import { z } from "zod";
const IDENTIFIER_PATTERN = /^[a-z][a-z0-9_.-]*$/;
const IDENTIFIER_PATTERN_MESSAGE = "identifier must start with a lowercase letter and contain only lowercase letters, numbers, dots, dashes, and underscores";
const toggleTypeSchema = z.enum(["boolean", "string", "number", "json"]);
const toggleCreateSchema = z.object({
  identifier: z.string().min(1).regex(
    IDENTIFIER_PATTERN,
    IDENTIFIER_PATTERN_MESSAGE
  ),
  name: z.string().min(1),
  description: z.string().nullable().optional(),
  category: z.string().nullable().optional(),
  type: toggleTypeSchema,
  defaultValue: z.any().nullable().optional()
});
const toggleCreateSchemaList = z.array(toggleCreateSchema);
const toggleUpdateSchema = z.object({
  id: z.string().uuid()
}).merge(toggleCreateSchema.partial());
const changeOverrideStateBaseSchema = z.object({
  toggleId: z.string().uuid(),
  isOverride: z.boolean(),
  overrideValue: z.any().optional()
});
const processedChangeOverrideStateSchema = changeOverrideStateBaseSchema.extend({
  tenantId: z.string().uuid()
});
const featureToggleOverrideResponseSchema = z.object({
  id: z.string().uuid(),
  value: z.any().optional(),
  tenantName: z.string(),
  tenantId: z.string().uuid(),
  toggleType: toggleTypeSchema,
  updatedAt: z.string().nullable().optional()
});
const featureToggleOverrideWithValueSchema = featureToggleOverrideResponseSchema;
const getToggleOverrideQuerySchema = z.object({
  toggleId: z.string().uuid(),
  tenantId: z.string().uuid().optional()
});
const overrideListQuerySchema = z.object({
  category: z.string().optional(),
  name: z.string().optional(),
  identifier: z.string().optional(),
  sortField: z.enum(["identifier", "name", "category"]).optional(),
  sortDir: z.enum(["asc", "desc"]).optional(),
  page: z.coerce.number().min(1).optional().default(1),
  pageSize: z.coerce.number().min(1).max(100).optional().default(25)
}).passthrough();
const featureToggleSchema = z.object({
  id: z.string().uuid().optional(),
  identifier: z.string().min(1).regex(
    IDENTIFIER_PATTERN,
    IDENTIFIER_PATTERN_MESSAGE
  ),
  name: z.string().min(1),
  description: z.string().nullable().optional(),
  category: z.string().nullable().optional(),
  type: z.enum(["boolean", "string", "number", "json"]),
  defaultValue: z.any().nullable().optional(),
  createdAt: z.string().optional(),
  updatedAt: z.string().optional()
});
const overrideRowIdSchema = z.union([z.string().uuid(), z.literal("")]);
const overrideListResponseSchema = z.object({
  id: overrideRowIdSchema,
  toggleId: z.string().uuid(),
  tenantName: z.string(),
  tenantId: z.string().uuid(),
  identifier: z.string(),
  name: z.string(),
  category: z.string(),
  isOverride: z.boolean(),
  updatedAt: z.string().nullable().optional()
});
export {
  IDENTIFIER_PATTERN,
  IDENTIFIER_PATTERN_MESSAGE,
  changeOverrideStateBaseSchema,
  featureToggleOverrideResponseSchema,
  featureToggleOverrideWithValueSchema,
  featureToggleSchema,
  getToggleOverrideQuerySchema,
  overrideListQuerySchema,
  overrideListResponseSchema,
  overrideRowIdSchema,
  processedChangeOverrideStateSchema,
  toggleCreateSchema,
  toggleCreateSchemaList,
  toggleTypeSchema,
  toggleUpdateSchema
};
//# sourceMappingURL=validators.js.map
