import type { ApiClient } from "@promobase/sdk-runtime"; import { Cursor } from "@promobase/sdk-runtime"; import { metaPagination } from "../../pagination.ts"; import type { PageFields } from "./page.ts"; import type { ProfileFields } from "./profile.ts"; export interface LifeEventFields { description: string; end_time: string; from: PageFields; id: string; is_hidden: boolean; start_time: string; title: string; updated_time: string; } export function lifeEventNode(client: ApiClient, id: string) { return { __path: id, __brand: undefined as unknown as LifeEventFields, get: (opts: { fields: F; params?: Record }) => client.get>(`${id}`, opts), likes: (opts: { fields: F; params?: Record }) => new Cursor>(client, `${id}/likes`, opts as { fields: readonly string[]; params?: Record }, metaPagination()), }; }