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,
  getPendingJobs,
  countPendingJobs,
  deletePipelineJob,
  deleteTerminalJobsForUser,
  markInterruptedJobs,
} from './queries/pipeline-jobs';

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

export {
  getMusicFavorites,
  addMusicFavorite,
  removeMusicFavorite,
  getNowPlaying,
  setNowPlaying,
  clearNowPlaying,
  getPlaylists,
  getPlaylist,
  createPlaylist,
  renamePlaylist,
  deletePlaylist,
  addPlaylistItems,
  setPlaylistItems,
} from './queries/music';
export type {
  FavoriteKind,
  GroupedFavorites,
  NowPlaying,
  NowPlayingInput,
  PlaylistSummary,
  Playlist,
} from './queries/music';
export { getSoulseekFavorites, addSoulseekFavorite, removeSoulseekFavorite } from './queries/soulseek';
export {
  getVaultTokens,
  setVaultTokens,
  updateVaultAccess,
  clearVaultTokens,
  getVaultUnlockKey,
  setVaultUnlockKey,
  clearVaultUnlockKey,
} from './queries/vault';
export type { VaultTokenSet } from './queries/vault';

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