diff --git a/src/lib/googleAuth.ts b/src/lib/googleAuth.ts index 69207ca..43336c3 100644 --- a/src/lib/googleAuth.ts +++ b/src/lib/googleAuth.ts @@ -98,7 +98,7 @@ export const googleSignOut = async (): Promise => { export async function exportApplicationsToGoogleSheets( applications: JobApplication[], accessToken?: string -): Promise<{ spreadsheetId: string; spreadsheetUrl: string }> { +): Promise<{ spreadsheetId: string; spreadsheetUrl: string; isLocalCsv?: boolean; message?: string }> { const token = accessToken || cachedAccessToken; const res = await fetch('/api/workspace/sheets/export', { method: 'POST', @@ -112,7 +112,7 @@ export async function exportApplicationsToGoogleSheets( if (!data.success) { throw new Error(data.error || 'Failed to export applications to Google Sheets'); } - return { spreadsheetId: data.spreadsheetId, spreadsheetUrl: data.spreadsheetUrl }; + return { spreadsheetId: data.spreadsheetId, spreadsheetUrl: data.spreadsheetUrl, isLocalCsv: data.isLocalCsv, message: data.message }; } export async function createTailoredGoogleDoc( @@ -120,7 +120,7 @@ export async function createTailoredGoogleDoc( content: string, docType: 'resume' | 'coverLetter' | 'note', accessToken?: string -): Promise<{ documentId: string; documentUrl: string }> { +): Promise<{ documentId: string; documentUrl: string; isLocalDoc?: boolean; message?: string }> { const token = accessToken || cachedAccessToken; const res = await fetch('/api/workspace/docs/create', { method: 'POST', @@ -134,7 +134,7 @@ export async function createTailoredGoogleDoc( if (!data.success) { throw new Error(data.error || 'Failed to create Google Doc'); } - return { documentId: data.documentId, documentUrl: data.documentUrl }; + return { documentId: data.documentId, documentUrl: data.documentUrl, isLocalDoc: data.isLocalDoc, message: data.message }; } export async function uploadFileToGoogleDrive( @@ -142,7 +142,7 @@ export async function uploadFileToGoogleDrive( fileContent: string, mimeType: string = 'text/plain', accessToken?: string -): Promise<{ fileId: string; driveUrl: string }> { +): Promise<{ fileId: string; driveUrl: string; isLocalFile?: boolean; message?: string }> { const token = accessToken || cachedAccessToken; const res = await fetch('/api/workspace/drive/upload', { method: 'POST', @@ -156,7 +156,7 @@ export async function uploadFileToGoogleDrive( if (!data.success) { throw new Error(data.error || 'Failed to upload file to Google Drive'); } - return { fileId: data.fileId, driveUrl: data.driveUrl }; + return { fileId: data.fileId, driveUrl: data.driveUrl, isLocalFile: data.isLocalFile, message: data.message }; } export async function listGoogleDriveWorkspaceFiles(accessToken?: string): Promise {