@squadbase/vite-server 0.1.3-dev.15 → 0.1.3-dev.16
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 +2105 -2700
- package/dist/connectors/airtable-oauth.js +16 -5
- package/dist/connectors/airtable.js +16 -5
- package/dist/connectors/amplitude.js +16 -5
- package/dist/connectors/anthropic.js +16 -5
- package/dist/connectors/asana.js +16 -5
- package/dist/connectors/attio.js +16 -5
- package/dist/connectors/backlog-api-key.js +16 -5
- package/dist/connectors/customerio.js +16 -5
- package/dist/connectors/dbt.js +16 -5
- package/dist/connectors/gamma.js +16 -5
- package/dist/connectors/gemini.js +16 -5
- package/dist/connectors/gmail-oauth.js +16 -5
- package/dist/connectors/gmail.js +68 -34
- package/dist/connectors/google-ads.js +16 -5
- package/dist/connectors/google-analytics-oauth.js +16 -5
- package/dist/connectors/google-analytics.js +16 -5
- package/dist/connectors/google-calendar-oauth.js +16 -5
- package/dist/connectors/google-calendar.js +71 -48
- package/dist/connectors/{google-drive-oauth.d.ts → google-docs.d.ts} +1 -1
- package/dist/connectors/google-docs.js +585 -0
- package/dist/connectors/google-drive.d.ts +1 -1
- package/dist/connectors/google-drive.js +391 -327
- package/dist/connectors/google-sheets.d.ts +1 -1
- package/dist/connectors/google-sheets.js +210 -280
- package/dist/connectors/google-slides.d.ts +1 -1
- package/dist/connectors/google-slides.js +198 -335
- package/dist/connectors/grafana.js +16 -5
- package/dist/connectors/hubspot-oauth.js +16 -5
- package/dist/connectors/hubspot.js +16 -5
- package/dist/connectors/intercom-oauth.js +16 -5
- package/dist/connectors/intercom.js +16 -5
- package/dist/connectors/jira-api-key.js +16 -5
- package/dist/connectors/kintone-api-token.js +133 -59
- package/dist/connectors/kintone.js +16 -5
- package/dist/connectors/linkedin-ads.js +16 -5
- package/dist/connectors/mailchimp-oauth.js +16 -5
- package/dist/connectors/mailchimp.js +16 -5
- package/dist/connectors/mixpanel.js +16 -5
- package/dist/connectors/notion-oauth.js +16 -5
- package/dist/connectors/notion.js +16 -5
- package/dist/connectors/openai.js +16 -5
- package/dist/connectors/sentry.js +16 -5
- package/dist/connectors/shopify-oauth.js +16 -5
- package/dist/connectors/shopify.js +16 -5
- package/dist/connectors/stripe-api-key.js +16 -5
- package/dist/connectors/stripe-oauth.js +16 -5
- package/dist/connectors/wix-store.js +16 -5
- package/dist/connectors/zendesk-oauth.js +16 -5
- package/dist/connectors/zendesk.js +16 -5
- package/dist/index.js +2100 -2695
- package/dist/main.js +2100 -2695
- package/dist/vite-plugin.js +2100 -2695
- package/package.json +7 -15
- package/dist/connectors/google-drive-oauth.js +0 -879
- package/dist/connectors/google-sheets-oauth.d.ts +0 -5
- package/dist/connectors/google-sheets-oauth.js +0 -821
- package/dist/connectors/google-slides-oauth.d.ts +0 -5
- package/dist/connectors/google-slides-oauth.js +0 -742
|
@@ -303,16 +303,27 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
303
303
|
* Filters connections by connectorKey internally.
|
|
304
304
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
305
305
|
*/
|
|
306
|
-
createTools(connections, config) {
|
|
306
|
+
createTools(connections, config, opts) {
|
|
307
307
|
const myConnections = connections.filter(
|
|
308
308
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
309
309
|
);
|
|
310
310
|
const result = {};
|
|
311
311
|
for (const t of Object.values(this.tools)) {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
312
|
+
const tool = t.createTool(myConnections, config);
|
|
313
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
314
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
315
|
+
...tool,
|
|
316
|
+
toModelOutput: async (options) => {
|
|
317
|
+
if (!originalToModelOutput) {
|
|
318
|
+
return opts.truncateOutput(options.output);
|
|
319
|
+
}
|
|
320
|
+
const modelOutput = await originalToModelOutput(options);
|
|
321
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
322
|
+
return opts.truncateOutput(modelOutput.value);
|
|
323
|
+
}
|
|
324
|
+
return modelOutput;
|
|
325
|
+
}
|
|
326
|
+
};
|
|
316
327
|
}
|
|
317
328
|
return result;
|
|
318
329
|
}
|
|
@@ -204,16 +204,27 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
204
204
|
* Filters connections by connectorKey internally.
|
|
205
205
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
206
206
|
*/
|
|
207
|
-
createTools(connections, config) {
|
|
207
|
+
createTools(connections, config, opts) {
|
|
208
208
|
const myConnections = connections.filter(
|
|
209
209
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
210
210
|
);
|
|
211
211
|
const result = {};
|
|
212
212
|
for (const t of Object.values(this.tools)) {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
const tool = t.createTool(myConnections, config);
|
|
214
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
215
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
216
|
+
...tool,
|
|
217
|
+
toModelOutput: async (options) => {
|
|
218
|
+
if (!originalToModelOutput) {
|
|
219
|
+
return opts.truncateOutput(options.output);
|
|
220
|
+
}
|
|
221
|
+
const modelOutput = await originalToModelOutput(options);
|
|
222
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
223
|
+
return opts.truncateOutput(modelOutput.value);
|
|
224
|
+
}
|
|
225
|
+
return modelOutput;
|
|
226
|
+
}
|
|
227
|
+
};
|
|
217
228
|
}
|
|
218
229
|
return result;
|
|
219
230
|
}
|
|
@@ -55,26 +55,26 @@ var parameters = {
|
|
|
55
55
|
type: "base64EncodedJson",
|
|
56
56
|
secret: true,
|
|
57
57
|
required: true
|
|
58
|
-
}),
|
|
59
|
-
impersonateEmail: new ParameterDefinition({
|
|
60
|
-
slug: "impersonate-email",
|
|
61
|
-
name: "User Email Address(es)",
|
|
62
|
-
description: "The email address(es) of the Google Workspace user(s) whose calendar will be accessed via Domain-wide Delegation. Multiple addresses can be provided as a comma-separated list (e.g., 'user1@example.com, user2@example.com') to aggregate accessible calendars across users during setup. After setup completes, this value is overwritten with the owner email of the selected calendar.",
|
|
63
|
-
envVarBaseKey: "GOOGLE_CALENDAR_IMPERSONATE_EMAIL",
|
|
64
|
-
type: "text",
|
|
65
|
-
secret: false,
|
|
66
|
-
required: true
|
|
67
|
-
}),
|
|
68
|
-
calendarId: new ParameterDefinition({
|
|
69
|
-
slug: "calendar-id",
|
|
70
|
-
name: "Default Calendar ID",
|
|
71
|
-
description: "The default Google Calendar ID to use (e.g., 'primary' or an email address like 'user@example.com'). If not set, 'primary' is used.",
|
|
72
|
-
envVarBaseKey: "GOOGLE_CALENDAR_CALENDAR_ID",
|
|
73
|
-
type: "text",
|
|
74
|
-
secret: false,
|
|
75
|
-
required: false
|
|
76
58
|
})
|
|
77
59
|
};
|
|
60
|
+
var impersonateEmailParameter = new ParameterDefinition({
|
|
61
|
+
slug: "impersonate-email",
|
|
62
|
+
name: "User Email Address(es)",
|
|
63
|
+
description: "The email address(es) of the Google Workspace user(s) whose calendar is accessed via Domain-wide Delegation. Collected during the setup flow.",
|
|
64
|
+
envVarBaseKey: "GOOGLE_CALENDAR_IMPERSONATE_EMAIL",
|
|
65
|
+
type: "text",
|
|
66
|
+
secret: false,
|
|
67
|
+
required: false
|
|
68
|
+
});
|
|
69
|
+
var calendarIdParameter = new ParameterDefinition({
|
|
70
|
+
slug: "calendar-id",
|
|
71
|
+
name: "Default Calendar ID",
|
|
72
|
+
description: "The default Google Calendar ID to use (e.g., 'primary' or an email address like 'user@example.com'). If not set, 'primary' is used.",
|
|
73
|
+
envVarBaseKey: "GOOGLE_CALENDAR_CALENDAR_ID",
|
|
74
|
+
type: "text",
|
|
75
|
+
secret: false,
|
|
76
|
+
required: false
|
|
77
|
+
});
|
|
78
78
|
|
|
79
79
|
// ../connectors/src/connectors/google-calendar/sdk/index.ts
|
|
80
80
|
var TOKEN_URL = "https://oauth2.googleapis.com/token";
|
|
@@ -106,8 +106,8 @@ function buildJwt(clientEmail, privateKey, nowSec, subject) {
|
|
|
106
106
|
}
|
|
107
107
|
function createClient(params) {
|
|
108
108
|
const serviceAccountKeyJsonBase64 = params[parameters.serviceAccountKeyJsonBase64.slug];
|
|
109
|
-
const impersonateEmail = params[
|
|
110
|
-
const defaultCalendarId = params[
|
|
109
|
+
const impersonateEmail = params[impersonateEmailParameter.slug];
|
|
110
|
+
const defaultCalendarId = params[calendarIdParameter.slug] ?? "primary";
|
|
111
111
|
if (!serviceAccountKeyJsonBase64) {
|
|
112
112
|
throw new Error(
|
|
113
113
|
`google-calendar: missing required parameter: ${parameters.serviceAccountKeyJsonBase64.slug}`
|
|
@@ -115,7 +115,7 @@ function createClient(params) {
|
|
|
115
115
|
}
|
|
116
116
|
if (!impersonateEmail) {
|
|
117
117
|
throw new Error(
|
|
118
|
-
`google-calendar: missing required parameter: ${
|
|
118
|
+
`google-calendar: missing required parameter: ${impersonateEmailParameter.slug}`
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
let serviceAccountKey;
|
|
@@ -316,16 +316,27 @@ var ConnectorPlugin = class _ConnectorPlugin {
|
|
|
316
316
|
* Filters connections by connectorKey internally.
|
|
317
317
|
* Returns tools keyed as `${connectorKey}_${toolName}`.
|
|
318
318
|
*/
|
|
319
|
-
createTools(connections, config) {
|
|
319
|
+
createTools(connections, config, opts) {
|
|
320
320
|
const myConnections = connections.filter(
|
|
321
321
|
(c) => _ConnectorPlugin.deriveKey(c.connector.slug, c.connector.authType) === this.connectorKey
|
|
322
322
|
);
|
|
323
323
|
const result = {};
|
|
324
324
|
for (const t of Object.values(this.tools)) {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
const tool = t.createTool(myConnections, config);
|
|
326
|
+
const originalToModelOutput = tool.toModelOutput;
|
|
327
|
+
result[`${this.connectorKey}_${t.name}`] = {
|
|
328
|
+
...tool,
|
|
329
|
+
toModelOutput: async (options) => {
|
|
330
|
+
if (!originalToModelOutput) {
|
|
331
|
+
return opts.truncateOutput(options.output);
|
|
332
|
+
}
|
|
333
|
+
const modelOutput = await originalToModelOutput(options);
|
|
334
|
+
if (modelOutput.type === "text" || modelOutput.type === "json") {
|
|
335
|
+
return opts.truncateOutput(modelOutput.value);
|
|
336
|
+
}
|
|
337
|
+
return modelOutput;
|
|
338
|
+
}
|
|
339
|
+
};
|
|
329
340
|
}
|
|
330
341
|
return result;
|
|
331
342
|
}
|
|
@@ -442,7 +453,7 @@ var listCalendarsTool = new ConnectorTool({
|
|
|
442
453
|
error: `Connection ${connectionId} not found`
|
|
443
454
|
};
|
|
444
455
|
}
|
|
445
|
-
const impersonateEmailRaw =
|
|
456
|
+
const impersonateEmailRaw = impersonateEmailParameter.getValue(connection2);
|
|
446
457
|
const emails = impersonateEmailRaw.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
|
|
447
458
|
if (emails.length === 0) {
|
|
448
459
|
return {
|
|
@@ -521,44 +532,56 @@ var listCalendarsTool = new ConnectorTool({
|
|
|
521
532
|
var listCalendarsToolName = `google-calendar_${listCalendarsTool.name}`;
|
|
522
533
|
var googleCalendarOnboarding = new ConnectorOnboarding({
|
|
523
534
|
connectionSetupInstructions: {
|
|
524
|
-
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
|
|
535
|
+
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
|
|
525
536
|
|
|
526
|
-
1.
|
|
527
|
-
|
|
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\u308BPass:
|
|
538
|
+
- \`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
|
+
- \`header\`: \u300C\u30E1\u30FC\u30EB\u5165\u529B\u300D
|
|
540
|
+
- \`options\`: \`[{ label: "\u4F8B: user@example.com", description: "Google Workspace\u30E6\u30FC\u30B6\u30FC\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u5165\u529B" }, { label: "\u8907\u6570\u6307\u5B9A \u4F8B: a@example.com, b@example.com", description: "\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\u8907\u6570\u6307\u5B9A\u3057\u3066\u5019\u88DC\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u96C6\u7D04" }]\` \uFF08\`allowFreeText: true\` \u306E\u305F\u3081\u81EA\u7531\u5165\u529B\u53EF\uFF09
|
|
541
|
+
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
|
+
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
543
|
+
- \`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
|
|
545
|
+
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:
|
|
528
546
|
- \`parameterSlug\`: \`"calendar-id"\`
|
|
529
|
-
- \`options\`: \
|
|
547
|
+
- \`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
|
|
530
548
|
- \`errors\` \u306B\u5931\u6557\u3057\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u304C\u3042\u308B\u5834\u5408\u306F\u3001\u305D\u306E\u65E8\u3092\u77ED\u304F\u4F1D\u3048\u308B
|
|
531
|
-
|
|
549
|
+
5. \u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30AB\u30EC\u30F3\u30C0\u30FC\u306E \`label\` \u304B\u3089 owner \u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092\u62BD\u51FA\u3057\u3001\`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3057\u3066 \`impersonate-email\` \u3092\u6700\u7D42\u5024\u3067\u4E0A\u66F8\u304D\u3059\u308B:
|
|
532
550
|
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
533
|
-
- \`options\`: \`[{ value: <ownerEmail>, label: <ownerEmail> }]
|
|
534
|
-
|
|
535
|
-
- \`user\`: \u8A2D\u5B9A\u3057\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9
|
|
551
|
+
- \`options\`: \`[{ value: <ownerEmail>, label: <ownerEmail> }]\`
|
|
552
|
+
6. \`updateConnectionContext\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u5BFE\u8C61\u60C5\u5831\u3092\u8A18\u9332\u3059\u308B:
|
|
553
|
+
- \`user\`: \u6700\u7D42\u7684\u306B\u8A2D\u5B9A\u3057\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9
|
|
536
554
|
- \`calendar\`: \u9078\u629E\u3055\u308C\u305F\u30AB\u30EC\u30F3\u30C0\u30FC\u540D
|
|
537
555
|
- \`calendarId\`: \u9078\u629E\u3055\u308C\u305F\u30AB\u30EC\u30F3\u30C0\u30FCID
|
|
538
556
|
- \`note\`: \u300CDomain-wide Delegation\u3067 {email} \u306E {calendar} \u306B\u30A2\u30AF\u30BB\u30B9\u300D\u306A\u3069\u306E\u8AAC\u660E
|
|
539
557
|
|
|
540
558
|
#### \u5236\u7D04
|
|
541
|
-
- **\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u30E6\u30FC\u30B6\u30FC\u3078\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u7B49\u306E\u5165\u529B\u3092\u6C42\u3081\u306A\u3044\u3053\u3068**\u3002\u5FC5\u8981\u306A\u5024\u306F\u63A5\u7D9A\u4F5C\u6210\u6642\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\uFF08\`impersonate-email\`\uFF09\u304B\u3089\u53D6\u5F97\u3059\u308B
|
|
542
559
|
- **\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u8A2D\u5B9A\u304C\u5FC5\u8981\u3067\u3059**\u3002\`${listCalendarsToolName}\` \u306E \`errors\` \u306B\u6A29\u9650\u30A8\u30E9\u30FC\u304C\u51FA\u308B\u5834\u5408\u3001Google Workspace\u7BA1\u7406\u8005\u306BDomain-wide Delegation\u306E\u8A2D\u5B9A\u78BA\u8A8D\u3092\u4FC3\u3057\u3066\u304F\u3060\u3055\u3044
|
|
543
560
|
- \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u3002\u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
|
|
544
|
-
en: `Follow these steps to set up the Google Calendar connection.
|
|
561
|
+
en: `Follow these steps to set up the Google Calendar connection. Only the service account JSON is provided at connection creation time \u2014 the target user email and calendar ID are collected during this setup flow.
|
|
545
562
|
|
|
546
|
-
1. Call
|
|
547
|
-
|
|
563
|
+
1. Call \`askUserQuestion\` to ask the user for the Google Workspace user email the service account will impersonate via Domain-wide Delegation:
|
|
564
|
+
- \`question\`: "Please enter the email address of the user whose calendar you want to access (comma-separated list allowed for multiple users)"
|
|
565
|
+
- \`header\`: "Email input"
|
|
566
|
+
- \`options\`: \`[{ label: "e.g., user@example.com", description: "Enter a Google Workspace user's email" }, { label: "Multiple e.g., a@example.com, b@example.com", description: "Comma-separated list to aggregate calendars across users" }]\` (free text entry is allowed because \`allowFreeText: true\`)
|
|
567
|
+
2. Save the email(s) the user provided (comma-separated supported) via \`updateConnectionParameters\`:
|
|
568
|
+
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
569
|
+
- \`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)
|
|
571
|
+
4. Using the returned \`calendars\` array (each item: \`{ impersonateEmail, id, summary, primary, accessRole }\`), briefly say "Please select a calendar." then call \`updateConnectionParameters\`:
|
|
548
572
|
- \`parameterSlug\`: \`"calendar-id"\`
|
|
549
|
-
- \`options\`:
|
|
573
|
+
- \`options\`: Each option's \`label\` should be \`Calendar Name (owner: impersonateEmail)\`, \`value\` should be the calendar ID
|
|
550
574
|
- If \`errors\` contains failing email addresses, briefly mention them
|
|
551
|
-
|
|
575
|
+
5. Extract the owner email from the \`label\` of the user's selected calendar, then call \`updateConnectionParameters\` to overwrite \`impersonate-email\` with the final value:
|
|
552
576
|
- \`parameterSlug\`: \`"impersonate-email"\`
|
|
553
|
-
- \`options\`: \`[{ value: <ownerEmail>, label: <ownerEmail> }]\`
|
|
554
|
-
|
|
555
|
-
- \`user\`: The configured email address
|
|
577
|
+
- \`options\`: \`[{ value: <ownerEmail>, label: <ownerEmail> }]\`
|
|
578
|
+
6. Call \`updateConnectionContext\` to record the target:
|
|
579
|
+
- \`user\`: The final configured email address
|
|
556
580
|
- \`calendar\`: The selected calendar's name
|
|
557
581
|
- \`calendarId\`: The selected calendar ID
|
|
558
582
|
- \`note\`: A description such as "Accessing {email}'s {calendar} via Domain-wide Delegation"
|
|
559
583
|
|
|
560
584
|
#### Constraints
|
|
561
|
-
- **Do NOT prompt the user for any input (e.g., email addresses) during setup**. The required values come from the connection parameters (\`impersonate-email\`) filled in at connection creation time
|
|
562
585
|
- **Domain-wide Delegation must be configured on the service account**. If \`${listCalendarsToolName}\` returns permission errors in the \`errors\` field, ask the user to verify the Domain-wide Delegation setup with their Google Workspace administrator
|
|
563
586
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
564
587
|
},
|
|
@@ -623,13 +646,13 @@ Authentication is handled automatically using a service account.
|
|
|
623
646
|
try {
|
|
624
647
|
const { GoogleAuth } = await import("google-auth-library");
|
|
625
648
|
const keyJsonBase64 = parameters.serviceAccountKeyJsonBase64.getValue(connection2);
|
|
626
|
-
const impersonateEmail =
|
|
627
|
-
const calendarId =
|
|
649
|
+
const impersonateEmail = impersonateEmailParameter.tryGetValue(connection2);
|
|
650
|
+
const calendarId = calendarIdParameter.tryGetValue(connection2) ?? "primary";
|
|
628
651
|
const resolvedSubject = subject ?? impersonateEmail;
|
|
629
652
|
if (!resolvedSubject) {
|
|
630
653
|
return {
|
|
631
654
|
success: false,
|
|
632
|
-
error: `Missing required parameter: ${
|
|
655
|
+
error: `Missing required parameter: ${impersonateEmailParameter.slug}. Configure the user email for this connection.`
|
|
633
656
|
};
|
|
634
657
|
}
|
|
635
658
|
const credentials = JSON.parse(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _squadbase_connectors_sdk from '@squadbase/connectors/sdk';
|
|
2
2
|
|
|
3
|
-
declare const connection: (connectionId: string) => _squadbase_connectors_sdk.
|
|
3
|
+
declare const connection: (connectionId: string) => _squadbase_connectors_sdk.GoogleDocsConnectorSdk;
|
|
4
4
|
|
|
5
5
|
export { connection };
|