@squadbase/vite-server 0.1.3-dev.17 → 0.1.3-dev.18
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 +302 -98
- package/dist/connectors/airtable-oauth.js +27 -1
- package/dist/connectors/airtable.js +27 -1
- package/dist/connectors/amplitude.js +27 -1
- package/dist/connectors/anthropic.js +27 -1
- package/dist/connectors/asana.js +27 -1
- package/dist/connectors/attio.js +27 -1
- package/dist/connectors/backlog-api-key.js +27 -1
- package/dist/connectors/customerio.js +27 -1
- package/dist/connectors/dbt.js +27 -1
- package/dist/connectors/gamma.js +27 -1
- package/dist/connectors/gemini.js +27 -1
- package/dist/connectors/gmail-oauth.js +49 -3
- package/dist/connectors/gmail.js +36 -10
- package/dist/connectors/google-ads.js +56 -12
- package/dist/connectors/google-analytics-oauth.js +45 -3
- package/dist/connectors/google-analytics.js +33 -7
- package/dist/connectors/google-calendar-oauth.js +45 -3
- package/dist/connectors/google-calendar.js +45 -15
- package/dist/connectors/google-docs.js +58 -12
- package/dist/connectors/google-drive.js +69 -11
- package/dist/connectors/google-sheets.js +63 -11
- package/dist/connectors/google-slides.js +65 -13
- package/dist/connectors/grafana.js +27 -1
- package/dist/connectors/hubspot-oauth.js +27 -1
- package/dist/connectors/hubspot.js +27 -1
- package/dist/connectors/intercom-oauth.js +27 -1
- package/dist/connectors/intercom.js +27 -1
- package/dist/connectors/jira-api-key.js +27 -1
- package/dist/connectors/kintone-api-token.js +35 -9
- package/dist/connectors/kintone.js +27 -1
- package/dist/connectors/linkedin-ads.js +27 -1
- package/dist/connectors/mailchimp-oauth.js +27 -1
- package/dist/connectors/mailchimp.js +27 -1
- package/dist/connectors/mixpanel.js +27 -1
- package/dist/connectors/notion-oauth.js +27 -1
- package/dist/connectors/notion.js +27 -1
- package/dist/connectors/openai.js +27 -1
- package/dist/connectors/sentry.js +27 -1
- package/dist/connectors/shopify-oauth.js +27 -1
- package/dist/connectors/shopify.js +27 -1
- package/dist/connectors/stripe-api-key.js +27 -1
- package/dist/connectors/stripe-oauth.js +27 -1
- package/dist/connectors/wix-store.js +27 -1
- package/dist/connectors/zendesk-oauth.js +27 -1
- package/dist/connectors/zendesk.js +27 -1
- package/dist/index.js +302 -98
- package/dist/main.js +302 -98
- package/dist/vite-plugin.js +302 -98
- package/package.json +1 -1
|
@@ -245,7 +245,33 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
245
245
|
return result;
|
|
246
246
|
}
|
|
247
247
|
static deriveKey(slug, authType) {
|
|
248
|
-
|
|
248
|
+
if (authType) return `${slug}-${authType}`;
|
|
249
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
250
|
+
// user-password
|
|
251
|
+
"postgresql": "user-password",
|
|
252
|
+
"mysql": "user-password",
|
|
253
|
+
"clickhouse": "user-password",
|
|
254
|
+
"kintone": "user-password",
|
|
255
|
+
"squadbase-db": "user-password",
|
|
256
|
+
// service-account
|
|
257
|
+
"snowflake": "service-account",
|
|
258
|
+
"bigquery": "service-account",
|
|
259
|
+
"google-analytics": "service-account",
|
|
260
|
+
"google-calendar": "service-account",
|
|
261
|
+
"aws-athena": "service-account",
|
|
262
|
+
"redshift": "service-account",
|
|
263
|
+
// api-key
|
|
264
|
+
"databricks": "api-key",
|
|
265
|
+
"dbt": "api-key",
|
|
266
|
+
"airtable": "api-key",
|
|
267
|
+
"openai": "api-key",
|
|
268
|
+
"gemini": "api-key",
|
|
269
|
+
"anthropic": "api-key",
|
|
270
|
+
"wix-store": "api-key"
|
|
271
|
+
};
|
|
272
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
273
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
274
|
+
return slug;
|
|
249
275
|
}
|
|
250
276
|
};
|
|
251
277
|
|
|
@@ -416,7 +442,7 @@ var listCustomersTool = new ConnectorTool({
|
|
|
416
442
|
});
|
|
417
443
|
|
|
418
444
|
// ../connectors/src/connectors/google-ads/setup.ts
|
|
419
|
-
var listCustomersToolName = `google-
|
|
445
|
+
var listCustomersToolName = `google-ads-oauth_${listCustomersTool.name}`;
|
|
420
446
|
var googleAdsOnboarding = new ConnectorOnboarding({
|
|
421
447
|
connectionSetupInstructions: {
|
|
422
448
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Ads (OAuth) \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
@@ -459,9 +485,9 @@ var googleAdsOnboarding = new ConnectorOnboarding({
|
|
|
459
485
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
460
486
|
},
|
|
461
487
|
dataOverviewInstructions: {
|
|
462
|
-
en: `1. Call google-
|
|
488
|
+
en: `1. Call google-ads-oauth_request with POST customers/{customerId}/googleAds:searchStream to explore available campaign data using GAQL: SELECT campaign.id, campaign.name, campaign.status FROM campaign LIMIT 10
|
|
463
489
|
2. Explore ad group and keyword data as needed to understand the data structure`,
|
|
464
|
-
ja: `1. google-
|
|
490
|
+
ja: `1. google-ads-oauth_request \u3067 POST customers/{customerId}/googleAds:searchStream \u3092\u547C\u3073\u51FA\u3057\u3001GAQL\u3067\u30AD\u30E3\u30F3\u30DA\u30FC\u30F3\u30C7\u30FC\u30BF\u3092\u63A2\u7D22: SELECT campaign.id, campaign.name, campaign.status FROM campaign LIMIT 10
|
|
465
491
|
2. \u5FC5\u8981\u306B\u5FDC\u3058\u3066\u5E83\u544A\u30B0\u30EB\u30FC\u30D7\u3084\u30AD\u30FC\u30EF\u30FC\u30C9\u30C7\u30FC\u30BF\u3092\u63A2\u7D22\u3057\u3001\u30C7\u30FC\u30BF\u69CB\u9020\u3092\u628A\u63E1`
|
|
466
492
|
}
|
|
467
493
|
});
|
|
@@ -610,10 +636,12 @@ var googleAdsConnector = new ConnectorPlugin({
|
|
|
610
636
|
]
|
|
611
637
|
},
|
|
612
638
|
systemPrompt: {
|
|
613
|
-
en: `### Tools
|
|
639
|
+
en: `### Tools (setup-time only)
|
|
640
|
+
|
|
641
|
+
- \`google-ads-oauth_request\`: Send authenticated requests to the Google Ads API during setup / data overview. Use it for GAQL queries via searchStream. The {customerId} placeholder in paths is automatically replaced (hyphens removed). Authentication and developer token are configured automatically.
|
|
642
|
+
- \`google-ads-oauth_listCustomers\`: List accessible Google Ads customer accounts. Use this during setup to discover available accounts.
|
|
614
643
|
|
|
615
|
-
|
|
616
|
-
- \`google-ads_listCustomers\`: List accessible Google Ads customer accounts. Use this during setup to discover available accounts.
|
|
644
|
+
> **Important**: These tools are only available at setup time. Inside server-logic handlers, use the SDK (\`connection(id).search\`, 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.
|
|
617
645
|
|
|
618
646
|
### Google Ads API Reference
|
|
619
647
|
|
|
@@ -645,7 +673,14 @@ segments.date, segments.device, segments.ad_network_type
|
|
|
645
673
|
|
|
646
674
|
### Business Logic
|
|
647
675
|
|
|
648
|
-
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.
|
|
676
|
+
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.
|
|
677
|
+
|
|
678
|
+
SDK surface (client created via \`connection(connectionId)\`):
|
|
679
|
+
- \`client.request(path, init?)\` \u2014 low-level authenticated fetch. \`{customerId}\` placeholders in the path are auto-replaced with the configured customer id.
|
|
680
|
+
- \`client.search(query, customerId?)\` \u2014 execute a GAQL query via searchStream and get rows back.
|
|
681
|
+
- \`client.listAccessibleCustomers()\` \u2014 return the list of customer IDs the OAuth user can access.
|
|
682
|
+
|
|
683
|
+
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.
|
|
649
684
|
|
|
650
685
|
#### Example
|
|
651
686
|
|
|
@@ -663,10 +698,12 @@ rows.forEach(row => console.log(row));
|
|
|
663
698
|
// List accessible customer accounts
|
|
664
699
|
const customerIds = await ads.listAccessibleCustomers();
|
|
665
700
|
\`\`\``,
|
|
666
|
-
ja: `### \u30C4\u30FC\u30EB
|
|
701
|
+
ja: `### \u30C4\u30FC\u30EB\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\uFF09
|
|
667
702
|
|
|
668
|
-
- \`google-
|
|
669
|
-
- \`google-
|
|
703
|
+
- \`google-ads-oauth_request\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3084\u30C7\u30FC\u30BF\u6982\u8981\u628A\u63E1\u6642\u306B Google Ads API \u3078\u8A8D\u8A3C\u6E08\u307F\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u9001\u4FE1\u3057\u307E\u3059\u3002searchStream \u3092\u4F7F\u3063\u305F GAQL \u30AF\u30A8\u30EA\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E {customerId} \u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\uFF08\u30CF\u30A4\u30D5\u30F3\u306F\u9664\u53BB\uFF09\u3002\u8A8D\u8A3C\u3068\u30C7\u30D9\u30ED\u30C3\u30D1\u30FC\u30C8\u30FC\u30AF\u30F3\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
704
|
+
- \`google-ads-oauth_listCustomers\`: \u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A Google Ads \u9867\u5BA2\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u4E00\u89A7\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u5229\u7528\u53EF\u80FD\u306A\u30A2\u30AB\u30A6\u30F3\u30C8\u3092\u78BA\u8A8D\u3059\u308B\u305F\u3081\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002
|
|
705
|
+
|
|
706
|
+
> **\u91CD\u8981**: \u3053\u308C\u3089\u306E\u30C4\u30FC\u30EB\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).search\` \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
|
|
670
707
|
|
|
671
708
|
### Google Ads API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
672
709
|
|
|
@@ -698,7 +735,14 @@ segments.date, segments.device, segments.ad_network_type
|
|
|
698
735
|
|
|
699
736
|
### Business Logic
|
|
700
737
|
|
|
701
|
-
\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\
|
|
738
|
+
\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
|
|
739
|
+
|
|
740
|
+
SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF09:
|
|
741
|
+
- \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304D fetch\u3002\u30D1\u30B9\u5185\u306E \`{customerId}\` \u306F\u81EA\u52D5\u7684\u306B\u8A2D\u5B9A\u6E08\u307F\u30AB\u30B9\u30BF\u30DE\u30FC ID \u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002
|
|
742
|
+
- \`client.search(query, customerId?)\` \u2014 GAQL \u30AF\u30A8\u30EA\u3092 searchStream \u3067\u5B9F\u884C\u3057\u3001\u884C\u3092\u53D6\u5F97\u3002
|
|
743
|
+
- \`client.listAccessibleCustomers()\` \u2014 OAuth \u30E6\u30FC\u30B6\u30FC\u304C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30AB\u30B9\u30BF\u30DE\u30FC ID \u4E00\u89A7\u3092\u53D6\u5F97\u3002
|
|
744
|
+
|
|
745
|
+
\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
|
|
702
746
|
|
|
703
747
|
#### Example
|
|
704
748
|
|
|
@@ -242,7 +242,33 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
242
242
|
return result;
|
|
243
243
|
}
|
|
244
244
|
static deriveKey(slug, authType) {
|
|
245
|
-
|
|
245
|
+
if (authType) return `${slug}-${authType}`;
|
|
246
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
247
|
+
// user-password
|
|
248
|
+
"postgresql": "user-password",
|
|
249
|
+
"mysql": "user-password",
|
|
250
|
+
"clickhouse": "user-password",
|
|
251
|
+
"kintone": "user-password",
|
|
252
|
+
"squadbase-db": "user-password",
|
|
253
|
+
// service-account
|
|
254
|
+
"snowflake": "service-account",
|
|
255
|
+
"bigquery": "service-account",
|
|
256
|
+
"google-analytics": "service-account",
|
|
257
|
+
"google-calendar": "service-account",
|
|
258
|
+
"aws-athena": "service-account",
|
|
259
|
+
"redshift": "service-account",
|
|
260
|
+
// api-key
|
|
261
|
+
"databricks": "api-key",
|
|
262
|
+
"dbt": "api-key",
|
|
263
|
+
"airtable": "api-key",
|
|
264
|
+
"openai": "api-key",
|
|
265
|
+
"gemini": "api-key",
|
|
266
|
+
"anthropic": "api-key",
|
|
267
|
+
"wix-store": "api-key"
|
|
268
|
+
};
|
|
269
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
270
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
271
|
+
return slug;
|
|
246
272
|
}
|
|
247
273
|
};
|
|
248
274
|
|
|
@@ -723,7 +749,15 @@ averageSessionDuration, conversions, totalRevenue
|
|
|
723
749
|
|
|
724
750
|
### Business Logic
|
|
725
751
|
|
|
726
|
-
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.
|
|
752
|
+
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.
|
|
753
|
+
|
|
754
|
+
SDK surface (client created via \`connection(connectionId)\`):
|
|
755
|
+
- \`client.request(path, init?)\` \u2014 low-level authenticated fetch (\`path\` is appended to \`https://analyticsdata.googleapis.com/v1beta/\`).
|
|
756
|
+
- \`client.runReport(request)\` \u2014 run a GA4 report.
|
|
757
|
+
- \`client.runRealtimeReport(request)\` \u2014 run a realtime report.
|
|
758
|
+
- \`client.getMetadata()\` \u2014 fetch available dimensions and metrics.
|
|
759
|
+
|
|
760
|
+
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.
|
|
727
761
|
|
|
728
762
|
#### Example
|
|
729
763
|
|
|
@@ -787,7 +821,15 @@ averageSessionDuration, conversions, totalRevenue
|
|
|
787
821
|
|
|
788
822
|
### Business Logic
|
|
789
823
|
|
|
790
|
-
\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\
|
|
824
|
+
\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
|
|
825
|
+
|
|
826
|
+
SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF09:
|
|
827
|
+
- \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304D fetch\uFF08\`path\` \u306F \`https://analyticsdata.googleapis.com/v1beta/\` \u306B\u8FFD\u52A0\u3055\u308C\u307E\u3059\uFF09\u3002
|
|
828
|
+
- \`client.runReport(request)\` \u2014 GA4 \u30EC\u30DD\u30FC\u30C8\u3092\u5B9F\u884C\u3002
|
|
829
|
+
- \`client.runRealtimeReport(request)\` \u2014 \u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u30EC\u30DD\u30FC\u30C8\u3092\u5B9F\u884C\u3002
|
|
830
|
+
- \`client.getMetadata()\` \u2014 \u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u30E1\u30C8\u30EA\u30AF\u30B9\u3092\u53D6\u5F97\u3002
|
|
831
|
+
|
|
832
|
+
\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
|
|
791
833
|
|
|
792
834
|
#### Example
|
|
793
835
|
|
|
@@ -328,7 +328,33 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
328
328
|
return result;
|
|
329
329
|
}
|
|
330
330
|
static deriveKey(slug, authType) {
|
|
331
|
-
|
|
331
|
+
if (authType) return `${slug}-${authType}`;
|
|
332
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
333
|
+
// user-password
|
|
334
|
+
"postgresql": "user-password",
|
|
335
|
+
"mysql": "user-password",
|
|
336
|
+
"clickhouse": "user-password",
|
|
337
|
+
"kintone": "user-password",
|
|
338
|
+
"squadbase-db": "user-password",
|
|
339
|
+
// service-account
|
|
340
|
+
"snowflake": "service-account",
|
|
341
|
+
"bigquery": "service-account",
|
|
342
|
+
"google-analytics": "service-account",
|
|
343
|
+
"google-calendar": "service-account",
|
|
344
|
+
"aws-athena": "service-account",
|
|
345
|
+
"redshift": "service-account",
|
|
346
|
+
// api-key
|
|
347
|
+
"databricks": "api-key",
|
|
348
|
+
"dbt": "api-key",
|
|
349
|
+
"airtable": "api-key",
|
|
350
|
+
"openai": "api-key",
|
|
351
|
+
"gemini": "api-key",
|
|
352
|
+
"anthropic": "api-key",
|
|
353
|
+
"wix-store": "api-key"
|
|
354
|
+
};
|
|
355
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
356
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
357
|
+
return slug;
|
|
332
358
|
}
|
|
333
359
|
};
|
|
334
360
|
|
|
@@ -345,10 +371,10 @@ var AUTH_TYPES = {
|
|
|
345
371
|
// ../connectors/src/connectors/google-analytics/setup.ts
|
|
346
372
|
var googleAnalyticsOnboarding = new ConnectorOnboarding({
|
|
347
373
|
dataOverviewInstructions: {
|
|
348
|
-
en: `1. Call google-
|
|
349
|
-
2. Call google-
|
|
350
|
-
ja: `1. google-
|
|
351
|
-
2. google-
|
|
374
|
+
en: `1. Call google-analytics-service-account_request with GET properties/{propertyId}/metadata to list available dimensions and metrics
|
|
375
|
+
2. Call google-analytics-service-account_request with POST properties/{propertyId}:runReport using a small date range and basic metrics to verify data availability`,
|
|
376
|
+
ja: `1. google-analytics-service-account_request \u3067 GET properties/{propertyId}/metadata \u3092\u547C\u3073\u51FA\u3057\u3001\u5229\u7528\u53EF\u80FD\u306A\u30C7\u30A3\u30E1\u30F3\u30B7\u30E7\u30F3\u3068\u30E1\u30C8\u30EA\u30AF\u30B9\u306E\u4E00\u89A7\u3092\u53D6\u5F97
|
|
377
|
+
2. google-analytics-service-account_request \u3067 POST properties/{propertyId}:runReport \u3092\u77ED\u3044\u671F\u9593\u3068\u57FA\u672C\u30E1\u30C8\u30EA\u30AF\u30B9\u3067\u547C\u3073\u51FA\u3057\u3001\u30C7\u30FC\u30BF\u306E\u53EF\u7528\u6027\u3092\u78BA\u8A8D`
|
|
352
378
|
}
|
|
353
379
|
});
|
|
354
380
|
|
|
@@ -449,7 +475,7 @@ var googleAnalyticsConnector = new ConnectorPlugin({
|
|
|
449
475
|
systemPrompt: {
|
|
450
476
|
en: `### Tools
|
|
451
477
|
|
|
452
|
-
- \`google-
|
|
478
|
+
- \`google-analytics-service-account_request\`: The only way to call the GA4 Data API. Use it to fetch metadata, run reports, or run realtime reports. See the GA4 Data API Reference below for available endpoints and request bodies.
|
|
453
479
|
|
|
454
480
|
### Business Logic
|
|
455
481
|
|
|
@@ -517,7 +543,7 @@ activeUsers, sessions, screenPageViews, bounceRate, averageSessionDuration, conv
|
|
|
517
543
|
- Relative: \`"today"\`, \`"yesterday"\`, \`"7daysAgo"\`, \`"30daysAgo"\``,
|
|
518
544
|
ja: `### \u30C4\u30FC\u30EB
|
|
519
545
|
|
|
520
|
-
- \`google-
|
|
546
|
+
- \`google-analytics-service-account_request\`: GA4 Data API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30E1\u30BF\u30C7\u30FC\u30BF\u306E\u53D6\u5F97\u3001\u30EC\u30DD\u30FC\u30C8\u306E\u5B9F\u884C\u3001\u30EA\u30A2\u30EB\u30BF\u30A4\u30E0\u30EC\u30DD\u30FC\u30C8\u306E\u5B9F\u884C\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u5229\u7528\u53EF\u80FD\u306A\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3068\u30EA\u30AF\u30A8\u30B9\u30C8\u30DC\u30C7\u30A3\u306F\u4E0B\u90E8\u306E\u300CGA4 Data API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\u300D\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
521
547
|
|
|
522
548
|
### Business Logic
|
|
523
549
|
|
|
@@ -229,7 +229,33 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
229
229
|
return result;
|
|
230
230
|
}
|
|
231
231
|
static deriveKey(slug, authType) {
|
|
232
|
-
|
|
232
|
+
if (authType) return `${slug}-${authType}`;
|
|
233
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
234
|
+
// user-password
|
|
235
|
+
"postgresql": "user-password",
|
|
236
|
+
"mysql": "user-password",
|
|
237
|
+
"clickhouse": "user-password",
|
|
238
|
+
"kintone": "user-password",
|
|
239
|
+
"squadbase-db": "user-password",
|
|
240
|
+
// service-account
|
|
241
|
+
"snowflake": "service-account",
|
|
242
|
+
"bigquery": "service-account",
|
|
243
|
+
"google-analytics": "service-account",
|
|
244
|
+
"google-calendar": "service-account",
|
|
245
|
+
"aws-athena": "service-account",
|
|
246
|
+
"redshift": "service-account",
|
|
247
|
+
// api-key
|
|
248
|
+
"databricks": "api-key",
|
|
249
|
+
"dbt": "api-key",
|
|
250
|
+
"airtable": "api-key",
|
|
251
|
+
"openai": "api-key",
|
|
252
|
+
"gemini": "api-key",
|
|
253
|
+
"anthropic": "api-key",
|
|
254
|
+
"wix-store": "api-key"
|
|
255
|
+
};
|
|
256
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
257
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
258
|
+
return slug;
|
|
233
259
|
}
|
|
234
260
|
};
|
|
235
261
|
|
|
@@ -580,7 +606,15 @@ var googleCalendarOauthConnector = new ConnectorPlugin({
|
|
|
580
606
|
|
|
581
607
|
### Business Logic
|
|
582
608
|
|
|
583
|
-
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.
|
|
609
|
+
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.
|
|
610
|
+
|
|
611
|
+
SDK surface (client created via \`connection(connectionId)\`):
|
|
612
|
+
- \`client.request(path, init?)\` \u2014 low-level authenticated fetch (\`path\` is appended to \`https://www.googleapis.com/calendar/v3\`; \`{calendarId}\` placeholders are auto-replaced).
|
|
613
|
+
- \`client.listCalendars()\` \u2014 list calendars accessible by the OAuth user.
|
|
614
|
+
- \`client.listEvents(options?, calendarId?)\` \u2014 list events with optional filters.
|
|
615
|
+
- \`client.getEvent(eventId, calendarId?)\` \u2014 fetch a single event.
|
|
616
|
+
|
|
617
|
+
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.
|
|
584
618
|
|
|
585
619
|
#### Example
|
|
586
620
|
|
|
@@ -637,7 +671,15 @@ console.log(event.summary, event.attendees);
|
|
|
637
671
|
|
|
638
672
|
### Business Logic
|
|
639
673
|
|
|
640
|
-
\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\
|
|
674
|
+
\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
|
|
675
|
+
|
|
676
|
+
SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF09:
|
|
677
|
+
- \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304D fetch\uFF08\`path\` \u306F \`https://www.googleapis.com/calendar/v3\` \u306B\u8FFD\u52A0\u3055\u308C\u3001\`{calendarId}\` \u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u306F\u81EA\u52D5\u7F6E\u63DB\u3055\u308C\u307E\u3059\uFF09\u3002
|
|
678
|
+
- \`client.listCalendars()\` \u2014 OAuth \u30E6\u30FC\u30B6\u30FC\u304C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30AB\u30EC\u30F3\u30C0\u30FC\u4E00\u89A7\u3092\u53D6\u5F97\u3002
|
|
679
|
+
- \`client.listEvents(options?, calendarId?)\` \u2014 \u30D5\u30A3\u30EB\u30BF\u30FC\u4ED8\u304D\u3067\u30A4\u30D9\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3002
|
|
680
|
+
- \`client.getEvent(eventId, calendarId?)\` \u2014 \u5358\u4E00\u30A4\u30D9\u30F3\u30C8\u3092\u53D6\u5F97\u3002
|
|
681
|
+
|
|
682
|
+
\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
|
|
641
683
|
|
|
642
684
|
#### Example
|
|
643
685
|
|
|
@@ -341,7 +341,33 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
341
341
|
return result;
|
|
342
342
|
}
|
|
343
343
|
static deriveKey(slug, authType) {
|
|
344
|
-
|
|
344
|
+
if (authType) return `${slug}-${authType}`;
|
|
345
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
346
|
+
// user-password
|
|
347
|
+
"postgresql": "user-password",
|
|
348
|
+
"mysql": "user-password",
|
|
349
|
+
"clickhouse": "user-password",
|
|
350
|
+
"kintone": "user-password",
|
|
351
|
+
"squadbase-db": "user-password",
|
|
352
|
+
// service-account
|
|
353
|
+
"snowflake": "service-account",
|
|
354
|
+
"bigquery": "service-account",
|
|
355
|
+
"google-analytics": "service-account",
|
|
356
|
+
"google-calendar": "service-account",
|
|
357
|
+
"aws-athena": "service-account",
|
|
358
|
+
"redshift": "service-account",
|
|
359
|
+
// api-key
|
|
360
|
+
"databricks": "api-key",
|
|
361
|
+
"dbt": "api-key",
|
|
362
|
+
"airtable": "api-key",
|
|
363
|
+
"openai": "api-key",
|
|
364
|
+
"gemini": "api-key",
|
|
365
|
+
"anthropic": "api-key",
|
|
366
|
+
"wix-store": "api-key"
|
|
367
|
+
};
|
|
368
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
369
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
370
|
+
return slug;
|
|
345
371
|
}
|
|
346
372
|
};
|
|
347
373
|
|
|
@@ -529,19 +555,21 @@ var listCalendarsTool = new ConnectorTool({
|
|
|
529
555
|
});
|
|
530
556
|
|
|
531
557
|
// ../connectors/src/connectors/google-calendar/setup.ts
|
|
532
|
-
var listCalendarsToolName = `google-
|
|
558
|
+
var listCalendarsToolName = `google-calendar-service-account_${listCalendarsTool.name}`;
|
|
533
559
|
var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
534
560
|
connectionSetupInstructions: {
|
|
535
561
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Calendar\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\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3084\u30AB\u30EC\u30F3\u30C0\u30FCID\u306F\u3053\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
536
562
|
|
|
537
|
-
1. \`askUserQuestion\` \u3067\u30E6\u30FC\u30B6\u30FC\u306B\u3001\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u304CDomain-wide Delegation\u3067\u4EE3\u7406\u30A2\u30AF\u30BB\u30B9\u3059\u308BGoogle Workspace\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u30D2\u30A2\u30EA\u30F3\u30B0\u3059\
|
|
563
|
+
1. \`askUserQuestion\` \u3067\u30E6\u30FC\u30B6\u30FC\u306B\u3001\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u304CDomain-wide Delegation\u3067\u4EE3\u7406\u30A2\u30AF\u30BB\u30B9\u3059\u308BGoogle Workspace\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u30D2\u30A2\u30EA\u30F3\u30B0\u3059\u308B:
|
|
538
564
|
- \`question\`: \u300C\u30A2\u30AF\u30BB\u30B9\u3057\u305F\u3044\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u6301\u3064\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u8907\u6570\u3042\u308B\u5834\u5408\u306F\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\u5165\u529B\u53EF\uFF09\u300D
|
|
539
565
|
- \`header\`: \u300C\u30E1\u30FC\u30EB\u5165\u529B\u300D
|
|
540
|
-
- \`options\`: \`[
|
|
566
|
+
- \`options\`: \`[]\`\uFF08\u9078\u629E\u80A2\u306A\u3057\u30FB\u81EA\u7531\u5165\u529B\u306E\u307F\uFF09
|
|
567
|
+
- \`allowFreeText\`: \`true\`
|
|
541
568
|
2. \u30E6\u30FC\u30B6\u30FC\u304B\u3089\u53D7\u3051\u53D6\u3063\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\u5BFE\u5FDC\uFF09\u3092 \`updateConnectionParameters\` \u3067\u4FDD\u5B58\u3059\u308B:
|
|
542
569
|
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
543
570
|
- \`options\`: \`[{ value: <\u5165\u529B\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u6587\u5B57\u5217>, label: <\u540C\u3058\u5024> }]\`\uFF081\u4EF6\u306E\u307F\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u81EA\u52D5\u9078\u629E\u3055\u308C\u308B\uFF09
|
|
544
|
-
3. \`${listCalendarsToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3001\u4FDD\u5B58\u3057\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30AB\u30EC\u30F3\u30C0\u30FC\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
|
|
571
|
+
3. \`${listCalendarsToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3001\u4FDD\u5B58\u3057\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30AB\u30EC\u30F3\u30C0\u30FC\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B\u3002
|
|
572
|
+
- \`errors\` \u306B\u30A8\u30E9\u30FC\u304C\u3042\u308A \`calendars\` \u304C\u7A7A\u306E\u5834\u5408\uFF08\u3059\u3079\u3066\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3067\u5931\u6557\uFF09\u3001\u5165\u529B\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u304C\u5B58\u5728\u3057\u306A\u3044\u53EF\u80FD\u6027\u304C\u3042\u308B\u3002\`askUserQuestion\` \u3067\u300C{\u5165\u529B\u3057\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9} \u306E\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30A2\u30C9\u30EC\u30B9\u306B\u8AA4\u308A\u304C\u3042\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u4F3C\u305F\u30A2\u30C9\u30EC\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u304B\uFF1F\u300D\u3068\u805E\u304D\u8FD4\u3057\u3001\u30B9\u30C6\u30C3\u30D72\u304B\u3089\u518D\u5EA6\u5B9F\u884C\u3059\u308B
|
|
545
573
|
4. \u8FD4\u5374\u3055\u308C\u305F \`calendars\` \u914D\u5217\uFF08\u5404\u8981\u7D20: \`{ impersonateEmail, id, summary, primary, accessRole }\`\uFF09\u3092\u5143\u306B\u300C\u4F7F\u7528\u3059\u308B\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u300D\u3068\u77ED\u304F\u4F1D\u3048\u305F\u4E0A\u3067\u3001\`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
546
574
|
- \`parameterSlug\`: \`"calendar-id"\`
|
|
547
575
|
- \`options\`: \u5404 option \u306E \`label\` \u306F \`\u30AB\u30EC\u30F3\u30C0\u30FC\u540D (owner: impersonateEmail)\` \u306E\u5F62\u5F0F\u3001\`value\` \u306F\u30AB\u30EC\u30F3\u30C0\u30FCID
|
|
@@ -563,11 +591,13 @@ var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
|
563
591
|
1. Call \`askUserQuestion\` to ask the user for the Google Workspace user email the service account will impersonate via Domain-wide Delegation:
|
|
564
592
|
- \`question\`: "Please enter the email address of the user whose calendar you want to access (comma-separated list allowed for multiple users)"
|
|
565
593
|
- \`header\`: "Email input"
|
|
566
|
-
- \`options\`: \`[
|
|
594
|
+
- \`options\`: \`[]\` (no preset choices \u2014 free text only)
|
|
595
|
+
- \`allowFreeText\`: \`true\`
|
|
567
596
|
2. Save the email(s) the user provided (comma-separated supported) via \`updateConnectionParameters\`:
|
|
568
597
|
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
569
598
|
- \`options\`: \`[{ value: <the email string entered>, label: <same value> }]\` (a single option is auto-selected)
|
|
570
|
-
3. Call \`${listCalendarsToolName}\` to list calendars accessible via the saved email(s)
|
|
599
|
+
3. Call \`${listCalendarsToolName}\` to list calendars accessible via the saved email(s).
|
|
600
|
+
- If \`errors\` is non-empty and \`calendars\` is empty (all emails failed), the entered address may not exist. Use \`askUserQuestion\` to ask: "Could not access the calendar for {entered email}. The address may be incorrect \u2014 did you mean a similar address?" Then re-run from step 2 with the new input
|
|
571
601
|
4. Using the returned \`calendars\` array (each item: \`{ impersonateEmail, id, summary, primary, accessRole }\`), briefly say "Please select a calendar." then call \`updateConnectionParameters\`:
|
|
572
602
|
- \`parameterSlug\`: \`"calendar-id"\`
|
|
573
603
|
- \`options\`: Each option's \`label\` should be \`Calendar Name (owner: impersonateEmail)\`, \`value\` should be the calendar ID
|
|
@@ -586,12 +616,12 @@ var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
|
586
616
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
587
617
|
},
|
|
588
618
|
dataOverviewInstructions: {
|
|
589
|
-
en: `1. Call google-
|
|
590
|
-
2. Call google-
|
|
591
|
-
3. Call google-
|
|
592
|
-
ja: `1. google-
|
|
593
|
-
2. google-
|
|
594
|
-
3. google-
|
|
619
|
+
en: `1. Call google-calendar-service-account_request with GET /calendars/{calendarId} to get the default calendar's metadata
|
|
620
|
+
2. Call google-calendar-service-account_request with GET /users/me/calendarList to list all accessible calendars
|
|
621
|
+
3. Call google-calendar-service-account_request with GET /calendars/{calendarId}/events with query params timeMin (RFC3339) and maxResults=10 to sample upcoming events`,
|
|
622
|
+
ja: `1. google-calendar-service-account_request \u3067 GET /calendars/{calendarId} \u3092\u547C\u3073\u51FA\u3057\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97
|
|
623
|
+
2. google-calendar-service-account_request \u3067 GET /users/me/calendarList \u3092\u547C\u3073\u51FA\u3057\u3001\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u5168\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u4E00\u89A7\u3092\u53D6\u5F97
|
|
624
|
+
3. google-calendar-service-account_request \u3067 GET /calendars/{calendarId}/events \u3092\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF timeMin\uFF08RFC3339\u5F62\u5F0F\uFF09\u3068 maxResults=10 \u3067\u547C\u3073\u51FA\u3057\u3001\u76F4\u8FD1\u306E\u30A4\u30D9\u30F3\u30C8\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0`
|
|
595
625
|
}
|
|
596
626
|
});
|
|
597
627
|
|
|
@@ -731,7 +761,7 @@ var googleCalendarConnector = new ConnectorPlugin({
|
|
|
731
761
|
systemPrompt: {
|
|
732
762
|
en: `### Tools
|
|
733
763
|
|
|
734
|
-
- \`google-
|
|
764
|
+
- \`google-calendar-service-account_request\`: The only way to call the Google Calendar API. Use it to list calendars, get events, and manage calendar data. Authentication is handled automatically using a service account with Domain-wide Delegation \u2014 the service account impersonates the user configured on the connection (\`impersonate-email\` parameter). The {calendarId} placeholder in paths is automatically replaced with the configured default calendar ID. Pass an optional \`subject\` only if you need to override the configured user for a specific request.
|
|
735
765
|
|
|
736
766
|
### Business Logic
|
|
737
767
|
|
|
@@ -802,7 +832,7 @@ export default async function handler(c: Context) {
|
|
|
802
832
|
- The default calendar ID is "primary" if not configured`,
|
|
803
833
|
ja: `### \u30C4\u30FC\u30EB
|
|
804
834
|
|
|
805
|
-
- \`google-
|
|
835
|
+
- \`google-calendar-service-account_request\`: Google Calendar API\u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002\u30AB\u30EC\u30F3\u30C0\u30FC\u306E\u4E00\u89A7\u53D6\u5F97\u3001\u30A4\u30D9\u30F3\u30C8\u306E\u53D6\u5F97\u3001\u30AB\u30EC\u30F3\u30C0\u30FC\u30C7\u30FC\u30BF\u306E\u7BA1\u7406\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\uFF0BDomain-wide Delegation\u3067\u8A8D\u8A3C\u304C\u81EA\u52D5\u7684\u306B\u51E6\u7406\u3055\u308C\u3001\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306B\u8A2D\u5B9A\u3055\u308C\u305F\u30E6\u30FC\u30B6\u30FC\uFF08\`impersonate-email\`\u30D1\u30E9\u30E1\u30FC\u30BF\uFF09\u3068\u3057\u3066\u52D5\u4F5C\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E{calendarId}\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u306F\u8A2D\u5B9A\u6E08\u307F\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u30AB\u30EC\u30F3\u30C0\u30FCID\u3067\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002\u7279\u5B9A\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u8A2D\u5B9A\u30E6\u30FC\u30B6\u30FC\u3092\u4E0A\u66F8\u304D\u3057\u305F\u3044\u5834\u5408\u306E\u307F\u3001\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\`subject\`\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
806
836
|
|
|
807
837
|
### Business Logic
|
|
808
838
|
|
|
@@ -161,7 +161,33 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
161
161
|
return result;
|
|
162
162
|
}
|
|
163
163
|
static deriveKey(slug, authType) {
|
|
164
|
-
|
|
164
|
+
if (authType) return `${slug}-${authType}`;
|
|
165
|
+
const LEGACY_NULL_AUTH_TYPE_MAP = {
|
|
166
|
+
// user-password
|
|
167
|
+
"postgresql": "user-password",
|
|
168
|
+
"mysql": "user-password",
|
|
169
|
+
"clickhouse": "user-password",
|
|
170
|
+
"kintone": "user-password",
|
|
171
|
+
"squadbase-db": "user-password",
|
|
172
|
+
// service-account
|
|
173
|
+
"snowflake": "service-account",
|
|
174
|
+
"bigquery": "service-account",
|
|
175
|
+
"google-analytics": "service-account",
|
|
176
|
+
"google-calendar": "service-account",
|
|
177
|
+
"aws-athena": "service-account",
|
|
178
|
+
"redshift": "service-account",
|
|
179
|
+
// api-key
|
|
180
|
+
"databricks": "api-key",
|
|
181
|
+
"dbt": "api-key",
|
|
182
|
+
"airtable": "api-key",
|
|
183
|
+
"openai": "api-key",
|
|
184
|
+
"gemini": "api-key",
|
|
185
|
+
"anthropic": "api-key",
|
|
186
|
+
"wix-store": "api-key"
|
|
187
|
+
};
|
|
188
|
+
const fallbackAuthType = LEGACY_NULL_AUTH_TYPE_MAP[slug];
|
|
189
|
+
if (fallbackAuthType) return `${slug}-${fallbackAuthType}`;
|
|
190
|
+
return slug;
|
|
165
191
|
}
|
|
166
192
|
};
|
|
167
193
|
|
|
@@ -178,10 +204,10 @@ var AUTH_TYPES = {
|
|
|
178
204
|
// ../connectors/src/connectors/google-docs/setup.ts
|
|
179
205
|
var googleDocsOnboarding = new ConnectorOnboarding({
|
|
180
206
|
dataOverviewInstructions: {
|
|
181
|
-
en: `1. Create a new document with google-
|
|
182
|
-
2. Call google-
|
|
183
|
-
ja: `1. google-
|
|
184
|
-
2. google-
|
|
207
|
+
en: `1. Create a new document with google-docs-oauth_request (POST with body { title: "..." }) or use an existing document ID.
|
|
208
|
+
2. Call google-docs-oauth_request with GET /{documentId} to fetch the document's content and metadata.`,
|
|
209
|
+
ja: `1. google-docs-oauth_request \u3092 POST\uFF08Body: { title: "..." }\uFF09\u3067\u547C\u3073\u51FA\u3057\u3066\u65B0\u3057\u3044\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u4F5C\u6210\u3059\u308B\u304B\u3001\u65E2\u5B58\u306E\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8ID\u3092\u5229\u7528\u3057\u307E\u3059\u3002
|
|
210
|
+
2. google-docs-oauth_request \u3067 GET /{documentId} \u3092\u547C\u3073\u51FA\u3057\u3001\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u5185\u5BB9\u3068\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002`
|
|
185
211
|
}
|
|
186
212
|
});
|
|
187
213
|
|
|
@@ -311,7 +337,7 @@ var googleDocsConnector = new ConnectorPlugin({
|
|
|
311
337
|
authType: AUTH_TYPES.OAUTH,
|
|
312
338
|
name: "Google Docs",
|
|
313
339
|
description: "Connect to Google Docs for document data access and creation using OAuth.",
|
|
314
|
-
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/
|
|
340
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6vvcGJisvXjOumeTvswjzf/e9bb39e453cc0b71a20f26019b23b0d2/google_docs.png",
|
|
315
341
|
parameters,
|
|
316
342
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
317
343
|
onboarding: googleDocsOnboarding,
|
|
@@ -324,9 +350,11 @@ var googleDocsConnector = new ConnectorPlugin({
|
|
|
324
350
|
]
|
|
325
351
|
},
|
|
326
352
|
systemPrompt: {
|
|
327
|
-
en: `### Tools
|
|
353
|
+
en: `### Tools (setup-time only)
|
|
354
|
+
|
|
355
|
+
- \`google-docs-oauth_request\`: Call the Google Docs API directly during setup / data overview. Supports read and write operations. Use it to get document content, create new documents, and modify document content via batchUpdate. Authentication is configured automatically via OAuth.
|
|
328
356
|
|
|
329
|
-
|
|
357
|
+
> **Important**: The \`google-docs-oauth_request\` tool is only available at setup time. Inside server-logic handlers, use the SDK (\`connection(id).createDocument\`, 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.
|
|
330
358
|
|
|
331
359
|
### Google Docs API Reference
|
|
332
360
|
|
|
@@ -355,7 +383,15 @@ var googleDocsConnector = new ConnectorPlugin({
|
|
|
355
383
|
|
|
356
384
|
### Business Logic
|
|
357
385
|
|
|
358
|
-
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.
|
|
386
|
+
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.
|
|
387
|
+
|
|
388
|
+
SDK surface (client created via \`connection(connectionId)\`):
|
|
389
|
+
- \`client.request(path, init?)\` \u2014 low-level authenticated fetch (\`path\` is appended to \`https://docs.googleapis.com/v1/documents\`).
|
|
390
|
+
- \`client.getDocument(documentId)\` \u2014 fetch document content and metadata.
|
|
391
|
+
- \`client.createDocument(title)\` \u2014 create a new document.
|
|
392
|
+
- \`client.batchUpdate(documentId, requests)\` \u2014 apply one or more requests (insertText / updateTextStyle / etc.).
|
|
393
|
+
|
|
394
|
+
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.
|
|
359
395
|
|
|
360
396
|
#### Example
|
|
361
397
|
|
|
@@ -383,9 +419,11 @@ await docs.batchUpdate(documentId, [
|
|
|
383
419
|
},
|
|
384
420
|
]);
|
|
385
421
|
\`\`\``,
|
|
386
|
-
ja: `### \u30C4\u30FC\u30EB
|
|
422
|
+
ja: `### \u30C4\u30FC\u30EB\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\uFF09
|
|
387
423
|
|
|
388
|
-
- \`google-
|
|
424
|
+
- \`google-docs-oauth_request\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3084\u30C7\u30FC\u30BF\u6982\u8981\u628A\u63E1\u6642\u306B Google Docs API \u3092\u76F4\u63A5\u53E9\u304F\u30C4\u30FC\u30EB\u3067\u3059\u3002\u8AAD\u307F\u53D6\u308A\u3068\u66F8\u304D\u8FBC\u307F\u306E\u4E21\u65B9\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u5185\u5BB9\u306E\u53D6\u5F97\u3001\u65B0\u3057\u3044\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u4F5C\u6210\u3001batchUpdate \u306B\u3088\u308B\u5185\u5BB9\u5909\u66F4\u306A\u3069\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002OAuth \u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
425
|
+
|
|
426
|
+
> **\u91CD\u8981**: \`google-docs-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).createDocument\` \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
|
|
389
427
|
|
|
390
428
|
### Google Docs API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
|
|
391
429
|
|
|
@@ -414,7 +452,15 @@ await docs.batchUpdate(documentId, [
|
|
|
414
452
|
|
|
415
453
|
### Business Logic
|
|
416
454
|
|
|
417
|
-
\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\
|
|
455
|
+
\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
|
|
456
|
+
|
|
457
|
+
SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF09:
|
|
458
|
+
- \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304D fetch\uFF08\`path\` \u306F \`https://docs.googleapis.com/v1/documents\` \u306B\u8FFD\u52A0\u3055\u308C\u307E\u3059\uFF09\u3002
|
|
459
|
+
- \`client.getDocument(documentId)\` \u2014 \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u5185\u5BB9\u3068\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3002
|
|
460
|
+
- \`client.createDocument(title)\` \u2014 \u65B0\u3057\u3044\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u4F5C\u6210\u3002
|
|
461
|
+
- \`client.batchUpdate(documentId, requests)\` \u2014 insertText / updateTextStyle \u306A\u3069\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3092\u307E\u3068\u3081\u3066\u9069\u7528\u3002
|
|
462
|
+
|
|
463
|
+
\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
|
|
418
464
|
|
|
419
465
|
#### Example
|
|
420
466
|
|