export {
  getUsers,
  getUserById,
  getUserByEmail,
  getUserCount,
  createUser,
  updateUser,
  deleteUser,
  getPasskeysByUserId,
  getPasskeysByUserIdAndOrigin,
  getPasskeyByCredentialId,
  createPasskey,
  updatePasskey,
  storeChallenge,
  consumeChallenge,
  blacklistToken,
  isTokenBlacklisted,
  cleanupExpiredTokens,
} from './queries/auth';

export { readServerSettings, writeServerSettings, readConfigValue, writeConfigValue } from './queries/server-config';

export {
  getUserSettings,
  setUserSettings,
  getUserState,
  patchUserState,
  getDockPaths,
  setDockPaths,
} from './queries/user-data';

export {
  getServerIntegrations,
  getServerIntegration,
  upsertServerIntegration,
  deleteServerIntegration,
  getUserIntegrations,
  getUserIntegration,
  getIntegrationsByProvider,
  upsertUserIntegration,
  deleteUserIntegration,
  findUserByIntegrationConfig,
} from './queries/integrations';

export {
  getEmailAccounts,
  getEmailAccount,
  createEmailAccount,
  deleteEmailAccount,
  updateEmailAccountStatus,
  updateEmailAccountSyncMeta,
  getAllSyncedAccounts,
} from './queries/email-accounts';

export {
  getAllDashboardState,
  upsertDashboard,
  deleteDashboard,
  upsertScreen,
  deleteScreen,
  upsertProject,
  deleteProject,
  getDefaults,
  upsertDefaults,
} from './queries/dashboards';


export {
  createPipelineJob,
  getPipelineJob,
  updatePipelineJob,
  getPipelineJobsForUser,
  getOldestPendingJob,
  countPendingJobs,
  deletePipelineJob,
  deleteTerminalJobsForUser,
  markInterruptedJobs,
} from './queries/pipeline-jobs';

export { appendChatEvent, getChatEventsSince, pruneChatEventsOlderThan } from './queries/chat-events';

export {
  getMusicFavorites,
  addMusicFavorite,
  removeMusicFavorite,
  getNowPlaying,
  setNowPlaying,
  clearNowPlaying,
} from './queries/music';
export type { FavoriteKind, GroupedFavorites, NowPlaying, NowPlayingInput } from './queries/music';

export { db } from './db';
export * as schema from './schema';
