import type { ApiClient } from "@promobase/sdk-runtime"; import { Cursor } from "@promobase/sdk-runtime"; import { metaPagination } from "../../pagination.ts"; import type { AdVideoFields } from "./ad-video.ts"; export interface VideoListFields { creation_time: string; description: string; id: string; last_modified: string; owner: Record; season_number: number; thumbnail: string; title: string; videos_count: number; } export function videoListNode(client: ApiClient, id: string) { return { __path: id, __brand: undefined as unknown as VideoListFields, get: (opts: { fields: F; params?: Record }) => client.get>(`${id}`, opts), videos: (opts: { fields: F; params?: Record }) => new Cursor>(client, `${id}/videos`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), }; }