/** * The Drive layer: authenticated clients, queries, exports and uploads. * * Everything that touches `drive_v3` lives here so the rest of the codebase * works with the clean types from `./types.js`. * * The scope gate is NOT in this file — it is inside `AccountClientCache`, which * every function below has to go through to get a client. That is deliberate: * a check placed here would have to be repeated in each new function, and the * one that gets forgotten is the one that matters. */ import { type drive_v3 } from '@googleapis/drive'; import type { AccountId } from '../core/errors.js'; import type { DriveFileContent, DriveFolderListing, DrivePermissionResult, DriveSearchPage, DriveSearchResult, SharedDriveInfo, SharedDrivesResult, DriveUploadResult, ShareRequest, UploadRequest } from './types.js'; /** Resolves an account reference (email or alias) and returns a ready client. */ export declare function driveFor(reference: AccountId): Promise<{ email: AccountId; api: drive_v3.Drive; }>; interface QueryParts { text?: string; raw?: string; includeTrashed?: boolean; } /** Searches one account's Drive. Throws on failure — the caller decides how to react. */ export declare function searchDrive(reference: AccountId, parts: QueryParts, maxResults?: number): Promise; /** * Searches every configured account's Drive in parallel and merges the results. * * `maxResults` is per account, then the merged list is trimmed to the same * number — asking for 20 across three accounts should not return 60. */ export declare function searchAllDrives(parts: QueryParts, maxResults?: number): Promise; /** * Lists the shared drives one account is a member of. * * Separate from every other tool here because a shared drive is not a file: * `files.list` cannot see it at all, so without this there is no path from a * drive's name to the id that `drive_list` and `drive_upload` need. * * Deliberately not passing `useDomainAdminAccess`: that returns every drive in * the domain whether or not the account belongs to it, which answers a * different question than "what can I reach". */ export declare function listSharedDrives(reference: AccountId, maxResults?: number): Promise; /** Same, across every configured account, merged by name. */ export declare function listAllSharedDrives(maxResults?: number): Promise; export declare function listDriveFolder(reference: AccountId, folderId: string, maxResults?: number): Promise; export declare function readDriveFile(reference: AccountId, fileId: string, maxChars?: number): Promise; export declare function uploadToDrive(reference: AccountId, request: UploadRequest): Promise; /** * Creates a real Google Doc, not a text file. * * The trick is asking Drive for a `google-apps.document` while uploading * `text/plain`: Drive converts on the way in. Creating the file and then * writing to it would need the Docs API and a second scope. */ export declare function createGoogleDoc(reference: AccountId, name: string, content: string, parentFolderId?: string): Promise; export declare function shareDriveFile(reference: AccountId, fileId: string, request: ShareRequest): Promise; export {}; //# sourceMappingURL=client.d.ts.map