gdrivekit 3.2.0

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 (121) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +275 -0
  3. package/dist/auth.d.ts +3 -0
  4. package/dist/components/01-FileOperation/copyFile.d.ts +6 -0
  5. package/dist/components/01-FileOperation/deleteFile.d.ts +7 -0
  6. package/dist/components/01-FileOperation/downloadFile.d.ts +8 -0
  7. package/dist/components/01-FileOperation/getFileIdByName.d.ts +15 -0
  8. package/dist/components/01-FileOperation/getFileInfo.d.ts +20 -0
  9. package/dist/components/01-FileOperation/helpers.d.ts +18 -0
  10. package/dist/components/01-FileOperation/moveFile.d.ts +6 -0
  11. package/dist/components/01-FileOperation/readFileData.d.ts +5 -0
  12. package/dist/components/01-FileOperation/renameFile.d.ts +6 -0
  13. package/dist/components/01-FileOperation/updateFile.d.ts +8 -0
  14. package/dist/components/01-FileOperation/uploadFile.d.ts +12 -0
  15. package/dist/components/02-JsonOperation/addJsonKeyValue.d.ts +13 -0
  16. package/dist/components/02-JsonOperation/createJsonFile.d.ts +14 -0
  17. package/dist/components/02-JsonOperation/deleteJsonFieldAndKeys.d.ts +13 -0
  18. package/dist/components/02-JsonOperation/pushJsonObjectToArray.d.ts +5 -0
  19. package/dist/components/02-JsonOperation/readJsonFileData.d.ts +5 -0
  20. package/dist/components/02-JsonOperation/selectJsonContent.d.ts +6 -0
  21. package/dist/components/02-JsonOperation/updateJsonFieldAndValues.d.ts +13 -0
  22. package/dist/components/03-FolderOperation/createFolder.d.ts +6 -0
  23. package/dist/components/03-FolderOperation/deleteFolder.d.ts +7 -0
  24. package/dist/components/03-FolderOperation/renameFolder.d.ts +6 -0
  25. package/dist/components/04-SearchOperation/searchByContent.d.ts +5 -0
  26. package/dist/components/04-SearchOperation/searchByExactName.d.ts +5 -0
  27. package/dist/components/04-SearchOperation/searchByName.d.ts +5 -0
  28. package/dist/components/04-SearchOperation/searchByType.d.ts +5 -0
  29. package/dist/components/04-SearchOperation/searchFiles.d.ts +6 -0
  30. package/dist/components/04-SearchOperation/searchModifiedAfter.d.ts +5 -0
  31. package/dist/components/04-SearchOperation/searchSharedFiles.d.ts +4 -0
  32. package/dist/components/04-SearchOperation/searchStarredFiles.d.ts +4 -0
  33. package/dist/components/05-ListOperation/getFolderIdByName.d.ts +15 -0
  34. package/dist/components/05-ListOperation/listAllFolders.d.ts +4 -0
  35. package/dist/components/05-ListOperation/listArchives.d.ts +4 -0
  36. package/dist/components/05-ListOperation/listAudios.d.ts +4 -0
  37. package/dist/components/05-ListOperation/listDocs.d.ts +4 -0
  38. package/dist/components/05-ListOperation/listFiles.d.ts +5 -0
  39. package/dist/components/05-ListOperation/listFilesInFolder.d.ts +5 -0
  40. package/dist/components/05-ListOperation/listFoldersByName.d.ts +5 -0
  41. package/dist/components/05-ListOperation/listFoldersInFolder.d.ts +5 -0
  42. package/dist/components/05-ListOperation/listImages.d.ts +4 -0
  43. package/dist/components/05-ListOperation/listJSONs.d.ts +4 -0
  44. package/dist/components/05-ListOperation/listPDFs.d.ts +4 -0
  45. package/dist/components/05-ListOperation/listPresentations.d.ts +4 -0
  46. package/dist/components/05-ListOperation/listRecentFiles.d.ts +5 -0
  47. package/dist/components/05-ListOperation/listSheets.d.ts +4 -0
  48. package/dist/components/05-ListOperation/listVideos.d.ts +4 -0
  49. package/dist/components/06-BatchOperation/deleteMultipleFiles.d.ts +10 -0
  50. package/dist/components/06-BatchOperation/downloadMultipleFiles.d.ts +14 -0
  51. package/dist/components/06-BatchOperation/uploadMultipleFiles.d.ts +9 -0
  52. package/dist/components/07-UtilityOperation/createStream.d.ts +4 -0
  53. package/dist/components/07-UtilityOperation/encrypt.d.ts +8 -0
  54. package/dist/components/07-UtilityOperation/fileUtils.d.ts +20 -0
  55. package/dist/components/07-UtilityOperation/shareFile.d.ts +4 -0
  56. package/dist/components/07-UtilityOperation/zip.d.ts +18 -0
  57. package/dist/components/08-ConversionOperation/convertDocs.d.ts +5 -0
  58. package/dist/components/08-ConversionOperation/convertDrawing.d.ts +3 -0
  59. package/dist/components/08-ConversionOperation/convertPdf.d.ts +2 -0
  60. package/dist/components/08-ConversionOperation/convertSheets.d.ts +5 -0
  61. package/dist/components/08-ConversionOperation/convertSlides.d.ts +4 -0
  62. package/dist/components/09-WatcherOperation/watchFolderDeepEvent.d.ts +8 -0
  63. package/dist/components/09-WatcherOperation/watchFolderEvent.d.ts +8 -0
  64. package/dist/components/10-ScriptOperation/createGoogleScript.d.ts +29 -0
  65. package/dist/components/10-ScriptOperation/deleteGoogleScript.d.ts +4 -0
  66. package/dist/components/10-ScriptOperation/deployGoogleScript.d.ts +7 -0
  67. package/dist/components/10-ScriptOperation/runGoogleScriptFunction.d.ts +22 -0
  68. package/dist/components/10-ScriptOperation/updateGoogleScript.d.ts +4 -0
  69. package/dist/components/index.d.ts +65 -0
  70. package/dist/const/index.d.ts +34 -0
  71. package/dist/drivers/Client.d.ts +27 -0
  72. package/dist/drivers/GoogleDriveService.d.ts +238 -0
  73. package/dist/drivers/functions/archive/convertFilesAndFoldersToZip.d.ts +16 -0
  74. package/dist/drivers/functions/conversion/ConversionFunction.d.ts +3 -0
  75. package/dist/drivers/functions/encryption/decryptText.d.ts +2 -0
  76. package/dist/drivers/functions/encryption/encryptText.d.ts +2 -0
  77. package/dist/drivers/functions/files/createStream.d.ts +2 -0
  78. package/dist/drivers/functions/files/createStreamfilesandFolder.d.ts +2 -0
  79. package/dist/drivers/functions/files/deleteFile.d.ts +8 -0
  80. package/dist/drivers/functions/files/downloadFile.d.ts +8 -0
  81. package/dist/drivers/functions/files/getAllFilesInParent.d.ts +6 -0
  82. package/dist/drivers/functions/files/getFile.d.ts +6 -0
  83. package/dist/drivers/functions/files/listFiles.d.ts +6 -0
  84. package/dist/drivers/functions/files/moveFile.d.ts +3 -0
  85. package/dist/drivers/functions/files/readFileData.d.ts +4 -0
  86. package/dist/drivers/functions/files/updateFileContent.d.ts +2 -0
  87. package/dist/drivers/functions/files/uploadFile.d.ts +6 -0
  88. package/dist/drivers/functions/folders/createFolder.d.ts +6 -0
  89. package/dist/drivers/functions/json/addJsonContent.d.ts +3 -0
  90. package/dist/drivers/functions/json/createJsonFile.d.ts +11 -0
  91. package/dist/drivers/functions/json/pushJsonObjectToArray.d.ts +2 -0
  92. package/dist/drivers/functions/json/selectJsonContent.d.ts +2 -0
  93. package/dist/drivers/functions/json/updateJsonContent.d.ts +3 -0
  94. package/dist/drivers/functions/metadata/getCompleteFileMetadata.d.ts +3 -0
  95. package/dist/drivers/functions/metadata/getFileMetadata.d.ts +3 -0
  96. package/dist/drivers/functions/metadata/getFileTypeBreakdown.d.ts +2 -0
  97. package/dist/drivers/functions/metadata/getImageMetadata.d.ts +3 -0
  98. package/dist/drivers/functions/metadata/getVideoMetadata.d.ts +3 -0
  99. package/dist/drivers/functions/metadata/updateFileMetadata.d.ts +3 -0
  100. package/dist/drivers/functions/permissions/shareFile.d.ts +3 -0
  101. package/dist/drivers/functions/scripts/DeployScript.d.ts +13 -0
  102. package/dist/drivers/functions/scripts/createScriptProject.d.ts +13 -0
  103. package/dist/drivers/functions/scripts/deleteScriptProject.d.ts +10 -0
  104. package/dist/drivers/functions/scripts/manageTrigger.d.ts +26 -0
  105. package/dist/drivers/functions/scripts/runScriptProject.d.ts +6 -0
  106. package/dist/drivers/functions/scripts/updateScriptProject.d.ts +10 -0
  107. package/dist/drivers/functions/search/findDuplicate.d.ts +2 -0
  108. package/dist/drivers/functions/search/searchFiles.d.ts +3 -0
  109. package/dist/drivers/functions/storage/getStorageQuota.d.ts +3 -0
  110. package/dist/drivers/functions/utils.d.ts +6 -0
  111. package/dist/drivers/functions/watcher/watchFolder.d.ts +6 -0
  112. package/dist/drivers/functions/watcher/watchFolderDeep.d.ts +6 -0
  113. package/dist/drivers/oauth2-client.d.ts +204 -0
  114. package/dist/drivers/services.d.ts +37 -0
  115. package/dist/index.d.ts +6 -0
  116. package/dist/index.js +36210 -0
  117. package/dist/operations.d.ts +330 -0
  118. package/package.json +62 -0
  119. package/types/archiver-bypass.d.ts +9 -0
  120. package/types/archiver-extend.d.ts +0 -0
  121. package/types/index.d.ts +756 -0
@@ -0,0 +1,756 @@
1
+ // ============================================
2
+ // Authentication & Credentials Types
3
+ // ============================================
4
+
5
+ import { MIME_TYPES } from "../const";
6
+
7
+ export interface GoogleCredentials {
8
+ web?: WebCredentials;
9
+ installed?: InstalledCredentials;
10
+ client_id?: string;
11
+ client_secret?: string;
12
+ redirect_uri?: string;
13
+ }
14
+
15
+ export interface WebCredentials {
16
+ client_id: string;
17
+ project_id: string;
18
+ auth_uri: string;
19
+ token_uri: string;
20
+ auth_provider_x509_cert_url: string;
21
+ client_secret: string;
22
+ redirect_uris: string[];
23
+ javascript_origins?: string[];
24
+ }
25
+
26
+ export interface InstalledCredentials {
27
+ client_id: string;
28
+ client_secret: string;
29
+ redirect_uris: string[];
30
+ auth_uri?: string;
31
+ token_uri?: string;
32
+ }
33
+
34
+ export interface TokenData {
35
+ access_token: string;
36
+ refresh_token?: string;
37
+ scope: string;
38
+ token_type: string;
39
+ expiry_date: number;
40
+ id_token?: string;
41
+ }
42
+
43
+ export interface CredentialsFileParams {
44
+ clientid: string;
45
+ projectid: string;
46
+ clientsecret: string;
47
+ redirecturis?: string[];
48
+ javascript_origin?: string[];
49
+ }
50
+
51
+ // ============================================
52
+ // File Metadata Types
53
+ // ============================================
54
+
55
+ export interface FileMetadata {
56
+ id: string;
57
+ name: string;
58
+ mimeType: string;
59
+ description?: string;
60
+ starred?: boolean;
61
+ trashed?: boolean;
62
+ explicitlyTrashed?: boolean;
63
+ parents?: string[];
64
+ properties?: Record<string, string>;
65
+ appProperties?: Record<string, string>;
66
+ spaces?: string[];
67
+ version?: string;
68
+ webContentLink?: string;
69
+ webViewLink?: string;
70
+ iconLink?: string;
71
+ hasThumbnail?: boolean;
72
+ thumbnailLink?: string;
73
+ thumbnailVersion?: string;
74
+ viewedByMe?: boolean;
75
+ viewedByMeTime?: string;
76
+ createdTime?: string;
77
+ modifiedTime?: string;
78
+ modifiedByMeTime?: string;
79
+ modifiedByMe?: boolean;
80
+ sharedWithMeTime?: string;
81
+ sharingUser?: User;
82
+ owners?: User[];
83
+ teamDriveId?: string;
84
+ driveId?: string;
85
+ lastModifyingUser?: User;
86
+ shared?: boolean;
87
+ ownedByMe?: boolean;
88
+ capabilities?: FileCapabilities;
89
+ viewersCanCopyContent?: boolean;
90
+ copyRequiresWriterPermission?: boolean;
91
+ writersCanShare?: boolean;
92
+ permissions?: Permission[];
93
+ permissionIds?: string[];
94
+ hasAugmentedPermissions?: boolean;
95
+ folderColorRgb?: string;
96
+ originalFilename?: string;
97
+ fullFileExtension?: string;
98
+ fileExtension?: string;
99
+ md5Checksum?: string;
100
+ size?: string;
101
+ quotaBytesUsed?: string;
102
+ headRevisionId?: string;
103
+ contentHints?: ContentHints;
104
+ imageMediaMetadata?: ImageMediaMetadata;
105
+ videoMediaMetadata?: VideoMediaMetadata;
106
+ isAppAuthorized?: boolean;
107
+ exportLinks?: Record<string, string>;
108
+ shortcutDetails?: ShortcutDetails;
109
+ contentRestrictions?: ContentRestriction[];
110
+ resourceKey?: string;
111
+ linkShareMetadata?: LinkShareMetadata;
112
+ labelInfo?: LabelInfo;
113
+ sha1Checksum?: string;
114
+ sha256Checksum?: string;
115
+ }
116
+
117
+ export interface User {
118
+ displayName?: string;
119
+ kind?: string;
120
+ me?: boolean;
121
+ permissionId?: string;
122
+ emailAddress?: string;
123
+ photoLink?: string;
124
+ }
125
+
126
+ export interface FileCapabilities {
127
+ canAcceptOwnership?: boolean;
128
+ canAddChildren?: boolean;
129
+ canAddFolderFromAnotherDrive?: boolean;
130
+ canAddMyDriveParent?: boolean;
131
+ canChangeCopyRequiresWriterPermission?: boolean;
132
+ canChangeSecurityUpdateEnabled?: boolean;
133
+ canChangeViewersCanCopyContent?: boolean;
134
+ canComment?: boolean;
135
+ canCopy?: boolean;
136
+ canDelete?: boolean;
137
+ canDeleteChildren?: boolean;
138
+ canDownload?: boolean;
139
+ canEdit?: boolean;
140
+ canListChildren?: boolean;
141
+ canModifyContent?: boolean;
142
+ canModifyContentRestriction?: boolean;
143
+ canModifyLabels?: boolean;
144
+ canMoveChildrenOutOfDrive?: boolean;
145
+ canMoveChildrenOutOfTeamDrive?: boolean;
146
+ canMoveChildrenWithinDrive?: boolean;
147
+ canMoveChildrenWithinTeamDrive?: boolean;
148
+ canMoveItemIntoTeamDrive?: boolean;
149
+ canMoveItemOutOfDrive?: boolean;
150
+ canMoveItemOutOfTeamDrive?: boolean;
151
+ canMoveItemWithinDrive?: boolean;
152
+ canMoveItemWithinTeamDrive?: boolean;
153
+ canMoveTeamDriveItem?: boolean;
154
+ canReadDrive?: boolean;
155
+ canReadLabels?: boolean;
156
+ canReadRevisions?: boolean;
157
+ canReadTeamDrive?: boolean;
158
+ canRemoveChildren?: boolean;
159
+ canRemoveMyDriveParent?: boolean;
160
+ canRename?: boolean;
161
+ canShare?: boolean;
162
+ canTrash?: boolean;
163
+ canTrashChildren?: boolean;
164
+ canUntrash?: boolean;
165
+ }
166
+
167
+ export interface Permission {
168
+ id?: string;
169
+ type?: 'user' | 'group' | 'domain' | 'anyone';
170
+ emailAddress?: string;
171
+ domain?: string;
172
+ role?: 'owner' | 'organizer' | 'fileOrganizer' | 'writer' | 'commenter' | 'reader';
173
+ displayName?: string;
174
+ photoLink?: string;
175
+ expirationTime?: string;
176
+ deleted?: boolean;
177
+ permissionDetails?: PermissionDetail[];
178
+ }
179
+
180
+ export interface PermissionDetail {
181
+ permissionType?: string;
182
+ role?: string;
183
+ inheritedFrom?: string;
184
+ inherited?: boolean;
185
+ }
186
+
187
+ export interface ContentHints {
188
+ thumbnail?: {
189
+ image?: string;
190
+ mimeType?: string;
191
+ };
192
+ indexableText?: string;
193
+ }
194
+
195
+ export interface ImageMediaMetadata {
196
+ width?: number;
197
+ height?: number;
198
+ rotation?: number;
199
+ location?: {
200
+ latitude?: number;
201
+ longitude?: number;
202
+ altitude?: number;
203
+ };
204
+ time?: string;
205
+ cameraMake?: string;
206
+ cameraModel?: string;
207
+ exposureTime?: number;
208
+ aperture?: number;
209
+ flashUsed?: boolean;
210
+ focalLength?: number;
211
+ isoSpeed?: number;
212
+ meteringMode?: string;
213
+ sensor?: string;
214
+ exposureMode?: string;
215
+ colorSpace?: string;
216
+ whiteBalance?: string;
217
+ exposureBias?: number;
218
+ maxApertureValue?: number;
219
+ subjectDistance?: number;
220
+ lens?: string;
221
+ }
222
+
223
+ export interface VideoMediaMetadata {
224
+ width?: number;
225
+ height?: number;
226
+ durationMillis?: string;
227
+ }
228
+
229
+ export interface StorageQuota {
230
+ usage?: string;
231
+ limit?: string;
232
+ }
233
+
234
+ export interface ShortcutDetails {
235
+ targetId?: string;
236
+ targetMimeType?: string;
237
+ targetResourceKey?: string;
238
+ }
239
+
240
+ export interface ContentRestriction {
241
+ readOnly?: boolean;
242
+ reason?: string;
243
+ restrictingUser?: User;
244
+ restrictionTime?: string;
245
+ type?: string;
246
+ }
247
+
248
+ export interface LinkShareMetadata {
249
+ securityUpdateEligible?: boolean;
250
+ securityUpdateEnabled?: boolean;
251
+ }
252
+
253
+ export interface LabelInfo {
254
+ labels?: Label[];
255
+ }
256
+
257
+ export interface Label {
258
+ id?: string;
259
+ revisionId?: string;
260
+ kind?: string;
261
+ fields?: Record<string, LabelField>;
262
+ }
263
+
264
+ export interface LabelField {
265
+ id?: string;
266
+ valueType?: string;
267
+ dateString?: string[];
268
+ integer?: string[];
269
+ selection?: string[];
270
+ text?: string[];
271
+ user?: User[];
272
+ }
273
+
274
+ // ============================================
275
+ // List Files Parameters
276
+ // ============================================
277
+
278
+ export interface ListFilesParams {
279
+ /** Maximum number of files to return per page (1-1000) */
280
+ pageSize?: number;
281
+
282
+ /** Query string for filtering files
283
+ * Examples:
284
+ * - "name contains 'report'"
285
+ * - "mimeType='application/pdf'"
286
+ * - "trashed=false"
287
+ * - "'folder_id' in parents"
288
+ */
289
+ query?: string;
290
+
291
+ /** Order results by field
292
+ * Options: 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime',
293
+ * 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime',
294
+ * 'starred', 'viewedByMeTime'
295
+ * Add 'desc' for descending: 'modifiedTime desc'
296
+ */
297
+ orderBy?: string;
298
+
299
+ /** Token for the next page of results */
300
+ pageToken?: string;
301
+
302
+ /** Comma-separated list of spaces to query (drive, appDataFolder, photos) */
303
+ spaces?: string;
304
+
305
+ /** Whether to include items from all drives (Shared Drives) */
306
+ includeItemsFromAllDrives?: boolean;
307
+
308
+ /** Whether Team Drive items should be included in results */
309
+ includeTeamDriveItems?: boolean;
310
+
311
+ /** Deprecated: Use includeItemsFromAllDrives */
312
+ supportsAllDrives?: boolean;
313
+
314
+ /** Deprecated: Use includeItemsFromAllDrives */
315
+ supportsTeamDrives?: boolean;
316
+
317
+ /** ID of the shared drive to search */
318
+ driveId?: string;
319
+
320
+ /** Deprecated: Use driveId */
321
+ teamDriveId?: string;
322
+
323
+ /** Selector specifying which fields to include in response */
324
+ fields?: string;
325
+
326
+ /** Whether the requesting application supports both My Drives and shared drives */
327
+ corpora?: 'user' | 'domain' | 'drive' | 'allDrives';
328
+
329
+ /** Deprecated: Use corpora */
330
+ corpus?: 'domain' | 'user';
331
+
332
+ /** Whether to include permissions for shared drive items */
333
+ includePermissionsForView?: string;
334
+ }
335
+
336
+ // ============================================
337
+ // Upload File Parameters
338
+ // ============================================
339
+
340
+ export interface UploadFileParams {
341
+ /** Path to the local file to upload */
342
+ filePath: string;
343
+
344
+ /** Metadata for the file */
345
+ metadata?: UploadFileMetadata;
346
+
347
+ /** Media metadata */
348
+ media?: {
349
+ mimeType?: string;
350
+ body?: any;
351
+ };
352
+ }
353
+
354
+ export interface UploadFileMetadata {
355
+ /** Name of the file */
356
+ name?: string;
357
+
358
+ /** MIME type of the file */
359
+ mimeType?: string;
360
+
361
+ /** Parent folder IDs */
362
+ parents?: string[];
363
+
364
+ /** Description of the file */
365
+ description?: string;
366
+
367
+ /** Whether the file is starred */
368
+ starred?: boolean;
369
+
370
+ /** Custom file properties (visible to all apps) */
371
+ properties?: Record<string, string>;
372
+
373
+ /** Private properties (visible only to the requesting app) */
374
+ appProperties?: Record<string, string>;
375
+
376
+ /** Folder color (RGB hex: #RRGGBB) */
377
+ folderColorRgb?: string;
378
+
379
+ /** Content hints */
380
+ contentHints?: ContentHints;
381
+
382
+ /** Modified time (RFC 3339 date-time) */
383
+ modifiedTime?: string;
384
+
385
+ /** Created time (RFC 3339 date-time) */
386
+ createdTime?: string;
387
+
388
+ /** Whether viewers can copy content */
389
+ viewersCanCopyContent?: boolean;
390
+
391
+ /** Whether writers can share */
392
+ writersCanShare?: boolean;
393
+
394
+ /** Whether copy requires writer permission */
395
+ copyRequiresWriterPermission?: boolean;
396
+ }
397
+
398
+ // ============================================
399
+ // Download File Parameters
400
+ // ============================================
401
+
402
+ export interface DownloadFileParams {
403
+ /** Google Drive file ID */
404
+ fileId: string;
405
+
406
+ /** Local destination path */
407
+ destPath: string;
408
+
409
+ /** Whether to acknowledge abuse risk (for flagged files) */
410
+ acknowledgeAbuse?: boolean;
411
+
412
+ /** Whether the requesting application supports shared drives */
413
+ supportsAllDrives?: boolean;
414
+
415
+ /** Whether to include permissions */
416
+ includePermissionsForView?: string;
417
+ }
418
+
419
+ // ============================================
420
+ // Update File Parameters
421
+ // ============================================
422
+
423
+ export interface UpdateFileContentParams {
424
+ /** Google Drive file ID */
425
+ fileId: string;
426
+
427
+ /** Path to the new content file */
428
+ filePath: string;
429
+
430
+ /** Media metadata */
431
+ media?: {
432
+ mimeType?: string;
433
+ };
434
+
435
+ /** Whether to set the modified date to the upload time */
436
+ keepRevisionForever?: boolean;
437
+
438
+ /** Whether to use content as indexable text */
439
+ useContentAsIndexableText?: boolean;
440
+
441
+ /** OCR language (for image files) */
442
+ ocrLanguage?: string;
443
+
444
+ /** Whether the requesting application supports shared drives */
445
+ supportsAllDrives?: boolean;
446
+ }
447
+
448
+ export interface UpdateFileMetadataParams {
449
+ /** Google Drive file ID */
450
+ fileId: string;
451
+
452
+ /** Updated metadata */
453
+ metadata: Partial<FileMetadata>;
454
+
455
+ /** Comma-separated list of parent IDs to add */
456
+ addParents?: string;
457
+
458
+ /** Comma-separated list of parent IDs to remove */
459
+ removeParents?: string;
460
+
461
+ /** Whether the requesting application supports shared drives */
462
+ supportsAllDrives?: boolean;
463
+
464
+ /** Whether to keep file revision forever */
465
+ keepRevisionForever?: boolean;
466
+
467
+ /** Whether to use content as indexable text */
468
+ useContentAsIndexableText?: boolean;
469
+
470
+ /** OCR language */
471
+ ocrLanguage?: string;
472
+
473
+ /** Selector specifying which fields to include in response */
474
+ fields?: string;
475
+ }
476
+
477
+ // ============================================
478
+ // Delete File Parameters
479
+ // ============================================
480
+
481
+ export interface DeleteFileParams {
482
+ /** Google Drive file ID */
483
+ fileId: string;
484
+
485
+ /** Whether the requesting application supports shared drives */
486
+ supportsAllDrives?: boolean;
487
+
488
+ /** Whether Team Drive items should be included */
489
+ supportsTeamDrives?: boolean;
490
+ }
491
+
492
+ // ============================================
493
+ // Create Folder Parameters
494
+ // ============================================
495
+
496
+ export interface CreateFolderParams {
497
+ /** Name of the folder */
498
+ folderName: string;
499
+
500
+ /** Parent folder ID */
501
+ parentFolderId?: string;
502
+
503
+ /** Additional metadata */
504
+ metadata?: Omit<UploadFileMetadata, 'mimeType'>;
505
+
506
+ /** Whether the requesting application supports shared drives */
507
+ supportsAllDrives?: boolean;
508
+ }
509
+
510
+ // ============================================
511
+ // Get File Metadata Parameters
512
+ // ============================================
513
+
514
+ export interface GetFileMetadataParams {
515
+ /** Google Drive file ID */
516
+ fileId: string;
517
+
518
+ /** Whether to acknowledge abuse risk */
519
+ acknowledgeAbuse?: boolean;
520
+
521
+ /** Selector specifying which fields to include
522
+ * Examples: 'id, name, mimeType, size, createdTime'
523
+ */
524
+ fields?: string;
525
+
526
+ /** Whether to include permissions for shared drive items */
527
+ includePermissionsForView?: string;
528
+
529
+ /** Whether the requesting application supports shared drives */
530
+ supportsAllDrives?: boolean;
531
+
532
+ /** Whether Team Drive items should be included */
533
+ supportsTeamDrives?: boolean;
534
+ }
535
+
536
+ // ============================================
537
+ // Search Files Parameters
538
+ // ============================================
539
+
540
+ export interface SearchFilesParams extends ListFilesParams {
541
+ /** Search query string
542
+ * Common queries:
543
+ * - "name contains 'keyword'"
544
+ * - "mimeType='image/jpeg'"
545
+ * - "fullText contains 'important'"
546
+ * - "modifiedTime > '2023-01-01T00:00:00'"
547
+ * - "'me' in owners"
548
+ * - "trashed=false and starred=true"
549
+ */
550
+ query: string;
551
+ }
552
+
553
+ // ============================================
554
+ // Copy File Parameters
555
+ // ============================================
556
+
557
+ export interface CopyFileParams {
558
+ /** Source file ID to copy */
559
+ fileId: string;
560
+
561
+ /** Metadata for the copied file */
562
+ metadata?: Partial<FileMetadata>;
563
+
564
+ /** Whether to ignore the domain's default visibility settings */
565
+ ignoreDefaultVisibility?: boolean;
566
+
567
+ /** Whether to keep revision forever */
568
+ keepRevisionForever?: boolean;
569
+
570
+ /** OCR language for image files */
571
+ ocrLanguage?: string;
572
+
573
+ /** Whether the requesting application supports shared drives */
574
+ supportsAllDrives?: boolean;
575
+
576
+ /** Selector specifying which fields to include in response */
577
+ fields?: string;
578
+ }
579
+
580
+ // ============================================
581
+ // Move File Parameters
582
+ // ============================================
583
+
584
+ export interface MoveFileParams {
585
+ /** File ID to move */
586
+ fileId: string;
587
+
588
+ /** Comma-separated list of parent IDs to add */
589
+ addParents?: string;
590
+
591
+ /** Comma-separated list of parent IDs to remove */
592
+ removeParents?: string;
593
+
594
+ /** Whether the requesting application supports shared drives */
595
+ supportsAllDrives?: boolean;
596
+
597
+ /** Selector specifying which fields to include in response */
598
+ fields?: string;
599
+ }
600
+
601
+ // ============================================
602
+ // Share File Parameters (Permissions)
603
+ // ============================================
604
+
605
+ export interface ShareFileParams {
606
+ /** File ID to share */
607
+ fileId: string;
608
+
609
+ /** Permission details */
610
+ permission: CreatePermissionParams;
611
+
612
+ /** Whether to send notification emails */
613
+ sendNotificationEmail?: boolean;
614
+
615
+ /** Custom message to include in notification email */
616
+ emailMessage?: string;
617
+
618
+ /** Whether the requesting application supports shared drives */
619
+ supportsAllDrives?: boolean;
620
+
621
+ /** Whether to transfer ownership */
622
+ transferOwnership?: boolean;
623
+
624
+ /** Whether to move to new owner's Drive */
625
+ moveToNewOwnersRoot?: boolean;
626
+ }
627
+
628
+ export interface CreatePermissionParams {
629
+ /** Type of grantee */
630
+ type: 'user' | 'group' | 'domain' | 'anyone';
631
+
632
+ /** Role granted */
633
+ role: 'owner' | 'organizer' | 'fileOrganizer' | 'writer' | 'commenter' | 'reader';
634
+
635
+ /** Email address (for user/group types) */
636
+ emailAddress?: string;
637
+
638
+ /** Domain name (for domain type) */
639
+ domain?: string;
640
+
641
+ /** Whether to allow file discovery */
642
+ allowFileDiscovery?: boolean;
643
+
644
+ /** Expiration time (RFC 3339 date-time) */
645
+ expirationTime?: string;
646
+ }
647
+
648
+ // ============================================
649
+ // Export File Parameters
650
+ // ============================================
651
+
652
+ export interface ExportFileParams {
653
+ /** File ID to export */
654
+ fileId: string;
655
+
656
+ /** MIME type to export to
657
+ * Google Docs: 'application/pdf', 'text/plain', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
658
+ * Google Sheets: 'application/pdf', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
659
+ * Google Slides: 'application/pdf', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
660
+ */
661
+ mimeType: string;
662
+
663
+ /** Local destination path */
664
+ destPath: string;
665
+ }
666
+
667
+ // ============================================
668
+ // Response Types
669
+ // ============================================
670
+
671
+ export interface ApiResponse<T> {
672
+ success: boolean;
673
+ data?: T;
674
+ error?: string;
675
+ errorCode?: string;
676
+ errorDetails?: any;
677
+ }
678
+
679
+ export interface ListFilesResponse {
680
+ files: FileMetadata[];
681
+ nextPageToken?: string;
682
+ incompleteSearch?: boolean;
683
+ }
684
+
685
+ export interface UploadFileResponse {
686
+ file: FileMetadata;
687
+ }
688
+
689
+ export interface DownloadFileResponse {
690
+ path: string;
691
+ size?: number;
692
+ }
693
+
694
+ export interface DeleteFileResponse {
695
+ message: string;
696
+ fileId: string;
697
+ }
698
+
699
+ export interface CreateFolderResponse {
700
+ folder: FileMetadata;
701
+ }
702
+
703
+ // ============================================
704
+ // Query Builder Types
705
+ // ============================================
706
+
707
+ export type QueryOperator = '=' | '!=' | '<' | '<=' | '>' | '>=' | 'contains' | 'in' | 'has';
708
+
709
+ export type QueryField =
710
+ | 'name'
711
+ | 'fullText'
712
+ | 'mimeType'
713
+ | 'modifiedTime'
714
+ | 'viewedByMeTime'
715
+ | 'trashed'
716
+ | 'starred'
717
+ | 'parents'
718
+ | 'owners'
719
+ | 'writers'
720
+ | 'readers'
721
+ | 'sharedWithMe'
722
+ | 'createdTime'
723
+ | 'properties'
724
+ | 'appProperties'
725
+ | 'visibility'
726
+ | 'shortcutDetails.targetId';
727
+
728
+ // ============================================
729
+ // Batch Operation Types
730
+ // ============================================
731
+
732
+ export interface BatchDeleteParams {
733
+ /** Array of file IDs to delete */
734
+ fileIds: string[];
735
+
736
+ /** Whether to continue on error */
737
+ continueOnError?: boolean;
738
+ }
739
+
740
+ export interface BatchDownloadParams {
741
+ /** Array of file IDs to download */
742
+ fileIds: string[];
743
+
744
+ /** Destination directory */
745
+ destDir: string;
746
+
747
+ /** Whether to continue on error */
748
+ continueOnError?: boolean;
749
+ }
750
+
751
+ // ============================================
752
+ // Common MIME Types
753
+ // ============================================
754
+
755
+
756
+ export type MimeType = typeof MIME_TYPES[keyof typeof MIME_TYPES]