'use strict';

var v4 = require('zod/v4');

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