import { google } from 'googleapis'; import { loadAuthorizedOAuthClient } from './src/gmailApi.js'; import { getMailAccount } from './src/mailConfig.js'; async function run() { const account = await getMailAccount('vjoati-gmail'); const auth = await loadAuthorizedOAuthClient({ account }); const gmail = google.gmail({ version: 'v1', auth }); const res = await gmail.users.labels.list({ userId: 'me' }); console.log(JSON.stringify(res.data.labels, null, 2)); } run();