import { customAgent } from "./custom-agent.js"; import { database } from "./database.js"; import { date, datetime } from "./date.js"; import { page, type TextValue, type VerificationInput, type VerificationPropertyValue, } from "./page.js"; import { teamspace } from "./teamspace.js"; import { view } from "./view.js"; const notionAsCodeFacade = { teamspace, database, page, customAgent, view, text: (value: string): TextValue => [[value]], number: (value: number): TextValue => [[String(value)]], date, datetime, verification: (value: VerificationInput): VerificationPropertyValue => ({ ...value, type: "verification", }), select: (value: string) => value, status: (value: string) => value, multiSelect: (values: readonly string[]) => values.join(","), checkbox: (value: boolean): TextValue => [[value ? "Yes" : "No"]], url: (value: string): TextValue => [[value, [["a", value]]]], email: (value: string): TextValue => [[value, [["a", `mailto:${value}`]]]], phone: (value: string): TextValue => [[value]], relation: (value: string | readonly string[]) => (Array.isArray(value) ? [...value] : value), }; export type NotionAsCodeFacade = typeof notionAsCodeFacade; /** Create the runtime facade used to declare Notion-as-Code project metadata. */ export function createNotion(): NotionAsCodeFacade { return notionAsCodeFacade; }