import { z } from 'zod';
import { ZPodcastItemLink } from './podcast/links.js';
export var PodcastType;
(function (PodcastType) {
    PodcastType["APPLE_PODCAST"] = "APPLE_PODCAST";
    PodcastType["SPOTIFY"] = "SPOTIFY";
})(PodcastType || (PodcastType = {}));
export var PodcastKey;
(function (PodcastKey) {
    PodcastKey["APPLE"] = "apple";
    PodcastKey["SPOTIFY"] = "spotify";
})(PodcastKey || (PodcastKey = {}));
export var ValidatePodcastEnum;
(function (ValidatePodcastEnum) {
    ValidatePodcastEnum["Success"] = "SUCCESS";
    ValidatePodcastEnum["InvalidApplePodcast"] = "INVALID_APPLE_PODCAST";
    ValidatePodcastEnum["InvalidSpotifyPodcast"] = "INVALID_SPOTIFY_PODCAST";
    ValidatePodcastEnum["DifferentPodcastShow"] = "DIFFERENT_PODCAST_SHOW";
    ValidatePodcastEnum["InvalidQuery"] = "URL_CANT_BE_NULL_OR_EMPTY";
    ValidatePodcastEnum["SomethingWentWrong"] = "SOMETHING_WENT_WRONG";
    ValidatePodcastEnum["SpotifyShowDoNotExists"] = "SPOTIFY_SHOW_DO_NOT_EXISTS";
    ValidatePodcastEnum["DoNotHaveShow"] = "APPLE_AND_SPOTIFY_DO_NOT_HAVE_ANY_SHOW";
    ValidatePodcastEnum["ApplePodcastShowDoNotExists"] = "APPLE_PODCAST_SHOW_DO_NOT_EXISTS";
    ValidatePodcastEnum["AppleConnectFailed"] = "APPLE_PODCAST_CONNECTION_FAILED";
    ValidatePodcastEnum["SpotifyConnectFailed"] = "SPOTIFY_CONNECTION_FAILED";
    ValidatePodcastEnum["DifferentPodcastAuthor"] = "DIFFERENT_PODCAST_AUTHOR";
    ValidatePodcastEnum["DifferentPodcastName"] = "DIFFERENT_PODCAST_NAME";
    ValidatePodcastEnum["DifferentPodcastEpisodes"] = "DIFFERENT_PODCAST_EPISODES";
})(ValidatePodcastEnum || (ValidatePodcastEnum = {}));
export const ZPodcastType = z.nativeEnum(PodcastType);
export const ZPodcastKey = z.nativeEnum(PodcastKey);
export const ZPodcastItem = z.object({
    customUrl: z.string().optional().nullable(),
    id: z.string().uuid().optional(),
    isUpdate: z.boolean().optional().nullable(),
    links: z.array(ZPodcastItemLink).default([]),
    metadata: z.any(),
    moduleId: z.string().optional().nullable(),
    order: z.number().optional(),
    versionId: z.string().optional().nullable(),
    visible: z.boolean().default(true)
});
export const ZPodcastEpisodeLink = z.object({
    preview: z.string().optional(),
    type: ZPodcastType,
    url: z.string()
});
export const ZPodcastEpisode = z.object({
    author: z.string(),
    images: z.array(z.string()),
    show: z.string(),
    title: z.string(),
    urls: z.array(ZPodcastEpisodeLink)
});
export const ZPodcastLinks = z.record(ZPodcastKey, z.string());
export const ZPodcastSyncParams = z.object({
    diverge: z.boolean().optional(),
    index: ZPodcastType.optional(),
    limit: z.number().int().optional(),
    links: ZPodcastLinks.optional()
});
export const ZValidatePodcastLinkBody = z.object({
    links: ZPodcastLinks.optional(),
    numberOfEpisodes: z.number().optional()
});
export const ZValidateUrlPodcast = z.object({
    active: z.boolean(),
    url: z.string()
});
export const ZValidatePodcastBody = z.object({
    apple: ZValidateUrlPodcast.optional(),
    numberOfEpisodes: z.number().optional(),
    spotify: ZValidateUrlPodcast.optional()
});
export var ComparePodcastResult;
(function (ComparePodcastResult) {
    ComparePodcastResult[ComparePodcastResult["SomethingWentWrong"] = 1] = "SomethingWentWrong";
    ComparePodcastResult[ComparePodcastResult["SpotifyDoNotExists"] = 2] = "SpotifyDoNotExists";
    ComparePodcastResult[ComparePodcastResult["AppleDoNotExists"] = 3] = "AppleDoNotExists";
    ComparePodcastResult[ComparePodcastResult["Same"] = 4] = "Same";
    ComparePodcastResult[ComparePodcastResult["Different"] = 5] = "Different";
})(ComparePodcastResult || (ComparePodcastResult = {}));
