@corsair-dev/googledrive 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.d.ts CHANGED
@@ -3,12 +3,14 @@ export declare class GoogleDriveAPIError extends Error {
3
3
  constructor(message: string, code?: number | undefined);
4
4
  }
5
5
  export declare const GOOGLE_DRIVE_API_BASE = "https://www.googleapis.com/drive/v3";
6
+ export declare const GOOGLE_DOCS_API_BASE = "https://docs.googleapis.com/v1";
6
7
  type GoogleDriveRequestOptions = {
7
8
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
8
9
  body?: Record<string, unknown>;
9
10
  query?: Record<string, string | number | boolean | undefined>;
10
11
  /** Return the body as bytes (`BinaryResponse`) instead of decoding it as text. */
11
12
  responseType?: 'binary';
13
+ base?: string;
12
14
  };
13
15
  export declare function makeGoogleDriveRequest<T>(endpoint: string, credentials: string, options?: GoogleDriveRequestOptions): Promise<T>;
14
16
  export declare function makeAuthenticatedGoogleDriveRequest<T>(endpoint: string, ctx: {
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../client.ts"],"names":[],"mappings":"AAGA,qBAAa,mBAAoB,SAAQ,KAAK;aAG5B,IAAI,CAAC,EAAE,MAAM;gBAD7B,OAAO,EAAE,MAAM,EACC,IAAI,CAAC,EAAE,MAAM,YAAA;CAK9B;AAED,eAAO,MAAM,qBAAqB,wCAAwC,CAAC;AAE3E,KAAK,yBAAyB,GAAG;IAChC,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;IAC9D,kFAAkF;IAClF,YAA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AC,CA4BZ;AAUD,wBAAsB,mCAAmC,CAAC,CAAC,EAC1D,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,EAC1D,OAAO,GAAE,yBAA8B,GACrC,OAAO,CAAC,CAAC,CAAC,CAUZ"}
@@ -10,4 +10,54 @@ export declare const move: GoogleDriveEndpoints['filesMove'];
10
10
  export declare const download: GoogleDriveEndpoints['filesDownload'];
11
11
  export declare const exportFile: GoogleDriveEndpoints['filesExport'];
12
12
  export declare const share: GoogleDriveEndpoints['filesShare'];
13
+ type DocsParagraphElement = {
14
+ textRun?: {
15
+ content?: string;
16
+ };
17
+ person?: {
18
+ personProperties?: {
19
+ name?: string;
20
+ email?: string;
21
+ };
22
+ };
23
+ richLink?: {
24
+ richLinkProperties?: {
25
+ title?: string;
26
+ uri?: string;
27
+ };
28
+ };
29
+ dateElement?: {
30
+ dateElementProperties?: {
31
+ displayText?: string;
32
+ };
33
+ };
34
+ };
35
+ type DocsStructuralElement = {
36
+ paragraph?: {
37
+ elements?: DocsParagraphElement[];
38
+ };
39
+ tableOfContents?: {
40
+ content?: DocsStructuralElement[];
41
+ };
42
+ table?: {
43
+ tableRows?: {
44
+ tableCells?: {
45
+ content?: DocsStructuralElement[];
46
+ }[];
47
+ }[];
48
+ };
49
+ };
50
+ export type DocsTab = {
51
+ tabProperties?: {
52
+ title?: string;
53
+ };
54
+ documentTab?: {
55
+ body?: {
56
+ content?: DocsStructuralElement[];
57
+ };
58
+ };
59
+ childTabs?: DocsTab[];
60
+ };
61
+ export declare const exportText: GoogleDriveEndpoints['filesExportText'];
62
+ export {};
13
63
  //# sourceMappingURL=files.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../endpoints/files.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA6B,oBAAoB,EAAE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,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACrB,aAAa,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,WAAW,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE;YAAE,OAAO,CAAC,EAAE,qBAAqB,EAAE,CAAA;SAAE,CAAA;KAAE,CAAC;IAC/D,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB,CAAC;AAsCF,eAAO,MAAM,UAAU,EAAE,oBAAoB,CAAC,iBAAiB,CAoE9D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=files.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"files.test.d.ts","sourceRoot":"","sources":["../../endpoints/files.test.ts"],"names":[],"mappings":""}
@@ -12,6 +12,7 @@ export declare const FilesEndpoints: {
12
12
  supportsAllDrives?: boolean | undefined;
13
13
  supportsTeamDrives?: boolean | undefined;
14
14
  teamDriveId?: string | undefined;
15
+ fields?: string | undefined;
15
16
  }) => Promise<import("..").FileList>;
16
17
  get: (ctx: import("..").GoogleDriveContext, args: {
17
18
  fileId: string;
@@ -19,6 +20,7 @@ export declare const FilesEndpoints: {
19
20
  supportsAllDrives?: boolean | undefined;
20
21
  supportsTeamDrives?: boolean | undefined;
21
22
  includePermissionsForView?: string | undefined;
23
+ fields?: string | undefined;
22
24
  }) => Promise<import("..").File>;
23
25
  createFromText: (ctx: import("..").GoogleDriveContext, args: {
24
26
  name: string;
@@ -105,6 +107,9 @@ export declare const FilesEndpoints: {
105
107
  moveToNewOwnersRoot?: boolean | undefined;
106
108
  transferOwnership?: boolean | undefined;
107
109
  }) => Promise<import("..").Permission>;
110
+ exportText: (ctx: import("..").GoogleDriveContext, args: {
111
+ fileId: string;
112
+ }) => Promise<import("..").FileContents>;
108
113
  };
109
114
  export declare const FoldersEndpoints: {
110
115
  create: (ctx: import("..").GoogleDriveContext, args: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../endpoints/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAY1B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM5B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMjC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAE3B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;CAE5B,CAAC;AAEF,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../endpoints/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa1B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM5B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMjC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAE3B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;CAE5B,CAAC;AAEF,cAAc,SAAS,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { FileOutput } from 'corsair/http';
2
2
  import { z } from 'zod';
3
- import type { File, FileList, Permission, SharedDrive, SharedDriveList, StorageQuota } from '../types';
3
+ import type { File, FileContents, FileList, Permission, SharedDrive, SharedDriveList, StorageQuota } from '../types';
4
4
  export declare const GoogleDriveEndpointInputSchemas: {
5
5
  readonly filesList: z.ZodObject<{
6
6
  q: z.ZodOptional<z.ZodString>;
@@ -15,6 +15,7 @@ export declare const GoogleDriveEndpointInputSchemas: {
15
15
  supportsAllDrives: z.ZodOptional<z.ZodBoolean>;
16
16
  supportsTeamDrives: z.ZodOptional<z.ZodBoolean>;
17
17
  teamDriveId: z.ZodOptional<z.ZodString>;
18
+ fields: z.ZodOptional<z.ZodString>;
18
19
  }, z.core.$strip>;
19
20
  readonly filesGet: z.ZodObject<{
20
21
  fileId: z.ZodString;
@@ -22,6 +23,7 @@ export declare const GoogleDriveEndpointInputSchemas: {
22
23
  supportsAllDrives: z.ZodOptional<z.ZodBoolean>;
23
24
  supportsTeamDrives: z.ZodOptional<z.ZodBoolean>;
24
25
  includePermissionsForView: z.ZodOptional<z.ZodString>;
26
+ fields: z.ZodOptional<z.ZodString>;
25
27
  }, z.core.$strip>;
26
28
  readonly filesCreateFromText: z.ZodObject<{
27
29
  name: z.ZodString;
@@ -104,6 +106,9 @@ export declare const GoogleDriveEndpointInputSchemas: {
104
106
  moveToNewOwnersRoot: z.ZodOptional<z.ZodBoolean>;
105
107
  transferOwnership: z.ZodOptional<z.ZodBoolean>;
106
108
  }, z.core.$strip>;
109
+ readonly filesExportText: z.ZodObject<{
110
+ fileId: z.ZodString;
111
+ }, z.core.$strip>;
107
112
  readonly foldersCreate: z.ZodObject<{
108
113
  name: z.ZodString;
109
114
  parents: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -250,6 +255,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
250
255
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
251
256
  shared: z.ZodOptional<z.ZodBoolean>;
252
257
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
258
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
259
+ kind: z.ZodOptional<z.ZodString>;
260
+ displayName: z.ZodOptional<z.ZodString>;
261
+ photoLink: z.ZodOptional<z.ZodString>;
262
+ me: z.ZodOptional<z.ZodBoolean>;
263
+ permissionId: z.ZodOptional<z.ZodString>;
264
+ emailAddress: z.ZodOptional<z.ZodString>;
265
+ }, z.core.$strip>>>;
253
266
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
254
267
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
255
268
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -293,6 +306,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
293
306
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
294
307
  shared: z.ZodOptional<z.ZodBoolean>;
295
308
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
309
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
310
+ kind: z.ZodOptional<z.ZodString>;
311
+ displayName: z.ZodOptional<z.ZodString>;
312
+ photoLink: z.ZodOptional<z.ZodString>;
313
+ me: z.ZodOptional<z.ZodBoolean>;
314
+ permissionId: z.ZodOptional<z.ZodString>;
315
+ emailAddress: z.ZodOptional<z.ZodString>;
316
+ }, z.core.$strip>>>;
296
317
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
297
318
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
298
319
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -335,6 +356,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
335
356
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
336
357
  shared: z.ZodOptional<z.ZodBoolean>;
337
358
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
359
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
360
+ kind: z.ZodOptional<z.ZodString>;
361
+ displayName: z.ZodOptional<z.ZodString>;
362
+ photoLink: z.ZodOptional<z.ZodString>;
363
+ me: z.ZodOptional<z.ZodBoolean>;
364
+ permissionId: z.ZodOptional<z.ZodString>;
365
+ emailAddress: z.ZodOptional<z.ZodString>;
366
+ }, z.core.$strip>>>;
338
367
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
339
368
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
340
369
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -377,6 +406,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
377
406
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
378
407
  shared: z.ZodOptional<z.ZodBoolean>;
379
408
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
409
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
410
+ kind: z.ZodOptional<z.ZodString>;
411
+ displayName: z.ZodOptional<z.ZodString>;
412
+ photoLink: z.ZodOptional<z.ZodString>;
413
+ me: z.ZodOptional<z.ZodBoolean>;
414
+ permissionId: z.ZodOptional<z.ZodString>;
415
+ emailAddress: z.ZodOptional<z.ZodString>;
416
+ }, z.core.$strip>>>;
380
417
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
381
418
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
382
419
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -419,6 +456,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
419
456
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
420
457
  shared: z.ZodOptional<z.ZodBoolean>;
421
458
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
459
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
460
+ kind: z.ZodOptional<z.ZodString>;
461
+ displayName: z.ZodOptional<z.ZodString>;
462
+ photoLink: z.ZodOptional<z.ZodString>;
463
+ me: z.ZodOptional<z.ZodBoolean>;
464
+ permissionId: z.ZodOptional<z.ZodString>;
465
+ emailAddress: z.ZodOptional<z.ZodString>;
466
+ }, z.core.$strip>>>;
422
467
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
423
468
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
424
469
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -462,6 +507,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
462
507
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
463
508
  shared: z.ZodOptional<z.ZodBoolean>;
464
509
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
510
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
511
+ kind: z.ZodOptional<z.ZodString>;
512
+ displayName: z.ZodOptional<z.ZodString>;
513
+ photoLink: z.ZodOptional<z.ZodString>;
514
+ me: z.ZodOptional<z.ZodBoolean>;
515
+ permissionId: z.ZodOptional<z.ZodString>;
516
+ emailAddress: z.ZodOptional<z.ZodString>;
517
+ }, z.core.$strip>>>;
465
518
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
466
519
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
467
520
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -504,6 +557,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
504
557
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
505
558
  shared: z.ZodOptional<z.ZodBoolean>;
506
559
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
560
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
561
+ kind: z.ZodOptional<z.ZodString>;
562
+ displayName: z.ZodOptional<z.ZodString>;
563
+ photoLink: z.ZodOptional<z.ZodString>;
564
+ me: z.ZodOptional<z.ZodBoolean>;
565
+ permissionId: z.ZodOptional<z.ZodString>;
566
+ emailAddress: z.ZodOptional<z.ZodString>;
567
+ }, z.core.$strip>>>;
507
568
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
508
569
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
509
570
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -572,6 +633,15 @@ export declare const GoogleDriveEndpointOutputSchemas: {
572
633
  }>>;
573
634
  pendingOwner: z.ZodOptional<z.ZodBoolean>;
574
635
  }, z.core.$strip>;
636
+ readonly filesExportText: z.ZodObject<{
637
+ id: z.ZodString;
638
+ name: z.ZodOptional<z.ZodString>;
639
+ mimeType: z.ZodOptional<z.ZodString>;
640
+ createdTime: z.ZodOptional<z.ZodString>;
641
+ modifiedTime: z.ZodOptional<z.ZodString>;
642
+ webViewLink: z.ZodOptional<z.ZodString>;
643
+ text: z.ZodString;
644
+ }, z.core.$strip>;
575
645
  readonly foldersCreate: z.ZodObject<{
576
646
  id: z.ZodOptional<z.ZodString>;
577
647
  name: z.ZodOptional<z.ZodString>;
@@ -599,6 +669,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
599
669
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
600
670
  shared: z.ZodOptional<z.ZodBoolean>;
601
671
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
672
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
673
+ kind: z.ZodOptional<z.ZodString>;
674
+ displayName: z.ZodOptional<z.ZodString>;
675
+ photoLink: z.ZodOptional<z.ZodString>;
676
+ me: z.ZodOptional<z.ZodBoolean>;
677
+ permissionId: z.ZodOptional<z.ZodString>;
678
+ emailAddress: z.ZodOptional<z.ZodString>;
679
+ }, z.core.$strip>>>;
602
680
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
603
681
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
604
682
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -641,6 +719,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
641
719
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
642
720
  shared: z.ZodOptional<z.ZodBoolean>;
643
721
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
722
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
723
+ kind: z.ZodOptional<z.ZodString>;
724
+ displayName: z.ZodOptional<z.ZodString>;
725
+ photoLink: z.ZodOptional<z.ZodString>;
726
+ me: z.ZodOptional<z.ZodBoolean>;
727
+ permissionId: z.ZodOptional<z.ZodString>;
728
+ emailAddress: z.ZodOptional<z.ZodString>;
729
+ }, z.core.$strip>>>;
644
730
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
645
731
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
646
732
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -687,6 +773,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
687
773
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
688
774
  shared: z.ZodOptional<z.ZodBoolean>;
689
775
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
776
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
777
+ kind: z.ZodOptional<z.ZodString>;
778
+ displayName: z.ZodOptional<z.ZodString>;
779
+ photoLink: z.ZodOptional<z.ZodString>;
780
+ me: z.ZodOptional<z.ZodBoolean>;
781
+ permissionId: z.ZodOptional<z.ZodString>;
782
+ emailAddress: z.ZodOptional<z.ZodString>;
783
+ }, z.core.$strip>>>;
690
784
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
691
785
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
692
786
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -805,6 +899,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
805
899
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
806
900
  shared: z.ZodOptional<z.ZodBoolean>;
807
901
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
902
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
903
+ kind: z.ZodOptional<z.ZodString>;
904
+ displayName: z.ZodOptional<z.ZodString>;
905
+ photoLink: z.ZodOptional<z.ZodString>;
906
+ me: z.ZodOptional<z.ZodBoolean>;
907
+ permissionId: z.ZodOptional<z.ZodString>;
908
+ emailAddress: z.ZodOptional<z.ZodString>;
909
+ }, z.core.$strip>>>;
808
910
  permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
809
911
  hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
810
912
  folderColorRgb: z.ZodOptional<z.ZodString>;
@@ -840,6 +942,7 @@ export type GoogleDriveEndpointOutputs = {
840
942
  filesDownload: FileOutput;
841
943
  filesExport: FileOutput;
842
944
  filesShare: Permission;
945
+ filesExportText: FileContents;
843
946
  foldersCreate: File;
844
947
  foldersGet: File;
845
948
  foldersList: FileList;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../endpoints/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACX,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,MAAM,UAAU,CAAC;AAkPlB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBlC,CAAC;AAEX,MAAM,MAAM,yBAAyB,GAAG;KACtC,CAAC,IAAI,MAAM,OAAO,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAC3D,CAAC,OAAO,+BAA+B,CAAC,CAAC,CAAC,CAAC,CAC3C;CACD,CAAC;AAmGF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;IAChC,eAAe,EAAE,YAAY,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const errorHandlers: {
2
+ RATE_LIMIT_ERROR: {
3
+ match: (error: Error) => boolean;
4
+ handler: () => Promise<{
5
+ maxRetries: number;
6
+ }>;
7
+ };
8
+ AUTH_ERROR: {
9
+ match: (error: Error) => boolean;
10
+ handler: () => Promise<{
11
+ maxRetries: number;
12
+ }>;
13
+ };
14
+ DEFAULT: {
15
+ match: () => true;
16
+ handler: () => Promise<{
17
+ maxRetries: number;
18
+ }>;
19
+ };
20
+ };
21
+ //# sourceMappingURL=error-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handlers.d.ts","sourceRoot":"","sources":["../error-handlers.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,aAAa;;uBAET,KAAK;;;;;;uBAML,KAAK;;;;;;;;;;;CAUS,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { BindEndpoints, BindWebhooks, CorsairEndpoint, CorsairPlugin, CorsairPluginContext, CorsairWebhook, KeyBuilderContext, PickAuth, PluginPermissionsConfig } from 'corsair/core';
1
+ import type { BindEndpoints, BindWebhooks, CorsairEndpoint, CorsairErrorHandler, CorsairPlugin, CorsairPluginContext, CorsairWebhook, KeyBuilderContext, PickAuth, PluginPermissionsConfig } from 'corsair/core';
2
2
  import type { GoogleDriveEndpointInputs, GoogleDriveEndpointOutputs } from './endpoints';
3
3
  import { GoogleDriveSchema } from './schema';
4
4
  import type { GoogleDriveWebhookEvent, GoogleDriveWebhookOutputs, GoogleDriveWebhookPayload } from './webhooks';
@@ -16,6 +16,7 @@ export type GoogleDriveEndpoints = {
16
16
  filesDownload: GoogleDriveEndpoint<'filesDownload'>;
17
17
  filesExport: GoogleDriveEndpoint<'filesExport'>;
18
18
  filesShare: GoogleDriveEndpoint<'filesShare'>;
19
+ filesExportText: GoogleDriveEndpoint<'filesExportText'>;
19
20
  foldersCreate: GoogleDriveEndpoint<'foldersCreate'>;
20
21
  foldersGet: GoogleDriveEndpoint<'foldersGet'>;
21
22
  foldersList: GoogleDriveEndpoint<'foldersList'>;
@@ -48,6 +49,7 @@ declare const googleDriveEndpointsNested: {
48
49
  readonly download: GoogleDriveEndpoint<"filesDownload">;
49
50
  readonly export: GoogleDriveEndpoint<"filesExport">;
50
51
  readonly share: GoogleDriveEndpoint<"filesShare">;
52
+ readonly exportText: GoogleDriveEndpoint<"filesExportText">;
51
53
  };
52
54
  readonly folders: {
53
55
  readonly create: GoogleDriveEndpoint<"foldersCreate">;
@@ -85,6 +87,7 @@ export declare const googledriveEndpointSchemas: {
85
87
  supportsAllDrives: import("zod").ZodOptional<import("zod").ZodBoolean>;
86
88
  supportsTeamDrives: import("zod").ZodOptional<import("zod").ZodBoolean>;
87
89
  teamDriveId: import("zod").ZodOptional<import("zod").ZodString>;
90
+ fields: import("zod").ZodOptional<import("zod").ZodString>;
88
91
  }, import("zod/v4/core").$strip>;
89
92
  readonly output: import("zod").ZodObject<{
90
93
  kind: import("zod").ZodOptional<import("zod").ZodString>;
@@ -117,6 +120,14 @@ export declare const googledriveEndpointSchemas: {
117
120
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
118
121
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
119
122
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
123
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
124
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
125
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
126
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
127
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
128
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
129
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
130
+ }, import("zod/v4/core").$strip>>>;
120
131
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
121
132
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
122
133
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -141,6 +152,7 @@ export declare const googledriveEndpointSchemas: {
141
152
  supportsAllDrives: import("zod").ZodOptional<import("zod").ZodBoolean>;
142
153
  supportsTeamDrives: import("zod").ZodOptional<import("zod").ZodBoolean>;
143
154
  includePermissionsForView: import("zod").ZodOptional<import("zod").ZodString>;
155
+ fields: import("zod").ZodOptional<import("zod").ZodString>;
144
156
  }, import("zod/v4/core").$strip>;
145
157
  readonly output: import("zod").ZodObject<{
146
158
  id: import("zod").ZodOptional<import("zod").ZodString>;
@@ -169,6 +181,14 @@ export declare const googledriveEndpointSchemas: {
169
181
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
170
182
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
171
183
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
184
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
185
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
186
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
187
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
188
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
189
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
190
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
191
+ }, import("zod/v4/core").$strip>>>;
172
192
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
173
193
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
174
194
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -220,6 +240,14 @@ export declare const googledriveEndpointSchemas: {
220
240
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
221
241
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
222
242
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
243
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
244
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
245
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
246
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
247
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
248
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
249
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
250
+ }, import("zod/v4/core").$strip>>>;
223
251
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
224
252
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
225
253
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -270,6 +298,14 @@ export declare const googledriveEndpointSchemas: {
270
298
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
271
299
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
272
300
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
301
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
302
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
303
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
304
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
305
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
306
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
307
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
308
+ }, import("zod/v4/core").$strip>>>;
273
309
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
274
310
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
275
311
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -328,6 +364,14 @@ export declare const googledriveEndpointSchemas: {
328
364
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
329
365
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
330
366
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
367
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
368
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
369
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
370
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
371
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
372
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
373
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
374
+ }, import("zod/v4/core").$strip>>>;
331
375
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
332
376
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
333
377
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -387,6 +431,14 @@ export declare const googledriveEndpointSchemas: {
387
431
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
388
432
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
389
433
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
434
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
435
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
436
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
437
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
438
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
439
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
440
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
441
+ }, import("zod/v4/core").$strip>>>;
390
442
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
391
443
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
392
444
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -438,6 +490,14 @@ export declare const googledriveEndpointSchemas: {
438
490
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
439
491
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
440
492
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
493
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
494
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
495
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
496
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
497
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
498
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
499
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
500
+ }, import("zod/v4/core").$strip>>>;
441
501
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
442
502
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
443
503
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -548,6 +608,20 @@ export declare const googledriveEndpointSchemas: {
548
608
  pendingOwner: import("zod").ZodOptional<import("zod").ZodBoolean>;
549
609
  }, import("zod/v4/core").$strip>;
550
610
  };
611
+ readonly 'files.exportText': {
612
+ readonly input: import("zod").ZodObject<{
613
+ fileId: import("zod").ZodString;
614
+ }, import("zod/v4/core").$strip>;
615
+ readonly output: import("zod").ZodObject<{
616
+ id: import("zod").ZodString;
617
+ name: import("zod").ZodOptional<import("zod").ZodString>;
618
+ mimeType: import("zod").ZodOptional<import("zod").ZodString>;
619
+ createdTime: import("zod").ZodOptional<import("zod").ZodString>;
620
+ modifiedTime: import("zod").ZodOptional<import("zod").ZodString>;
621
+ webViewLink: import("zod").ZodOptional<import("zod").ZodString>;
622
+ text: import("zod").ZodString;
623
+ }, import("zod/v4/core").$strip>;
624
+ };
551
625
  readonly 'folders.create': {
552
626
  readonly input: import("zod").ZodObject<{
553
627
  name: import("zod").ZodString;
@@ -581,6 +655,14 @@ export declare const googledriveEndpointSchemas: {
581
655
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
582
656
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
583
657
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
658
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
659
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
660
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
661
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
662
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
663
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
664
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
665
+ }, import("zod/v4/core").$strip>>>;
584
666
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
585
667
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
586
668
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -631,6 +713,14 @@ export declare const googledriveEndpointSchemas: {
631
713
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
632
714
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
633
715
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
716
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
717
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
718
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
719
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
720
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
721
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
722
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
723
+ }, import("zod/v4/core").$strip>>>;
634
724
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
635
725
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
636
726
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -693,6 +783,14 @@ export declare const googledriveEndpointSchemas: {
693
783
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
694
784
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
695
785
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
786
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
787
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
788
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
789
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
790
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
791
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
792
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
793
+ }, import("zod/v4/core").$strip>>>;
696
794
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
697
795
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
698
796
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -911,6 +1009,14 @@ export declare const googledriveEndpointSchemas: {
911
1009
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
912
1010
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
913
1011
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
1012
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
1013
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
1014
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
1015
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
1016
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
1017
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
1018
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
1019
+ }, import("zod/v4/core").$strip>>>;
914
1020
  permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
915
1021
  hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
916
1022
  folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
@@ -975,6 +1081,7 @@ export type GoogleDrivePluginOptions = {
975
1081
  * Overrides use dot-notation paths from the Google Drive endpoint tree — invalid paths are type errors.
976
1082
  */
977
1083
  permissions?: PluginPermissionsConfig<typeof googleDriveEndpointsNested>;
1084
+ errorHandlers?: CorsairErrorHandler;
978
1085
  };
979
1086
  export type GoogleDriveKeyBuilderContext = KeyBuilderContext<GoogleDrivePluginOptions>;
980
1087
  declare const defaultAuthType: "oauth_2";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,iBAAiB,EACjB,QAAQ,EAER,uBAAuB,EAGvB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EACX,yBAAyB,EACzB,0BAA0B,EAC1B,MAAM,aAAa,CAAC;AAYrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EACX,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,YAAY,CAAC;AAUpB,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CACpD,OAAO,iBAAiB,EACxB,wBAAwB,CACxB,CAAC;AAEF,KAAK,mBAAmB,CAAC,CAAC,SAAS,MAAM,0BAA0B,IAClE,eAAe,CACd,kBAAkB,EAClB,yBAAyB,CAAC,CAAC,CAAC,EAC5B,0BAA0B,CAAC,CAAC,CAAC,CAC7B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG;IAClC,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC5C,QAAQ,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC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AC,CAAC,SAAS,wBAAwB,IACvE,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAE1B,wBAAgB,WAAW,CAAC,KAAK,CAAC,CAAC,SAAS,wBAAwB,EACnE,eAAe,GAAE,wBAAwB,GACxC,CAAsC,GACrC,yBAAyB,CAAC,CAAC,CAAC,CAmE9B;AAMD,YAAY,EACX,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,aAAa,EACb,kBAAkB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,+BAA+B,EAC/B,mBAAmB,GACnB,MAAM,kBAAkB,CAAC;AAM1B,YAAY,EACX,yBAAyB,EACzB,0BAA0B,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,mBAAmB,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1,3 @@
1
- import{AuthMissingError as zo,getOAuthAccessToken as $o}from"corsair/core";import{logEventFromContext as v}from"corsair/core";import{toFileOutput as V}from"corsair/http";import{request as We}from"corsair/http";var M=class extends Error{constructor(i,s){super(i);this.code=s;this.name="GoogleDriveAPIError"}},q="https://www.googleapis.com/drive/v3";async function x(t,o,i={}){let{method:s="GET",body:n,query:d,responseType:c}=i;return await We({BASE:q,VERSION:"1.0.0",WITH_CREDENTIALS:!1,CREDENTIALS:"omit",TOKEN:o,HEADERS:{"Content-Type":"application/json"}},{method:s,url:t,body:s==="POST"||s==="PUT"||s==="PATCH"?n:void 0,mediaType:"application/json",query:d,responseType:c})}function Ne(t){return t instanceof Error&&"status"in t&&t.status===401}async function l(t,o,i={}){try{return await x(t,o.key,i)}catch(s){if(Ne(s)&&o._refreshAuth){let n=await o._refreshAuth();return await x(t,n,i)}throw s}}var Q=async(t,o)=>{let i=await l("/files",t,{method:"GET",query:o});if(i.files&&t.db.files)try{for(let s of i.files)if(s.id){let n=s.mimeType==="application/vnd.google-apps.folder";n&&t.db.folders?await t.db.folders.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date}):n||await t.db.files.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date})}}catch(s){console.warn("Failed to save files to database:",s)}return await v(t,"googledrive.files.list",{...o},"completed"),i},K=async(t,o)=>{let i=await l(`/files/${o.fileId}`,t,{method:"GET",query:o});if(i.id){let s=i.mimeType==="application/vnd.google-apps.folder";try{s&&t.db.folders?await t.db.folders.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date}):!s&&t.db.files&&await t.db.files.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date})}catch(n){console.warn("Failed to save file to database:",n)}}return await v(t,"googledrive.files.get",{...o},"completed"),i},H=async(t,o)=>{let i=await l("/files",t,{method:"POST",body:{...o},query:{uploadType:"multipart"}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await v(t,"googledrive.files.createFromText",{...o},"completed"),i},X=async(t,o)=>{let i=await l("/files",t,{method:"POST",body:{...o},query:{uploadType:"multipart"}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await v(t,"googledrive.files.upload",{...o},"completed"),i},Y=async(t,o)=>{let i=await l(`/files/${o.fileId}`,t,{method:"PATCH",body:{name:o.name,description:o.description,starred:o.starred,trashed:o.trashed,parents:o.parents,properties:o.properties,appProperties:o.appProperties},query:{addParents:o.addParents,removeParents:o.removeParents,supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await v(t,"googledrive.files.update",{...o},"completed"),i},J=async(t,o)=>{if(await l(`/files/${o.fileId}`,t,{method:"DELETE",query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}}),t.db.files)try{await t.db.files.deleteByEntityId(o.fileId)}catch(i){console.warn("Failed to delete file from database:",i)}await v(t,"googledrive.files.delete",{...o},"completed")},Z=async(t,o)=>{let i=await l(`/files/${o.fileId}/copy`,t,{method:"POST",body:{name:o.name,parents:o.parents},query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await v(t,"googledrive.files.copy",{...o},"completed"),i},ee=async(t,o)=>{let i=await l(`/files/${o.fileId}`,t,{method:"PATCH",body:{},query:{addParents:o.addParents,removeParents:o.removeParents,supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await v(t,"googledrive.files.move",{...o},"completed"),i},oe="application/vnd.google-apps.",je={"application/vnd.google-apps.document":"text/markdown","application/vnd.google-apps.spreadsheet":"text/csv","application/vnd.google-apps.presentation":"application/pdf","application/vnd.google-apps.drawing":"image/png","application/vnd.google-apps.script":"application/vnd.google-apps.script+json"},ze="application/vnd.google-apps.vid",$e={"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.oasis.opendocument.text":"odt","application/rtf":"rtf","application/pdf":"pdf","text/plain":"txt","text/html":"html","application/zip":"zip","application/epub+zip":"epub","text/markdown":"md","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.oasis.opendocument.spreadsheet":"ods","text/csv":"csv","text/tab-separated-values":"tsv","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.oasis.opendocument.presentation":"odp","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","application/vnd.google-apps.script+json":"json","video/mp4":"mp4"};async function te(t,o){return l(`/files/${o}`,t,{method:"GET",query:{fields:"name,mimeType",supportsAllDrives:!0}})}function Ve(t,o){let i=$e[o];return!i||t.toLowerCase().endsWith(`.${i}`)?t:`${t}.${i}`}var ie=async(t,o)=>{let i=await te(t,o.fileId);if(i.mimeType?.startsWith(oe))throw new Error(`This file is a Google file (${i.mimeType}), which Drive cannot download as it is. Use files.export with the same fileId to get it as Markdown, CSV, PDF or another format.`);let{bytes:s,contentType:n}=await l(`/files/${o.fileId}`,t,{method:"GET",query:{alt:"media",acknowledgeAbuse:o.acknowledgeAbuse,supportsAllDrives:!0},responseType:"binary"});return await v(t,"googledrive.files.download",{...o},"completed"),V(s,n??i.mimeType,{...i.name?{filename:i.name}:{}})},re=async(t,o)=>{let i=await te(t,o.fileId),s=i.mimeType??"";if(!s.startsWith(oe))throw new Error(`This file is not a Google Docs, Sheets, Slides or Drawings file (${s||"unknown type"}). Use files.download to get it as it is.`);if(s===ze)throw new Error("Drive does not export Google Vids files, and this plugin cannot download them yet.");let n=je[s];if(!n)throw new Error(`Drive cannot export a ${s} file. Docs, Sheets, Slides, Drawings and Apps Script files can be exported.`);let d=o.mimeType??n,{bytes:c,contentType:u}=await l(`/files/${o.fileId}/export`,t,{method:"GET",query:{mimeType:d},responseType:"binary"});return await v(t,"googledrive.files.export",{...o},"completed"),V(c,u??d,{...i.name?{filename:Ve(i.name,d)}:{}})},se=async(t,o)=>{let i=await l(`/files/${o.fileId}/permissions`,t,{method:"POST",body:{type:o.type,role:o.role,emailAddress:o.emailAddress,domain:o.domain,allowFileDiscovery:o.allowFileDiscovery,expirationTime:o.expirationTime,sendNotificationEmail:o.sendNotificationEmail,emailMessage:o.emailMessage},query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,moveToNewOwnersRoot:o.moveToNewOwnersRoot,transferOwnership:o.transferOwnership}});return await v(t,"googledrive.files.share",{...o},"completed"),i};import{logEventFromContext as O}from"corsair/core";var ne=async(t,o)=>{let i=await l("/files",t,{method:"POST",body:{name:o.name,mimeType:"application/vnd.google-apps.folder",parents:o.parents,description:o.description}});if(i.id&&t.db.folders)try{await t.db.folders.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date})}catch(s){console.warn("Failed to save folder to database:",s)}return await O(t,"googledrive.folders.create",{...o},"completed"),i},ae=async(t,o)=>{let i=await l(`/files/${o.folderId}`,t,{method:"GET",query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,includePermissionsForView:o.includePermissionsForView}});if(i.id&&t.db.folders)try{await t.db.folders.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date})}catch(s){console.warn("Failed to save folder to database:",s)}return await O(t,"googledrive.folders.get",{...o},"completed"),i},le=async(t,o)=>{let i=`mimeType='application/vnd.google-apps.folder'${o.q?` and ${o.q}`:""}`,s=await l("/files",t,{method:"GET",query:{q:i,pageSize:o.pageSize,pageToken:o.pageToken,spaces:o.spaces,corpora:o.corpora,driveId:o.driveId,includeItemsFromAllDrives:o.includeItemsFromAllDrives,includePermissionsForView:o.includePermissionsForView,orderBy:o.orderBy,supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,teamDriveId:o.teamDriveId}});if(s.files&&t.db.folders)try{for(let n of s.files)n.id&&await t.db.folders.upsertByEntityId(n.id,{...n,id:n.id,createdAt:new Date})}catch(n){console.warn("Failed to save folders to database:",n)}return await O(t,"googledrive.folders.list",{...o},"completed"),s},de=async(t,o)=>{if(await l(`/files/${o.folderId}`,t,{method:"DELETE",query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}}),t.db.folders)try{await t.db.folders.deleteByEntityId(o.folderId)}catch(i){console.warn("Failed to delete folder from database:",i)}await O(t,"googledrive.folders.delete",{...o},"completed")},pe=async(t,o)=>{let i=await l(`/files/${o.folderId}/permissions`,t,{method:"POST",body:{type:o.type,role:o.role,emailAddress:o.emailAddress,domain:o.domain,allowFileDiscovery:o.allowFileDiscovery,expirationTime:o.expirationTime,sendNotificationEmail:o.sendNotificationEmail,emailMessage:o.emailMessage},query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,moveToNewOwnersRoot:o.moveToNewOwnersRoot,transferOwnership:o.transferOwnership}});return await O(t,"googledrive.folders.share",{...o},"completed"),i};import{logEventFromContext as He}from"corsair/core";var ge=async(t,o)=>{let i=await l("/files",t,{method:"GET",query:{q:o.q,pageSize:o.pageSize,pageToken:o.pageToken,spaces:o.spaces,corpora:o.corpora,driveId:o.driveId,includeItemsFromAllDrives:o.includeItemsFromAllDrives,includePermissionsForView:o.includePermissionsForView,orderBy:o.orderBy,supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,teamDriveId:o.teamDriveId}});if(i.files)try{for(let s of i.files)if(s.id){let n=s.mimeType==="application/vnd.google-apps.folder";n&&t.db.folders?await t.db.folders.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date}):!n&&t.db.files&&await t.db.files.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date})}}catch(s){console.warn("Failed to save search results to database:",s)}return await He(t,"googledrive.search.filesAndFolders",{...o},"completed"),i};import{logEventFromContext as L}from"corsair/core";var ce=async(t,o)=>{let i=o.requestId||`req_${Date.now()}`,s=await l("/drives",t,{method:"POST",body:{name:o.name,themeId:o.themeId,colorRgb:o.colorRgb,restrictions:o.restrictions},query:{requestId:i}});if(s.id&&t.db.sharedDrives)try{await t.db.sharedDrives.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date})}catch(n){console.warn("Failed to save shared drive to database:",n)}return await L(t,"googledrive.sharedDrives.create",{...o},"completed"),s},fe=async(t,o)=>{let i=await l(`/drives/${o.driveId}`,t,{method:"GET",query:{useDomainAdminAccess:o.useDomainAdminAccess}});if(i.id&&t.db.sharedDrives)try{await t.db.sharedDrives.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date})}catch(s){console.warn("Failed to save shared drive to database:",s)}return await L(t,"googledrive.sharedDrives.get",{...o},"completed"),i},ue=async(t,o)=>{let i=await l("/drives",t,{method:"GET",query:{pageSize:o.pageSize,pageToken:o.pageToken,q:o.q,useDomainAdminAccess:o.useDomainAdminAccess}});if(i.drives&&t.db.sharedDrives)try{for(let s of i.drives)s.id&&await t.db.sharedDrives.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date})}catch(s){console.warn("Failed to save shared drives to database:",s)}return await L(t,"googledrive.sharedDrives.list",{...o},"completed"),i},me=async(t,o)=>{let i=await l(`/drives/${o.driveId}`,t,{method:"PATCH",body:{name:o.name,themeId:o.themeId,colorRgb:o.colorRgb,restrictions:o.restrictions},query:{useDomainAdminAccess:o.useDomainAdminAccess}});if(i.id&&t.db.sharedDrives)try{await t.db.sharedDrives.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date})}catch(s){console.warn("Failed to save shared drive to database:",s)}return await L(t,"googledrive.sharedDrives.update",{...o},"completed"),i},he=async(t,o)=>{if(await l(`/drives/${o.driveId}`,t,{method:"DELETE"}),t.db.sharedDrives)try{await t.db.sharedDrives.deleteByEntityId(o.driveId)}catch(i){console.warn("Failed to delete shared drive from database:",i)}await L(t,"googledrive.sharedDrives.delete",{...o},"completed")};import{logEventFromContext as Je}from"corsair/core";var Ze="storageQuota",ve=async(t,o)=>{let s=(await l("/about",t,{method:"GET",query:{fields:Ze}})).storageQuota;if(!s||Object.keys(s).length===0)throw new M("Google Drive about.get returned no storageQuota",502);return await Je(t,"googledrive.storage.getQuota",{...o},"completed"),s};import{FileOutputSchema as De}from"corsair/http";import{z as e}from"zod";var oo=e.object({q:e.string().optional(),pageSize:e.number().optional(),pageToken:e.string().optional(),spaces:e.string().optional(),corpora:e.string().optional(),driveId:e.string().optional(),includeItemsFromAllDrives:e.boolean().optional(),includePermissionsForView:e.string().optional(),orderBy:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),teamDriveId:e.string().optional()}),to=e.object({fileId:e.string(),acknowledgeAbuse:e.boolean().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),includePermissionsForView:e.string().optional()}),io=e.object({name:e.string(),content:e.string(),mimeType:e.string().optional(),parents:e.array(e.string()).optional(),description:e.string().optional()}),ro=e.object({name:e.string(),mimeType:e.string().optional(),parents:e.array(e.string()).optional(),description:e.string().optional()}),so=e.object({fileId:e.string(),name:e.string().optional(),description:e.string().optional(),starred:e.boolean().optional(),trashed:e.boolean().optional(),parents:e.array(e.string()).optional(),addParents:e.string().optional(),removeParents:e.string().optional(),properties:e.record(e.string(),e.string()).optional(),appProperties:e.record(e.string(),e.string()).optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),no=e.object({fileId:e.string(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),ao=e.object({fileId:e.string(),name:e.string().optional(),parents:e.array(e.string()).optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),lo=e.object({fileId:e.string(),addParents:e.string().optional(),removeParents:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),po=e.object({fileId:e.string(),acknowledgeAbuse:e.boolean().optional()}),go=e.object({fileId:e.string().describe("The Google Docs, Sheets, Slides or Drawings file."),mimeType:e.string().optional().describe("The format to export to, for example application/pdf or application/vnd.openxmlformats-officedocument.wordprocessingml.document. Defaults to Markdown for Docs, CSV (first sheet only) for Sheets, PDF for Slides and PNG for Drawings.")}),co=e.object({fileId:e.string(),type:e.enum(["user","group","domain","anyone"]).optional(),role:e.enum(["owner","organizer","fileOrganizer","writer","commenter","reader"]).optional(),emailAddress:e.string().optional(),domain:e.string().optional(),allowFileDiscovery:e.boolean().optional(),expirationTime:e.string().optional(),sendNotificationEmail:e.boolean().optional(),emailMessage:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),moveToNewOwnersRoot:e.boolean().optional(),transferOwnership:e.boolean().optional()}),fo=e.object({name:e.string(),parents:e.array(e.string()).optional(),description:e.string().optional()}),uo=e.object({folderId:e.string(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),includePermissionsForView:e.string().optional()}),mo=e.object({q:e.string().optional(),pageSize:e.number().optional(),pageToken:e.string().optional(),spaces:e.string().optional(),corpora:e.string().optional(),driveId:e.string().optional(),includeItemsFromAllDrives:e.boolean().optional(),includePermissionsForView:e.string().optional(),orderBy:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),teamDriveId:e.string().optional()}),ho=e.object({folderId:e.string(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),vo=e.object({folderId:e.string(),type:e.enum(["user","group","domain","anyone"]).optional(),role:e.enum(["owner","organizer","fileOrganizer","writer","commenter","reader"]).optional(),emailAddress:e.string().optional(),domain:e.string().optional(),allowFileDiscovery:e.boolean().optional(),expirationTime:e.string().optional(),sendNotificationEmail:e.boolean().optional(),emailMessage:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),moveToNewOwnersRoot:e.boolean().optional(),transferOwnership:e.boolean().optional()}),Do=e.object({name:e.string(),requestId:e.string().optional(),themeId:e.string().optional(),colorRgb:e.string().optional(),restrictions:e.object({adminManagedRestrictions:e.boolean().optional(),copyRequiresWriterPermission:e.boolean().optional(),domainUsersOnly:e.boolean().optional(),driveMembersOnly:e.boolean().optional()}).optional()}),yo=e.object({driveId:e.string(),useDomainAdminAccess:e.boolean().optional()}),bo=e.object({pageSize:e.number().optional(),pageToken:e.string().optional(),q:e.string().optional(),useDomainAdminAccess:e.boolean().optional()}),wo=e.object({driveId:e.string(),name:e.string().optional(),themeId:e.string().optional(),colorRgb:e.string().optional(),restrictions:e.object({adminManagedRestrictions:e.boolean().optional(),copyRequiresWriterPermission:e.boolean().optional(),domainUsersOnly:e.boolean().optional(),driveMembersOnly:e.boolean().optional()}).optional(),useDomainAdminAccess:e.boolean().optional()}),Eo=e.object({driveId:e.string()}),To=e.object({q:e.string(),pageSize:e.number().optional(),pageToken:e.string().optional(),spaces:e.string().optional(),corpora:e.string().optional(),driveId:e.string().optional(),includeItemsFromAllDrives:e.boolean().optional(),includePermissionsForView:e.string().optional(),orderBy:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),teamDriveId:e.string().optional()}),Go=e.object({}),p={filesList:oo,filesGet:to,filesCreateFromText:io,filesUpload:ro,filesUpdate:so,filesDelete:no,filesCopy:ao,filesMove:lo,filesDownload:po,filesExport:go,filesShare:co,foldersCreate:fo,foldersGet:uo,foldersList:mo,foldersDelete:ho,foldersShare:vo,sharedDrivesCreate:Do,sharedDrivesGet:yo,sharedDrivesList:bo,sharedDrivesUpdate:wo,sharedDrivesDelete:Eo,searchFilesAndFolders:To,storageGetQuota:Go},y=e.object({id:e.string().optional(),name:e.string().optional(),mimeType:e.string().optional(),description:e.string().optional(),starred:e.boolean().optional(),trashed:e.boolean().optional(),explicitlyTrashed:e.boolean().optional(),parents:e.array(e.string()).optional(),properties:e.record(e.string(),e.string()).optional(),appProperties:e.record(e.string(),e.string()).optional(),spaces:e.array(e.string()).optional(),version:e.string().optional(),webViewLink:e.string().optional(),webContentLink:e.string().optional(),iconLink:e.string().optional(),hasThumbnail:e.boolean().optional(),thumbnailLink:e.string().optional(),thumbnailVersion:e.string().optional(),viewedByMe:e.boolean().optional(),viewedByMeTime:e.string().optional(),createdTime:e.string().optional(),modifiedTime:e.string().optional(),modifiedByMeTime:e.string().optional(),modifiedByMe:e.boolean().optional(),shared:e.boolean().optional(),ownedByMe:e.boolean().optional(),permissionIds:e.array(e.string()).optional(),hasAugmentedPermissions:e.boolean().optional(),folderColorRgb:e.string().optional(),originalFilename:e.string().optional(),fullFileExtension:e.string().optional(),fileExtension:e.string().optional(),md5Checksum:e.string().optional(),size:e.string().optional(),quotaBytesUsed:e.string().optional(),headRevisionId:e.string().optional(),isAppAuthorized:e.boolean().optional(),resourceKey:e.string().optional(),sha1Checksum:e.string().optional(),sha256Checksum:e.string().optional()}),_=e.object({kind:e.string().optional(),nextPageToken:e.string().optional(),incompleteSearch:e.boolean().optional(),files:e.array(y).optional()}),ye=e.object({id:e.string().optional(),type:e.enum(["user","group","domain","anyone"]).optional(),emailAddress:e.string().optional(),domain:e.string().optional(),role:e.enum(["owner","organizer","fileOrganizer","writer","commenter","reader"]).optional(),allowFileDiscovery:e.boolean().optional(),displayName:e.string().optional(),photoLink:e.string().optional(),expirationTime:e.string().optional(),deleted:e.boolean().optional(),view:e.enum(["user","domain"]).optional(),pendingOwner:e.boolean().optional()}),U=e.object({kind:e.string().optional(),id:e.string().optional(),name:e.string().optional(),themeId:e.string().optional(),colorRgb:e.string().optional(),createdTime:e.string().optional(),hidden:e.boolean().optional()}),Fo=e.object({kind:e.string().optional(),nextPageToken:e.string().optional(),drives:e.array(U).optional()}),ko=e.object({limit:e.string().optional(),usage:e.string(),usageInDrive:e.string(),usageInDriveTrash:e.string()}),g={filesList:_,filesGet:y,filesCreateFromText:y,filesUpload:y,filesUpdate:y,filesDelete:e.void(),filesCopy:y,filesMove:y,filesDownload:De,filesExport:De,filesShare:ye,foldersCreate:y,foldersGet:y,foldersList:_,foldersDelete:e.void(),foldersShare:ye,sharedDrivesCreate:U,sharedDrivesGet:U,sharedDrivesList:Fo,sharedDrivesUpdate:U,sharedDrivesDelete:e.void(),searchFilesAndFolders:_,storageGetQuota:ko};var h={list:Q,get:K,createFromText:H,upload:X,update:Y,delete:J,copy:Z,move:ee,download:ie,export:re,share:se},C={create:ne,get:ae,list:le,delete:de,share:pe},I={create:ce,get:fe,list:ue,update:me,delete:he},be={filesAndFolders:ge},we={getQuota:ve};import{z as r}from"zod";var Ee=r.object({canAddChildren:r.boolean().optional(),canChangeCopyRequiresWriterPermission:r.boolean().optional(),canChangeViewersCanCopyContent:r.boolean().optional(),canComment:r.boolean().optional(),canCopy:r.boolean().optional(),canDelete:r.boolean().optional(),canDeleteChildren:r.boolean().optional(),canDownload:r.boolean().optional(),canEdit:r.boolean().optional(),canListChildren:r.boolean().optional(),canModifyContent:r.boolean().optional(),canModifyContentRestriction:r.boolean().optional(),canMoveChildrenOutOfDrive:r.boolean().optional(),canMoveChildrenOutOfTeamDrive:r.boolean().optional(),canMoveChildrenWithinDrive:r.boolean().optional(),canMoveItemIntoTeamDrive:r.boolean().optional(),canMoveItemOutOfDrive:r.boolean().optional(),canMoveItemWithinDrive:r.boolean().optional(),canReadRevisions:r.boolean().optional(),canReadTeamDrive:r.boolean().optional(),canRemoveChildren:r.boolean().optional(),canRename:r.boolean().optional(),canShare:r.boolean().optional(),canTrash:r.boolean().optional(),canTrashChildren:r.boolean().optional(),canUntrash:r.boolean().optional()}),Te=r.object({id:r.string(),name:r.string().optional(),mimeType:r.string().optional(),description:r.string().optional(),starred:r.boolean().optional(),trashed:r.boolean().optional(),explicitlyTrashed:r.boolean().optional(),parents:r.array(r.string()).optional(),properties:r.record(r.string(),r.string()).optional(),appProperties:r.record(r.string(),r.string()).optional(),spaces:r.array(r.string()).optional(),version:r.string().optional(),webViewLink:r.string().optional(),webContentLink:r.string().optional(),iconLink:r.string().optional(),hasThumbnail:r.boolean().optional(),thumbnailLink:r.string().optional(),thumbnailVersion:r.string().optional(),viewedByMe:r.boolean().optional(),viewedByMeTime:r.string().optional(),createdTime:r.string().optional(),modifiedTime:r.string().optional(),modifiedByMeTime:r.string().optional(),modifiedByMe:r.boolean().optional(),shared:r.boolean().optional(),ownedByMe:r.boolean().optional(),capabilities:Ee.optional(),viewersCanCopyContent:r.boolean().optional(),copyRequiresWriterPermission:r.boolean().optional(),writersCanShare:r.boolean().optional(),permissionIds:r.array(r.string()).optional(),hasAugmentedPermissions:r.boolean().optional(),folderColorRgb:r.string().optional(),originalFilename:r.string().optional(),fullFileExtension:r.string().optional(),fileExtension:r.string().optional(),md5Checksum:r.string().optional(),size:r.string().optional(),quotaBytesUsed:r.string().optional(),headRevisionId:r.string().optional(),isAppAuthorized:r.boolean().optional(),resourceKey:r.string().optional(),sha1Checksum:r.string().optional(),sha256Checksum:r.string().optional(),filePath:r.string().optional(),createdAt:r.coerce.date().optional()}),Ge=r.object({id:r.string(),name:r.string().optional(),mimeType:r.string().optional(),description:r.string().optional(),starred:r.boolean().optional(),trashed:r.boolean().optional(),explicitlyTrashed:r.boolean().optional(),parents:r.array(r.string()).optional(),properties:r.record(r.string(),r.string()).optional(),appProperties:r.record(r.string(),r.string()).optional(),spaces:r.array(r.string()).optional(),version:r.string().optional(),webViewLink:r.string().optional(),webContentLink:r.string().optional(),iconLink:r.string().optional(),hasThumbnail:r.boolean().optional(),thumbnailLink:r.string().optional(),thumbnailVersion:r.string().optional(),viewedByMe:r.boolean().optional(),viewedByMeTime:r.string().optional(),createdTime:r.string().optional(),modifiedTime:r.string().optional(),modifiedByMeTime:r.string().optional(),modifiedByMe:r.boolean().optional(),shared:r.boolean().optional(),ownedByMe:r.boolean().optional(),capabilities:Ee.optional(),viewersCanCopyContent:r.boolean().optional(),copyRequiresWriterPermission:r.boolean().optional(),writersCanShare:r.boolean().optional(),permissionIds:r.array(r.string()).optional(),hasAugmentedPermissions:r.boolean().optional(),folderColorRgb:r.string().optional(),filePath:r.string().optional(),createdAt:r.coerce.date().optional()}),Fe=r.object({id:r.string(),name:r.string().optional(),themeId:r.string().optional(),colorRgb:r.string().optional(),createdTime:r.string().optional(),hidden:r.boolean().optional(),createdAt:r.coerce.date().optional()});var ke={version:"1.0.0",entities:{files:Te,folders:Ge,sharedDrives:Fe}};import{googleChannelSubscribe as So}from"corsair/core";async function Se(t,o){let i=await t.keys.get_access_token();if(!i)return null;let s=await fetch(`${q}/changes/startPageToken`,{headers:{authorization:`Bearer ${i}`},signal:AbortSignal.timeout(2e4)});if(!s.ok)return null;let{startPageToken:n}=await s.json();return n?(await t.keys.set_changes_page_token?.(n),So(t,{webhookUrl:o.webhookUrl,watchUrl:`${q}/changes/watch?pageToken=${encodeURIComponent(n)}`})):null}import{logEventFromContext as Pe}from"corsair/core";import{ApiError as j}from"corsair/http";import{z as a}from"zod";var Co=a.object({data:a.string().optional(),attributes:a.record(a.string(),a.string()).optional(),messageId:a.string().optional(),publishTime:a.string().optional()}),Ce=a.object({message:Co.optional(),subscription:a.string().optional(),event:a.unknown().optional()}),Ft=a.object({kind:a.string().optional(),id:a.string().optional(),resourceId:a.string().optional(),resourceUri:a.string().optional(),resourceState:a.string().optional(),changed:a.string().optional(),expiration:a.string().optional()}),W=a.enum(["created","updated","deleted","trashed","untrashed"]),Ie=a.object({type:a.enum(["fileChanged","folderChanged"]),fileId:a.string().optional(),folderId:a.string().optional(),changeType:W,file:a.custom().optional(),folder:a.custom().optional(),filePath:a.string().optional(),change:a.custom().optional(),binaryData:a.string().nullable().optional(),allFiles:a.array(a.object({file:a.custom(),filePath:a.string(),change:a.custom(),changeType:W,binaryData:a.string().nullable().optional()})),allFolders:a.array(a.object({folder:a.custom(),filePath:a.string(),change:a.custom(),changeType:W}))});function P(t){let o=Buffer.from(t,"base64").toString("utf-8");return JSON.parse(o)}function N(t){return o=>{let i=o.body;if(!i.message?.data)return!1;try{let s=P(i.message.data);return!!s.resourceId&&!!s.resourceUri&&s.resourceUri.includes("/drive/")}catch{return!1}}}var Io=/[?&]pageToken=([^&]+)/,xe="application/vnd.google-apps.folder",Po=10,Ao=["id","name","mimeType","parents","trashed","createdTime","modifiedTime","size","webViewLink","webContentLink","starred","shared","ownedByMe","description","fileExtension","originalFilename"].join(",");function xo(t){return t.match(Io)?.[1]}function Oo(t){return t instanceof j?t.status>=500||t.status===429:!0}function Lo(t){if(!(t instanceof j)||t.status!==400)return!1;let o=`${t.message} ${JSON.stringify(t.body??{})}`;return/invalidStartPageToken|pageToken|Invalid Value/i.test(o)}async function Oe(t,o){try{return{status:"ok",file:await x(`/files/${o}`,t,{method:"GET",query:{supportsAllDrives:!0,fields:Ao}})}}catch(i){return i instanceof j&&(i.status===404||i.status===410)?{status:"missing"}:(console.warn(`Failed to fetch file ${o}:`,i),Oo(i)?{status:"failed"}:{status:"missing"})}}async function Ro(t,o){try{let i=`https://www.googleapis.com/drive/v3/files/${o}?alt=media&supportsAllDrives=true`,s=await fetch(i,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!s.ok)return null;let n=await s.arrayBuffer();return Buffer.from(n).toString("base64")}catch(i){return console.warn(`Failed to fetch binary data for file ${o}:`,i),null}}async function Bo(t,o){return await x("/changes",t,{method:"GET",query:{pageToken:o,pageSize:100,includeRemoved:!0,supportsAllDrives:!0}})}async function Ae(t,o){let i=[],s=new Set,n=o,d;for(let b=0;n&&b<Po&&!s.has(n);b++){s.add(n);let w=await Bo(t,n);i.push(...w.changes??[]),d=w.newStartPageToken??d,n=w.nextPageToken}let c=!!(n&&!s.has(n));return{changes:i,resumeToken:c?n:d,truncated:c}}async function Mo(t){try{return await t.keys?.get_changes_page_token?.()??null}catch(o){return console.warn("Failed to read Drive changes cursor:",o),null}}async function qo(t,o,i){if(!o)return"written";let s=t.keys;if(!s?.set_changes_page_token)return"failed";try{let n=await s.get_changes_page_token?.()??null;return n&&i&&n!==i?"cas-lost":(await s.set_changes_page_token(o),"written")}catch(n){return console.warn("Failed to persist Drive changes cursor:",n),"failed"}}async function Uo(t,o,i=20){let s=[o.name??""],n=o.parents,d=0;for(;n?.length&&d<i;){let c=n[0];if(!c)break;let u=await Oe(t,c);if(u.status!=="ok"||!u.file.name||!u.file.parents?.length)break;s.unshift(u.file.name),n=u.file.parents,d++}return"/"+s.join("/")}function _o(t,o){return t.removed?"deleted":o.trashed?"trashed":"updated"}async function Wo(t,o,i,s){let n=o.fileId;if(!n)return!0;let d=o.file??{id:n},c=d.mimeType===xe;try{c?await t.db?.folders?.deleteByEntityId(n):await t.db?.files?.deleteByEntityId(n),d.mimeType||await t.db?.folders?.deleteByEntityId(n)}catch(u){return console.warn(`Failed to delete ${n} from database:`,u),!1}return c?(s.push({folder:d,filePath:"",change:o,changeType:"deleted"}),!0):(i.push({file:d,filePath:"",change:o,changeType:"deleted",binaryData:null}),!0)}var Le={match:N("driveChanged"),handler:async(t,o)=>{let i=o.payload;if(!i.message?.data)return{success:!1,error:"No message data in notification"};let s=P(i.message.data);if(!s.resourceId||!s.resourceUri)return{success:!1,error:"Invalid push notification format"};let n=t.key,d=xo(s.resourceUri);try{let c=await Mo(t),u=c??d;if(!u)return{success:!1,error:"Could not parse pageToken from resource URI"};let b;try{b=await Ae(n,u)}catch(f){if(c&&d&&c!==d&&Lo(f))b=await Ae(n,d);else throw f}let{changes:w,resumeToken:Me,truncated:qe}=b,A=!1,G="",F=[],k=[];for(let f of w){if(!f.fileId)continue;if(f.removed){await Wo(t,f,F,k)||(A=!0);continue}let D=await Oe(n,f.fileId);if(D.status==="failed"){A=!0;continue}if(D.status==="missing")continue;let m=D.file,_e=m.mimeType===xe,R=await Uo(n,m),$=_o(f,m);if(_e){if(t.db?.folders&&m.id)try{let T=await t.db.folders.upsertByEntityId(m.id,{...m,id:m.id,filePath:R});!G&&T?.id&&(G=T.id)}catch(T){A=!0,console.warn(`Failed to save folder ${m.id} to database:`,T)}k.push({folder:m,filePath:R,change:f,changeType:$})}else{let T=await Ro(n,f.fileId);if(t.db?.files&&m.id)try{let B=await t.db.files.upsertByEntityId(m.id,{...m,id:m.id,filePath:R});!G&&B?.id&&(G=B.id)}catch(B){A=!0,console.warn(`Failed to save file ${m.id} to database:`,B)}F.push({file:m,filePath:R,change:f,changeType:$,binaryData:T})}}if(A)return{success:!1,error:"Failed to apply one or more Drive changes"};let Ue=await qo(t,Me,u);if(qe&&Ue==="failed")return{success:!1,error:"Truncated changes feed but could not persist continuation cursor"};if(F.length===0&&k.length===0)return{success:!0,corsairEntityId:"",data:{type:"fileChanged",fileId:s.resourceId??"",changeType:"updated",allFiles:[],allFolders:[]}};let S=k[0],E=F[0];if(S&&!E){let f={type:"folderChanged",folderId:S.folder.id??s.resourceId??"",changeType:S.changeType,folder:S.folder,filePath:S.filePath,change:S.change,allFolders:k,allFiles:F.map(D=>({file:D.file,filePath:D.filePath,change:D.change,changeType:D.changeType,binaryData:D.binaryData}))};return await Pe(t,"googledrive.webhook.folderChanged",{...f},"completed"),{success:!0,corsairEntityId:G,data:f}}let z={type:"fileChanged",fileId:E?.file.id??s.resourceId??"",changeType:E?.changeType??"updated",file:E?.file,filePath:E?.filePath??"",change:E?.change??w[0],binaryData:E?.binaryData??null,allFiles:F.map(f=>({file:f.file,filePath:f.filePath,change:f.change,changeType:f.changeType,binaryData:f.binaryData})),allFolders:k};return await Pe(t,"googledrive.webhook.fileChanged",{...z},"completed"),{success:!0,corsairEntityId:G,data:z}}catch(c){return console.error("Failed to process Google Drive webhook:",c),{success:!1,error:`Failed to process change: ${c instanceof Error?c.message:"Unknown error"}`}}}};var Re={driveChanged:Le};import{firstString as No,getHeader as jo}from"corsair/core";function Be(t){let o=No([jo(t.headers,"x-goog-channel-id")]);return o?{linkType:"channel_id",externalId:o}:null}var Vo={files:{list:h.list,get:h.get,createFromText:h.createFromText,upload:h.upload,update:h.update,delete:h.delete,copy:h.copy,move:h.move,download:h.download,export:h.export,share:h.share},folders:{create:C.create,get:C.get,list:C.list,delete:C.delete,share:C.share},sharedDrives:{create:I.create,get:I.get,list:I.list,update:I.update,delete:I.delete},search:{filesAndFolders:be.filesAndFolders},storage:{getQuota:we.getQuota}},Qo={"files.list":{input:p.filesList,output:g.filesList},"files.get":{input:p.filesGet,output:g.filesGet},"files.createFromText":{input:p.filesCreateFromText,output:g.filesCreateFromText},"files.upload":{input:p.filesUpload,output:g.filesUpload},"files.update":{input:p.filesUpdate,output:g.filesUpdate},"files.delete":{input:p.filesDelete,output:g.filesDelete},"files.copy":{input:p.filesCopy,output:g.filesCopy},"files.move":{input:p.filesMove,output:g.filesMove},"files.download":{input:p.filesDownload,output:g.filesDownload},"files.export":{input:p.filesExport,output:g.filesExport},"files.share":{input:p.filesShare,output:g.filesShare},"folders.create":{input:p.foldersCreate,output:g.foldersCreate},"folders.get":{input:p.foldersGet,output:g.foldersGet},"folders.list":{input:p.foldersList,output:g.foldersList},"folders.delete":{input:p.foldersDelete,output:g.foldersDelete},"folders.share":{input:p.foldersShare,output:g.foldersShare},"sharedDrives.create":{input:p.sharedDrivesCreate,output:g.sharedDrivesCreate},"sharedDrives.get":{input:p.sharedDrivesGet,output:g.sharedDrivesGet},"sharedDrives.list":{input:p.sharedDrivesList,output:g.sharedDrivesList},"sharedDrives.update":{input:p.sharedDrivesUpdate,output:g.sharedDrivesUpdate},"sharedDrives.delete":{input:p.sharedDrivesDelete,output:g.sharedDrivesDelete},"search.filesAndFolders":{input:p.searchFilesAndFolders,output:g.searchFilesAndFolders},"storage.getQuota":{input:p.storageGetQuota,output:g.storageGetQuota}},Ko={driveChanged:Re.driveChanged},Ho={driveChanged:{description:"A file or folder in Google Drive was created, updated, or deleted",payload:Ce,response:Ie}},Xo="oauth_2",Yo={"files.list":{riskLevel:"read",description:"List files in Google Drive"},"files.get":{riskLevel:"read",description:"Get metadata for a specific file"},"files.createFromText":{riskLevel:"write",description:"Create a new Drive file from text content"},"files.upload":{riskLevel:"write",description:"Upload a file to Google Drive"},"files.update":{riskLevel:"write",description:"Update the content or metadata of a file"},"files.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a file [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"files.copy":{riskLevel:"write",description:"Copy a file in Google Drive"},"files.move":{riskLevel:"write",description:"Move a file to a different folder"},"files.download":{riskLevel:"read",description:"Download a file with its name, type and size. Up to about 700 KB the content comes back inline: a text file as text, any other file as base64. A larger file comes back with fileId, where the host saved it (on Corsair, a Files id to pass to another app or read with files.read_text), or with contentOmitted when the host keeps no files. Google Docs, Sheets and Slides can't be downloaded; use files.export."},"files.export":{riskLevel:"read",description:"Export a Google Docs, Sheets, Slides or Drawings file to a regular format: Markdown for Docs, CSV (first sheet only) for Sheets, PDF for Slides and PNG for Drawings unless mimeType names another, such as docx, xlsx or pptx. Drive exports up to 10 MB. The result comes back like files.download: inline up to about 700 KB, otherwise as fileId where the host saved it, or with contentOmitted."},"files.share":{riskLevel:"write",description:"Share a file by granting permissions to users"},"folders.create":{riskLevel:"write",description:"Create a new folder"},"folders.get":{riskLevel:"read",description:"Get metadata for a specific folder"},"folders.list":{riskLevel:"read",description:"List folders in Google Drive"},"folders.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a folder and its contents [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"folders.share":{riskLevel:"write",description:"Share a folder by granting permissions to users"},"sharedDrives.create":{riskLevel:"write",description:"Create a new shared drive"},"sharedDrives.get":{riskLevel:"read",description:"Get info about a shared drive"},"sharedDrives.list":{riskLevel:"read",description:"List shared drives"},"sharedDrives.update":{riskLevel:"write",description:"Update a shared drive"},"sharedDrives.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a shared drive [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"search.filesAndFolders":{riskLevel:"read",description:"Search for files and folders in Google Drive"},"storage.getQuota":{riskLevel:"read",description:"Get the user's Google Drive storage quota and usage"}},Jo={oauth_2:{account:["channel_id","changes_page_token"]}};function $t(t={}){let o={...t,authType:t.authType??Xo};return{id:"googledrive",authConfig:Jo,schema:ke,options:o,oauthConfig:{providerName:"Google",authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:["https://www.googleapis.com/auth/drive"],authParams:{access_type:"offline",prompt:"consent"}},hooks:o.hooks,webhookHooks:o.webhookHooks,endpoints:Vo,webhooks:Ko,endpointMeta:Yo,endpointSchemas:Qo,webhookSchemas:Ho,keyBuilder:async i=>{let s=i.authType;if(o.key)return o.key;if(i.authType==="oauth_2")return $o(i,{plugin:"googledrive",tokenUrl:"https://oauth2.googleapis.com/token"});throw new zo("googledrive","oauth_2")},pluginWebhookMatcher:i=>{let s=i.headers;if(!(s.from==="noreply@google.com"||typeof s["user-agent"]=="string"&&s["user-agent"].includes("APIs-Google")))return!1;let d=i.body;if(!d?.message?.data)return!1;try{let c=P(d.message.data);return!!c.resourceUri&&c.resourceUri.includes("drive")}catch{return!1}},pluginTenantWebhookMatcher:Be,subscribe:Se}}export{N as createGoogleDriveWebhookMatcher,P as decodePubSubMessage,$t as googledrive,Jo as googledriveAuthConfig,Qo as googledriveEndpointSchemas};
1
+ import{AuthMissingError as nt,getOAuthAccessToken as at}from"corsair/core";import{logEventFromContext as D}from"corsair/core";import{ApiError as Fo,toFileOutput as Y}from"corsair/http";import{request as Ke}from"corsair/http";var T=class extends Error{constructor(i,s){super(i);this.code=s;this.name="GoogleDriveAPIError"}},_="https://www.googleapis.com/drive/v3",Q="https://docs.googleapis.com/v1";async function O(t,o,i={}){let{method:s="GET",body:n,query:l,responseType:g,base:f}=i;return await Ke({BASE:f??_,VERSION:"1.0.0",WITH_CREDENTIALS:!1,CREDENTIALS:"omit",TOKEN:o,HEADERS:{"Content-Type":"application/json"}},{method:s,url:t,body:s==="POST"||s==="PUT"||s==="PATCH"?n:void 0,mediaType:"application/json",query:l,responseType:g})}function Xe(t){return t instanceof Error&&"status"in t&&t.status===401}async function d(t,o,i={}){try{return await O(t,o.key,i)}catch(s){if(Xe(s)&&o._refreshAuth){let n=await o._refreshAuth();return await O(t,n,i)}throw s}}import{FileOutputSchema as K}from"corsair/http";import{z as e}from"zod";var Ye=e.object({q:e.string().optional(),pageSize:e.number().optional(),pageToken:e.string().optional(),spaces:e.string().optional(),corpora:e.string().optional(),driveId:e.string().optional(),includeItemsFromAllDrives:e.boolean().optional(),includePermissionsForView:e.string().optional(),orderBy:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),teamDriveId:e.string().optional(),fields:e.string().optional()}),Je=e.object({fileId:e.string(),acknowledgeAbuse:e.boolean().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),includePermissionsForView:e.string().optional(),fields:e.string().optional()}),Ze=e.object({name:e.string(),content:e.string(),mimeType:e.string().optional(),parents:e.array(e.string()).optional(),description:e.string().optional()}),eo=e.object({name:e.string(),mimeType:e.string().optional(),parents:e.array(e.string()).optional(),description:e.string().optional()}),oo=e.object({fileId:e.string(),name:e.string().optional(),description:e.string().optional(),starred:e.boolean().optional(),trashed:e.boolean().optional(),parents:e.array(e.string()).optional(),addParents:e.string().optional(),removeParents:e.string().optional(),properties:e.record(e.string(),e.string()).optional(),appProperties:e.record(e.string(),e.string()).optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),to=e.object({fileId:e.string(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),io=e.object({fileId:e.string(),name:e.string().optional(),parents:e.array(e.string()).optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),ro=e.object({fileId:e.string(),addParents:e.string().optional(),removeParents:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),so=e.object({fileId:e.string(),acknowledgeAbuse:e.boolean().optional()}),no=e.object({fileId:e.string().describe("The Google Docs, Sheets, Slides or Drawings file."),mimeType:e.string().optional().describe("The format to export to, for example application/pdf or application/vnd.openxmlformats-officedocument.wordprocessingml.document. Defaults to Markdown for Docs, CSV (first sheet only) for Sheets, PDF for Slides and PNG for Drawings.")}),ao=e.object({fileId:e.string()}),lo=e.object({fileId:e.string(),type:e.enum(["user","group","domain","anyone"]).optional(),role:e.enum(["owner","organizer","fileOrganizer","writer","commenter","reader"]).optional(),emailAddress:e.string().optional(),domain:e.string().optional(),allowFileDiscovery:e.boolean().optional(),expirationTime:e.string().optional(),sendNotificationEmail:e.boolean().optional(),emailMessage:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),moveToNewOwnersRoot:e.boolean().optional(),transferOwnership:e.boolean().optional()}),po=e.object({name:e.string(),parents:e.array(e.string()).optional(),description:e.string().optional()}),co=e.object({folderId:e.string(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),includePermissionsForView:e.string().optional()}),go=e.object({q:e.string().optional(),pageSize:e.number().optional(),pageToken:e.string().optional(),spaces:e.string().optional(),corpora:e.string().optional(),driveId:e.string().optional(),includeItemsFromAllDrives:e.boolean().optional(),includePermissionsForView:e.string().optional(),orderBy:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),teamDriveId:e.string().optional()}),fo=e.object({folderId:e.string(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),uo=e.object({folderId:e.string(),type:e.enum(["user","group","domain","anyone"]).optional(),role:e.enum(["owner","organizer","fileOrganizer","writer","commenter","reader"]).optional(),emailAddress:e.string().optional(),domain:e.string().optional(),allowFileDiscovery:e.boolean().optional(),expirationTime:e.string().optional(),sendNotificationEmail:e.boolean().optional(),emailMessage:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),moveToNewOwnersRoot:e.boolean().optional(),transferOwnership:e.boolean().optional()}),mo=e.object({name:e.string(),requestId:e.string().optional(),themeId:e.string().optional(),colorRgb:e.string().optional(),restrictions:e.object({adminManagedRestrictions:e.boolean().optional(),copyRequiresWriterPermission:e.boolean().optional(),domainUsersOnly:e.boolean().optional(),driveMembersOnly:e.boolean().optional()}).optional()}),ho=e.object({driveId:e.string(),useDomainAdminAccess:e.boolean().optional()}),vo=e.object({pageSize:e.number().optional(),pageToken:e.string().optional(),q:e.string().optional(),useDomainAdminAccess:e.boolean().optional()}),Do=e.object({driveId:e.string(),name:e.string().optional(),themeId:e.string().optional(),colorRgb:e.string().optional(),restrictions:e.object({adminManagedRestrictions:e.boolean().optional(),copyRequiresWriterPermission:e.boolean().optional(),domainUsersOnly:e.boolean().optional(),driveMembersOnly:e.boolean().optional()}).optional(),useDomainAdminAccess:e.boolean().optional()}),yo=e.object({driveId:e.string()}),bo=e.object({q:e.string(),pageSize:e.number().optional(),pageToken:e.string().optional(),spaces:e.string().optional(),corpora:e.string().optional(),driveId:e.string().optional(),includeItemsFromAllDrives:e.boolean().optional(),includePermissionsForView:e.string().optional(),orderBy:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),teamDriveId:e.string().optional()}),wo=e.object({}),p={filesList:Ye,filesGet:Je,filesCreateFromText:Ze,filesUpload:eo,filesUpdate:oo,filesDelete:to,filesCopy:io,filesMove:ro,filesDownload:so,filesExport:no,filesShare:lo,filesExportText:ao,foldersCreate:po,foldersGet:co,foldersList:go,foldersDelete:fo,foldersShare:uo,sharedDrivesCreate:mo,sharedDrivesGet:ho,sharedDrivesList:vo,sharedDrivesUpdate:Do,sharedDrivesDelete:yo,searchFilesAndFolders:bo,storageGetQuota:wo},To=e.object({kind:e.string().optional(),displayName:e.string().optional(),photoLink:e.string().optional(),me:e.boolean().optional(),permissionId:e.string().optional(),emailAddress:e.string().optional()}),w=e.object({id:e.string().optional(),name:e.string().optional(),mimeType:e.string().optional(),description:e.string().optional(),starred:e.boolean().optional(),trashed:e.boolean().optional(),explicitlyTrashed:e.boolean().optional(),parents:e.array(e.string()).optional(),properties:e.record(e.string(),e.string()).optional(),appProperties:e.record(e.string(),e.string()).optional(),spaces:e.array(e.string()).optional(),version:e.string().optional(),webViewLink:e.string().optional(),webContentLink:e.string().optional(),iconLink:e.string().optional(),hasThumbnail:e.boolean().optional(),thumbnailLink:e.string().optional(),thumbnailVersion:e.string().optional(),viewedByMe:e.boolean().optional(),viewedByMeTime:e.string().optional(),createdTime:e.string().optional(),modifiedTime:e.string().optional(),modifiedByMeTime:e.string().optional(),modifiedByMe:e.boolean().optional(),shared:e.boolean().optional(),ownedByMe:e.boolean().optional(),owners:e.array(To).optional(),permissionIds:e.array(e.string()).optional(),hasAugmentedPermissions:e.boolean().optional(),folderColorRgb:e.string().optional(),originalFilename:e.string().optional(),fullFileExtension:e.string().optional(),fileExtension:e.string().optional(),md5Checksum:e.string().optional(),size:e.string().optional(),quotaBytesUsed:e.string().optional(),headRevisionId:e.string().optional(),isAppAuthorized:e.boolean().optional(),resourceKey:e.string().optional(),sha1Checksum:e.string().optional(),sha256Checksum:e.string().optional()}),Eo=e.object({id:e.string(),name:e.string().optional(),mimeType:e.string().optional(),createdTime:e.string().optional(),modifiedTime:e.string().optional(),webViewLink:e.string().optional(),text:e.string()}),U=e.object({kind:e.string().optional(),nextPageToken:e.string().optional(),incompleteSearch:e.boolean().optional(),files:e.array(w).optional()}),X=e.object({id:e.string().optional(),type:e.enum(["user","group","domain","anyone"]).optional(),emailAddress:e.string().optional(),domain:e.string().optional(),role:e.enum(["owner","organizer","fileOrganizer","writer","commenter","reader"]).optional(),allowFileDiscovery:e.boolean().optional(),displayName:e.string().optional(),photoLink:e.string().optional(),expirationTime:e.string().optional(),deleted:e.boolean().optional(),view:e.enum(["user","domain"]).optional(),pendingOwner:e.boolean().optional()}),q=e.object({kind:e.string().optional(),id:e.string().optional(),name:e.string().optional(),themeId:e.string().optional(),colorRgb:e.string().optional(),createdTime:e.string().optional(),hidden:e.boolean().optional()}),Go=e.object({kind:e.string().optional(),nextPageToken:e.string().optional(),drives:e.array(q).optional()}),ko=e.object({limit:e.string().optional(),usage:e.string(),usageInDrive:e.string(),usageInDriveTrash:e.string()}),c={filesList:U,filesGet:w,filesCreateFromText:w,filesUpload:w,filesUpdate:w,filesDelete:e.void(),filesCopy:w,filesMove:w,filesDownload:K,filesExport:K,filesShare:X,filesExportText:Eo,foldersCreate:w,foldersGet:w,foldersList:U,foldersDelete:e.void(),foldersShare:X,sharedDrivesCreate:q,sharedDrivesGet:q,sharedDrivesList:Go,sharedDrivesUpdate:q,sharedDrivesDelete:e.void(),searchFilesAndFolders:U,storageGetQuota:ko};async function J(t,o,i){if(!t)return;let s=i?(await t.findByEntityId(o.id))?.data:void 0;await t.upsertByEntityId(o.id,{...s,...o})}var Z=async(t,o)=>{let i=await d("/files",t,{method:"GET",query:{...o,fields:o.fields&&!o.fields.includes("nextPageToken")?`nextPageToken,${o.fields}`:o.fields}});if(i.files&&t.db.files)try{for(let s of i.files)if(s.id){let n=s.mimeType==="application/vnd.google-apps.folder",l={...s,id:s.id,createdAt:new Date};await J(n?t.db.folders:t.db.files,l,!!o.fields)}}catch(s){console.warn("Failed to save files to database:",s)}return await D(t,"googledrive.files.list",{...o},"completed"),i},ee=async(t,o)=>{let i=await d(`/files/${o.fileId}`,t,{method:"GET",query:o});if(i.id){let s=i.mimeType==="application/vnd.google-apps.folder";try{let n={...i,id:i.id,createdAt:new Date};await J(s?t.db.folders:t.db.files,n,!!o.fields)}catch(n){console.warn("Failed to save file to database:",n)}}return await D(t,"googledrive.files.get",{...o},"completed"),i},oe=async(t,o)=>{let i=await d("/files",t,{method:"POST",body:{...o},query:{uploadType:"multipart"}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await D(t,"googledrive.files.createFromText",{...o},"completed"),i},te=async(t,o)=>{let i=await d("/files",t,{method:"POST",body:{...o},query:{uploadType:"multipart"}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await D(t,"googledrive.files.upload",{...o},"completed"),i},ie=async(t,o)=>{let i=await d(`/files/${o.fileId}`,t,{method:"PATCH",body:{name:o.name,description:o.description,starred:o.starred,trashed:o.trashed,parents:o.parents,properties:o.properties,appProperties:o.appProperties},query:{addParents:o.addParents,removeParents:o.removeParents,supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await D(t,"googledrive.files.update",{...o},"completed"),i},re=async(t,o)=>{if(await d(`/files/${o.fileId}`,t,{method:"DELETE",query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}}),t.db.files)try{await t.db.files.deleteByEntityId(o.fileId),await t.db.fileContents?.deleteByEntityId(o.fileId)}catch(i){console.warn("Failed to delete file from database:",i)}await D(t,"googledrive.files.delete",{...o},"completed")},se=async(t,o)=>{let i=await d(`/files/${o.fileId}/copy`,t,{method:"POST",body:{name:o.name,parents:o.parents},query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await D(t,"googledrive.files.copy",{...o},"completed"),i},ne=async(t,o)=>{let i=await d(`/files/${o.fileId}`,t,{method:"PATCH",body:{},query:{addParents:o.addParents,removeParents:o.removeParents,supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}});return i.id&&await t.endpoints.files.get({fileId:i.id}),await D(t,"googledrive.files.move",{...o},"completed"),i},ae="application/vnd.google-apps.",So={"application/vnd.google-apps.document":"text/markdown","application/vnd.google-apps.spreadsheet":"text/csv","application/vnd.google-apps.presentation":"application/pdf","application/vnd.google-apps.drawing":"image/png","application/vnd.google-apps.script":"application/vnd.google-apps.script+json"},Co="application/vnd.google-apps.vid",Po={"application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.oasis.opendocument.text":"odt","application/rtf":"rtf","application/pdf":"pdf","text/plain":"txt","text/html":"html","application/zip":"zip","application/epub+zip":"epub","text/markdown":"md","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.oasis.opendocument.spreadsheet":"ods","text/csv":"csv","text/tab-separated-values":"tsv","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.oasis.opendocument.presentation":"odp","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","application/vnd.google-apps.script+json":"json","video/mp4":"mp4"};async function le(t,o){return d(`/files/${o}`,t,{method:"GET",query:{fields:"name,mimeType",supportsAllDrives:!0}})}function Io(t,o){let i=Po[o];return!i||t.toLowerCase().endsWith(`.${i}`)?t:`${t}.${i}`}var de=async(t,o)=>{let i=await le(t,o.fileId);if(i.mimeType?.startsWith(ae))throw new Error(`This file is a Google file (${i.mimeType}), which Drive cannot download as it is. Use files.export with the same fileId to get it as Markdown, CSV, PDF or another format.`);let{bytes:s,contentType:n}=await d(`/files/${o.fileId}`,t,{method:"GET",query:{alt:"media",acknowledgeAbuse:o.acknowledgeAbuse,supportsAllDrives:!0},responseType:"binary"});return await D(t,"googledrive.files.download",{...o},"completed"),Y(s,n??i.mimeType,{...i.name?{filename:i.name}:{}})},pe=async(t,o)=>{let i=await le(t,o.fileId),s=i.mimeType??"";if(!s.startsWith(ae))throw new Error(`This file is not a Google Docs, Sheets, Slides or Drawings file (${s||"unknown type"}). Use files.download to get it as it is.`);if(s===Co)throw new Error("Drive does not export Google Vids files, and this plugin cannot download them yet.");let n=So[s];if(!n)throw new Error(`Drive cannot export a ${s} file. Docs, Sheets, Slides, Drawings and Apps Script files can be exported.`);let l=o.mimeType??n,{bytes:g,contentType:f}=await d(`/files/${o.fileId}/export`,t,{method:"GET",query:{mimeType:l},responseType:"binary"});return await D(t,"googledrive.files.export",{...o},"completed"),Y(g,f??l,{...i.name?{filename:Io(i.name,l)}:{}})},ce=async(t,o)=>{let i=await d(`/files/${o.fileId}/permissions`,t,{method:"POST",body:{type:o.type,role:o.role,emailAddress:o.emailAddress,domain:o.domain,allowFileDiscovery:o.allowFileDiscovery,expirationTime:o.expirationTime,sendNotificationEmail:o.sendNotificationEmail,emailMessage:o.emailMessage},query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,moveToNewOwnersRoot:o.moveToNewOwnersRoot,transferOwnership:o.transferOwnership}});return await D(t,"googledrive.files.share",{...o},"completed"),i},xo="application/vnd.google-apps.document",Ao="id,name,mimeType,createdTime,modifiedTime,webViewLink",Oo=5e5;function j(t=[]){return t.map(o=>o.paragraph?(o.paragraph.elements??[]).map(i=>i.textRun?.content??i.person?.personProperties?.name??i.person?.personProperties?.email??i.richLink?.richLinkProperties?.title??i.dateElement?.dateElementProperties?.displayText??"").join(""):o.tableOfContents?j(o.tableOfContents.content):(o.table?.tableRows??[]).flatMap(i=>i.tableCells??[]).map(i=>j(i.content)).join("")).join("")}function ge(t=[]){return t.flatMap(o=>[`# ${o.tabProperties?.title??""}
2
+ ${j(o.documentTab?.body?.content)}`,...ge(o.childTabs)])}var fe=async(t,o)=>{let i=p.filesExportText.parse(o),s=await d(`/files/${i.fileId}`,t,{method:"GET",query:{fields:Ao,supportsAllDrives:!0}});if(s.mimeType!==xo)throw new T("exportText supports Google Docs only",400);let n;try{n=await d(`/documents/${i.fileId}`,t,{method:"GET",base:Q,query:{includeTabsContent:!0}})}catch(m){if(m instanceof Fo&&m.status===403){let y=m.body?.error?.message;typeof y=="string"&&y&&(m.message=y)}throw m}let l=ge(n.tabs).join(`
3
+ `).slice(0,Oo),g=l.charCodeAt(l.length-1);g>=55296&&g<=56319&&(l=l.slice(0,-1));let f=c.filesExportText.parse({id:s.id??i.fileId,name:s.name,mimeType:s.mimeType,createdTime:s.createdTime,modifiedTime:s.modifiedTime,webViewLink:s.webViewLink,text:l});if(t.db.fileContents)try{await t.db.fileContents.upsertByEntityId(f.id,f)}catch(m){console.warn("Failed to save file contents to database:",m)}return await D(t,"googledrive.files.exportText",{...i},"completed"),f};import{logEventFromContext as L}from"corsair/core";var ue=async(t,o)=>{let i=await d("/files",t,{method:"POST",body:{name:o.name,mimeType:"application/vnd.google-apps.folder",parents:o.parents,description:o.description}});if(i.id&&t.db.folders)try{await t.db.folders.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date})}catch(s){console.warn("Failed to save folder to database:",s)}return await L(t,"googledrive.folders.create",{...o},"completed"),i},me=async(t,o)=>{let i=await d(`/files/${o.folderId}`,t,{method:"GET",query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,includePermissionsForView:o.includePermissionsForView}});if(i.id&&t.db.folders)try{await t.db.folders.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date})}catch(s){console.warn("Failed to save folder to database:",s)}return await L(t,"googledrive.folders.get",{...o},"completed"),i},he=async(t,o)=>{let i=`mimeType='application/vnd.google-apps.folder'${o.q?` and ${o.q}`:""}`,s=await d("/files",t,{method:"GET",query:{q:i,pageSize:o.pageSize,pageToken:o.pageToken,spaces:o.spaces,corpora:o.corpora,driveId:o.driveId,includeItemsFromAllDrives:o.includeItemsFromAllDrives,includePermissionsForView:o.includePermissionsForView,orderBy:o.orderBy,supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,teamDriveId:o.teamDriveId}});if(s.files&&t.db.folders)try{for(let n of s.files)n.id&&await t.db.folders.upsertByEntityId(n.id,{...n,id:n.id,createdAt:new Date})}catch(n){console.warn("Failed to save folders to database:",n)}return await L(t,"googledrive.folders.list",{...o},"completed"),s},ve=async(t,o)=>{if(await d(`/files/${o.folderId}`,t,{method:"DELETE",query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}}),t.db.folders)try{await t.db.folders.deleteByEntityId(o.folderId)}catch(i){console.warn("Failed to delete folder from database:",i)}await L(t,"googledrive.folders.delete",{...o},"completed")},De=async(t,o)=>{let i=await d(`/files/${o.folderId}/permissions`,t,{method:"POST",body:{type:o.type,role:o.role,emailAddress:o.emailAddress,domain:o.domain,allowFileDiscovery:o.allowFileDiscovery,expirationTime:o.expirationTime,sendNotificationEmail:o.sendNotificationEmail,emailMessage:o.emailMessage},query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,moveToNewOwnersRoot:o.moveToNewOwnersRoot,transferOwnership:o.transferOwnership}});return await L(t,"googledrive.folders.share",{...o},"completed"),i};import{logEventFromContext as Bo}from"corsair/core";var ye=async(t,o)=>{let i=await d("/files",t,{method:"GET",query:{q:o.q,pageSize:o.pageSize,pageToken:o.pageToken,spaces:o.spaces,corpora:o.corpora,driveId:o.driveId,includeItemsFromAllDrives:o.includeItemsFromAllDrives,includePermissionsForView:o.includePermissionsForView,orderBy:o.orderBy,supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,teamDriveId:o.teamDriveId}});if(i.files)try{for(let s of i.files)if(s.id){let n=s.mimeType==="application/vnd.google-apps.folder";n&&t.db.folders?await t.db.folders.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date}):!n&&t.db.files&&await t.db.files.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date})}}catch(s){console.warn("Failed to save search results to database:",s)}return await Bo(t,"googledrive.search.filesAndFolders",{...o},"completed"),i};import{logEventFromContext as R}from"corsair/core";var be=async(t,o)=>{let i=o.requestId||`req_${Date.now()}`,s=await d("/drives",t,{method:"POST",body:{name:o.name,themeId:o.themeId,colorRgb:o.colorRgb,restrictions:o.restrictions},query:{requestId:i}});if(s.id&&t.db.sharedDrives)try{await t.db.sharedDrives.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date})}catch(n){console.warn("Failed to save shared drive to database:",n)}return await R(t,"googledrive.sharedDrives.create",{...o},"completed"),s},we=async(t,o)=>{let i=await d(`/drives/${o.driveId}`,t,{method:"GET",query:{useDomainAdminAccess:o.useDomainAdminAccess}});if(i.id&&t.db.sharedDrives)try{await t.db.sharedDrives.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date})}catch(s){console.warn("Failed to save shared drive to database:",s)}return await R(t,"googledrive.sharedDrives.get",{...o},"completed"),i},Te=async(t,o)=>{let i=await d("/drives",t,{method:"GET",query:{pageSize:o.pageSize,pageToken:o.pageToken,q:o.q,useDomainAdminAccess:o.useDomainAdminAccess}});if(i.drives&&t.db.sharedDrives)try{for(let s of i.drives)s.id&&await t.db.sharedDrives.upsertByEntityId(s.id,{...s,id:s.id,createdAt:new Date})}catch(s){console.warn("Failed to save shared drives to database:",s)}return await R(t,"googledrive.sharedDrives.list",{...o},"completed"),i},Ee=async(t,o)=>{let i=await d(`/drives/${o.driveId}`,t,{method:"PATCH",body:{name:o.name,themeId:o.themeId,colorRgb:o.colorRgb,restrictions:o.restrictions},query:{useDomainAdminAccess:o.useDomainAdminAccess}});if(i.id&&t.db.sharedDrives)try{await t.db.sharedDrives.upsertByEntityId(i.id,{...i,id:i.id,createdAt:new Date})}catch(s){console.warn("Failed to save shared drive to database:",s)}return await R(t,"googledrive.sharedDrives.update",{...o},"completed"),i},Ge=async(t,o)=>{if(await d(`/drives/${o.driveId}`,t,{method:"DELETE"}),t.db.sharedDrives)try{await t.db.sharedDrives.deleteByEntityId(o.driveId)}catch(i){console.warn("Failed to delete shared drive from database:",i)}await R(t,"googledrive.sharedDrives.delete",{...o},"completed")};import{logEventFromContext as qo}from"corsair/core";var Uo="storageQuota",ke=async(t,o)=>{let s=(await d("/about",t,{method:"GET",query:{fields:Uo}})).storageQuota;if(!s||Object.keys(s).length===0)throw new T("Google Drive about.get returned no storageQuota",502);return await qo(t,"googledrive.storage.getQuota",{...o},"completed"),s};var v={list:Z,get:ee,createFromText:oe,upload:te,update:ie,delete:re,copy:se,move:ne,download:de,export:pe,share:ce,exportText:fe},P={create:ue,get:me,list:he,delete:ve,share:De},I={create:be,get:we,list:Te,update:Ee,delete:Ge},Fe={filesAndFolders:ye},Se={getQuota:ke};import{ApiError as No}from"corsair/http";function Ce(t){if(t instanceof No)return t.status;if(t instanceof T)return t.code}var Pe={RATE_LIMIT_ERROR:{match:t=>Ce(t)===429,handler:async()=>({maxRetries:0})},AUTH_ERROR:{match:t=>{let o=Ce(t);return o===401||o===403},handler:async()=>({maxRetries:0})},DEFAULT:{match:()=>!0,handler:async()=>({maxRetries:0})}};import{z as r}from"zod";var Ie=r.object({canAddChildren:r.boolean().optional(),canChangeCopyRequiresWriterPermission:r.boolean().optional(),canChangeViewersCanCopyContent:r.boolean().optional(),canComment:r.boolean().optional(),canCopy:r.boolean().optional(),canDelete:r.boolean().optional(),canDeleteChildren:r.boolean().optional(),canDownload:r.boolean().optional(),canEdit:r.boolean().optional(),canListChildren:r.boolean().optional(),canModifyContent:r.boolean().optional(),canModifyContentRestriction:r.boolean().optional(),canMoveChildrenOutOfDrive:r.boolean().optional(),canMoveChildrenOutOfTeamDrive:r.boolean().optional(),canMoveChildrenWithinDrive:r.boolean().optional(),canMoveItemIntoTeamDrive:r.boolean().optional(),canMoveItemOutOfDrive:r.boolean().optional(),canMoveItemWithinDrive:r.boolean().optional(),canReadRevisions:r.boolean().optional(),canReadTeamDrive:r.boolean().optional(),canRemoveChildren:r.boolean().optional(),canRename:r.boolean().optional(),canShare:r.boolean().optional(),canTrash:r.boolean().optional(),canTrashChildren:r.boolean().optional(),canUntrash:r.boolean().optional()}),xe=r.object({id:r.string(),name:r.string().optional(),mimeType:r.string().optional(),description:r.string().optional(),starred:r.boolean().optional(),trashed:r.boolean().optional(),explicitlyTrashed:r.boolean().optional(),parents:r.array(r.string()).optional(),properties:r.record(r.string(),r.string()).optional(),appProperties:r.record(r.string(),r.string()).optional(),spaces:r.array(r.string()).optional(),version:r.string().optional(),webViewLink:r.string().optional(),webContentLink:r.string().optional(),iconLink:r.string().optional(),hasThumbnail:r.boolean().optional(),thumbnailLink:r.string().optional(),thumbnailVersion:r.string().optional(),viewedByMe:r.boolean().optional(),viewedByMeTime:r.string().optional(),createdTime:r.string().optional(),modifiedTime:r.string().optional(),modifiedByMeTime:r.string().optional(),modifiedByMe:r.boolean().optional(),shared:r.boolean().optional(),ownedByMe:r.boolean().optional(),owners:r.array(r.object({displayName:r.string().optional(),emailAddress:r.string().optional(),photoLink:r.string().optional(),me:r.boolean().optional(),permissionId:r.string().optional()})).optional(),capabilities:Ie.optional(),viewersCanCopyContent:r.boolean().optional(),copyRequiresWriterPermission:r.boolean().optional(),writersCanShare:r.boolean().optional(),permissionIds:r.array(r.string()).optional(),hasAugmentedPermissions:r.boolean().optional(),folderColorRgb:r.string().optional(),originalFilename:r.string().optional(),fullFileExtension:r.string().optional(),fileExtension:r.string().optional(),md5Checksum:r.string().optional(),size:r.string().optional(),quotaBytesUsed:r.string().optional(),headRevisionId:r.string().optional(),isAppAuthorized:r.boolean().optional(),resourceKey:r.string().optional(),sha1Checksum:r.string().optional(),sha256Checksum:r.string().optional(),filePath:r.string().optional(),createdAt:r.coerce.date().optional()}),Ae=r.object({id:r.string(),name:r.string().optional(),mimeType:r.string().optional(),description:r.string().optional(),starred:r.boolean().optional(),trashed:r.boolean().optional(),explicitlyTrashed:r.boolean().optional(),parents:r.array(r.string()).optional(),properties:r.record(r.string(),r.string()).optional(),appProperties:r.record(r.string(),r.string()).optional(),spaces:r.array(r.string()).optional(),version:r.string().optional(),webViewLink:r.string().optional(),webContentLink:r.string().optional(),iconLink:r.string().optional(),hasThumbnail:r.boolean().optional(),thumbnailLink:r.string().optional(),thumbnailVersion:r.string().optional(),viewedByMe:r.boolean().optional(),viewedByMeTime:r.string().optional(),createdTime:r.string().optional(),modifiedTime:r.string().optional(),modifiedByMeTime:r.string().optional(),modifiedByMe:r.boolean().optional(),shared:r.boolean().optional(),ownedByMe:r.boolean().optional(),capabilities:Ie.optional(),viewersCanCopyContent:r.boolean().optional(),copyRequiresWriterPermission:r.boolean().optional(),writersCanShare:r.boolean().optional(),permissionIds:r.array(r.string()).optional(),hasAugmentedPermissions:r.boolean().optional(),folderColorRgb:r.string().optional(),filePath:r.string().optional(),createdAt:r.coerce.date().optional()}),Oe=r.object({id:r.string(),name:r.string().optional(),mimeType:r.string().optional(),createdTime:r.string().optional(),modifiedTime:r.string().optional(),webViewLink:r.string().optional(),text:r.string()}),Le=r.object({id:r.string(),name:r.string().optional(),themeId:r.string().optional(),colorRgb:r.string().optional(),createdTime:r.string().optional(),hidden:r.boolean().optional(),createdAt:r.coerce.date().optional()});var Re={version:"1.0.0",entities:{files:xe,fileContents:Oe,folders:Ae,sharedDrives:Le}};import{googleChannelSubscribe as Wo}from"corsair/core";async function Be(t,o){let i=await t.keys.get_access_token();if(!i)return null;let s=await fetch(`${_}/changes/startPageToken`,{headers:{authorization:`Bearer ${i}`},signal:AbortSignal.timeout(2e4)});if(!s.ok)return null;let{startPageToken:n}=await s.json();return n?(await t.keys.set_changes_page_token?.(n),Wo(t,{webhookUrl:o.webhookUrl,watchUrl:`${_}/changes/watch?pageToken=${encodeURIComponent(n)}`})):null}import{logEventFromContext as qe}from"corsair/core";import{ApiError as $}from"corsair/http";import{z as a}from"zod";var $o=a.object({data:a.string().optional(),attributes:a.record(a.string(),a.string()).optional(),messageId:a.string().optional(),publishTime:a.string().optional()}),Me=a.object({message:$o.optional(),subscription:a.string().optional(),event:a.unknown().optional()}),zt=a.object({kind:a.string().optional(),id:a.string().optional(),resourceId:a.string().optional(),resourceUri:a.string().optional(),resourceState:a.string().optional(),changed:a.string().optional(),expiration:a.string().optional()}),N=a.enum(["created","updated","deleted","trashed","untrashed"]),_e=a.object({type:a.enum(["fileChanged","folderChanged"]),fileId:a.string().optional(),folderId:a.string().optional(),changeType:N,file:a.custom().optional(),folder:a.custom().optional(),filePath:a.string().optional(),change:a.custom().optional(),binaryData:a.string().nullable().optional(),allFiles:a.array(a.object({file:a.custom(),filePath:a.string(),change:a.custom(),changeType:N,binaryData:a.string().nullable().optional()})),allFolders:a.array(a.object({folder:a.custom(),filePath:a.string(),change:a.custom(),changeType:N}))});function x(t){let o=Buffer.from(t,"base64").toString("utf-8");return JSON.parse(o)}function W(t){return o=>{let i=o.body;if(!i.message?.data)return!1;try{let s=x(i.message.data);return!!s.resourceId&&!!s.resourceUri&&s.resourceUri.includes("/drive/")}catch{return!1}}}var zo=/[?&]pageToken=([^&]+)/,je="application/vnd.google-apps.folder",Vo=10,Ho=["id","name","mimeType","parents","trashed","createdTime","modifiedTime","size","webViewLink","webContentLink","starred","shared","ownedByMe","description","fileExtension","originalFilename"].join(",");function Qo(t){return t.match(zo)?.[1]}function Ko(t){return t instanceof $?t.status>=500||t.status===429:!0}function Xo(t){if(!(t instanceof $)||t.status!==400)return!1;let o=`${t.message} ${JSON.stringify(t.body??{})}`;return/invalidStartPageToken|pageToken|Invalid Value/i.test(o)}async function Ne(t,o){try{return{status:"ok",file:await O(`/files/${o}`,t,{method:"GET",query:{supportsAllDrives:!0,fields:Ho}})}}catch(i){return i instanceof $&&(i.status===404||i.status===410)?{status:"missing"}:(console.warn(`Failed to fetch file ${o}:`,i),Ko(i)?{status:"failed"}:{status:"missing"})}}async function Yo(t,o){try{let i=`https://www.googleapis.com/drive/v3/files/${o}?alt=media&supportsAllDrives=true`,s=await fetch(i,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!s.ok)return null;let n=await s.arrayBuffer();return Buffer.from(n).toString("base64")}catch(i){return console.warn(`Failed to fetch binary data for file ${o}:`,i),null}}async function Jo(t,o){return await O("/changes",t,{method:"GET",query:{pageToken:o,pageSize:100,includeRemoved:!0,supportsAllDrives:!0}})}async function Ue(t,o){let i=[],s=new Set,n=o,l;for(let m=0;n&&m<Vo&&!s.has(n);m++){s.add(n);let y=await Jo(t,n);i.push(...y.changes??[]),l=y.newStartPageToken??l,n=y.nextPageToken}let g=!!(n&&!s.has(n));return{changes:i,resumeToken:g?n:l,truncated:g}}async function Zo(t){try{return await t.keys?.get_changes_page_token?.()??null}catch(o){return console.warn("Failed to read Drive changes cursor:",o),null}}async function et(t,o,i){if(!o)return"written";let s=t.keys;if(!s?.set_changes_page_token)return"failed";try{let n=await s.get_changes_page_token?.()??null;return n&&i&&n!==i?"cas-lost":(await s.set_changes_page_token(o),"written")}catch(n){return console.warn("Failed to persist Drive changes cursor:",n),"failed"}}async function ot(t,o,i=20){let s=[o.name??""],n=o.parents,l=0;for(;n?.length&&l<i;){let g=n[0];if(!g)break;let f=await Ne(t,g);if(f.status!=="ok"||!f.file.name||!f.file.parents?.length)break;s.unshift(f.file.name),n=f.file.parents,l++}return"/"+s.join("/")}function tt(t,o){return t.removed?"deleted":o.trashed?"trashed":"updated"}async function it(t,o,i,s){let n=o.fileId;if(!n)return!0;let l=o.file??{id:n},g=l.mimeType===je;try{g?await t.db?.folders?.deleteByEntityId(n):(await t.db?.files?.deleteByEntityId(n),await t.db?.fileContents?.deleteByEntityId(n)),l.mimeType||await t.db?.folders?.deleteByEntityId(n)}catch(f){return console.warn(`Failed to delete ${n} from database:`,f),!1}return g?(s.push({folder:l,filePath:"",change:o,changeType:"deleted"}),!0):(i.push({file:l,filePath:"",change:o,changeType:"deleted",binaryData:null}),!0)}var We={match:W("driveChanged"),handler:async(t,o)=>{let i=o.payload;if(!i.message?.data)return{success:!1,error:"No message data in notification"};let s=x(i.message.data);if(!s.resourceId||!s.resourceUri)return{success:!1,error:"Invalid push notification format"};let n=t.key,l=Qo(s.resourceUri);try{let g=await Zo(t),f=g??l;if(!f)return{success:!1,error:"Could not parse pageToken from resource URI"};let m;try{m=await Ue(n,f)}catch(u){if(g&&l&&g!==l&&Xo(u))m=await Ue(n,l);else throw u}let{changes:y,resumeToken:z,truncated:Ve}=m,A=!1,k="",F=[],S=[];for(let u of y){if(!u.fileId)continue;if(u.removed){await it(t,u,F,S)||(A=!0);continue}let b=await Ne(n,u.fileId);if(b.status==="failed"){A=!0;continue}if(b.status==="missing")continue;let h=b.file,Qe=h.mimeType===je,B=await ot(n,h),H=tt(u,h);if(Qe){if(t.db?.folders&&h.id)try{let G=await t.db.folders.upsertByEntityId(h.id,{...h,id:h.id,filePath:B});!k&&G?.id&&(k=G.id)}catch(G){A=!0,console.warn(`Failed to save folder ${h.id} to database:`,G)}S.push({folder:h,filePath:B,change:u,changeType:H})}else{let G=await Yo(n,u.fileId);if(t.db?.files&&h.id)try{let M=await t.db.files.upsertByEntityId(h.id,{...h,id:h.id,filePath:B});!k&&M?.id&&(k=M.id)}catch(M){A=!0,console.warn(`Failed to save file ${h.id} to database:`,M)}F.push({file:h,filePath:B,change:u,changeType:H,binaryData:G})}}if(A)return{success:!1,error:"Failed to apply one or more Drive changes"};let He=await et(t,z,f);if(Ve&&He==="failed")return{success:!1,error:"Truncated changes feed but could not persist continuation cursor"};if(F.length===0&&S.length===0)return{success:!0,corsairEntityId:"",data:{type:"fileChanged",fileId:s.resourceId??"",changeType:"updated",allFiles:[],allFolders:[]}};let C=S[0],E=F[0];if(C&&!E){let u={type:"folderChanged",folderId:C.folder.id??s.resourceId??"",changeType:C.changeType,folder:C.folder,filePath:C.filePath,change:C.change,allFolders:S,allFiles:F.map(b=>({file:b.file,filePath:b.filePath,change:b.change,changeType:b.changeType,binaryData:b.binaryData}))};return await qe(t,"googledrive.webhook.folderChanged",{...u},"completed"),{success:!0,corsairEntityId:k,data:u}}let V={type:"fileChanged",fileId:E?.file.id??s.resourceId??"",changeType:E?.changeType??"updated",file:E?.file,filePath:E?.filePath??"",change:E?.change??y[0],binaryData:E?.binaryData??null,allFiles:F.map(u=>({file:u.file,filePath:u.filePath,change:u.change,changeType:u.changeType,binaryData:u.binaryData})),allFolders:S};return await qe(t,"googledrive.webhook.fileChanged",{...V},"completed"),{success:!0,corsairEntityId:k,data:V}}catch(g){return console.error("Failed to process Google Drive webhook:",g),{success:!1,error:`Failed to process change: ${g instanceof Error?g.message:"Unknown error"}`}}}};var $e={driveChanged:We};import{firstString as rt,getHeader as st}from"corsair/core";function ze(t){let o=rt([st(t.headers,"x-goog-channel-id")]);return o?{linkType:"channel_id",externalId:o}:null}var lt={files:{list:v.list,get:v.get,createFromText:v.createFromText,upload:v.upload,update:v.update,delete:v.delete,copy:v.copy,move:v.move,download:v.download,export:v.export,share:v.share,exportText:v.exportText},folders:{create:P.create,get:P.get,list:P.list,delete:P.delete,share:P.share},sharedDrives:{create:I.create,get:I.get,list:I.list,update:I.update,delete:I.delete},search:{filesAndFolders:Fe.filesAndFolders},storage:{getQuota:Se.getQuota}},dt={"files.list":{input:p.filesList,output:c.filesList},"files.get":{input:p.filesGet,output:c.filesGet},"files.createFromText":{input:p.filesCreateFromText,output:c.filesCreateFromText},"files.upload":{input:p.filesUpload,output:c.filesUpload},"files.update":{input:p.filesUpdate,output:c.filesUpdate},"files.delete":{input:p.filesDelete,output:c.filesDelete},"files.copy":{input:p.filesCopy,output:c.filesCopy},"files.move":{input:p.filesMove,output:c.filesMove},"files.download":{input:p.filesDownload,output:c.filesDownload},"files.export":{input:p.filesExport,output:c.filesExport},"files.share":{input:p.filesShare,output:c.filesShare},"files.exportText":{input:p.filesExportText,output:c.filesExportText},"folders.create":{input:p.foldersCreate,output:c.foldersCreate},"folders.get":{input:p.foldersGet,output:c.foldersGet},"folders.list":{input:p.foldersList,output:c.foldersList},"folders.delete":{input:p.foldersDelete,output:c.foldersDelete},"folders.share":{input:p.foldersShare,output:c.foldersShare},"sharedDrives.create":{input:p.sharedDrivesCreate,output:c.sharedDrivesCreate},"sharedDrives.get":{input:p.sharedDrivesGet,output:c.sharedDrivesGet},"sharedDrives.list":{input:p.sharedDrivesList,output:c.sharedDrivesList},"sharedDrives.update":{input:p.sharedDrivesUpdate,output:c.sharedDrivesUpdate},"sharedDrives.delete":{input:p.sharedDrivesDelete,output:c.sharedDrivesDelete},"search.filesAndFolders":{input:p.searchFilesAndFolders,output:c.searchFilesAndFolders},"storage.getQuota":{input:p.storageGetQuota,output:c.storageGetQuota}},pt={driveChanged:$e.driveChanged},ct={driveChanged:{description:"A file or folder in Google Drive was created, updated, or deleted",payload:Me,response:_e}},gt="oauth_2",ft={"files.list":{riskLevel:"read",description:"List files in Google Drive"},"files.get":{riskLevel:"read",description:"Get metadata for a specific file"},"files.createFromText":{riskLevel:"write",description:"Create a new Drive file from text content"},"files.upload":{riskLevel:"write",description:"Upload a file to Google Drive"},"files.update":{riskLevel:"write",description:"Update the content or metadata of a file"},"files.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a file [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"files.copy":{riskLevel:"write",description:"Copy a file in Google Drive"},"files.move":{riskLevel:"write",description:"Move a file to a different folder"},"files.download":{riskLevel:"read",description:"Download a file with its name, type and size. Up to about 700 KB the content comes back inline: a text file as text, any other file as base64. A larger file comes back with fileId, where the host saved it (on Corsair, a Files id to pass to another app or read with files.read_text), or with contentOmitted when the host keeps no files. Google Docs, Sheets and Slides can't be downloaded; use files.export."},"files.export":{riskLevel:"read",description:"Export a Google Docs, Sheets, Slides or Drawings file to a regular format: Markdown for Docs, CSV (first sheet only) for Sheets, PDF for Slides and PNG for Drawings unless mimeType names another, such as docx, xlsx or pptx. Drive exports up to 10 MB. The result comes back like files.download: inline up to about 700 KB, otherwise as fileId where the host saved it, or with contentOmitted."},"files.share":{riskLevel:"write",description:"Share a file by granting permissions to users"},"files.exportText":{riskLevel:"read",description:"Get the plain text of a Google Doc across all of its tabs and store it"},"folders.create":{riskLevel:"write",description:"Create a new folder"},"folders.get":{riskLevel:"read",description:"Get metadata for a specific folder"},"folders.list":{riskLevel:"read",description:"List folders in Google Drive"},"folders.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a folder and its contents [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"folders.share":{riskLevel:"write",description:"Share a folder by granting permissions to users"},"sharedDrives.create":{riskLevel:"write",description:"Create a new shared drive"},"sharedDrives.get":{riskLevel:"read",description:"Get info about a shared drive"},"sharedDrives.list":{riskLevel:"read",description:"List shared drives"},"sharedDrives.update":{riskLevel:"write",description:"Update a shared drive"},"sharedDrives.delete":{riskLevel:"destructive",irreversible:!0,description:"Permanently delete a shared drive [DESTRUCTIVE \xB7 IRREVERSIBLE]"},"search.filesAndFolders":{riskLevel:"read",description:"Search for files and folders in Google Drive"},"storage.getQuota":{riskLevel:"read",description:"Get the user's Google Drive storage quota and usage"}},ut={oauth_2:{account:["channel_id","changes_page_token"]}};function gi(t={}){let o={...t,authType:t.authType??gt};return{id:"googledrive",authConfig:ut,schema:Re,options:o,oauthConfig:{providerName:"Google",authUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",scopes:["https://www.googleapis.com/auth/drive"],authParams:{access_type:"offline",prompt:"consent"}},hooks:o.hooks,webhookHooks:o.webhookHooks,endpoints:lt,webhooks:pt,endpointMeta:ft,endpointSchemas:dt,webhookSchemas:ct,errorHandlers:{...Pe,...o.errorHandlers},keyBuilder:async i=>{let s=i.authType;if(o.key)return o.key;if(i.authType==="oauth_2")return at(i,{plugin:"googledrive",tokenUrl:"https://oauth2.googleapis.com/token"});throw new nt("googledrive","oauth_2")},pluginWebhookMatcher:i=>{let s=i.headers;if(!(s.from==="noreply@google.com"||typeof s["user-agent"]=="string"&&s["user-agent"].includes("APIs-Google")))return!1;let l=i.body;if(!l?.message?.data)return!1;try{let g=x(l.message.data);return!!g.resourceUri&&g.resourceUri.includes("drive")}catch{return!1}},pluginTenantWebhookMatcher:ze,subscribe:Be}}export{W as createGoogleDriveWebhookMatcher,x as decodePubSubMessage,gi as googledrive,ut as googledriveAuthConfig,dt as googledriveEndpointSchemas};
@@ -26,6 +26,13 @@ export declare const GoogleDriveFile: z.ZodObject<{
26
26
  modifiedByMe: z.ZodOptional<z.ZodBoolean>;
27
27
  shared: z.ZodOptional<z.ZodBoolean>;
28
28
  ownedByMe: z.ZodOptional<z.ZodBoolean>;
29
+ owners: z.ZodOptional<z.ZodArray<z.ZodObject<{
30
+ displayName: z.ZodOptional<z.ZodString>;
31
+ emailAddress: z.ZodOptional<z.ZodString>;
32
+ photoLink: z.ZodOptional<z.ZodString>;
33
+ me: z.ZodOptional<z.ZodBoolean>;
34
+ permissionId: z.ZodOptional<z.ZodString>;
35
+ }, z.core.$strip>>>;
29
36
  capabilities: z.ZodOptional<z.ZodObject<{
30
37
  canAddChildren: z.ZodOptional<z.ZodBoolean>;
31
38
  canChangeCopyRequiresWriterPermission: z.ZodOptional<z.ZodBoolean>;
@@ -138,6 +145,15 @@ export declare const GoogleDriveFolder: z.ZodObject<{
138
145
  filePath: z.ZodOptional<z.ZodString>;
139
146
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
140
147
  }, z.core.$strip>;
148
+ export declare const GoogleDriveFileContents: z.ZodObject<{
149
+ id: z.ZodString;
150
+ name: z.ZodOptional<z.ZodString>;
151
+ mimeType: z.ZodOptional<z.ZodString>;
152
+ createdTime: z.ZodOptional<z.ZodString>;
153
+ modifiedTime: z.ZodOptional<z.ZodString>;
154
+ webViewLink: z.ZodOptional<z.ZodString>;
155
+ text: z.ZodString;
156
+ }, z.core.$strip>;
141
157
  export declare const GoogleDriveSharedDrive: z.ZodObject<{
142
158
  id: z.ZodString;
143
159
  name: z.ZodOptional<z.ZodString>;
@@ -148,6 +164,7 @@ export declare const GoogleDriveSharedDrive: z.ZodObject<{
148
164
  createdAt: z.ZodOptional<z.ZodCoercedDate<unknown>>;
149
165
  }, z.core.$strip>;
150
166
  export type GoogleDriveFile = z.infer<typeof GoogleDriveFile>;
167
+ export type GoogleDriveFileContents = z.infer<typeof GoogleDriveFileContents>;
151
168
  export type GoogleDriveFolder = z.infer<typeof GoogleDriveFolder>;
152
169
  export type GoogleDriveSharedDrive = z.infer<typeof GoogleDriveSharedDrive>;
153
170
  //# sourceMappingURL=database.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../schema/database.ts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,CAAC;AAC9E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -28,6 +28,13 @@ export declare const GoogleDriveSchema: {
28
28
  modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
29
29
  shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
30
30
  ownedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
31
+ owners: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
32
+ displayName: import("zod").ZodOptional<import("zod").ZodString>;
33
+ emailAddress: import("zod").ZodOptional<import("zod").ZodString>;
34
+ photoLink: import("zod").ZodOptional<import("zod").ZodString>;
35
+ me: import("zod").ZodOptional<import("zod").ZodBoolean>;
36
+ permissionId: import("zod").ZodOptional<import("zod").ZodString>;
37
+ }, import("zod/v4/core").$strip>>>;
31
38
  capabilities: import("zod").ZodOptional<import("zod").ZodObject<{
32
39
  canAddChildren: import("zod").ZodOptional<import("zod").ZodBoolean>;
33
40
  canChangeCopyRequiresWriterPermission: import("zod").ZodOptional<import("zod").ZodBoolean>;
@@ -76,6 +83,15 @@ export declare const GoogleDriveSchema: {
76
83
  filePath: import("zod").ZodOptional<import("zod").ZodString>;
77
84
  createdAt: import("zod").ZodOptional<import("zod").ZodCoercedDate<unknown>>;
78
85
  }, import("zod/v4/core").$strip>;
86
+ readonly fileContents: import("zod").ZodObject<{
87
+ id: import("zod").ZodString;
88
+ name: import("zod").ZodOptional<import("zod").ZodString>;
89
+ mimeType: import("zod").ZodOptional<import("zod").ZodString>;
90
+ createdTime: import("zod").ZodOptional<import("zod").ZodString>;
91
+ modifiedTime: import("zod").ZodOptional<import("zod").ZodString>;
92
+ webViewLink: import("zod").ZodOptional<import("zod").ZodString>;
93
+ text: import("zod").ZodString;
94
+ }, import("zod/v4/core").$strip>;
79
95
  readonly folders: import("zod").ZodObject<{
80
96
  id: import("zod").ZodString;
81
97
  name: import("zod").ZodOptional<import("zod").ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../schema/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOpB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../schema/index.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQpB,CAAC"}
package/dist/types.d.ts CHANGED
@@ -84,6 +84,14 @@ export type FileContentRestriction = {
84
84
  restrictionTime?: string;
85
85
  type?: string;
86
86
  };
87
+ export type User = {
88
+ kind?: string;
89
+ displayName?: string;
90
+ photoLink?: string;
91
+ me?: boolean;
92
+ permissionId?: string;
93
+ emailAddress?: string;
94
+ };
87
95
  export type File = {
88
96
  id?: string;
89
97
  name?: string;
@@ -111,6 +119,7 @@ export type File = {
111
119
  modifiedByMe?: boolean;
112
120
  shared?: boolean;
113
121
  ownedByMe?: boolean;
122
+ owners?: User[];
114
123
  capabilities?: FileCapabilities;
115
124
  viewersCanCopyContent?: boolean;
116
125
  copyRequiresWriterPermission?: boolean;
@@ -141,6 +150,15 @@ export type File = {
141
150
  sha1Checksum?: string;
142
151
  sha256Checksum?: string;
143
152
  };
153
+ export type FileContents = {
154
+ id: string;
155
+ name?: string;
156
+ mimeType?: string;
157
+ createdTime?: string;
158
+ modifiedTime?: string;
159
+ webViewLink?: string;
160
+ text: string;
161
+ };
144
162
  export type FileList = {
145
163
  kind?: string;
146
164
  nextPageToken?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAA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,CA0O5D,CAAC"}
1
+ {"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../webhooks/changes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAySpD,eAAO,MAAM,YAAY,EAAE,mBAAmB,CAAC,cAAc,CA0O5D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corsair-dev/googledrive",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Google drive plugin for Corsair",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",