import * as v from "valibot" import { notionBlockIdSchema, notionDataSourceIdSchema, notionPageIdSchema, } from "./ids.js" export const notionParentSchema = v.variant("type", [ v.object({ type: v.literal("page_id"), page_id: notionPageIdSchema }), v.object({ type: v.literal("data_source_id"), data_source_id: notionDataSourceIdSchema, }), v.object({ type: v.literal("workspace"), workspace: v.literal(true) }), v.object({ type: v.literal("block_id"), block_id: notionBlockIdSchema }), ]) /** * A record's parent reference. * * Mirrors Notion's public API: * - `page_id` — parented directly under a page. * - `block_id` — parented under a non-page container block (toggle, column, callout, ...). * - `data_source_id` — parented under a collection (data source). * - `workspace` — top-level / team-rooted. */ export type NotionParent = v.InferOutput