diff --git a/packages/server-shared/src/reports/reports.types.ts b/packages/server-shared/src/reports/reports.types.ts index aa3171997..4ab5db284 100644 --- a/packages/server-shared/src/reports/reports.types.ts +++ b/packages/server-shared/src/reports/reports.types.ts @@ -1,7 +1,7 @@ import { z } from 'zod'; -import { ReportElementsSchema } from './report-elements'; +import type { ReportElements } from './report-elements'; -const BaseReportSchema = z.object({ +export const ReportSchema = z.object({ id: z.string(), name: z.string(), file_name: z.string(), @@ -11,10 +11,7 @@ const BaseReportSchema = z.object({ updated_at: z.string(), deleted_at: z.string().nullable(), publicly_accessible: z.boolean(), -}); - -export const ReportSchema = BaseReportSchema.extend({ - content: ReportElementsSchema, + content: z.any() as z.ZodType, }); export type Report = z.infer; diff --git a/packages/server-shared/src/reports/requests.ts b/packages/server-shared/src/reports/requests.ts index 912fe3f60..cfd158849 100644 --- a/packages/server-shared/src/reports/requests.ts +++ b/packages/server-shared/src/reports/requests.ts @@ -1,19 +1,16 @@ import { z } from 'zod'; -import { ReportElementsSchema } from './report-elements'; +import type { ReportElements } from './report-elements'; export const GetReportsListRequestSchema = z.object({ page_token: z.number().optional().default(0), page_size: z.number().optional().default(50), }); -const BaseUpdateRequestSchema = z.object({ +export const UpdateReportRequestSchema = z.object({ name: z.string().optional(), description: z.string().optional(), publicly_accessible: z.boolean().optional(), -}); - -export const UpdateReportRequestSchema = BaseUpdateRequestSchema.extend({ - content: ReportElementsSchema.optional(), + content: z.any().optional() as z.ZodOptional>, }); export type GetReportsListRequest = z.infer;