[{"data":1,"prerenderedAt":3041},["ShallowReactive",2],{"navigation_docs":3,"-docs-core-working-with-content-http-api-and-client":478,"-docs-core-working-with-content-http-api-and-client-surround":3036},[4,352,446],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Docs",false,"\u002Fdocs\u002Fcore","docs\u002F1.core",[10,35,141,174,195,212,242,318],{"title":11,"icon":6,"path":12,"stem":13,"children":14,"page":6},"Getting Started","\u002Fdocs\u002Fcore\u002Fgetting-started","docs\u002F1.core\u002F1.getting-started",[15,19,23,27,31],{"title":16,"path":17,"stem":18},"Introduction","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fintroduction","docs\u002F1.core\u002F1.getting-started\u002F1.introduction",{"title":20,"path":21,"stem":22},"Quick Start","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fquick-start","docs\u002F1.core\u002F1.getting-started\u002F2.quick-start",{"title":24,"path":25,"stem":26},"Add to an Existing Site","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fexisting-site","docs\u002F1.core\u002F1.getting-started\u002F3.existing-site",{"title":28,"path":29,"stem":30},"Configuration","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fconfiguration","docs\u002F1.core\u002F1.getting-started\u002F4.configuration",{"title":32,"path":33,"stem":34},"How Tenon works","\u002Fdocs\u002Fcore\u002Fgetting-started\u002Fhow-tenon-works","docs\u002F1.core\u002F1.getting-started\u002F5.how-tenon-works",{"title":36,"icon":6,"path":37,"stem":38,"children":39,"page":6},"Content Modeling","\u002Fdocs\u002Fcore\u002Fcontent-modeling","docs\u002F1.core\u002F2.content-modeling",[40,44,111,115,119],{"title":41,"path":42,"stem":43},"Collections and Globals","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fcollections-and-globals","docs\u002F1.core\u002F2.content-modeling\u002F1.collections-and-globals",{"title":45,"icon":6,"path":46,"stem":47,"children":48},"Fields","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002Findex",[49,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107],{"title":50,"path":46,"stem":47},"Overview",{"title":52,"path":53,"stem":54},"Array","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Farray","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F01.array",{"title":56,"path":57,"stem":58},"Blocks","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fblocks","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F02.blocks",{"title":60,"path":61,"stem":62},"Boolean","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fboolean","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F03.boolean",{"title":64,"path":65,"stem":66},"Date","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fdate","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F04.date",{"title":68,"path":69,"stem":70},"File","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ffile","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F05.file",{"title":72,"path":73,"stem":74},"Group","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fgroup","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F06.group",{"title":76,"path":77,"stem":78},"Image","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fimage","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F07.image",{"title":80,"path":81,"stem":82},"Link","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Flink","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F08.link",{"title":84,"path":85,"stem":86},"Number","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fnumber","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F09.number",{"title":88,"path":89,"stem":90},"Relation","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frelation","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F10.relation",{"title":92,"path":93,"stem":94},"Rich text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Frich-text","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F11.rich-text",{"title":96,"path":97,"stem":98},"Select","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fselect","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F12.select",{"title":100,"path":101,"stem":102},"Size","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fsize","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F13.size",{"title":104,"path":105,"stem":106},"Slug","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Fslug","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F14.slug",{"title":108,"path":109,"stem":110},"Text","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Ffields\u002Ftext","docs\u002F1.core\u002F2.content-modeling\u002F2.fields\u002F15.text",{"title":112,"path":113,"stem":114},"Relations","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Frelations","docs\u002F1.core\u002F2.content-modeling\u002F3.relations",{"title":116,"path":117,"stem":118},"Media","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fmedia","docs\u002F1.core\u002F2.content-modeling\u002F4.media",{"title":120,"icon":6,"path":121,"stem":122,"children":123},"Presets","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002Findex",[124,125,129,133,137],{"title":50,"path":121,"stem":122},{"title":126,"path":127,"stem":128},"Menu","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fmenu","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F1.menu",{"title":130,"path":131,"stem":132},"Pages","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fpages","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F2.pages",{"title":134,"path":135,"stem":136},"Settings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fsettings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F3.settings",{"title":138,"path":139,"stem":140},"Strings","\u002Fdocs\u002Fcore\u002Fcontent-modeling\u002Fpresets\u002Fstrings","docs\u002F1.core\u002F2.content-modeling\u002F5.presets\u002F4.strings",{"title":142,"icon":6,"path":143,"stem":144,"children":145,"page":6},"Working with Content","\u002Fdocs\u002Fcore\u002Fworking-with-content","docs\u002F1.core\u002F3.working-with-content",[146,150,154,158,162,166,170],{"title":147,"path":148,"stem":149},"Reading","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Freading","docs\u002F1.core\u002F3.working-with-content\u002F1.reading",{"title":151,"path":152,"stem":153},"Writing and Drafts","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fwriting","docs\u002F1.core\u002F3.working-with-content\u002F2.writing",{"title":155,"path":156,"stem":157},"Scheduled publishing","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fscheduled-publishing","docs\u002F1.core\u002F3.working-with-content\u002F3.scheduled-publishing",{"title":159,"path":160,"stem":161},"HTTP API and Client","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhttp-api-and-client","docs\u002F1.core\u002F3.working-with-content\u002F4.http-api-and-client",{"title":163,"path":164,"stem":165},"Headless","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fheadless","docs\u002F1.core\u002F3.working-with-content\u002F5.headless",{"title":167,"path":168,"stem":169},"Localization","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Flocalization","docs\u002F1.core\u002F3.working-with-content\u002F6.localization",{"title":171,"path":172,"stem":173},"Hooks","\u002Fdocs\u002Fcore\u002Fworking-with-content\u002Fhooks","docs\u002F1.core\u002F3.working-with-content\u002F7.hooks",{"title":175,"icon":6,"path":176,"stem":177,"children":178,"page":6},"Building Your Site","\u002Fdocs\u002Fcore\u002Fbuilding-your-site","docs\u002F1.core\u002F4.building-your-site",[179,183,187,191],{"title":180,"path":181,"stem":182},"Pages and SEO","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fpages-and-seo","docs\u002F1.core\u002F4.building-your-site\u002F1.pages-and-seo",{"title":184,"path":185,"stem":186},"Components","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fcomponents","docs\u002F1.core\u002F4.building-your-site\u002F2.components",{"title":188,"path":189,"stem":190},"Menus","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Fmenus","docs\u002F1.core\u002F4.building-your-site\u002F3.menus",{"title":192,"path":193,"stem":194},"Live Preview","\u002Fdocs\u002Fcore\u002Fbuilding-your-site\u002Flive-preview","docs\u002F1.core\u002F4.building-your-site\u002F4.live-preview",{"title":196,"icon":6,"path":197,"stem":198,"children":199,"page":6},"Users and Access","\u002Fdocs\u002Fcore\u002Fusers-and-access","docs\u002F1.core\u002F5.users-and-access",[200,204,208],{"title":201,"path":202,"stem":203},"Authentication","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fauthentication","docs\u002F1.core\u002F5.users-and-access\u002F1.authentication",{"title":205,"path":206,"stem":207},"Access Control","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Faccess-control","docs\u002F1.core\u002F5.users-and-access\u002F2.access-control",{"title":209,"path":210,"stem":211},"API Keys","\u002Fdocs\u002Fcore\u002Fusers-and-access\u002Fapi-keys","docs\u002F1.core\u002F5.users-and-access\u002F3.api-keys",{"title":213,"icon":6,"path":214,"stem":215,"children":216},"Customization","\u002Fdocs\u002Fcore\u002Fcustomization","docs\u002F1.core\u002F6.customization\u002Findex",[217,218,222,226,230,234,238],{"title":50,"path":214,"stem":215},{"title":219,"path":220,"stem":221},"Admin","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fadmin","docs\u002F1.core\u002F6.customization\u002F1.admin",{"title":223,"path":224,"stem":225},"Custom Fields","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-fields","docs\u002F1.core\u002F6.customization\u002F2.custom-fields",{"title":227,"path":228,"stem":229},"Custom Pages and Actions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fcustom-pages-and-actions","docs\u002F1.core\u002F6.customization\u002F3.custom-pages-and-actions",{"title":231,"path":232,"stem":233},"Styles and UI Libraries","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fstyles-and-ui-libraries","docs\u002F1.core\u002F6.customization\u002F4.styles-and-ui-libraries",{"title":235,"path":236,"stem":237},"Rich Text Extensions","\u002Fdocs\u002Fcore\u002Fcustomization\u002Frich-text-extensions","docs\u002F1.core\u002F6.customization\u002F5.rich-text-extensions",{"title":239,"path":240,"stem":241},"Plugins","\u002Fdocs\u002Fcore\u002Fcustomization\u002Fplugins","docs\u002F1.core\u002F6.customization\u002F6.plugins",{"title":243,"icon":6,"path":244,"stem":245,"children":246},"Operations","\u002Fdocs\u002Fcore\u002Foperations","docs\u002F1.core\u002F7.operations\u002Findex",[247,248,266,288,306,310,314],{"title":50,"path":244,"stem":245},{"title":249,"icon":6,"path":250,"stem":251,"children":252},"Email","\u002Fdocs\u002Fcore\u002Foperations\u002Femail","docs\u002F1.core\u002F7.operations\u002F1.email\u002Findex",[253,254,258,262],{"title":50,"path":250,"stem":251},{"title":255,"path":256,"stem":257},"SMTP","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fsmtp","docs\u002F1.core\u002F7.operations\u002F1.email\u002F1.smtp",{"title":259,"path":260,"stem":261},"Cloudflare","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcloudflare","docs\u002F1.core\u002F7.operations\u002F1.email\u002F2.cloudflare",{"title":263,"path":264,"stem":265},"Custom adapter","\u002Fdocs\u002Fcore\u002Foperations\u002Femail\u002Fcustom-adapter","docs\u002F1.core\u002F7.operations\u002F1.email\u002F3.custom-adapter",{"title":267,"icon":6,"path":268,"stem":269,"children":270},"Jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002Findex",[271,272,276,280,284],{"title":50,"path":268,"stem":269},{"title":273,"path":274,"stem":275},"Queue jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fqueue-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F1.queue-jobs",{"title":277,"path":278,"stem":279},"Recurring jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Frecurring-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F2.recurring-jobs",{"title":281,"path":282,"stem":283},"The clock","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fclock","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F3.clock",{"title":285,"path":286,"stem":287},"Manage jobs","\u002Fdocs\u002Fcore\u002Foperations\u002Fjobs\u002Fmanage-jobs","docs\u002F1.core\u002F7.operations\u002F2.jobs\u002F4.manage-jobs",{"title":289,"icon":6,"path":290,"stem":291,"children":292},"Webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002Findex",[293,294,298,302],{"title":50,"path":290,"stem":291},{"title":295,"path":296,"stem":297},"Send webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Fsend-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F1.send-webhooks",{"title":299,"path":300,"stem":301},"Receive webhooks","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Freceive-webhooks","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F2.receive-webhooks",{"title":303,"path":304,"stem":305},"Rebuild on publish","\u002Fdocs\u002Fcore\u002Foperations\u002Fwebhooks\u002Frebuild-on-publish","docs\u002F1.core\u002F7.operations\u002F3.webhooks\u002F3.rebuild-on-publish",{"title":307,"path":308,"stem":309},"Backup and Restore","\u002Fdocs\u002Fcore\u002Foperations\u002Fbackup-and-restore","docs\u002F1.core\u002F7.operations\u002F4.backup-and-restore",{"title":311,"path":312,"stem":313},"Lifecycle Hooks","\u002Fdocs\u002Fcore\u002Foperations\u002Flifecycle-hooks","docs\u002F1.core\u002F7.operations\u002F5.lifecycle-hooks",{"title":315,"path":316,"stem":317},"Upgrades and Schema Changes","\u002Fdocs\u002Fcore\u002Foperations\u002Fupgrades-and-schema-changes","docs\u002F1.core\u002F7.operations\u002F6.upgrades-and-schema-changes",{"title":319,"icon":6,"path":320,"stem":321,"children":322,"page":6},"Reference","\u002Fdocs\u002Fcore\u002Freference","docs\u002F1.core\u002F8.reference",[323,326,344,348],{"title":28,"path":324,"stem":325},"\u002Fdocs\u002Fcore\u002Freference\u002Fconfiguration","docs\u002F1.core\u002F8.reference\u002F1.configuration",{"title":327,"icon":6,"path":328,"stem":329,"children":330},"API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi","docs\u002F1.core\u002F8.reference\u002F2.api\u002Findex",[331,332,336,340],{"title":50,"path":328,"stem":329},{"title":333,"path":334,"stem":335},"Local API","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Flocal-api","docs\u002F1.core\u002F8.reference\u002F2.api\u002F1.local-api",{"title":337,"path":338,"stem":339},"Client","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fclient","docs\u002F1.core\u002F8.reference\u002F2.api\u002F2.client",{"title":341,"path":342,"stem":343},"HTTP routes","\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fhttp-routes","docs\u002F1.core\u002F8.reference\u002F2.api\u002F3.http-routes",{"title":345,"path":346,"stem":347},"Errors and types","\u002Fdocs\u002Fcore\u002Freference\u002Ferrors-and-types","docs\u002F1.core\u002F8.reference\u002F3.errors-and-types",{"title":349,"path":350,"stem":351},"Package exports","\u002Fdocs\u002Fcore\u002Freference\u002Fpackage-exports","docs\u002F1.core\u002F8.reference\u002F4.package-exports",{"title":353,"icon":6,"path":354,"stem":355,"children":356,"page":6},"Guide","\u002Fdocs\u002Fguide","docs\u002F2.guide",[357,383,400,417],{"title":358,"icon":6,"path":359,"stem":360,"children":361},"Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks","docs\u002F2.guide\u002F1.frameworks\u002Findex",[362,363,367,371,375,379],{"title":50,"path":359,"stem":360},{"title":364,"path":365,"stem":366},"Astro","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fastro","docs\u002F2.guide\u002F1.frameworks\u002F1.astro",{"title":368,"path":369,"stem":370},"Nuxt","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fnuxt","docs\u002F2.guide\u002F1.frameworks\u002F2.nuxt",{"title":372,"path":373,"stem":374},"TanStack Start","\u002Fdocs\u002Fguide\u002Fframeworks\u002Ftanstack-start","docs\u002F2.guide\u002F1.frameworks\u002F3.tanstack-start",{"title":376,"path":377,"stem":378},"Standalone","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fstandalone","docs\u002F2.guide\u002F1.frameworks\u002F4.standalone",{"title":380,"path":381,"stem":382},"Other Frameworks","\u002Fdocs\u002Fguide\u002Fframeworks\u002Fother-frameworks","docs\u002F2.guide\u002F1.frameworks\u002F5.other-frameworks",{"title":384,"icon":6,"path":385,"stem":386,"children":387},"Deployment","\u002Fdocs\u002Fguide\u002Fdeployment","docs\u002F2.guide\u002F2.deployment\u002Findex",[388,389,393,397],{"title":50,"path":385,"stem":386},{"title":390,"path":391,"stem":392},"Node","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fnode","docs\u002F2.guide\u002F2.deployment\u002F1.node",{"title":394,"path":395,"stem":396},"Vercel","\u002Fdocs\u002Fguide\u002Fdeployment\u002Fvercel","docs\u002F2.guide\u002F2.deployment\u002F2.vercel",{"title":259,"path":398,"stem":399},"\u002Fdocs\u002Fguide\u002Fdeployment\u002Fcloudflare","docs\u002F2.guide\u002F2.deployment\u002F3.cloudflare",{"title":401,"icon":6,"path":402,"stem":403,"children":404,"page":6},"Databases and Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage","docs\u002F2.guide\u002F3.databases-and-storage",[405,409,413],{"title":406,"path":407,"stem":408},"Databases","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fdatabases","docs\u002F2.guide\u002F3.databases-and-storage\u002F1.databases",{"title":410,"path":411,"stem":412},"Media Storage","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fmedia-storage","docs\u002F2.guide\u002F3.databases-and-storage\u002F2.media-storage",{"title":414,"path":415,"stem":416},"Image Providers","\u002Fdocs\u002Fguide\u002Fdatabases-and-storage\u002Fimage-providers","docs\u002F2.guide\u002F3.databases-and-storage\u002F3.image-providers",{"title":418,"icon":6,"path":419,"stem":420,"children":421,"page":6},"Recipes","\u002Fdocs\u002Fguide\u002Frecipes","docs\u002F2.guide\u002F4.recipes",[422,426,430,434,438,442],{"title":423,"path":424,"stem":425},"Seed Content","\u002Fdocs\u002Fguide\u002Frecipes\u002Fseed-content","docs\u002F2.guide\u002F4.recipes\u002F1.seed-content",{"title":427,"path":428,"stem":429},"Tracking and Consent","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftracking-and-consent","docs\u002F2.guide\u002F4.recipes\u002F2.tracking-and-consent",{"title":431,"path":432,"stem":433},"Build a Custom Field","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-custom-field","docs\u002F2.guide\u002F4.recipes\u002F3.build-a-custom-field",{"title":435,"path":436,"stem":437},"Write a Plugin","\u002Fdocs\u002Fguide\u002Frecipes\u002Fwrite-a-plugin","docs\u002F2.guide\u002F4.recipes\u002F4.write-a-plugin",{"title":439,"path":440,"stem":441},"Build a Headless Site with Next.js","\u002Fdocs\u002Fguide\u002Frecipes\u002Fbuild-a-headless-site-with-nextjs","docs\u002F2.guide\u002F4.recipes\u002F5.build-a-headless-site-with-nextjs",{"title":443,"path":444,"stem":445},"Troubleshooting","\u002Fdocs\u002Fguide\u002Frecipes\u002Ftroubleshooting","docs\u002F2.guide\u002F4.recipes\u002F6.troubleshooting",{"title":447,"icon":6,"path":448,"stem":449,"children":450,"page":6},"CLI","\u002Fdocs\u002Fcli","docs\u002F3.cli",[451,454,458,462,466,470,474],{"title":50,"path":452,"stem":453},"\u002Fdocs\u002Fcli\u002Foverview","docs\u002F3.cli\u002F1.overview",{"title":455,"path":456,"stem":457},"create-tenoncms","\u002Fdocs\u002Fcli\u002Fcreate-tenoncms","docs\u002F3.cli\u002F2.create-tenoncms",{"title":459,"path":460,"stem":461},"tenon backup","\u002Fdocs\u002Fcli\u002Fbackup","docs\u002F3.cli\u002F3.backup",{"title":463,"path":464,"stem":465},"tenon users","\u002Fdocs\u002Fcli\u002Fusers","docs\u002F3.cli\u002F4.users",{"title":467,"path":468,"stem":469},"tenon media","\u002Fdocs\u002Fcli\u002Fmedia","docs\u002F3.cli\u002F5.media",{"title":471,"path":472,"stem":473},"tenon upgrade","\u002Fdocs\u002Fcli\u002Fupgrade","docs\u002F3.cli\u002F6.upgrade",{"title":475,"path":476,"stem":477},"tenon login","\u002Fdocs\u002Fcli\u002Flogin","docs\u002F3.cli\u002F7.login",{"id":479,"title":159,"body":480,"description":3030,"extension":3031,"links":3032,"meta":3033,"navigation":550,"path":160,"seo":3034,"stem":161,"__hash__":3035},"docs\u002Fdocs\u002F1.core\u002F3.working-with-content\u002F4.http-api-and-client.md",{"type":481,"value":482,"toc":3015},"minimark",[483,501,646,651,700,707,736,741,746,777,781,793,949,953,962,966,975,1074,1084,1088,1095,1151,1181,1185,1188,2662,2675,2688,2692,2699,2883,2889,2893,2896,2903,2974,2978,3011],[484,485,486,487,491,492,495,496,500],"p",{},"Browser code and other services reach your content over HTTP, under ",[488,489,490],"code",{},"\u002F_tenon",". The client from ",[488,493,494],{},"tenoncms\u002Fclient"," wraps it with the same methods and types as the ",[497,498,499],"a",{"href":148},"local API",".",[502,503,508],"pre",{"className":504,"code":505,"language":506,"meta":507,"style":507},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createClient } from \"tenoncms\u002Fclient\";\n\nconst client = createClient();\nconst posts = await client.find(\"posts\", { where: { featured: true }, limit: 3 });\n","ts","",[488,509,510,545,552,573],{"__ignoreMap":507},[511,512,515,519,523,527,530,533,536,539,542],"span",{"class":513,"line":514},"line",1,[511,516,518],{"class":517},"s7zQu","import",[511,520,522],{"class":521},"sMK4o"," {",[511,524,526],{"class":525},"sTEyZ"," createClient",[511,528,529],{"class":521}," }",[511,531,532],{"class":517}," from",[511,534,535],{"class":521}," \"",[511,537,494],{"class":538},"sfazB",[511,540,541],{"class":521},"\"",[511,543,544],{"class":521},";\n",[511,546,548],{"class":513,"line":547},2,[511,549,551],{"emptyLinePlaceholder":550},true,"\n",[511,553,555,559,562,565,568,571],{"class":513,"line":554},3,[511,556,558],{"class":557},"spNyl","const",[511,560,561],{"class":525}," client ",[511,563,564],{"class":521},"=",[511,566,526],{"class":567},"s2Zo4",[511,569,570],{"class":525},"()",[511,572,544],{"class":521},[511,574,576,578,581,583,586,589,591,594,597,599,602,604,607,609,613,616,618,621,623,627,630,633,635,639,641,644],{"class":513,"line":575},4,[511,577,558],{"class":557},[511,579,580],{"class":525}," posts ",[511,582,564],{"class":521},[511,584,585],{"class":517}," await",[511,587,588],{"class":525}," client",[511,590,500],{"class":521},[511,592,593],{"class":567},"find",[511,595,596],{"class":525},"(",[511,598,541],{"class":521},[511,600,601],{"class":538},"posts",[511,603,541],{"class":521},[511,605,606],{"class":521},",",[511,608,522],{"class":521},[511,610,612],{"class":611},"swJcz"," where",[511,614,615],{"class":521},":",[511,617,522],{"class":521},[511,619,620],{"class":611}," featured",[511,622,615],{"class":521},[511,624,626],{"class":625},"sfNiH"," true",[511,628,629],{"class":521}," },",[511,631,632],{"class":611}," limit",[511,634,615],{"class":521},[511,636,638],{"class":637},"sbssI"," 3",[511,640,529],{"class":521},[511,642,643],{"class":525},")",[511,645,544],{"class":521},[647,648,650],"h2",{"id":649},"the-client","The client",[484,652,653,656,657,659,660,659,663,666,667,670,671,659,674,659,677,666,680,683,684,687,688,691,692,695,696,500],{},[488,654,655],{},"createClient()"," returns a client with the methods of the local API: ",[488,658,593],{},", ",[488,661,662],{},"findOne",[488,664,665],{},"findById"," and ",[488,668,669],{},"getGlobal"," to read, and ",[488,672,673],{},"create",[488,675,676],{},"update",[488,678,679],{},"delete",[488,681,682],{},"setGlobal"," to write. They take the same options. A few return ",[488,685,686],{},"null"," or throw a ",[488,689,690],{},"404"," where the local API returns ",[488,693,694],{},"undefined",". See ",[497,697,699],{"href":698},"\u002Fdocs\u002Fcore\u002Freference\u002Fapi\u002Fclient#differences-to-the-local-api","Differences to the local API",[484,701,702,703,706],{},"Use it in code that runs in the browser, like islands, client components and ",[497,704,705],{"href":228},"admin pages",". On the server, call the CMS instance directly. It skips HTTP.",[484,708,709,710,713,714,716,717,720,721,724,725,728,729,732,733,500],{},"A failed request throws a ",[488,711,712],{},"CmsError",", also from ",[488,715,494],{},". Its ",[488,718,719],{},"status"," is the HTTP status, and its ",[488,722,723],{},"body"," the parsed response. For invalid data, ",[488,726,727],{},"body.errors"," holds one message per field, keyed by its path, like ",[488,730,731],{},"text"," or ",[488,734,735],{},"seo.title",[737,738,740],"h3",{"id":739},"options","Options",[484,742,743,745],{},[488,744,655],{}," takes these options:",[747,748,749,759,767],"field-group",{},[750,751,754,755,758],"field",{"name":752,"type":753},"baseUrl","string","The origin of the site that runs Tenon, like ",[488,756,757],{},"https:\u002F\u002Fexample.com",". Default: the current origin.",[750,760,762,763,766],{"name":761,"type":753},"apiKey","An API key, sent as the ",[488,764,765],{},"x-api-key"," header. The client then acts as the key, within its permissions. For server code only.",[750,768,771,772,774,775,500],{"name":769,"type":770},"fetch","typeof fetch","The ",[488,773,769],{}," function to use, for example one that forwards cookies. Default: the global ",[488,776,769],{},[737,778,780],{"id":779},"call-from-another-service","Call from another service",[484,782,783,784,787,788,792],{},"A script, a build or the server of another app can use the API with an ",[497,785,786],{"href":210},"API key",". Admins create keys in the admin under ",[789,790,791],"strong",{},"Manage → API keys"," and pick what each key may do.",[502,794,797],{"className":504,"code":795,"filename":796,"language":506,"meta":507,"style":507},"import { createClient } from \"tenoncms\u002Fclient\";\n\nconst client = createClient({\n  baseUrl: \"https:\u002F\u002Fexample.com\",\n  apiKey: process.env.TENON_API_KEY,\n});\n\nawait client.create(\"products\", { name: \"Chair\", sku: \"CH-1\" });\n","scripts\u002Fsync-products.ts",[488,798,799,819,823,838,854,877,887,892],{"__ignoreMap":507},[511,800,801,803,805,807,809,811,813,815,817],{"class":513,"line":514},[511,802,518],{"class":517},[511,804,522],{"class":521},[511,806,526],{"class":525},[511,808,529],{"class":521},[511,810,532],{"class":517},[511,812,535],{"class":521},[511,814,494],{"class":538},[511,816,541],{"class":521},[511,818,544],{"class":521},[511,820,821],{"class":513,"line":547},[511,822,551],{"emptyLinePlaceholder":550},[511,824,825,827,829,831,833,835],{"class":513,"line":554},[511,826,558],{"class":557},[511,828,561],{"class":525},[511,830,564],{"class":521},[511,832,526],{"class":567},[511,834,596],{"class":525},[511,836,837],{"class":521},"{\n",[511,839,840,843,845,847,849,851],{"class":513,"line":575},[511,841,842],{"class":611},"  baseUrl",[511,844,615],{"class":521},[511,846,535],{"class":521},[511,848,757],{"class":538},[511,850,541],{"class":521},[511,852,853],{"class":521},",\n",[511,855,857,860,862,865,867,870,872,875],{"class":513,"line":856},5,[511,858,859],{"class":611},"  apiKey",[511,861,615],{"class":521},[511,863,864],{"class":525}," process",[511,866,500],{"class":521},[511,868,869],{"class":525},"env",[511,871,500],{"class":521},[511,873,874],{"class":525},"TENON_API_KEY",[511,876,853],{"class":521},[511,878,880,883,885],{"class":513,"line":879},6,[511,881,882],{"class":521},"}",[511,884,643],{"class":525},[511,886,544],{"class":521},[511,888,890],{"class":513,"line":889},7,[511,891,551],{"emptyLinePlaceholder":550},[511,893,895,898,900,902,904,906,908,911,913,915,917,920,922,924,927,929,931,934,936,938,941,943,945,947],{"class":513,"line":894},8,[511,896,897],{"class":517},"await",[511,899,588],{"class":525},[511,901,500],{"class":521},[511,903,673],{"class":567},[511,905,596],{"class":525},[511,907,541],{"class":521},[511,909,910],{"class":538},"products",[511,912,541],{"class":521},[511,914,606],{"class":521},[511,916,522],{"class":521},[511,918,919],{"class":611}," name",[511,921,615],{"class":521},[511,923,535],{"class":521},[511,925,926],{"class":538},"Chair",[511,928,541],{"class":521},[511,930,606],{"class":521},[511,932,933],{"class":611}," sku",[511,935,615],{"class":521},[511,937,535],{"class":521},[511,939,940],{"class":538},"CH-1",[511,942,541],{"class":521},[511,944,529],{"class":521},[511,946,643],{"class":525},[511,948,544],{"class":521},[950,951,952],"warning",{},"An API key MUST NOT reach a browser. Anyone who has the key can do everything its permissions allow.",[484,954,955,956,959,960,500],{},"A browser on another origin can only call the content routes and the routes of the admin bar, and only from the origin of ",[488,957,958],{},"site.url",". Other routes send no CORS headers, so a browser on another origin cannot read their answers. For a frontend on another origin, or Tenon without a site, see ",[497,961,163],{"href":164},[737,963,965],{"id":964},"types-without-an-adapter","Types without an adapter",[484,967,968,969,971,972,615],{},"The client is typed from your schema. Astro and Nuxt register the type of your CMS instance, so ",[488,970,655],{}," needs no type argument. On TanStack Start and other frameworks, add this to ",[488,973,974],{},"tsconfig.json",[502,976,980],{"className":977,"code":978,"filename":974,"language":979,"meta":507,"style":507},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"compilerOptions\": {\n    \"types\": [\"tenoncms\u002Fregister\"],\n    \"paths\": { \"#tenon\u002Fconfig\": [\".\u002Ftenon.config.ts\"] }\n  }\n}\n","json",[488,981,982,986,1001,1027,1064,1069],{"__ignoreMap":507},[511,983,984],{"class":513,"line":514},[511,985,837],{"class":521},[511,987,988,991,994,996,998],{"class":513,"line":547},[511,989,990],{"class":521},"  \"",[511,992,993],{"class":557},"compilerOptions",[511,995,541],{"class":521},[511,997,615],{"class":521},[511,999,1000],{"class":521}," {\n",[511,1002,1003,1006,1010,1012,1014,1017,1019,1022,1024],{"class":513,"line":554},[511,1004,1005],{"class":521},"    \"",[511,1007,1009],{"class":1008},"sBMFI","types",[511,1011,541],{"class":521},[511,1013,615],{"class":521},[511,1015,1016],{"class":521}," [",[511,1018,541],{"class":521},[511,1020,1021],{"class":538},"tenoncms\u002Fregister",[511,1023,541],{"class":521},[511,1025,1026],{"class":521},"],\n",[511,1028,1029,1031,1034,1036,1038,1040,1042,1045,1047,1049,1051,1053,1056,1058,1061],{"class":513,"line":575},[511,1030,1005],{"class":521},[511,1032,1033],{"class":1008},"paths",[511,1035,541],{"class":521},[511,1037,615],{"class":521},[511,1039,522],{"class":521},[511,1041,535],{"class":521},[511,1043,1044],{"class":637},"#tenon\u002Fconfig",[511,1046,541],{"class":521},[511,1048,615],{"class":521},[511,1050,1016],{"class":521},[511,1052,541],{"class":521},[511,1054,1055],{"class":538},".\u002Ftenon.config.ts",[511,1057,541],{"class":521},[511,1059,1060],{"class":521},"]",[511,1062,1063],{"class":521}," }\n",[511,1065,1066],{"class":513,"line":856},[511,1067,1068],{"class":521},"  }\n",[511,1070,1071],{"class":513,"line":879},[511,1072,1073],{"class":521},"}\n",[484,1075,1076,1079,1080,1083],{},[488,1077,1078],{},"createClient\u003Ctypeof cms>()"," with ",[488,1081,1082],{},"import type cms from \".\u002Ftenon.config\""," works too, and overrides the registered type.",[647,1085,1087],{"id":1086},"what-is-public","What is public",[484,1089,1090,1091,1094],{},"The HTTP API applies the ",[497,1092,1093],{"href":206},"access rules"," for the caller of each request. Without rules of your own:",[1096,1097,1098,1111],"table",{},[1099,1100,1101],"thead",{},[1102,1103,1104,1108],"tr",{},[1105,1106,1107],"th",{},"Request",[1105,1109,1110],{},"Who may send it",[1112,1113,1114,1123,1131,1139],"tbody",{},[1102,1115,1116,1120],{},[1117,1118,1119],"td",{},"Read published content",[1117,1121,1122],{},"Everyone, without a session",[1102,1124,1125,1128],{},[1117,1126,1127],{},"Read drafts",[1117,1129,1130],{},"Signed-in users, inside the live preview",[1102,1132,1133,1136],{},[1117,1134,1135],{},"Create, update, publish and delete",[1117,1137,1138],{},"Signed-in users, and API keys with the permission",[1102,1140,1141,1144],{},[1117,1142,1143],{},"Users, API keys, jobs and other settings",[1117,1145,1146,1147,1150],{},"Signed-in users. Some routes need the ",[488,1148,1149],{},"admin"," role",[1152,1153,1154,1158,1168,1175],"ul",{},[1155,1156,1157],"li",{},"Reads are public because your site renders that content anyway.",[1155,1159,1160,1161,1164,1165,500],{},"A write without a session or an API key answers ",[488,1162,1163],{},"401",". A signed-in user whom a rule denies gets ",[488,1166,1167],{},"403",[1155,1169,1170,1171,1174],{},"Fields with ",[488,1172,1173],{},"private: true"," are left out of responses for callers without a session.",[1155,1176,1177,1178,500],{},"A filter on a field that is not in the schema, or that the caller may not read, answers ",[488,1179,1180],{},"400",[647,1182,1184],{"id":1183},"write-from-the-site","Write from the site",[484,1186,1187],{},"A form on your site can create documents. This example lets visitors post comments.",[1189,1190,1192,1196,1202,1433,1443,1447],"steps",{"level":1191},"3",[737,1193,1195],{"id":1194},"allow-anyone-to-create-comments","Allow anyone to create comments",[484,1197,1198,1201],{},[488,1199,1200],{},"create: true"," replaces the default rule, so the API accepts a create without a session:",[502,1203,1206],{"className":504,"code":1204,"filename":1205,"language":506,"meta":507,"style":507},"import { defineCollection } from \"tenoncms\";\n\nexport const comments = defineCollection({\n  access: { create: true },\n  fields: {\n    post: { type: \"relation\", collection: \"posts\", required: true, onDelete: \"cascade\" },\n    name: { type: \"text\", required: true, maxLength: 80 },\n    text: { type: \"textarea\", required: true, maxLength: 2000 },\n  },\n});\n","cms\u002Fcollections\u002Fcomments.ts",[488,1207,1208,1230,1234,1253,1272,1281,1340,1379,1418,1424],{"__ignoreMap":507},[511,1209,1210,1212,1214,1217,1219,1221,1223,1226,1228],{"class":513,"line":514},[511,1211,518],{"class":517},[511,1213,522],{"class":521},[511,1215,1216],{"class":525}," defineCollection",[511,1218,529],{"class":521},[511,1220,532],{"class":517},[511,1222,535],{"class":521},[511,1224,1225],{"class":538},"tenoncms",[511,1227,541],{"class":521},[511,1229,544],{"class":521},[511,1231,1232],{"class":513,"line":547},[511,1233,551],{"emptyLinePlaceholder":550},[511,1235,1236,1239,1242,1245,1247,1249,1251],{"class":513,"line":554},[511,1237,1238],{"class":517},"export",[511,1240,1241],{"class":557}," const",[511,1243,1244],{"class":525}," comments ",[511,1246,564],{"class":521},[511,1248,1216],{"class":567},[511,1250,596],{"class":525},[511,1252,837],{"class":521},[511,1254,1255,1258,1260,1262,1265,1267,1269],{"class":513,"line":575},[511,1256,1257],{"class":611},"  access",[511,1259,615],{"class":521},[511,1261,522],{"class":521},[511,1263,1264],{"class":611}," create",[511,1266,615],{"class":521},[511,1268,626],{"class":625},[511,1270,1271],{"class":521}," },\n",[511,1273,1274,1277,1279],{"class":513,"line":856},[511,1275,1276],{"class":611},"  fields",[511,1278,615],{"class":521},[511,1280,1000],{"class":521},[511,1282,1283,1286,1288,1290,1293,1295,1297,1300,1302,1304,1307,1309,1311,1313,1315,1317,1320,1322,1324,1326,1329,1331,1333,1336,1338],{"class":513,"line":879},[511,1284,1285],{"class":611},"    post",[511,1287,615],{"class":521},[511,1289,522],{"class":521},[511,1291,1292],{"class":611}," type",[511,1294,615],{"class":521},[511,1296,535],{"class":521},[511,1298,1299],{"class":538},"relation",[511,1301,541],{"class":521},[511,1303,606],{"class":521},[511,1305,1306],{"class":611}," collection",[511,1308,615],{"class":521},[511,1310,535],{"class":521},[511,1312,601],{"class":538},[511,1314,541],{"class":521},[511,1316,606],{"class":521},[511,1318,1319],{"class":611}," required",[511,1321,615],{"class":521},[511,1323,626],{"class":625},[511,1325,606],{"class":521},[511,1327,1328],{"class":611}," onDelete",[511,1330,615],{"class":521},[511,1332,535],{"class":521},[511,1334,1335],{"class":538},"cascade",[511,1337,541],{"class":521},[511,1339,1271],{"class":521},[511,1341,1342,1345,1347,1349,1351,1353,1355,1357,1359,1361,1363,1365,1367,1369,1372,1374,1377],{"class":513,"line":889},[511,1343,1344],{"class":611},"    name",[511,1346,615],{"class":521},[511,1348,522],{"class":521},[511,1350,1292],{"class":611},[511,1352,615],{"class":521},[511,1354,535],{"class":521},[511,1356,731],{"class":538},[511,1358,541],{"class":521},[511,1360,606],{"class":521},[511,1362,1319],{"class":611},[511,1364,615],{"class":521},[511,1366,626],{"class":625},[511,1368,606],{"class":521},[511,1370,1371],{"class":611}," maxLength",[511,1373,615],{"class":521},[511,1375,1376],{"class":637}," 80",[511,1378,1271],{"class":521},[511,1380,1381,1384,1386,1388,1390,1392,1394,1397,1399,1401,1403,1405,1407,1409,1411,1413,1416],{"class":513,"line":894},[511,1382,1383],{"class":611},"    text",[511,1385,615],{"class":521},[511,1387,522],{"class":521},[511,1389,1292],{"class":611},[511,1391,615],{"class":521},[511,1393,535],{"class":521},[511,1395,1396],{"class":538},"textarea",[511,1398,541],{"class":521},[511,1400,606],{"class":521},[511,1402,1319],{"class":611},[511,1404,615],{"class":521},[511,1406,626],{"class":625},[511,1408,606],{"class":521},[511,1410,1371],{"class":611},[511,1412,615],{"class":521},[511,1414,1415],{"class":637}," 2000",[511,1417,1271],{"class":521},[511,1419,1421],{"class":513,"line":1420},9,[511,1422,1423],{"class":521},"  },\n",[511,1425,1427,1429,1431],{"class":513,"line":1426},10,[511,1428,882],{"class":521},[511,1430,643],{"class":525},[511,1432,544],{"class":521},[484,1434,1435,1436,1439,1440,500],{},"Add it to ",[488,1437,1438],{},"collections"," in ",[488,1441,1442],{},"tenon.config.ts",[737,1444,1446],{"id":1445},"send-the-form-with-the-client","Send the form with the client",[1448,1449,1451,1981,2356],"code-group",{"sync":1450},"framework",[502,1452,1457],{"className":1453,"code":1454,"filename":1455,"language":1456,"meta":507,"style":507},"language-astro shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","---\nconst { postId } = Astro.props;\n---\n\n\u003Cform id=\"comment-form\">\n  \u003Cinput type=\"hidden\" name=\"post\" value={postId} \u002F>\n  \u003Cinput name=\"name\" required \u002F>\n  \u003Ctextarea name=\"text\" required>\u003C\u002Ftextarea>\n  \u003Cbutton>Send\u003C\u002Fbutton>\n\u003C\u002Fform>\n\n\u003Cscript>\n  import { createClient } from \"tenoncms\u002Fclient\";\n\n  const client = createClient();\n  const form = document.querySelector\u003CHTMLFormElement>(\"#comment-form\")!;\n\n  form.addEventListener(\"submit\", async (event) => {\n    event.preventDefault();\n    const data = new FormData(form);\n    await client.create(\"comments\", {\n      post: String(data.get(\"post\")),\n      name: String(data.get(\"name\")),\n      text: String(data.get(\"text\")),\n    });\n    form.reset();\n  });\n\u003C\u002Fscript>\n","src\u002Fcomponents\u002FCommentForm.astro","astro",[488,1458,1459,1465,1489,1493,1497,1520,1562,1584,1609,1629,1637,1642,1652,1674,1679,1695,1734,1739,1778,1793,1818,1843,1877,1907,1937,1947,1962,1972],{"__ignoreMap":507},[511,1460,1461],{"class":513,"line":514},[511,1462,1464],{"class":1463},"sHwdD","---\n",[511,1466,1467,1469,1471,1474,1476,1479,1482,1484,1487],{"class":513,"line":547},[511,1468,558],{"class":557},[511,1470,522],{"class":521},[511,1472,1473],{"class":525}," postId ",[511,1475,882],{"class":521},[511,1477,1478],{"class":521}," =",[511,1480,1481],{"class":525}," Astro",[511,1483,500],{"class":521},[511,1485,1486],{"class":525},"props",[511,1488,544],{"class":521},[511,1490,1491],{"class":513,"line":554},[511,1492,1464],{"class":1463},[511,1494,1495],{"class":513,"line":575},[511,1496,551],{"emptyLinePlaceholder":550},[511,1498,1499,1502,1505,1508,1510,1512,1515,1517],{"class":513,"line":856},[511,1500,1501],{"class":521},"\u003C",[511,1503,1504],{"class":611},"form",[511,1506,1507],{"class":557}," id",[511,1509,564],{"class":521},[511,1511,541],{"class":521},[511,1513,1514],{"class":538},"comment-form",[511,1516,541],{"class":521},[511,1518,1519],{"class":521},">\n",[511,1521,1522,1525,1528,1530,1532,1534,1537,1539,1541,1543,1545,1548,1550,1553,1556,1559],{"class":513,"line":879},[511,1523,1524],{"class":521},"  \u003C",[511,1526,1527],{"class":611},"input",[511,1529,1292],{"class":557},[511,1531,564],{"class":521},[511,1533,541],{"class":521},[511,1535,1536],{"class":538},"hidden",[511,1538,541],{"class":521},[511,1540,919],{"class":557},[511,1542,564],{"class":521},[511,1544,541],{"class":521},[511,1546,1547],{"class":538},"post",[511,1549,541],{"class":521},[511,1551,1552],{"class":557}," value",[511,1554,1555],{"class":521},"={",[511,1557,1558],{"class":525},"postId",[511,1560,1561],{"class":521},"} \u002F>\n",[511,1563,1564,1566,1568,1570,1572,1574,1577,1579,1581],{"class":513,"line":889},[511,1565,1524],{"class":521},[511,1567,1527],{"class":611},[511,1569,919],{"class":557},[511,1571,564],{"class":521},[511,1573,541],{"class":521},[511,1575,1576],{"class":538},"name",[511,1578,541],{"class":521},[511,1580,1319],{"class":557},[511,1582,1583],{"class":521}," \u002F>\n",[511,1585,1586,1588,1590,1592,1594,1596,1598,1600,1602,1605,1607],{"class":513,"line":894},[511,1587,1524],{"class":521},[511,1589,1396],{"class":611},[511,1591,919],{"class":557},[511,1593,564],{"class":521},[511,1595,541],{"class":521},[511,1597,731],{"class":538},[511,1599,541],{"class":521},[511,1601,1319],{"class":557},[511,1603,1604],{"class":521},">\u003C\u002F",[511,1606,1396],{"class":611},[511,1608,1519],{"class":521},[511,1610,1611,1613,1616,1619,1622,1625,1627],{"class":513,"line":1420},[511,1612,1524],{"class":521},[511,1614,1615],{"class":611},"button",[511,1617,1618],{"class":521},">",[511,1620,1621],{"class":525},"Send",[511,1623,1624],{"class":521},"\u003C\u002F",[511,1626,1615],{"class":611},[511,1628,1519],{"class":521},[511,1630,1631,1633,1635],{"class":513,"line":1426},[511,1632,1624],{"class":521},[511,1634,1504],{"class":611},[511,1636,1519],{"class":521},[511,1638,1640],{"class":513,"line":1639},11,[511,1641,551],{"emptyLinePlaceholder":550},[511,1643,1645,1647,1650],{"class":513,"line":1644},12,[511,1646,1501],{"class":521},[511,1648,1649],{"class":611},"script",[511,1651,1519],{"class":521},[511,1653,1655,1658,1660,1662,1664,1666,1668,1670,1672],{"class":513,"line":1654},13,[511,1656,1657],{"class":517},"  import",[511,1659,522],{"class":521},[511,1661,526],{"class":525},[511,1663,529],{"class":521},[511,1665,532],{"class":517},[511,1667,535],{"class":521},[511,1669,494],{"class":538},[511,1671,541],{"class":521},[511,1673,544],{"class":521},[511,1675,1677],{"class":513,"line":1676},14,[511,1678,551],{"emptyLinePlaceholder":550},[511,1680,1682,1685,1687,1689,1691,1693],{"class":513,"line":1681},15,[511,1683,1684],{"class":557},"  const",[511,1686,561],{"class":525},[511,1688,564],{"class":521},[511,1690,526],{"class":567},[511,1692,570],{"class":525},[511,1694,544],{"class":521},[511,1696,1698,1700,1703,1705,1708,1710,1713,1715,1718,1720,1722,1724,1727,1729,1731],{"class":513,"line":1697},16,[511,1699,1684],{"class":557},[511,1701,1702],{"class":525}," form ",[511,1704,564],{"class":521},[511,1706,1707],{"class":525}," document",[511,1709,500],{"class":521},[511,1711,1712],{"class":567},"querySelector",[511,1714,1501],{"class":521},[511,1716,1717],{"class":1008},"HTMLFormElement",[511,1719,1618],{"class":521},[511,1721,596],{"class":525},[511,1723,541],{"class":521},[511,1725,1726],{"class":538},"#comment-form",[511,1728,541],{"class":521},[511,1730,643],{"class":525},[511,1732,1733],{"class":521},"!;\n",[511,1735,1737],{"class":513,"line":1736},17,[511,1738,551],{"emptyLinePlaceholder":550},[511,1740,1742,1745,1747,1750,1752,1754,1757,1759,1761,1764,1767,1771,1773,1776],{"class":513,"line":1741},18,[511,1743,1744],{"class":525},"  form",[511,1746,500],{"class":521},[511,1748,1749],{"class":567},"addEventListener",[511,1751,596],{"class":525},[511,1753,541],{"class":521},[511,1755,1756],{"class":538},"submit",[511,1758,541],{"class":521},[511,1760,606],{"class":521},[511,1762,1763],{"class":557}," async",[511,1765,1766],{"class":521}," (",[511,1768,1770],{"class":1769},"sHdIc","event",[511,1772,643],{"class":521},[511,1774,1775],{"class":557}," =>",[511,1777,1000],{"class":521},[511,1779,1781,1784,1786,1789,1791],{"class":513,"line":1780},19,[511,1782,1783],{"class":525},"    event",[511,1785,500],{"class":521},[511,1787,1788],{"class":567},"preventDefault",[511,1790,570],{"class":611},[511,1792,544],{"class":521},[511,1794,1796,1799,1802,1804,1807,1810,1812,1814,1816],{"class":513,"line":1795},20,[511,1797,1798],{"class":557},"    const",[511,1800,1801],{"class":525}," data",[511,1803,1478],{"class":521},[511,1805,1806],{"class":521}," new",[511,1808,1809],{"class":567}," FormData",[511,1811,596],{"class":611},[511,1813,1504],{"class":525},[511,1815,643],{"class":611},[511,1817,544],{"class":521},[511,1819,1821,1824,1826,1828,1830,1832,1834,1837,1839,1841],{"class":513,"line":1820},21,[511,1822,1823],{"class":517},"    await",[511,1825,588],{"class":525},[511,1827,500],{"class":521},[511,1829,673],{"class":567},[511,1831,596],{"class":611},[511,1833,541],{"class":521},[511,1835,1836],{"class":538},"comments",[511,1838,541],{"class":521},[511,1840,606],{"class":521},[511,1842,1000],{"class":521},[511,1844,1846,1849,1851,1854,1856,1859,1861,1864,1866,1868,1870,1872,1875],{"class":513,"line":1845},22,[511,1847,1848],{"class":611},"      post",[511,1850,615],{"class":521},[511,1852,1853],{"class":567}," String",[511,1855,596],{"class":611},[511,1857,1858],{"class":525},"data",[511,1860,500],{"class":521},[511,1862,1863],{"class":567},"get",[511,1865,596],{"class":611},[511,1867,541],{"class":521},[511,1869,1547],{"class":538},[511,1871,541],{"class":521},[511,1873,1874],{"class":611},"))",[511,1876,853],{"class":521},[511,1878,1880,1883,1885,1887,1889,1891,1893,1895,1897,1899,1901,1903,1905],{"class":513,"line":1879},23,[511,1881,1882],{"class":611},"      name",[511,1884,615],{"class":521},[511,1886,1853],{"class":567},[511,1888,596],{"class":611},[511,1890,1858],{"class":525},[511,1892,500],{"class":521},[511,1894,1863],{"class":567},[511,1896,596],{"class":611},[511,1898,541],{"class":521},[511,1900,1576],{"class":538},[511,1902,541],{"class":521},[511,1904,1874],{"class":611},[511,1906,853],{"class":521},[511,1908,1910,1913,1915,1917,1919,1921,1923,1925,1927,1929,1931,1933,1935],{"class":513,"line":1909},24,[511,1911,1912],{"class":611},"      text",[511,1914,615],{"class":521},[511,1916,1853],{"class":567},[511,1918,596],{"class":611},[511,1920,1858],{"class":525},[511,1922,500],{"class":521},[511,1924,1863],{"class":567},[511,1926,596],{"class":611},[511,1928,541],{"class":521},[511,1930,731],{"class":538},[511,1932,541],{"class":521},[511,1934,1874],{"class":611},[511,1936,853],{"class":521},[511,1938,1940,1943,1945],{"class":513,"line":1939},25,[511,1941,1942],{"class":521},"    }",[511,1944,643],{"class":611},[511,1946,544],{"class":521},[511,1948,1950,1953,1955,1958,1960],{"class":513,"line":1949},26,[511,1951,1952],{"class":525},"    form",[511,1954,500],{"class":521},[511,1956,1957],{"class":567},"reset",[511,1959,570],{"class":611},[511,1961,544],{"class":521},[511,1963,1965,1968,1970],{"class":513,"line":1964},27,[511,1966,1967],{"class":521},"  }",[511,1969,643],{"class":525},[511,1971,544],{"class":521},[511,1973,1975,1977,1979],{"class":513,"line":1974},28,[511,1976,1624],{"class":521},[511,1978,1649],{"class":611},[511,1980,1519],{"class":521},[502,1982,1987],{"className":1983,"code":1984,"filename":1985,"language":1986,"meta":507,"style":507},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Cscript setup lang=\"ts\">\nimport { createClient } from \"tenoncms\u002Fclient\";\n\nconst props = defineProps\u003C{ postId: string }>();\nconst client = createClient();\nconst name = ref(\"\");\nconst text = ref(\"\");\n\nasync function send() {\n  await client.create(\"comments\", { post: props.postId, name: name.value, text: text.value });\n  name.value = \"\";\n  text.value = \"\";\n}\n\u003C\u002Fscript>\n\n\u003Ctemplate>\n  \u003Cform @submit.prevent=\"send\">\n    \u003Cinput v-model=\"name\" required \u002F>\n    \u003Ctextarea v-model=\"text\" required \u002F>\n    \u003Cbutton>Send\u003C\u002Fbutton>\n  \u003C\u002Fform>\n\u003C\u002Ftemplate>\n","app\u002Fcomponents\u002FCommentForm.vue","vue",[488,1988,1989,2011,2031,2035,2065,2079,2100,2119,2123,2138,2205,2221,2236,2240,2248,2252,2261,2281,2303,2323,2339,2348],{"__ignoreMap":507},[511,1990,1991,1993,1995,1998,2001,2003,2005,2007,2009],{"class":513,"line":514},[511,1992,1501],{"class":521},[511,1994,1649],{"class":611},[511,1996,1997],{"class":557}," setup",[511,1999,2000],{"class":557}," lang",[511,2002,564],{"class":521},[511,2004,541],{"class":521},[511,2006,506],{"class":538},[511,2008,541],{"class":521},[511,2010,1519],{"class":521},[511,2012,2013,2015,2017,2019,2021,2023,2025,2027,2029],{"class":513,"line":547},[511,2014,518],{"class":517},[511,2016,522],{"class":521},[511,2018,526],{"class":525},[511,2020,529],{"class":521},[511,2022,532],{"class":517},[511,2024,535],{"class":521},[511,2026,494],{"class":538},[511,2028,541],{"class":521},[511,2030,544],{"class":521},[511,2032,2033],{"class":513,"line":554},[511,2034,551],{"emptyLinePlaceholder":550},[511,2036,2037,2039,2042,2044,2047,2050,2053,2055,2058,2061,2063],{"class":513,"line":575},[511,2038,558],{"class":557},[511,2040,2041],{"class":525}," props ",[511,2043,564],{"class":521},[511,2045,2046],{"class":567}," defineProps",[511,2048,2049],{"class":521},"\u003C{",[511,2051,2052],{"class":611}," postId",[511,2054,615],{"class":521},[511,2056,2057],{"class":1008}," string",[511,2059,2060],{"class":521}," }>",[511,2062,570],{"class":525},[511,2064,544],{"class":521},[511,2066,2067,2069,2071,2073,2075,2077],{"class":513,"line":856},[511,2068,558],{"class":557},[511,2070,561],{"class":525},[511,2072,564],{"class":521},[511,2074,526],{"class":567},[511,2076,570],{"class":525},[511,2078,544],{"class":521},[511,2080,2081,2083,2086,2088,2091,2093,2096,2098],{"class":513,"line":879},[511,2082,558],{"class":557},[511,2084,2085],{"class":525}," name ",[511,2087,564],{"class":521},[511,2089,2090],{"class":567}," ref",[511,2092,596],{"class":525},[511,2094,2095],{"class":521},"\"\"",[511,2097,643],{"class":525},[511,2099,544],{"class":521},[511,2101,2102,2104,2107,2109,2111,2113,2115,2117],{"class":513,"line":889},[511,2103,558],{"class":557},[511,2105,2106],{"class":525}," text ",[511,2108,564],{"class":521},[511,2110,2090],{"class":567},[511,2112,596],{"class":525},[511,2114,2095],{"class":521},[511,2116,643],{"class":525},[511,2118,544],{"class":521},[511,2120,2121],{"class":513,"line":894},[511,2122,551],{"emptyLinePlaceholder":550},[511,2124,2125,2128,2131,2134,2136],{"class":513,"line":1420},[511,2126,2127],{"class":557},"async",[511,2129,2130],{"class":557}," function",[511,2132,2133],{"class":567}," send",[511,2135,570],{"class":521},[511,2137,1000],{"class":521},[511,2139,2140,2143,2145,2147,2149,2151,2153,2155,2157,2159,2161,2164,2166,2169,2171,2173,2175,2177,2179,2181,2183,2186,2188,2191,2193,2195,2197,2199,2201,2203],{"class":513,"line":1426},[511,2141,2142],{"class":517},"  await",[511,2144,588],{"class":525},[511,2146,500],{"class":521},[511,2148,673],{"class":567},[511,2150,596],{"class":611},[511,2152,541],{"class":521},[511,2154,1836],{"class":538},[511,2156,541],{"class":521},[511,2158,606],{"class":521},[511,2160,522],{"class":521},[511,2162,2163],{"class":611}," post",[511,2165,615],{"class":521},[511,2167,2168],{"class":525}," props",[511,2170,500],{"class":521},[511,2172,1558],{"class":525},[511,2174,606],{"class":521},[511,2176,919],{"class":611},[511,2178,615],{"class":521},[511,2180,919],{"class":525},[511,2182,500],{"class":521},[511,2184,2185],{"class":525},"value",[511,2187,606],{"class":521},[511,2189,2190],{"class":611}," text",[511,2192,615],{"class":521},[511,2194,2190],{"class":525},[511,2196,500],{"class":521},[511,2198,2185],{"class":525},[511,2200,529],{"class":521},[511,2202,643],{"class":611},[511,2204,544],{"class":521},[511,2206,2207,2210,2212,2214,2216,2219],{"class":513,"line":1639},[511,2208,2209],{"class":525},"  name",[511,2211,500],{"class":521},[511,2213,2185],{"class":525},[511,2215,1478],{"class":521},[511,2217,2218],{"class":521}," \"\"",[511,2220,544],{"class":521},[511,2222,2223,2226,2228,2230,2232,2234],{"class":513,"line":1644},[511,2224,2225],{"class":525},"  text",[511,2227,500],{"class":521},[511,2229,2185],{"class":525},[511,2231,1478],{"class":521},[511,2233,2218],{"class":521},[511,2235,544],{"class":521},[511,2237,2238],{"class":513,"line":1654},[511,2239,1073],{"class":521},[511,2241,2242,2244,2246],{"class":513,"line":1676},[511,2243,1624],{"class":521},[511,2245,1649],{"class":611},[511,2247,1519],{"class":521},[511,2249,2250],{"class":513,"line":1681},[511,2251,551],{"emptyLinePlaceholder":550},[511,2253,2254,2256,2259],{"class":513,"line":1697},[511,2255,1501],{"class":521},[511,2257,2258],{"class":611},"template",[511,2260,1519],{"class":521},[511,2262,2263,2265,2267,2270,2272,2274,2277,2279],{"class":513,"line":1736},[511,2264,1524],{"class":521},[511,2266,1504],{"class":611},[511,2268,2269],{"class":557}," @submit.prevent",[511,2271,564],{"class":521},[511,2273,541],{"class":521},[511,2275,2276],{"class":538},"send",[511,2278,541],{"class":521},[511,2280,1519],{"class":521},[511,2282,2283,2286,2288,2291,2293,2295,2297,2299,2301],{"class":513,"line":1741},[511,2284,2285],{"class":521},"    \u003C",[511,2287,1527],{"class":611},[511,2289,2290],{"class":557}," v-model",[511,2292,564],{"class":521},[511,2294,541],{"class":521},[511,2296,1576],{"class":538},[511,2298,541],{"class":521},[511,2300,1319],{"class":557},[511,2302,1583],{"class":521},[511,2304,2305,2307,2309,2311,2313,2315,2317,2319,2321],{"class":513,"line":1780},[511,2306,2285],{"class":521},[511,2308,1396],{"class":611},[511,2310,2290],{"class":557},[511,2312,564],{"class":521},[511,2314,541],{"class":521},[511,2316,731],{"class":538},[511,2318,541],{"class":521},[511,2320,1319],{"class":557},[511,2322,1583],{"class":521},[511,2324,2325,2327,2329,2331,2333,2335,2337],{"class":513,"line":1795},[511,2326,2285],{"class":521},[511,2328,1615],{"class":611},[511,2330,1618],{"class":521},[511,2332,1621],{"class":525},[511,2334,1624],{"class":521},[511,2336,1615],{"class":611},[511,2338,1519],{"class":521},[511,2340,2341,2344,2346],{"class":513,"line":1820},[511,2342,2343],{"class":521},"  \u003C\u002F",[511,2345,1504],{"class":611},[511,2347,1519],{"class":521},[511,2349,2350,2352,2354],{"class":513,"line":1845},[511,2351,1624],{"class":521},[511,2353,2258],{"class":611},[511,2355,1519],{"class":521},[502,2357,2362],{"className":2358,"code":2359,"filename":2360,"language":2361,"meta":507,"style":507},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createClient } from \"tenoncms\u002Fclient\";\n\nconst client = createClient();\n\nexport function CommentForm({ postId }: { postId: string }) {\n  async function send(data: FormData) {\n    await client.create(\"comments\", {\n      post: postId,\n      name: String(data.get(\"name\")),\n      text: String(data.get(\"text\")),\n    });\n  }\n\n  return (\n    \u003Cform action={send}>\n      \u003Cinput name=\"name\" required \u002F>\n      \u003Ctextarea name=\"text\" required \u002F>\n      \u003Cbutton>Send\u003C\u002Fbutton>\n    \u003C\u002Fform>\n  );\n}\n","src\u002Fcomponents\u002FCommentForm.tsx","tsx",[488,2363,2364,2384,2388,2402,2406,2436,2457,2479,2489,2517,2545,2553,2557,2561,2569,2585,2606,2626,2642,2651,2658],{"__ignoreMap":507},[511,2365,2366,2368,2370,2372,2374,2376,2378,2380,2382],{"class":513,"line":514},[511,2367,518],{"class":517},[511,2369,522],{"class":521},[511,2371,526],{"class":525},[511,2373,529],{"class":521},[511,2375,532],{"class":517},[511,2377,535],{"class":521},[511,2379,494],{"class":538},[511,2381,541],{"class":521},[511,2383,544],{"class":521},[511,2385,2386],{"class":513,"line":547},[511,2387,551],{"emptyLinePlaceholder":550},[511,2389,2390,2392,2394,2396,2398,2400],{"class":513,"line":554},[511,2391,558],{"class":557},[511,2393,561],{"class":525},[511,2395,564],{"class":521},[511,2397,526],{"class":567},[511,2399,570],{"class":525},[511,2401,544],{"class":521},[511,2403,2404],{"class":513,"line":575},[511,2405,551],{"emptyLinePlaceholder":550},[511,2407,2408,2410,2412,2415,2418,2420,2423,2425,2427,2429,2431,2434],{"class":513,"line":856},[511,2409,1238],{"class":517},[511,2411,2130],{"class":557},[511,2413,2414],{"class":567}," CommentForm",[511,2416,2417],{"class":521},"({",[511,2419,2052],{"class":1769},[511,2421,2422],{"class":521}," }:",[511,2424,522],{"class":521},[511,2426,2052],{"class":611},[511,2428,615],{"class":521},[511,2430,2057],{"class":1008},[511,2432,2433],{"class":521}," })",[511,2435,1000],{"class":521},[511,2437,2438,2441,2443,2445,2447,2449,2451,2453,2455],{"class":513,"line":879},[511,2439,2440],{"class":557},"  async",[511,2442,2130],{"class":557},[511,2444,2133],{"class":567},[511,2446,596],{"class":521},[511,2448,1858],{"class":1769},[511,2450,615],{"class":521},[511,2452,1809],{"class":1008},[511,2454,643],{"class":521},[511,2456,1000],{"class":521},[511,2458,2459,2461,2463,2465,2467,2469,2471,2473,2475,2477],{"class":513,"line":889},[511,2460,1823],{"class":517},[511,2462,588],{"class":525},[511,2464,500],{"class":521},[511,2466,673],{"class":567},[511,2468,596],{"class":611},[511,2470,541],{"class":521},[511,2472,1836],{"class":538},[511,2474,541],{"class":521},[511,2476,606],{"class":521},[511,2478,1000],{"class":521},[511,2480,2481,2483,2485,2487],{"class":513,"line":894},[511,2482,1848],{"class":611},[511,2484,615],{"class":521},[511,2486,2052],{"class":525},[511,2488,853],{"class":521},[511,2490,2491,2493,2495,2497,2499,2501,2503,2505,2507,2509,2511,2513,2515],{"class":513,"line":1420},[511,2492,1882],{"class":611},[511,2494,615],{"class":521},[511,2496,1853],{"class":567},[511,2498,596],{"class":611},[511,2500,1858],{"class":525},[511,2502,500],{"class":521},[511,2504,1863],{"class":567},[511,2506,596],{"class":611},[511,2508,541],{"class":521},[511,2510,1576],{"class":538},[511,2512,541],{"class":521},[511,2514,1874],{"class":611},[511,2516,853],{"class":521},[511,2518,2519,2521,2523,2525,2527,2529,2531,2533,2535,2537,2539,2541,2543],{"class":513,"line":1426},[511,2520,1912],{"class":611},[511,2522,615],{"class":521},[511,2524,1853],{"class":567},[511,2526,596],{"class":611},[511,2528,1858],{"class":525},[511,2530,500],{"class":521},[511,2532,1863],{"class":567},[511,2534,596],{"class":611},[511,2536,541],{"class":521},[511,2538,731],{"class":538},[511,2540,541],{"class":521},[511,2542,1874],{"class":611},[511,2544,853],{"class":521},[511,2546,2547,2549,2551],{"class":513,"line":1639},[511,2548,1942],{"class":521},[511,2550,643],{"class":611},[511,2552,544],{"class":521},[511,2554,2555],{"class":513,"line":1644},[511,2556,1068],{"class":521},[511,2558,2559],{"class":513,"line":1654},[511,2560,551],{"emptyLinePlaceholder":550},[511,2562,2563,2566],{"class":513,"line":1676},[511,2564,2565],{"class":517},"  return",[511,2567,2568],{"class":611}," (\n",[511,2570,2571,2573,2575,2578,2580,2582],{"class":513,"line":1681},[511,2572,2285],{"class":521},[511,2574,1504],{"class":611},[511,2576,2577],{"class":557}," action",[511,2579,1555],{"class":521},[511,2581,2276],{"class":525},[511,2583,2584],{"class":521},"}>\n",[511,2586,2587,2590,2592,2594,2596,2598,2600,2602,2604],{"class":513,"line":1697},[511,2588,2589],{"class":521},"      \u003C",[511,2591,1527],{"class":611},[511,2593,919],{"class":557},[511,2595,564],{"class":521},[511,2597,541],{"class":521},[511,2599,1576],{"class":538},[511,2601,541],{"class":521},[511,2603,1319],{"class":557},[511,2605,1583],{"class":521},[511,2607,2608,2610,2612,2614,2616,2618,2620,2622,2624],{"class":513,"line":1736},[511,2609,2589],{"class":521},[511,2611,1396],{"class":611},[511,2613,919],{"class":557},[511,2615,564],{"class":521},[511,2617,541],{"class":521},[511,2619,731],{"class":538},[511,2621,541],{"class":521},[511,2623,1319],{"class":557},[511,2625,1583],{"class":521},[511,2627,2628,2630,2632,2634,2636,2638,2640],{"class":513,"line":1741},[511,2629,2589],{"class":521},[511,2631,1615],{"class":611},[511,2633,1618],{"class":521},[511,2635,1621],{"class":525},[511,2637,1624],{"class":521},[511,2639,1615],{"class":611},[511,2641,1519],{"class":521},[511,2643,2644,2647,2649],{"class":513,"line":1780},[511,2645,2646],{"class":521},"    \u003C\u002F",[511,2648,1504],{"class":611},[511,2650,1519],{"class":521},[511,2652,2653,2656],{"class":513,"line":1795},[511,2654,2655],{"class":611},"  )",[511,2657,544],{"class":521},[511,2659,2660],{"class":513,"line":1820},[511,2661,1073],{"class":521},[484,2663,2664,2665,2667,2668,2670,2671,2674],{},"The API validates the input like every other write. Invalid input throws a ",[488,2666,712],{}," with status ",[488,2669,1180],{},", and ",[488,2672,2673],{},"error.body.errors"," holds the message for each field. A new comment is published at once, so everyone can read it.",[2676,2677,2678,2680,2681,666,2684,2687],"caution",{},[488,2679,1200],{}," lets anyone write to the collection. Keep its fields few, and set ",[488,2682,2683],{},"required",[488,2685,2686],{},"maxLength"," on them. Tenon does not limit how often a visitor can send the form.",[737,2689,2691],{"id":2690},"review-comments-before-they-show","Review comments before they show",[484,2693,2694,2695,2698],{},"To show only the comments an editor approved, add a read rule and an ",[488,2696,2697],{},"approved"," field that visitors cannot set:",[502,2700,2702],{"className":504,"code":2701,"filename":1205,"language":506,"meta":507,"style":507},"export const comments = defineCollection({\n  access: {\n    create: true,\n    \u002F\u002F Visitors read approved comments. Signed-in users read all of them.\n    read: ({ user }) => (user ? true : { approved: true }),\n  },\n  fields: {\n    \u002F\u002F ...\n    approved: { type: \"boolean\", default: false, access: { create: [\"admin\", \"editor\"] } },\n  },\n});\n",[488,2703,2704,2720,2728,2739,2744,2787,2791,2799,2804,2871,2875],{"__ignoreMap":507},[511,2705,2706,2708,2710,2712,2714,2716,2718],{"class":513,"line":514},[511,2707,1238],{"class":517},[511,2709,1241],{"class":557},[511,2711,1244],{"class":525},[511,2713,564],{"class":521},[511,2715,1216],{"class":567},[511,2717,596],{"class":525},[511,2719,837],{"class":521},[511,2721,2722,2724,2726],{"class":513,"line":547},[511,2723,1257],{"class":611},[511,2725,615],{"class":521},[511,2727,1000],{"class":521},[511,2729,2730,2733,2735,2737],{"class":513,"line":554},[511,2731,2732],{"class":611},"    create",[511,2734,615],{"class":521},[511,2736,626],{"class":625},[511,2738,853],{"class":521},[511,2740,2741],{"class":513,"line":575},[511,2742,2743],{"class":1463},"    \u002F\u002F Visitors read approved comments. Signed-in users read all of them.\n",[511,2745,2746,2749,2751,2754,2757,2759,2761,2764,2767,2769,2772,2774,2777,2779,2781,2783,2785],{"class":513,"line":856},[511,2747,2748],{"class":567},"    read",[511,2750,615],{"class":521},[511,2752,2753],{"class":521}," ({",[511,2755,2756],{"class":1769}," user",[511,2758,2433],{"class":521},[511,2760,1775],{"class":557},[511,2762,2763],{"class":525}," (user ",[511,2765,2766],{"class":521},"?",[511,2768,626],{"class":625},[511,2770,2771],{"class":521}," :",[511,2773,522],{"class":521},[511,2775,2776],{"class":611}," approved",[511,2778,615],{"class":521},[511,2780,626],{"class":625},[511,2782,529],{"class":521},[511,2784,643],{"class":525},[511,2786,853],{"class":521},[511,2788,2789],{"class":513,"line":879},[511,2790,1423],{"class":521},[511,2792,2793,2795,2797],{"class":513,"line":889},[511,2794,1276],{"class":611},[511,2796,615],{"class":521},[511,2798,1000],{"class":521},[511,2800,2801],{"class":513,"line":894},[511,2802,2803],{"class":1463},"    \u002F\u002F ...\n",[511,2805,2806,2809,2811,2813,2815,2817,2819,2822,2824,2826,2829,2831,2834,2836,2839,2841,2843,2845,2847,2849,2851,2853,2855,2857,2859,2862,2864,2867,2869],{"class":513,"line":1420},[511,2807,2808],{"class":611},"    approved",[511,2810,615],{"class":521},[511,2812,522],{"class":521},[511,2814,1292],{"class":611},[511,2816,615],{"class":521},[511,2818,535],{"class":521},[511,2820,2821],{"class":538},"boolean",[511,2823,541],{"class":521},[511,2825,606],{"class":521},[511,2827,2828],{"class":611}," default",[511,2830,615],{"class":521},[511,2832,2833],{"class":625}," false",[511,2835,606],{"class":521},[511,2837,2838],{"class":611}," access",[511,2840,615],{"class":521},[511,2842,522],{"class":521},[511,2844,1264],{"class":611},[511,2846,615],{"class":521},[511,2848,1016],{"class":525},[511,2850,541],{"class":521},[511,2852,1149],{"class":538},[511,2854,541],{"class":521},[511,2856,606],{"class":521},[511,2858,535],{"class":521},[511,2860,2861],{"class":538},"editor",[511,2863,541],{"class":521},[511,2865,2866],{"class":525},"] ",[511,2868,882],{"class":521},[511,2870,1271],{"class":521},[511,2872,2873],{"class":513,"line":1426},[511,2874,1423],{"class":521},[511,2876,2877,2879,2881],{"class":513,"line":1639},[511,2878,882],{"class":521},[511,2880,643],{"class":525},[511,2882,544],{"class":521},[484,2884,2885,2886,2888],{},"A visitor's value for ",[488,2887,2697],{}," is dropped, so a new comment waits. Editors approve it in the admin.",[647,2890,2892],{"id":2891},"without-the-client","Without the client",[484,2894,2895],{},"The client only builds requests to the HTTP API. You can send them yourself:",[502,2897,2901],{"className":2898,"code":2900,"language":731,"meta":507},[2899],"language-text","GET \u002F_tenon\u002Fcollections\u002Fposts?category=news&limit=5\nGET \u002F_tenon\u002Fcollections\u002Fposts\u002F:id\nGET \u002F_tenon\u002Fglobals\u002Ffooter\nPOST \u002F_tenon\u002Fcollections\u002Fcomments\nPUT \u002F_tenon\u002Fcollections\u002Fposts\u002F:id\nDELETE \u002F_tenon\u002Fcollections\u002Fposts\u002F:id\n",[488,2902,2900],{"__ignoreMap":507},[1152,2904,2905,2916,2943,2953,2960],{},[1155,2906,2907,2908,2911,2912,2915],{},"Query parameters are equality filters, like ",[488,2909,2910],{},"where",". ",[488,2913,2914],{},"?category=null"," matches an empty or missing field.",[1155,2917,2918,659,2921,659,2924,659,2927,659,2930,659,2933,659,2936,666,2939,2942],{},[488,2919,2920],{},"limit",[488,2922,2923],{},"populate",[488,2925,2926],{},"depth",[488,2928,2929],{},"select",[488,2931,2932],{},"locale",[488,2934,2935],{},"fallback",[488,2937,2938],{},"alternates",[488,2940,2941],{},"permalink"," are options, not filters. You cannot filter on fields with these names over HTTP.",[1155,2944,2945,666,2947,2949,2950,500],{},[488,2946,2923],{},[488,2948,2929],{}," take dot paths, separated by commas: ",[488,2951,2952],{},"?populate=author&select=title,author.name",[1155,2954,2955,2956,2959],{},"Writes send the data as JSON. ",[488,2957,2958],{},"PUT"," changes only the fields it sends.",[1155,2961,2962,2963,2966,2967,2969,2970,2973],{},"An error answers JSON with a ",[488,2964,2965],{},"message",". A ",[488,2968,1180],{}," for invalid data adds ",[488,2971,2972],{},"errors",", the messages by field path.",[647,2975,2977],{"id":2976},"related-resources","Related resources",[1152,2979,2980,2986,2992,3004],{},[1155,2981,2982,2985],{},[497,2983,2984],{"href":206},"Access control",": roles and rules.",[1155,2987,2988,2991],{},[497,2989,2990],{"href":210},"API keys",": create keys and set what they may do.",[1155,2993,2994,2996,2997,659,2999,666,3001,3003],{},[497,2995,147],{"href":148},": ",[488,2998,2910],{},[488,3000,2929],{},[488,3002,2923],{}," in detail.",[1155,3005,3006,666,3008,3010],{},[497,3007,337],{"href":338},[497,3009,341],{"href":342},": every method and route.",[3012,3013,3014],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}",{"title":507,"searchDepth":547,"depth":547,"links":3016},[3017,3022,3023,3028,3029],{"id":649,"depth":547,"text":650,"children":3018},[3019,3020,3021],{"id":739,"depth":554,"text":740},{"id":779,"depth":554,"text":780},{"id":964,"depth":554,"text":965},{"id":1086,"depth":547,"text":1087},{"id":1183,"depth":547,"text":1184,"children":3024},[3025,3026,3027],{"id":1194,"depth":554,"text":1195},{"id":1445,"depth":554,"text":1446},{"id":2690,"depth":554,"text":2691},{"id":2891,"depth":547,"text":2892},{"id":2976,"depth":547,"text":2977},"Read and write content from the browser or another service.","md",null,{},{"title":159,"description":3030},"w4yGaCUcsmHxsniPNXpf3lRNBAy02uv8fqfyExCUA6M",[3037,3039],{"title":155,"path":156,"stem":157,"description":3038,"children":-1},"Publish or unpublish a document at a set time, with a built-in job.",{"title":163,"path":164,"stem":165,"description":3040,"children":-1},"Use Tenon from a site on another origin, an app or a service, or run it without a site.",1795884672880]