import { z } from "zod";
import {
  toggleCreateSchema,
  toggleUpdateSchema,
  toggleTypeSchema,
  changeOverrideStateBaseSchema,
  overrideListQuerySchema,
  getToggleOverrideQuerySchema,
  featureToggleOverrideResponseSchema,
  overrideRowIdSchema
} from "../data/validators.js";
const featureTogglesTag = "Feature Toggles";
const featureToggleErrorSchema = z.object({
  error: z.string(),
  details: z.any().optional()
}).passthrough();
const featureToggleSchema = z.object({
  id: z.string().uuid(),
  identifier: z.string(),
  name: z.string(),
  description: z.string().nullable().optional(),
  category: z.string().nullable().optional(),
  type: toggleTypeSchema,
  defaultValue: z.any().nullable().optional(),
  createdAt: z.string().nullable().optional(),
  updatedAt: z.string().nullable().optional()
}).passthrough();
const featureToggleListResponseSchema = z.object({
  items: z.array(featureToggleSchema),
  total: z.number().int().nonnegative(),
  page: z.number().int().min(1),
  pageSize: z.number().int().min(1),
  totalPages: z.number().int().min(1)
});
const featureToggleOverrideSchema = 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()
}).passthrough();
const featureToggleOverrideListResponseSchema = z.object({
  items: z.array(featureToggleOverrideSchema),
  total: z.number().int().nonnegative(),
  page: z.number().int().min(1),
  pageSize: z.number().int().min(1),
  totalPages: z.number().int().min(1),
  isSuperAdmin: z.boolean()
});
const changeOverrideStateResponseSchema = z.object({
  ok: z.literal(true),
  overrideToggleId: z.string().uuid().nullable()
});
const checkResponseSchema = z.object({
  enabled: z.boolean(),
  source: z.enum(["override", "default", "fallback", "missing"]),
  toggleId: z.string(),
  identifier: z.string(),
  tenantId: z.string()
}).passthrough();
const checkStringResponseSchema = z.object({
  valueType: z.literal("string"),
  value: z.string(),
  source: z.enum(["override", "default", "fallback", "missing"]),
  toggleId: z.string(),
  identifier: z.string(),
  tenantId: z.string()
}).passthrough();
const checkNumberResponseSchema = z.object({
  valueType: z.literal("number"),
  value: z.number(),
  source: z.enum(["override", "default", "fallback", "missing"]),
  toggleId: z.string(),
  identifier: z.string(),
  tenantId: z.string()
}).passthrough();
const checkJsonResponseSchema = z.object({
  valueType: z.literal("json"),
  value: z.unknown(),
  source: z.enum(["override", "default", "fallback", "missing"]),
  toggleId: z.string(),
  identifier: z.string(),
  tenantId: z.string()
}).passthrough();
export {
  changeOverrideStateBaseSchema,
  changeOverrideStateResponseSchema,
  checkJsonResponseSchema,
  checkNumberResponseSchema,
  checkResponseSchema,
  checkStringResponseSchema,
  featureToggleErrorSchema,
  featureToggleListResponseSchema,
  featureToggleOverrideListResponseSchema,
  featureToggleOverrideResponseSchema,
  featureToggleOverrideSchema,
  featureToggleSchema,
  featureTogglesTag,
  getToggleOverrideQuerySchema,
  overrideListQuerySchema,
  toggleCreateSchema,
  toggleUpdateSchema
};
//# sourceMappingURL=openapi.js.map
