import type { ApiClient } from "@promobase/sdk-runtime"; import { Cursor } from "@promobase/sdk-runtime"; import { metaPagination } from "../../pagination.ts"; import type { InsightsResultFields } from "./insights-result.ts"; export interface StoriesFields { creation_time: string; media_id: string; media_type: string; post_id: string; status: string; url: string; } export interface StoriesListInsightsParams { metric?: string[]; [key: string]: unknown; } export function storiesNode(client: ApiClient, id: string) { return { __path: id, __brand: undefined as unknown as StoriesFields, get: (opts: { fields: F; params?: Record }) => client.get>(`${id}`, opts), insights: (opts: { fields: F; params?: StoriesListInsightsParams }) => new Cursor>(client, `${id}/insights`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), }; }