refactor: replace TranscriptEntry interface with PodcastTranscriptEntry type for improved type safety in podcast player

This commit is contained in:
Anish Sarkar 2025-12-21 20:37:30 +05:30
parent 4f2c9caac2
commit bc189a53cf
2 changed files with 11 additions and 12 deletions

View file

@ -1,12 +1,17 @@
import { z } from "zod";
import { paginationQueryParams } from ".";
export const podcastTranscriptEntry = z.object({
speaker_id: z.number(),
dialog: z.string(),
});
export const podcast = z.object({
id: z.number(),
title: z.string(),
created_at: z.string(),
file_location: z.string(),
podcast_transcript: z.array(z.any()),
podcast_transcript: z.array(podcastTranscriptEntry),
search_space_id: z.number(),
chat_state_version: z.number().nullable(),
});
@ -41,6 +46,7 @@ export const getPodcastsRequest = z.object({
queryParams: paginationQueryParams.nullish(),
});
export type PodcastTranscriptEntry = z.infer<typeof podcastTranscriptEntry>;
export type GeneratePodcastRequest = z.infer<typeof generatePodcastRequest>;
export type GetPodcastByChatIdRequest = z.infer<typeof getPodcastByChatIdRequest>;
export type GetPodcastByChatIdResponse = z.infer<typeof getPodcastByChaIdResponse>;