import 'dotenv/config';

import { loadVaultEnvironment } from './vault/env.js';

await loadVaultEnvironment();

export const config = {
  host: process.env.HOST ?? '0.0.0.0',
  port: Number(process.env.PORT ?? '4000'),
  databaseUrl: process.env.DATABASE_URL ?? '',
  hatchetToken: process.env.HATCHET_CLIENT_TOKEN ?? '',
  telegramMiniAppBotToken: process.env.TELEGRAM_MINI_APP_BOT_TOKEN ?? '',
  telegramBotUsername: process.env.TELEGRAM_BOT_USERNAME ?? 'carfteebot',
  telegramWebhookSecret: process.env.TELEGRAM_WEBHOOK_SECRET ?? '',
  googlePlacesApiKey: process.env.GOOGLE_PLACES_API_KEY ?? '',
  deepgramApiKey: process.env.DEEPGRAM_API_KEY ?? '',
  deepgramModel: process.env.DEEPGRAM_MODEL ?? 'nova-3',
  deepgramLanguage: process.env.DEEPGRAM_LANGUAGE ?? 'ru',
  openRouterApiKey: process.env.OPENROUTER_API_KEY ?? '',
  openRouterModel: process.env.OPENROUTER_MODEL ?? 'deepseek/deepseek-v4-flash',
  webAppUrl: process.env.WEB_APP_URL ?? 'https://map.craftee.vn',
  publicApiUrl: process.env.PUBLIC_API_URL ?? 'https://api.map.craftee.vn',
  telegramAuthMaxAgeSeconds: Number(
    process.env.TELEGRAM_AUTH_MAX_AGE_SECONDS ?? '86400',
  ),
  sessionMaxAgeSeconds: Number(process.env.SESSION_MAX_AGE_SECONDS ?? '2592000'),
  botLoginMaxAgeSeconds: Number(process.env.BOT_LOGIN_MAX_AGE_SECONDS ?? '300'),
};
