export { createAuthEngine, type AuthEngine } from "./engine.ts";
export type { AuthStore } from "./store.ts";
export { MemoryAuthStore } from "./stores/memory.ts";
export { SqlAuthStore } from "./stores/sql.ts";
export {
  authSession,
  requireAuth,
  establishAuthSession,
  clearAuthSession,
  getAuthUser,
  getAuthSession,
  isAuthenticatedContext,
  AUTH_SESSION_KEY,
} from "./middleware.ts";
export {
  createAuthHttpHandlers,
  type AuthHttpOptions,
  type AuthPasskeyHttpOptions,
} from "./http/index.ts";
export {
  authPlugin,
  authComponentsDir,
  type AuthConfig,
  type AuthRoutesConfig,
  type AuthPluginOptions,
  type AuthAuditIssue,
} from "./plugin.ts";
export {
  setDefaultAuthEngine,
  clearDefaultAuthEngine,
  setDefaultAuthSchemas,
  setDefaultAuthRouteOptions,
  tryGetDefaultAuthEngine,
  getDefaultAuthEngine,
  getDefaultAuthSchemas,
  getDefaultAuthRouteOptions,
  hasDefaultAuthEngine,
  type DefaultAuthRouteOptions,
} from "./runtime.ts";
export { createAuthSecretProtector } from "./protector.ts";
export { evaluateAuthRisk, type RiskPolicy } from "./risk.ts";
export {
  normalizeEmail,
  normalizePhone,
  normalizeUsername,
  normalizeIdentity,
  inferIdentityType,
  publicUser,
  safeAuthReturnTo,
} from "./normalize.ts";
export {
  generateTotpSecret,
  generateTotp,
  verifyTotp,
  totpUri,
  encodeBase32,
  decodeBase32,
} from "./totp/index.ts";
export {
  MemoryPasskeyChallengeStore,
  assertPasskeyProvider,
  type PasskeyChallengeStore,
  type PasskeyChallengeRecord,
  type PasskeyChallengeKind,
} from "./passkeys/index.ts";
export * from "./types.ts";

export {
  registerSchema,
  signUpSchema,
  loginSchema,
  verificationRequestSchema,
  verificationTokenSchema,
  passwordResetRequestSchema,
  passwordResetSchema,
  invitationAcceptSchema,
  magicLinkRequestSchema,
  magicLinkConsumeSchema,
  otpLoginRequestSchema,
  otpLoginCompleteSchema,
  otpIssueSchema,
  otpSchema,
  mfaOtpRequestSchema,
  mfaSchema,
  sessionRevokeSchema,
  impersonationStartSchema,
  passkeyRegistrationOptionsSchema,
  passkeyRegistrationVerifySchema,
  passkeyAuthenticationOptionsSchema,
  passkeyAuthenticationVerifySchema,
  authenticatorSetupSchema,
  authenticatorConfirmSchema,
  authenticatorDisableSchema,
  recoveryCodesSchema,
  emptyActionSchema,
  changePasswordSchema,
  authSchemas,
  authBrowserSchemaMap,
  authBrowserSchemaDescriptors,
  resolveAuthSchemas,
  type AuthSchemaSet,
  type AuthSchemaOverrides,
} from "./validation.ts";

export * from "./helpers.ts";
