import { z } from "zod";
import {
  dashboardLayoutSchema,
  dashboardLayoutItemPatchSchema,
  dashboardWidgetIdSchema,
  roleWidgetSettingsSchema,
  userWidgetSettingsSchema
} from "../data/validators.js";
const dashboardsTag = "Dashboards";
const dashboardsErrorSchema = z.object({
  error: z.string()
}).passthrough();
const dashboardsOkSchema = z.object({
  ok: z.literal(true)
});
const nullableUuid = z.string().uuid().nullable();
const dashboardWidgetSummarySchema = z.object({
  id: dashboardWidgetIdSchema,
  title: z.string(),
  description: z.string().nullable(),
  defaultSize: z.enum(["sm", "md", "lg"]),
  defaultEnabled: z.boolean(),
  defaultSettings: z.unknown().nullable(),
  features: z.array(z.string()),
  moduleId: z.string(),
  icon: z.string().nullable(),
  loaderKey: z.string(),
  supportsRefresh: z.boolean()
});
const dashboardContextSchema = z.object({
  userId: z.string().uuid(),
  tenantId: nullableUuid,
  organizationId: nullableUuid,
  userName: z.string().nullable(),
  userEmail: z.string().nullable(),
  userLabel: z.string()
});
const dashboardLayoutStateSchema = z.object({
  layout: dashboardLayoutSchema,
  allowedWidgetIds: z.array(dashboardWidgetIdSchema),
  canConfigure: z.boolean(),
  context: dashboardContextSchema,
  widgets: z.array(dashboardWidgetSummarySchema)
});
const dashboardLayoutItemUpdateSchema = dashboardLayoutItemPatchSchema.omit({ id: true });
const dashboardRoleWidgetsResponseSchema = z.object({
  widgetIds: z.array(dashboardWidgetIdSchema),
  hasCustom: z.boolean(),
  scope: z.object({
    tenantId: nullableUuid,
    organizationId: nullableUuid
  })
});
const dashboardRoleWidgetsUpdateResponseSchema = z.object({
  ok: z.literal(true),
  widgetIds: z.array(dashboardWidgetIdSchema)
});
const dashboardUserWidgetsResponseSchema = z.object({
  mode: z.enum(["inherit", "override"]),
  widgetIds: z.array(dashboardWidgetIdSchema),
  hasCustom: z.boolean(),
  effectiveWidgetIds: z.array(dashboardWidgetIdSchema),
  scope: z.object({
    tenantId: nullableUuid,
    organizationId: nullableUuid
  })
});
const dashboardUserWidgetsUpdateResponseSchema = z.object({
  ok: z.literal(true),
  mode: z.enum(["inherit", "override"]),
  widgetIds: z.array(dashboardWidgetIdSchema)
});
const dashboardWidgetCatalogSchema = z.object({
  items: z.array(dashboardWidgetSummarySchema)
});
export {
  dashboardContextSchema,
  dashboardLayoutItemUpdateSchema,
  dashboardLayoutStateSchema,
  roleWidgetSettingsSchema as dashboardRoleWidgetSettingsSchema,
  dashboardRoleWidgetsResponseSchema,
  dashboardRoleWidgetsUpdateResponseSchema,
  userWidgetSettingsSchema as dashboardUserWidgetSettingsSchema,
  dashboardUserWidgetsResponseSchema,
  dashboardUserWidgetsUpdateResponseSchema,
  dashboardWidgetCatalogSchema,
  dashboardWidgetSummarySchema,
  dashboardsErrorSchema,
  dashboardsOkSchema,
  dashboardsTag
};
//# sourceMappingURL=openapi.js.map
