import { ProfileLinkTypes } from '@komi-app/meta-profiles';
import { ScrapePlatform, ZAdditionalLink } from './entities.js';
import { z } from 'zod';
export const ZScrapeOption = z.object({
    platform: ScrapePlatform,
    data: z.string()
});
export const ZCreatePreviewLinks = z.object({
    platform: z.union([ScrapePlatform, z.nativeEnum(ProfileLinkTypes)]),
    data: z.string()
});
export const ZPlatformProfile = z.object({
    id: z.string().optional(),
    name: z.string(),
    imageUrl: z.string().optional()
});
export const ZInstagramPost = z.object({
    type: z.literal('post'),
    url: z.string(),
    caption: z.string()
});
export const ZInstagramReel = z.object({
    type: z.literal('reel'),
    url: z.string(),
    caption: z.string()
});
export const ZInstagramProfile = z.object({
    handle: z.string(),
    name: z.string(),
    thumbnailUrl: z.string().optional()
});
export const ZInstagramResult = z.object({
    type: z.literal(ScrapePlatform.Values.instagram),
    profile: ZInstagramProfile.optional(),
    posts: z.array(ZInstagramPost).optional(),
    reels: z.array(ZInstagramReel).optional(),
    links: z.array(z.string()).optional()
});
export const ZSpotifyTrack = z.object({
    type: z.literal('track'),
    id: z.string(),
    imageUrl: z.string(),
    title: z.string(),
    artist: z.string(),
    artistId: z.string(),
    previewUrl: z.string().optional(),
    url: z.string()
});
export const ZSpotifyAlbum = z.object({
    type: z.literal('album'),
    id: z.string(),
    imageUrl: z.string(),
    title: z.string(),
    artist: z.string(),
    artistId: z.string(),
    releaseDate: z.string(),
    url: z.string()
});
export const ZSpotifyPodcast = z.object({
    type: z.literal('podcast'),
    id: z.string(),
    imageUrl: z.string(),
    title: z.string(),
    publisher: z.string(),
    description: z.string(),
    url: z.string()
});
export const ZSpotifyArtistProfile = z.object({
    type: z.literal('artist'),
    id: z.string().optional(),
    name: z.string(),
    imageUrl: z.string().optional(),
    genres: z.array(z.string()),
    followers: z.number()
});
export const ZSpotifyResult = z.object({
    type: z.literal(ScrapePlatform.Values.spotify),
    artist: ZSpotifyArtistProfile.optional(),
    tracks: z.array(ZSpotifyTrack),
    albums: z.array(ZSpotifyAlbum),
    latestReleases: z.array(ZSpotifyTrack).optional(),
    podcasts: z.array(ZSpotifyPodcast)
});
export const ZTikTokVideo = z.object({
    url: z.string(),
    title: z.string()
});
export const ZTiktokProfile = z.object({
    name: z.string(),
    handle: z.string(),
    thumbnailUrl: z.string().optional()
});
export const ZTikTokResult = z.object({
    type: z.literal(ScrapePlatform.Values.tiktok),
    profile: ZTiktokProfile,
    videos: z.array(ZTikTokVideo)
});
export const ZYoutubeVideo = z.object({
    url: z.string(),
    title: z.string(),
    thumbnailUrl: z.string().optional()
});
export const ZYoutubeChannel = z.object({
    id: z.string(),
    name: z.string(),
    imageUrl: z.string().optional(),
    statistics: z.object({
        subscriberCount: z.string(),
        videoCount: z.string(),
        viewCount: z.string()
    })
});
export const ZYoutubeResult = z.object({
    type: z.literal(ScrapePlatform.Values.youtube),
    channel: ZYoutubeChannel.optional(),
    videos: z.array(ZYoutubeVideo)
});
export const ZLinkInBioResult = z.object({
    type: z.literal(ScrapePlatform.Values.link_in_bio),
    links: z.array(ZScrapeOption),
    additionalLinks: z.array(ZAdditionalLink)
});
export const ZPlatformResult = z.discriminatedUnion('type', [
    ZInstagramResult,
    ZSpotifyResult,
    ZTikTokResult,
    ZYoutubeResult,
    ZLinkInBioResult
]);
export class ScrapeAdaptor {
}
