@squadbase/vite-server 0.1.8 → 0.1.9-dev.3841401
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 +73422 -59588
- package/dist/connectors/airtable-oauth.js +3 -0
- package/dist/connectors/airtable.js +3 -0
- package/dist/connectors/amplitude.js +3 -0
- package/dist/connectors/anthropic.js +3 -0
- package/dist/connectors/asana.js +18 -2
- package/dist/connectors/attio.js +3 -0
- package/dist/connectors/aws-billing.d.ts +5 -0
- package/dist/connectors/aws-billing.js +29843 -0
- package/dist/connectors/azure-sql.d.ts +5 -0
- package/dist/connectors/azure-sql.js +668 -0
- package/dist/connectors/backlog-api-key.js +3 -0
- package/dist/connectors/clickup.d.ts +5 -0
- package/dist/connectors/clickup.js +850 -0
- package/dist/connectors/customerio.js +3 -0
- package/dist/connectors/dbt.js +3 -0
- package/dist/connectors/freshdesk.d.ts +5 -0
- package/dist/connectors/freshdesk.js +842 -0
- package/dist/connectors/freshsales.d.ts +5 -0
- package/dist/connectors/freshsales.js +867 -0
- package/dist/connectors/freshservice.d.ts +5 -0
- package/dist/connectors/freshservice.js +813 -0
- package/dist/connectors/gamma.js +3 -0
- package/dist/connectors/gemini.js +3 -0
- package/dist/connectors/github.d.ts +5 -0
- package/dist/connectors/github.js +963 -0
- package/dist/connectors/gmail-oauth.js +18 -2
- package/dist/connectors/gmail.js +34 -16
- package/dist/connectors/google-ads.js +3 -0
- package/dist/connectors/google-analytics-oauth.js +3 -0
- package/dist/connectors/google-analytics.js +3 -0
- package/dist/connectors/google-audit-log.d.ts +5 -0
- package/dist/connectors/google-audit-log.js +813 -0
- package/dist/connectors/google-calendar-oauth.js +21 -2
- package/dist/connectors/google-calendar.js +140 -73
- package/dist/connectors/google-docs.js +21 -2
- package/dist/connectors/google-drive.js +18 -2
- package/dist/connectors/google-search-console-oauth.d.ts +5 -0
- package/dist/connectors/google-search-console-oauth.js +954 -0
- package/dist/connectors/google-sheets.js +21 -2
- package/dist/connectors/google-slides.js +21 -2
- package/dist/connectors/grafana.js +3 -0
- package/dist/connectors/hubspot-oauth.js +3 -0
- package/dist/connectors/hubspot.js +3 -0
- package/dist/connectors/influxdb.js +3 -0
- package/dist/connectors/intercom-oauth.js +3 -0
- package/dist/connectors/intercom.js +3 -0
- package/dist/connectors/jdbc.d.ts +5 -0
- package/dist/connectors/jdbc.js +21509 -0
- package/dist/connectors/jira-api-key.js +3 -0
- package/dist/connectors/kintone-api-token.js +3 -0
- package/dist/connectors/kintone.js +3 -0
- package/dist/connectors/linear.js +3 -0
- package/dist/connectors/linkedin-ads.js +3 -0
- package/dist/connectors/mailchimp-oauth.js +3 -0
- package/dist/connectors/mailchimp.js +3 -0
- package/dist/connectors/meta-ads-oauth.js +3 -0
- package/dist/connectors/meta-ads.js +3 -0
- package/dist/connectors/mixpanel.js +3 -0
- package/dist/connectors/monday.d.ts +5 -0
- package/dist/connectors/monday.js +853 -0
- package/dist/connectors/notion-oauth.js +3 -0
- package/dist/connectors/notion.js +3 -0
- package/dist/connectors/openai.js +3 -0
- package/dist/connectors/oracle.d.ts +5 -0
- package/dist/connectors/oracle.js +676 -0
- package/dist/connectors/salesforce.js +3 -0
- package/dist/connectors/semrush.d.ts +5 -0
- package/dist/connectors/semrush.js +812 -0
- package/dist/connectors/sentry.js +3 -0
- package/dist/connectors/shopify-oauth.js +3 -0
- package/dist/connectors/shopify.js +3 -0
- package/dist/connectors/sqlserver.d.ts +5 -0
- package/dist/connectors/sqlserver.js +667 -0
- package/dist/connectors/stripe-api-key.js +3 -0
- package/dist/connectors/stripe-oauth.js +3 -0
- package/dist/connectors/supabase.d.ts +5 -0
- package/dist/connectors/supabase.js +582 -0
- package/dist/connectors/tiktok-ads.js +18 -2
- package/dist/connectors/wix-store.js +3 -0
- package/dist/connectors/zendesk-oauth.js +3 -0
- package/dist/connectors/zendesk.js +3 -0
- package/dist/index.js +70184 -56350
- package/dist/main.js +70178 -56344
- package/dist/vite-plugin.js +71935 -58101
- package/package.json +64 -2
|
@@ -175,6 +175,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
175
175
|
releaseFlag;
|
|
176
176
|
proxyPolicy;
|
|
177
177
|
experimentalAttributes;
|
|
178
|
+
categories;
|
|
178
179
|
onboarding;
|
|
179
180
|
systemPrompt;
|
|
180
181
|
tools;
|
|
@@ -190,6 +191,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
190
191
|
this.releaseFlag = config.releaseFlag;
|
|
191
192
|
this.proxyPolicy = config.proxyPolicy;
|
|
192
193
|
this.experimentalAttributes = config.experimentalAttributes;
|
|
194
|
+
this.categories = config.categories ?? [];
|
|
193
195
|
this.onboarding = config.onboarding;
|
|
194
196
|
this.systemPrompt = config.systemPrompt;
|
|
195
197
|
this.tools = config.tools;
|
|
@@ -269,6 +271,16 @@ var AUTH_TYPES = {
|
|
|
269
271
|
USER_PASSWORD: "user-password"
|
|
270
272
|
};
|
|
271
273
|
|
|
274
|
+
// ../connectors/src/lib/normalize-path.ts
|
|
275
|
+
function normalizeRequestPath(path2, basePathSegment) {
|
|
276
|
+
let p = path2.trim();
|
|
277
|
+
if (!p.startsWith("/")) p = "/" + p;
|
|
278
|
+
if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
|
|
279
|
+
p = p.slice(basePathSegment.length) || "/";
|
|
280
|
+
}
|
|
281
|
+
return p;
|
|
282
|
+
}
|
|
283
|
+
|
|
272
284
|
// ../connectors/src/connectors/google-calendar-oauth/tools/list-calendars.ts
|
|
273
285
|
import { z } from "zod";
|
|
274
286
|
var BASE_URL2 = "https://www.googleapis.com/calendar/v3";
|
|
@@ -426,7 +438,9 @@ var googleCalendarOauthOnboarding = new ConnectorOnboarding({
|
|
|
426
438
|
|
|
427
439
|
// ../connectors/src/connectors/google-calendar-oauth/tools/request.ts
|
|
428
440
|
import { z as z2 } from "zod";
|
|
429
|
-
var
|
|
441
|
+
var BASE_HOST = "https://www.googleapis.com";
|
|
442
|
+
var BASE_PATH_SEGMENT = "/calendar/v3";
|
|
443
|
+
var BASE_URL3 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
|
|
430
444
|
var REQUEST_TIMEOUT_MS2 = 6e4;
|
|
431
445
|
var cachedToken2 = null;
|
|
432
446
|
async function getProxyToken2(config) {
|
|
@@ -503,7 +517,11 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
503
517
|
try {
|
|
504
518
|
const calendarId = parameters.calendarId.tryGetValue(connection2) ?? "primary";
|
|
505
519
|
const resolvedPath = path2.replace(/\{calendarId\}/g, calendarId);
|
|
506
|
-
|
|
520
|
+
const normalizedPath = normalizeRequestPath(
|
|
521
|
+
resolvedPath,
|
|
522
|
+
BASE_PATH_SEGMENT
|
|
523
|
+
);
|
|
524
|
+
let url = `${BASE_URL3}${normalizedPath}`;
|
|
507
525
|
if (queryParams) {
|
|
508
526
|
const searchParams = new URLSearchParams(queryParams);
|
|
509
527
|
url += `?${searchParams.toString()}`;
|
|
@@ -558,6 +576,7 @@ var googleCalendarOauthConnector = new ConnectorPlugin({
|
|
|
558
576
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2YsqoBEpdELmfDeFcyGHyE/4494c633b5ae15e562cb739cd85442c1/google-calendar.png",
|
|
559
577
|
parameters,
|
|
560
578
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
579
|
+
categories: ["productivity"],
|
|
561
580
|
onboarding: googleCalendarOauthOnboarding,
|
|
562
581
|
proxyPolicy: {
|
|
563
582
|
allowlist: [
|
|
@@ -180,6 +180,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
180
180
|
releaseFlag;
|
|
181
181
|
proxyPolicy;
|
|
182
182
|
experimentalAttributes;
|
|
183
|
+
categories;
|
|
183
184
|
onboarding;
|
|
184
185
|
systemPrompt;
|
|
185
186
|
tools;
|
|
@@ -195,6 +196,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
195
196
|
this.releaseFlag = config.releaseFlag;
|
|
196
197
|
this.proxyPolicy = config.proxyPolicy;
|
|
197
198
|
this.experimentalAttributes = config.experimentalAttributes;
|
|
199
|
+
this.categories = config.categories ?? [];
|
|
198
200
|
this.onboarding = config.onboarding;
|
|
199
201
|
this.systemPrompt = config.systemPrompt;
|
|
200
202
|
this.tools = config.tools;
|
|
@@ -276,7 +278,21 @@ var AUTH_TYPES = {
|
|
|
276
278
|
|
|
277
279
|
// ../connectors/src/connectors/google-calendar/tools/request.ts
|
|
278
280
|
import { z } from "zod";
|
|
279
|
-
|
|
281
|
+
|
|
282
|
+
// ../connectors/src/lib/normalize-path.ts
|
|
283
|
+
function normalizeRequestPath(path2, basePathSegment) {
|
|
284
|
+
let p = path2.trim();
|
|
285
|
+
if (!p.startsWith("/")) p = "/" + p;
|
|
286
|
+
if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
|
|
287
|
+
p = p.slice(basePathSegment.length) || "/";
|
|
288
|
+
}
|
|
289
|
+
return p;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// ../connectors/src/connectors/google-calendar/tools/request.ts
|
|
293
|
+
var BASE_HOST = "https://www.googleapis.com";
|
|
294
|
+
var BASE_PATH_SEGMENT = "/calendar/v3";
|
|
295
|
+
var BASE_URL2 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
|
|
280
296
|
var REQUEST_TIMEOUT_MS = 6e4;
|
|
281
297
|
function decodeServiceAccount(keyJsonBase64) {
|
|
282
298
|
const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
|
|
@@ -301,7 +317,8 @@ var outputSchema = z.discriminatedUnion("success", [
|
|
|
301
317
|
z.object({
|
|
302
318
|
success: z.literal(true),
|
|
303
319
|
status: z.number(),
|
|
304
|
-
data: z.record(z.string(), z.unknown())
|
|
320
|
+
data: z.record(z.string(), z.unknown()),
|
|
321
|
+
serviceAccountEmail: z.string()
|
|
305
322
|
}),
|
|
306
323
|
z.object({
|
|
307
324
|
success: z.literal(false),
|
|
@@ -354,7 +371,8 @@ var requestTool = new ConnectorTool({
|
|
|
354
371
|
serviceAccountEmail
|
|
355
372
|
};
|
|
356
373
|
}
|
|
357
|
-
|
|
374
|
+
const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT);
|
|
375
|
+
let url = `${BASE_URL2}${normalizedPath}`;
|
|
358
376
|
if (queryParams) {
|
|
359
377
|
const searchParams = new URLSearchParams(queryParams);
|
|
360
378
|
url += `?${searchParams.toString()}`;
|
|
@@ -382,7 +400,12 @@ var requestTool = new ConnectorTool({
|
|
|
382
400
|
serviceAccountEmail
|
|
383
401
|
};
|
|
384
402
|
}
|
|
385
|
-
return {
|
|
403
|
+
return {
|
|
404
|
+
success: true,
|
|
405
|
+
status: response.status,
|
|
406
|
+
data,
|
|
407
|
+
serviceAccountEmail
|
|
408
|
+
};
|
|
386
409
|
} finally {
|
|
387
410
|
clearTimeout(timeout);
|
|
388
411
|
}
|
|
@@ -399,7 +422,9 @@ var requestTool = new ConnectorTool({
|
|
|
399
422
|
|
|
400
423
|
// ../connectors/src/connectors/google-calendar/tools/request-with-delegation.ts
|
|
401
424
|
import { z as z2 } from "zod";
|
|
402
|
-
var
|
|
425
|
+
var BASE_HOST2 = "https://www.googleapis.com";
|
|
426
|
+
var BASE_PATH_SEGMENT2 = "/calendar/v3";
|
|
427
|
+
var BASE_URL3 = `${BASE_HOST2}${BASE_PATH_SEGMENT2}`;
|
|
403
428
|
var REQUEST_TIMEOUT_MS2 = 6e4;
|
|
404
429
|
function decodeServiceAccount2(keyJsonBase64) {
|
|
405
430
|
const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
|
|
@@ -429,7 +454,8 @@ var outputSchema2 = z2.discriminatedUnion("success", [
|
|
|
429
454
|
z2.object({
|
|
430
455
|
success: z2.literal(true),
|
|
431
456
|
status: z2.number(),
|
|
432
|
-
data: z2.record(z2.string(), z2.unknown())
|
|
457
|
+
data: z2.record(z2.string(), z2.unknown()),
|
|
458
|
+
serviceAccountEmail: z2.string()
|
|
433
459
|
}),
|
|
434
460
|
z2.object({
|
|
435
461
|
success: z2.literal(false),
|
|
@@ -483,7 +509,8 @@ var requestWithDelegationTool = new ConnectorTool({
|
|
|
483
509
|
serviceAccountEmail
|
|
484
510
|
};
|
|
485
511
|
}
|
|
486
|
-
|
|
512
|
+
const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT2);
|
|
513
|
+
let url = `${BASE_URL3}${normalizedPath}`;
|
|
487
514
|
if (queryParams) {
|
|
488
515
|
const searchParams = new URLSearchParams(queryParams);
|
|
489
516
|
url += `?${searchParams.toString()}`;
|
|
@@ -511,7 +538,12 @@ var requestWithDelegationTool = new ConnectorTool({
|
|
|
511
538
|
serviceAccountEmail
|
|
512
539
|
};
|
|
513
540
|
}
|
|
514
|
-
return {
|
|
541
|
+
return {
|
|
542
|
+
success: true,
|
|
543
|
+
status: response.status,
|
|
544
|
+
data,
|
|
545
|
+
serviceAccountEmail
|
|
546
|
+
};
|
|
515
547
|
} finally {
|
|
516
548
|
clearTimeout(timeout);
|
|
517
549
|
}
|
|
@@ -533,7 +565,18 @@ var READONLY_SCOPES = '["https://www.googleapis.com/auth/calendar.readonly"]';
|
|
|
533
565
|
var SERVICE_ACCOUNT_KEY_PARAM_SLUG = parameters.serviceAccountKeyJsonBase64.slug;
|
|
534
566
|
var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
535
567
|
connectionSetupInstructions: {
|
|
536
|
-
ja: `Google Calendar \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u307E\u3059\u3002\u30A2\u30AF\u30BB\u30B9\u65B9\u6CD5\u3092\u9078\u3093\u3067\u3082\u3089\u3044\u3001\u5BFE\u8C61\u30AB\u30EC\u30F3\u30C0\u30FC\u3092
|
|
568
|
+
ja: `Google Calendar \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u3092\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3057\u307E\u3059\u3002\u30A2\u30AF\u30BB\u30B9\u65B9\u6CD5\u3092\u9078\u3093\u3067\u3082\u3089\u3044\u3001\u5BFE\u8C61\u30AB\u30EC\u30F3\u30C0\u30FC\u3092 Project Knowledge \u306B\u8A18\u9332\u3057\u307E\u3059\u3002
|
|
569
|
+
|
|
570
|
+
## \u30B9\u30C6\u30C3\u30D7 0: \u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u53D6\u5F97
|
|
571
|
+
|
|
572
|
+
\u4EE5\u964D\u306E\u30B9\u30C6\u30C3\u30D7\u3067\u30E6\u30FC\u30B6\u30FC\u306B\u6848\u5185\u3059\u308B\u305F\u3081\u306B\u3001\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
573
|
+
|
|
574
|
+
\`${requestToolName}\` \u3092\u4EE5\u4E0B\u306E\u5F15\u6570\u3067 1 \u56DE\u547C\u3073\u3001\u30EC\u30B9\u30DD\u30F3\u30B9\u306E \`serviceAccountEmail\` \u3092\u4FDD\u6301\u3059\u308B:
|
|
575
|
+
- \`method\`: \`"GET"\`
|
|
576
|
+
- \`path\`: \`"/users/me/calendarList"\`
|
|
577
|
+
- \`scopes\`: \`${READONLY_SCOPES}\`
|
|
578
|
+
|
|
579
|
+
\u6210\u529F\u30FB\u5931\u6557\u3069\u3061\u3089\u3067\u3082 \`serviceAccountEmail\` \u306F\u8FD4\u3063\u3066\u304F\u308B\u306E\u3067\u3001\u7D50\u679C\u306E\u30EA\u30B9\u30C8\u306F\u3053\u306E\u30B9\u30C6\u30C3\u30D7\u3067\u306F\u7121\u8996\u3057\u3066\u3088\u3044\u3002\u4EE5\u964D\u3053\u306E\u5024\u3092 \`<serviceAccountEmail>\` \u3068\u3057\u3066\u53C2\u7167\u3059\u308B\u3002
|
|
537
580
|
|
|
538
581
|
## \u30B9\u30C6\u30C3\u30D7 1: \u30A2\u30AF\u30BB\u30B9\u65B9\u6CD5\u3092\u9078\u629E
|
|
539
582
|
|
|
@@ -545,52 +588,58 @@ var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
|
545
588
|
- \`{ label: "\u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u3067\u7D44\u7E54\u306E\u30E6\u30FC\u30B6\u30FC\u306E\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u30A2\u30AF\u30BB\u30B9\u3059\u308B", value: "delegation" }\`
|
|
546
589
|
- \`{ label: "\u4E21\u65B9\u3092\u7D44\u307F\u5408\u308F\u305B\u308B", value: "both" }\`
|
|
547
590
|
|
|
548
|
-
## \u30B9\u30C6\u30C3\u30D7 2: \u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u7D4C\u8DEF
|
|
591
|
+
## \u30B9\u30C6\u30C3\u30D7 2: \u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u7D4C\u8DEF (\`"service-account"\` \u307E\u305F\u306F \`"both"\` \u306E\u5834\u5408)
|
|
592
|
+
|
|
593
|
+
\u30E6\u30FC\u30B6\u30FC\u304C\u3042\u3089\u304B\u3058\u3081\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8 \`<serviceAccountEmail>\` \u306B\u5171\u6709\u8A2D\u5B9A\u3057\u305F\u30AB\u30EC\u30F3\u30C0\u30FC\u306E ID \u3092\u76F4\u63A5\u53D7\u3051\u53D6\u308A\u3001\u758E\u901A\u78BA\u8A8D\u3057\u307E\u3059\u3002multiSelect \u306F\u51FA\u3055\u306A\u3044 (\u30E6\u30FC\u30B6\u30FC\u304C\u5165\u529B\u3057\u305F\u6642\u70B9\u3067\u5BFE\u8C61\u304C\u78BA\u5B9A\u3057\u3066\u3044\u308B\u305F\u3081)\u3002
|
|
594
|
+
|
|
595
|
+
1. \`askUserQuestion\` \u3067\u30AB\u30EC\u30F3\u30C0\u30FC ID \u3092\u805E\u304F:
|
|
596
|
+
- \`type\`: \`"freeText"\`
|
|
597
|
+
- \`question\`: \u300C\u30A2\u30AF\u30BB\u30B9\u3057\u305F\u3044\u30AB\u30EC\u30F3\u30C0\u30FC\u306E ID \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u8907\u6570\u53EF\u3001\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09\u3002\u3042\u3089\u304B\u3058\u3081 \`<serviceAccountEmail>\` \u306B\u5171\u6709\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\u30E1\u30A4\u30F3\u30AB\u30EC\u30F3\u30C0\u30FC\u306F\u6240\u6709\u8005\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u305D\u306E\u307E\u307E\u5165\u529B\u3067\u304D\u307E\u3059\u3002\u305D\u308C\u4EE5\u5916\u306E\u30AB\u30EC\u30F3\u30C0\u30FC\uFF08\u30C1\u30FC\u30E0\u30AB\u30EC\u30F3\u30C0\u30FC\u7B49\uFF09\u306F Google Calendar \u306E\u8A2D\u5B9A\u304B\u3089\u300C\u30AB\u30EC\u30F3\u30C0\u30FC ID\u300D\u3092\u30B3\u30D4\u30FC\u3057\u3066\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u300D
|
|
598
|
+
- \`placeholder\`: \`"alice@example.com, c_xxx@group.calendar.google.com"\`
|
|
549
599
|
|
|
550
|
-
|
|
600
|
+
2. \u5165\u529B\u3055\u308C\u305F\u5404\u30AB\u30EC\u30F3\u30C0\u30FC ID \`<id>\` \u306B\u3064\u3044\u3066 \`${requestToolName}\` \u3067\u758E\u901A\u78BA\u8A8D:
|
|
551
601
|
- \`method\`: \`"GET"\`
|
|
552
|
-
- \`path\`: \`"/
|
|
602
|
+
- \`path\`: \`"/calendars/<id>"\`
|
|
553
603
|
- \`scopes\`: \`${READONLY_SCOPES}\`
|
|
604
|
+
- \u6210\u529F\u3059\u308C\u3070\u3001\u30EC\u30B9\u30DD\u30F3\u30B9 \`data.summary\` \u3092\u30AB\u30EC\u30F3\u30C0\u30FC\u540D\u3068\u3057\u3066\u4FDD\u6301
|
|
605
|
+
- \u5931\u6557 (404 / 403 \u7B49) \u306F\u30A2\u30AF\u30BB\u30B9\u4E0D\u53EF\u3068\u3057\u3066\u8A18\u9332
|
|
554
606
|
|
|
555
|
-
|
|
556
|
-
- \
|
|
557
|
-
- \
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
- \`options\`: \u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u3064\u3044\u3066 \`label\`: \`"<\u30AB\u30EC\u30F3\u30C0\u30FC\u540D>"\`\u3001\`value\`: \`"<calendarId>"\`
|
|
607
|
+
3. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
608
|
+
- **\u5168 ID \u5931\u6557**: \u30A2\u30AF\u30BB\u30B9\u65B9\u6CD5\u304C \`"service-account"\` \u3060\u3051\u306A\u3089\u30B9\u30C6\u30C3\u30D7 5 \u3078\u3002\`"both"\` \u306E\u5834\u5408\u306F\u305D\u306E\u307E\u307E\u30B9\u30C6\u30C3\u30D7 3 \u3078\u9032\u3080
|
|
609
|
+
- **\u4E00\u90E8\u307E\u305F\u306F\u5168\u4EF6\u6210\u529F**: \u6210\u529F\u3057\u305F\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u305D\u306E\u307E\u307E\u30B9\u30C6\u30C3\u30D7 4 \u7528\u306E\u9078\u629E\u7D50\u679C\u3068\u3057\u3066\u78BA\u5B9A\u3059\u308B\u3002\u5931\u6557\u304C\u3042\u308C\u3070\u3001\u305D\u306E\u65E8\u3092 1 \u6587\u3067\u77ED\u304F\u4F1D\u3048\u308B
|
|
610
|
+
|
|
611
|
+
## \u30B9\u30C6\u30C3\u30D7 3: \u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u7D4C\u8DEF (\`"delegation"\` \u307E\u305F\u306F \`"both"\` \u306E\u5834\u5408)
|
|
561
612
|
|
|
562
|
-
|
|
613
|
+
\u5404 Workspace \u30E6\u30FC\u30B6\u30FC\u304C\u6301\u3063\u3066\u3044\u308B\u591A\u6570\u306E\u30AB\u30EC\u30F3\u30C0\u30FC\u304B\u3089\u3001\u5BFE\u8C61\u3092\u7D5E\u308A\u8FBC\u307F\u307E\u3059\u3002
|
|
563
614
|
|
|
564
615
|
1. \`askUserQuestion\` \u3067\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u805E\u304F:
|
|
565
616
|
- \`type\`: \`"freeText"\`
|
|
566
|
-
- \`question\`: \u300C\u30A2\u30AF\u30BB\u30B9\u3057\u305F\u3044\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u6240\u6709\u3059\u308B Google Workspace \u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u8907\u6570\u53EF\u3001\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09\u3002Workspace \u7BA1\u7406\u8005\u304C\
|
|
617
|
+
- \`question\`: \u300C\u30A2\u30AF\u30BB\u30B9\u3057\u305F\u3044\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u6240\u6709\u3059\u308B Google Workspace \u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u8907\u6570\u53EF\u3001\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09\u3002Workspace \u7BA1\u7406\u8005\u304C\u3042\u3089\u304B\u3058\u3081\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8 \`<serviceAccountEmail>\` \u306B\u5BFE\u3057\u3066\u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u3092\u627F\u8A8D\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\uFF08[\u7BA1\u7406\u8005\u5411\u3051\u8A2D\u5B9A\u30AC\u30A4\u30C9](https://support.google.com/a/answer/162106)\uFF09\u3002\u300D
|
|
567
618
|
- \`placeholder\`: \`"alice@example.com, bob@example.com"\`
|
|
568
619
|
|
|
569
|
-
2. \
|
|
620
|
+
2. \u5165\u529B\u3055\u308C\u305F\u5404\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9 \`<email>\` \u306B\u3064\u3044\u3066 \`${requestWithDelegationToolName}\` \u3092\u547C\u3073\u3001\u305D\u306E\u30E6\u30FC\u30B6\u30FC\u304C\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u308B\u30AB\u30EC\u30F3\u30C0\u30FC\u4E00\u89A7\u3092\u53D6\u5F97:
|
|
570
621
|
- \`method\`: \`"GET"\`
|
|
571
622
|
- \`path\`: \`"/users/me/calendarList"\`
|
|
572
623
|
- \`subject\`: \`<email>\`
|
|
573
624
|
- \`scopes\`: \`${READONLY_SCOPES}\`
|
|
574
625
|
|
|
575
|
-
3. \
|
|
576
|
-
-
|
|
577
|
-
-
|
|
626
|
+
3. \u7D50\u679C\u306B\u5FDC\u3058\u3066\u5206\u5C90:
|
|
627
|
+
- **\u5168 email \u3067\u5931\u6557**: \u30A2\u30AF\u30BB\u30B9\u65B9\u6CD5\u304C \`"delegation"\` \u3060\u3051\u3001\u307E\u305F\u306F \`"both"\` \u3067\u30B9\u30C6\u30C3\u30D7 2 \u3067\u3082 0 \u4EF6\u306E\u3068\u304D\u306F\u30B9\u30C6\u30C3\u30D7 5 \u3078\u3002\`"both"\` \u3067\u30B9\u30C6\u30C3\u30D7 2 \u306B\u30AB\u30EC\u30F3\u30C0\u30FC\u304C\u3042\u308C\u3070\u3001\u305D\u306E\u307E\u307E\u30B9\u30C6\u30C3\u30D7 4 \u3078\u9032\u3080
|
|
628
|
+
- **\u4E00\u90E8\u307E\u305F\u306F\u5168\u4EF6\u6210\u529F**: \`askUserQuestion\` \u3067\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u7D5E\u308A\u8FBC\u307E\u305B\u308B
|
|
578
629
|
- \`type\`: \`"multiSelect"\`
|
|
579
630
|
- \`question\`: \u300C\u4F7F\u7528\u3059\u308B\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u8907\u6570\u53EF\uFF09\u300D
|
|
580
|
-
- \`options\`: \u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u3064\u3044\u3066 \`label\`: \`"<\u30AB\u30EC\u30F3\u30C0\u30FC\u540D> (\u6240\u6709\u8005: <\u305D\u306E\u3068\u304D\u306E subject>)"\`\u3001\`value\`: \`"<calendarId>"\`
|
|
631
|
+
- \`options\`: \u767A\u898B\u3057\u305F\u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u3064\u3044\u3066 \`label\`: \`"<\u30AB\u30EC\u30F3\u30C0\u30FC\u540D> (\u6240\u6709\u8005: <\u305D\u306E\u3068\u304D\u306E subject>)"\`\u3001\`value\`: \`"<calendarId>"\`
|
|
581
632
|
- \u4E00\u90E8\u5931\u6557\u304C\u3042\u308C\u3070\u3001\u305D\u306E\u65E8\u3092 1 \u6587\u3067\u77ED\u304F\u4F1D\u3048\u308B
|
|
582
633
|
|
|
583
634
|
## \u30B9\u30C6\u30C3\u30D7 4: Project Knowledge \u306B\u8A18\u9332
|
|
584
635
|
|
|
585
|
-
\u30B9\u30C6\u30C3\u30D7 2 \u3068 3 \u3067\
|
|
586
|
-
- \u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u7D4C\u7531: \`- calendar: <calendarId> (delegation, subject: <subject>, name: "<\u30AB\u30EC\u30F3\u30C0\u30FC\u540D>")\`
|
|
587
|
-
- \u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u7D4C\u8DEF: \`- calendar: <calendarId> (service-account, name: "<\u30AB\u30EC\u30F3\u30C0\u30FC\u540D>")\`
|
|
636
|
+
\u30B9\u30C6\u30C3\u30D7 2 \u3068 3 \u3067\u78BA\u5B9A\u3057\u305F calendarId \u96C6\u5408\u3092\u7D71\u5408\u3059\u308B\u3002\u5404 calendarId \u306B\u3064\u3044\u3066\u3001\u30B9\u30C6\u30C3\u30D7 2 \u3067\u758E\u901A\u78BA\u8A8D\u3057\u305F\u7D50\u679C\u304B\u3001\u30B9\u30C6\u30C3\u30D7 3 \u306E\u30C7\u30A3\u30B9\u30AB\u30D0\u30EA\u7D50\u679C\u304B\u3089\u7D4C\u8DEF\u3068 (delegation \u306E\u5834\u5408\u306F) subject \u3092\u7279\u5B9A\u3059\u308B\u3002\`finalizeSetup\` \u3092\u547C\u3073\u3001\u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u300C\u30AB\u30EC\u30F3\u30C0\u30FC\u540D\u30FB\u30AB\u30EC\u30F3\u30C0\u30FC ID\u30FB\u30A2\u30AF\u30BB\u30B9\u7D4C\u8DEF\uFF08delegation \u304B service-account \u304B\uFF09\u30FBdelegation \u306E\u5834\u5408\u306F subject\u300D\u3068\u3068\u3082\u306B\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30B3\u30FC\u30D7\u60C5\u5831\u3068\u3057\u3066\u8A18\u9332\u3059\u308B\u3002
|
|
588
637
|
|
|
589
|
-
## \u30B9\u30C6\u30C3\u30D7 5: \u6700\u7D42\u7684\u306B\u30AB\u30EC\u30F3\u30C0\u30FC\u304C 0 \u4EF6\u306E\
|
|
638
|
+
## \u30B9\u30C6\u30C3\u30D7 5: \u6700\u7D42\u7684\u306B\u30AB\u30EC\u30F3\u30C0\u30FC\u304C 0 \u4EF6\u306E\u3068\u304D\u306E\u30A8\u30B9\u30AB\u30EC\u30FC\u30B7\u30E7\u30F3
|
|
590
639
|
|
|
591
|
-
\u6700\u7D42\u7684\u306B\
|
|
640
|
+
\u6700\u7D42\u7684\u306B\u5BFE\u8C61\u30AB\u30EC\u30F3\u30C0\u30FC\u304C 1 \u4EF6\u3082\u306A\u3044\u5834\u5408\u3001\`askUserQuestion\` \u3067\u6B21\u306E\u3088\u3046\u306B\u6848\u5185\u3059\u308B:
|
|
592
641
|
|
|
593
|
-
- \`question\`: \u300C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30AB\u30EC\u30F3\u30C0\u30FC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u6B21\u306E\u3044\u305A\u308C\u304B\u3092\u884C\u3063\u3066\u304B\u3089\u7D9A\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\
|
|
642
|
+
- \`question\`: \u300C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30AB\u30EC\u30F3\u30C0\u30FC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8 \`<serviceAccountEmail>\` \u3067\u6B21\u306E\u3044\u305A\u308C\u304B\u3092\u884C\u3063\u3066\u304B\u3089\u7D9A\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u300D
|
|
594
643
|
- \`options\`: \u3053\u3053\u307E\u3067\u306B\u8A66\u3057\u305F\u7D4C\u8DEF\u306B\u5FDC\u3058\u3066\u4EE5\u4E0B\u3092\u7D44\u307F\u5408\u308F\u305B\u308B:
|
|
595
644
|
- \u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u7D4C\u8DEF\u3092\u8A66\u3057\u305F\u5834\u5408: \`{ label: "\u5BFE\u8C61\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u306B\u5171\u6709\u3057\u305F\u306E\u3067\u30EA\u30C8\u30E9\u30A4", value: "retry" }\`
|
|
596
645
|
- \u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u7D4C\u8DEF\u3092\u8A66\u3057\u305F\u5834\u5408: \`{ label: "\u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u3092\u627F\u8A8D\u3057\u305F\u306E\u3067\u30EA\u30C8\u30E9\u30A4", value: "retry" }\`
|
|
@@ -598,17 +647,28 @@ var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
|
598
647
|
- \u5E38\u306B: \`{ label: "\u5225\u306E\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u8A2D\u5B9A\u3057\u76F4\u3059", value: "change-service-account" }\`
|
|
599
648
|
|
|
600
649
|
\u9078\u629E\u7D50\u679C\u306B\u5FDC\u3058\u305F\u6319\u52D5:
|
|
601
|
-
- "retry": \u76F4\u524D\u306E\u7D4C\u8DEF\u3092\u518D probe (\
|
|
650
|
+
- "retry": \u76F4\u524D\u306E\u7D4C\u8DEF\u3092\u518D probe (\u30EA\u30C8\u30E9\u30A4\u306E\u4ED5\u65B9\u306F\u30A8\u30FC\u30B8\u30A7\u30F3\u30C8\u304C\u6587\u8108\u306B\u5FDC\u3058\u3066\u5224\u65AD)
|
|
602
651
|
- "restart": \u30B9\u30C6\u30C3\u30D7 1 \u304B\u3089\u518D\u5B9F\u884C
|
|
603
652
|
- "change-service-account": \`updateConnectionParameters\` \u3092\u547C\u3093\u3067\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8 JSON \u3092\u518D\u5165\u529B\u3055\u305B\u308B:
|
|
604
653
|
- \`parameterSlug\`: \`"${SERVICE_ACCOUNT_KEY_PARAM_SLUG}"\`
|
|
605
|
-
- \u5B8C\u4E86\u5F8C\u3001\u30B9\u30C6\u30C3\u30D7
|
|
654
|
+
- \u5B8C\u4E86\u5F8C\u3001\u30B9\u30C6\u30C3\u30D7 0 \u304B\u3089\u518D\u5B9F\u884C
|
|
606
655
|
|
|
607
656
|
## \u5236\u7D04
|
|
608
657
|
|
|
609
658
|
- \u4E0A\u8A18\u4EE5\u5916\u306E API \u547C\u3073\u51FA\u3057\u3092 setup \u4E2D\u306B\u884C\u308F\u306A\u3044
|
|
610
659
|
- \u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u306E\u9593\u306F 1 \u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057`,
|
|
611
|
-
en: `Set up the Google Calendar connection. Ask the user how they want to access calendars
|
|
660
|
+
en: `Set up the Google Calendar connection. Ask the user how they want to access calendars and record the target calendars in Project Knowledge.
|
|
661
|
+
|
|
662
|
+
## Step 0: Get the service account email
|
|
663
|
+
|
|
664
|
+
We need the service account email so we can show it to the user in the next steps.
|
|
665
|
+
|
|
666
|
+
Call \`${requestToolName}\` once and remember the \`serviceAccountEmail\` from the response:
|
|
667
|
+
- \`method\`: \`"GET"\`
|
|
668
|
+
- \`path\`: \`"/users/me/calendarList"\`
|
|
669
|
+
- \`scopes\`: \`${READONLY_SCOPES}\`
|
|
670
|
+
|
|
671
|
+
\`serviceAccountEmail\` is returned regardless of success or failure, so the list payload itself can be ignored at this stage. Refer to the captured value as \`<serviceAccountEmail>\` in the steps below.
|
|
612
672
|
|
|
613
673
|
## Step 1: Choose the access method
|
|
614
674
|
|
|
@@ -620,50 +680,56 @@ Call \`askUserQuestion\`:
|
|
|
620
680
|
- \`{ label: "Calendars of users in your organization (via Domain-wide Delegation)", value: "delegation" }\`
|
|
621
681
|
- \`{ label: "Both", value: "both" }\`
|
|
622
682
|
|
|
623
|
-
## Step 2:
|
|
683
|
+
## Step 2: Service-account path (when \`"service-account"\` or \`"both"\`)
|
|
624
684
|
|
|
625
|
-
|
|
685
|
+
Take calendar IDs that the user has already shared with \`<serviceAccountEmail>\`, and verify each one. No multiSelect step (the user has already specified which calendars to use by entering their IDs).
|
|
686
|
+
|
|
687
|
+
1. Ask the user for calendar IDs:
|
|
688
|
+
- \`type\`: \`"freeText"\`
|
|
689
|
+
- \`question\`: "Enter the IDs of the calendars you want to access (comma-separated for multiple). Each calendar must already be shared with \`<serviceAccountEmail>\`. For someone's primary calendar you can enter their email address directly. For other calendars (such as team calendars), copy the 'Calendar ID' from the calendar settings in Google Calendar."
|
|
690
|
+
- \`placeholder\`: \`"alice@example.com, c_xxx@group.calendar.google.com"\`
|
|
691
|
+
|
|
692
|
+
2. For each calendar ID \`<id>\`, verify access by calling \`${requestToolName}\`:
|
|
626
693
|
- \`method\`: \`"GET"\`
|
|
627
|
-
- \`path\`: \`"/
|
|
694
|
+
- \`path\`: \`"/calendars/<id>"\`
|
|
628
695
|
- \`scopes\`: \`${READONLY_SCOPES}\`
|
|
696
|
+
- On success, capture \`data.summary\` as the calendar name
|
|
697
|
+
- On failure (404 / 403 / etc.), record the ID as inaccessible
|
|
629
698
|
|
|
630
|
-
|
|
631
|
-
-
|
|
632
|
-
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
- \`options\`: For each calendar, \`label\`: \`"<calendar name>"\`, \`value\`: \`"<calendarId>"\`
|
|
699
|
+
3. Branch on the results:
|
|
700
|
+
- **All IDs failed**: if the access method is \`"service-account"\` only, jump to Step 5. If \`"both"\`, continue to Step 3.
|
|
701
|
+
- **Any success**: take the verified calendars as the selection for Step 4. If some failed, mention them briefly in one sentence.
|
|
702
|
+
|
|
703
|
+
## Step 3: Domain-wide Delegation path (when \`"delegation"\` or \`"both"\`)
|
|
636
704
|
|
|
637
|
-
|
|
705
|
+
Discover calendars from each Workspace user and let the user narrow them down.
|
|
638
706
|
|
|
639
|
-
1. Ask the user for target emails:
|
|
707
|
+
1. Ask the user for the target Workspace user emails:
|
|
640
708
|
- \`type\`: \`"freeText"\`
|
|
641
|
-
- \`question\`: "Enter the email addresses of the Google Workspace users whose calendars you want to access (comma-separated for multiple). Your Workspace admin must have authorized Domain-wide Delegation for
|
|
709
|
+
- \`question\`: "Enter the email addresses of the Google Workspace users whose calendars you want to access (comma-separated for multiple). Your Workspace admin must have authorized Domain-wide Delegation for service account \`<serviceAccountEmail>\` in advance ([admin setup guide](https://support.google.com/a/answer/162106))."
|
|
642
710
|
- \`placeholder\`: \`"alice@example.com, bob@example.com"\`
|
|
643
711
|
|
|
644
|
-
2.
|
|
712
|
+
2. For each email \`<email>\`, list calendars accessible to that user via \`${requestWithDelegationToolName}\`:
|
|
645
713
|
- \`method\`: \`"GET"\`
|
|
646
714
|
- \`path\`: \`"/users/me/calendarList"\`
|
|
647
715
|
- \`subject\`: \`<email>\`
|
|
648
716
|
- \`scopes\`: \`${READONLY_SCOPES}\`
|
|
649
717
|
|
|
650
718
|
3. Branch on the results:
|
|
651
|
-
- All emails failed
|
|
652
|
-
- Any success
|
|
719
|
+
- **All emails failed**: if the access method is \`"delegation"\` only, or \`"both"\` with no calendars from Step 2, jump to Step 5. If \`"both"\` and Step 2 had calendars, continue to Step 4.
|
|
720
|
+
- **Any success**: ask the user to narrow down via \`askUserQuestion\`:
|
|
653
721
|
- \`type\`: \`"multiSelect"\`
|
|
654
722
|
- \`question\`: "Select the calendars to use (multiple allowed)"
|
|
655
|
-
- \`options\`: For each calendar, \`label\`: \`"<calendar name> (owner: <the subject used>)"\`, \`value\`: \`"<calendarId>"\`
|
|
656
|
-
- If some emails failed, mention
|
|
723
|
+
- \`options\`: For each discovered calendar, \`label\`: \`"<calendar name> (owner: <the subject used>)"\`, \`value\`: \`"<calendarId>"\`
|
|
724
|
+
- If some emails failed, mention them briefly in one sentence.
|
|
657
725
|
|
|
658
726
|
## Step 4: Record in Project Knowledge
|
|
659
727
|
|
|
660
|
-
Aggregate the calendarIds
|
|
661
|
-
- Via Domain-wide Delegation: \`- calendar: <calendarId> (delegation, subject: <subject>, name: "<calendar name>")\`
|
|
662
|
-
- Via service account: \`- calendar: <calendarId> (service-account, name: "<calendar name>")\`
|
|
728
|
+
Aggregate the calendarIds from Steps 2 and 3. Cross-reference each calendarId against the verification result (Step 2) or the discovery result (Step 3) to recover its access path and, for delegation, the subject. Call \`finalizeSetup\` and record each calendar with its name, calendar ID, access path (delegation or service-account), and (for delegation) the subject as this connection's scope info.
|
|
663
729
|
|
|
664
730
|
## Step 5: Escalation when zero calendars are selected
|
|
665
731
|
|
|
666
|
-
|
|
732
|
+
When no calendars end up selected, call \`askUserQuestion\`:
|
|
667
733
|
|
|
668
734
|
- \`question\`: "No accessible calendars found. Please do one of the following before continuing. Service account: \`<serviceAccountEmail>\`."
|
|
669
735
|
- \`options\`: Combine these based on which paths were attempted:
|
|
@@ -673,11 +739,11 @@ If the final selected calendar set is empty (every attempted path returned nothi
|
|
|
673
739
|
- Always: \`{ label: "Use a different service account", value: "change-service-account" }\`
|
|
674
740
|
|
|
675
741
|
Behavior per selection:
|
|
676
|
-
- "retry": re-probe the path that was just attempted (
|
|
742
|
+
- "retry": re-probe the path that was just attempted (the agent decides the exact retry plan)
|
|
677
743
|
- "restart": re-run from Step 1
|
|
678
744
|
- "change-service-account": call \`updateConnectionParameters\` to have the user re-upload the service account JSON:
|
|
679
745
|
- \`parameterSlug\`: \`"${SERVICE_ACCOUNT_KEY_PARAM_SLUG}"\`
|
|
680
|
-
- After it completes, re-run from Step
|
|
746
|
+
- After it completes, re-run from Step 0
|
|
681
747
|
|
|
682
748
|
## Constraints
|
|
683
749
|
|
|
@@ -685,18 +751,18 @@ Behavior per selection:
|
|
|
685
751
|
- Write at most 1 sentence between tool calls`
|
|
686
752
|
},
|
|
687
753
|
dataOverviewInstructions: {
|
|
688
|
-
en: `For each calendar
|
|
689
|
-
-
|
|
690
|
-
-
|
|
754
|
+
en: `For each calendar configured for this connection, fetch metadata and a small sample of upcoming events. Pick the tool that matches the calendar's access path:
|
|
755
|
+
- Calendars accessed via delegation \u2192 \`${requestWithDelegationToolName}\` with the user's email as \`subject\`
|
|
756
|
+
- Calendars shared directly with the service account \u2192 \`${requestToolName}\`
|
|
691
757
|
|
|
692
758
|
Pass \`scopes: ${READONLY_SCOPES}\` for every call.
|
|
693
759
|
|
|
694
760
|
For each calendar:
|
|
695
761
|
1. \`method=GET\`, \`path=/calendars/<id>\` to fetch metadata.
|
|
696
762
|
2. \`method=GET\`, \`path=/calendars/<id>/events\`, \`queryParams={ timeMin: <RFC3339 now>, maxResults: "10", singleEvents: "true", orderBy: "startTime" }\`.`,
|
|
697
|
-
ja:
|
|
698
|
-
-
|
|
699
|
-
-
|
|
763
|
+
ja: `\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u3067\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u3064\u3044\u3066\u3001\u30E1\u30BF\u30C7\u30FC\u30BF\u3068\u76F4\u8FD1\u306E\u30A4\u30D9\u30F3\u30C8\u3092\u5C11\u91CF\u53D6\u5F97\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30A2\u30AF\u30BB\u30B9\u7D4C\u8DEF\u306B\u5FDC\u3058\u3066\u30C4\u30FC\u30EB\u3092\u9078\u3073\u307E\u3059:
|
|
764
|
+
- delegation \u7D4C\u7531\u306E\u30AB\u30EC\u30F3\u30C0\u30FC \u2192 \`${requestWithDelegationToolName}\` \u3092\u3001\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u547C\u3076
|
|
765
|
+
- service account \u306B\u76F4\u63A5\u5171\u6709\u3055\u308C\u305F\u30AB\u30EC\u30F3\u30C0\u30FC \u2192 \`${requestToolName}\` \u3092\u547C\u3076
|
|
700
766
|
|
|
701
767
|
\`scopes\` \u306F\u6BCE\u56DE \`${READONLY_SCOPES}\` \u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
|
702
768
|
|
|
@@ -719,6 +785,7 @@ var googleCalendarConnector = new ConnectorPlugin({
|
|
|
719
785
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2YsqoBEpdELmfDeFcyGHyE/4494c633b5ae15e562cb739cd85442c1/google-calendar.png",
|
|
720
786
|
parameters,
|
|
721
787
|
releaseFlag: { dev1: true, dev2: true, prod: true },
|
|
788
|
+
categories: ["productivity"],
|
|
722
789
|
onboarding: googleCalendarOnboarding,
|
|
723
790
|
systemPrompt: {
|
|
724
791
|
en: `### Tools
|
|
@@ -744,10 +811,10 @@ Per-endpoint scope reference: https://developers.google.com/calendar/api/auth
|
|
|
744
811
|
|
|
745
812
|
### Choosing the right tool
|
|
746
813
|
|
|
747
|
-
|
|
814
|
+
Each calendar configured for this connection has an access path. Match the path to the tool:
|
|
748
815
|
|
|
749
|
-
-
|
|
750
|
-
-
|
|
816
|
+
- A Workspace user's calendar accessed via Domain-wide Delegation \u2192 use \`request_with_delegation\` and pass that user's email as \`subject\`
|
|
817
|
+
- A calendar shared directly with the service account \u2192 use \`request\` (no \`subject\`)
|
|
751
818
|
|
|
752
819
|
### Path conventions
|
|
753
820
|
|
|
@@ -802,14 +869,14 @@ export default async function handler(c: Context) {
|
|
|
802
869
|
orderBy: "startTime",
|
|
803
870
|
});
|
|
804
871
|
|
|
805
|
-
//
|
|
872
|
+
// alice@example.com is accessed via delegation
|
|
806
873
|
const aliceRes = await calendar.requestWithDelegation(
|
|
807
874
|
\`/calendars/alice@example.com/events?\${qs}\`,
|
|
808
875
|
{ subject: "alice@example.com", scopes: READ },
|
|
809
876
|
);
|
|
810
877
|
const alice = await aliceRes.json();
|
|
811
878
|
|
|
812
|
-
//
|
|
879
|
+
// team@example.com is shared directly with the service account
|
|
813
880
|
const teamRes = await calendar.request(
|
|
814
881
|
\`/calendars/team@example.com/events?\${qs}\`,
|
|
815
882
|
{ scopes: READ },
|
|
@@ -842,10 +909,10 @@ export default async function handler(c: Context) {
|
|
|
842
909
|
|
|
843
910
|
### \u9069\u5207\u306A\u30C4\u30FC\u30EB\u306E\u9078\u3073\u65B9
|
|
844
911
|
|
|
845
|
-
\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\
|
|
912
|
+
\u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u3067\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u5404\u30AB\u30EC\u30F3\u30C0\u30FC\u306B\u306F\u30A2\u30AF\u30BB\u30B9\u7D4C\u8DEF\u304C\u3042\u308A\u307E\u3059\u3002\u7D4C\u8DEF\u306B\u5FDC\u3058\u3066\u30C4\u30FC\u30EB\u3092\u9078\u3093\u3067\u304F\u3060\u3055\u3044:
|
|
846
913
|
|
|
847
|
-
-
|
|
848
|
-
-
|
|
914
|
+
- delegation \u7D4C\u7531\uFF08Workspace \u30E6\u30FC\u30B6\u30FC\u306E\u30AB\u30EC\u30F3\u30C0\u30FC\u306B Domain-wide Delegation \u3067\u30A2\u30AF\u30BB\u30B9\uFF09\u2192 \`request_with_delegation\` \u3092\u4F7F\u3044\u3001\u5BFE\u8C61\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`subject\` \u3068\u3057\u3066\u6E21\u3059
|
|
915
|
+
- service account \u7D4C\u7531\uFF08\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u306B\u76F4\u63A5\u5171\u6709\u3055\u308C\u305F\u30AB\u30EC\u30F3\u30C0\u30FC\uFF09\u2192 \`request\` \u3092\u4F7F\u3046\uFF08\`subject\` \u4E0D\u8981\uFF09
|
|
849
916
|
|
|
850
917
|
### \u30D1\u30B9\u306E\u66F8\u304D\u65B9
|
|
851
918
|
|
|
@@ -900,14 +967,14 @@ export default async function handler(c: Context) {
|
|
|
900
967
|
orderBy: "startTime",
|
|
901
968
|
});
|
|
902
969
|
|
|
903
|
-
//
|
|
970
|
+
// alice@example.com \u306F delegation \u7D4C\u8DEF\u3067\u30A2\u30AF\u30BB\u30B9
|
|
904
971
|
const aliceRes = await calendar.requestWithDelegation(
|
|
905
972
|
\`/calendars/alice@example.com/events?\${qs}\`,
|
|
906
973
|
{ subject: "alice@example.com", scopes: READ },
|
|
907
974
|
);
|
|
908
975
|
const alice = await aliceRes.json();
|
|
909
976
|
|
|
910
|
-
//
|
|
977
|
+
// team@example.com \u306F SA \u306B\u76F4\u63A5\u5171\u6709
|
|
911
978
|
const teamRes = await calendar.request(
|
|
912
979
|
\`/calendars/team@example.com/events?\${qs}\`,
|
|
913
980
|
{ scopes: READ },
|
|
@@ -107,6 +107,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
107
107
|
releaseFlag;
|
|
108
108
|
proxyPolicy;
|
|
109
109
|
experimentalAttributes;
|
|
110
|
+
categories;
|
|
110
111
|
onboarding;
|
|
111
112
|
systemPrompt;
|
|
112
113
|
tools;
|
|
@@ -122,6 +123,7 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
122
123
|
this.releaseFlag = config.releaseFlag;
|
|
123
124
|
this.proxyPolicy = config.proxyPolicy;
|
|
124
125
|
this.experimentalAttributes = config.experimentalAttributes;
|
|
126
|
+
this.categories = config.categories ?? [];
|
|
125
127
|
this.onboarding = config.onboarding;
|
|
126
128
|
this.systemPrompt = config.systemPrompt;
|
|
127
129
|
this.tools = config.tools;
|
|
@@ -201,6 +203,16 @@ var AUTH_TYPES = {
|
|
|
201
203
|
USER_PASSWORD: "user-password"
|
|
202
204
|
};
|
|
203
205
|
|
|
206
|
+
// ../connectors/src/lib/normalize-path.ts
|
|
207
|
+
function normalizeRequestPath(path2, basePathSegment) {
|
|
208
|
+
let p = path2.trim();
|
|
209
|
+
if (!p.startsWith("/")) p = "/" + p;
|
|
210
|
+
if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
|
|
211
|
+
p = p.slice(basePathSegment.length) || "/";
|
|
212
|
+
}
|
|
213
|
+
return p;
|
|
214
|
+
}
|
|
215
|
+
|
|
204
216
|
// ../connectors/src/connectors/google-docs/setup.ts
|
|
205
217
|
var googleDocsOnboarding = new ConnectorOnboarding({
|
|
206
218
|
dataOverviewInstructions: {
|
|
@@ -216,7 +228,9 @@ var parameters = {};
|
|
|
216
228
|
|
|
217
229
|
// ../connectors/src/connectors/google-docs/tools/request.ts
|
|
218
230
|
import { z } from "zod";
|
|
219
|
-
var
|
|
231
|
+
var DOCS_BASE_HOST = "https://docs.googleapis.com";
|
|
232
|
+
var DOCS_BASE_PATH_SEGMENT = "/v1/documents";
|
|
233
|
+
var DOCS_BASE_URL2 = `${DOCS_BASE_HOST}${DOCS_BASE_PATH_SEGMENT}`;
|
|
220
234
|
var REQUEST_TIMEOUT_MS = 6e4;
|
|
221
235
|
var cachedToken = null;
|
|
222
236
|
async function getProxyToken(config) {
|
|
@@ -291,7 +305,11 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
291
305
|
`[connector-request] google-docs/${connection2.name}: ${method} ${path2}`
|
|
292
306
|
);
|
|
293
307
|
try {
|
|
294
|
-
|
|
308
|
+
const normalizedPath = normalizeRequestPath(
|
|
309
|
+
path2,
|
|
310
|
+
DOCS_BASE_PATH_SEGMENT
|
|
311
|
+
);
|
|
312
|
+
let url = `${DOCS_BASE_URL2}${normalizedPath === "/" ? "" : normalizedPath}`;
|
|
295
313
|
if (queryParams) {
|
|
296
314
|
const searchParams = new URLSearchParams(queryParams);
|
|
297
315
|
url += `?${searchParams.toString()}`;
|
|
@@ -342,6 +360,7 @@ var googleDocsConnector = new ConnectorPlugin({
|
|
|
342
360
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6vvcGJisvXjOumeTvswjzf/e9bb39e453cc0b71a20f26019b23b0d2/google_docs.png",
|
|
343
361
|
parameters,
|
|
344
362
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
363
|
+
categories: ["productivity"],
|
|
345
364
|
onboarding: googleDocsOnboarding,
|
|
346
365
|
proxyPolicy: {
|
|
347
366
|
allowlist: [
|