'use server'; import { z } from 'zod'; import { AppcondaException } from '../../client'; import { getSDKForCurrentUser } from '../../getSDKForCurrentUser'; import { ListSpreadSheetsSchema, ListWorkbookColumnsSchema, ListWorkbooksSchema } from './schema'; export const ListSpreadSheets = async (parsedInput: z.infer) => { try { const { google } = await getSDKForCurrentUser(); //@ts-ignore const app = await google.ListSpreadSheets(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListWorkbooks = async (parsedInput: z.infer) => { try { const { google } = await getSDKForCurrentUser(); //@ts-ignore const app = await google.ListWorkbooks(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } }; export const ListWorkbookColumns = async (parsedInput: z.infer) => { try { const { google } = await getSDKForCurrentUser(); //@ts-ignore const app = await google.ListWorkbookColumns(parsedInput); return app; } catch (error) { if (error instanceof AppcondaException) { throw new Error(error.message); } throw error; } };