@squadbase/vite-server 0.1.7-dev.2 → 0.1.7-dev.4
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 +114 -77
- package/dist/connectors/google-sheets.js +168 -101
- package/dist/index.js +114 -77
- package/dist/main.js +114 -77
- package/dist/vite-plugin.js +114 -77
- package/package.json +1 -1
package/dist/vite-plugin.js
CHANGED
|
@@ -72710,11 +72710,16 @@ var inputSchema27 = z27.object({
|
|
|
72710
72710
|
"Brief description of what you intend to accomplish with this tool call"
|
|
72711
72711
|
),
|
|
72712
72712
|
connectionId: z27.string().describe("ID of the Google Sheets connection to use"),
|
|
72713
|
-
method: z27.enum(["GET"]).describe(
|
|
72713
|
+
method: z27.enum(["GET", "POST", "PUT"]).describe(
|
|
72714
|
+
"HTTP method. GET for reads, PUT for values.update, POST for values.append / values:batchUpdate / values:batchGet / values:clear / values:batchClear."
|
|
72715
|
+
),
|
|
72714
72716
|
path: z27.string().describe(
|
|
72715
|
-
"API path appended to https://sheets.googleapis.com/v4/spreadsheets (e.g., '/
|
|
72717
|
+
"API path appended to https://sheets.googleapis.com/v4/spreadsheets. The caller must provide the target spreadsheetId explicitly in the path (e.g., '/1AbCxyz...', '/1AbCxyz.../values/Sheet1!A1:D10')."
|
|
72716
72718
|
),
|
|
72717
|
-
queryParams: z27.record(z27.string(), z27.string()).optional().describe("Query parameters to append to the URL")
|
|
72719
|
+
queryParams: z27.record(z27.string(), z27.string()).optional().describe("Query parameters to append to the URL"),
|
|
72720
|
+
body: z27.unknown().optional().describe(
|
|
72721
|
+
"Request body for POST/PUT. Will be JSON-serialized. Omit for GET."
|
|
72722
|
+
)
|
|
72718
72723
|
});
|
|
72719
72724
|
var outputSchema27 = z27.discriminatedUnion("success", [
|
|
72720
72725
|
z27.object({
|
|
@@ -72729,12 +72734,13 @@ var outputSchema27 = z27.discriminatedUnion("success", [
|
|
|
72729
72734
|
]);
|
|
72730
72735
|
var requestTool9 = new ConnectorTool({
|
|
72731
72736
|
name: "request",
|
|
72732
|
-
description: `Send authenticated
|
|
72733
|
-
|
|
72737
|
+
description: `Send authenticated requests to the Google Sheets API v4.
|
|
72738
|
+
Supports GET (read) and POST/PUT (write: update/append/batchUpdate/clear).
|
|
72739
|
+
The caller must include the target spreadsheetId in the path explicitly.
|
|
72734
72740
|
Authentication is handled automatically via OAuth proxy.`,
|
|
72735
72741
|
inputSchema: inputSchema27,
|
|
72736
72742
|
outputSchema: outputSchema27,
|
|
72737
|
-
async execute({ connectionId, method, path: path4, queryParams }, connections, config) {
|
|
72743
|
+
async execute({ connectionId, method, path: path4, queryParams, body }, connections, config) {
|
|
72738
72744
|
const connection = connections.find((c6) => c6.id === connectionId);
|
|
72739
72745
|
if (!connection) {
|
|
72740
72746
|
return {
|
|
@@ -72756,16 +72762,17 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
72756
72762
|
const controller = new AbortController();
|
|
72757
72763
|
const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS17);
|
|
72758
72764
|
try {
|
|
72765
|
+
const proxyBody = { url, method };
|
|
72766
|
+
if (body !== void 0 && method !== "GET") {
|
|
72767
|
+
proxyBody.body = body;
|
|
72768
|
+
}
|
|
72759
72769
|
const response = await fetch(proxyUrl, {
|
|
72760
72770
|
method: "POST",
|
|
72761
72771
|
headers: {
|
|
72762
72772
|
"Content-Type": "application/json",
|
|
72763
72773
|
Authorization: `Bearer ${token}`
|
|
72764
72774
|
},
|
|
72765
|
-
body: JSON.stringify(
|
|
72766
|
-
url,
|
|
72767
|
-
method
|
|
72768
|
-
}),
|
|
72775
|
+
body: JSON.stringify(proxyBody),
|
|
72769
72776
|
signal: controller.signal
|
|
72770
72777
|
});
|
|
72771
72778
|
const data = await response.json();
|
|
@@ -72788,52 +72795,50 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
72788
72795
|
var requestToolName = `google-sheets-oauth_${requestTool9.name}`;
|
|
72789
72796
|
var googleSheetsOnboarding = new ConnectorOnboarding({
|
|
72790
72797
|
connectionSetupInstructions: {
|
|
72791
|
-
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\
|
|
72798
|
+
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\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306F\u8AAD\u307F\u66F8\u304D\u53EF\u80FD\u306A\u30B9\u30B3\u30FC\u30D7 (\`spreadsheets\`) \u3067\u63A5\u7D9A\u3055\u308C\u3001OAuth\u8A8D\u8A3C\u3057\u305FGoogle\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u6A29\u9650\u3092\u6301\u3064\u4EFB\u610F\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306B\u5BFE\u3057\u3066\u8AAD\u307F\u66F8\u304D\u3067\u304D\u307E\u3059\u3002
|
|
72792
72799
|
|
|
72793
|
-
1. \`askUserQuestion\` \u3067\
|
|
72800
|
+
1. \`askUserQuestion\` \u3067\u64CD\u4F5C\u5BFE\u8C61\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8URL\u3092\u30D2\u30A2\u30EA\u30F3\u30B0\u3059\u308B:
|
|
72794
72801
|
- \`type\`: \`"freeText"\`
|
|
72795
|
-
- \`question\`: \u300C\
|
|
72802
|
+
- \`question\`: \u300C\u64CD\u4F5C\u3057\u305F\u3044Google Sheets\u306EURL\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\uFF08\u8AAD\u307F\u53D6\u308A\u30FB\u7DE8\u96C6\u3069\u3061\u3089\u3082\u53EF\u80FD\u3067\u3059\uFF09\u300D
|
|
72796
72803
|
- \`placeholder\`: \`"https://docs.google.com/spreadsheets/d/.../edit"\`
|
|
72797
72804
|
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
|
|
72798
|
-
3. \
|
|
72799
|
-
- \`parameterSlug\`: \`"spreadsheet-id"\`
|
|
72800
|
-
- \`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
|
|
72801
|
-
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:
|
|
72805
|
+
3. \`${requestToolName}\` \u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u6027\u3092\u78BA\u8A8D\u3059\u308B:
|
|
72802
72806
|
- \`method\`: \`"GET"\`
|
|
72803
|
-
- \`path\`: \`"
|
|
72804
|
-
|
|
72805
|
-
|
|
72806
|
-
|
|
72807
|
+
- \`path\`: \`"/<\u62BD\u51FA\u3057\u305FspreadsheetId>"\`
|
|
72808
|
+
4. **\u691C\u8A3C\u5931\u6557\u6642\u306E\u518D\u30D2\u30A2\u30EA\u30F3\u30B0**: \u30B9\u30C6\u30C3\u30D73\u304C \`success: false\` \u3092\u8FD4\u3057\u305F\u5834\u5408\uFF08404/403/\u898B\u3064\u304B\u3089\u306A\u3044\u7B49\uFF09\u3001\u4EE5\u4E0B\u306E\u624B\u9806\u3067\u518D\u8A66\u884C\u3059\u308B:
|
|
72809
|
+
a. \u30E6\u30FC\u30B6\u30FC\u306B\u539F\u56E0\u306E\u53EF\u80FD\u6027\u3092\u4F1D\u3048\u308B\uFF08URL\u304C\u9593\u9055\u3063\u3066\u3044\u308B\u3001OAuth\u9023\u643A\u3057\u305FGoogle\u30A2\u30AB\u30A6\u30F3\u30C8\u306B\u30A2\u30AF\u30BB\u30B9\u6A29\u9650\u304C\u306A\u3044\u3001\u30D7\u30E9\u30A4\u30D9\u30FC\u30C8\u30B7\u30FC\u30C8\u3067\u5225\u30A2\u30AB\u30A6\u30F3\u30C8\u3068\u5171\u6709\u3055\u308C\u3066\u3044\u308B \u7B49\uFF09
|
|
72810
|
+
b. \`askUserQuestion\` \u3067\u3082\u3046\u4E00\u5EA6URL\u3092\u805E\u304D\u76F4\u3057\u3001\u518D\u5EA6 \`${requestToolName}\` \u3067\u691C\u8A3C
|
|
72811
|
+
c. \u6210\u529F\u3059\u308B\u307E\u3067\uFF08\u307E\u305F\u306F\u30E6\u30FC\u30B6\u30FC\u304C\u4E2D\u65AD\u3059\u308B\u307E\u3067\uFF09\u3053\u306E\u30EB\u30FC\u30D7\u3092\u7E70\u308A\u8FD4\u3059
|
|
72807
72812
|
|
|
72808
72813
|
#### \u5236\u7D04
|
|
72809
|
-
- **\
|
|
72814
|
+
- **\u63A5\u7D9A\u8A2D\u5B9A\u4E2D\u306F\u5927\u91CF\u306E\u30BB\u30EB\u5024\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
|
|
72815
|
+
- **\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3092\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u30D1\u30E9\u30E1\u30FC\u30BF\u3068\u3057\u3066\u4FDD\u5B58\u3057\u306A\u3044**\u3002\u30CF\u30F3\u30C9\u30E9\u5074\u306E\u30B3\u30FC\u30C9\uFF08\`server-logic\`\uFF09\u306B\u5BFE\u8C61\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3092\u76F4\u63A5\u6E21\u3059\u8A2D\u8A08\u306B\u306A\u3063\u3066\u3044\u308B\u305F\u3081\u3001\`updateConnectionParameters\` \u306F\u547C\u3070\u306A\u3044\u3053\u3068
|
|
72810
72816
|
- \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`,
|
|
72811
|
-
en: `Follow these steps to set up the Google Sheets (OAuth) connection.
|
|
72817
|
+
en: `Follow these steps to set up the Google Sheets (OAuth) connection. This connector uses the read/write \`spreadsheets\` scope, so it can read and edit any spreadsheet the authenticated Google account has access to.
|
|
72812
72818
|
|
|
72813
|
-
1. Call \`askUserQuestion\` to ask for the spreadsheet URL to
|
|
72819
|
+
1. Call \`askUserQuestion\` to ask for the spreadsheet URL the user wants to work with:
|
|
72814
72820
|
- \`type\`: \`"freeText"\`
|
|
72815
|
-
- \`question\`: "Please paste the URL of the Google Sheet you want to
|
|
72821
|
+
- \`question\`: "Please paste the URL of the Google Sheet you want to work with (both read and edit are supported)."
|
|
72816
72822
|
- \`placeholder\`: \`"https://docs.google.com/spreadsheets/d/.../edit"\`
|
|
72817
72823
|
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.
|
|
72818
|
-
3.
|
|
72819
|
-
- \`parameterSlug\`: \`"spreadsheet-id"\`
|
|
72820
|
-
- \`options\`: \`[{ value: <extracted ID>, label: <same value> }]\` (a single option is auto-selected)
|
|
72821
|
-
4. Verify access by calling \`${requestToolName}\`:
|
|
72824
|
+
3. Verify accessibility by calling \`${requestToolName}\`:
|
|
72822
72825
|
- \`method\`: \`"GET"\`
|
|
72823
|
-
- \`path\`: \`"
|
|
72824
|
-
|
|
72825
|
-
|
|
72826
|
-
-
|
|
72826
|
+
- \`path\`: \`"/<extracted spreadsheetId>"\`
|
|
72827
|
+
4. **Retry on verification failure**: If step 3 returns \`success: false\` (404/403/not found or any other error):
|
|
72828
|
+
a. Tell the user the likely causes (wrong URL, OAuth-connected Google account lacks access, private sheet shared with a different account, etc.)
|
|
72829
|
+
b. Call \`askUserQuestion\` again to re-ask for the URL and re-verify with \`${requestToolName}\`
|
|
72830
|
+
c. Repeat until verification succeeds (or the user aborts)
|
|
72827
72831
|
|
|
72828
72832
|
#### Constraints
|
|
72829
|
-
- **Do NOT
|
|
72830
|
-
-
|
|
72833
|
+
- **Do NOT fetch large amounts of cell data during setup**. Only the metadata request specified above is allowed.
|
|
72834
|
+
- **Do NOT persist the spreadsheet ID as a connection parameter.** The handler-side code (\`server-logic\`) is designed to receive the target spreadsheet ID directly, so do NOT call \`updateConnectionParameters\`.
|
|
72835
|
+
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently.`
|
|
72831
72836
|
},
|
|
72832
72837
|
dataOverviewInstructions: {
|
|
72833
|
-
en: `1. Call ${requestToolName} with GET
|
|
72834
|
-
2. For each sheet of interest, call ${requestToolName} with GET
|
|
72835
|
-
ja: `1. ${requestToolName} \u3067 GET
|
|
72836
|
-
2. \u4E3B\u8981\u306A\u30B7\u30FC\u30C8\u306B\u3064\u3044\u3066 ${requestToolName} \u3067 GET
|
|
72838
|
+
en: `1. Call ${requestToolName} with GET /<spreadsheetId> to fetch spreadsheet metadata (sheet names, grid properties)
|
|
72839
|
+
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`,
|
|
72840
|
+
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
|
|
72841
|
+
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`
|
|
72837
72842
|
}
|
|
72838
72843
|
});
|
|
72839
72844
|
|
|
@@ -72856,7 +72861,7 @@ var googleSheetsConnector = new ConnectorPlugin({
|
|
|
72856
72861
|
slug: "google-sheets",
|
|
72857
72862
|
authType: AUTH_TYPES.OAUTH,
|
|
72858
72863
|
name: "Google Sheets",
|
|
72859
|
-
description: "Connect to
|
|
72864
|
+
description: "Connect to Google Sheets for read/write access via OAuth. Any spreadsheet the authenticated Google account can access is supported \u2014 the target spreadsheetId is passed per call.",
|
|
72860
72865
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1UPQuggyiZmbb26CuaSr2h/032770e8739b183fa00b7625f024e536/google-sheets.svg",
|
|
72861
72866
|
parameters: parameters18,
|
|
72862
72867
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
@@ -72865,25 +72870,33 @@ var googleSheetsConnector = new ConnectorPlugin({
|
|
|
72865
72870
|
allowlist: [
|
|
72866
72871
|
{
|
|
72867
72872
|
host: "sheets.googleapis.com",
|
|
72868
|
-
methods: ["GET"]
|
|
72873
|
+
methods: ["GET", "POST", "PUT"]
|
|
72869
72874
|
}
|
|
72870
72875
|
]
|
|
72871
72876
|
},
|
|
72872
72877
|
systemPrompt: {
|
|
72873
72878
|
en: `### Tools (setup-time only)
|
|
72874
72879
|
|
|
72875
|
-
- \`google-sheets-oauth_request\`: Call the Google Sheets API during setup / data overview.
|
|
72880
|
+
- \`google-sheets-oauth_request\`: Call the Google Sheets API during setup / data overview. Supports GET, POST, and PUT. The caller must include the target spreadsheetId in the path explicitly (e.g., \`/1AbCxyz...\`, \`/1AbCxyz.../values/Sheet1!A1:D10\`). Authentication is configured automatically via OAuth.
|
|
72876
72881
|
|
|
72877
|
-
> **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.
|
|
72882
|
+
> **Important**: The \`google-sheets-oauth_request\` tool is only available at setup time. Inside server-logic handlers, use the SDK (\`connection(id).getValues(spreadsheetId, range)\`, 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.
|
|
72878
72883
|
|
|
72879
|
-
> **Connection scope**:
|
|
72884
|
+
> **Connection scope**: The OAuth scope is \`spreadsheets\` (read/write). A connection is NOT bound to a single spreadsheet \u2014 the target spreadsheetId is passed per call. The spreadsheetId is NOT stored as a connection parameter or environment variable; pass it explicitly from the caller (e.g., as a query param or request input to the handler).
|
|
72880
72885
|
|
|
72881
|
-
### Google Sheets API Reference
|
|
72886
|
+
### Google Sheets API Reference
|
|
72882
72887
|
|
|
72888
|
+
Reads:
|
|
72883
72889
|
- GET \`/{spreadsheetId}\` \u2014 Get spreadsheet metadata (title, sheets, properties)
|
|
72884
72890
|
- GET \`/{spreadsheetId}/values/{range}\` \u2014 Get cell values for a range
|
|
72885
72891
|
- GET \`/{spreadsheetId}/values:batchGet?ranges={range1}&ranges={range2}\` \u2014 Get values for multiple ranges
|
|
72886
72892
|
|
|
72893
|
+
Writes:
|
|
72894
|
+
- PUT \`/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED\` \u2014 Overwrite a range (body: \`{ range, majorDimension, values }\`)
|
|
72895
|
+
- POST \`/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED\` \u2014 Append rows after the existing data
|
|
72896
|
+
- POST \`/{spreadsheetId}/values/{range}:clear\` \u2014 Clear values in a range
|
|
72897
|
+
- POST \`/{spreadsheetId}/values:batchUpdate\` \u2014 Batch update / batch clear
|
|
72898
|
+
- POST \`/{spreadsheetId}:batchUpdate\` \u2014 Structural edits (addSheet, deleteSheet, updateCells, formatting, \u2026)
|
|
72899
|
+
|
|
72887
72900
|
### Range Notation (A1 notation)
|
|
72888
72901
|
- \`Sheet1!A1:D10\` \u2014 Specific range on Sheet1
|
|
72889
72902
|
- \`Sheet1!A:A\` \u2014 Entire column A on Sheet1
|
|
@@ -72893,20 +72906,24 @@ var googleSheetsConnector = new ConnectorPlugin({
|
|
|
72893
72906
|
|
|
72894
72907
|
### Tips
|
|
72895
72908
|
- To explore a spreadsheet, first get metadata to see available sheet names
|
|
72909
|
+
- Use \`valueInputOption=USER_ENTERED\` to parse formulas/dates like the UI; use \`RAW\` to store inputs literally
|
|
72896
72910
|
- Use \`valueRenderOption=FORMATTED_VALUE\` query param to get display values
|
|
72897
72911
|
- Use \`valueRenderOption=UNFORMATTED_VALUE\` for raw numeric values
|
|
72898
72912
|
- Use \`majorDimension=COLUMNS\` to get data organized by columns instead of rows
|
|
72899
72913
|
|
|
72900
72914
|
### Business Logic
|
|
72901
72915
|
|
|
72902
|
-
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
|
|
72916
|
+
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 target spreadsheetId is NOT stored on the connection \u2014 the handler caller must pass it (as part of the request input).
|
|
72903
72917
|
|
|
72904
72918
|
SDK surface (client created via \`connection(connectionId)\`):
|
|
72905
|
-
- \`client.
|
|
72906
|
-
- \`client.
|
|
72907
|
-
- \`client.
|
|
72908
|
-
- \`client.
|
|
72909
|
-
- \`client.
|
|
72919
|
+
- \`client.request(path, init?)\` \u2014 low-level authenticated fetch (\`path\` is appended to \`https://sheets.googleapis.com/v4/spreadsheets\`; the caller must include the target spreadsheetId).
|
|
72920
|
+
- \`client.getSpreadsheet(spreadsheetId)\` \u2014 fetch spreadsheet metadata.
|
|
72921
|
+
- \`client.getValues(spreadsheetId, range)\` \u2014 read a range (A1 notation).
|
|
72922
|
+
- \`client.batchGetValues(spreadsheetId, ranges)\` \u2014 read multiple ranges.
|
|
72923
|
+
- \`client.updateValues(spreadsheetId, range, values, valueInputOption?)\` \u2014 overwrite a range (requires write scope).
|
|
72924
|
+
- \`client.appendValues(spreadsheetId, range, values, valueInputOption?)\` \u2014 append rows (requires write scope).
|
|
72925
|
+
- \`client.clearValues(spreadsheetId, range)\` \u2014 clear a range (requires write scope).
|
|
72926
|
+
- \`client.batchUpdate(spreadsheetId, requests)\` \u2014 structural edits (requires write scope).
|
|
72910
72927
|
|
|
72911
72928
|
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.
|
|
72912
72929
|
|
|
@@ -72916,32 +72933,44 @@ If a handler test fails with \`Connection proxy is not configured\`, retry \u201
|
|
|
72916
72933
|
import { connection } from "@squadbase/vite-server/connectors/google-sheets";
|
|
72917
72934
|
|
|
72918
72935
|
const sheets = connection("<connectionId>");
|
|
72936
|
+
const spreadsheetId = "<passed from request input>";
|
|
72919
72937
|
|
|
72920
|
-
//
|
|
72921
|
-
const metadata = await sheets.getSpreadsheet();
|
|
72922
|
-
|
|
72938
|
+
// Read: metadata and values
|
|
72939
|
+
const metadata = await sheets.getSpreadsheet(spreadsheetId);
|
|
72940
|
+
const values = await sheets.getValues(spreadsheetId, "Sheet1!A1:D10");
|
|
72923
72941
|
|
|
72924
|
-
//
|
|
72925
|
-
|
|
72926
|
-
|
|
72942
|
+
// Write: overwrite, append, clear
|
|
72943
|
+
await sheets.updateValues(spreadsheetId, "Sheet1!A1:B2", [["name", "age"], ["Alice", 30]]);
|
|
72944
|
+
await sheets.appendValues(spreadsheetId, "Sheet1!A:B", [["Bob", 25]]);
|
|
72945
|
+
await sheets.clearValues(spreadsheetId, "Sheet1!A1:B10");
|
|
72927
72946
|
|
|
72928
|
-
//
|
|
72929
|
-
|
|
72947
|
+
// Structural edits (add a sheet)
|
|
72948
|
+
await sheets.batchUpdate(spreadsheetId, [
|
|
72949
|
+
{ addSheet: { properties: { title: "NewSheet" } } },
|
|
72950
|
+
]);
|
|
72930
72951
|
\`\`\``,
|
|
72931
72952
|
ja: `### \u30C4\u30FC\u30EB\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\uFF09
|
|
72932
72953
|
|
|
72933
|
-
- \`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\
|
|
72954
|
+
- \`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\u3002GET / POST / PUT \u3092\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\u547C\u3073\u51FA\u3057\u5074\u304C\u30D1\u30B9\u306B\u5BFE\u8C61\u306E spreadsheetId \u3092\u660E\u793A\u7684\u306B\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF08\u4F8B: \`/1AbCxyz...\`\u3001\`/1AbCxyz.../values/Sheet1!A1:D10\`\uFF09\u3002OAuth \u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
72934
72955
|
|
|
72935
|
-
> **\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
|
|
72956
|
+
> **\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(spreadsheetId, range)\` \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
|
|
72936
72957
|
|
|
72937
|
-
> **\u63A5\u7D9A\u30B9\u30B3\u30FC\u30D7**: \
|
|
72958
|
+
> **\u63A5\u7D9A\u30B9\u30B3\u30FC\u30D7**: OAuth \u30B9\u30B3\u30FC\u30D7\u306F \`spreadsheets\`\uFF08\u8AAD\u307F\u66F8\u304D\u53EF\u80FD\uFF09\u3067\u3059\u3002\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306F\u5358\u4E00\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306B\u7D10\u3065\u304D\u307E\u305B\u3093 \u2014 \u5BFE\u8C61\u306E spreadsheetId \u306F\u547C\u3073\u51FA\u3057\u3054\u3068\u306B\u6E21\u3057\u307E\u3059\u3002spreadsheetId \u306F\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u30D1\u30E9\u30E1\u30FC\u30BF\u3084\u74B0\u5883\u5909\u6570\u3068\u3057\u3066\u4FDD\u5B58\u3055\u308C\u306A\u3044\u305F\u3081\u3001\u30CF\u30F3\u30C9\u30E9\u306E\u547C\u3073\u51FA\u3057\u5143\uFF08\u30EA\u30AF\u30A8\u30B9\u30C8\u5165\u529B\u306A\u3069\uFF09\u304B\u3089\u660E\u793A\u7684\u306B\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
72938
72959
|
|
|
72939
|
-
### Google Sheets API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
72960
|
+
### Google Sheets API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
72940
72961
|
|
|
72962
|
+
\u8AAD\u307F\u53D6\u308A:
|
|
72941
72963
|
- 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
|
|
72942
72964
|
- GET \`/{spreadsheetId}/values/{range}\` \u2014 \u7BC4\u56F2\u306E\u30BB\u30EB\u5024\u3092\u53D6\u5F97
|
|
72943
72965
|
- GET \`/{spreadsheetId}/values:batchGet?ranges={range1}&ranges={range2}\` \u2014 \u8907\u6570\u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97
|
|
72944
72966
|
|
|
72967
|
+
\u66F8\u304D\u8FBC\u307F:
|
|
72968
|
+
- PUT \`/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED\` \u2014 \u7BC4\u56F2\u3092\u4E0A\u66F8\u304D\uFF08body: \`{ range, majorDimension, values }\`\uFF09
|
|
72969
|
+
- POST \`/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED\` \u2014 \u65E2\u5B58\u30C7\u30FC\u30BF\u306E\u5F8C\u308D\u306B\u884C\u3092\u8FFD\u8A18
|
|
72970
|
+
- POST \`/{spreadsheetId}/values/{range}:clear\` \u2014 \u7BC4\u56F2\u306E\u5024\u3092\u30AF\u30EA\u30A2
|
|
72971
|
+
- POST \`/{spreadsheetId}/values:batchUpdate\` \u2014 \u30D0\u30C3\u30C1\u66F4\u65B0 / \u30D0\u30C3\u30C1\u30AF\u30EA\u30A2
|
|
72972
|
+
- POST \`/{spreadsheetId}:batchUpdate\` \u2014 \u69CB\u9020\u5909\u66F4\uFF08addSheet, deleteSheet, updateCells, \u66F8\u5F0F\u8A2D\u5B9A \u7B49\uFF09
|
|
72973
|
+
|
|
72945
72974
|
### \u7BC4\u56F2\u306E\u8868\u8A18\u6CD5\uFF08A1\u8868\u8A18\u6CD5\uFF09
|
|
72946
72975
|
- \`Sheet1!A1:D10\` \u2014 Sheet1\u4E0A\u306E\u7279\u5B9A\u7BC4\u56F2
|
|
72947
72976
|
- \`Sheet1!A:A\` \u2014 Sheet1\u306EA\u5217\u5168\u4F53
|
|
@@ -72951,20 +72980,24 @@ const batch = await sheets.batchGetValues(["Sheet1!A:A", "Sheet2!B2:C100"]);
|
|
|
72951
72980
|
|
|
72952
72981
|
### \u30D2\u30F3\u30C8
|
|
72953
72982
|
- \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u3092\u63A2\u7D22\u3059\u308B\u306B\u306F\u3001\u307E\u305A\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3057\u3066\u5229\u7528\u53EF\u80FD\u306A\u30B7\u30FC\u30C8\u540D\u3092\u78BA\u8A8D\u3057\u307E\u3059
|
|
72983
|
+
- \u6570\u5F0F\u3084\u65E5\u4ED8\u3092 UI \u3068\u540C\u3058\u3088\u3046\u306B\u89E3\u91C8\u3055\u305B\u308B\u306B\u306F \`valueInputOption=USER_ENTERED\`\u3001\u305D\u306E\u307E\u307E\u6587\u5B57\u5217\u3068\u3057\u3066\u4FDD\u5B58\u3059\u308B\u306B\u306F \`RAW\` \u3092\u4F7F\u3044\u307E\u3059
|
|
72954
72984
|
- \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
|
|
72955
72985
|
- \u751F\u306E\u6570\u5024\u3092\u53D6\u5F97\u3059\u308B\u306B\u306F \`valueRenderOption=UNFORMATTED_VALUE\` \u3092\u4F7F\u7528\u3057\u307E\u3059
|
|
72956
72986
|
- \u5217\u3054\u3068\u306B\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3059\u308B\u306B\u306F \`majorDimension=COLUMNS\` \u3092\u4F7F\u7528\u3057\u307E\u3059
|
|
72957
72987
|
|
|
72958
72988
|
### Business Logic
|
|
72959
72989
|
|
|
72960
|
-
\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\
|
|
72990
|
+
\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\u5BFE\u8C61 spreadsheetId \u306F\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306B\u4FDD\u5B58\u3055\u308C\u306A\u3044\u305F\u3081\u3001\u30CF\u30F3\u30C9\u30E9\u306E\u547C\u3073\u51FA\u3057\u5143\uFF08\u30EA\u30AF\u30A8\u30B9\u30C8\u5165\u529B\u306A\u3069\uFF09\u304B\u3089\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
72961
72991
|
|
|
72962
72992
|
SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF09:
|
|
72963
|
-
- \`client.
|
|
72964
|
-
- \`client.
|
|
72965
|
-
- \`client.
|
|
72966
|
-
- \`client.
|
|
72967
|
-
- \`client.
|
|
72993
|
+
- \`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\u547C\u3073\u51FA\u3057\u5074\u304C spreadsheetId \u3092\u542B\u3081\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF09\u3002
|
|
72994
|
+
- \`client.getSpreadsheet(spreadsheetId)\` \u2014 \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3002
|
|
72995
|
+
- \`client.getValues(spreadsheetId, range)\` \u2014 \u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97\uFF08A1 \u8868\u8A18\uFF09\u3002
|
|
72996
|
+
- \`client.batchGetValues(spreadsheetId, ranges)\` \u2014 \u8907\u6570\u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97\u3002
|
|
72997
|
+
- \`client.updateValues(spreadsheetId, range, values, valueInputOption?)\` \u2014 \u7BC4\u56F2\u3092\u4E0A\u66F8\u304D\uFF08\u66F8\u304D\u8FBC\u307F\u30B9\u30B3\u30FC\u30D7\u304C\u5FC5\u8981\uFF09\u3002
|
|
72998
|
+
- \`client.appendValues(spreadsheetId, range, values, valueInputOption?)\` \u2014 \u884C\u3092\u8FFD\u8A18\uFF08\u66F8\u304D\u8FBC\u307F\u30B9\u30B3\u30FC\u30D7\u304C\u5FC5\u8981\uFF09\u3002
|
|
72999
|
+
- \`client.clearValues(spreadsheetId, range)\` \u2014 \u7BC4\u56F2\u306E\u5024\u3092\u30AF\u30EA\u30A2\uFF08\u66F8\u304D\u8FBC\u307F\u30B9\u30B3\u30FC\u30D7\u304C\u5FC5\u8981\uFF09\u3002
|
|
73000
|
+
- \`client.batchUpdate(spreadsheetId, requests)\` \u2014 \u69CB\u9020\u5909\u66F4\uFF08\u66F8\u304D\u8FBC\u307F\u30B9\u30B3\u30FC\u30D7\u304C\u5FC5\u8981\uFF09\u3002
|
|
72968
73001
|
|
|
72969
73002
|
\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
|
|
72970
73003
|
|
|
@@ -72974,17 +73007,21 @@ SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9
|
|
|
72974
73007
|
import { connection } from "@squadbase/vite-server/connectors/google-sheets";
|
|
72975
73008
|
|
|
72976
73009
|
const sheets = connection("<connectionId>");
|
|
73010
|
+
const spreadsheetId = "<\u30EA\u30AF\u30A8\u30B9\u30C8\u5165\u529B\u304B\u3089\u53D7\u3051\u53D6\u308B>";
|
|
72977
73011
|
|
|
72978
|
-
// \
|
|
72979
|
-
const metadata = await sheets.getSpreadsheet();
|
|
72980
|
-
|
|
73012
|
+
// \u8AAD\u307F\u53D6\u308A: \u30E1\u30BF\u30C7\u30FC\u30BF\u3068\u5024
|
|
73013
|
+
const metadata = await sheets.getSpreadsheet(spreadsheetId);
|
|
73014
|
+
const values = await sheets.getValues(spreadsheetId, "Sheet1!A1:D10");
|
|
72981
73015
|
|
|
72982
|
-
// \
|
|
72983
|
-
|
|
72984
|
-
|
|
73016
|
+
// \u66F8\u304D\u8FBC\u307F: \u4E0A\u66F8\u304D\u30FB\u8FFD\u8A18\u30FB\u30AF\u30EA\u30A2
|
|
73017
|
+
await sheets.updateValues(spreadsheetId, "Sheet1!A1:B2", [["name", "age"], ["Alice", 30]]);
|
|
73018
|
+
await sheets.appendValues(spreadsheetId, "Sheet1!A:B", [["Bob", 25]]);
|
|
73019
|
+
await sheets.clearValues(spreadsheetId, "Sheet1!A1:B10");
|
|
72985
73020
|
|
|
72986
|
-
// \
|
|
72987
|
-
|
|
73021
|
+
// \u69CB\u9020\u5909\u66F4\uFF08\u30B7\u30FC\u30C8\u3092\u8FFD\u52A0\uFF09
|
|
73022
|
+
await sheets.batchUpdate(spreadsheetId, [
|
|
73023
|
+
{ addSheet: { properties: { title: "NewSheet" } } },
|
|
73024
|
+
]);
|
|
72988
73025
|
\`\`\``
|
|
72989
73026
|
},
|
|
72990
73027
|
tools: tools18
|