[{"data":1,"prerenderedAt":3348},["ShallowReactive",2],{"navigation_docs":3,"-developers-collections":613,"-developers-collections-surround":3345},[4,39,101,378,540,562,584,606],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":38},"Start","i-lucide-rocket","\u002Fstart","1.start",[10,14,18,22,26,30,34],{"title":11,"path":12,"stem":13},"Our approach","\u002Fstart\u002Four-approach","1.start\u002F0.our-approach",{"title":15,"path":16,"stem":17},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction",{"title":19,"path":20,"stem":21},"Concepts","\u002Fstart\u002Fconcepts","1.start\u002F2.concepts",{"title":23,"path":24,"stem":25},"Glossary","\u002Fstart\u002Fglossary","1.start\u002F3.glossary",{"title":27,"path":28,"stem":29},"Try it locally","\u002Fstart\u002Ftry-it-locally","1.start\u002F4.try-it-locally",{"title":31,"path":32,"stem":33},"Features","\u002Fstart\u002Ffeatures","1.start\u002F5.features",{"title":35,"path":36,"stem":37},"Questions","\u002Fstart\u002Ffaq","1.start\u002F6.faq",false,{"title":40,"icon":41,"path":42,"stem":43,"children":44,"page":38},"Run SHADE","i-lucide-server","\u002Frun","2.run",[45,49,53,57,61,65,69,73,77,81,85,89,93,97],{"title":46,"path":47,"stem":48},"Setting up an instance (Coolify)","\u002Frun\u002Fcoolify","2.run\u002F1.coolify",{"title":50,"path":51,"stem":52},"Console commands","\u002Frun\u002Fconsole","2.run\u002F10.console",{"title":54,"path":55,"stem":56},"Rotating APP_SECRET","\u002Frun\u002Frotating-app-secret","2.run\u002F11.rotating-app-secret",{"title":58,"path":59,"stem":60},"Checking an instance","\u002Frun\u002Fdoctor","2.run\u002F12.doctor",{"title":62,"path":63,"stem":64},"Self-hosting by hand","\u002Frun\u002Fown-server-by-hand","2.run\u002F13.own-server-by-hand",{"title":66,"path":67,"stem":68},"NixOS (experimental)","\u002Frun\u002Fnixos","2.run\u002F14.nixos",{"title":70,"path":71,"stem":72},"Self-hosting without Coolify","\u002Frun\u002Fown-server","2.run\u002F2.own-server",{"title":74,"path":75,"stem":76},"Hosting the site on a static host","\u002Frun\u002Fstatic-hosts","2.run\u002F3.static-hosts",{"title":78,"path":79,"stem":80},"Licence","\u002Frun\u002Flicence","2.run\u002F4.licence",{"title":82,"path":83,"stem":84},"Updating and backups","\u002Frun\u002Fupdating-and-backups","2.run\u002F5.updating-and-backups",{"title":86,"path":87,"stem":88},"Troubleshooting","\u002Frun\u002Ftroubleshooting","2.run\u002F6.troubleshooting",{"title":90,"path":91,"stem":92},"Logs, request ids, traces and metrics","\u002Frun\u002Flogs","2.run\u002F7.logs",{"title":94,"path":95,"stem":96},"Maintenance mode","\u002Frun\u002Fmaintenance-mode","2.run\u002F8.maintenance-mode",{"title":98,"path":99,"stem":100},"Usage limits","\u002Frun\u002Fusage-limits","2.run\u002F9.usage-limits",{"title":102,"icon":103,"path":104,"stem":105,"children":106},"Guide","i-lucide-book-open","\u002Fguide","3.guide",[107,109,147,192,210,280,310,364],{"title":102,"path":104,"stem":108},"3.guide\u002Findex",{"title":110,"icon":111,"path":112,"stem":113,"children":114,"page":38},"Content","i-lucide-file-text","\u002Fguide\u002Fcontent","3.guide\u002F1.content",[115,119,123,127,131,135,139,143],{"title":116,"path":117,"stem":118},"Collections and entries","\u002Fguide\u002Fcontent\u002Fcollections","3.guide\u002F1.content\u002F1.collections",{"title":120,"path":121,"stem":122},"Field types","\u002Fguide\u002Fcontent\u002Ffields","3.guide\u002F1.content\u002F2.fields",{"title":124,"path":125,"stem":126},"Drafts, publishing and version history","\u002Fguide\u002Fcontent\u002Fversions","3.guide\u002F1.content\u002F3.versions",{"title":128,"path":129,"stem":130},"Languages","\u002Fguide\u002Fcontent\u002Flanguages","3.guide\u002F1.content\u002F4.languages",{"title":132,"path":133,"stem":134},"Data sources","\u002Fguide\u002Fcontent\u002Fdata-sources","3.guide\u002F1.content\u002F5.data-sources",{"title":136,"path":137,"stem":138},"Media","\u002Fguide\u002Fcontent\u002Fmedia","3.guide\u002F1.content\u002F6.media",{"title":140,"path":141,"stem":142},"Search","\u002Fguide\u002Fcontent\u002Fsearch","3.guide\u002F1.content\u002F7.search",{"title":144,"path":145,"stem":146},"Trash","\u002Fguide\u002Fcontent\u002Ftrash","3.guide\u002F1.content\u002F8.trash",{"title":148,"icon":149,"path":150,"stem":151,"children":152,"page":38},"Website","i-lucide-globe","\u002Fguide\u002Fwebsite","3.guide\u002F2.website",[153,156,160,164,168,172,176,180,184,188],{"title":148,"path":154,"stem":155},"\u002Fguide\u002Fwebsite\u002Fwebsite","3.guide\u002F2.website\u002F1.website",{"title":157,"path":158,"stem":159},"Scroll scenes","\u002Fguide\u002Fwebsite\u002Fscroll-scenes","3.guide\u002F2.website\u002F10.scroll-scenes",{"title":161,"path":162,"stem":163},"Pages and posts","\u002Fguide\u002Fwebsite\u002Fpages","3.guide\u002F2.website\u002F2.pages",{"title":165,"path":166,"stem":167},"The visual editor","\u002Fguide\u002Fwebsite\u002Fvisual-editor","3.guide\u002F2.website\u002F3.visual-editor",{"title":169,"path":170,"stem":171},"Roles and locks","\u002Fguide\u002Fwebsite\u002Froles-and-locks","3.guide\u002F2.website\u002F4.roles-and-locks",{"title":173,"path":174,"stem":175},"Header and footer","\u002Fguide\u002Fwebsite\u002Fheader-and-footer","3.guide\u002F2.website\u002F5.header-and-footer",{"title":177,"path":178,"stem":179},"Theme","\u002Fguide\u002Fwebsite\u002Ftheme","3.guide\u002F2.website\u002F6.theme",{"title":181,"path":182,"stem":183},"Redirects","\u002Fguide\u002Fwebsite\u002Fredirects","3.guide\u002F2.website\u002F7.redirects",{"title":185,"path":186,"stem":187},"Site settings","\u002Fguide\u002Fwebsite\u002Fsite-settings","3.guide\u002F2.website\u002F8.site-settings",{"title":189,"path":190,"stem":191},"The site","\u002Fguide\u002Fwebsite\u002Fthe-site","3.guide\u002F2.website\u002F9.the-site",{"title":193,"icon":194,"path":195,"stem":196,"children":197,"page":38},"Publishing","i-lucide-send","\u002Fguide\u002Fpublishing","3.guide\u002F3.publishing",[198,202,206],{"title":199,"path":200,"stem":201},"Publishing and preview","\u002Fguide\u002Fpublishing\u002Fpublishing","3.guide\u002F3.publishing\u002F1.publishing",{"title":203,"path":204,"stem":205},"Builds","\u002Fguide\u002Fpublishing\u002Fbuilds","3.guide\u002F3.publishing\u002F2.builds",{"title":207,"path":208,"stem":209},"CDN caches","\u002Fguide\u002Fpublishing\u002Fcaches","3.guide\u002F3.publishing\u002F3.caches",{"title":211,"icon":212,"path":213,"stem":214,"children":215,"page":38},"People, security and privacy","i-lucide-shield","\u002Fguide\u002Fpeople-and-security","3.guide\u002F4.people-and-security",[216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276],{"title":217,"path":218,"stem":219},"People in SHADE","\u002Fguide\u002Fpeople-and-security\u002Fpeople-in-shade","3.guide\u002F4.people-and-security\u002F0.people-in-shade",{"title":221,"path":222,"stem":223},"Team and roles","\u002Fguide\u002Fpeople-and-security\u002Fteam","3.guide\u002F4.people-and-security\u002F1.team",{"title":225,"path":226,"stem":227},"Errors and security alerts","\u002Fguide\u002Fpeople-and-security\u002Ferrors","3.guide\u002F4.people-and-security\u002F10.errors",{"title":229,"path":230,"stem":231},"Exporting an instance","\u002Fguide\u002Fpeople-and-security\u002Fexporting","3.guide\u002F4.people-and-security\u002F11.exporting",{"title":233,"path":234,"stem":235},"Organisations","\u002Fguide\u002Fpeople-and-security\u002Forganisations","3.guide\u002F4.people-and-security\u002F12.organisations",{"title":237,"path":238,"stem":239},"Signing in through an identity provider (team)","\u002Fguide\u002Fpeople-and-security\u002Fidentity-providers","3.guide\u002F4.people-and-security\u002F13.identity-providers",{"title":241,"path":242,"stem":243},"System status","\u002Fguide\u002Fpeople-and-security\u002Fsystem-status","3.guide\u002F4.people-and-security\u002F14.system-status",{"title":245,"path":246,"stem":247},"Appearance","\u002Fguide\u002Fpeople-and-security\u002Fappearance","3.guide\u002F4.people-and-security\u002F15.appearance",{"title":249,"path":250,"stem":251},"Accounts and personal pages","\u002Fguide\u002Fpeople-and-security\u002Faccounts","3.guide\u002F4.people-and-security\u002F2.accounts",{"title":253,"path":254,"stem":255},"Signing in (team)","\u002Fguide\u002Fpeople-and-security\u002Fsign-in","3.guide\u002F4.people-and-security\u002F3.sign-in",{"title":257,"path":258,"stem":259},"API tokens","\u002Fguide\u002Fpeople-and-security\u002Fapi-tokens","3.guide\u002F4.people-and-security\u002F4.api-tokens",{"title":261,"path":262,"stem":263},"Audit log","\u002Fguide\u002Fpeople-and-security\u002Faudit","3.guide\u002F4.people-and-security\u002F5.audit",{"title":265,"path":266,"stem":267},"Request protection","\u002Fguide\u002Fpeople-and-security\u002Fprotection","3.guide\u002F4.people-and-security\u002F6.protection",{"title":269,"path":270,"stem":271},"Personal data per person","\u002Fguide\u002Fpeople-and-security\u002Fprivacy","3.guide\u002F4.people-and-security\u002F7.privacy",{"title":273,"path":274,"stem":275},"Data retention","\u002Fguide\u002Fpeople-and-security\u002Fretention","3.guide\u002F4.people-and-security\u002F8.retention",{"title":277,"path":278,"stem":279},"Consent banner","\u002Fguide\u002Fpeople-and-security\u002Fconsent","3.guide\u002F4.people-and-security\u002F9.consent",{"title":281,"icon":282,"path":283,"stem":284,"children":285,"page":38},"Services","i-lucide-plug","\u002Fguide\u002Fservices","3.guide\u002F5.services",[286,290,294,298,302,306],{"title":287,"path":288,"stem":289},"Email","\u002Fguide\u002Fservices\u002Femail","3.guide\u002F5.services\u002F1.email",{"title":291,"path":292,"stem":293},"Opening hours","\u002Fguide\u002Fservices\u002Fopening-hours","3.guide\u002F5.services\u002F4.opening-hours",{"title":295,"path":296,"stem":297},"Webhooks","\u002Fguide\u002Fservices\u002Fwebhooks","3.guide\u002F5.services\u002F5.webhooks",{"title":299,"path":300,"stem":301},"Locations","\u002Fguide\u002Fservices\u002Flocations","3.guide\u002F5.services\u002F6.locations",{"title":303,"path":304,"stem":305},"VAT rates","\u002Fguide\u002Fservices\u002Fvat-rates","3.guide\u002F5.services\u002F7.vat-rates",{"title":307,"path":308,"stem":309},"Channels","\u002Fguide\u002Fservices\u002Fchannels","3.guide\u002F5.services\u002F8.channels",{"title":311,"icon":312,"path":313,"stem":314,"children":315,"page":38},"InstalledModules","i-lucide-puzzle","\u002Fguide\u002Fmodules","3.guide\u002F6.modules",[316,320,324,328,332,336,340,344,348,352,356,360],{"title":317,"path":318,"stem":319},"Modules","\u002Fguide\u002Fmodules\u002Fmanaging","3.guide\u002F6.modules\u002F1.managing",{"title":321,"path":322,"stem":323},"Dutch services (module)","\u002Fguide\u002Fmodules\u002Fnl","3.guide\u002F6.modules\u002F10.nl",{"title":325,"path":326,"stem":327},"Editorial (module)","\u002Fguide\u002Fmodules\u002Feditorial","3.guide\u002F6.modules\u002F11.editorial",{"title":329,"path":330,"stem":331},"Appointments (module)","\u002Fguide\u002Fmodules\u002Fappointments","3.guide\u002F6.modules\u002F2.appointments",{"title":333,"path":334,"stem":335},"Shop (the commerce module)","\u002Fguide\u002Fmodules\u002Fshop","3.guide\u002F6.modules\u002F3.shop",{"title":337,"path":338,"stem":339},"Untrusted modules","\u002Fguide\u002Fmodules\u002Funtrusted","3.guide\u002F6.modules\u002F4.untrusted",{"title":341,"path":342,"stem":343},"Analytics (module)","\u002Fguide\u002Fmodules\u002Fanalytics","3.guide\u002F6.modules\u002F5.analytics",{"title":345,"path":346,"stem":347},"Error forwarding (module)","\u002Fguide\u002Fmodules\u002Ferror-forwarding","3.guide\u002F6.modules\u002F6.error-forwarding",{"title":349,"path":350,"stem":351},"Client programs","\u002Fguide\u002Fmodules\u002Fprograms","3.guide\u002F6.modules\u002F7.programs",{"title":353,"path":354,"stem":355},"Import and export (module)","\u002Fguide\u002Fmodules\u002Fimport","3.guide\u002F6.modules\u002F8.import",{"title":357,"path":358,"stem":359},"Payments (module)","\u002Fguide\u002Fmodules\u002Fpayments","3.guide\u002F6.modules\u002F8.payments",{"title":361,"path":362,"stem":363},"Forms (module)","\u002Fguide\u002Fmodules\u002Fforms","3.guide\u002F6.modules\u002F9.forms",{"title":365,"icon":366,"path":367,"stem":368,"children":369,"page":38},"AI assistants","i-lucide-bot","\u002Fguide\u002Fai","3.guide\u002F7.ai",[370,374],{"title":371,"path":372,"stem":373},"AI assistants (MCP)","\u002Fguide\u002Fai\u002Fassistants","3.guide\u002F7.ai\u002F1.assistants",{"title":375,"path":376,"stem":377},"Connecting an AI assistant","\u002Fguide\u002Fai\u002Fconnecting","3.guide\u002F7.ai\u002F2.connecting",{"title":379,"icon":380,"path":381,"stem":382,"children":383,"page":38},"Developers","i-lucide-code","\u002Fdevelopers","4.developers",[384,388,392,396,400,404,408,412,416,420,424,428,432,435,489,493,497,501,536],{"title":385,"path":386,"stem":387},"Architecture","\u002Fdevelopers\u002Farchitecture","4.developers\u002F1.architecture",{"title":389,"path":390,"stem":391},"Capabilities","\u002Fdevelopers\u002Fcapabilities","4.developers\u002F10.capabilities",{"title":393,"path":394,"stem":395},"Trust","\u002Fdevelopers\u002Ftrust","4.developers\u002F11.trust",{"title":397,"path":398,"stem":399},"Redis and the ports","\u002Fdevelopers\u002Fredis","4.developers\u002F12.redis",{"title":401,"path":402,"stem":403},"The worker container role","\u002Fdevelopers\u002Fworker","4.developers\u002F13.worker",{"title":405,"path":406,"stem":407},"kv: a module's own key-value storage","\u002Fdevelopers\u002Fkv","4.developers\u002F14.kv",{"title":409,"path":410,"stem":411},"Processes: long-running work on the worker","\u002Fdevelopers\u002Fprocesses","4.developers\u002F15.processes",{"title":413,"path":414,"stem":415},"Network: a module's outgoing calls","\u002Fdevelopers\u002Fnetwork","4.developers\u002F16.network",{"title":417,"path":418,"stem":419},"Realtime","\u002Fdevelopers\u002Frealtime","4.developers\u002F17.realtime",{"title":421,"path":422,"stem":423},"Private files","\u002Fdevelopers\u002Ffiles","4.developers\u002F18.files",{"title":425,"path":426,"stem":427},"Notify","\u002Fdevelopers\u002Fnotify","4.developers\u002F19.notify",{"title":429,"path":430,"stem":431},"Collections","\u002Fdevelopers\u002Fcollections","4.developers\u002F2.collections",{"title":337,"path":433,"stem":434},"\u002Fdevelopers\u002Funtrusted","4.developers\u002F20.untrusted",{"title":436,"icon":312,"path":437,"stem":438,"children":439},"Writing a plugin","\u002Fdevelopers\u002Fmodules","4.developers\u002F3.modules\u002Findex",[440,442,446,450,454,458,462,466,470,473,477,481,485],{"title":441,"path":437,"stem":438},"Writing a module",{"title":443,"path":444,"stem":445},"Module SDK and tooling","\u002Fdevelopers\u002Fmodules\u002Fsdk-and-tooling","4.developers\u002F3.modules\u002F1.sdk-and-tooling",{"title":447,"path":448,"stem":449},"Connecting accounts with OAuth2","\u002Fdevelopers\u002Fmodules\u002Foauth","4.developers\u002F3.modules\u002F10.oauth",{"title":451,"path":452,"stem":453},"Calls between modules","\u002Fdevelopers\u002Fmodules\u002Fcalls-between-modules","4.developers\u002F3.modules\u002F11.calls-between-modules",{"title":455,"path":456,"stem":457},"Experimental parts","\u002Fdevelopers\u002Fmodules\u002Fexperimental-parts","4.developers\u002F3.modules\u002F12.experimental-parts",{"title":459,"path":460,"stem":461},"The manifest","\u002Fdevelopers\u002Fmodules\u002Fmanifest","4.developers\u002F3.modules\u002F2.manifest",{"title":463,"path":464,"stem":465},"Routes","\u002Fdevelopers\u002Fmodules\u002Froutes","4.developers\u002F3.modules\u002F3.routes",{"title":467,"path":468,"stem":469},"Admin screens and the site part","\u002Fdevelopers\u002Fmodules\u002Fadmin-and-site","4.developers\u002F3.modules\u002F4.admin-and-site",{"title":110,"path":471,"stem":472},"\u002Fdevelopers\u002Fmodules\u002Fcontent","4.developers\u002F3.modules\u002F5.content",{"title":474,"path":475,"stem":476},"Background work and services","\u002Fdevelopers\u002Fmodules\u002Fbackground-and-services","4.developers\u002F3.modules\u002F6.background-and-services",{"title":478,"path":479,"stem":480},"SDK reference","\u002Fdevelopers\u002Fmodules\u002Fsdk-reference","4.developers\u002F3.modules\u002F7.sdk-reference",{"title":482,"path":483,"stem":484},"The website module's SDK","\u002Fdevelopers\u002Fmodules\u002Fwebsite-sdk","4.developers\u002F3.modules\u002F8.website-sdk",{"title":486,"path":487,"stem":488},"Incoming webhooks","\u002Fdevelopers\u002Fmodules\u002Fincoming-webhooks","4.developers\u002F3.modules\u002F9.incoming-webhooks",{"title":490,"path":491,"stem":492},"Core and the website module","\u002Fdevelopers\u002Fcore-and-website-module","4.developers\u002F4.core-and-website-module",{"title":494,"path":495,"stem":496},"The API","\u002Fdevelopers\u002Fapi","4.developers\u002F6.api",{"title":498,"path":499,"stem":500},"API reference","\u002Fdevelopers\u002Fapi-reference","4.developers\u002F6.api-reference",{"title":502,"icon":503,"path":504,"stem":505,"children":506},"Sites in other frameworks","i-lucide-layout-template","\u002Fdevelopers\u002Fframeworks","4.developers\u002F7.frameworks\u002Findex",[507,508,512,516,520,524,528,532],{"title":502,"path":504,"stem":505},{"title":509,"path":510,"stem":511},"Accounts: sign-in and modules' routes","\u002Fdevelopers\u002Fframeworks\u002Faccounts","4.developers\u002F7.frameworks\u002F1.accounts",{"title":513,"path":514,"stem":515},"`@shadestack\u002Ftree`","\u002Fdevelopers\u002Fframeworks\u002Ftree","4.developers\u002F7.frameworks\u002F2.tree",{"title":517,"path":518,"stem":519},"Expressions and styles","\u002Fdevelopers\u002Fframeworks\u002Fexpressions-and-styles","4.developers\u002F7.frameworks\u002F3.expressions-and-styles",{"title":521,"path":522,"stem":523},"`@shadestack\u002Frender`","\u002Fdevelopers\u002Fframeworks\u002Frender","4.developers\u002F7.frameworks\u002F4.render",{"title":525,"path":526,"stem":527},"`@shadestack\u002Finteractions`","\u002Fdevelopers\u002Fframeworks\u002Finteractions","4.developers\u002F7.frameworks\u002F5.interactions",{"title":529,"path":530,"stem":531},"`@shadestack\u002Fa11y`","\u002Fdevelopers\u002Fframeworks\u002Fa11y","4.developers\u002F7.frameworks\u002F6.a11y",{"title":533,"path":534,"stem":535},"Your own page for SHADE's links","\u002Fdevelopers\u002Fframeworks\u002Flinks","4.developers\u002F7.frameworks\u002F7.links",{"title":537,"path":538,"stem":539},"Build a client module","\u002Fdevelopers\u002Fclient-module","4.developers\u002F9.client-module",{"title":541,"icon":542,"path":543,"stem":544,"children":545,"page":38},"Security","i-lucide-shield-check","\u002Fsecurity","5.security",[546,550,554,558],{"title":547,"path":548,"stem":549},"Reporting a vulnerability","\u002Fsecurity\u002Freporting","5.security\u002F0.reporting",{"title":551,"path":552,"stem":553},"Security testing","\u002Fsecurity\u002Ftesting","5.security\u002F1.testing",{"title":555,"path":556,"stem":557},"Hardening a production instance","\u002Fsecurity\u002Fhardening","5.security\u002F2.hardening",{"title":559,"path":560,"stem":561},"Manual testing with Kali Linux","\u002Fsecurity\u002Fmanual-testing","5.security\u002F3.manual-testing",{"title":563,"icon":564,"path":565,"stem":566,"children":567,"page":38},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","6.contributing",[568,572,576,580],{"title":569,"path":570,"stem":571},"Reading the code","\u002Fcontributing\u002Freading-the-code","6.contributing\u002F1.reading-the-code",{"title":573,"path":574,"stem":575},"Docs site","\u002Fcontributing\u002Fdocs-site","6.contributing\u002F2.docs-site",{"title":577,"path":578,"stem":579},"Releases","\u002Fcontributing\u002Freleases","6.contributing\u002F3.releases",{"title":581,"path":582,"stem":583},"Load tests","\u002Fcontributing\u002Fload-tests","6.contributing\u002F4.load-tests",{"title":585,"icon":586,"path":587,"stem":588,"children":589,"page":38},"Project","i-lucide-map","\u002Fproject","7.project",[590,594,598,602],{"title":591,"path":592,"stem":593},"Roadmap","\u002Fproject\u002Froadmap","7.project\u002F1.roadmap",{"title":595,"path":596,"stem":597},"Known issues","\u002Fproject\u002Fknown-issues","7.project\u002F2.known-issues",{"title":599,"path":600,"stem":601},"Changelog","\u002Fproject\u002Fchangelog","7.project\u002F3.changelog",{"title":603,"path":604,"stem":605},"Decisions","\u002Fproject\u002Fdecisions","7.project\u002F4.decisions",{"title":607,"path":608,"stem":609,"children":610,"icon":612},"Community","\u002Fcommunity","8.community\u002Findex",[611],{"title":607,"path":608,"stem":609},"i-lucide-users",{"id":614,"title":429,"body":615,"description":781,"extension":3340,"links":3341,"meta":3342,"navigation":822,"path":430,"seo":3343,"stem":431,"__hash__":3344},"docs\u002F4.developers\u002F2.collections.md",{"type":616,"value":617,"toc":3327},"minimark",[618,627,748,751,756,775,1839,1854,1857,1894,1909,1932,1936,2085,2090,2325,2328,2332,2360,2364,2427,2431,2493,2497,2508,2511,2618,2632,2643,2647,2658,2695,2720,2898,2941,2955,2958,3107,3110,3116,3201,3225,3228,3238,3323],[619,620,621,622,626],"p",{},"Collections are the content types of SHADE. Core has none built in; modules add their own: the website module's\npages, navigation, footer and posts, the shop's products, or a client's own module's events or vacancies\n(",[623,624,625],"a",{"href":538},"Writing a client module","). One definition in code drives everything:",[628,629,630,643],"table",{},[631,632,633],"thead",{},[634,635,636,640],"tr",{},[637,638,639],"th",{},"From the definition",[637,641,642],{},"Where",[644,645,646,662,672,684,698,715,725,738],"tbody",{},[634,647,648,657],{},[649,650,651,652,656],"td",{},"TypeScript types (",[653,654,655],"code",{},"EntryData\u003Ctypeof collection>",")",[649,658,659],{},[653,660,661],{},"shade\u002Ffeatures\u002Fentries\u002Fshared\u002Finfer.ts",[634,663,664,667],{},[649,665,666],{},"Validation (Zod, per mode: draft \u002F publish \u002F patch)",[649,668,669],{},[653,670,671],{},"buildEntrySchema",[634,673,674,677],{},[649,675,676],{},"Database tables, versions, child and join tables",[649,678,679,680,683],{},"generator → ",[653,681,682],{},"shade\u002Ffeatures\u002Fentries\u002Fserver\u002Fcollections.generated.sql.ts"," → migration",[634,685,686,692],{},[649,687,688,689],{},"Permissions ",[653,690,691],{},"collections.\u003Cslug>.\u003Cverb>",[649,693,694,695],{},"registered at API startup, typed via ",[653,696,697],{},"ActionRegistry",[634,699,700,710],{},[649,701,702,703,706,707],{},"Admin API ",[653,704,705],{},"\u002Fapi\u002Fcollections\u002F:slug"," and content API ",[653,708,709],{},"\u002Fapi\u002Fv1\u002Fcontent\u002Fcollections\u002F:slug",[649,711,712],{},[653,713,714],{},"apps\u002Fadmin",[634,716,717,720],{},[649,718,719],{},"Admin list and edit screens, sidebar group",[649,721,722],{},[653,723,724],{},"shade\u002Ffeatures\u002Fentries\u002Fadmin",[634,726,727,733],{},[649,728,729,730],{},"SDK client ",[653,731,732],{},"shade.collection('…')",[649,734,735],{},[653,736,737],{},"shade\u002Fsdk",[634,739,740,743],{},[649,741,742],{},"MCP access (opt-in, drafts only)",[649,744,745],{},[653,746,747],{},"shade\u002Ffeatures\u002Fai\u002Fserver\u002Fmcp\u002Fcollection-tools.ts",[619,749,750],{},"Collections compile to real SQL tables rather than a generic table with a JSON blob per row, so the data has real\ncolumns, indexes, foreign keys and join tables, like a dedicated application.",[752,753,755],"h2",{"id":754},"defining-a-collection","Defining a collection",[619,757,758,759,762,763,766,767,770,771,774],{},"Built-in collections live in ",[653,760,761],{},"shade\u002Ffeatures\u002Fentries\u002Fshared\u002Fbuiltin\u002F",". A module lists its collections in its\nmanifest (",[653,764,765],{},"collections: [...]",", slugs prefixed ",[653,768,769],{},"\u003Cplugin>-",") and declares their actions next to them (see\n",[653,772,773],{},"modules\u002Fcommerce\u002Fshared\u002Fcollections.ts","). A definition looks like this:",[776,777,782],"pre",{"className":778,"code":779,"language":780,"meta":781,"style":781},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineCollection } from '@shadestack\u002Fcore\u002Fcollections'\n\nexport const teamMembers = defineCollection({\n  slug: 'team-members',\n  labels: { singular: 'Team member', plural: 'Team members' },\n  titleField: 'name',\n  slugField: 'slug',\n  fields: [\n    { kind: 'text', name: 'name', label: 'Name', required: true, index: true },\n    { kind: 'slug', name: 'slug', label: 'Slug', required: true, unique: true, from: 'name' },\n    { kind: 'email', name: 'email', label: 'Email', unique: true },\n    { kind: 'image', name: 'photo', label: 'Photo' },\n    { kind: 'select', name: 'seniority', label: 'Seniority', options: [\n      { label: 'Junior', value: 'junior' }, { label: 'Medior', value: 'medior' }, { label: 'Senior', value: 'senior' }\n    ] },\n    { kind: 'relation', name: 'department', label: 'Department', to: 'departments' },\n    { kind: 'relation', name: 'skills', label: 'Skills', to: 'skills', many: true },\n    { kind: 'repeater', name: 'links', label: 'Links', fields: [\n      { kind: 'text', name: 'label', label: 'Label', required: true },\n      { kind: 'url', name: 'url', label: 'URL', required: true }\n    ] },\n    { kind: 'richtext', name: 'bio', label: 'Bio' }\n  ],\n  admin: { group: 'Company', icon: 'i-lucide-users', listColumns: ['name', 'seniority', 'status', 'updatedAt'] },\n  publicApi: {},\n  access: { editor: ['read', 'create', 'update', 'publish', 'delete'] }\n})\n","ts","",[653,783,784,817,824,849,870,910,927,944,955,1022,1093,1143,1187,1238,1329,1338,1396,1460,1511,1562,1613,1620,1664,1672,1754,1765,1830],{"__ignoreMap":781},[785,786,789,793,797,801,804,807,810,814],"span",{"class":787,"line":788},"line",1,[785,790,792],{"class":791},"s7zQu","import",[785,794,796],{"class":795},"sMK4o"," {",[785,798,800],{"class":799},"sTEyZ"," defineCollection",[785,802,803],{"class":795}," }",[785,805,806],{"class":791}," from",[785,808,809],{"class":795}," '",[785,811,813],{"class":812},"sfazB","@shadestack\u002Fcore\u002Fcollections",[785,815,816],{"class":795},"'\n",[785,818,820],{"class":787,"line":819},2,[785,821,823],{"emptyLinePlaceholder":822},true,"\n",[785,825,827,830,834,837,840,843,846],{"class":787,"line":826},3,[785,828,829],{"class":791},"export",[785,831,833],{"class":832},"spNyl"," const",[785,835,836],{"class":799}," teamMembers ",[785,838,839],{"class":795},"=",[785,841,800],{"class":842},"s2Zo4",[785,844,845],{"class":799},"(",[785,847,848],{"class":795},"{\n",[785,850,852,856,859,861,864,867],{"class":787,"line":851},4,[785,853,855],{"class":854},"swJcz","  slug",[785,857,858],{"class":795},":",[785,860,809],{"class":795},[785,862,863],{"class":812},"team-members",[785,865,866],{"class":795},"'",[785,868,869],{"class":795},",\n",[785,871,873,876,878,880,883,885,887,890,892,895,898,900,902,905,907],{"class":787,"line":872},5,[785,874,875],{"class":854},"  labels",[785,877,858],{"class":795},[785,879,796],{"class":795},[785,881,882],{"class":854}," singular",[785,884,858],{"class":795},[785,886,809],{"class":795},[785,888,889],{"class":812},"Team member",[785,891,866],{"class":795},[785,893,894],{"class":795},",",[785,896,897],{"class":854}," plural",[785,899,858],{"class":795},[785,901,809],{"class":795},[785,903,904],{"class":812},"Team members",[785,906,866],{"class":795},[785,908,909],{"class":795}," },\n",[785,911,913,916,918,920,923,925],{"class":787,"line":912},6,[785,914,915],{"class":854},"  titleField",[785,917,858],{"class":795},[785,919,809],{"class":795},[785,921,922],{"class":812},"name",[785,924,866],{"class":795},[785,926,869],{"class":795},[785,928,930,933,935,937,940,942],{"class":787,"line":929},7,[785,931,932],{"class":854},"  slugField",[785,934,858],{"class":795},[785,936,809],{"class":795},[785,938,939],{"class":812},"slug",[785,941,866],{"class":795},[785,943,869],{"class":795},[785,945,947,950,952],{"class":787,"line":946},8,[785,948,949],{"class":854},"  fields",[785,951,858],{"class":795},[785,953,954],{"class":799}," [\n",[785,956,958,961,964,966,968,971,973,975,978,980,982,984,986,988,991,993,995,998,1000,1002,1005,1007,1011,1013,1016,1018,1020],{"class":787,"line":957},9,[785,959,960],{"class":795},"    {",[785,962,963],{"class":854}," kind",[785,965,858],{"class":795},[785,967,809],{"class":795},[785,969,970],{"class":812},"text",[785,972,866],{"class":795},[785,974,894],{"class":795},[785,976,977],{"class":854}," name",[785,979,858],{"class":795},[785,981,809],{"class":795},[785,983,922],{"class":812},[785,985,866],{"class":795},[785,987,894],{"class":795},[785,989,990],{"class":854}," label",[785,992,858],{"class":795},[785,994,809],{"class":795},[785,996,997],{"class":812},"Name",[785,999,866],{"class":795},[785,1001,894],{"class":795},[785,1003,1004],{"class":854}," required",[785,1006,858],{"class":795},[785,1008,1010],{"class":1009},"sfNiH"," true",[785,1012,894],{"class":795},[785,1014,1015],{"class":854}," index",[785,1017,858],{"class":795},[785,1019,1010],{"class":1009},[785,1021,909],{"class":795},[785,1023,1025,1027,1029,1031,1033,1035,1037,1039,1041,1043,1045,1047,1049,1051,1053,1055,1057,1060,1062,1064,1066,1068,1070,1072,1075,1077,1079,1081,1083,1085,1087,1089,1091],{"class":787,"line":1024},10,[785,1026,960],{"class":795},[785,1028,963],{"class":854},[785,1030,858],{"class":795},[785,1032,809],{"class":795},[785,1034,939],{"class":812},[785,1036,866],{"class":795},[785,1038,894],{"class":795},[785,1040,977],{"class":854},[785,1042,858],{"class":795},[785,1044,809],{"class":795},[785,1046,939],{"class":812},[785,1048,866],{"class":795},[785,1050,894],{"class":795},[785,1052,990],{"class":854},[785,1054,858],{"class":795},[785,1056,809],{"class":795},[785,1058,1059],{"class":812},"Slug",[785,1061,866],{"class":795},[785,1063,894],{"class":795},[785,1065,1004],{"class":854},[785,1067,858],{"class":795},[785,1069,1010],{"class":1009},[785,1071,894],{"class":795},[785,1073,1074],{"class":854}," unique",[785,1076,858],{"class":795},[785,1078,1010],{"class":1009},[785,1080,894],{"class":795},[785,1082,806],{"class":854},[785,1084,858],{"class":795},[785,1086,809],{"class":795},[785,1088,922],{"class":812},[785,1090,866],{"class":795},[785,1092,909],{"class":795},[785,1094,1096,1098,1100,1102,1104,1107,1109,1111,1113,1115,1117,1119,1121,1123,1125,1127,1129,1131,1133,1135,1137,1139,1141],{"class":787,"line":1095},11,[785,1097,960],{"class":795},[785,1099,963],{"class":854},[785,1101,858],{"class":795},[785,1103,809],{"class":795},[785,1105,1106],{"class":812},"email",[785,1108,866],{"class":795},[785,1110,894],{"class":795},[785,1112,977],{"class":854},[785,1114,858],{"class":795},[785,1116,809],{"class":795},[785,1118,1106],{"class":812},[785,1120,866],{"class":795},[785,1122,894],{"class":795},[785,1124,990],{"class":854},[785,1126,858],{"class":795},[785,1128,809],{"class":795},[785,1130,287],{"class":812},[785,1132,866],{"class":795},[785,1134,894],{"class":795},[785,1136,1074],{"class":854},[785,1138,858],{"class":795},[785,1140,1010],{"class":1009},[785,1142,909],{"class":795},[785,1144,1146,1148,1150,1152,1154,1157,1159,1161,1163,1165,1167,1170,1172,1174,1176,1178,1180,1183,1185],{"class":787,"line":1145},12,[785,1147,960],{"class":795},[785,1149,963],{"class":854},[785,1151,858],{"class":795},[785,1153,809],{"class":795},[785,1155,1156],{"class":812},"image",[785,1158,866],{"class":795},[785,1160,894],{"class":795},[785,1162,977],{"class":854},[785,1164,858],{"class":795},[785,1166,809],{"class":795},[785,1168,1169],{"class":812},"photo",[785,1171,866],{"class":795},[785,1173,894],{"class":795},[785,1175,990],{"class":854},[785,1177,858],{"class":795},[785,1179,809],{"class":795},[785,1181,1182],{"class":812},"Photo",[785,1184,866],{"class":795},[785,1186,909],{"class":795},[785,1188,1190,1192,1194,1196,1198,1201,1203,1205,1207,1209,1211,1214,1216,1218,1220,1222,1224,1227,1229,1231,1234,1236],{"class":787,"line":1189},13,[785,1191,960],{"class":795},[785,1193,963],{"class":854},[785,1195,858],{"class":795},[785,1197,809],{"class":795},[785,1199,1200],{"class":812},"select",[785,1202,866],{"class":795},[785,1204,894],{"class":795},[785,1206,977],{"class":854},[785,1208,858],{"class":795},[785,1210,809],{"class":795},[785,1212,1213],{"class":812},"seniority",[785,1215,866],{"class":795},[785,1217,894],{"class":795},[785,1219,990],{"class":854},[785,1221,858],{"class":795},[785,1223,809],{"class":795},[785,1225,1226],{"class":812},"Seniority",[785,1228,866],{"class":795},[785,1230,894],{"class":795},[785,1232,1233],{"class":854}," options",[785,1235,858],{"class":795},[785,1237,954],{"class":799},[785,1239,1241,1244,1246,1248,1250,1253,1255,1257,1260,1262,1264,1267,1269,1272,1274,1276,1278,1280,1283,1285,1287,1289,1291,1293,1296,1298,1300,1302,1304,1306,1308,1311,1313,1315,1317,1319,1321,1324,1326],{"class":787,"line":1240},14,[785,1242,1243],{"class":795},"      {",[785,1245,990],{"class":854},[785,1247,858],{"class":795},[785,1249,809],{"class":795},[785,1251,1252],{"class":812},"Junior",[785,1254,866],{"class":795},[785,1256,894],{"class":795},[785,1258,1259],{"class":854}," value",[785,1261,858],{"class":795},[785,1263,809],{"class":795},[785,1265,1266],{"class":812},"junior",[785,1268,866],{"class":795},[785,1270,1271],{"class":795}," },",[785,1273,796],{"class":795},[785,1275,990],{"class":854},[785,1277,858],{"class":795},[785,1279,809],{"class":795},[785,1281,1282],{"class":812},"Medior",[785,1284,866],{"class":795},[785,1286,894],{"class":795},[785,1288,1259],{"class":854},[785,1290,858],{"class":795},[785,1292,809],{"class":795},[785,1294,1295],{"class":812},"medior",[785,1297,866],{"class":795},[785,1299,1271],{"class":795},[785,1301,796],{"class":795},[785,1303,990],{"class":854},[785,1305,858],{"class":795},[785,1307,809],{"class":795},[785,1309,1310],{"class":812},"Senior",[785,1312,866],{"class":795},[785,1314,894],{"class":795},[785,1316,1259],{"class":854},[785,1318,858],{"class":795},[785,1320,809],{"class":795},[785,1322,1323],{"class":812},"senior",[785,1325,866],{"class":795},[785,1327,1328],{"class":795}," }\n",[785,1330,1332,1335],{"class":787,"line":1331},15,[785,1333,1334],{"class":799},"    ] ",[785,1336,1337],{"class":795},"},\n",[785,1339,1341,1343,1345,1347,1349,1352,1354,1356,1358,1360,1362,1365,1367,1369,1371,1373,1375,1378,1380,1382,1385,1387,1389,1392,1394],{"class":787,"line":1340},16,[785,1342,960],{"class":795},[785,1344,963],{"class":854},[785,1346,858],{"class":795},[785,1348,809],{"class":795},[785,1350,1351],{"class":812},"relation",[785,1353,866],{"class":795},[785,1355,894],{"class":795},[785,1357,977],{"class":854},[785,1359,858],{"class":795},[785,1361,809],{"class":795},[785,1363,1364],{"class":812},"department",[785,1366,866],{"class":795},[785,1368,894],{"class":795},[785,1370,990],{"class":854},[785,1372,858],{"class":795},[785,1374,809],{"class":795},[785,1376,1377],{"class":812},"Department",[785,1379,866],{"class":795},[785,1381,894],{"class":795},[785,1383,1384],{"class":854}," to",[785,1386,858],{"class":795},[785,1388,809],{"class":795},[785,1390,1391],{"class":812},"departments",[785,1393,866],{"class":795},[785,1395,909],{"class":795},[785,1397,1399,1401,1403,1405,1407,1409,1411,1413,1415,1417,1419,1422,1424,1426,1428,1430,1432,1435,1437,1439,1441,1443,1445,1447,1449,1451,1454,1456,1458],{"class":787,"line":1398},17,[785,1400,960],{"class":795},[785,1402,963],{"class":854},[785,1404,858],{"class":795},[785,1406,809],{"class":795},[785,1408,1351],{"class":812},[785,1410,866],{"class":795},[785,1412,894],{"class":795},[785,1414,977],{"class":854},[785,1416,858],{"class":795},[785,1418,809],{"class":795},[785,1420,1421],{"class":812},"skills",[785,1423,866],{"class":795},[785,1425,894],{"class":795},[785,1427,990],{"class":854},[785,1429,858],{"class":795},[785,1431,809],{"class":795},[785,1433,1434],{"class":812},"Skills",[785,1436,866],{"class":795},[785,1438,894],{"class":795},[785,1440,1384],{"class":854},[785,1442,858],{"class":795},[785,1444,809],{"class":795},[785,1446,1421],{"class":812},[785,1448,866],{"class":795},[785,1450,894],{"class":795},[785,1452,1453],{"class":854}," many",[785,1455,858],{"class":795},[785,1457,1010],{"class":1009},[785,1459,909],{"class":795},[785,1461,1463,1465,1467,1469,1471,1474,1476,1478,1480,1482,1484,1487,1489,1491,1493,1495,1497,1500,1502,1504,1507,1509],{"class":787,"line":1462},18,[785,1464,960],{"class":795},[785,1466,963],{"class":854},[785,1468,858],{"class":795},[785,1470,809],{"class":795},[785,1472,1473],{"class":812},"repeater",[785,1475,866],{"class":795},[785,1477,894],{"class":795},[785,1479,977],{"class":854},[785,1481,858],{"class":795},[785,1483,809],{"class":795},[785,1485,1486],{"class":812},"links",[785,1488,866],{"class":795},[785,1490,894],{"class":795},[785,1492,990],{"class":854},[785,1494,858],{"class":795},[785,1496,809],{"class":795},[785,1498,1499],{"class":812},"Links",[785,1501,866],{"class":795},[785,1503,894],{"class":795},[785,1505,1506],{"class":854}," fields",[785,1508,858],{"class":795},[785,1510,954],{"class":799},[785,1512,1514,1516,1518,1520,1522,1524,1526,1528,1530,1532,1534,1537,1539,1541,1543,1545,1547,1550,1552,1554,1556,1558,1560],{"class":787,"line":1513},19,[785,1515,1243],{"class":795},[785,1517,963],{"class":854},[785,1519,858],{"class":795},[785,1521,809],{"class":795},[785,1523,970],{"class":812},[785,1525,866],{"class":795},[785,1527,894],{"class":795},[785,1529,977],{"class":854},[785,1531,858],{"class":795},[785,1533,809],{"class":795},[785,1535,1536],{"class":812},"label",[785,1538,866],{"class":795},[785,1540,894],{"class":795},[785,1542,990],{"class":854},[785,1544,858],{"class":795},[785,1546,809],{"class":795},[785,1548,1549],{"class":812},"Label",[785,1551,866],{"class":795},[785,1553,894],{"class":795},[785,1555,1004],{"class":854},[785,1557,858],{"class":795},[785,1559,1010],{"class":1009},[785,1561,909],{"class":795},[785,1563,1565,1567,1569,1571,1573,1576,1578,1580,1582,1584,1586,1588,1590,1592,1594,1596,1598,1601,1603,1605,1607,1609,1611],{"class":787,"line":1564},20,[785,1566,1243],{"class":795},[785,1568,963],{"class":854},[785,1570,858],{"class":795},[785,1572,809],{"class":795},[785,1574,1575],{"class":812},"url",[785,1577,866],{"class":795},[785,1579,894],{"class":795},[785,1581,977],{"class":854},[785,1583,858],{"class":795},[785,1585,809],{"class":795},[785,1587,1575],{"class":812},[785,1589,866],{"class":795},[785,1591,894],{"class":795},[785,1593,990],{"class":854},[785,1595,858],{"class":795},[785,1597,809],{"class":795},[785,1599,1600],{"class":812},"URL",[785,1602,866],{"class":795},[785,1604,894],{"class":795},[785,1606,1004],{"class":854},[785,1608,858],{"class":795},[785,1610,1010],{"class":1009},[785,1612,1328],{"class":795},[785,1614,1616,1618],{"class":787,"line":1615},21,[785,1617,1334],{"class":799},[785,1619,1337],{"class":795},[785,1621,1623,1625,1627,1629,1631,1634,1636,1638,1640,1642,1644,1647,1649,1651,1653,1655,1657,1660,1662],{"class":787,"line":1622},22,[785,1624,960],{"class":795},[785,1626,963],{"class":854},[785,1628,858],{"class":795},[785,1630,809],{"class":795},[785,1632,1633],{"class":812},"richtext",[785,1635,866],{"class":795},[785,1637,894],{"class":795},[785,1639,977],{"class":854},[785,1641,858],{"class":795},[785,1643,809],{"class":795},[785,1645,1646],{"class":812},"bio",[785,1648,866],{"class":795},[785,1650,894],{"class":795},[785,1652,990],{"class":854},[785,1654,858],{"class":795},[785,1656,809],{"class":795},[785,1658,1659],{"class":812},"Bio",[785,1661,866],{"class":795},[785,1663,1328],{"class":795},[785,1665,1667,1670],{"class":787,"line":1666},23,[785,1668,1669],{"class":799},"  ]",[785,1671,869],{"class":795},[785,1673,1675,1678,1680,1682,1685,1687,1689,1692,1694,1696,1699,1701,1703,1705,1707,1709,1712,1714,1717,1719,1721,1723,1725,1727,1729,1731,1733,1735,1738,1740,1742,1744,1747,1749,1752],{"class":787,"line":1674},24,[785,1676,1677],{"class":854},"  admin",[785,1679,858],{"class":795},[785,1681,796],{"class":795},[785,1683,1684],{"class":854}," group",[785,1686,858],{"class":795},[785,1688,809],{"class":795},[785,1690,1691],{"class":812},"Company",[785,1693,866],{"class":795},[785,1695,894],{"class":795},[785,1697,1698],{"class":854}," icon",[785,1700,858],{"class":795},[785,1702,809],{"class":795},[785,1704,612],{"class":812},[785,1706,866],{"class":795},[785,1708,894],{"class":795},[785,1710,1711],{"class":854}," listColumns",[785,1713,858],{"class":795},[785,1715,1716],{"class":799}," [",[785,1718,866],{"class":795},[785,1720,922],{"class":812},[785,1722,866],{"class":795},[785,1724,894],{"class":795},[785,1726,809],{"class":795},[785,1728,1213],{"class":812},[785,1730,866],{"class":795},[785,1732,894],{"class":795},[785,1734,809],{"class":795},[785,1736,1737],{"class":812},"status",[785,1739,866],{"class":795},[785,1741,894],{"class":795},[785,1743,809],{"class":795},[785,1745,1746],{"class":812},"updatedAt",[785,1748,866],{"class":795},[785,1750,1751],{"class":799},"] ",[785,1753,1337],{"class":795},[785,1755,1757,1760,1762],{"class":787,"line":1756},25,[785,1758,1759],{"class":854},"  publicApi",[785,1761,858],{"class":795},[785,1763,1764],{"class":795}," {},\n",[785,1766,1768,1771,1773,1775,1778,1780,1782,1784,1787,1789,1791,1793,1796,1798,1800,1802,1805,1807,1809,1811,1814,1816,1818,1820,1823,1825,1827],{"class":787,"line":1767},26,[785,1769,1770],{"class":854},"  access",[785,1772,858],{"class":795},[785,1774,796],{"class":795},[785,1776,1777],{"class":854}," editor",[785,1779,858],{"class":795},[785,1781,1716],{"class":799},[785,1783,866],{"class":795},[785,1785,1786],{"class":812},"read",[785,1788,866],{"class":795},[785,1790,894],{"class":795},[785,1792,809],{"class":795},[785,1794,1795],{"class":812},"create",[785,1797,866],{"class":795},[785,1799,894],{"class":795},[785,1801,809],{"class":795},[785,1803,1804],{"class":812},"update",[785,1806,866],{"class":795},[785,1808,894],{"class":795},[785,1810,809],{"class":795},[785,1812,1813],{"class":812},"publish",[785,1815,866],{"class":795},[785,1817,894],{"class":795},[785,1819,809],{"class":795},[785,1821,1822],{"class":812},"delete",[785,1824,866],{"class":795},[785,1826,1751],{"class":799},[785,1828,1829],{"class":795},"}\n",[785,1831,1833,1836],{"class":787,"line":1832},27,[785,1834,1835],{"class":795},"}",[785,1837,1838],{"class":799},")\n",[619,1840,1841,1842,1845,1846,1849,1850,1853],{},"Every link to an entry in the admin (the AI changes, the dashboard, a file's uses) opens the collection's form. A\ncollection a module edits on a screen of its own names it in ",[653,1843,1844],{},"admin.editorRoute",", an admin path in which ",[653,1847,1848],{},":id"," stands\nfor the entry's id (",[653,1851,1852],{},"editorRoute: '\u002Fwebsite\u002Ftheme'"," for a singleton), and those links lead there instead. On the AI\nchanges screen a singleton has no title of its own, so its row carries the collection's name.",[619,1855,1856],{},"Then:",[776,1858,1862],{"className":1859,"code":1860,"language":1861,"meta":781,"style":781},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm db:collections   # regenerate shade\u002Ffeatures\u002Fentries\u002Fserver\u002Fcollections.generated.sql.ts (built-in collections)\npnpm db:generate      # drizzle-kit writes the SQL migration — review it in the PR\npnpm db:migrate\n","sh",[653,1863,1864,1877,1887],{"__ignoreMap":781},[785,1865,1866,1870,1873],{"class":787,"line":788},[785,1867,1869],{"class":1868},"sBMFI","pnpm",[785,1871,1872],{"class":812}," db:collections",[785,1874,1876],{"class":1875},"sHwdD","   # regenerate shade\u002Ffeatures\u002Fentries\u002Fserver\u002Fcollections.generated.sql.ts (built-in collections)\n",[785,1878,1879,1881,1884],{"class":787,"line":819},[785,1880,1869],{"class":1868},[785,1882,1883],{"class":812}," db:generate",[785,1885,1886],{"class":1875},"      # drizzle-kit writes the SQL migration — review it in the PR\n",[785,1888,1889,1891],{"class":787,"line":826},[785,1890,1869],{"class":1868},[785,1892,1893],{"class":812}," db:migrate\n",[619,1895,1896,1897,1900,1901,1904,1905,1908],{},"Until 0.1.0 no instance is live, so there is no data to protect: renaming a table, a column, an enum value or a name\nstored in rows is done in place, in the schema, and ",[653,1898,1899],{},"db:generate"," writes the migration (when it asks whether a column\nwas renamed or dropped and added, either answer is fine). No alias, no kept old name and no test on data. From 0.1.0\non, a rename is written by hand (",[653,1902,1903],{},"drizzle-kit generate --custom",") and tested on a database holding rows under the old\nnames. Core's ",[653,1906,1907],{},"shade\u002Fkernel\u002Fdb\u002Fmigrations\u002FREADME.md"," (\"Adding one\") says how.",[619,1910,1911,1912,1915,1916,1919,1920,1923,1924,1927,1928,1931],{},"A module's collections get their tables in the module, with the same generator: ",[653,1913,1914],{},"shade-module collections"," writes\n",[653,1917,1918],{},"server\u002Fcollections.generated.sql.ts"," and the module's own ",[653,1921,1922],{},"pnpm db:generate"," its migration\n(see ",[623,1925,441],{"href":1926},"\u002Fdevelopers\u002Fmodules\u002Fcontent#collections-from-modules","). Core's migration history and\neach module's were squashed into one baseline on 17 November 2026, and are squashed again just before 0.1.0. A\ndatabase migrated by an earlier history is refused at start with a message to reset it: drop it and make it again\n(",[653,1929,1930],{},"docker compose down -v",", or drop the database), as no client runs SHADE yet.",[752,1933,1935],{"id":1934},"what-it-becomes-in-the-database","What it becomes in the database",[776,1937,1941],{"className":1938,"code":1939,"language":1940,"meta":781,"style":781},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","team_members\n  id               uuid primary key\n  name             text                         -- + index\n  slug             text unique\n  email            text unique\n  photo_id         uuid references media(id) on delete restrict\n  seniority        text check (seniority in ('junior', 'medior', 'senior'))\n  department_id    uuid references departments(id) on delete restrict\n  bio              jsonb                        -- rich text is a document\n  status           entry_status not null default 'draft'\n  latest_version_id, published_version_id  uuid references team_members_versions(id)\n  published_at, created_at, updated_at, created_by, updated_by\n\nteam_members_skills                             -- many relation → join table\n  parent_id        uuid references team_members(id) on delete cascade\n  skills_id        uuid references skills(id) on delete restrict\n  position         integer\n\nteam_members_links                              -- repeater → child table\n  id               uuid primary key\n  parent_id        uuid references team_members(id) on delete cascade   -- named team_members_links_parent_fk\n  position         integer\n  label            text\n  url              text\n\nteam_members_versions                           -- immutable snapshots, same typed columns\n  id, parent_id, version_note, version_author_id, version_created_at,\n  name, slug, email, photo_id, seniority, department_id, bio\nteam_members_versions_skills, team_members_versions_links   -- mirrored child tables\n","sql",[653,1942,1943,1948,1953,1958,1963,1968,1973,1978,1983,1988,1993,1998,2003,2007,2012,2017,2022,2027,2031,2036,2040,2045,2049,2054,2059,2063,2068,2073,2079],{"__ignoreMap":781},[785,1944,1945],{"class":787,"line":788},[785,1946,1947],{},"team_members\n",[785,1949,1950],{"class":787,"line":819},[785,1951,1952],{},"  id               uuid primary key\n",[785,1954,1955],{"class":787,"line":826},[785,1956,1957],{},"  name             text                         -- + index\n",[785,1959,1960],{"class":787,"line":851},[785,1961,1962],{},"  slug             text unique\n",[785,1964,1965],{"class":787,"line":872},[785,1966,1967],{},"  email            text unique\n",[785,1969,1970],{"class":787,"line":912},[785,1971,1972],{},"  photo_id         uuid references media(id) on delete restrict\n",[785,1974,1975],{"class":787,"line":929},[785,1976,1977],{},"  seniority        text check (seniority in ('junior', 'medior', 'senior'))\n",[785,1979,1980],{"class":787,"line":946},[785,1981,1982],{},"  department_id    uuid references departments(id) on delete restrict\n",[785,1984,1985],{"class":787,"line":957},[785,1986,1987],{},"  bio              jsonb                        -- rich text is a document\n",[785,1989,1990],{"class":787,"line":1024},[785,1991,1992],{},"  status           entry_status not null default 'draft'\n",[785,1994,1995],{"class":787,"line":1095},[785,1996,1997],{},"  latest_version_id, published_version_id  uuid references team_members_versions(id)\n",[785,1999,2000],{"class":787,"line":1145},[785,2001,2002],{},"  published_at, created_at, updated_at, created_by, updated_by\n",[785,2004,2005],{"class":787,"line":1189},[785,2006,823],{"emptyLinePlaceholder":822},[785,2008,2009],{"class":787,"line":1240},[785,2010,2011],{},"team_members_skills                             -- many relation → join table\n",[785,2013,2014],{"class":787,"line":1331},[785,2015,2016],{},"  parent_id        uuid references team_members(id) on delete cascade\n",[785,2018,2019],{"class":787,"line":1340},[785,2020,2021],{},"  skills_id        uuid references skills(id) on delete restrict\n",[785,2023,2024],{"class":787,"line":1398},[785,2025,2026],{},"  position         integer\n",[785,2028,2029],{"class":787,"line":1462},[785,2030,823],{"emptyLinePlaceholder":822},[785,2032,2033],{"class":787,"line":1513},[785,2034,2035],{},"team_members_links                              -- repeater → child table\n",[785,2037,2038],{"class":787,"line":1564},[785,2039,1952],{},[785,2041,2042],{"class":787,"line":1615},[785,2043,2044],{},"  parent_id        uuid references team_members(id) on delete cascade   -- named team_members_links_parent_fk\n",[785,2046,2047],{"class":787,"line":1622},[785,2048,2026],{},[785,2050,2051],{"class":787,"line":1666},[785,2052,2053],{},"  label            text\n",[785,2055,2056],{"class":787,"line":1674},[785,2057,2058],{},"  url              text\n",[785,2060,2061],{"class":787,"line":1756},[785,2062,823],{"emptyLinePlaceholder":822},[785,2064,2065],{"class":787,"line":1767},[785,2066,2067],{},"team_members_versions                           -- immutable snapshots, same typed columns\n",[785,2069,2070],{"class":787,"line":1832},[785,2071,2072],{},"  id, parent_id, version_note, version_author_id, version_created_at,\n",[785,2074,2076],{"class":787,"line":2075},28,[785,2077,2078],{},"  name, slug, email, photo_id, seniority, department_id, bio\n",[785,2080,2082],{"class":787,"line":2081},29,[785,2083,2084],{},"team_members_versions_skills, team_members_versions_links   -- mirrored child tables\n",[2086,2087,2089],"h3",{"id":2088},"mapping-rules","Mapping rules",[628,2091,2092,2102],{},[631,2093,2094],{},[634,2095,2096,2099],{},[637,2097,2098],{},"Field",[637,2100,2101],{},"Storage",[644,2103,2104,2121,2131,2149,2171,2181,2196,2205,2219,2228,2242,2269,2280,2295,2305,2315],{},[634,2105,2106,2109],{},[649,2107,2108],{},"text, textarea, email, url, slug",[649,2110,2111,2113,2114,2117,2118,656],{},[653,2112,970],{}," (+ ",[653,2115,2116],{},"index"," \u002F ",[653,2119,2120],{},"unique",[634,2122,2123,2126],{},[649,2124,2125],{},"emails",[649,2127,2128],{},[653,2129,2130],{},"jsonb not null default '[]'",[634,2132,2133,2136],{},[649,2134,2135],{},"number",[649,2137,2138,2141,2142,2145,2146],{},[653,2139,2140],{},"integer",", or ",[653,2143,2144],{},"numeric"," with ",[653,2147,2148],{},"decimals",[634,2150,2151,2154],{},[649,2152,2153],{},"money",[649,2155,2156,2158,2159,2162,2163,2166,2167,2170],{},[653,2157,2140],{},": whole cents (",[653,2160,2161],{},"1250"," is € 12,50); ",[653,2164,2165],{},"min"," and ",[653,2168,2169],{},"max"," in cents",[634,2172,2173,2176],{},[649,2174,2175],{},"toggle",[649,2177,2178],{},[653,2179,2180],{},"boolean not null default false",[634,2182,2183,2186],{},[649,2184,2185],{},"date",[649,2187,2188,2141,2190,2145,2193],{},[653,2189,2185],{},[653,2191,2192],{},"timestamptz",[653,2194,2195],{},"time: true",[634,2197,2198,2200],{},[649,2199,1200],{},[649,2201,2202,2204],{},[653,2203,970],{}," + check constraint",[634,2206,2207,2210],{},[649,2208,2209],{},"image, file",[649,2211,2212,2215,2216],{},[653,2213,2214],{},"\u003Cname>_id"," → ",[653,2217,2218],{},"media",[634,2220,2221,2223],{},[649,2222,1351],{},[649,2224,2225,2227],{},[653,2226,2214],{}," → target table",[634,2229,2230,2233],{},[649,2231,2232],{},"relation (many)",[649,2234,2235,2236,2145,2239],{},"join table ",[653,2237,2238],{},"\u003Ctable>_\u003Cname>",[653,2240,2241],{},"position",[634,2243,2244,2247],{},[649,2245,2246],{},"link",[649,2248,2249,2252,2253,2252,2256,2259,2260,2252,2263,2252,2266],{},[653,2250,2251],{},"\u003Cname>_kind",", ",[653,2254,2255],{},"\u003Cname>_collection",[653,2257,2258],{},"\u003Cname>_entry_id"," (no foreign key), ",[653,2261,2262],{},"\u003Cname>_url",[653,2264,2265],{},"\u003Cname>_anchor",[653,2267,2268],{},"\u003Cname>_new_tab",[634,2270,2271,2274],{},[649,2272,2273],{},"group",[649,2275,2276,2277],{},"prefixed columns ",[653,2278,2279],{},"\u003Cgroup>_\u003Cfield>",[634,2281,2282,2284],{},[649,2283,1473],{},[649,2285,2286,2287,2145,2289,2252,2292,2294],{},"child table ",[653,2288,2238],{},[653,2290,2291],{},"parent_id",[653,2293,2241],{}," (nested repeaters nest tables)",[634,2296,2297,2299],{},[649,2298,1633],{},[649,2300,2301,2304],{},[653,2302,2303],{},"jsonb"," (a document)",[634,2306,2307,2310],{},[649,2308,2309],{},"tree",[649,2311,2312,2314],{},[653,2313,2303],{}," (a validated node tree)",[634,2316,2317,2320],{},[649,2318,2319],{},"json",[649,2321,2322,2324],{},[653,2323,2303],{},", nullable (the value its module's check gave back)",[619,2326,2327],{},"JSON is used only for documents (rich text, page trees and a module's own documents in json fields), all validated\nbefore they are saved.\nEverything you filter, sort, relate or report on is a real column.",[2086,2329,2331],{"id":2330},"drafts-and-history","Drafts and history",[2333,2334,2335,2348,2354],"ul",{},[2336,2337,2338,2339,2343,2344,2347],"li",{},"The main table is the ",[2340,2341,2342],"strong",{},"working copy","; every save also writes an immutable snapshot to ",[653,2345,2346],{},"\u003Cslug>_versions",".",[2336,2349,2350,2353],{},[653,2351,2352],{},"published_version_id"," points at the live snapshot; the content API only ever reads published snapshots.",[2336,2355,2356,2359],{},[653,2357,2358],{},"drafts: false"," turns this off (saves are live, no versions table) — for data that is not published content.",[2086,2361,2363],{"id":2362},"integrity","Integrity",[2333,2365,2366,2373,2380,2386,2396,2414],{},[2336,2367,2368,2369,2372],{},"References from main and child tables use ",[653,2370,2371],{},"on delete restrict",": you cannot delete media, a page or an entry\nthat is still used. The services report a readable CONFLICT first; the database is the backstop.",[2336,2374,2375,2376,2379],{},"References from versions tables use ",[653,2377,2378],{},"on delete set null",": history never blocks a delete.",[2336,2381,2382,2383,2347],{},"Singletons have ",[653,2384,2385],{},"id integer primary key default 1 check (id = 1)",[2336,2387,2388,2389,2252,2392,2395],{},"A published entry always has its published version: ",[653,2390,2391],{},"\u003Cslug>_published_version",[653,2393,2394],{},"status \u003C> 'published' or published_version_id is not null",", on every main table with drafts.",[2336,2397,2398,2401,2402,2405,2406,2409,2410,2413],{},[653,2399,2400],{},"indexes"," adds composite indexes, and ",[653,2403,2404],{},"where"," makes one partial, over the rows whose fields hold the given values.\nOne default header and one default footer, for instance:\n",[653,2407,2408],{},"indexes: [{ fields: ['kind'], unique: true, where: { default: true } }]"," (",[653,2411,2412],{},"\u003Cslug>_kind_when_default_unique",").\nA save check can still give the readable answer first; the index holds the rule when two saves run at once.",[2336,2415,2416,2417,2420,2421,2409,2423,2426],{},"The content API reads the published versions, so the versions table gets the same indexes as plain ones (versions\nshare a slug), its translations ",[653,2418,2419],{},"(locale, column)"," for them, and the main table a unique index on\n",[653,2422,2352],{},[653,2424,2425],{},"\u003Cslug>_published_version_unique","): one entry by its slug stays an index lookup however\noften it is saved.",[752,2428,2430],{"id":2429},"changing-a-collection","Changing a collection",[628,2432,2433,2443],{},[631,2434,2435],{},[634,2436,2437,2440],{},[637,2438,2439],{},"Change",[637,2441,2442],{},"Migration",[644,2444,2445,2456,2464,2475,2483],{},[634,2446,2447,2450],{},[649,2448,2449],{},"Add a field",[649,2451,2452,2455],{},[653,2453,2454],{},"add column"," (nullable) — safe",[634,2457,2458,2461],{},[649,2459,2460],{},"Rename a field",[649,2462,2463],{},"drizzle-kit asks \"rename or drop+create?\" — answer rename to keep data",[634,2465,2466,2469],{},[649,2467,2468],{},"Remove a field",[649,2470,2471,2474],{},[653,2472,2473],{},"drop column"," — visible in review; data is gone",[634,2476,2477,2480],{},[649,2478,2479],{},"Change a field's kind",[649,2481,2482],{},"usually drop + add; write a manual data migration if values must be kept",[634,2484,2485,2490],{},[649,2486,2487,2488],{},"Add ",[653,2489,2120],{},[649,2491,2492],{},"fails if existing rows have duplicates — clean them first",[752,2494,2496],{"id":2495},"built-in-collections","Built-in collections",[619,2498,2499,2500,2503,2504,2507],{},"Core has none: every collection comes from a module. The forms module keeps its forms in ",[653,2501,2502],{},"forms-forms","\n(",[623,2505,2506],{"href":362},"Forms",").",[619,2509,2510],{},"The website module adds these (each with its locales and versions tables):",[628,2512,2513,2526],{},[631,2514,2515],{},[634,2516,2517,2520,2523],{},[637,2518,2519],{},"Collection",[637,2521,2522],{},"Tables",[637,2524,2525],{},"Edited in",[644,2527,2528,2543,2565,2588,2603],{},[634,2529,2530,2535,2540],{},[649,2531,2532],{},[653,2533,2534],{},"website-pages",[649,2536,2537],{},[653,2538,2539],{},"website_pages",[649,2541,2542],{},"the visual editor",[634,2544,2545,2551,2562],{},[649,2546,2547,2550],{},[653,2548,2549],{},"website-navigation"," (singleton)",[649,2552,2553,2252,2556,2252,2559],{},[653,2554,2555],{},"website_navigation",[653,2557,2558],{},"website_navigation_items",[653,2560,2561],{},"website_navigation_items_children",[649,2563,2564],{},"the entry editor with a live layout preview",[634,2566,2567,2572,2586],{},[649,2568,2569,2550],{},[653,2570,2571],{},"website-footer",[649,2573,2574,2252,2577,2252,2580,2252,2583],{},[653,2575,2576],{},"website_footer",[653,2578,2579],{},"website_footer_columns",[653,2581,2582],{},"website_footer_columns_links",[653,2584,2585],{},"website_footer_social",[649,2587,2564],{},[634,2589,2590,2595,2600],{},[649,2591,2592],{},[653,2593,2594],{},"website-posts",[649,2596,2597],{},[653,2598,2599],{},"website_posts",[649,2601,2602],{},"the collection screens; each post gets a page from its item template",[634,2604,2605,2610,2615],{},[649,2606,2607],{},[653,2608,2609],{},"website-parts",[649,2611,2612],{},[653,2613,2614],{},"website_parts",[649,2616,2617],{},"Header and footer: the site's headers and footers as trees, one default of each, others picked per page",[619,2619,2620,2621,2624,2625,2628,2629,2347],{},"A collection with ",[653,2622,2623],{},"itemPages: true"," (and a slug field and ",[653,2626,2627],{},"publicApi",") gets a page per published item, built from\nthe page marked as its template in the page settings: ",[653,2630,2631],{},"\u002F\u003Citem path>\u002F\u003Cslug>",[619,2633,2634,2635,2638,2639,2642],{},"The pages service is a typed facade over the generic collection service, so the page editor, MCP tools and\npublic API keep their dedicated shapes. Navigation and footer are edited as plain entries; ",[653,2636,2637],{},"getPublishedLayout","\n(the website module's ",[653,2640,2641],{},"server\u002Flayout.ts",") reads them in their public shape.",[752,2644,2646],{"id":2645},"using-entries-on-the-site","Using entries on the site",[619,2648,2649,2650,2653,2654,2657],{},"A frontend gets its collections' types from the instance with ",[653,2651,2652],{},"shade-types",", a command of ",[653,2655,2656],{},"@shadestack\u002Fclient",". It\nreads the instance's OpenAPI document with a read token and writes the published data of each collection with a\npublic API the token may read:",[776,2659,2661],{"className":1859,"code":2660,"language":1861,"meta":781,"style":781},"npx shade-types --url https:\u002F\u002Fadmin.example.org --token \"$SHADE_TOKEN\" --out src\u002Fshade-types.ts\n",[653,2662,2663],{"__ignoreMap":781},[785,2664,2665,2668,2671,2674,2677,2680,2683,2686,2689,2692],{"class":787,"line":788},[785,2666,2667],{"class":1868},"npx",[785,2669,2670],{"class":812}," shade-types",[785,2672,2673],{"class":812}," --url",[785,2675,2676],{"class":812}," https:\u002F\u002Fadmin.example.org",[785,2678,2679],{"class":812}," --token",[785,2681,2682],{"class":795}," \"",[785,2684,2685],{"class":799},"$SHADE_TOKEN",[785,2687,2688],{"class":795},"\"",[785,2690,2691],{"class":812}," --out",[785,2693,2694],{"class":812}," src\u002Fshade-types.ts\n",[619,2696,2697,2698,2166,2701,2704,2705,2166,2708,2711,2712,2715,2716,2719],{},"The address and token may come from ",[653,2699,2700],{},"SHADE_API_URL",[653,2702,2703],{},"SHADE_TOKEN"," instead of ",[653,2706,2707],{},"--url",[653,2709,2710],{},"--token",". Without\n",[653,2713,2714],{},"--out"," the types are printed. Write the file again when the collections change. Give the types to the client, and\n",[653,2717,2718],{},"collection(slug)"," knows each collection's data:",[776,2721,2723],{"className":778,"code":2722,"language":780,"meta":781,"style":781},"import { createShadeClient } from '@shadestack\u002Fclient'\nimport type { ShadeCollections } from '.\u002Fshade-types'\n\nconst shade = createShadeClient\u003CShadeCollections>({ baseUrl: process.env.SHADE_API_URL!, token: process.env.SHADE_TOKEN! })\nconst members = await shade.collection('team-members').all({ sort: 'name' })\n\u002F\u002F members[0].data.name: string\n",[653,2724,2725,2744,2767,2771,2839,2893],{"__ignoreMap":781},[785,2726,2727,2729,2731,2734,2736,2738,2740,2742],{"class":787,"line":788},[785,2728,792],{"class":791},[785,2730,796],{"class":795},[785,2732,2733],{"class":799}," createShadeClient",[785,2735,803],{"class":795},[785,2737,806],{"class":791},[785,2739,809],{"class":795},[785,2741,2656],{"class":812},[785,2743,816],{"class":795},[785,2745,2746,2748,2751,2753,2756,2758,2760,2762,2765],{"class":787,"line":819},[785,2747,792],{"class":791},[785,2749,2750],{"class":791}," type",[785,2752,796],{"class":795},[785,2754,2755],{"class":799}," ShadeCollections",[785,2757,803],{"class":795},[785,2759,806],{"class":791},[785,2761,809],{"class":795},[785,2763,2764],{"class":812},".\u002Fshade-types",[785,2766,816],{"class":795},[785,2768,2769],{"class":787,"line":826},[785,2770,823],{"emptyLinePlaceholder":822},[785,2772,2773,2776,2779,2781,2783,2786,2789,2792,2794,2797,2800,2802,2805,2807,2810,2812,2814,2817,2820,2822,2824,2826,2828,2830,2832,2835,2837],{"class":787,"line":851},[785,2774,2775],{"class":832},"const",[785,2777,2778],{"class":799}," shade ",[785,2780,839],{"class":795},[785,2782,2733],{"class":842},[785,2784,2785],{"class":795},"\u003C",[785,2787,2788],{"class":1868},"ShadeCollections",[785,2790,2791],{"class":795},">",[785,2793,845],{"class":799},[785,2795,2796],{"class":795},"{",[785,2798,2799],{"class":854}," baseUrl",[785,2801,858],{"class":795},[785,2803,2804],{"class":799}," process",[785,2806,2347],{"class":795},[785,2808,2809],{"class":799},"env",[785,2811,2347],{"class":795},[785,2813,2700],{"class":799},[785,2815,2816],{"class":795},"!,",[785,2818,2819],{"class":854}," token",[785,2821,858],{"class":795},[785,2823,2804],{"class":799},[785,2825,2347],{"class":795},[785,2827,2809],{"class":799},[785,2829,2347],{"class":795},[785,2831,2703],{"class":799},[785,2833,2834],{"class":795},"!",[785,2836,803],{"class":795},[785,2838,1838],{"class":799},[785,2840,2841,2843,2846,2848,2851,2854,2856,2859,2861,2863,2865,2867,2869,2871,2874,2876,2878,2881,2883,2885,2887,2889,2891],{"class":787,"line":872},[785,2842,2775],{"class":832},[785,2844,2845],{"class":799}," members ",[785,2847,839],{"class":795},[785,2849,2850],{"class":791}," await",[785,2852,2853],{"class":799}," shade",[785,2855,2347],{"class":795},[785,2857,2858],{"class":842},"collection",[785,2860,845],{"class":799},[785,2862,866],{"class":795},[785,2864,863],{"class":812},[785,2866,866],{"class":795},[785,2868,656],{"class":799},[785,2870,2347],{"class":795},[785,2872,2873],{"class":842},"all",[785,2875,845],{"class":799},[785,2877,2796],{"class":795},[785,2879,2880],{"class":854}," sort",[785,2882,858],{"class":795},[785,2884,809],{"class":795},[785,2886,922],{"class":812},[785,2888,866],{"class":795},[785,2890,803],{"class":795},[785,2892,1838],{"class":799},[785,2894,2895],{"class":787,"line":912},[785,2896,2897],{"class":1875},"\u002F\u002F members[0].data.name: string\n",[619,2899,2900,2901,2904,2905,869,2908,2166,2911,2914,2915,2918,2919,2922,2923,2925,2926,2929,2930,2933,2934,2918,2937,2933,2939,2347],{},"The framework packages take the same types. ",[653,2902,2903],{},"shadeFromEnv\u003CShadeCollections>()"," in ",[653,2906,2907],{},"@shadestack\u002Fnext",[653,2909,2910],{},"@shadestack\u002Fnuxt",[653,2912,2913],{},"@shadestack\u002Fsveltekit",", and ",[653,2916,2917],{},"createSiteClient\u003CShadeCollections>()"," from\n",[653,2920,2921],{},"@shadestack\u002Fclient\u002Frender",", give a site client whose ",[653,2924,2718],{}," knows each collection's data and which still\nfinds pages. ",[653,2927,2928],{},"@shadestack\u002Fastro"," has no read client of its own: import ",[653,2931,2932],{},"createShadeClient"," or ",[653,2935,2936],{},"createSiteClient",[653,2938,2656],{},[653,2940,2921],{},[619,2942,2943,2944,2947,2948,2951,2952,2347],{},"Only the fields the public API shows are in the types. A relation is the related entry's id, or with ",[653,2945,2946],{},"depth"," the entry\nitself (",[653,2949,2950],{},"{ id, collection, data }","), and null when that entry is not published. A json field's value is ",[653,2953,2954],{},"unknown",[619,2956,2957],{},"Code that has the collection's definition, such as a module's own site part, can type the data with it instead:",[776,2959,2961],{"className":778,"code":2960,"language":780,"meta":781,"style":781},"import type { EntryData } from '@shadestack\u002Fcore\u002Fcollections'\nimport type { teamMembers } from '@shadestack\u002Fconfig\u002Fcollections'\n\nconst members = await shade.collection\u003CEntryData\u003Ctypeof teamMembers>>('team-members').all({\n  where: { seniority: { eq: 'senior' } },\n  sort: 'name'\n})\n",[653,2962,2963,2984,3006,3010,3057,3088,3101],{"__ignoreMap":781},[785,2964,2965,2967,2969,2971,2974,2976,2978,2980,2982],{"class":787,"line":788},[785,2966,792],{"class":791},[785,2968,2750],{"class":791},[785,2970,796],{"class":795},[785,2972,2973],{"class":799}," EntryData",[785,2975,803],{"class":795},[785,2977,806],{"class":791},[785,2979,809],{"class":795},[785,2981,813],{"class":812},[785,2983,816],{"class":795},[785,2985,2986,2988,2990,2992,2995,2997,2999,3001,3004],{"class":787,"line":819},[785,2987,792],{"class":791},[785,2989,2750],{"class":791},[785,2991,796],{"class":795},[785,2993,2994],{"class":799}," teamMembers",[785,2996,803],{"class":795},[785,2998,806],{"class":791},[785,3000,809],{"class":795},[785,3002,3003],{"class":812},"@shadestack\u002Fconfig\u002Fcollections",[785,3005,816],{"class":795},[785,3007,3008],{"class":787,"line":826},[785,3009,823],{"emptyLinePlaceholder":822},[785,3011,3012,3014,3016,3018,3020,3022,3024,3026,3028,3031,3034,3036,3039,3041,3043,3045,3047,3049,3051,3053,3055],{"class":787,"line":851},[785,3013,2775],{"class":832},[785,3015,2845],{"class":799},[785,3017,839],{"class":795},[785,3019,2850],{"class":791},[785,3021,2853],{"class":799},[785,3023,2347],{"class":795},[785,3025,2858],{"class":842},[785,3027,2785],{"class":795},[785,3029,3030],{"class":1868},"EntryData",[785,3032,3033],{"class":795},"\u003Ctypeof",[785,3035,2994],{"class":799},[785,3037,3038],{"class":795},">>",[785,3040,845],{"class":799},[785,3042,866],{"class":795},[785,3044,863],{"class":812},[785,3046,866],{"class":795},[785,3048,656],{"class":799},[785,3050,2347],{"class":795},[785,3052,2873],{"class":842},[785,3054,845],{"class":799},[785,3056,848],{"class":795},[785,3058,3059,3062,3064,3066,3069,3071,3073,3076,3078,3080,3082,3084,3086],{"class":787,"line":872},[785,3060,3061],{"class":854},"  where",[785,3063,858],{"class":795},[785,3065,796],{"class":795},[785,3067,3068],{"class":854}," seniority",[785,3070,858],{"class":795},[785,3072,796],{"class":795},[785,3074,3075],{"class":854}," eq",[785,3077,858],{"class":795},[785,3079,809],{"class":795},[785,3081,1323],{"class":812},[785,3083,866],{"class":795},[785,3085,803],{"class":795},[785,3087,909],{"class":795},[785,3089,3090,3093,3095,3097,3099],{"class":787,"line":912},[785,3091,3092],{"class":854},"  sort",[785,3094,858],{"class":795},[785,3096,809],{"class":795},[785,3098,922],{"class":812},[785,3100,816],{"class":795},[785,3102,3103,3105],{"class":787,"line":929},[785,3104,1835],{"class":795},[785,3106,1838],{"class":799},[752,3108,120],{"id":3109},"field-types",[619,3111,3112,3113,858],{},"Each field kind is one folder, ",[653,3114,3115],{},"shade\u002Ffields\u002F\u003Ckind>\u002F",[628,3117,3118,3128],{},[631,3119,3120],{},[634,3121,3122,3125],{},[637,3123,3124],{},"File",[637,3126,3127],{},"What it holds",[644,3129,3130,3165,3182],{},[634,3131,3132,3137],{},[649,3133,3134],{},[653,3135,3136],{},"shared.ts",[649,3138,3139,3140,3143,3144,3147,3148,2252,3151,2252,3154,3157,3158,2252,3161,3164],{},"The descriptor type (",[653,3141,3142],{},"TextField","), its Zod schema, its columns (",[653,3145,3146],{},"plan","), model checks, flags (",[653,3149,3150],{},"scalar",[653,3152,3153],{},"title",[653,3155,3156],{},"slugSource","), structure (",[653,3159,3160],{},"nested",[653,3162,3163],{},"joins","), the empty value and the list cell. Browser-safe.",[634,3166,3167,3172],{},[649,3168,3169],{},[653,3170,3171],{},"server.ts",[649,3173,3174,3175,2252,3178,3181],{},"Row mapping (",[653,3176,3177],{},"toColumns",[653,3179,3180],{},"fromColumns","), the filterable column, references and referrers.",[634,3183,3184,3189],{},[649,3185,3186],{},[653,3187,3188],{},"admin\u002F",[649,3190,3191,3192,3195,3196,2904,3199,2347],{},"The editor component (",[653,3193,3194],{},"FieldText.vue","), named by ",[653,3197,3198],{},"component",[653,3200,3136],{},[619,3202,3203,3204,3207,3208,2252,3211,3214,3215,3218,3219,2166,3222,2347],{},"The entries feature (",[653,3205,3206],{},"features\u002Fentries",") looks a field's type up (",[653,3209,3210],{},"fieldType(field)",[653,3212,3213],{},"serverFieldType(field)",") instead of\nswitching over kinds; it only knows the three structures a type can have: its own columns, nested fields in the\nsame table (group) or a child table (repeater), and a join table (many relation). Adding a field type: a folder\nwith those parts, its kind in ",[653,3216,3217],{},"FIELD_KINDS",", and one line in ",[653,3220,3221],{},"fields\u002Fshared.ts",[653,3223,3224],{},"fields\u002Fserver\u002Findex.ts",[752,3226,128],{"id":3227},"languages",[619,3229,3230,3231,3234,3235,2507],{},"Every entry exists in all of the site's languages. The default language is stored in the entry's\nown columns; each table with translatable fields has a ",[653,3232,3233],{},"\u003Ctable>_locales"," table for the other languages, generated\nwith the rest (",[653,3236,3237],{},"pnpm db:collections",[2333,3239,3240,3251,3276,3294,3311,3320],{},[2336,3241,3242,3243,3246,3247,3250],{},"A field is translatable when its type says so (text, textarea, rich text, slugs) or it sets\n",[653,3244,3245],{},"translatable: true","; ",[653,3248,3249],{},"translatable: false"," keeps it shared.",[2336,3252,3253,3254,3257,3258,3261,3262,3265,3266,3269,3270,3273,3274,2507],{},"A field's part in search is ",[653,3255,3256],{},"search: 'A' | 'B' | 'C' | 'D' | false"," (weights, best first; ",[653,3259,3260],{},"false"," leaves it out, and on a\ngroup or repeater everything inside). Without it the title counts ",[653,3263,3264],{},"A",", text and slugs ",[653,3267,3268],{},"B",", textarea and rich text\n",[653,3271,3272],{},"C",", the rest not at all (",[623,3275,140],{"href":141},[2336,3277,3278,3281,3282,3285,3286,3289,3290,3293],{},[653,3279,3280],{},"GET \u002Fapi\u002Fcollections\u002F\u003Cslug>\u002F\u003Cid>?locale=en"," returns the entry in English; ",[653,3283,3284],{},"meta.missing"," lists the text that is\nnot translated and shows the default language (paths are written like ",[653,3287,3288],{},"items.2.label","). Which\ntranslations are out of date is the ",[623,3291,3292],{"href":326},"editorial module","'s, with its own routes\nand the entry list's column. The content API says nothing about it: it serves published text.",[2336,3295,3296,2145,3299,3302,3303,3306,3307,3310],{},[653,3297,3298],{},"PUT …",[653,3300,3301],{},"locale: 'en'"," saves the English text: ",[653,3304,3305],{},"data"," holds translatable fields only, repeater items with\ntheir ",[653,3308,3309],{},"id"," (a tree keeps every language in its texts). Structure is edited in the default language.",[2336,3312,3313,3314,3316,3317,3319],{},"Repeater items carry an ",[653,3315,3309],{}," in entry data. Send it back when saving: the item is updated in place and keeps its\ntranslations; items without an ",[653,3318,3309],{}," are new.",[2336,3321,3322],{},"A translated unique field (a slug) is unique per language.",[3324,3325,3326],"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 .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}",{"title":781,"searchDepth":819,"depth":819,"links":3328},[3329,3330,3335,3336,3337,3338,3339],{"id":754,"depth":819,"text":755},{"id":1934,"depth":819,"text":1935,"children":3331},[3332,3333,3334],{"id":2088,"depth":826,"text":2089},{"id":2330,"depth":826,"text":2331},{"id":2362,"depth":826,"text":2363},{"id":2429,"depth":819,"text":2430},{"id":2495,"depth":819,"text":2496},{"id":2645,"depth":819,"text":2646},{"id":3109,"depth":819,"text":120},{"id":3227,"depth":819,"text":128},"md",null,{},{"title":429,"description":781},"bR1371fYOkI9P5n4LBwNwKH5B3CetaoGBTWZfNlBKhs",[3346,3347],{"title":425,"path":426,"stem":427,"description":781,"children":-1},{"title":337,"path":433,"stem":434,"description":781,"children":-1},1796500155088]