@notionhq/apps 0.0.13 → 0.0.14

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 (89) hide show
  1. package/README.md +32 -28
  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/confluence.generated.d.ts +98 -0
  10. package/dist/confluence.generated.d.ts.map +1 -0
  11. package/dist/confluence.generated.js +18 -0
  12. package/dist/connection-actions.d.ts +2 -0
  13. package/dist/connection-actions.d.ts.map +1 -0
  14. package/dist/connection-actions.js +0 -0
  15. package/dist/connection-trigger-definitions.generated.d.ts +34 -0
  16. package/dist/connection-trigger-definitions.generated.d.ts.map +1 -0
  17. package/dist/connection-trigger-definitions.generated.js +45 -0
  18. package/dist/connections.d.ts +15 -0
  19. package/dist/connections.d.ts.map +1 -0
  20. package/dist/connections.js +79 -0
  21. package/dist/connections.test.d.ts +2 -0
  22. package/dist/connections.test.d.ts.map +1 -0
  23. package/dist/cursor.generated.d.ts +154 -0
  24. package/dist/cursor.generated.d.ts.map +1 -0
  25. package/dist/cursor.generated.js +18 -0
  26. package/dist/discord.generated.d.ts +279 -0
  27. package/dist/discord.generated.d.ts.map +1 -0
  28. package/dist/discord.generated.js +33 -0
  29. package/dist/gmail.generated.d.ts +184 -0
  30. package/dist/gmail.generated.d.ts.map +1 -0
  31. package/dist/gmail.generated.js +21 -0
  32. package/dist/googleCalendar.generated.d.ts +83 -0
  33. package/dist/googleCalendar.generated.d.ts.map +1 -0
  34. package/dist/googleCalendar.generated.js +15 -0
  35. package/dist/googleDrive.generated.d.ts +210 -0
  36. package/dist/googleDrive.generated.d.ts.map +1 -0
  37. package/dist/googleDrive.generated.js +27 -0
  38. package/dist/googleDriveOauth.generated.d.ts +851 -0
  39. package/dist/googleDriveOauth.generated.d.ts.map +1 -0
  40. package/dist/googleDriveOauth.generated.js +84 -0
  41. package/dist/outlook.generated.d.ts +224 -0
  42. package/dist/outlook.generated.d.ts.map +1 -0
  43. package/dist/outlook.generated.js +24 -0
  44. package/dist/providers.generated.d.ts +117 -0
  45. package/dist/providers.generated.d.ts.map +1 -0
  46. package/dist/providers.generated.js +108 -0
  47. package/dist/salesforce.generated.d.ts +151 -0
  48. package/dist/salesforce.generated.d.ts.map +1 -0
  49. package/dist/salesforce.generated.js +24 -0
  50. package/dist/slack.generated.d.ts +290 -0
  51. package/dist/slack.generated.d.ts.map +1 -0
  52. package/dist/slack.generated.js +30 -0
  53. package/dist/triggers.generated.d.ts +107 -32
  54. package/dist/triggers.generated.d.ts.map +1 -1
  55. package/dist/triggers.generated.js +36 -24
  56. package/dist/workflow-connections-types.test.d.ts +2 -0
  57. package/dist/workflow-connections-types.test.d.ts.map +1 -0
  58. package/dist/workflow-types.test.d.ts +2 -0
  59. package/dist/workflow-types.test.d.ts.map +1 -0
  60. package/dist/workflow.d.ts +20 -16
  61. package/dist/workflow.d.ts.map +1 -1
  62. package/dist/workflow.js +14 -17
  63. package/docs/BUILD.md +83 -14
  64. package/docs/CONNECTIONS.md +129 -0
  65. package/package.json +1 -1
  66. package/src/box.generated.ts +187 -0
  67. package/src/calendar.generated.ts +1117 -0
  68. package/src/cli/build.test.ts +33 -0
  69. package/src/cli/build.ts +6 -5
  70. package/src/confluence.generated.ts +109 -0
  71. package/src/connection-actions.ts +2 -0
  72. package/src/connection-trigger-definitions.generated.ts +48 -0
  73. package/src/connections.test.ts +157 -0
  74. package/src/connections.ts +126 -0
  75. package/src/cursor.generated.ts +167 -0
  76. package/src/discord.generated.ts +318 -0
  77. package/src/gmail.generated.ts +205 -0
  78. package/src/googleCalendar.generated.ts +95 -0
  79. package/src/googleDrive.generated.ts +235 -0
  80. package/src/googleDriveOauth.generated.ts +980 -0
  81. package/src/outlook.generated.ts +249 -0
  82. package/src/providers.generated.ts +207 -0
  83. package/src/salesforce.generated.ts +170 -0
  84. package/src/slack.generated.ts +330 -0
  85. package/src/triggers.generated.ts +112 -32
  86. package/src/workflow-connections-types.test.ts +59 -0
  87. package/src/workflow-types.test.ts +144 -0
  88. package/src/workflow.test.ts +112 -2
  89. package/src/workflow.ts +58 -29
@@ -0,0 +1,980 @@
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 "Append Google Sheet rows" effect (`googleDriveOauth.appendSheetRows`),
5
+ * derived from its Tool Core definition's call_function input projection.
6
+ *
7
+ * Append rows to a Google Sheet via OAuth.
8
+ */
9
+ export type AppendSheetRowsScriptInput = {
10
+ /**
11
+ * The Google Sheet file ID.
12
+ */
13
+ fileId: string
14
+ /**
15
+ * Sheet (tab) title to append to, e.g. 'Sheet1'.
16
+ */
17
+ sheet: string
18
+ /**
19
+ * 2D array of new rows to append (rows × columns). Each inner array is one row.
20
+ */
21
+ values: Array<Array<string>>
22
+ /**
23
+ * USER_ENTERED (default) parses formulas, dates, and numbers as if a user typed them. RAW stores each value exactly as provided.
24
+ */
25
+ valueInputOption?: "RAW" | "USER_ENTERED"
26
+ }
27
+
28
+ /**
29
+ * Canonical Tool Core output for the "Append Google Sheet rows" effect (`googleDriveOauth.appendSheetRows`).
30
+ * This is the definition's output schema; the effect's script surface may
31
+ * re-encode it before returning.
32
+ */
33
+ export type AppendSheetRowsScriptOutput = {
34
+ updatedRange?: string
35
+ updatedRows?: number
36
+ }
37
+
38
+ /**
39
+ * Script input for the "Batch update Google Doc" effect (`googleDriveOauth.batchUpdateDocument`),
40
+ * derived from its Tool Core definition's call_function input projection.
41
+ *
42
+ * Apply low-level Google Docs batchUpdate requests to a document via OAuth.
43
+ */
44
+ export type BatchUpdateDocumentScriptInput = {
45
+ /**
46
+ * The Google Doc file ID.
47
+ */
48
+ fileId: string
49
+ /**
50
+ * A list of updates to apply to the document. Each request should be a valid documents.batchUpdate Request object, using the schema documented in: https://developers.google.com/workspace/docs/api/reference/rest/v1/documents/request Requests will be applied in the order they are specified. If any request is not valid, no requests will be applied.
51
+ */
52
+ requests: Array<Record<string, unknown>>
53
+ /**
54
+ * Require the document revision returned by readDocument.
55
+ */
56
+ writeControl?: {
57
+ requiredRevisionId: string
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Canonical Tool Core output for the "Batch update Google Doc" effect (`googleDriveOauth.batchUpdateDocument`).
63
+ * This is the definition's output schema; the effect's script surface may
64
+ * re-encode it before returning.
65
+ */
66
+ export type BatchUpdateDocumentScriptOutput = {
67
+ replies: Array<Record<string, unknown>>
68
+ documentId: string
69
+ writeControl?: {
70
+ requiredRevisionId?: string
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Script input for the "Batch update Google Slides presentation" effect (`googleDriveOauth.batchUpdatePresentation`),
76
+ * derived from its Tool Core definition's call_function input projection.
77
+ *
78
+ * Apply low-level Google Slides batchUpdate requests to a presentation via OAuth.
79
+ */
80
+ export type BatchUpdatePresentationScriptInput = {
81
+ /**
82
+ * The Google Slides presentation file ID.
83
+ */
84
+ fileId: string
85
+ /**
86
+ * A list of updates to apply to the presentation. Each request should be a valid presentations.batchUpdate Request object, using the schema documented in: https://developers.google.com/workspace/slides/api/reference/rest/v1/presentations/request Requests will be applied in the order they are specified. If any request is not valid, no requests will be applied.
87
+ */
88
+ requests: Array<Record<string, unknown>>
89
+ /**
90
+ * Require the presentation revision returned by readPresentation.
91
+ */
92
+ writeControl?: {
93
+ requiredRevisionId: string
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Canonical Tool Core output for the "Batch update Google Slides presentation" effect (`googleDriveOauth.batchUpdatePresentation`).
99
+ * This is the definition's output schema; the effect's script surface may
100
+ * re-encode it before returning.
101
+ */
102
+ export type BatchUpdatePresentationScriptOutput = {
103
+ replies: Array<Record<string, unknown>>
104
+ presentationId: string
105
+ writeControl?: {
106
+ requiredRevisionId?: string
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Script input for the "Batch update Google Sheet" effect (`googleDriveOauth.batchUpdateSpreadsheet`),
112
+ * derived from its Tool Core definition's call_function input projection.
113
+ *
114
+ * Apply low-level Google Sheets batchUpdate requests to a spreadsheet via OAuth.
115
+ */
116
+ export type BatchUpdateSpreadsheetScriptInput = {
117
+ /**
118
+ * The Google Sheet file ID.
119
+ */
120
+ fileId: string
121
+ /**
122
+ * A list of updates to apply to the spreadsheet. Each request should be a valid spreadsheets.batchUpdate Request object, using the schema documented in: https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/request Requests will be applied in the order they are specified. If any request is not valid, no requests will be applied.
123
+ */
124
+ requests: Array<Record<string, unknown>>
125
+ /**
126
+ * Whether to include the updated spreadsheet resource in the response.
127
+ */
128
+ includeSpreadsheetInResponse?: boolean
129
+ /**
130
+ * A1 ranges to include when includeSpreadsheetInResponse is true.
131
+ */
132
+ responseRanges?: Array<string>
133
+ /**
134
+ * Whether the updated spreadsheet response should include grid data.
135
+ */
136
+ responseIncludeGridData?: boolean
137
+ }
138
+
139
+ /**
140
+ * Canonical Tool Core output for the "Batch update Google Sheet" effect (`googleDriveOauth.batchUpdateSpreadsheet`).
141
+ * This is the definition's output schema; the effect's script surface may
142
+ * re-encode it before returning.
143
+ */
144
+ export type BatchUpdateSpreadsheetScriptOutput = {
145
+ replies: Array<Record<string, unknown>>
146
+ spreadsheetId: string
147
+ updatedSpreadsheet?: Record<string, unknown>
148
+ }
149
+
150
+ /**
151
+ * Script input for the "Copy Google Drive file" effect (`googleDriveOauth.copyFile`),
152
+ * derived from its Tool Core definition's call_function input projection.
153
+ *
154
+ * Copy a Google Drive file via OAuth.
155
+ */
156
+ export type CopyFileScriptInput = {
157
+ /**
158
+ * The ID of the file to copy.
159
+ */
160
+ fileId: string
161
+ /**
162
+ * Optional name for the copy. Defaults to 'Copy of <original name>'.
163
+ */
164
+ name?: string
165
+ /**
166
+ * Optional folder or shared drive ID to place the copy in.
167
+ */
168
+ destinationParentId?: string
169
+ }
170
+
171
+ /**
172
+ * Canonical Tool Core output for the "Copy Google Drive file" effect (`googleDriveOauth.copyFile`).
173
+ * This is the definition's output schema; the effect's script surface may
174
+ * re-encode it before returning.
175
+ */
176
+ export type CopyFileScriptOutput = {
177
+ id: string
178
+ name: string
179
+ mimeType: string
180
+ webViewLink?: string
181
+ }
182
+
183
+ /**
184
+ * Script input for the "Create Google Doc" effect (`googleDriveOauth.createDocument`),
185
+ * derived from its Tool Core definition's call_function input projection.
186
+ *
187
+ * Create a new Google Doc with content via OAuth.
188
+ */
189
+ export type CreateDocumentScriptInput = {
190
+ /**
191
+ * The name for the new document.
192
+ */
193
+ name: string
194
+ /**
195
+ * HTML content for the document. Supports headings, paragraphs, lists, tables, bold, italic, links, etc. Google converts the HTML into native Doc formatting.
196
+ */
197
+ content: string
198
+ /**
199
+ * Optional folder or shared drive ID to create the document in.
200
+ */
201
+ parentId?: string
202
+ /**
203
+ * Optional description for the document.
204
+ */
205
+ description?: string
206
+ }
207
+
208
+ /**
209
+ * Canonical Tool Core output for the "Create Google Doc" effect (`googleDriveOauth.createDocument`).
210
+ * This is the definition's output schema; the effect's script surface may
211
+ * re-encode it before returning.
212
+ */
213
+ export type CreateDocumentScriptOutput = {
214
+ id: string
215
+ name: string
216
+ mimeType: string
217
+ webViewLink?: string
218
+ }
219
+
220
+ /**
221
+ * Script input for the "Create Google Drive folder" effect (`googleDriveOauth.createFolder`),
222
+ * derived from its Tool Core definition's call_function input projection.
223
+ *
224
+ * Create a new folder in Google Drive via OAuth.
225
+ */
226
+ export type CreateFolderScriptInput = {
227
+ /**
228
+ * The name for the new folder.
229
+ */
230
+ name: string
231
+ /**
232
+ * Optional folder or shared drive ID to create the folder in.
233
+ */
234
+ parentId?: string
235
+ /**
236
+ * Optional description for the folder.
237
+ */
238
+ description?: string
239
+ }
240
+
241
+ /**
242
+ * Canonical Tool Core output for the "Create Google Drive folder" effect (`googleDriveOauth.createFolder`).
243
+ * This is the definition's output schema; the effect's script surface may
244
+ * re-encode it before returning.
245
+ */
246
+ export type CreateFolderScriptOutput = {
247
+ id: string
248
+ name: string
249
+ webViewLink?: string
250
+ }
251
+
252
+ /**
253
+ * Script input for the "Create Google Slides presentation" effect (`googleDriveOauth.createPresentation`),
254
+ * derived from its Tool Core definition's call_function input projection.
255
+ *
256
+ * Create a new Google Slides presentation via OAuth.
257
+ */
258
+ export type CreatePresentationScriptInput = {
259
+ /**
260
+ * The name for the new presentation.
261
+ */
262
+ name: string
263
+ /**
264
+ * Optional title-slide title. Defaults to the name when omitted.
265
+ */
266
+ title?: string
267
+ /**
268
+ * Optional title-slide subtitle.
269
+ */
270
+ subtitle?: string
271
+ /**
272
+ * Optional folder or shared drive ID to create the presentation in.
273
+ */
274
+ parentId?: string
275
+ /**
276
+ * Optional description for the presentation.
277
+ */
278
+ description?: string
279
+ }
280
+
281
+ /**
282
+ * Canonical Tool Core output for the "Create Google Slides presentation" effect (`googleDriveOauth.createPresentation`).
283
+ * This is the definition's output schema; the effect's script surface may
284
+ * re-encode it before returning.
285
+ */
286
+ export type CreatePresentationScriptOutput = {
287
+ id: string
288
+ name: string
289
+ mimeType: string
290
+ webViewLink?: string
291
+ }
292
+
293
+ /**
294
+ * Script input for the "Create Google Sheet" effect (`googleDriveOauth.createSpreadsheet`),
295
+ * derived from its Tool Core definition's call_function input projection.
296
+ *
297
+ * Create a new Google Sheet with data via OAuth.
298
+ */
299
+ export type CreateSpreadsheetScriptInput = {
300
+ /**
301
+ * The name for the new spreadsheet.
302
+ */
303
+ name: string
304
+ /**
305
+ * CSV-formatted data: rows separated by newlines, columns by commas. Example: "Name,Age\nAlice,30\nBob,25"
306
+ */
307
+ content: string
308
+ /**
309
+ * Optional folder or shared drive ID to create the spreadsheet in.
310
+ */
311
+ parentId?: string
312
+ /**
313
+ * Optional description for the spreadsheet.
314
+ */
315
+ description?: string
316
+ }
317
+
318
+ /**
319
+ * Canonical Tool Core output for the "Create Google Sheet" effect (`googleDriveOauth.createSpreadsheet`).
320
+ * This is the definition's output schema; the effect's script surface may
321
+ * re-encode it before returning.
322
+ */
323
+ export type CreateSpreadsheetScriptOutput = {
324
+ id: string
325
+ name: string
326
+ mimeType: string
327
+ webViewLink?: string
328
+ }
329
+
330
+ /**
331
+ * Script input for the "Download Google Drive file" effect (`googleDriveOauth.downloadFile`),
332
+ * derived from its Tool Core definition's call_function input projection.
333
+ *
334
+ * Download a Google Drive file into the current thread.
335
+ */
336
+ export type DownloadFileScriptInput = {
337
+ /**
338
+ * The Google Drive file ID to download.
339
+ */
340
+ fileId: string
341
+ /**
342
+ * Optional Google Drive export MIME type for a native Google Workspace file, such as application/pdf.
343
+ */
344
+ exportMimeType?: string
345
+ }
346
+
347
+ /**
348
+ * Canonical Tool Core output for the "Download Google Drive file" effect (`googleDriveOauth.downloadFile`).
349
+ * This is the definition's output schema; the effect's script surface may
350
+ * re-encode it before returning.
351
+ */
352
+ export type DownloadFileScriptOutput = {
353
+ id: string
354
+ name: string
355
+ mimeType: string
356
+ sourceMimeType: string
357
+ modifiedTime?: string
358
+ }
359
+
360
+ /**
361
+ * Script input for the "List Google Drive changes" effect (`googleDriveOauth.listChanges`),
362
+ * derived from its Tool Core definition's call_function input projection.
363
+ *
364
+ * List Google Drive files modified since the trigger's previous poll.
365
+ */
366
+ export type ListChangesScriptInput = {
367
+ /**
368
+ * ISO 8601 timestamp from the trigger's `changeToken` variable.
369
+ */
370
+ pageToken: string
371
+ /**
372
+ * Override the auto-applied scope to query a specific shared drive.
373
+ */
374
+ driveId?: string
375
+ /**
376
+ * Override the auto-applied scope to filter to a folder's direct children.
377
+ */
378
+ folderId?: string
379
+ }
380
+
381
+ /**
382
+ * Canonical Tool Core output for the "List Google Drive changes" effect (`googleDriveOauth.listChanges`).
383
+ * This is the definition's output schema; the effect's script surface may
384
+ * re-encode it before returning.
385
+ */
386
+ export type ListChangesScriptOutput = {
387
+ changes: Array<{
388
+ fileId: string
389
+ removed: boolean
390
+ changeType?: string
391
+ time?: string
392
+ file?: {
393
+ id: string
394
+ name: string
395
+ mimeType: string
396
+ webViewLink?: string
397
+ modifiedTime?: string
398
+ createdTime?: string
399
+ }
400
+ }>
401
+ truncated?: boolean
402
+ nextModifiedAfter?: string
403
+ }
404
+
405
+ /**
406
+ * Script input for the "List Google Drive files" effect (`googleDriveOauth.listFiles`),
407
+ * derived from its Tool Core definition's call_function input projection.
408
+ *
409
+ * List Google Drive files via OAuth.
410
+ */
411
+ export type ListFilesScriptInput = {
412
+ /**
413
+ * Google Drive folder ID to list files from.
414
+ */
415
+ folderId?: string
416
+ /**
417
+ * Shared drive ID to list files from.
418
+ */
419
+ driveId?: string
420
+ /**
421
+ * Optional MIME type filters (e.g. 'application/vnd.google-apps.document', 'application/vnd.google-apps.folder').
422
+ */
423
+ mimeTypes?: Array<string>
424
+ /**
425
+ * Optional file or folder name prefix. This searches names only, not file content.
426
+ */
427
+ nameContains?: string
428
+ /**
429
+ * Optional most-recent-first sort order; it ranks results but does not filter to a time range. Use 'recency desc' for generic recent files, 'modifiedByMeTime desc' for files the connected user recently updated, and 'viewedByMeTime desc' for files they recently viewed.
430
+ */
431
+ orderBy?:
432
+ | "modifiedTime desc"
433
+ | "modifiedByMeTime desc"
434
+ | "viewedByMeTime desc"
435
+ | "recency desc"
436
+ /**
437
+ * Maximum number of files to return (default: 50, max: 100).
438
+ */
439
+ pageSize?: number
440
+ /**
441
+ * Token from a previous response to fetch the next page of results.
442
+ */
443
+ pageToken?: string
444
+ }
445
+
446
+ /**
447
+ * Canonical Tool Core output for the "List Google Drive files" effect (`googleDriveOauth.listFiles`).
448
+ * This is the definition's output schema; the effect's script surface may
449
+ * re-encode it before returning.
450
+ */
451
+ export type ListFilesScriptOutput = {
452
+ files: Array<{
453
+ id: string
454
+ name: string
455
+ mimeType: string
456
+ webViewLink?: string
457
+ modifiedTime?: string
458
+ createdTime?: string
459
+ modifiedByMeTime?: string
460
+ viewedByMeTime?: string
461
+ sharedWithMeTime?: string
462
+ }>
463
+ /**
464
+ * Pass this opaque token as pageToken for the next page.
465
+ */
466
+ nextPageToken?: string
467
+ /**
468
+ * True when an unscoped listing may have omitted shared-drive results.
469
+ */
470
+ incompleteSearch?: boolean
471
+ }
472
+
473
+ /**
474
+ * Script input for the "Move or rename Google Drive file" effect (`googleDriveOauth.moveFile`),
475
+ * derived from its Tool Core definition's call_function input projection.
476
+ *
477
+ * Move and/or rename a Google Drive file via OAuth.
478
+ */
479
+ export type MoveFileScriptInput = {
480
+ /**
481
+ * The ID of the file to move or rename.
482
+ */
483
+ fileId: string
484
+ /**
485
+ * New name for the file. Omit to keep the current name.
486
+ */
487
+ name?: string
488
+ /**
489
+ * Folder or shared drive ID to move the file into. Omit to keep the file in its current location.
490
+ */
491
+ destinationParentId?: string
492
+ }
493
+
494
+ /**
495
+ * Canonical Tool Core output for the "Move or rename Google Drive file" effect (`googleDriveOauth.moveFile`).
496
+ * This is the definition's output schema; the effect's script surface may
497
+ * re-encode it before returning.
498
+ */
499
+ export type MoveFileScriptOutput = {
500
+ id: string
501
+ name: string
502
+ mimeType: string
503
+ webViewLink?: string
504
+ }
505
+
506
+ /**
507
+ * Script input for the "Read Google Doc structure" effect (`googleDriveOauth.readDocument`),
508
+ * derived from its Tool Core definition's call_function input projection.
509
+ *
510
+ * Read a Google Doc's outline and optionally a section body via OAuth.
511
+ */
512
+ export type ReadDocumentScriptInput = {
513
+ /**
514
+ * The Google Doc file ID.
515
+ */
516
+ fileId: string
517
+ /**
518
+ * Optional tab ID from the overview. With no indices, returns the whole tab if it fits.
519
+ */
520
+ tabId?: string
521
+ /**
522
+ * Optional inclusive character index. Must be provided with tabId and endIndex.
523
+ */
524
+ startIndex?: number
525
+ /**
526
+ * Optional exclusive character index. Must be provided with tabId and startIndex.
527
+ */
528
+ endIndex?: number
529
+ }
530
+
531
+ /**
532
+ * Canonical Tool Core output for the "Read Google Doc structure" effect (`googleDriveOauth.readDocument`).
533
+ * This is the definition's output schema; the effect's script surface may
534
+ * re-encode it before returning.
535
+ */
536
+ export type ReadDocumentScriptOutput =
537
+ | {
538
+ id: string
539
+ title: string
540
+ type: "overview"
541
+ webViewLink?: string
542
+ revisionId?: string
543
+ tabs: Array<{
544
+ tabId: string
545
+ title: string
546
+ index?: number
547
+ nestingLevel?: number
548
+ parentTabId?: string
549
+ startIndex: number
550
+ endIndex: number
551
+ characterCount: number
552
+ headings: Array<{
553
+ heading: string
554
+ level: number
555
+ order: number
556
+ startIndex: number
557
+ contentStartIndex: number
558
+ endIndex: number
559
+ preview?: string
560
+ }>
561
+ }>
562
+ }
563
+ | {
564
+ id: string
565
+ title: string
566
+ type: "content"
567
+ webViewLink?: string
568
+ revisionId?: string
569
+ tabId: string
570
+ range: {
571
+ startIndex: number
572
+ endIndex: number
573
+ }
574
+ documentTab: Record<string, unknown>
575
+ }
576
+
577
+ /**
578
+ * Script input for the "Read Google Drive file" effect (`googleDriveOauth.readFile`),
579
+ * derived from its Tool Core definition's call_function input projection.
580
+ *
581
+ * Read a Google Drive file's content or metadata via OAuth.
582
+ */
583
+ export type ReadFileScriptInput = {
584
+ /**
585
+ * The Google Drive file ID to read.
586
+ */
587
+ fileId: string
588
+ /**
589
+ * When true, returns only file metadata without downloading content. Useful for checking file info without the cost of a full read.
590
+ */
591
+ metadataOnly?: boolean
592
+ }
593
+
594
+ /**
595
+ * Canonical Tool Core output for the "Read Google Drive file" effect (`googleDriveOauth.readFile`).
596
+ * This is the definition's output schema; the effect's script surface may
597
+ * re-encode it before returning.
598
+ */
599
+ export type ReadFileScriptOutput = {
600
+ id: string
601
+ name: string
602
+ mimeType: string
603
+ content?: string
604
+ webViewLink?: string
605
+ modifiedTime?: string
606
+ }
607
+
608
+ /**
609
+ * Script input for the "Read Google Slides structure" effect (`googleDriveOauth.readPresentation`),
610
+ * derived from its Tool Core definition's call_function input projection.
611
+ *
612
+ * Read a Google Slides presentation's structure via OAuth.
613
+ */
614
+ export type ReadPresentationScriptInput = {
615
+ /**
616
+ * The Google Slides file ID to read.
617
+ */
618
+ fileId: string
619
+ /**
620
+ * Optional. One to 20 slide, layout, or master page object IDs from the overview. Returns raw Page details. Omit to get the page map.
621
+ */
622
+ pageIds?: Array<string>
623
+ }
624
+
625
+ /**
626
+ * Canonical Tool Core output for the "Read Google Slides structure" effect (`googleDriveOauth.readPresentation`).
627
+ * This is the definition's output schema; the effect's script surface may
628
+ * re-encode it before returning.
629
+ */
630
+ export type ReadPresentationScriptOutput =
631
+ | {
632
+ id: string
633
+ title: string
634
+ type: "overview"
635
+ webViewLink?: string
636
+ revisionId?: string
637
+ slides: Array<{
638
+ pageId: string
639
+ index: number
640
+ title?: string
641
+ textPreview?: string
642
+ layoutId?: string
643
+ masterId?: string
644
+ }>
645
+ layouts: Array<{
646
+ pageId: string
647
+ name?: string
648
+ displayName?: string
649
+ masterId?: string
650
+ }>
651
+ masters: Array<{
652
+ pageId: string
653
+ }>
654
+ }
655
+ | {
656
+ id: string
657
+ title: string
658
+ type: "pages"
659
+ webViewLink?: string
660
+ revisionId?: string
661
+ pages: Array<Record<string, unknown>>
662
+ }
663
+
664
+ /**
665
+ * Script input for the "Read Google Sheet structure" effect (`googleDriveOauth.readSpreadsheet`),
666
+ * derived from its Tool Core definition's call_function input projection.
667
+ *
668
+ * Read a Google Sheet's structure and optionally one sheet's values via OAuth.
669
+ */
670
+ export type ReadSpreadsheetScriptInput = {
671
+ /**
672
+ * The Google Sheet file ID to read.
673
+ */
674
+ fileId: string
675
+ /**
676
+ * Optional explicit A1 range, including the tab name, such as "Sales!A1:H200". Omit for metadata only. Reads are limited to 10,000 requested cells and oversized requests fail with a narrower example.
677
+ */
678
+ range?: string
679
+ }
680
+
681
+ /**
682
+ * Canonical Tool Core output for the "Read Google Sheet structure" effect (`googleDriveOauth.readSpreadsheet`).
683
+ * This is the definition's output schema; the effect's script surface may
684
+ * re-encode it before returning.
685
+ */
686
+ export type ReadSpreadsheetScriptOutput = {
687
+ id: string
688
+ title: string
689
+ webViewLink?: string
690
+ sheets: Array<{
691
+ sheetId: number
692
+ title: string
693
+ index: number
694
+ rowCount?: number
695
+ columnCount?: number
696
+ }>
697
+ sheetValues?: {
698
+ requestedRange: string
699
+ returnedRange: string
700
+ majorDimension: string
701
+ values: Array<Array<string>>
702
+ }
703
+ }
704
+
705
+ /**
706
+ * Script input for the "Search Google Drive files" effect (`googleDriveOauth.searchFiles`),
707
+ * derived from its Tool Core definition's call_function input projection.
708
+ *
709
+ * Search Google Drive files via OAuth.
710
+ */
711
+ export type SearchFilesScriptInput = {
712
+ /**
713
+ * Plain-text search query for finding files by name or content. Do NOT put Drive query syntax here (e.g. mimeType=, modifiedTime>, name contains) — use the dedicated parameters instead.
714
+ */
715
+ query: string
716
+ /**
717
+ * Optional folder ID to scope the search within.
718
+ */
719
+ folderId?: string
720
+ /**
721
+ * Optional shared drive ID to scope the search within.
722
+ */
723
+ driveId?: string
724
+ /**
725
+ * Optional MIME type filters (e.g. 'application/vnd.google-apps.document', 'application/vnd.google-apps.folder').
726
+ */
727
+ mimeTypes?: Array<string>
728
+ /**
729
+ * Optional ISO date string to filter files modified after this date (e.g. '2024-01-01T00:00:00Z').
730
+ */
731
+ modifiedAfter?: string
732
+ /**
733
+ * Optional ISO date string to filter files created after this date. Use for finding new files.
734
+ */
735
+ createdAfter?: string
736
+ /**
737
+ * Maximum number of results per page (default: 20, max: 100).
738
+ */
739
+ pageSize?: number
740
+ /**
741
+ * Continuation cursor. Pass a prior result's `nextPageToken` to fetch the next page.
742
+ */
743
+ pageToken?: string
744
+ }
745
+
746
+ /**
747
+ * Canonical Tool Core output for the "Search Google Drive files" effect (`googleDriveOauth.searchFiles`).
748
+ * This is the definition's output schema; the effect's script surface may
749
+ * re-encode it before returning.
750
+ */
751
+ export type SearchFilesScriptOutput = {
752
+ files: Array<{
753
+ id: string
754
+ name: string
755
+ mimeType: string
756
+ webViewLink?: string
757
+ modifiedTime?: string
758
+ createdTime?: string
759
+ modifiedByMeTime?: string
760
+ viewedByMeTime?: string
761
+ sharedWithMeTime?: string
762
+ }>
763
+ /**
764
+ * Pass this opaque token as pageToken for the next page.
765
+ */
766
+ nextPageToken?: string
767
+ /**
768
+ * True when an unscoped search may have omitted shared-drive results.
769
+ */
770
+ incompleteSearch?: boolean
771
+ }
772
+
773
+ /**
774
+ * Script input for the "Trash Google Drive file" effect (`googleDriveOauth.trashFile`),
775
+ * derived from its Tool Core definition's call_function input projection.
776
+ *
777
+ * Move a Google Drive file to trash via OAuth.
778
+ */
779
+ export type TrashFileScriptInput = {
780
+ /**
781
+ * The ID of the file to trash.
782
+ */
783
+ fileId: string
784
+ }
785
+
786
+ /**
787
+ * Canonical Tool Core output for the "Trash Google Drive file" effect (`googleDriveOauth.trashFile`).
788
+ * This is the definition's output schema; the effect's script surface may
789
+ * re-encode it before returning.
790
+ */
791
+ export type TrashFileScriptOutput = {
792
+ id: string
793
+ name: string
794
+ trashed: boolean
795
+ }
796
+
797
+ /**
798
+ * Script input for the "Upload Google Drive file" effect (`googleDriveOauth.uploadFile`),
799
+ * derived from its Tool Core definition's call_function input projection.
800
+ *
801
+ * Create a new Google Drive file from a thread file.
802
+ */
803
+ export type UploadFileScriptInput = {
804
+ /**
805
+ * Authenticated thread file URI returned by computer.downloadFile, or session-file://<file-id> for a file attached to the Agent Service session.
806
+ */
807
+ fileUri: string
808
+ /**
809
+ * Source filename including extension, used to infer its media type.
810
+ */
811
+ sourceFileName: string
812
+ /**
813
+ * Optional name for the newly created Drive file. Defaults to sourceFileName.
814
+ */
815
+ name?: string
816
+ /**
817
+ * Optional destination folder or shared drive ID.
818
+ */
819
+ parentId?: string
820
+ /**
821
+ * Optional Drive file description.
822
+ */
823
+ description?: string
824
+ /**
825
+ * Optionally convert a compatible file to a native Google Workspace format.
826
+ */
827
+ convertTo?: "document" | "spreadsheet" | "presentation"
828
+ }
829
+
830
+ /**
831
+ * Canonical Tool Core output for the "Upload Google Drive file" effect (`googleDriveOauth.uploadFile`).
832
+ * This is the definition's output schema; the effect's script surface may
833
+ * re-encode it before returning.
834
+ */
835
+ export type UploadFileScriptOutput = {
836
+ id: string
837
+ name: string
838
+ mimeType: string
839
+ webViewLink?: string
840
+ }
841
+
842
+ /**
843
+ * Script input for the "Write Google Sheet range" effect (`googleDriveOauth.writeSheetRange`),
844
+ * derived from its Tool Core definition's call_function input projection.
845
+ *
846
+ * Write values to a range in a Google Sheet via OAuth.
847
+ */
848
+ export type WriteSheetRangeScriptInput = {
849
+ /**
850
+ * The Google Sheet file ID.
851
+ */
852
+ fileId: string
853
+ /**
854
+ * A1-notation range to write to, e.g. 'Sheet1!A1:C10'. Include the sheet name to avoid ambiguity.
855
+ */
856
+ range: string
857
+ /**
858
+ * 2D array of cell values (rows × columns). All cells are written as strings; Google parses formulas and numbers when valueInputOption is USER_ENTERED (default).
859
+ */
860
+ values: Array<Array<string>>
861
+ /**
862
+ * USER_ENTERED (default) parses formulas, dates, and numbers as if a user typed them. RAW stores each value exactly as provided.
863
+ */
864
+ valueInputOption?: "RAW" | "USER_ENTERED"
865
+ }
866
+
867
+ /**
868
+ * Canonical Tool Core output for the "Write Google Sheet range" effect (`googleDriveOauth.writeSheetRange`).
869
+ * This is the definition's output schema; the effect's script surface may
870
+ * re-encode it before returning.
871
+ */
872
+ export type WriteSheetRangeScriptOutput = {
873
+ updatedRange?: string
874
+ updatedCells?: number
875
+ }
876
+
877
+ export class GoogleDriveOauthConnectionClient {
878
+ constructor(private readonly invoke: ConnectionActionInvoker) {}
879
+ appendSheetRows(
880
+ args: AppendSheetRowsScriptInput,
881
+ ): Promise<AppendSheetRowsScriptOutput> {
882
+ return this.invoke<AppendSheetRowsScriptOutput>("appendSheetRows", args)
883
+ }
884
+ batchUpdateDocument(
885
+ args: BatchUpdateDocumentScriptInput,
886
+ ): Promise<BatchUpdateDocumentScriptOutput> {
887
+ return this.invoke<BatchUpdateDocumentScriptOutput>(
888
+ "batchUpdateDocument",
889
+ args,
890
+ )
891
+ }
892
+ batchUpdatePresentation(
893
+ args: BatchUpdatePresentationScriptInput,
894
+ ): Promise<BatchUpdatePresentationScriptOutput> {
895
+ return this.invoke<BatchUpdatePresentationScriptOutput>(
896
+ "batchUpdatePresentation",
897
+ args,
898
+ )
899
+ }
900
+ batchUpdateSpreadsheet(
901
+ args: BatchUpdateSpreadsheetScriptInput,
902
+ ): Promise<BatchUpdateSpreadsheetScriptOutput> {
903
+ return this.invoke<BatchUpdateSpreadsheetScriptOutput>(
904
+ "batchUpdateSpreadsheet",
905
+ args,
906
+ )
907
+ }
908
+ copyFile(args: CopyFileScriptInput): Promise<CopyFileScriptOutput> {
909
+ return this.invoke<CopyFileScriptOutput>("copyFile", args)
910
+ }
911
+ createDocument(
912
+ args: CreateDocumentScriptInput,
913
+ ): Promise<CreateDocumentScriptOutput> {
914
+ return this.invoke<CreateDocumentScriptOutput>("createDocument", args)
915
+ }
916
+ createFolder(
917
+ args: CreateFolderScriptInput,
918
+ ): Promise<CreateFolderScriptOutput> {
919
+ return this.invoke<CreateFolderScriptOutput>("createFolder", args)
920
+ }
921
+ createPresentation(
922
+ args: CreatePresentationScriptInput,
923
+ ): Promise<CreatePresentationScriptOutput> {
924
+ return this.invoke<CreatePresentationScriptOutput>(
925
+ "createPresentation",
926
+ args,
927
+ )
928
+ }
929
+ createSpreadsheet(
930
+ args: CreateSpreadsheetScriptInput,
931
+ ): Promise<CreateSpreadsheetScriptOutput> {
932
+ return this.invoke<CreateSpreadsheetScriptOutput>("createSpreadsheet", args)
933
+ }
934
+ downloadFile(
935
+ args: DownloadFileScriptInput,
936
+ ): Promise<DownloadFileScriptOutput> {
937
+ return this.invoke<DownloadFileScriptOutput>("downloadFile", args)
938
+ }
939
+ listChanges(args: ListChangesScriptInput): Promise<ListChangesScriptOutput> {
940
+ return this.invoke<ListChangesScriptOutput>("listChanges", args)
941
+ }
942
+ listFiles(args: ListFilesScriptInput): Promise<ListFilesScriptOutput> {
943
+ return this.invoke<ListFilesScriptOutput>("listFiles", args)
944
+ }
945
+ moveFile(args: MoveFileScriptInput): Promise<MoveFileScriptOutput> {
946
+ return this.invoke<MoveFileScriptOutput>("moveFile", args)
947
+ }
948
+ readDocument(
949
+ args: ReadDocumentScriptInput,
950
+ ): Promise<ReadDocumentScriptOutput> {
951
+ return this.invoke<ReadDocumentScriptOutput>("readDocument", args)
952
+ }
953
+ readFile(args: ReadFileScriptInput): Promise<ReadFileScriptOutput> {
954
+ return this.invoke<ReadFileScriptOutput>("readFile", args)
955
+ }
956
+ readPresentation(
957
+ args: ReadPresentationScriptInput,
958
+ ): Promise<ReadPresentationScriptOutput> {
959
+ return this.invoke<ReadPresentationScriptOutput>("readPresentation", args)
960
+ }
961
+ readSpreadsheet(
962
+ args: ReadSpreadsheetScriptInput,
963
+ ): Promise<ReadSpreadsheetScriptOutput> {
964
+ return this.invoke<ReadSpreadsheetScriptOutput>("readSpreadsheet", args)
965
+ }
966
+ searchFiles(args: SearchFilesScriptInput): Promise<SearchFilesScriptOutput> {
967
+ return this.invoke<SearchFilesScriptOutput>("searchFiles", args)
968
+ }
969
+ trashFile(args: TrashFileScriptInput): Promise<TrashFileScriptOutput> {
970
+ return this.invoke<TrashFileScriptOutput>("trashFile", args)
971
+ }
972
+ uploadFile(args: UploadFileScriptInput): Promise<UploadFileScriptOutput> {
973
+ return this.invoke<UploadFileScriptOutput>("uploadFile", args)
974
+ }
975
+ writeSheetRange(
976
+ args: WriteSheetRangeScriptInput,
977
+ ): Promise<WriteSheetRangeScriptOutput> {
978
+ return this.invoke<WriteSheetRangeScriptOutput>("writeSheetRange", args)
979
+ }
980
+ }