@marcfargas/go-easy 0.0.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +90 -0
- package/LICENSE +21 -0
- package/README.md +224 -0
- package/dist/auth-flow.d.ts +50 -0
- package/dist/auth-flow.d.ts.map +1 -0
- package/dist/auth-flow.js +219 -0
- package/dist/auth-flow.js.map +1 -0
- package/dist/auth-server.d.ts +18 -0
- package/dist/auth-server.d.ts.map +1 -0
- package/dist/auth-server.js +327 -0
- package/dist/auth-server.js.map +1 -0
- package/dist/auth-store.d.ts +81 -0
- package/dist/auth-store.d.ts.map +1 -0
- package/dist/auth-store.js +185 -0
- package/dist/auth-store.js.map +1 -0
- package/dist/auth.d.ts +47 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +131 -0
- package/dist/auth.js.map +1 -0
- package/dist/bin/calendar.d.ts +17 -0
- package/dist/bin/calendar.d.ts.map +1 -0
- package/dist/bin/calendar.js +224 -0
- package/dist/bin/calendar.js.map +1 -0
- package/dist/bin/drive.d.ts +18 -0
- package/dist/bin/drive.d.ts.map +1 -0
- package/dist/bin/drive.js +205 -0
- package/dist/bin/drive.js.map +1 -0
- package/dist/bin/easy.d.ts +11 -0
- package/dist/bin/easy.d.ts.map +1 -0
- package/dist/bin/easy.js +140 -0
- package/dist/bin/easy.js.map +1 -0
- package/dist/bin/gmail.d.ts +25 -0
- package/dist/bin/gmail.d.ts.map +1 -0
- package/dist/bin/gmail.js +243 -0
- package/dist/bin/gmail.js.map +1 -0
- package/dist/bin/tasks.d.ts +17 -0
- package/dist/bin/tasks.d.ts.map +1 -0
- package/dist/bin/tasks.js +190 -0
- package/dist/bin/tasks.js.map +1 -0
- package/dist/calendar/helpers.d.ts +35 -0
- package/dist/calendar/helpers.d.ts.map +1 -0
- package/dist/calendar/helpers.js +178 -0
- package/dist/calendar/helpers.js.map +1 -0
- package/dist/calendar/index.d.ts +64 -0
- package/dist/calendar/index.d.ts.map +1 -0
- package/dist/calendar/index.js +210 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/calendar/types.d.ts +191 -0
- package/dist/calendar/types.d.ts.map +1 -0
- package/dist/calendar/types.js +12 -0
- package/dist/calendar/types.js.map +1 -0
- package/dist/drive/helpers.d.ts +22 -0
- package/dist/drive/helpers.d.ts.map +1 -0
- package/dist/drive/helpers.js +85 -0
- package/dist/drive/helpers.js.map +1 -0
- package/dist/drive/index.d.ts +114 -0
- package/dist/drive/index.d.ts.map +1 -0
- package/dist/drive/index.js +418 -0
- package/dist/drive/index.js.map +1 -0
- package/dist/drive/types.d.ts +91 -0
- package/dist/drive/types.d.ts.map +1 -0
- package/dist/drive/types.js +5 -0
- package/dist/drive/types.js.map +1 -0
- package/dist/errors.d.ts +58 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +73 -0
- package/dist/errors.js.map +1 -0
- package/dist/gmail/helpers.d.ts +59 -0
- package/dist/gmail/helpers.d.ts.map +1 -0
- package/dist/gmail/helpers.js +308 -0
- package/dist/gmail/helpers.js.map +1 -0
- package/dist/gmail/index.d.ts +95 -0
- package/dist/gmail/index.d.ts.map +1 -0
- package/dist/gmail/index.js +465 -0
- package/dist/gmail/index.js.map +1 -0
- package/dist/gmail/markdown.d.ts +22 -0
- package/dist/gmail/markdown.d.ts.map +1 -0
- package/dist/gmail/markdown.js +30 -0
- package/dist/gmail/markdown.js.map +1 -0
- package/dist/gmail/types.d.ts +154 -0
- package/dist/gmail/types.d.ts.map +1 -0
- package/dist/gmail/types.js +5 -0
- package/dist/gmail/types.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/safety.d.ts +58 -0
- package/dist/safety.d.ts.map +1 -0
- package/dist/safety.js +61 -0
- package/dist/safety.js.map +1 -0
- package/dist/scopes.d.ts +16 -0
- package/dist/scopes.d.ts.map +1 -0
- package/dist/scopes.js +28 -0
- package/dist/scopes.js.map +1 -0
- package/dist/tasks/helpers.d.ts +10 -0
- package/dist/tasks/helpers.d.ts.map +1 -0
- package/dist/tasks/helpers.js +33 -0
- package/dist/tasks/helpers.js.map +1 -0
- package/dist/tasks/index.d.ts +63 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +253 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/types.d.ts +79 -0
- package/dist/tasks/types.d.ts.map +1 -0
- package/dist/tasks/types.js +5 -0
- package/dist/tasks/types.js.map +1 -0
- package/package.json +73 -4
- package/skills/go-easy/SKILL.md +146 -0
- package/skills/go-easy/calendar.md +366 -0
- package/skills/go-easy/drive.md +309 -0
- package/skills/go-easy/gmail.md +478 -0
- package/skills/go-easy/tasks.md +260 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drive module — list, search, download, upload, share, and manage files.
|
|
3
|
+
*
|
|
4
|
+
* All functions take an OAuth2Client as first argument.
|
|
5
|
+
* Use `getAuth('drive', 'account@email.com')` from the auth module.
|
|
6
|
+
*/
|
|
7
|
+
import { drive } from '@googleapis/drive';
|
|
8
|
+
import { createReadStream } from 'node:fs';
|
|
9
|
+
import { basename } from 'node:path';
|
|
10
|
+
import { guardOperation } from '../safety.js';
|
|
11
|
+
import { NotFoundError, QuotaError, GoEasyError } from '../errors.js';
|
|
12
|
+
import { parseFile, parsePermission, FILE_FIELDS, LIST_FIELDS, exportFormatToMime, isGoogleWorkspaceFile, guessMimeType, } from './helpers.js';
|
|
13
|
+
/** Get a Drive API client instance */
|
|
14
|
+
function driveApi(auth) {
|
|
15
|
+
return drive({ version: 'v3', auth });
|
|
16
|
+
}
|
|
17
|
+
/** Wrap Google API errors into our error types */
|
|
18
|
+
function handleApiError(err, context) {
|
|
19
|
+
if (err instanceof GoEasyError)
|
|
20
|
+
throw err;
|
|
21
|
+
const gErr = err;
|
|
22
|
+
if (gErr.code === 404)
|
|
23
|
+
throw new NotFoundError('file', context, err);
|
|
24
|
+
if (gErr.code === 429)
|
|
25
|
+
throw new QuotaError('drive', err);
|
|
26
|
+
throw new GoEasyError(`Drive ${context}: ${gErr.message ?? 'Unknown error'}`, 'DRIVE_ERROR', err);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* List files in a folder or matching a query.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* // List root folder
|
|
34
|
+
* const files = await listFiles(auth);
|
|
35
|
+
*
|
|
36
|
+
* // List specific folder
|
|
37
|
+
* const files = await listFiles(auth, { folderId: 'folder-id' });
|
|
38
|
+
*
|
|
39
|
+
* // Query by metadata
|
|
40
|
+
* const files = await listFiles(auth, { query: "name contains 'report'" });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export async function listFiles(auth, opts = {}) {
|
|
44
|
+
const drive = driveApi(auth);
|
|
45
|
+
const queryParts = [];
|
|
46
|
+
if (opts.folderId) {
|
|
47
|
+
queryParts.push(`'${opts.folderId}' in parents`);
|
|
48
|
+
}
|
|
49
|
+
if (opts.query) {
|
|
50
|
+
queryParts.push(opts.query);
|
|
51
|
+
}
|
|
52
|
+
if (!opts.includeTrashed) {
|
|
53
|
+
queryParts.push('trashed = false');
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const res = await drive.files.list({
|
|
57
|
+
q: queryParts.length > 0 ? queryParts.join(' and ') : undefined,
|
|
58
|
+
fields: LIST_FIELDS,
|
|
59
|
+
pageSize: opts.maxResults ?? 20,
|
|
60
|
+
pageToken: opts.pageToken,
|
|
61
|
+
orderBy: opts.orderBy ?? 'modifiedTime desc',
|
|
62
|
+
includeItemsFromAllDrives: true,
|
|
63
|
+
supportsAllDrives: true,
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
items: (res.data.files ?? []).map(parseFile),
|
|
67
|
+
nextPageToken: res.data.nextPageToken ?? undefined,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
handleApiError(err, 'listFiles');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Full-text search inside file contents.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const results = await searchFiles(auth, { query: 'quarterly revenue' });
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export async function searchFiles(auth, opts) {
|
|
83
|
+
return listFiles(auth, {
|
|
84
|
+
query: `fullText contains '${opts.query.replace(/'/g, "\\'")}'`,
|
|
85
|
+
maxResults: opts.maxResults,
|
|
86
|
+
pageToken: opts.pageToken,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get a single file's metadata by ID.
|
|
91
|
+
*/
|
|
92
|
+
export async function getFile(auth, fileId) {
|
|
93
|
+
const drive = driveApi(auth);
|
|
94
|
+
try {
|
|
95
|
+
const res = await drive.files.get({
|
|
96
|
+
fileId,
|
|
97
|
+
fields: FILE_FIELDS,
|
|
98
|
+
supportsAllDrives: true,
|
|
99
|
+
});
|
|
100
|
+
return parseFile(res.data);
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
handleApiError(err, fileId);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Download a file's content as a Buffer.
|
|
108
|
+
* For Google Workspace files (Docs, Sheets, Slides), use `exportFile()` instead.
|
|
109
|
+
*/
|
|
110
|
+
export async function downloadFile(auth, fileId) {
|
|
111
|
+
const drive = driveApi(auth);
|
|
112
|
+
// Get metadata first to check type
|
|
113
|
+
const file = await getFile(auth, fileId);
|
|
114
|
+
if (isGoogleWorkspaceFile(file.mimeType)) {
|
|
115
|
+
throw new GoEasyError(`Cannot download Google Workspace file "${file.name}" (${file.mimeType}). Use exportFile() instead.`, 'DRIVE_EXPORT_REQUIRED');
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
const res = await drive.files.get({ fileId, alt: 'media', supportsAllDrives: true }, { responseType: 'arraybuffer' });
|
|
119
|
+
return {
|
|
120
|
+
data: Buffer.from(res.data),
|
|
121
|
+
mimeType: file.mimeType,
|
|
122
|
+
name: file.name,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
126
|
+
handleApiError(err, `download ${fileId}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Export a Google Workspace file (Doc, Sheet, Slides) to a standard format.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* const { data } = await exportFile(auth, 'doc-id', 'pdf');
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
export async function exportFile(auth, fileId, format) {
|
|
138
|
+
const drive = driveApi(auth);
|
|
139
|
+
const file = await getFile(auth, fileId);
|
|
140
|
+
const exportMime = exportFormatToMime(format);
|
|
141
|
+
try {
|
|
142
|
+
const res = await drive.files.export({ fileId, mimeType: exportMime }, { responseType: 'arraybuffer' });
|
|
143
|
+
return {
|
|
144
|
+
data: Buffer.from(res.data),
|
|
145
|
+
mimeType: exportMime,
|
|
146
|
+
name: `${file.name}.${format}`,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
handleApiError(err, `export ${fileId} as ${format}`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Upload a file to Google Drive.
|
|
155
|
+
*
|
|
156
|
+
* WRITE operation — no safety gate (reversible via trash).
|
|
157
|
+
*/
|
|
158
|
+
export async function uploadFile(auth, localPath, opts = {}) {
|
|
159
|
+
const drive = driveApi(auth);
|
|
160
|
+
const fileName = opts.name ?? basename(localPath);
|
|
161
|
+
const mimeType = opts.mimeType ?? guessMimeType(fileName);
|
|
162
|
+
try {
|
|
163
|
+
const res = await drive.files.create({
|
|
164
|
+
requestBody: {
|
|
165
|
+
name: fileName,
|
|
166
|
+
mimeType,
|
|
167
|
+
parents: opts.folderId ? [opts.folderId] : undefined,
|
|
168
|
+
},
|
|
169
|
+
media: {
|
|
170
|
+
mimeType,
|
|
171
|
+
body: createReadStream(localPath),
|
|
172
|
+
},
|
|
173
|
+
fields: 'id, name, webViewLink',
|
|
174
|
+
supportsAllDrives: true,
|
|
175
|
+
});
|
|
176
|
+
return {
|
|
177
|
+
ok: true,
|
|
178
|
+
id: res.data.id ?? '',
|
|
179
|
+
name: res.data.name ?? fileName,
|
|
180
|
+
webViewLink: res.data.webViewLink ?? undefined,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
handleApiError(err, `upload ${fileName}`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Create a folder in Google Drive.
|
|
189
|
+
*
|
|
190
|
+
* WRITE operation — no safety gate.
|
|
191
|
+
*/
|
|
192
|
+
export async function createFolder(auth, name, parentId) {
|
|
193
|
+
const drive = driveApi(auth);
|
|
194
|
+
try {
|
|
195
|
+
const res = await drive.files.create({
|
|
196
|
+
requestBody: {
|
|
197
|
+
name,
|
|
198
|
+
mimeType: 'application/vnd.google-apps.folder',
|
|
199
|
+
parents: parentId ? [parentId] : undefined,
|
|
200
|
+
},
|
|
201
|
+
fields: 'id, name, webViewLink',
|
|
202
|
+
supportsAllDrives: true,
|
|
203
|
+
});
|
|
204
|
+
return {
|
|
205
|
+
ok: true,
|
|
206
|
+
id: res.data.id ?? '',
|
|
207
|
+
name: res.data.name ?? name,
|
|
208
|
+
webViewLink: res.data.webViewLink ?? undefined,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
catch (err) {
|
|
212
|
+
handleApiError(err, `createFolder ${name}`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Move a file to a different folder.
|
|
217
|
+
*
|
|
218
|
+
* WRITE operation — no safety gate (reversible).
|
|
219
|
+
*/
|
|
220
|
+
export async function moveFile(auth, fileId, newParentId) {
|
|
221
|
+
const drive = driveApi(auth);
|
|
222
|
+
// Get current parents to remove
|
|
223
|
+
const file = await getFile(auth, fileId);
|
|
224
|
+
const previousParents = (file.parents ?? []).join(',');
|
|
225
|
+
try {
|
|
226
|
+
const res = await drive.files.update({
|
|
227
|
+
fileId,
|
|
228
|
+
addParents: newParentId,
|
|
229
|
+
removeParents: previousParents,
|
|
230
|
+
fields: 'id, name, webViewLink',
|
|
231
|
+
supportsAllDrives: true,
|
|
232
|
+
});
|
|
233
|
+
return {
|
|
234
|
+
ok: true,
|
|
235
|
+
id: res.data.id ?? '',
|
|
236
|
+
name: res.data.name ?? '',
|
|
237
|
+
webViewLink: res.data.webViewLink ?? undefined,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
catch (err) {
|
|
241
|
+
handleApiError(err, `move ${fileId}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Rename a file.
|
|
246
|
+
*
|
|
247
|
+
* WRITE operation — no safety gate.
|
|
248
|
+
*/
|
|
249
|
+
export async function renameFile(auth, fileId, newName) {
|
|
250
|
+
const drive = driveApi(auth);
|
|
251
|
+
try {
|
|
252
|
+
const res = await drive.files.update({
|
|
253
|
+
fileId,
|
|
254
|
+
requestBody: { name: newName },
|
|
255
|
+
fields: 'id, name, webViewLink',
|
|
256
|
+
supportsAllDrives: true,
|
|
257
|
+
});
|
|
258
|
+
return {
|
|
259
|
+
ok: true,
|
|
260
|
+
id: res.data.id ?? '',
|
|
261
|
+
name: res.data.name ?? newName,
|
|
262
|
+
webViewLink: res.data.webViewLink ?? undefined,
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
catch (err) {
|
|
266
|
+
handleApiError(err, `rename ${fileId}`);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Copy a file.
|
|
271
|
+
*
|
|
272
|
+
* WRITE operation — no safety gate.
|
|
273
|
+
*/
|
|
274
|
+
export async function copyFile(auth, fileId, name, parentId) {
|
|
275
|
+
const drive = driveApi(auth);
|
|
276
|
+
try {
|
|
277
|
+
const res = await drive.files.copy({
|
|
278
|
+
fileId,
|
|
279
|
+
requestBody: {
|
|
280
|
+
name,
|
|
281
|
+
parents: parentId ? [parentId] : undefined,
|
|
282
|
+
},
|
|
283
|
+
fields: 'id, name, webViewLink',
|
|
284
|
+
supportsAllDrives: true,
|
|
285
|
+
});
|
|
286
|
+
return {
|
|
287
|
+
ok: true,
|
|
288
|
+
id: res.data.id ?? '',
|
|
289
|
+
name: res.data.name ?? '',
|
|
290
|
+
webViewLink: res.data.webViewLink ?? undefined,
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
catch (err) {
|
|
294
|
+
handleApiError(err, `copy ${fileId}`);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Trash a file.
|
|
299
|
+
*
|
|
300
|
+
* ⚠️ DESTRUCTIVE — requires safety confirmation.
|
|
301
|
+
*/
|
|
302
|
+
export async function trashFile(auth, fileId) {
|
|
303
|
+
const file = await getFile(auth, fileId);
|
|
304
|
+
await guardOperation({
|
|
305
|
+
name: 'drive.trash',
|
|
306
|
+
level: 'DESTRUCTIVE',
|
|
307
|
+
description: `Trash file "${file.name}" (${fileId})`,
|
|
308
|
+
details: { fileId, name: file.name, mimeType: file.mimeType },
|
|
309
|
+
});
|
|
310
|
+
const drive = driveApi(auth);
|
|
311
|
+
try {
|
|
312
|
+
const res = await drive.files.update({
|
|
313
|
+
fileId,
|
|
314
|
+
requestBody: { trashed: true },
|
|
315
|
+
fields: 'id, name',
|
|
316
|
+
supportsAllDrives: true,
|
|
317
|
+
});
|
|
318
|
+
return {
|
|
319
|
+
ok: true,
|
|
320
|
+
id: res.data.id ?? '',
|
|
321
|
+
name: res.data.name ?? '',
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
catch (err) {
|
|
325
|
+
handleApiError(err, `trash ${fileId}`);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* List permissions on a file.
|
|
330
|
+
*/
|
|
331
|
+
export async function listPermissions(auth, fileId) {
|
|
332
|
+
const drive = driveApi(auth);
|
|
333
|
+
try {
|
|
334
|
+
const res = await drive.permissions.list({
|
|
335
|
+
fileId,
|
|
336
|
+
fields: 'permissions(id, type, role, emailAddress, displayName)',
|
|
337
|
+
supportsAllDrives: true,
|
|
338
|
+
});
|
|
339
|
+
return (res.data.permissions ?? []).map(parsePermission);
|
|
340
|
+
}
|
|
341
|
+
catch (err) {
|
|
342
|
+
handleApiError(err, `listPermissions ${fileId}`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Share a file with a user, group, domain, or anyone.
|
|
347
|
+
*
|
|
348
|
+
* ⚠️ DESTRUCTIVE when sharing with 'anyone' — requires safety confirmation.
|
|
349
|
+
* WRITE for user/group/domain sharing.
|
|
350
|
+
*/
|
|
351
|
+
export async function shareFile(auth, fileId, opts) {
|
|
352
|
+
const file = await getFile(auth, fileId);
|
|
353
|
+
if (opts.type === 'anyone') {
|
|
354
|
+
await guardOperation({
|
|
355
|
+
name: 'drive.share',
|
|
356
|
+
level: 'DESTRUCTIVE',
|
|
357
|
+
description: `Share "${file.name}" publicly (anyone with link, role: ${opts.role})`,
|
|
358
|
+
details: { fileId, name: file.name, type: opts.type, role: opts.role },
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
const drive = driveApi(auth);
|
|
362
|
+
const permission = {
|
|
363
|
+
type: opts.type,
|
|
364
|
+
role: opts.role,
|
|
365
|
+
};
|
|
366
|
+
if (opts.emailAddress)
|
|
367
|
+
permission.emailAddress = opts.emailAddress;
|
|
368
|
+
if (opts.domain)
|
|
369
|
+
permission.domain = opts.domain;
|
|
370
|
+
try {
|
|
371
|
+
const res = await drive.permissions.create({
|
|
372
|
+
fileId,
|
|
373
|
+
requestBody: permission,
|
|
374
|
+
fields: 'id',
|
|
375
|
+
supportsAllDrives: true,
|
|
376
|
+
});
|
|
377
|
+
return {
|
|
378
|
+
ok: true,
|
|
379
|
+
id: res.data.id ?? '',
|
|
380
|
+
name: file.name,
|
|
381
|
+
webViewLink: file.webViewLink ?? undefined,
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
catch (err) {
|
|
385
|
+
handleApiError(err, `share ${fileId}`);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Remove a sharing permission from a file.
|
|
390
|
+
*
|
|
391
|
+
* ⚠️ DESTRUCTIVE — requires safety confirmation.
|
|
392
|
+
*/
|
|
393
|
+
export async function unshareFile(auth, fileId, permissionId) {
|
|
394
|
+
const file = await getFile(auth, fileId);
|
|
395
|
+
await guardOperation({
|
|
396
|
+
name: 'drive.unshare',
|
|
397
|
+
level: 'DESTRUCTIVE',
|
|
398
|
+
description: `Remove permission ${permissionId} from "${file.name}"`,
|
|
399
|
+
details: { fileId, name: file.name, permissionId },
|
|
400
|
+
});
|
|
401
|
+
const drive = driveApi(auth);
|
|
402
|
+
try {
|
|
403
|
+
await drive.permissions.delete({
|
|
404
|
+
fileId,
|
|
405
|
+
permissionId,
|
|
406
|
+
supportsAllDrives: true,
|
|
407
|
+
});
|
|
408
|
+
return {
|
|
409
|
+
ok: true,
|
|
410
|
+
id: permissionId,
|
|
411
|
+
name: file.name,
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
catch (err) {
|
|
415
|
+
handleApiError(err, `unshare ${fileId}`);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/drive/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OA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C;IAE7B,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC;YAC7B,MAAM;YACN,YAAY;YACZ,iBAAiB,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,OAAO;YACL,EAAE,EAAE,IAAI;YACR,EAAE,EAAE,YAAY;YAChB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,cAAc,CAAC,GAAG,EAAE,WAAW,MAAM,EAAE,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drive types — agent-friendly shapes, not raw API types.
|
|
3
|
+
*/
|
|
4
|
+
/** A simplified file/folder */
|
|
5
|
+
export interface DriveFile {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
/** Size in bytes (not present for Google Docs/Sheets/Slides) */
|
|
10
|
+
size?: number;
|
|
11
|
+
createdTime?: string;
|
|
12
|
+
modifiedTime?: string;
|
|
13
|
+
/** Parent folder IDs */
|
|
14
|
+
parents?: string[];
|
|
15
|
+
/** Link to open in browser */
|
|
16
|
+
webViewLink?: string;
|
|
17
|
+
/** Shared Drive ID (if in a Shared Drive) */
|
|
18
|
+
driveId?: string;
|
|
19
|
+
/** Whether the file is shared */
|
|
20
|
+
shared?: boolean;
|
|
21
|
+
/** Whether the file is trashed */
|
|
22
|
+
trashed?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** A sharing permission */
|
|
25
|
+
export interface DrivePermission {
|
|
26
|
+
id: string;
|
|
27
|
+
type: 'user' | 'group' | 'domain' | 'anyone';
|
|
28
|
+
role: 'owner' | 'organizer' | 'fileOrganizer' | 'writer' | 'commenter' | 'reader';
|
|
29
|
+
emailAddress?: string;
|
|
30
|
+
displayName?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Supported export formats for Google Workspace files */
|
|
33
|
+
export type ExportFormat = 'pdf' | 'docx' | 'xlsx' | 'pptx' | 'csv' | 'txt' | 'html';
|
|
34
|
+
/** Options for listing files */
|
|
35
|
+
export interface ListFilesOptions {
|
|
36
|
+
/** Folder ID to list (default: 'root') */
|
|
37
|
+
folderId?: string;
|
|
38
|
+
/** Drive API query filter (metadata search) */
|
|
39
|
+
query?: string;
|
|
40
|
+
/** Maximum results (default: 20) */
|
|
41
|
+
maxResults?: number;
|
|
42
|
+
/** Page token for pagination */
|
|
43
|
+
pageToken?: string;
|
|
44
|
+
/** Include trashed files (default: false) */
|
|
45
|
+
includeTrashed?: boolean;
|
|
46
|
+
/** Order by (e.g. 'modifiedTime desc', 'name') */
|
|
47
|
+
orderBy?: string;
|
|
48
|
+
}
|
|
49
|
+
/** Options for full-text search */
|
|
50
|
+
export interface SearchFilesOptions {
|
|
51
|
+
/** Text to search for inside file contents */
|
|
52
|
+
query: string;
|
|
53
|
+
/** Maximum results (default: 20) */
|
|
54
|
+
maxResults?: number;
|
|
55
|
+
/** Page token for pagination */
|
|
56
|
+
pageToken?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Options for uploading a file */
|
|
59
|
+
export interface UploadOptions {
|
|
60
|
+
/** Parent folder ID (default: root) */
|
|
61
|
+
folderId?: string;
|
|
62
|
+
/** Override filename (default: basename of localPath) */
|
|
63
|
+
name?: string;
|
|
64
|
+
/** MIME type (auto-detected if not provided) */
|
|
65
|
+
mimeType?: string;
|
|
66
|
+
}
|
|
67
|
+
/** Options for sharing a file */
|
|
68
|
+
export interface ShareOptions {
|
|
69
|
+
/** Who to share with */
|
|
70
|
+
type: 'user' | 'group' | 'domain' | 'anyone';
|
|
71
|
+
/** Permission level */
|
|
72
|
+
role: 'reader' | 'commenter' | 'writer';
|
|
73
|
+
/** Email (required for user/group), domain (required for domain) */
|
|
74
|
+
emailAddress?: string;
|
|
75
|
+
/** Domain (required for type 'domain') */
|
|
76
|
+
domain?: string;
|
|
77
|
+
}
|
|
78
|
+
/** Paginated list result */
|
|
79
|
+
export interface ListResult<T> {
|
|
80
|
+
items: T[];
|
|
81
|
+
/** Token for next page, undefined if no more results */
|
|
82
|
+
nextPageToken?: string;
|
|
83
|
+
}
|
|
84
|
+
/** Result of a write operation */
|
|
85
|
+
export interface WriteResult {
|
|
86
|
+
ok: true;
|
|
87
|
+
id: string;
|
|
88
|
+
name?: string;
|
|
89
|
+
webViewLink?: string;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/drive/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,+BAA+B;AAC/B,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wBAAwB;IACxB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,2BAA2B;AAC3B,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC7C,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,eAAe,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CA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W,UAAU,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,IAAI,CAAC;IACT,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/drive/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* go-easy error hierarchy.
|
|
3
|
+
*
|
|
4
|
+
* All errors extend GoEasyError so callers can catch broadly
|
|
5
|
+
* or narrowly as needed.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GoEasyError extends Error {
|
|
8
|
+
readonly code: string;
|
|
9
|
+
readonly cause?: unknown | undefined;
|
|
10
|
+
constructor(message: string, code: string, cause?: unknown | undefined);
|
|
11
|
+
/** Structured JSON for gateway output */
|
|
12
|
+
toJSON(): {
|
|
13
|
+
cause?: string | undefined;
|
|
14
|
+
error: string;
|
|
15
|
+
message: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Auth error codes:
|
|
20
|
+
* AUTH_NO_ACCOUNT — Account not configured at all
|
|
21
|
+
* AUTH_MISSING_SCOPE — Account exists but token lacks required scope
|
|
22
|
+
* AUTH_TOKEN_REVOKED — Refresh token was revoked (Google returned invalid_grant)
|
|
23
|
+
* AUTH_REFRESH_FAILED — Transient network error refreshing token
|
|
24
|
+
* AUTH_STORE_CORRUPT — accounts.json unreadable
|
|
25
|
+
* AUTH_NO_CREDENTIALS — credentials.json missing
|
|
26
|
+
* AUTH_ERROR — Generic (legacy fallback)
|
|
27
|
+
*/
|
|
28
|
+
export type AuthErrorCode = 'AUTH_NO_ACCOUNT' | 'AUTH_MISSING_SCOPE' | 'AUTH_TOKEN_REVOKED' | 'AUTH_REFRESH_FAILED' | 'AUTH_STORE_CORRUPT' | 'AUTH_NO_CREDENTIALS' | 'AUTH_ERROR';
|
|
29
|
+
/** OAuth2 token expired, missing, or invalid */
|
|
30
|
+
export declare class AuthError extends GoEasyError {
|
|
31
|
+
/** Exact CLI command that fixes this error */
|
|
32
|
+
readonly fix?: string;
|
|
33
|
+
constructor(message: string, cause?: unknown);
|
|
34
|
+
constructor(code: AuthErrorCode, opts: {
|
|
35
|
+
message: string;
|
|
36
|
+
fix?: string;
|
|
37
|
+
cause?: unknown;
|
|
38
|
+
});
|
|
39
|
+
toJSON(): {
|
|
40
|
+
fix?: string | undefined;
|
|
41
|
+
cause?: string | undefined;
|
|
42
|
+
error: string;
|
|
43
|
+
message: string;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** Google API returned 404 */
|
|
47
|
+
export declare class NotFoundError extends GoEasyError {
|
|
48
|
+
constructor(resource: string, id: string, cause?: unknown);
|
|
49
|
+
}
|
|
50
|
+
/** Google API quota exceeded (429) */
|
|
51
|
+
export declare class QuotaError extends GoEasyError {
|
|
52
|
+
constructor(service: string, cause?: unknown);
|
|
53
|
+
}
|
|
54
|
+
/** Operation blocked by safety checks */
|
|
55
|
+
export declare class SafetyError extends GoEasyError {
|
|
56
|
+
constructor(operation: string);
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qBAAa,WAAY,SAAQ,KAAK;aAGlB,IAAI,EAAE,MAAM;aACZ,KAAK,CAAC,EAAE,OAAO;gBAF/B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,OAAO,YAAA;IAMjC,yCAAyC;IACzC,MAAM;;;;;CAOP;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,GACpB,qBAAqB,GACrB,oBAAoB,GACpB,qBAAqB,GACrB,YAAY,CAAC;AAEjB,gDAAgD;AAChD,qBAAa,SAAU,SAAQ,WAAW;IACxC,8CAA8C;IAC9C,SAAgB,GAAG,CAAC,EAAE,MAAM,CAAC;gBAEjB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;gBAChC,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;IAsBhF,MAAM;;;;;;CAMhB;AAED,8BAA8B;AAC9B,qBAAa,aAAc,SAAQ,WAAW;gBAChC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAI1D;AAED,sCAAsC;AACtC,qBAAa,UAAW,SAAQ,WAAW;gBAC7B,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAI7C;AAED,yCAAyC;AACzC,qBAAa,WAAY,SAAQ,WAAW;gBAC9B,SAAS,EAAE,MAAM;CAO9B"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* go-easy error hierarchy.
|
|
3
|
+
*
|
|
4
|
+
* All errors extend GoEasyError so callers can catch broadly
|
|
5
|
+
* or narrowly as needed.
|
|
6
|
+
*/
|
|
7
|
+
export class GoEasyError extends Error {
|
|
8
|
+
code;
|
|
9
|
+
cause;
|
|
10
|
+
constructor(message, code, cause) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.code = code;
|
|
13
|
+
this.cause = cause;
|
|
14
|
+
this.name = 'GoEasyError';
|
|
15
|
+
}
|
|
16
|
+
/** Structured JSON for gateway output */
|
|
17
|
+
toJSON() {
|
|
18
|
+
return {
|
|
19
|
+
error: this.code,
|
|
20
|
+
message: this.message,
|
|
21
|
+
...(this.cause instanceof Error ? { cause: this.cause.message } : {}),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** OAuth2 token expired, missing, or invalid */
|
|
26
|
+
export class AuthError extends GoEasyError {
|
|
27
|
+
/** Exact CLI command that fixes this error */
|
|
28
|
+
fix;
|
|
29
|
+
constructor(messageOrCode, causeOrOpts) {
|
|
30
|
+
// Disambiguate: the opts form is a plain object with a `fix` key or
|
|
31
|
+
// is NOT an Error instance. An Error passed as second arg is always the legacy cause form.
|
|
32
|
+
if (typeof causeOrOpts === 'object' &&
|
|
33
|
+
causeOrOpts !== null &&
|
|
34
|
+
!(causeOrOpts instanceof Error) &&
|
|
35
|
+
'message' in causeOrOpts) {
|
|
36
|
+
const opts = causeOrOpts;
|
|
37
|
+
super(opts.message, messageOrCode, opts.cause);
|
|
38
|
+
this.fix = opts.fix;
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
super(messageOrCode, 'AUTH_ERROR', causeOrOpts);
|
|
42
|
+
}
|
|
43
|
+
this.name = 'AuthError';
|
|
44
|
+
}
|
|
45
|
+
toJSON() {
|
|
46
|
+
return {
|
|
47
|
+
...super.toJSON(),
|
|
48
|
+
...(this.fix ? { fix: this.fix } : {}),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Google API returned 404 */
|
|
53
|
+
export class NotFoundError extends GoEasyError {
|
|
54
|
+
constructor(resource, id, cause) {
|
|
55
|
+
super(`${resource} not found: ${id}`, 'NOT_FOUND', cause);
|
|
56
|
+
this.name = 'NotFoundError';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/** Google API quota exceeded (429) */
|
|
60
|
+
export class QuotaError extends GoEasyError {
|
|
61
|
+
constructor(service, cause) {
|
|
62
|
+
super(`Quota exceeded for ${service}`, 'QUOTA_EXCEEDED', cause);
|
|
63
|
+
this.name = 'QuotaError';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Operation blocked by safety checks */
|
|
67
|
+
export class SafetyError extends GoEasyError {
|
|
68
|
+
constructor(operation) {
|
|
69
|
+
super(`Destructive operation "${operation}" blocked — no confirmation provided`, 'SAFETY_BLOCKED');
|
|
70
|
+
this.name = 'SafetyError';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAGlB;IACA;IAHlB,YACE,OAAe,EACC,IAAY,EACZ,KAAe;QAE/B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAQ;QACZ,UAAK,GAAL,KAAK,CAAU;QAG/B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;IAED,yCAAyC;IACzC,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,IAAI;YAChB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,CAAC,IAAI,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtE,CAAC;IACJ,CAAC;CACF;AAqBD,gDAAgD;AAChD,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC,8CAA8C;IAC9B,GAAG,CAAU;IAI7B,YACE,aAAqB,EACrB,WAAqB;QAErB,oEAAoE;QACpE,2FAA2F;QAC3F,IACE,OAAO,WAAW,KAAK,QAAQ;YAC/B,WAAW,KAAK,IAAI;YACpB,CAAC,C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