@notionhq/apps 0.0.13 → 0.0.15

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.
Files changed (111) hide show
  1. package/README.md +110 -49
  2. package/dist/box.generated.d.ts +164 -0
  3. package/dist/box.generated.d.ts.map +1 -0
  4. package/dist/box.generated.js +24 -0
  5. package/dist/calendar.generated.d.ts +1036 -0
  6. package/dist/calendar.generated.d.ts.map +1 -0
  7. package/dist/calendar.generated.js +42 -0
  8. package/dist/cli/build.js +7 -6
  9. package/dist/cli/emit-manifest.d.ts.map +1 -1
  10. package/dist/cli/emit-manifest.js +1 -4
  11. package/dist/confluence.generated.d.ts +98 -0
  12. package/dist/confluence.generated.d.ts.map +1 -0
  13. package/dist/confluence.generated.js +18 -0
  14. package/dist/connection-actions.d.ts +2 -0
  15. package/dist/connection-actions.d.ts.map +1 -0
  16. package/dist/connection-actions.js +0 -0
  17. package/dist/connection-trigger-definitions.generated.d.ts +34 -0
  18. package/dist/connection-trigger-definitions.generated.d.ts.map +1 -0
  19. package/dist/connection-trigger-definitions.generated.js +45 -0
  20. package/dist/connections.d.ts +15 -0
  21. package/dist/connections.d.ts.map +1 -0
  22. package/dist/connections.js +79 -0
  23. package/dist/connections.test.d.ts +2 -0
  24. package/dist/connections.test.d.ts.map +1 -0
  25. package/dist/context.d.ts.map +1 -1
  26. package/dist/context.js +3 -0
  27. package/dist/context.test.d.ts +2 -0
  28. package/dist/context.test.d.ts.map +1 -0
  29. package/dist/cursor.generated.d.ts +154 -0
  30. package/dist/cursor.generated.d.ts.map +1 -0
  31. package/dist/cursor.generated.js +18 -0
  32. package/dist/custom-block.d.ts +1 -1
  33. package/dist/custom-block.d.ts.map +1 -1
  34. package/dist/custom-block.js +3 -3
  35. package/dist/discord.generated.d.ts +279 -0
  36. package/dist/discord.generated.d.ts.map +1 -0
  37. package/dist/discord.generated.js +33 -0
  38. package/dist/gmail.generated.d.ts +184 -0
  39. package/dist/gmail.generated.d.ts.map +1 -0
  40. package/dist/gmail.generated.js +21 -0
  41. package/dist/googleCalendar.generated.d.ts +83 -0
  42. package/dist/googleCalendar.generated.d.ts.map +1 -0
  43. package/dist/googleCalendar.generated.js +15 -0
  44. package/dist/googleDrive.generated.d.ts +210 -0
  45. package/dist/googleDrive.generated.d.ts.map +1 -0
  46. package/dist/googleDrive.generated.js +27 -0
  47. package/dist/googleDriveOauth.generated.d.ts +851 -0
  48. package/dist/googleDriveOauth.generated.d.ts.map +1 -0
  49. package/dist/googleDriveOauth.generated.js +84 -0
  50. package/dist/index.d.ts +8 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +16 -0
  53. package/dist/outlook.generated.d.ts +224 -0
  54. package/dist/outlook.generated.d.ts.map +1 -0
  55. package/dist/outlook.generated.js +24 -0
  56. package/dist/providers.generated.d.ts +117 -0
  57. package/dist/providers.generated.d.ts.map +1 -0
  58. package/dist/providers.generated.js +108 -0
  59. package/dist/salesforce.generated.d.ts +151 -0
  60. package/dist/salesforce.generated.d.ts.map +1 -0
  61. package/dist/salesforce.generated.js +24 -0
  62. package/dist/slack.generated.d.ts +290 -0
  63. package/dist/slack.generated.d.ts.map +1 -0
  64. package/dist/slack.generated.js +30 -0
  65. package/dist/sync.d.ts +2 -2
  66. package/dist/sync.d.ts.map +1 -1
  67. package/dist/sync.js +3 -3
  68. package/dist/triggers.generated.d.ts +107 -32
  69. package/dist/triggers.generated.d.ts.map +1 -1
  70. package/dist/triggers.generated.js +36 -24
  71. package/dist/workflow-connections-types.test.d.ts +2 -0
  72. package/dist/workflow-connections-types.test.d.ts.map +1 -0
  73. package/dist/workflow-types.test.d.ts +2 -0
  74. package/dist/workflow-types.test.d.ts.map +1 -0
  75. package/dist/workflow.d.ts +24 -20
  76. package/dist/workflow.d.ts.map +1 -1
  77. package/dist/workflow.js +16 -19
  78. package/docs/BUILD.md +83 -14
  79. package/docs/CONNECTIONS.md +130 -0
  80. package/package.json +5 -1
  81. package/src/box.generated.ts +187 -0
  82. package/src/calendar.generated.ts +1117 -0
  83. package/src/cli/build.test.ts +35 -4
  84. package/src/cli/build.ts +6 -5
  85. package/src/cli/emit-manifest.ts +1 -5
  86. package/src/confluence.generated.ts +109 -0
  87. package/src/connection-actions.ts +2 -0
  88. package/src/connection-trigger-definitions.generated.ts +48 -0
  89. package/src/connections.test.ts +157 -0
  90. package/src/connections.ts +126 -0
  91. package/src/context.test.ts +26 -0
  92. package/src/context.ts +8 -0
  93. package/src/cursor.generated.ts +167 -0
  94. package/src/custom-block.test.ts +4 -4
  95. package/src/custom-block.ts +2 -2
  96. package/src/discord.generated.ts +318 -0
  97. package/src/gmail.generated.ts +205 -0
  98. package/src/googleCalendar.generated.ts +95 -0
  99. package/src/googleDrive.generated.ts +235 -0
  100. package/src/googleDriveOauth.generated.ts +980 -0
  101. package/src/index.ts +7 -0
  102. package/src/outlook.generated.ts +249 -0
  103. package/src/providers.generated.ts +207 -0
  104. package/src/salesforce.generated.ts +170 -0
  105. package/src/slack.generated.ts +330 -0
  106. package/src/sync.ts +2 -2
  107. package/src/triggers.generated.ts +112 -32
  108. package/src/workflow-connections-types.test.ts +59 -0
  109. package/src/workflow-types.test.ts +144 -0
  110. package/src/workflow.test.ts +135 -25
  111. package/src/workflow.ts +63 -34
@@ -0,0 +1,1117 @@
1
+ // Generated by notion tool-core codegen-script-types --connections. Do not edit.
2
+ import type { ConnectionActionInvoker } from "./connection-actions.js"
3
+ /**
4
+ * Script input for the "List available calendar resources (such as conference rooms)." effect (`calendar.listCalendarResources`),
5
+ * derived from its Tool Core definition's call_function input projection.
6
+ *
7
+ * Search for resources (often conference rooms) and check their availability for specific time slots.
8
+ * Resources are scoped to a single account; pass `calendar` to target the account of the event you intend to attach the rooms to.
9
+ * Only works with Google Workspace accounts that have admin permissions to view calendar resources.
10
+ * Use this tool to find rooms when creating in-person meetings.
11
+ * Pass multiple meeting times in timeSlots to get available rooms for each time slot independently.
12
+ */
13
+ export type ListCalendarResourcesScriptInput = {
14
+ /**
15
+ * Specific time slots to check. Returns available resources for each time slot independently.
16
+ */
17
+ timeSlots: Array<{
18
+ /**
19
+ * Start of the time slot to check, as an ISO 8601 date-time.
20
+ */
21
+ startAt: string
22
+ /**
23
+ * End of the time slot to check, as an ISO 8601 date-time.
24
+ */
25
+ endAt: string
26
+ }>
27
+ /**
28
+ * Minimum room capacity (number of people). MUST include the meeting organizer/user themselves in the count. For a 1-on-1, pass 2. For a meeting with N invitees besides the user, pass N+1.
29
+ */
30
+ minCapacity: number
31
+ /**
32
+ * Maximum number of resources to return per time slot (default: 20, max: 40)
33
+ */
34
+ maxCount?: number
35
+ /**
36
+ * If true, do not narrow rooms to the user's working-location building for this day. Set this when the user is explicitly asking about rooms in a different office (e.g. for a visiting team).
37
+ */
38
+ ignoreWorkingLocation?: boolean
39
+ /**
40
+ * Date-times of returned events will be expressed in this time-zone
41
+ */
42
+ timeZone: string
43
+ /**
44
+ * Calendar of the event the rooms will be attached to. Rooms are scoped to a single account.
45
+ */
46
+ calendar?: {
47
+ /**
48
+ * Account that owns the target calendar.
49
+ */
50
+ accountId: string
51
+ /**
52
+ * Target calendar identifier within the account.
53
+ */
54
+ calendarId: string
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Canonical Tool Core output for the "List available calendar resources (such as conference rooms)." effect (`calendar.listCalendarResources`).
60
+ * This is the definition's output schema; the effect's script surface may
61
+ * re-encode it before returning.
62
+ */
63
+ export type ListCalendarResourcesScriptOutput = {
64
+ /**
65
+ * Results for each requested time slot, with available rooms sorted by capacity
66
+ */
67
+ resultsBySlot: Array<{
68
+ /**
69
+ * The time slot being checked
70
+ */
71
+ timeSlot: {
72
+ startAt: string
73
+ endAt: string
74
+ }
75
+ /**
76
+ * Available conference rooms for this time slot, sorted by increasing capacity (smallest rooms first)
77
+ */
78
+ availableResources: Array<{
79
+ /**
80
+ * Use this as the email when adding rooms to events
81
+ */
82
+ resourceEmail: string
83
+ /**
84
+ * Display name of the conference room
85
+ */
86
+ resourceName: string
87
+ /**
88
+ * Building information
89
+ */
90
+ building?: {
91
+ buildingId: string
92
+ buildingName?: string
93
+ }
94
+ /**
95
+ * Maximum number of people the room can accommodate
96
+ */
97
+ capacity?: number
98
+ /**
99
+ * Floor location
100
+ */
101
+ floor?: string
102
+ /**
103
+ * Room description
104
+ */
105
+ description?: string
106
+ }>
107
+ }>
108
+ }
109
+
110
+ /**
111
+ * Script input for the "Fetch list of calendars of the user." effect (`calendar.listCalendars`),
112
+ * derived from its Tool Core definition's call_function input projection.
113
+ *
114
+ * List of calendars grouped by account.
115
+ */
116
+ export type ListCalendarsScriptInput = {
117
+ /**
118
+ * Return only accounts linked to these email addresses. Useful to get calendars from a work account only for example. Do not specify if you are interested in getting the whole picture of someone's agenda across work and personal accounts.
119
+ */
120
+ onlyAccountEmails?: Array<string>
121
+ }
122
+
123
+ /**
124
+ * Canonical Tool Core output for the "Fetch list of calendars of the user." effect (`calendar.listCalendars`).
125
+ * This is the definition's output schema; the effect's script surface may
126
+ * re-encode it before returning.
127
+ */
128
+ export type ListCalendarsScriptOutput = {
129
+ accounts: Array<{
130
+ accountId: string
131
+ /**
132
+ * Google, Apple iCloud, Outlook, etc.
133
+ */
134
+ providerName: string
135
+ /**
136
+ * The user email associated with this account. Useful to know if this account and its data should be used depending on context.
137
+ */
138
+ email?: string
139
+ /**
140
+ * Whether this account is work-related or a personal account, if we know this information.
141
+ */
142
+ category?: "work" | "personal"
143
+ capabilities: {
144
+ /**
145
+ * Does this account expose any calendars?
146
+ */
147
+ readCalendars: boolean
148
+ /**
149
+ * Can we read calendar events from calendars of this account?
150
+ */
151
+ readEvents: boolean
152
+ /**
153
+ * Can we write events in some calendars of this account? Calendars themselves might have their own set of restrictions.
154
+ */
155
+ writeEvents: boolean
156
+ /**
157
+ * Can we use a text search query to find events in the calendars of this account?
158
+ */
159
+ searchEvents: boolean
160
+ /**
161
+ * Does this account expose contacts?
162
+ */
163
+ readContacts: boolean
164
+ }
165
+ /**
166
+ * User can access the events of co-workers having an email address with one of these domains
167
+ */
168
+ coworkersEmailDomains?: Array<string>
169
+ calendars: Array<{
170
+ accountId: string
171
+ calendarId: string
172
+ name: string
173
+ description?: string
174
+ colors?: {
175
+ foreground?: string
176
+ background?: string
177
+ }
178
+ isPrimary: boolean
179
+ /**
180
+ * Is this calendar read-only or can the user create/edit/delete events?
181
+ */
182
+ isReadOnly: boolean
183
+ /**
184
+ * The contents of a calendar appear in the user calendar app only if that calendar is selected.
185
+ * Calendars that are not selected might be useful to get lower-signal events, but probably not to create events as it might not be visible to the user.
186
+ */
187
+ isSelected: boolean
188
+ /**
189
+ * A hidden calendar is a calendar the user has access to but decided to hide completely from their calendar app.
190
+ * Hidden calendars might be useful to know what you might have access to, but keep in mind the user hid them and is most likely not aware of their content.
191
+ */
192
+ isHidden: boolean
193
+ /**
194
+ * The email address of the owner of this calendar.
195
+ */
196
+ ownerEmail?: string
197
+ }>
198
+ }>
199
+ }
200
+
201
+ /**
202
+ * Script input for the "List contacts" effect (`calendar.listContacts`),
203
+ * derived from its Tool Core definition's call_function input projection.
204
+ *
205
+ * List the user's contacts from different accounts. Returns contact information including email addresses, names, phone numbers, and profile photos.
206
+ */
207
+ export type ListContactsScriptInput = {
208
+ /**
209
+ * Optional search queries to filter contacts by name or email. Results matching any query are included.
210
+ */
211
+ queries?: Array<string>
212
+ }
213
+
214
+ /**
215
+ * Canonical Tool Core output for the "List contacts" effect (`calendar.listContacts`).
216
+ * This is the definition's output schema; the effect's script surface may
217
+ * re-encode it before returning.
218
+ */
219
+ export type ListContactsScriptOutput = {
220
+ accounts: Array<{
221
+ accountId: string
222
+ /**
223
+ * Google, Apple iCloud, Outlook, etc.
224
+ */
225
+ providerName: string
226
+ /**
227
+ * The user email associated with this account. Useful to know if this account and its data should be used depending on context.
228
+ */
229
+ email?: string
230
+ /**
231
+ * Whether this account is work-related or a personal account, if we know this information.
232
+ */
233
+ category?: "work" | "personal"
234
+ capabilities: {
235
+ /**
236
+ * Does this account expose any calendars?
237
+ */
238
+ readCalendars: boolean
239
+ /**
240
+ * Can we read calendar events from calendars of this account?
241
+ */
242
+ readEvents: boolean
243
+ /**
244
+ * Can we write events in some calendars of this account? Calendars themselves might have their own set of restrictions.
245
+ */
246
+ writeEvents: boolean
247
+ /**
248
+ * Can we use a text search query to find events in the calendars of this account?
249
+ */
250
+ searchEvents: boolean
251
+ /**
252
+ * Does this account expose contacts?
253
+ */
254
+ readContacts: boolean
255
+ }
256
+ /**
257
+ * User can access the events of co-workers having an email address with one of these domains
258
+ */
259
+ coworkersEmailDomains?: Array<string>
260
+ contacts: Array<{
261
+ /**
262
+ * Unique identifier for the contact
263
+ */
264
+ id: string
265
+ /**
266
+ * Primary email address of the contact
267
+ */
268
+ email: string
269
+ /**
270
+ * Additional email addresses for this contact
271
+ */
272
+ alternateEmails?: Array<string>
273
+ /**
274
+ * Display name of the contact
275
+ */
276
+ displayName?: string
277
+ /**
278
+ * Phone numbers associated with this contact
279
+ */
280
+ phoneNumbers?: Array<{
281
+ /**
282
+ * The type of phone number (e.g., home, work, mobile)
283
+ */
284
+ type?: string
285
+ /**
286
+ * The phone number value
287
+ */
288
+ value: string
289
+ }>
290
+ /**
291
+ * URL to the contact's profile photo
292
+ */
293
+ photoUrl?: string
294
+ }>
295
+ }>
296
+ }
297
+
298
+ /**
299
+ * Script input for the "View coworkers' scheduled events." effect (`calendar.listCoworkersEvents`),
300
+ * derived from its Tool Core definition's call_function input projection.
301
+ *
302
+ * Retrieves the detailed calendar events for specific coworkers within a time range.
303
+ * Use this to see what meetings or events people have scheduled, including event titles, times, and details.
304
+ * Only works for coworkers in the same organization domain.
305
+ */
306
+ export type ListCoworkersEventsScriptInput = {
307
+ /**
308
+ * Emails of relevant coworkers
309
+ */
310
+ coworkerEmails: Array<string>
311
+ /**
312
+ * Start of the time range, as an ISO 8601 date-time.
313
+ */
314
+ timeMin: string
315
+ /**
316
+ * End of the time range, as an ISO 8601 date-time.
317
+ */
318
+ timeMax: string
319
+ /**
320
+ * Date-times of returned events will be expressed in this time-zone
321
+ */
322
+ timeZone: string
323
+ }
324
+
325
+ /**
326
+ * Canonical Tool Core output for the "View coworkers' scheduled events." effect (`calendar.listCoworkersEvents`).
327
+ * This is the definition's output schema; the effect's script surface may
328
+ * re-encode it before returning.
329
+ */
330
+ export type ListCoworkersEventsScriptOutput = {
331
+ /**
332
+ * List of coworkers with their scheduled calendar events. Some coworkers may be excluded if their calendar could not be accessed.
333
+ */
334
+ coworkers: Array<{
335
+ accountId: string
336
+ coworkerEmail: string
337
+ profile?: {
338
+ displayName?: string
339
+ email?: string
340
+ photoUrl?: string
341
+ }
342
+ events: Array<{
343
+ calendar: {
344
+ accountId: string
345
+ calendarId: string
346
+ }
347
+ eventId: string
348
+ summary: string
349
+ description?: string
350
+ /**
351
+ * Physical location where the event takes place, or remote conference link/info.
352
+ */
353
+ location?: string
354
+ /**
355
+ * Recurrence rules in RRULE format (e.g., ['RRULE:FREQ=WEEKLY;COUNT=10']). Can also include EXDATE for exception dates (e.g., ['RRULE:FREQ=WEEKLY;COUNT=10', 'EXDATE:2026-03-24T13:00:00']).
356
+ */
357
+ recurrenceRules?: Array<string>
358
+ /**
359
+ * The data provider this event belongs to
360
+ */
361
+ provider?: "google" | "notion" | "icloud" | "outlook"
362
+ /**
363
+ * The URL to view the event in the Calendar app.
364
+ */
365
+ webUrl: string
366
+ /**
367
+ * When the event is happening
368
+ */
369
+ period:
370
+ | {
371
+ type: "DATE"
372
+ start: {
373
+ /**
374
+ * Date in ISO 8601 format (no time)
375
+ */
376
+ date: string
377
+ }
378
+ end: {
379
+ /**
380
+ * Date in ISO 8601 format (no time)
381
+ */
382
+ date: string
383
+ }
384
+ }
385
+ | {
386
+ type: "DATE_TIME"
387
+ start: {
388
+ /**
389
+ * Date-time in ISO 8601 format, in UTC (ending with Z), or with TZ offset
390
+ */
391
+ dateTime: string
392
+ timeZone?: string
393
+ }
394
+ end: {
395
+ /**
396
+ * Date-time in ISO 8601 format, in UTC (ending with Z), or with TZ offset
397
+ */
398
+ dateTime: string
399
+ timeZone?: string
400
+ }
401
+ }
402
+ /**
403
+ * Whether it's part of a recurring event series
404
+ */
405
+ isRecurring: boolean
406
+ /**
407
+ * If true, the event does not block time on the calendar. This is equivalent to setting `Show me as to Available` in the Calendar UI.
408
+ */
409
+ isTransparent: boolean
410
+ /**
411
+ * Is the event an auto-blocking event created from another event? Used to create blocked events on a calendar from events on another calendar. You can ignore auto-blocked events if there are events happening at the exact same time on other calendars.
412
+ */
413
+ isAutoBlock: boolean
414
+ /**
415
+ * What kind of event is it? Standard, out of office, birthday...
416
+ */
417
+ eventType?:
418
+ | "fromGmail"
419
+ | "default"
420
+ | "focusTime"
421
+ | "outOfOffice"
422
+ | "birthday"
423
+ | "availability"
424
+ /**
425
+ * Is an event confirmed, tentative or cancelled? This is different from the user's RSVP
426
+ */
427
+ eventStatus?: "confirmed" | "tentative" | "cancelled"
428
+ /**
429
+ * Whether it's a meeting, aka an event with attendees listed
430
+ */
431
+ isMeeting: boolean
432
+ conferencingEntryPoints?: Array<{
433
+ uri: string
434
+ accessCode?: string
435
+ entryPointType?: "video" | "phone" | "sip" | "more"
436
+ label?: string
437
+ meetingCode?: string
438
+ passcode?: string
439
+ password?: string
440
+ pin?: string
441
+ notes?: string
442
+ signature?: string
443
+ }>
444
+ /**
445
+ * The URL to join the video conference, if available
446
+ */
447
+ conferencingUrl?: string
448
+ /**
449
+ * The calendar user's RSVP status
450
+ */
451
+ responseStatus?: "needsAction" | "accepted" | "declined" | "tentative"
452
+ creator?: {
453
+ /**
454
+ * Whether this entry represents the calendar user
455
+ */
456
+ isSelf: boolean
457
+ displayName?: string
458
+ email?: string
459
+ }
460
+ organizer?: {
461
+ /**
462
+ * Whether this entry represents the calendar user
463
+ */
464
+ isSelf: boolean
465
+ displayName?: string
466
+ email?: string
467
+ }
468
+ attendees?: Array<{
469
+ /**
470
+ * Whether this entry represents the calendar user
471
+ */
472
+ isSelf: boolean
473
+ displayName?: string
474
+ email?: string
475
+ isOptional: boolean
476
+ isOrganizer?: boolean
477
+ /**
478
+ * The calendar user's RSVP status
479
+ */
480
+ responseStatus?: "needsAction" | "accepted" | "declined" | "tentative"
481
+ }>
482
+ resources?: Array<{
483
+ displayName?: string
484
+ email?: string
485
+ isOptional: boolean
486
+ /**
487
+ * The calendar user's RSVP status
488
+ */
489
+ responseStatus?: "needsAction" | "accepted" | "declined" | "tentative"
490
+ }>
491
+ colors?: {
492
+ foreground?: string
493
+ background?: string
494
+ }
495
+ attachments?: Array<{
496
+ url: string
497
+ mimeType?: string
498
+ title?: string
499
+ notionWorkspaceId?: string
500
+ }>
501
+ }>
502
+ }>
503
+ errors?: Array<{
504
+ /**
505
+ * An identifier for the item that failed (e.g., event summary for creation, event ID for updates/cancellations)
506
+ */
507
+ identifier: string
508
+ /**
509
+ * Description of the error that occurred
510
+ */
511
+ errorMessage: string
512
+ }>
513
+ }
514
+
515
+ /**
516
+ * Script input for the "List the user's events from different calendars." effect (`calendar.listEvents`),
517
+ * derived from its Tool Core definition's call_function input projection.
518
+ *
519
+ * Date-times will be expressed in the time-zone passed as parameter.
520
+ */
521
+ export type ListEventsScriptInput = {
522
+ /**
523
+ * Start of the time range, as an ISO 8601 date-time.
524
+ */
525
+ timeMin: string
526
+ /**
527
+ * End of the time range, as an ISO 8601 date-time.
528
+ */
529
+ timeMax: string
530
+ /**
531
+ * Date-times of returned events will be expressed in this time-zone
532
+ */
533
+ timeZone: string
534
+ /**
535
+ * Whether to include event invites the user has declined
536
+ */
537
+ includeDeclinedInvites?: boolean | null
538
+ }
539
+
540
+ /**
541
+ * Canonical Tool Core output for the "List the user's events from different calendars." effect (`calendar.listEvents`).
542
+ * This is the definition's output schema; the effect's script surface may
543
+ * re-encode it before returning.
544
+ */
545
+ export type ListEventsScriptOutput = {
546
+ accounts: Array<{
547
+ accountId: string
548
+ /**
549
+ * Google, Apple iCloud, Outlook, etc.
550
+ */
551
+ providerName: string
552
+ /**
553
+ * The user email associated with this account. Useful to know if this account and its data should be used depending on context.
554
+ */
555
+ email?: string
556
+ /**
557
+ * Whether this account is work-related or a personal account, if we know this information.
558
+ */
559
+ category?: "work" | "personal"
560
+ capabilities: {
561
+ /**
562
+ * Does this account expose any calendars?
563
+ */
564
+ readCalendars: boolean
565
+ /**
566
+ * Can we read calendar events from calendars of this account?
567
+ */
568
+ readEvents: boolean
569
+ /**
570
+ * Can we write events in some calendars of this account? Calendars themselves might have their own set of restrictions.
571
+ */
572
+ writeEvents: boolean
573
+ /**
574
+ * Can we use a text search query to find events in the calendars of this account?
575
+ */
576
+ searchEvents: boolean
577
+ /**
578
+ * Does this account expose contacts?
579
+ */
580
+ readContacts: boolean
581
+ }
582
+ /**
583
+ * User can access the events of co-workers having an email address with one of these domains
584
+ */
585
+ coworkersEmailDomains?: Array<string>
586
+ calendars: Array<{
587
+ accountId: string
588
+ calendarId: string
589
+ name: string
590
+ description?: string
591
+ colors?: {
592
+ foreground?: string
593
+ background?: string
594
+ }
595
+ isPrimary: boolean
596
+ /**
597
+ * Is this calendar read-only or can the user create/edit/delete events?
598
+ */
599
+ isReadOnly: boolean
600
+ /**
601
+ * The contents of a calendar appear in the user calendar app only if that calendar is selected.
602
+ * Calendars that are not selected might be useful to get lower-signal events, but probably not to create events as it might not be visible to the user.
603
+ */
604
+ isSelected: boolean
605
+ /**
606
+ * A hidden calendar is a calendar the user has access to but decided to hide completely from their calendar app.
607
+ * Hidden calendars might be useful to know what you might have access to, but keep in mind the user hid them and is most likely not aware of their content.
608
+ */
609
+ isHidden: boolean
610
+ /**
611
+ * The email address of the owner of this calendar.
612
+ */
613
+ ownerEmail?: string
614
+ events: Array<{
615
+ calendar: {
616
+ accountId: string
617
+ calendarId: string
618
+ }
619
+ eventId: string
620
+ summary: string
621
+ description?: string
622
+ /**
623
+ * Physical location where the event takes place, or remote conference link/info.
624
+ */
625
+ location?: string
626
+ /**
627
+ * Recurrence rules in RRULE format (e.g., ['RRULE:FREQ=WEEKLY;COUNT=10']). Can also include EXDATE for exception dates (e.g., ['RRULE:FREQ=WEEKLY;COUNT=10', 'EXDATE:2026-03-24T13:00:00']).
628
+ */
629
+ recurrenceRules?: Array<string>
630
+ /**
631
+ * The data provider this event belongs to
632
+ */
633
+ provider?: "google" | "notion" | "icloud" | "outlook"
634
+ /**
635
+ * The URL to view the event in the Calendar app.
636
+ */
637
+ webUrl: string
638
+ /**
639
+ * When the event is happening
640
+ */
641
+ period:
642
+ | {
643
+ type: "DATE"
644
+ start: {
645
+ /**
646
+ * Date in ISO 8601 format (no time)
647
+ */
648
+ date: string
649
+ }
650
+ end: {
651
+ /**
652
+ * Date in ISO 8601 format (no time)
653
+ */
654
+ date: string
655
+ }
656
+ }
657
+ | {
658
+ type: "DATE_TIME"
659
+ start: {
660
+ /**
661
+ * Date-time in ISO 8601 format, in UTC (ending with Z), or with TZ offset
662
+ */
663
+ dateTime: string
664
+ timeZone?: string
665
+ }
666
+ end: {
667
+ /**
668
+ * Date-time in ISO 8601 format, in UTC (ending with Z), or with TZ offset
669
+ */
670
+ dateTime: string
671
+ timeZone?: string
672
+ }
673
+ }
674
+ /**
675
+ * Whether it's part of a recurring event series
676
+ */
677
+ isRecurring: boolean
678
+ /**
679
+ * If true, the event does not block time on the calendar. This is equivalent to setting `Show me as to Available` in the Calendar UI.
680
+ */
681
+ isTransparent: boolean
682
+ /**
683
+ * Is the event an auto-blocking event created from another event? Used to create blocked events on a calendar from events on another calendar. You can ignore auto-blocked events if there are events happening at the exact same time on other calendars.
684
+ */
685
+ isAutoBlock: boolean
686
+ /**
687
+ * What kind of event is it? Standard, out of office, birthday...
688
+ */
689
+ eventType?:
690
+ | "fromGmail"
691
+ | "default"
692
+ | "focusTime"
693
+ | "outOfOffice"
694
+ | "birthday"
695
+ | "availability"
696
+ /**
697
+ * Is an event confirmed, tentative or cancelled? This is different from the user's RSVP
698
+ */
699
+ eventStatus?: "confirmed" | "tentative" | "cancelled"
700
+ /**
701
+ * Whether it's a meeting, aka an event with attendees listed
702
+ */
703
+ isMeeting: boolean
704
+ conferencingEntryPoints?: Array<{
705
+ uri: string
706
+ accessCode?: string
707
+ entryPointType?: "video" | "phone" | "sip" | "more"
708
+ label?: string
709
+ meetingCode?: string
710
+ passcode?: string
711
+ password?: string
712
+ pin?: string
713
+ notes?: string
714
+ signature?: string
715
+ }>
716
+ /**
717
+ * The URL to join the video conference, if available
718
+ */
719
+ conferencingUrl?: string
720
+ /**
721
+ * The calendar user's RSVP status
722
+ */
723
+ responseStatus?: "needsAction" | "accepted" | "declined" | "tentative"
724
+ creator?: {
725
+ /**
726
+ * Whether this entry represents the calendar user
727
+ */
728
+ isSelf: boolean
729
+ displayName?: string
730
+ email?: string
731
+ }
732
+ organizer?: {
733
+ /**
734
+ * Whether this entry represents the calendar user
735
+ */
736
+ isSelf: boolean
737
+ displayName?: string
738
+ email?: string
739
+ }
740
+ attendees?: Array<{
741
+ /**
742
+ * Whether this entry represents the calendar user
743
+ */
744
+ isSelf: boolean
745
+ displayName?: string
746
+ email?: string
747
+ isOptional: boolean
748
+ isOrganizer?: boolean
749
+ /**
750
+ * The calendar user's RSVP status
751
+ */
752
+ responseStatus?: "needsAction" | "accepted" | "declined" | "tentative"
753
+ }>
754
+ resources?: Array<{
755
+ displayName?: string
756
+ email?: string
757
+ isOptional: boolean
758
+ /**
759
+ * The calendar user's RSVP status
760
+ */
761
+ responseStatus?: "needsAction" | "accepted" | "declined" | "tentative"
762
+ }>
763
+ colors?: {
764
+ foreground?: string
765
+ background?: string
766
+ }
767
+ attachments?: Array<{
768
+ url: string
769
+ mimeType?: string
770
+ title?: string
771
+ notionWorkspaceId?: string
772
+ }>
773
+ }>
774
+ }>
775
+ }>
776
+ /**
777
+ * User preferences for calendar data
778
+ */
779
+ userPreferences: {
780
+ /**
781
+ * Whether the user prefers to display time in 12-hour (AM/PM) or 24-hour format
782
+ */
783
+ timeFormat?: "12_HOUR" | "24_HOUR"
784
+ }
785
+ errors: Array<{
786
+ accountId: string
787
+ calendarId: string
788
+ error: string
789
+ }>
790
+ }
791
+
792
+ /**
793
+ * Script input for the "List the user's scheduling links." effect (`calendar.listSchedulingLinks`),
794
+ * derived from its Tool Core definition's call_function input projection.
795
+ *
796
+ * List active, unexpired scheduling links with upcoming time ranges, optionally filtered by link type.
797
+ */
798
+ export type ListSchedulingLinksScriptInput = {
799
+ /**
800
+ * Return only scheduling links of this type
801
+ */
802
+ type?: "singleUse" | "multiUse" | "recurring"
803
+ }
804
+
805
+ /**
806
+ * Canonical Tool Core output for the "List the user's scheduling links." effect (`calendar.listSchedulingLinks`).
807
+ * This is the definition's output schema; the effect's script surface may
808
+ * re-encode it before returning.
809
+ */
810
+ export type ListSchedulingLinksScriptOutput = {
811
+ schedulingLinks: Array<{
812
+ /**
813
+ * Unique ID of the created scheduling link
814
+ */
815
+ id: string
816
+ /**
817
+ * Short ID used in the scheduling link URL
818
+ */
819
+ shortId: string
820
+ /**
821
+ * Current booking calendar for this scheduling link
822
+ */
823
+ bookingCalendarRef: {
824
+ accountId: string
825
+ calendarId: string
826
+ }
827
+ /**
828
+ * Custom URL slug for the scheduling link
829
+ */
830
+ alias?: string
831
+ /**
832
+ * The resolved type of the link
833
+ */
834
+ type?: "singleUse" | "multiUse" | "recurring"
835
+ /**
836
+ * Status of the scheduling link
837
+ */
838
+ status: string
839
+ title?: string
840
+ description?: string
841
+ duration?: number
842
+ /**
843
+ * Full URL where invitees can book a meeting
844
+ */
845
+ schedulingLinkUrl?: string
846
+ timeRanges: Array<{
847
+ /**
848
+ * Start of availability window in ISO 8601 format with timezone offset, e.g. '2024-08-22T09:00:00-04:00'
849
+ */
850
+ startDate: string
851
+ /**
852
+ * End of availability window in ISO 8601 format with timezone offset, e.g. '2024-08-22T17:00:00-04:00'
853
+ */
854
+ endDate: string
855
+ /**
856
+ * Recurrence rules in RRULE format (e.g., ['RRULE:FREQ=WEEKLY;COUNT=10']). Can also include EXDATE for exception dates (e.g., ['RRULE:FREQ=WEEKLY;COUNT=10', 'EXDATE:2026-03-24T13:00:00']).
857
+ */
858
+ recurrence?: Array<string>
859
+ /**
860
+ * Unique identifier for this time range
861
+ */
862
+ id: string
863
+ }>
864
+ }>
865
+ }
866
+
867
+ /**
868
+ * Script input for the "Find available meeting times." effect (`calendar.suggestMeetingTimes`),
869
+ * derived from its Tool Core definition's call_function input projection.
870
+ *
871
+ * Analyzes calendar availability for multiple participants and returns ranked time slots when everyone is free.
872
+ * Use this when scheduling meetings or finding times that work for a group of people.
873
+ * Returns suggestions sorted by preference, showing which participants are available, softly conflicted by an unconfirmed RSVP, busy, or have unknown status for each slot.
874
+ */
875
+ export type SuggestMeetingTimesScriptInput = {
876
+ /**
877
+ * Individual participant or group email addresses to find time with. Resolvable groups are expanded into their members.
878
+ */
879
+ participantEmails: Array<string>
880
+ /**
881
+ * The duration of the meeting in minutes
882
+ */
883
+ durationMinutes: number
884
+ /**
885
+ * Start of the time range to consider, as an ISO 8601 date-time.
886
+ */
887
+ timeMin: string
888
+ /**
889
+ * End of the time range to consider, as an ISO 8601 date-time.
890
+ */
891
+ timeMax: string
892
+ /**
893
+ * Maximum number of suggestions to return (default: 10)
894
+ */
895
+ maxCount?: number
896
+ /**
897
+ * Date-times of returned events will be expressed in this time-zone
898
+ */
899
+ timeZone: string
900
+ /**
901
+ * Whether to include participant event schedules in the response
902
+ */
903
+ includeParticipantSchedules?: boolean
904
+ }
905
+
906
+ /**
907
+ * Canonical Tool Core output for the "Find available meeting times." effect (`calendar.suggestMeetingTimes`).
908
+ * This is the definition's output schema; the effect's script surface may
909
+ * re-encode it before returning.
910
+ */
911
+ export type SuggestMeetingTimesScriptOutput = {
912
+ /**
913
+ * Ranked list of available meeting time slots, sorted from most to least preferable. Each slot includes start/end times and categorizes participants by availability status.
914
+ */
915
+ suggestions: Array<{
916
+ /**
917
+ * Start time in ISO 8601 format
918
+ */
919
+ startAt: string
920
+ /**
921
+ * End time in ISO 8601 format
922
+ */
923
+ endAt: string
924
+ /**
925
+ * Total number of hard event conflicts, including multiple events for one participant
926
+ */
927
+ hardEventConflictCount: number
928
+ /**
929
+ * Total number of soft event conflicts, including multiple events for one participant
930
+ */
931
+ softEventConflictCount: number
932
+ /**
933
+ * Participant emails for invitees with conflicts with this meeting time
934
+ */
935
+ unavailableParticipants: Array<string>
936
+ /**
937
+ * Participant emails for invitees who are available for this meeting time
938
+ */
939
+ availableParticipants: Array<string>
940
+ /**
941
+ * Participant emails for invitees with overlapping events whose RSVP is not firm yet
942
+ */
943
+ softConflictParticipants: Array<string>
944
+ /**
945
+ * Participant emails for invitees with unknown status
946
+ */
947
+ unknownStatus: Array<string>
948
+ /**
949
+ * Readable participant events that overlap this meeting time, including the participant and whether each event creates a hard or soft conflict
950
+ */
951
+ conflictingEvents: Array<{
952
+ participantEmail: string
953
+ eventId: string
954
+ summary?: string
955
+ /**
956
+ * What kind of event is it? Standard, out of office, birthday...
957
+ */
958
+ eventType:
959
+ | "fromGmail"
960
+ | "default"
961
+ | "focusTime"
962
+ | "outOfOffice"
963
+ | "birthday"
964
+ | "availability"
965
+ /**
966
+ * The calendar user's RSVP status
967
+ */
968
+ responseStatus?: "needsAction" | "accepted" | "declined" | "tentative"
969
+ conflictType: "hard" | "soft"
970
+ }>
971
+ }>
972
+ /**
973
+ * Whether one or more suggestions use a shorter duration than requested because no sufficiently conflict-free times were available at the requested duration
974
+ */
975
+ usedFlexibleDuration: boolean
976
+ /**
977
+ * List of participant schedules, one for each individual participant, including resolved group members. Each schedule includes basic participant information and a list of the participant's calendar events.
978
+ */
979
+ participantSchedules?: Array<{
980
+ accountId: string
981
+ coworkerEmail: string
982
+ profile?: {
983
+ displayName?: string
984
+ email?: string
985
+ photoUrl?: string
986
+ }
987
+ events: Array<{
988
+ eventId: string
989
+ /**
990
+ * What kind of event is it? Standard, out of office, birthday...
991
+ */
992
+ eventType?:
993
+ | "fromGmail"
994
+ | "default"
995
+ | "focusTime"
996
+ | "outOfOffice"
997
+ | "birthday"
998
+ | "availability"
999
+ /**
1000
+ * Is an event confirmed, tentative or cancelled? This is different from the user's RSVP
1001
+ */
1002
+ eventStatus?: "confirmed" | "tentative" | "cancelled"
1003
+ summary: string
1004
+ /**
1005
+ * When the event is happening
1006
+ */
1007
+ period:
1008
+ | {
1009
+ type: "DATE"
1010
+ start: {
1011
+ /**
1012
+ * Date in ISO 8601 format (no time)
1013
+ */
1014
+ date: string
1015
+ }
1016
+ end: {
1017
+ /**
1018
+ * Date in ISO 8601 format (no time)
1019
+ */
1020
+ date: string
1021
+ }
1022
+ }
1023
+ | {
1024
+ type: "DATE_TIME"
1025
+ start: {
1026
+ /**
1027
+ * Date-time in ISO 8601 format, in UTC (ending with Z), or with TZ offset
1028
+ */
1029
+ dateTime: string
1030
+ timeZone?: string
1031
+ }
1032
+ end: {
1033
+ /**
1034
+ * Date-time in ISO 8601 format, in UTC (ending with Z), or with TZ offset
1035
+ */
1036
+ dateTime: string
1037
+ timeZone?: string
1038
+ }
1039
+ }
1040
+ /**
1041
+ * The calendar user's RSVP status
1042
+ */
1043
+ responseStatus?: "needsAction" | "accepted" | "declined" | "tentative"
1044
+ colors?: {
1045
+ foreground?: string
1046
+ background?: string
1047
+ }
1048
+ /**
1049
+ * If true, the event does not block time on the calendar. This is equivalent to setting `Show me as to Available` in the Calendar UI.
1050
+ */
1051
+ isTransparent: boolean
1052
+ /**
1053
+ * Whether it's a meeting, aka an event with attendees listed
1054
+ */
1055
+ isMeeting: boolean
1056
+ }>
1057
+ }>
1058
+ errors?: Array<{
1059
+ /**
1060
+ * An identifier for the item that failed (e.g., event summary for creation, event ID for updates/cancellations)
1061
+ */
1062
+ identifier: string
1063
+ /**
1064
+ * Description of the error that occurred
1065
+ */
1066
+ errorMessage: string
1067
+ }>
1068
+ }
1069
+
1070
+ export class CalendarConnectionClient {
1071
+ constructor(private readonly invoke: ConnectionActionInvoker) {}
1072
+ listCalendarResources(
1073
+ args: ListCalendarResourcesScriptInput,
1074
+ ): Promise<ListCalendarResourcesScriptOutput> {
1075
+ return this.invoke<ListCalendarResourcesScriptOutput>(
1076
+ "listCalendarResources",
1077
+ args,
1078
+ )
1079
+ }
1080
+ listCalendars(
1081
+ args: ListCalendarsScriptInput,
1082
+ ): Promise<ListCalendarsScriptOutput> {
1083
+ return this.invoke<ListCalendarsScriptOutput>("listCalendars", args)
1084
+ }
1085
+ listContacts(
1086
+ args: ListContactsScriptInput,
1087
+ ): Promise<ListContactsScriptOutput> {
1088
+ return this.invoke<ListContactsScriptOutput>("listContacts", args)
1089
+ }
1090
+ listCoworkersEvents(
1091
+ args: ListCoworkersEventsScriptInput,
1092
+ ): Promise<ListCoworkersEventsScriptOutput> {
1093
+ return this.invoke<ListCoworkersEventsScriptOutput>(
1094
+ "listCoworkersEvents",
1095
+ args,
1096
+ )
1097
+ }
1098
+ listEvents(args: ListEventsScriptInput): Promise<ListEventsScriptOutput> {
1099
+ return this.invoke<ListEventsScriptOutput>("listEvents", args)
1100
+ }
1101
+ listSchedulingLinks(
1102
+ args: ListSchedulingLinksScriptInput,
1103
+ ): Promise<ListSchedulingLinksScriptOutput> {
1104
+ return this.invoke<ListSchedulingLinksScriptOutput>(
1105
+ "listSchedulingLinks",
1106
+ args,
1107
+ )
1108
+ }
1109
+ suggestMeetingTimes(
1110
+ args: SuggestMeetingTimesScriptInput,
1111
+ ): Promise<SuggestMeetingTimesScriptOutput> {
1112
+ return this.invoke<SuggestMeetingTimesScriptOutput>(
1113
+ "suggestMeetingTimes",
1114
+ args,
1115
+ )
1116
+ }
1117
+ }