// Generated by notion tool-core codegen-script-types --connections. Do not edit. import type { ConnectionActionInvoker } from "./connection-actions.js" /** * Script input for the "Get Google Drive file comments" effect (`googleDrive.getFileComments`), * derived from its Tool Core definition's call_function input projection. * * Load comments from a Google Drive file. */ export type GetFileCommentsScriptInput = { /** * Google Drive file ID. */ fileId: string /** * Optional shared drive IDs that may contain the file being loaded. */ sharedDriveIds?: Array } /** * Canonical Tool Core output for the "Get Google Drive file comments" effect (`googleDrive.getFileComments`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type GetFileCommentsScriptOutput = Array<{ author: string bodyText: string lastEdited: string }> /** * Script input for the "Grep Google Drive files" effect (`googleDrive.grepFiles`), * derived from its Tool Core definition's call_function input projection. * * Search for files in Google Drive. */ export type GrepFilesScriptInput = { /** * Search query for Google Drive title and content. */ query: string /** * Maximum number of results to return. */ maxResults?: number /** * Optional shared drive IDs to scope the search to specific shared drives. */ sharedDriveIds?: Array } /** * Canonical Tool Core output for the "Grep Google Drive files" effect (`googleDrive.grepFiles`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type GrepFilesScriptOutput = Array<{ type: "googleDrive" blocks: Array title: string fileId: string fileType: string timestamp: number comments?: Array<{ author: string bodyText: string lastEdited: string }> }> /** * Script input for the "Load a Google Drive file" effect (`googleDrive.loadFile`), * derived from its Tool Core definition's call_function input projection. * * Load a Google Drive file. */ export type LoadFileScriptInput = { /** * Google Drive file ID. */ fileId: string /** * Optional shared drive IDs that may contain the file being loaded. */ sharedDriveIds?: Array /** * Whether to include comments in the file. Defaults to false unless user requests it. */ includeComments?: boolean } /** * Canonical Tool Core output for the "Load a Google Drive file" effect (`googleDrive.loadFile`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type LoadFileScriptOutput = { title: string fileId: string fileType: string timestamp: number } /** * Script input for the "Load a Google Drive ZIP file" effect (`googleDrive.loadZipFile`), * derived from its Tool Core definition's call_function input projection. * * Load the top-level files and folders in a zip file on Google Drive, including readable text content when available. */ export type LoadZipFileScriptInput = { /** * Google Drive file ID for the zip file. */ fileId: string /** * Optional shared drive IDs to scope listing to specific shared drives. */ sharedDriveIds?: Array } /** * Canonical Tool Core output for the "Load a Google Drive ZIP file" effect (`googleDrive.loadZipFile`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type LoadZipFileScriptOutput = Array<{ blocks: Array title: string path: string fileType: string timestamp: number }> /** * Script input for the "List a Google Drive folder" effect (`googleDrive.lsFolder`), * derived from its Tool Core definition's call_function input projection. * * List files in a Google Drive folder. */ export type LsFolderScriptInput = { /** * Google Drive folder ID. */ folderId: string /** * Optional shared drive IDs to scope listing to specific shared drives. */ sharedDriveIds?: Array } /** * Canonical Tool Core output for the "List a Google Drive folder" effect (`googleDrive.lsFolder`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type LsFolderScriptOutput = Array<{ type: "googleDrive" blocks: Array title: string fileId: string fileType: string timestamp: number comments?: Array<{ author: string bodyText: string lastEdited: string }> }> /** * Script input for the "Search Google Drive" effect (`googleDrive.search`), * derived from its Tool Core definition's call_function input projection. * * Search Google Drive via the configured connector. */ export type SearchScriptInput = { /** * A single, focused question to search for. */ question: string /** * Brief keywords capturing the core entities. */ keywords?: string /** * Optional time window. Use only "default", "all_time", a duration matching /^\d+[dwmy]$/ (for example, "7d", "2w", "3m", or "1y"), or a date in "YYYY-MM-DD" format. Do not use natural-language durations or combine units. */ lookback?: string /** * Optional shared drive IDs to scope search to specific shared drives. */ sharedDriveIds?: Array } /** * Canonical Tool Core output for the "Search Google Drive" effect (`googleDrive.search`). * This is the definition's output schema; the effect's script surface may * re-encode it before returning. */ export type SearchScriptOutput = { results: Array<{ id: string title: string path: string text: string lastEdited: string isPrivate: boolean pageId: string fileType: string }> } export class GoogleDriveConnectionClient { constructor(private readonly invoke: ConnectionActionInvoker) {} getFileComments( args: GetFileCommentsScriptInput, ): Promise { return this.invoke("getFileComments", args) } grepFiles(args: GrepFilesScriptInput): Promise { return this.invoke("grepFiles", args) } loadFile(args: LoadFileScriptInput): Promise { return this.invoke("loadFile", args) } loadZipFile(args: LoadZipFileScriptInput): Promise { return this.invoke("loadZipFile", args) } lsFolder(args: LsFolderScriptInput): Promise { return this.invoke("lsFolder", args) } search(args: SearchScriptInput): Promise { return this.invoke("search", args) } }