diff --git a/surfsense_web/contracts/types/image-generations.types.ts b/surfsense_web/contracts/types/image-generations.types.ts new file mode 100644 index 000000000..d972dad78 --- /dev/null +++ b/surfsense_web/contracts/types/image-generations.types.ts @@ -0,0 +1,27 @@ +import { z } from "zod"; + +// ============================================================================= +// Image generations — mirror app/schemas/image_generation.py. +// ============================================================================= + +export const imageGenerationListItem = z.object({ + id: z.number(), + prompt: z.string(), + search_space_id: z.number(), + created_at: z.string(), + is_success: z.boolean(), + image_count: z.number().nullish(), +}); +export type ImageGenerationListItem = z.infer; + +export const imageGenerationList = z.array(imageGenerationListItem); + +// Detail carries the raw provider response, which holds the displayable image +// as either a hosted url or inline base64. +export const imageGenerationDetail = z.object({ + id: z.number(), + prompt: z.string(), + response_data: z.record(z.string(), z.unknown()).nullish(), + error_message: z.string().nullish(), +}); +export type ImageGenerationDetail = z.infer; diff --git a/surfsense_web/contracts/types/podcast.types.ts b/surfsense_web/contracts/types/podcast.types.ts index 31311c469..c8247a7fe 100644 --- a/surfsense_web/contracts/types/podcast.types.ts +++ b/surfsense_web/contracts/types/podcast.types.ts @@ -155,3 +155,15 @@ export const podcastDetail = z.object({ thread_id: z.number().nullable(), }); export type PodcastDetail = z.infer; + +// Lightweight list item — mirror app/podcasts/api/schemas.py PodcastSummary. +export const podcastSummary = z.object({ + id: z.number(), + title: z.string(), + status: podcastStatus, + created_at: z.string(), + search_space_id: z.number(), +}); +export type PodcastSummary = z.infer; + +export const podcastSummaryList = z.array(podcastSummary); diff --git a/surfsense_web/contracts/types/reports.types.ts b/surfsense_web/contracts/types/reports.types.ts new file mode 100644 index 000000000..25a682084 --- /dev/null +++ b/surfsense_web/contracts/types/reports.types.ts @@ -0,0 +1,24 @@ +import { z } from "zod"; + +// ============================================================================= +// Reports — mirror app/schemas/reports.py ReportRead (list view, no content). +// Resumes are reports with content_type === "typst". +// ============================================================================= + +export const reportMetadata = z + .object({ + status: z.enum(["ready", "failed"]).nullish(), + word_count: z.number().nullish(), + }) + .nullish(); + +export const reportListItem = z.object({ + id: z.number(), + title: z.string(), + content_type: z.string().default("markdown"), + report_metadata: reportMetadata, + created_at: z.string(), +}); +export type ReportListItem = z.infer; + +export const reportList = z.array(reportListItem); diff --git a/surfsense_web/contracts/types/video-presentations.types.ts b/surfsense_web/contracts/types/video-presentations.types.ts new file mode 100644 index 000000000..45b062840 --- /dev/null +++ b/surfsense_web/contracts/types/video-presentations.types.ts @@ -0,0 +1,19 @@ +import { z } from "zod"; + +// ============================================================================= +// Video presentations — mirror app/schemas/video_presentations.py status enum. +// ============================================================================= + +export const videoPresentationStatus = z.enum(["pending", "generating", "ready", "failed"]); +export type VideoPresentationStatus = z.infer; + +export const videoPresentationListItem = z.object({ + id: z.number(), + title: z.string(), + status: videoPresentationStatus.default("ready"), + created_at: z.string(), + search_space_id: z.number(), +}); +export type VideoPresentationListItem = z.infer; + +export const videoPresentationList = z.array(videoPresentationListItem);