@corsair-dev/googledrive 0.1.6 → 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/README.md +2 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/endpoints/files.d.ts +51 -0
- package/dist/endpoints/files.d.ts.map +1 -1
- package/dist/endpoints/files.test.d.ts +2 -0
- package/dist/endpoints/files.test.d.ts.map +1 -0
- package/dist/endpoints/index.d.ts +18 -0
- package/dist/endpoints/index.d.ts.map +1 -1
- package/dist/endpoints/types.d.ts +122 -1
- package/dist/endpoints/types.d.ts.map +1 -1
- package/dist/error-handlers.d.ts +21 -0
- package/dist/error-handlers.d.ts.map +1 -0
- package/dist/index.d.ts +129 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/schema/database.d.ts +17 -0
- package/dist/schema/database.d.ts.map +1 -1
- package/dist/schema/index.d.ts +16 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/types.d.ts +18 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/webhooks/changes.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -15,7 +15,8 @@ pnpm add @corsair-dev/googledrive
|
|
|
15
15
|
| `files.copy` | `googledrive.api.files.copy` | `write` | Copy a file in Google Drive |
|
|
16
16
|
| `files.createFromText` | `googledrive.api.files.createFromText` | `write` | Create a new Drive file from text content |
|
|
17
17
|
| `files.delete` | `googledrive.api.files.delete` | `destructive` | Permanently delete a file [DESTRUCTIVE · IRREVERSIBLE] |
|
|
18
|
-
| `files.download` | `googledrive.api.files.download` | `read` | Download the content
|
|
18
|
+
| `files.download` | `googledrive.api.files.download` | `read` | 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. |
|
|
19
|
+
| `files.export` | `googledrive.api.files.export` | `read` | 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. |
|
|
19
20
|
| `files.get` | `googledrive.api.files.get` | `read` | Get metadata for a specific file |
|
|
20
21
|
| `files.list` | `googledrive.api.files.list` | `read` | List files in Google Drive |
|
|
21
22
|
| `files.move` | `googledrive.api.files.move` | `write` | Move a file to a different folder |
|
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: {
|
package/dist/client.d.ts.map
CHANGED
|
@@ -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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
|
|
|
8
8
|
export declare const copy: GoogleDriveEndpoints['filesCopy'];
|
|
9
9
|
export declare const move: GoogleDriveEndpoints['filesMove'];
|
|
10
10
|
export declare const download: GoogleDriveEndpoints['filesDownload'];
|
|
11
|
+
export declare const exportFile: GoogleDriveEndpoints['filesExport'];
|
|
11
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 {};
|
|
12
63
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../endpoints/files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../endpoints/files.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAA6B,oBAAoB,EAAE,MAAM,UAAU,CAAC;AA4BhF,eAAO,MAAM,IAAI,EAAE,oBAAoB,CAAC,WAAW,CAyClD,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,oBAAoB,CAAC,UAAU,CA6BhD,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,oBAAoB,CAAC,qBAAqB,CA0BrE,CAAC;AAEH,eAAO,MAAM,MAAM,EAAE,oBAAoB,CAAC,aAAa,CA4BtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,oBAAoB,CAAC,aAAa,CAqCtD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,oBAAoB,CAAC,aAAa,CA6B1D,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,oBAAoB,CAAC,WAAW,CA2BlD,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,oBAAoB,CAAC,WAAW,CA0BlD,CAAC;AAqEF,eAAO,MAAM,QAAQ,EAAE,oBAAoB,CAAC,eAAe,CAwC1D,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,oBAAoB,CAAC,aAAa,CA8C1D,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,oBAAoB,CAAC,YAAY,CA8BpD,CAAC;AAOF,KAAK,oBAAoB,GAAG;IAC3B,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,MAAM,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAClE,QAAQ,CAAC,EAAE;QAAE,kBAAkB,CAAC,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,GAAG,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACrE,WAAW,CAAC,EAAE;QAAE,qBAAqB,CAAC,EAAE;YAAE,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CACnE,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC5B,SAAS,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,oBAAoB,EAAE,CAAA;KAAE,CAAC;IAClD,eAAe,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,qBAAqB,EAAE,CAAA;KAAE,CAAC;IACxD,KAAK,CAAC,EAAE;QACP,SAAS,CAAC,EAAE;YACX,UAAU,CAAC,EAAE;gBAAE,OAAO,CAAC,EAAE,qBAAqB,EAAE,CAAA;aAAE,EAAE,CAAC;SACrD,EAAE,CAAC;KACJ,CAAC;CACF,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 @@
|
|
|
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;
|
|
@@ -76,6 +78,19 @@ export declare const FilesEndpoints: {
|
|
|
76
78
|
text?: string | undefined;
|
|
77
79
|
filename?: string | undefined;
|
|
78
80
|
contentOmitted?: "not_requested" | "over_limit" | undefined;
|
|
81
|
+
fileId?: string | undefined;
|
|
82
|
+
}>;
|
|
83
|
+
export: (ctx: import("..").GoogleDriveContext, args: {
|
|
84
|
+
fileId: string;
|
|
85
|
+
mimeType?: string | undefined;
|
|
86
|
+
}) => Promise<{
|
|
87
|
+
contentType: string;
|
|
88
|
+
byteLength: number;
|
|
89
|
+
contentBase64?: string | undefined;
|
|
90
|
+
text?: string | undefined;
|
|
91
|
+
filename?: string | undefined;
|
|
92
|
+
contentOmitted?: "not_requested" | "over_limit" | undefined;
|
|
93
|
+
fileId?: string | undefined;
|
|
79
94
|
}>;
|
|
80
95
|
share: (ctx: import("..").GoogleDriveContext, args: {
|
|
81
96
|
fileId: string;
|
|
@@ -92,6 +107,9 @@ export declare const FilesEndpoints: {
|
|
|
92
107
|
moveToNewOwnersRoot?: boolean | undefined;
|
|
93
108
|
transferOwnership?: boolean | undefined;
|
|
94
109
|
}) => Promise<import("..").Permission>;
|
|
110
|
+
exportText: (ctx: import("..").GoogleDriveContext, args: {
|
|
111
|
+
fileId: string;
|
|
112
|
+
}) => Promise<import("..").FileContents>;
|
|
95
113
|
};
|
|
96
114
|
export declare const FoldersEndpoints: {
|
|
97
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
|
|
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;
|
|
@@ -73,6 +75,10 @@ export declare const GoogleDriveEndpointInputSchemas: {
|
|
|
73
75
|
fileId: z.ZodString;
|
|
74
76
|
acknowledgeAbuse: z.ZodOptional<z.ZodBoolean>;
|
|
75
77
|
}, z.core.$strip>;
|
|
78
|
+
readonly filesExport: z.ZodObject<{
|
|
79
|
+
fileId: z.ZodString;
|
|
80
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>;
|
|
76
82
|
readonly filesShare: z.ZodObject<{
|
|
77
83
|
fileId: z.ZodString;
|
|
78
84
|
type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -100,6 +106,9 @@ export declare const GoogleDriveEndpointInputSchemas: {
|
|
|
100
106
|
moveToNewOwnersRoot: z.ZodOptional<z.ZodBoolean>;
|
|
101
107
|
transferOwnership: z.ZodOptional<z.ZodBoolean>;
|
|
102
108
|
}, z.core.$strip>;
|
|
109
|
+
readonly filesExportText: z.ZodObject<{
|
|
110
|
+
fileId: z.ZodString;
|
|
111
|
+
}, z.core.$strip>;
|
|
103
112
|
readonly foldersCreate: z.ZodObject<{
|
|
104
113
|
name: z.ZodString;
|
|
105
114
|
parents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -246,6 +255,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
246
255
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
247
256
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
248
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>>>;
|
|
249
266
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
250
267
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
251
268
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -289,6 +306,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
289
306
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
290
307
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
291
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>>>;
|
|
292
317
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
293
318
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
294
319
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -331,6 +356,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
331
356
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
332
357
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
333
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>>>;
|
|
334
367
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
335
368
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
336
369
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -373,6 +406,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
373
406
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
374
407
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
375
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>>>;
|
|
376
417
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
377
418
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
378
419
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -415,6 +456,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
415
456
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
416
457
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
417
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>>>;
|
|
418
467
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
419
468
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
420
469
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -458,6 +507,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
458
507
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
459
508
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
460
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>>>;
|
|
461
518
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
462
519
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
463
520
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -500,6 +557,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
500
557
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
501
558
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
502
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>>>;
|
|
503
568
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
504
569
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
505
570
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -525,6 +590,19 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
525
590
|
not_requested: "not_requested";
|
|
526
591
|
over_limit: "over_limit";
|
|
527
592
|
}>>;
|
|
593
|
+
fileId: z.ZodOptional<z.ZodString>;
|
|
594
|
+
}, z.core.$strip>;
|
|
595
|
+
readonly filesExport: z.ZodObject<{
|
|
596
|
+
contentBase64: z.ZodOptional<z.ZodString>;
|
|
597
|
+
text: z.ZodOptional<z.ZodString>;
|
|
598
|
+
contentType: z.ZodString;
|
|
599
|
+
byteLength: z.ZodNumber;
|
|
600
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
601
|
+
contentOmitted: z.ZodOptional<z.ZodEnum<{
|
|
602
|
+
not_requested: "not_requested";
|
|
603
|
+
over_limit: "over_limit";
|
|
604
|
+
}>>;
|
|
605
|
+
fileId: z.ZodOptional<z.ZodString>;
|
|
528
606
|
}, z.core.$strip>;
|
|
529
607
|
readonly filesShare: z.ZodObject<{
|
|
530
608
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -555,6 +633,15 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
555
633
|
}>>;
|
|
556
634
|
pendingOwner: z.ZodOptional<z.ZodBoolean>;
|
|
557
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>;
|
|
558
645
|
readonly foldersCreate: z.ZodObject<{
|
|
559
646
|
id: z.ZodOptional<z.ZodString>;
|
|
560
647
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -582,6 +669,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
582
669
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
583
670
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
584
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>>>;
|
|
585
680
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
586
681
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
587
682
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -624,6 +719,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
624
719
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
625
720
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
626
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>>>;
|
|
627
730
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
628
731
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
629
732
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -670,6 +773,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
670
773
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
671
774
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
672
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>>>;
|
|
673
784
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
674
785
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
675
786
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -788,6 +899,14 @@ export declare const GoogleDriveEndpointOutputSchemas: {
|
|
|
788
899
|
modifiedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
789
900
|
shared: z.ZodOptional<z.ZodBoolean>;
|
|
790
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>>>;
|
|
791
910
|
permissionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
792
911
|
hasAugmentedPermissions: z.ZodOptional<z.ZodBoolean>;
|
|
793
912
|
folderColorRgb: z.ZodOptional<z.ZodString>;
|
|
@@ -821,7 +940,9 @@ export type GoogleDriveEndpointOutputs = {
|
|
|
821
940
|
filesCopy: File;
|
|
822
941
|
filesMove: File;
|
|
823
942
|
filesDownload: FileOutput;
|
|
943
|
+
filesExport: FileOutput;
|
|
824
944
|
filesShare: Permission;
|
|
945
|
+
filesExportText: FileContents;
|
|
825
946
|
foldersCreate: File;
|
|
826
947
|
foldersGet: File;
|
|
827
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;
|
|
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,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,MAAM,UAAU,CAAC;AAwPlB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBlC,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;AAuHF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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W,EAAE,QAAQ,CAAC;IACtB,aAAa,EAAE,IAAI,CAAC;IACpB,YAAY,EAAE,UAAU,CAAC;IACzB,kBAAkB,EAAE,WAAW,CAAC;IAChC,eAAe,EAAE,WAAW,CAAC;IAC7B,gBAAgB,EAAE,eAAe,CAAC;IAClC,kBAAkB,EAAE,WAAW,CAAC;IAChC,kBAAkB,EAAE,IAAI,CAAC;IACzB,qBAAqB,EAAE,QAAQ,CAAC;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';
|
|
@@ -14,7 +14,9 @@ export type GoogleDriveEndpoints = {
|
|
|
14
14
|
filesCopy: GoogleDriveEndpoint<'filesCopy'>;
|
|
15
15
|
filesMove: GoogleDriveEndpoint<'filesMove'>;
|
|
16
16
|
filesDownload: GoogleDriveEndpoint<'filesDownload'>;
|
|
17
|
+
filesExport: GoogleDriveEndpoint<'filesExport'>;
|
|
17
18
|
filesShare: GoogleDriveEndpoint<'filesShare'>;
|
|
19
|
+
filesExportText: GoogleDriveEndpoint<'filesExportText'>;
|
|
18
20
|
foldersCreate: GoogleDriveEndpoint<'foldersCreate'>;
|
|
19
21
|
foldersGet: GoogleDriveEndpoint<'foldersGet'>;
|
|
20
22
|
foldersList: GoogleDriveEndpoint<'foldersList'>;
|
|
@@ -45,7 +47,9 @@ declare const googleDriveEndpointsNested: {
|
|
|
45
47
|
readonly copy: GoogleDriveEndpoint<"filesCopy">;
|
|
46
48
|
readonly move: GoogleDriveEndpoint<"filesMove">;
|
|
47
49
|
readonly download: GoogleDriveEndpoint<"filesDownload">;
|
|
50
|
+
readonly export: GoogleDriveEndpoint<"filesExport">;
|
|
48
51
|
readonly share: GoogleDriveEndpoint<"filesShare">;
|
|
52
|
+
readonly exportText: GoogleDriveEndpoint<"filesExportText">;
|
|
49
53
|
};
|
|
50
54
|
readonly folders: {
|
|
51
55
|
readonly create: GoogleDriveEndpoint<"foldersCreate">;
|
|
@@ -83,6 +87,7 @@ export declare const googledriveEndpointSchemas: {
|
|
|
83
87
|
supportsAllDrives: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
84
88
|
supportsTeamDrives: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
85
89
|
teamDriveId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
90
|
+
fields: import("zod").ZodOptional<import("zod").ZodString>;
|
|
86
91
|
}, import("zod/v4/core").$strip>;
|
|
87
92
|
readonly output: import("zod").ZodObject<{
|
|
88
93
|
kind: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -115,6 +120,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
115
120
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
116
121
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
117
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>>>;
|
|
118
131
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
119
132
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
120
133
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -139,6 +152,7 @@ export declare const googledriveEndpointSchemas: {
|
|
|
139
152
|
supportsAllDrives: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
140
153
|
supportsTeamDrives: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
141
154
|
includePermissionsForView: import("zod").ZodOptional<import("zod").ZodString>;
|
|
155
|
+
fields: import("zod").ZodOptional<import("zod").ZodString>;
|
|
142
156
|
}, import("zod/v4/core").$strip>;
|
|
143
157
|
readonly output: import("zod").ZodObject<{
|
|
144
158
|
id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -167,6 +181,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
167
181
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
168
182
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
169
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>>>;
|
|
170
192
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
171
193
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
172
194
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -218,6 +240,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
218
240
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
219
241
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
220
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>>>;
|
|
221
251
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
222
252
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
223
253
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -268,6 +298,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
268
298
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
269
299
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
270
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>>>;
|
|
271
309
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
272
310
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
273
311
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -326,6 +364,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
326
364
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
327
365
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
328
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>>>;
|
|
329
375
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
330
376
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
331
377
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -385,6 +431,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
385
431
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
386
432
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
387
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>>>;
|
|
388
442
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
389
443
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
390
444
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -436,6 +490,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
436
490
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
437
491
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
438
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>>>;
|
|
439
501
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
440
502
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
441
503
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -467,6 +529,25 @@ export declare const googledriveEndpointSchemas: {
|
|
|
467
529
|
not_requested: "not_requested";
|
|
468
530
|
over_limit: "over_limit";
|
|
469
531
|
}>>;
|
|
532
|
+
fileId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
533
|
+
}, import("zod/v4/core").$strip>;
|
|
534
|
+
};
|
|
535
|
+
readonly 'files.export': {
|
|
536
|
+
readonly input: import("zod").ZodObject<{
|
|
537
|
+
fileId: import("zod").ZodString;
|
|
538
|
+
mimeType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
539
|
+
}, import("zod/v4/core").$strip>;
|
|
540
|
+
readonly output: import("zod").ZodObject<{
|
|
541
|
+
contentBase64: import("zod").ZodOptional<import("zod").ZodString>;
|
|
542
|
+
text: import("zod").ZodOptional<import("zod").ZodString>;
|
|
543
|
+
contentType: import("zod").ZodString;
|
|
544
|
+
byteLength: import("zod").ZodNumber;
|
|
545
|
+
filename: import("zod").ZodOptional<import("zod").ZodString>;
|
|
546
|
+
contentOmitted: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
547
|
+
not_requested: "not_requested";
|
|
548
|
+
over_limit: "over_limit";
|
|
549
|
+
}>>;
|
|
550
|
+
fileId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
470
551
|
}, import("zod/v4/core").$strip>;
|
|
471
552
|
};
|
|
472
553
|
readonly 'files.share': {
|
|
@@ -527,6 +608,20 @@ export declare const googledriveEndpointSchemas: {
|
|
|
527
608
|
pendingOwner: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
528
609
|
}, import("zod/v4/core").$strip>;
|
|
529
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
|
+
};
|
|
530
625
|
readonly 'folders.create': {
|
|
531
626
|
readonly input: import("zod").ZodObject<{
|
|
532
627
|
name: import("zod").ZodString;
|
|
@@ -560,6 +655,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
560
655
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
561
656
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
562
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>>>;
|
|
563
666
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
564
667
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
565
668
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -610,6 +713,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
610
713
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
611
714
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
612
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>>>;
|
|
613
724
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
614
725
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
615
726
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -672,6 +783,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
672
783
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
673
784
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
674
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>>>;
|
|
675
794
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
676
795
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
677
796
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -890,6 +1009,14 @@ export declare const googledriveEndpointSchemas: {
|
|
|
890
1009
|
modifiedByMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
891
1010
|
shared: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
892
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>>>;
|
|
893
1020
|
permissionIds: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
894
1021
|
hasAugmentedPermissions: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
895
1022
|
folderColorRgb: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -954,6 +1081,7 @@ export type GoogleDrivePluginOptions = {
|
|
|
954
1081
|
* Overrides use dot-notation paths from the Google Drive endpoint tree — invalid paths are type errors.
|
|
955
1082
|
*/
|
|
956
1083
|
permissions?: PluginPermissionsConfig<typeof googleDriveEndpointsNested>;
|
|
1084
|
+
errorHandlers?: CorsairErrorHandler;
|
|
957
1085
|
};
|
|
958
1086
|
export type GoogleDriveKeyBuilderContext = KeyBuilderContext<GoogleDrivePluginOptions>;
|
|
959
1087
|
declare const defaultAuthType: "oauth_2";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,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BAA2B,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 xo,getOAuthAccessToken as qo}from"corsair/core";import{logEventFromContext as v}from"corsair/core";import{toFileOutput as Me}from"corsair/http";import{request as xe}from"corsair/http";var q=class extends Error{constructor(r,s){super(r);this.code=s;this.name="GoogleDriveAPIError"}},M="https://www.googleapis.com/drive/v3";async function O(t,o,r={}){let{method:s="GET",body:n,query:g,responseType:c}=r;return await xe({BASE:M,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:g,responseType:c})}function qe(t){return t instanceof Error&&"status"in t&&t.status===401}async function l(t,o,r={}){try{return await O(t,o.key,r)}catch(s){if(qe(s)&&o._refreshAuth){let n=await o._refreshAuth();return await O(t,n,r)}throw s}}var V=async(t,o)=>{let r=await l("/files",t,{method:"GET",query:o});if(r.files&&t.db.files)try{for(let s of r.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"),r},Q=async(t,o)=>{let r=await l(`/files/${o.fileId}`,t,{method:"GET",query:o});if(r.id){let s=r.mimeType==="application/vnd.google-apps.folder";try{s&&t.db.folders?await t.db.folders.upsertByEntityId(r.id,{...r,id:r.id,createdAt:new Date}):!s&&t.db.files&&await t.db.files.upsertByEntityId(r.id,{...r,id:r.id,createdAt:new Date})}catch(n){console.warn("Failed to save file to database:",n)}}return await v(t,"googledrive.files.get",{...o},"completed"),r},K=async(t,o)=>{let r=await l("/files",t,{method:"POST",body:{...o},query:{uploadType:"multipart"}});return r.id&&await t.endpoints.files.get({fileId:r.id}),await v(t,"googledrive.files.createFromText",{...o},"completed"),r},H=async(t,o)=>{let r=await l("/files",t,{method:"POST",body:{...o},query:{uploadType:"multipart"}});return r.id&&await t.endpoints.files.get({fileId:r.id}),await v(t,"googledrive.files.upload",{...o},"completed"),r},J=async(t,o)=>{let r=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 r.id&&await t.endpoints.files.get({fileId:r.id}),await v(t,"googledrive.files.update",{...o},"completed"),r},X=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(r){console.warn("Failed to delete file from database:",r)}await v(t,"googledrive.files.delete",{...o},"completed")},Y=async(t,o)=>{let r=await l(`/files/${o.fileId}/copy`,t,{method:"POST",body:{name:o.name,parents:o.parents},query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}});return r.id&&await t.endpoints.files.get({fileId:r.id}),await v(t,"googledrive.files.copy",{...o},"completed"),r},Z=async(t,o)=>{let r=await l(`/files/${o.fileId}`,t,{method:"PATCH",body:{},query:{addParents:o.addParents,removeParents:o.removeParents,supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives}});return r.id&&await t.endpoints.files.get({fileId:r.id}),await v(t,"googledrive.files.move",{...o},"completed"),r},ee=async(t,o)=>{let{bytes:r,contentType:s}=await l(`/files/${o.fileId}`,t,{method:"GET",query:{alt:"media",acknowledgeAbuse:o.acknowledgeAbuse},responseType:"binary"});return await v(t,"googledrive.files.download",{...o},"completed"),Me(r,s)},oe=async(t,o)=>{let r=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"),r};import{logEventFromContext as L}from"corsair/core";var te=async(t,o)=>{let r=await l("/files",t,{method:"POST",body:{name:o.name,mimeType:"application/vnd.google-apps.folder",parents:o.parents,description:o.description}});if(r.id&&t.db.folders)try{await t.db.folders.upsertByEntityId(r.id,{...r,id:r.id,createdAt:new Date})}catch(s){console.warn("Failed to save folder to database:",s)}return await L(t,"googledrive.folders.create",{...o},"completed"),r},ie=async(t,o)=>{let r=await l(`/files/${o.folderId}`,t,{method:"GET",query:{supportsAllDrives:o.supportsAllDrives,supportsTeamDrives:o.supportsTeamDrives,includePermissionsForView:o.includePermissionsForView}});if(r.id&&t.db.folders)try{await t.db.folders.upsertByEntityId(r.id,{...r,id:r.id,createdAt:new Date})}catch(s){console.warn("Failed to save folder to database:",s)}return await L(t,"googledrive.folders.get",{...o},"completed"),r},re=async(t,o)=>{let r=`mimeType='application/vnd.google-apps.folder'${o.q?` and ${o.q}`:""}`,s=await l("/files",t,{method:"GET",query:{q:r,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},se=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(r){console.warn("Failed to delete folder from database:",r)}await L(t,"googledrive.folders.delete",{...o},"completed")},ne=async(t,o)=>{let r=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 L(t,"googledrive.folders.share",{...o},"completed"),r};import{logEventFromContext as We}from"corsair/core";var ae=async(t,o)=>{let r=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(r.files)try{for(let s of r.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 We(t,"googledrive.search.filesAndFolders",{...o},"completed"),r};import{logEventFromContext as R}from"corsair/core";var le=async(t,o)=>{let r=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:r}});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},de=async(t,o)=>{let r=await l(`/drives/${o.driveId}`,t,{method:"GET",query:{useDomainAdminAccess:o.useDomainAdminAccess}});if(r.id&&t.db.sharedDrives)try{await t.db.sharedDrives.upsertByEntityId(r.id,{...r,id:r.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"),r},pe=async(t,o)=>{let r=await l("/drives",t,{method:"GET",query:{pageSize:o.pageSize,pageToken:o.pageToken,q:o.q,useDomainAdminAccess:o.useDomainAdminAccess}});if(r.drives&&t.db.sharedDrives)try{for(let s of r.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"),r},ge=async(t,o)=>{let r=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(r.id&&t.db.sharedDrives)try{await t.db.sharedDrives.upsertByEntityId(r.id,{...r,id:r.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"),r},ce=async(t,o)=>{if(await l(`/drives/${o.driveId}`,t,{method:"DELETE"}),t.db.sharedDrives)try{await t.db.sharedDrives.deleteByEntityId(o.driveId)}catch(r){console.warn("Failed to delete shared drive from database:",r)}await R(t,"googledrive.sharedDrives.delete",{...o},"completed")};import{logEventFromContext as ze}from"corsair/core";var $e="storageQuota",ue=async(t,o)=>{let s=(await l("/about",t,{method:"GET",query:{fields:$e}})).storageQuota;if(!s||Object.keys(s).length===0)throw new q("Google Drive about.get returned no storageQuota",502);return await ze(t,"googledrive.storage.getQuota",{...o},"completed"),s};import{FileOutputSchema as Qe}from"corsair/http";import{z as e}from"zod";var Ke=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()}),He=e.object({fileId:e.string(),acknowledgeAbuse:e.boolean().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),includePermissionsForView:e.string().optional()}),Je=e.object({name:e.string(),content:e.string(),mimeType:e.string().optional(),parents:e.array(e.string()).optional(),description:e.string().optional()}),Xe=e.object({name:e.string(),mimeType:e.string().optional(),parents:e.array(e.string()).optional(),description:e.string().optional()}),Ye=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()}),Ze=e.object({fileId:e.string(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),eo=e.object({fileId:e.string(),name:e.string().optional(),parents:e.array(e.string()).optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),oo=e.object({fileId:e.string(),addParents:e.string().optional(),removeParents:e.string().optional(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),to=e.object({fileId:e.string(),acknowledgeAbuse:e.boolean().optional()}),io=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()}),ro=e.object({name:e.string(),parents:e.array(e.string()).optional(),description:e.string().optional()}),so=e.object({folderId:e.string(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional(),includePermissionsForView:e.string().optional()}),no=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()}),ao=e.object({folderId:e.string(),supportsAllDrives:e.boolean().optional(),supportsTeamDrives:e.boolean().optional()}),lo=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()}),po=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()}),go=e.object({driveId:e.string(),useDomainAdminAccess:e.boolean().optional()}),co=e.object({pageSize:e.number().optional(),pageToken:e.string().optional(),q:e.string().optional(),useDomainAdminAccess:e.boolean().optional()}),uo=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()}),fo=e.object({driveId:e.string()}),ho=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()}),mo=e.object({}),d={filesList:Ke,filesGet:He,filesCreateFromText:Je,filesUpload:Xe,filesUpdate:Ye,filesDelete:Ze,filesCopy:eo,filesMove:oo,filesDownload:to,filesShare:io,foldersCreate:ro,foldersGet:so,foldersList:no,foldersDelete:ao,foldersShare:lo,sharedDrivesCreate:po,sharedDrivesGet:go,sharedDrivesList:co,sharedDrivesUpdate:uo,sharedDrivesDelete:fo,searchFilesAndFolders:ho,storageGetQuota:mo},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()}),fe=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()}),vo=e.object({kind:e.string().optional(),nextPageToken:e.string().optional(),drives:e.array(U).optional()}),Do=e.object({limit:e.string().optional(),usage:e.string(),usageInDrive:e.string(),usageInDriveTrash:e.string()}),p={filesList:_,filesGet:y,filesCreateFromText:y,filesUpload:y,filesUpdate:y,filesDelete:e.void(),filesCopy:y,filesMove:y,filesDownload:Qe,filesShare:fe,foldersCreate:y,foldersGet:y,foldersList:_,foldersDelete:e.void(),foldersShare:fe,sharedDrivesCreate:U,sharedDrivesGet:U,sharedDrivesList:vo,sharedDrivesUpdate:U,sharedDrivesDelete:e.void(),searchFilesAndFolders:_,storageGetQuota:Do};var m={list:V,get:Q,createFromText:K,upload:H,update:J,delete:X,copy:Y,move:Z,download:ee,share:oe},S={create:te,get:ie,list:re,delete:se,share:ne},I={create:le,get:de,list:pe,update:ge,delete:ce},he={filesAndFolders:ae},me={getQuota:ue};import{z as i}from"zod";var ve=i.object({canAddChildren:i.boolean().optional(),canChangeCopyRequiresWriterPermission:i.boolean().optional(),canChangeViewersCanCopyContent:i.boolean().optional(),canComment:i.boolean().optional(),canCopy:i.boolean().optional(),canDelete:i.boolean().optional(),canDeleteChildren:i.boolean().optional(),canDownload:i.boolean().optional(),canEdit:i.boolean().optional(),canListChildren:i.boolean().optional(),canModifyContent:i.boolean().optional(),canModifyContentRestriction:i.boolean().optional(),canMoveChildrenOutOfDrive:i.boolean().optional(),canMoveChildrenOutOfTeamDrive:i.boolean().optional(),canMoveChildrenWithinDrive:i.boolean().optional(),canMoveItemIntoTeamDrive:i.boolean().optional(),canMoveItemOutOfDrive:i.boolean().optional(),canMoveItemWithinDrive:i.boolean().optional(),canReadRevisions:i.boolean().optional(),canReadTeamDrive:i.boolean().optional(),canRemoveChildren:i.boolean().optional(),canRename:i.boolean().optional(),canShare:i.boolean().optional(),canTrash:i.boolean().optional(),canTrashChildren:i.boolean().optional(),canUntrash:i.boolean().optional()}),De=i.object({id:i.string(),name:i.string().optional(),mimeType:i.string().optional(),description:i.string().optional(),starred:i.boolean().optional(),trashed:i.boolean().optional(),explicitlyTrashed:i.boolean().optional(),parents:i.array(i.string()).optional(),properties:i.record(i.string(),i.string()).optional(),appProperties:i.record(i.string(),i.string()).optional(),spaces:i.array(i.string()).optional(),version:i.string().optional(),webViewLink:i.string().optional(),webContentLink:i.string().optional(),iconLink:i.string().optional(),hasThumbnail:i.boolean().optional(),thumbnailLink:i.string().optional(),thumbnailVersion:i.string().optional(),viewedByMe:i.boolean().optional(),viewedByMeTime:i.string().optional(),createdTime:i.string().optional(),modifiedTime:i.string().optional(),modifiedByMeTime:i.string().optional(),modifiedByMe:i.boolean().optional(),shared:i.boolean().optional(),ownedByMe:i.boolean().optional(),capabilities:ve.optional(),viewersCanCopyContent:i.boolean().optional(),copyRequiresWriterPermission:i.boolean().optional(),writersCanShare:i.boolean().optional(),permissionIds:i.array(i.string()).optional(),hasAugmentedPermissions:i.boolean().optional(),folderColorRgb:i.string().optional(),originalFilename:i.string().optional(),fullFileExtension:i.string().optional(),fileExtension:i.string().optional(),md5Checksum:i.string().optional(),size:i.string().optional(),quotaBytesUsed:i.string().optional(),headRevisionId:i.string().optional(),isAppAuthorized:i.boolean().optional(),resourceKey:i.string().optional(),sha1Checksum:i.string().optional(),sha256Checksum:i.string().optional(),filePath:i.string().optional(),createdAt:i.coerce.date().optional()}),ye=i.object({id:i.string(),name:i.string().optional(),mimeType:i.string().optional(),description:i.string().optional(),starred:i.boolean().optional(),trashed:i.boolean().optional(),explicitlyTrashed:i.boolean().optional(),parents:i.array(i.string()).optional(),properties:i.record(i.string(),i.string()).optional(),appProperties:i.record(i.string(),i.string()).optional(),spaces:i.array(i.string()).optional(),version:i.string().optional(),webViewLink:i.string().optional(),webContentLink:i.string().optional(),iconLink:i.string().optional(),hasThumbnail:i.boolean().optional(),thumbnailLink:i.string().optional(),thumbnailVersion:i.string().optional(),viewedByMe:i.boolean().optional(),viewedByMeTime:i.string().optional(),createdTime:i.string().optional(),modifiedTime:i.string().optional(),modifiedByMeTime:i.string().optional(),modifiedByMe:i.boolean().optional(),shared:i.boolean().optional(),ownedByMe:i.boolean().optional(),capabilities:ve.optional(),viewersCanCopyContent:i.boolean().optional(),copyRequiresWriterPermission:i.boolean().optional(),writersCanShare:i.boolean().optional(),permissionIds:i.array(i.string()).optional(),hasAugmentedPermissions:i.boolean().optional(),folderColorRgb:i.string().optional(),filePath:i.string().optional(),createdAt:i.coerce.date().optional()}),be=i.object({id:i.string(),name:i.string().optional(),themeId:i.string().optional(),colorRgb:i.string().optional(),createdTime:i.string().optional(),hidden:i.boolean().optional(),createdAt:i.coerce.date().optional()});var we={version:"1.0.0",entities:{files:De,folders:ye,sharedDrives:be}};import{googleChannelSubscribe as yo}from"corsair/core";async function Ee(t,o){let r=await t.keys.get_access_token();if(!r)return null;let s=await fetch(`${M}/changes/startPageToken`,{headers:{authorization:`Bearer ${r}`},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),yo(t,{webhookUrl:o.webhookUrl,watchUrl:`${M}/changes/watch?pageToken=${encodeURIComponent(n)}`})):null}import{logEventFromContext as ke}from"corsair/core";import{ApiError as j}from"corsair/http";import{z as a}from"zod";var bo=a.object({data:a.string().optional(),attributes:a.record(a.string(),a.string()).optional(),messageId:a.string().optional(),publishTime:a.string().optional()}),Te=a.object({message:bo.optional(),subscription:a.string().optional(),event:a.unknown().optional()}),vt=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"]),Ge=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 r=o.body;if(!r.message?.data)return!1;try{let s=P(r.message.data);return!!s.resourceId&&!!s.resourceUri&&s.resourceUri.includes("/drive/")}catch{return!1}}}var wo=/[?&]pageToken=([^&]+)/,Ce="application/vnd.google-apps.folder",Eo=10,To=["id","name","mimeType","parents","trashed","createdTime","modifiedTime","size","webViewLink","webContentLink","starred","shared","ownedByMe","description","fileExtension","originalFilename"].join(",");function Go(t){return t.match(wo)?.[1]}function ko(t){return t instanceof j?t.status>=500||t.status===429:!0}function Fo(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 Se(t,o){try{return{status:"ok",file:await O(`/files/${o}`,t,{method:"GET",query:{supportsAllDrives:!0,fields:To}})}}catch(r){return r instanceof j&&(r.status===404||r.status===410)?{status:"missing"}:(console.warn(`Failed to fetch file ${o}:`,r),ko(r)?{status:"failed"}:{status:"missing"})}}async function Co(t,o){try{let r=`https://www.googleapis.com/drive/v3/files/${o}?alt=media&supportsAllDrives=true`,s=await fetch(r,{method:"GET",headers:{Authorization:`Bearer ${t}`}});if(!s.ok)return null;let n=await s.arrayBuffer();return Buffer.from(n).toString("base64")}catch(r){return console.warn(`Failed to fetch binary data for file ${o}:`,r),null}}async function So(t,o){return await O("/changes",t,{method:"GET",query:{pageToken:o,pageSize:100,includeRemoved:!0,supportsAllDrives:!0}})}async function Fe(t,o){let r=[],s=new Set,n=o,g;for(let b=0;n&&b<Eo&&!s.has(n);b++){s.add(n);let w=await So(t,n);r.push(...w.changes??[]),g=w.newStartPageToken??g,n=w.nextPageToken}let c=!!(n&&!s.has(n));return{changes:r,resumeToken:c?n:g,truncated:c}}async function Io(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 Po(t,o,r){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&&r&&n!==r?"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 Ao(t,o,r=20){let s=[o.name??""],n=o.parents,g=0;for(;n?.length&&g<r;){let c=n[0];if(!c)break;let h=await Se(t,c);if(h.status!=="ok"||!h.file.name||!h.file.parents?.length)break;s.unshift(h.file.name),n=h.file.parents,g++}return"/"+s.join("/")}function Oo(t,o){return t.removed?"deleted":o.trashed?"trashed":"updated"}async function Lo(t,o,r,s){let n=o.fileId;if(!n)return!0;let g=o.file??{id:n},c=g.mimeType===Ce;try{c?await t.db?.folders?.deleteByEntityId(n):await t.db?.files?.deleteByEntityId(n),g.mimeType||await t.db?.folders?.deleteByEntityId(n)}catch(h){return console.warn(`Failed to delete ${n} from database:`,h),!1}return c?(s.push({folder:g,filePath:"",change:o,changeType:"deleted"}),!0):(r.push({file:g,filePath:"",change:o,changeType:"deleted",binaryData:null}),!0)}var Ie={match:N("driveChanged"),handler:async(t,o)=>{let r=o.payload;if(!r.message?.data)return{success:!1,error:"No message data in notification"};let s=P(r.message.data);if(!s.resourceId||!s.resourceUri)return{success:!1,error:"Invalid push notification format"};let n=t.key,g=Go(s.resourceUri);try{let c=await Io(t),h=c??g;if(!h)return{success:!1,error:"Could not parse pageToken from resource URI"};let b;try{b=await Fe(n,h)}catch(u){if(c&&g&&c!==g&&Fo(u))b=await Fe(n,g);else throw u}let{changes:w,resumeToken:Oe,truncated:Le}=b,A=!1,G="",k=[],F=[];for(let u of w){if(!u.fileId)continue;if(u.removed){await Lo(t,u,k,F)||(A=!0);continue}let D=await Se(n,u.fileId);if(D.status==="failed"){A=!0;continue}if(D.status==="missing")continue;let f=D.file,Be=f.mimeType===Ce,B=await Ao(n,f),$=Oo(u,f);if(Be){if(t.db?.folders&&f.id)try{let T=await t.db.folders.upsertByEntityId(f.id,{...f,id:f.id,filePath:B});!G&&T?.id&&(G=T.id)}catch(T){A=!0,console.warn(`Failed to save folder ${f.id} to database:`,T)}F.push({folder:f,filePath:B,change:u,changeType:$})}else{let T=await Co(n,u.fileId);if(t.db?.files&&f.id)try{let x=await t.db.files.upsertByEntityId(f.id,{...f,id:f.id,filePath:B});!G&&x?.id&&(G=x.id)}catch(x){A=!0,console.warn(`Failed to save file ${f.id} to database:`,x)}k.push({file:f,filePath:B,change:u,changeType:$,binaryData:T})}}if(A)return{success:!1,error:"Failed to apply one or more Drive changes"};let Re=await Po(t,Oe,h);if(Le&&Re==="failed")return{success:!1,error:"Truncated changes feed but could not persist continuation cursor"};if(k.length===0&&F.length===0)return{success:!0,corsairEntityId:"",data:{type:"fileChanged",fileId:s.resourceId??"",changeType:"updated",allFiles:[],allFolders:[]}};let C=F[0],E=k[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:F,allFiles:k.map(D=>({file:D.file,filePath:D.filePath,change:D.change,changeType:D.changeType,binaryData:D.binaryData}))};return await ke(t,"googledrive.webhook.folderChanged",{...u},"completed"),{success:!0,corsairEntityId:G,data:u}}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:k.map(u=>({file:u.file,filePath:u.filePath,change:u.change,changeType:u.changeType,binaryData:u.binaryData})),allFolders:F};return await ke(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 Pe={driveChanged:Ie};import{firstString as Ro,getHeader as Bo}from"corsair/core";function Ae(t){let o=Ro([Bo(t.headers,"x-goog-channel-id")]);return o?{linkType:"channel_id",externalId:o}:null}var Mo={files:{list:m.list,get:m.get,createFromText:m.createFromText,upload:m.upload,update:m.update,delete:m.delete,copy:m.copy,move:m.move,download:m.download,share:m.share},folders:{create:S.create,get:S.get,list:S.list,delete:S.delete,share:S.share},sharedDrives:{create:I.create,get:I.get,list:I.list,update:I.update,delete:I.delete},search:{filesAndFolders:he.filesAndFolders},storage:{getQuota:me.getQuota}},Uo={"files.list":{input:d.filesList,output:p.filesList},"files.get":{input:d.filesGet,output:p.filesGet},"files.createFromText":{input:d.filesCreateFromText,output:p.filesCreateFromText},"files.upload":{input:d.filesUpload,output:p.filesUpload},"files.update":{input:d.filesUpdate,output:p.filesUpdate},"files.delete":{input:d.filesDelete,output:p.filesDelete},"files.copy":{input:d.filesCopy,output:p.filesCopy},"files.move":{input:d.filesMove,output:p.filesMove},"files.download":{input:d.filesDownload,output:p.filesDownload},"files.share":{input:d.filesShare,output:p.filesShare},"folders.create":{input:d.foldersCreate,output:p.foldersCreate},"folders.get":{input:d.foldersGet,output:p.foldersGet},"folders.list":{input:d.foldersList,output:p.foldersList},"folders.delete":{input:d.foldersDelete,output:p.foldersDelete},"folders.share":{input:d.foldersShare,output:p.foldersShare},"sharedDrives.create":{input:d.sharedDrivesCreate,output:p.sharedDrivesCreate},"sharedDrives.get":{input:d.sharedDrivesGet,output:p.sharedDrivesGet},"sharedDrives.list":{input:d.sharedDrivesList,output:p.sharedDrivesList},"sharedDrives.update":{input:d.sharedDrivesUpdate,output:p.sharedDrivesUpdate},"sharedDrives.delete":{input:d.sharedDrivesDelete,output:p.sharedDrivesDelete},"search.filesAndFolders":{input:d.searchFilesAndFolders,output:p.searchFilesAndFolders},"storage.getQuota":{input:d.storageGetQuota,output:p.storageGetQuota}},_o={driveChanged:Pe.driveChanged},Wo={driveChanged:{description:"A file or folder in Google Drive was created, updated, or deleted",payload:Te,response:Ge}},No="oauth_2",jo={"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. A text file comes back as text, any other file as base64, up to about 700 KB; size and type are always returned. Google Docs, Sheets and Slides cannot be downloaded this way."},"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"}},zo={oauth_2:{account:["channel_id","changes_page_token"]}};function qt(t={}){let o={...t,authType:t.authType??No};return{id:"googledrive",authConfig:zo,schema:we,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:Mo,webhooks:_o,endpointMeta:jo,endpointSchemas:Uo,webhookSchemas:Wo,keyBuilder:async r=>{let s=r.authType;if(o.key)return o.key;if(r.authType==="oauth_2")return qo(r,{plugin:"googledrive",tokenUrl:"https://oauth2.googleapis.com/token"});throw new xo("googledrive","oauth_2")},pluginWebhookMatcher:r=>{let s=r.headers;if(!(s.from==="noreply@google.com"||typeof s["user-agent"]=="string"&&s["user-agent"].includes("APIs-Google")))return!1;let g=r.body;if(!g?.message?.data)return!1;try{let c=P(g.message.data);return!!c.resourceUri&&c.resourceUri.includes("drive")}catch{return!1}},pluginTenantWebhookMatcher:Ae,subscribe:Ee}}export{N as createGoogleDriveWebhookMatcher,P as decodePubSubMessage,qt as googledrive,zo as googledriveAuthConfig,Uo 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"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+BxB,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../schema/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA+BxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0D1B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoC5B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;iBAQlC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;iBAQjC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,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"}
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -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":"
|
|
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;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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,CA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B,GAAG;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE;QACd,wBAAwB,CAAC,EAAE,OAAO,CAAC;QACnC,4BAA4B,CAAC,EAAE,OAAO,CAAC;QACvC,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../webhooks/changes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,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.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Google drive plugin for Corsair",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"typescript": "^5.9.3",
|
|
29
29
|
"zod": "^4.1.13",
|
|
30
30
|
"jest": "^29.7.0",
|
|
31
|
-
"corsair": "0.
|
|
31
|
+
"corsair": "0.2.15"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"corsair",
|