import { z } from 'zod';

// src/server/schemas/auth.ts
var ssoConfigSchema = z.object({
  provider: z.string(),
  text: z.string(),
  icon: z.string().optional(),
  url: z.string()
});
var loginConfigSchema = z.object({
  type: z.enum(["sso", "credentials", "both"]),
  sso: ssoConfigSchema.optional(),
  signUpEnabled: z.boolean().optional()
}).nullable();
var publicCapabilitiesSchema = z.object({
  enabled: z.boolean(),
  login: loginConfigSchema
});
var authenticatedUserSchema = z.object({
  id: z.string(),
  email: z.string().optional(),
  name: z.string().optional(),
  avatarUrl: z.string().optional()
});
var capabilityFlagsSchema = z.object({
  user: z.boolean(),
  session: z.boolean(),
  sso: z.boolean(),
  rbac: z.boolean(),
  acl: z.boolean()
});
var userAccessSchema = z.object({
  roles: z.array(z.string()),
  permissions: z.array(z.string())
}).nullable();
var authenticatedCapabilitiesSchema = publicCapabilitiesSchema.extend({
  user: authenticatedUserSchema,
  capabilities: capabilityFlagsSchema,
  access: userAccessSchema
});
var capabilitiesResponseSchema = z.union([authenticatedCapabilitiesSchema, publicCapabilitiesSchema]);
var ssoLoginQuerySchema = z.object({
  redirect_uri: z.string().optional()
});
var ssoCallbackQuerySchema = z.object({
  code: z.string(),
  state: z.string().optional()
});
var ssoLoginResponseSchema = z.object({
  url: z.string()
});
var ssoCallbackResponseSchema = z.object({
  success: z.boolean(),
  user: authenticatedUserSchema.optional(),
  redirectTo: z.string().optional()
});
var logoutResponseSchema = z.object({
  success: z.boolean(),
  redirectTo: z.string().optional()
});
var currentUserResponseSchema = z.object({
  id: z.string(),
  email: z.string().optional(),
  name: z.string().optional(),
  avatarUrl: z.string().optional(),
  roles: z.array(z.string()).optional(),
  permissions: z.array(z.string()).optional()
}).nullable();
var credentialsSignInBodySchema = z.object({
  email: z.string().email(),
  password: z.string().min(1)
});
var credentialsSignUpBodySchema = z.object({
  email: z.string().email(),
  password: z.string().min(1),
  name: z.string().optional()
});
var credentialsResponseSchema = z.object({
  user: authenticatedUserSchema,
  token: z.string().optional()
});

export { authenticatedCapabilitiesSchema, authenticatedUserSchema, capabilitiesResponseSchema, capabilityFlagsSchema, credentialsResponseSchema, credentialsSignInBodySchema, credentialsSignUpBodySchema, currentUserResponseSchema, loginConfigSchema, logoutResponseSchema, publicCapabilitiesSchema, ssoCallbackQuerySchema, ssoCallbackResponseSchema, ssoConfigSchema, ssoLoginQuerySchema, ssoLoginResponseSchema, userAccessSchema };
//# sourceMappingURL=chunk-NLMVQMCR.js.map
//# sourceMappingURL=chunk-NLMVQMCR.js.map