'use strict';

var zod = require('zod');

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

exports.authenticatedCapabilitiesSchema = authenticatedCapabilitiesSchema;
exports.authenticatedUserSchema = authenticatedUserSchema;
exports.capabilitiesResponseSchema = capabilitiesResponseSchema;
exports.capabilityFlagsSchema = capabilityFlagsSchema;
exports.credentialsResponseSchema = credentialsResponseSchema;
exports.credentialsSignInBodySchema = credentialsSignInBodySchema;
exports.credentialsSignUpBodySchema = credentialsSignUpBodySchema;
exports.currentUserResponseSchema = currentUserResponseSchema;
exports.loginConfigSchema = loginConfigSchema;
exports.logoutResponseSchema = logoutResponseSchema;
exports.publicCapabilitiesSchema = publicCapabilitiesSchema;
exports.ssoCallbackQuerySchema = ssoCallbackQuerySchema;
exports.ssoCallbackResponseSchema = ssoCallbackResponseSchema;
exports.ssoConfigSchema = ssoConfigSchema;
exports.ssoLoginQuerySchema = ssoLoginQuerySchema;
exports.ssoLoginResponseSchema = ssoLoginResponseSchema;
exports.userAccessSchema = userAccessSchema;
//# sourceMappingURL=chunk-574U64WA.cjs.map
//# sourceMappingURL=chunk-574U64WA.cjs.map