[{"data":1,"prerenderedAt":1933},["ShallowReactive",2],{"navigation_docs":3,"-docs-capabilities-branded-ids":493,"-docs-capabilities-branded-ids-surround":1928},[4,46,135,218,257,292,355,377,420],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":45},"Getting Started","i-lucide-rocket","\u002Fdocs\u002Fgetting-started","docs\u002F01.getting-started",[10,15,20,25,30,35,40],{"title":11,"path":12,"stem":13,"icon":14},"What is Heximon?","\u002Fdocs\u002Fgetting-started\u002Fintroduction","docs\u002F01.getting-started\u002F01.introduction","i-lucide-info",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","docs\u002F01.getting-started\u002F02.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quick Start","\u002Fdocs\u002Fgetting-started\u002Fquick-start","docs\u002F01.getting-started\u002F03.quick-start","i-lucide-zap",{"title":26,"path":27,"stem":28,"icon":29},"Core Concepts","\u002Fdocs\u002Fgetting-started\u002Fcore-concepts","docs\u002F01.getting-started\u002F04.core-concepts","i-lucide-shapes",{"title":31,"path":32,"stem":33,"icon":34},"Examples","\u002Fdocs\u002Fgetting-started\u002Fexamples","docs\u002F01.getting-started\u002F05.examples","i-lucide-library",{"title":36,"path":37,"stem":38,"icon":39},"Where Next?","\u002Fdocs\u002Fgetting-started\u002Fwhere-next","docs\u002F01.getting-started\u002F06.where-next","i-lucide-signpost",{"title":41,"path":42,"stem":43,"icon":44},"Troubleshooting","\u002Fdocs\u002Fgetting-started\u002Ftroubleshooting","docs\u002F01.getting-started\u002F07.troubleshooting","i-lucide-life-buoy",false,{"title":47,"icon":48,"path":49,"stem":50,"children":51,"page":45},"Essentials","i-lucide-boxes","\u002Fdocs\u002Fessentials","docs\u002F02.essentials",[52,56,61,66,71,76,81,86,91,96,101,105,110,115,120,125,130],{"title":53,"path":54,"stem":55,"icon":48},"Modules & DI","\u002Fdocs\u002Fessentials\u002Fmodules-and-di","docs\u002F02.essentials\u002F01.modules-and-di",{"title":57,"path":58,"stem":59,"icon":60},"Controllers","\u002Fdocs\u002Fessentials\u002Fcontrollers","docs\u002F02.essentials\u002F02.controllers","i-lucide-route",{"title":62,"path":63,"stem":64,"icon":65},"Validation & DTOs","\u002Fdocs\u002Fessentials\u002Fvalidation","docs\u002F02.essentials\u002F03.validation","i-lucide-shield-check",{"title":67,"path":68,"stem":69,"icon":70},"Contracts","\u002Fdocs\u002Fessentials\u002Fcontracts","docs\u002F02.essentials\u002F04.contracts","i-lucide-file-signature",{"title":72,"path":73,"stem":74,"icon":75},"REST Client","\u002Fdocs\u002Fessentials\u002Fclient","docs\u002F02.essentials\u002F05.client","i-lucide-plug",{"title":77,"path":78,"stem":79,"icon":80},"Database","\u002Fdocs\u002Fessentials\u002Fdatabase","docs\u002F02.essentials\u002F06.database","i-lucide-database",{"title":82,"path":83,"stem":84,"icon":85},"Drizzle ORM","\u002Fdocs\u002Fessentials\u002Fdrizzle","docs\u002F02.essentials\u002F07.drizzle","i-lucide-database-zap",{"title":87,"path":88,"stem":89,"icon":90},"Persistence & Transactions","\u002Fdocs\u002Fessentials\u002Fpersistence","docs\u002F02.essentials\u002F08.persistence","i-lucide-database-backup",{"title":92,"path":93,"stem":94,"icon":95},"Migrations","\u002Fdocs\u002Fessentials\u002Fmigrations","docs\u002F02.essentials\u002F09.migrations","i-lucide-git-branch",{"title":97,"path":98,"stem":99,"icon":100},"Authentication","\u002Fdocs\u002Fessentials\u002Fauthentication","docs\u002F02.essentials\u002F10.authentication","i-lucide-key-round",{"title":102,"path":103,"stem":104,"icon":65},"Permissions & scopes","\u002Fdocs\u002Fessentials\u002Fpermissions","docs\u002F02.essentials\u002F11.permissions",{"title":106,"path":107,"stem":108,"icon":109},"Error Handling","\u002Fdocs\u002Fessentials\u002Ferrors","docs\u002F02.essentials\u002F12.errors","i-lucide-triangle-alert",{"title":111,"path":112,"stem":113,"icon":114},"Testing a Heximon App","\u002Fdocs\u002Fessentials\u002Ftesting","docs\u002F02.essentials\u002F13.testing","i-lucide-flask-conical",{"title":116,"path":117,"stem":118,"icon":119},"Test app harness","\u002Fdocs\u002Fessentials\u002Fcreatetestapp","docs\u002F02.essentials\u002F14.createtestapp","i-lucide-test-tube",{"title":121,"path":122,"stem":123,"icon":124},"Logging & Observability","\u002Fdocs\u002Fessentials\u002Flogging","docs\u002F02.essentials\u002F17.logging","i-lucide-scroll-text",{"title":126,"path":127,"stem":128,"icon":129},"Context & Lifecycle","\u002Fdocs\u002Fessentials\u002Fcontext-and-lifecycle","docs\u002F02.essentials\u002F18.context-and-lifecycle","i-lucide-radio",{"title":131,"path":132,"stem":133,"icon":134},"Project Structure","\u002Fdocs\u002Fessentials\u002Fproject-structure","docs\u002F02.essentials\u002F19.project-structure","i-lucide-folder-tree",{"title":136,"icon":137,"path":138,"stem":139,"children":140,"page":45},"Capabilities","i-lucide-sparkles","\u002Fdocs\u002Fcapabilities","docs\u002F03.capabilities",[141,145,150,155,160,164,169,174,179,184,188,193,198,203,208,213],{"title":142,"path":143,"stem":144,"icon":137},"Overview","\u002Fdocs\u002Fcapabilities\u002Foverview","docs\u002F03.capabilities\u002F01.overview",{"title":146,"path":147,"stem":148,"icon":149},"Events","\u002Fdocs\u002Fcapabilities\u002Fevents","docs\u002F03.capabilities\u002F02.events","i-lucide-radio-tower",{"title":151,"path":152,"stem":153,"icon":154},"Queue","\u002Fdocs\u002Fcapabilities\u002Fbackground-jobs","docs\u002F03.capabilities\u002F03.background-jobs","i-lucide-list-ordered",{"title":156,"path":157,"stem":158,"icon":159},"Scheduled Work","\u002Fdocs\u002Fcapabilities\u002Fscheduled-jobs","docs\u002F03.capabilities\u002F04.scheduled-jobs","i-lucide-clock",{"title":161,"path":162,"stem":163,"icon":85},"Caching","\u002Fdocs\u002Fcapabilities\u002Fcaching","docs\u002F03.capabilities\u002F05.caching",{"title":165,"path":166,"stem":167,"icon":168},"Key\u002FValue Storage","\u002Fdocs\u002Fcapabilities\u002Fkey-value","docs\u002F03.capabilities\u002F06.key-value","i-lucide-hard-drive",{"title":170,"path":171,"stem":172,"icon":173},"Blob Storage","\u002Fdocs\u002Fcapabilities\u002Fblob","docs\u002F03.capabilities\u002F07.blob","i-lucide-folder-open",{"title":175,"path":176,"stem":177,"icon":178},"Health & Readiness","\u002Fdocs\u002Fcapabilities\u002Fhealth","docs\u002F03.capabilities\u002F08.health","i-lucide-heart-pulse",{"title":180,"path":181,"stem":182,"icon":183},"Notifications","\u002Fdocs\u002Fcapabilities\u002Fnotifications","docs\u002F03.capabilities\u002F09.notifications","i-lucide-mail",{"title":185,"path":186,"stem":187,"icon":65},"Idempotency","\u002Fdocs\u002Fcapabilities\u002Fidempotency","docs\u002F03.capabilities\u002F10.idempotency",{"title":189,"path":190,"stem":191,"icon":192},"Security Hardening","\u002Fdocs\u002Fcapabilities\u002Fsecurity","docs\u002F03.capabilities\u002F11.security","i-lucide-shield",{"title":194,"path":195,"stem":196,"icon":197},"Observability & Tracing","\u002Fdocs\u002Fcapabilities\u002Fobservability","docs\u002F03.capabilities\u002F12.observability","i-lucide-activity",{"title":199,"path":200,"stem":201,"icon":202},"OpenAPI","\u002Fdocs\u002Fcapabilities\u002Fopenapi","docs\u002F03.capabilities\u002F13.openapi","i-lucide-book-marked",{"title":204,"path":205,"stem":206,"icon":207},"MCP Server","\u002Fdocs\u002Fcapabilities\u002Fmcp","docs\u002F03.capabilities\u002F14.mcp","i-lucide-bot",{"title":209,"path":210,"stem":211,"icon":212},"Schema DTOs","\u002Fdocs\u002Fcapabilities\u002Fschema","docs\u002F03.capabilities\u002F15.schema","i-lucide-file-json",{"title":214,"path":215,"stem":216,"icon":217},"Branded IDs","\u002Fdocs\u002Fcapabilities\u002Fbranded-ids","docs\u002F03.capabilities\u002F16.branded-ids","i-lucide-tag",{"title":219,"icon":220,"path":221,"stem":222,"children":223,"page":45},"Architecture","i-lucide-building","\u002Fdocs\u002Farchitecture","docs\u002F04.architecture",[224,227,232,237,242,247,252],{"title":142,"path":225,"stem":226,"icon":220},"\u002Fdocs\u002Farchitecture\u002Foverview","docs\u002F04.architecture\u002F01.overview",{"title":228,"path":229,"stem":230,"icon":231},"Domain-Driven Design","\u002Fdocs\u002Farchitecture\u002Fddd","docs\u002F04.architecture\u002F02.ddd","i-lucide-hexagon",{"title":233,"path":234,"stem":235,"icon":236},"CQRS","\u002Fdocs\u002Farchitecture\u002Fcqrs","docs\u002F04.architecture\u002F03.cqrs","i-lucide-split",{"title":238,"path":239,"stem":240,"icon":241},"Repository Pattern","\u002Fdocs\u002Farchitecture\u002Frepository-pattern","docs\u002F04.architecture\u002F04.repository-pattern","i-lucide-archive",{"title":243,"path":244,"stem":245,"icon":246},"Integration Events","\u002Fdocs\u002Farchitecture\u002Fintegration-events","docs\u002F04.architecture\u002F05.integration-events","i-lucide-send-horizontal",{"title":248,"path":249,"stem":250,"icon":251},"Saga Orchestration","\u002Fdocs\u002Farchitecture\u002Fsagas","docs\u002F04.architecture\u002F06.sagas","i-lucide-hourglass",{"title":253,"path":254,"stem":255,"icon":256},"Durable Workflows","\u002Fdocs\u002Farchitecture\u002Fworkflows","docs\u002F04.architecture\u002F07.workflows","i-lucide-workflow",{"title":258,"icon":259,"path":260,"stem":261,"children":262,"page":45},"Realtime","i-lucide-cable","\u002Fdocs\u002Frealtime","docs\u002F05.realtime",[263,266,270,274,279,284,288],{"title":142,"path":264,"stem":265,"icon":259},"\u002Fdocs\u002Frealtime\u002Foverview","docs\u002F05.realtime\u002F01.overview",{"title":267,"path":268,"stem":269,"icon":129},"WebSockets","\u002Fdocs\u002Frealtime\u002Fwebsockets","docs\u002F05.realtime\u002F02.websockets",{"title":271,"path":272,"stem":273,"icon":70},"WebSocket Contracts","\u002Fdocs\u002Frealtime\u002Fwebsocket-contracts","docs\u002F05.realtime\u002F03.websocket-contracts",{"title":275,"path":276,"stem":277,"icon":278},"Server-Sent Events","\u002Fdocs\u002Frealtime\u002Fserver-sent-events","docs\u002F05.realtime\u002F04.server-sent-events","i-lucide-rss",{"title":280,"path":281,"stem":282,"icon":283},"Typed Clients","\u002Fdocs\u002Frealtime\u002Ftyped-clients","docs\u002F05.realtime\u002F05.typed-clients","i-lucide-plug-zap",{"title":285,"path":286,"stem":287,"icon":259},"AsyncAPI","\u002Fdocs\u002Frealtime\u002Fasyncapi","docs\u002F05.realtime\u002F06.asyncapi",{"title":289,"path":290,"stem":291,"icon":80},"Durable Objects","\u002Fdocs\u002Frealtime\u002Fdurable-objects","docs\u002F05.realtime\u002F07.durable-objects",{"title":293,"icon":294,"path":295,"stem":296,"children":297,"page":45},"Deploy","i-lucide-cloud-upload","\u002Fdocs\u002Fdeploy","docs\u002F06.deploy",[298,301,306,311,316,321,326,331,336,341,345,350],{"title":142,"path":299,"stem":300,"icon":6},"\u002Fdocs\u002Fdeploy\u002Foverview","docs\u002F06.deploy\u002F01.overview",{"title":302,"path":303,"stem":304,"icon":305},"Node","\u002Fdocs\u002Fdeploy\u002Fnode","docs\u002F06.deploy\u002F02.node","la:node-js",{"title":307,"path":308,"stem":309,"icon":310},"Cloudflare","\u002Fdocs\u002Fdeploy\u002Fcloudflare","docs\u002F06.deploy\u002F03.cloudflare","simple-icons:cloudflare",{"title":312,"path":313,"stem":314,"icon":315},"Vercel","\u002Fdocs\u002Fdeploy\u002Fvercel","docs\u002F06.deploy\u002F04.vercel","ri:vercel-fill",{"title":317,"path":318,"stem":319,"icon":320},"Netlify","\u002Fdocs\u002Fdeploy\u002Fnetlify","docs\u002F06.deploy\u002F05.netlify","i-simple-icons-netlify",{"title":322,"path":323,"stem":324,"icon":325},"AWS Lambda","\u002Fdocs\u002Fdeploy\u002Faws-lambda","docs\u002F06.deploy\u002F06.aws-lambda","hugeicons:aws-lambda",{"title":327,"path":328,"stem":329,"icon":330},"Deno Deploy","\u002Fdocs\u002Fdeploy\u002Fdeno-deploy","docs\u002F06.deploy\u002F07.deno-deploy","simple-icons:denodeploy",{"title":332,"path":333,"stem":334,"icon":335},"Nitro","\u002Fdocs\u002Fdeploy\u002Fnitro","docs\u002F06.deploy\u002F08.nitro","i-unjs-nitro",{"title":337,"path":338,"stem":339,"icon":340},"Nuxt","\u002Fdocs\u002Fdeploy\u002Fnuxt","docs\u002F06.deploy\u002F09.nuxt","i-devicon-nuxt",{"title":342,"path":343,"stem":344,"icon":236},"Mixed-runtime split","\u002Fdocs\u002Fdeploy\u002Fmixed-runtime-split","docs\u002F06.deploy\u002F10.mixed-runtime-split",{"title":346,"path":347,"stem":348,"icon":349},"Hosts","\u002Fdocs\u002Fdeploy\u002Fhosts","docs\u002F06.deploy\u002F11.hosts","i-lucide-map",{"title":351,"path":352,"stem":353,"icon":354},"Cross-service events","\u002Fdocs\u002Fdeploy\u002Fcross-service-events","docs\u002F06.deploy\u002F12.cross-service-events","i-lucide-network",{"title":356,"icon":357,"path":358,"stem":359,"children":360,"page":45},"CLI","i-lucide-terminal","\u002Fdocs\u002Fcli","docs\u002F07.cli",[361,365,369,373],{"title":362,"path":363,"stem":364,"icon":357},"The heximon CLI","\u002Fdocs\u002Fcli\u002Foverview","docs\u002F07.cli\u002F01.overview",{"title":366,"path":367,"stem":368,"icon":137},"Create a New App","\u002Fdocs\u002Fcli\u002Fcreate","docs\u002F07.cli\u002F02.create",{"title":370,"path":371,"stem":372,"icon":95},"Migrations from the CLI","\u002Fdocs\u002Fcli\u002Fmigrations","docs\u002F07.cli\u002F03.migrations",{"title":374,"path":375,"stem":376,"icon":6},"Deploying a Heximon app","\u002Fdocs\u002Fcli\u002Fdeploy","docs\u002F07.cli\u002F04.deploy",{"title":378,"icon":379,"path":380,"stem":381,"children":382,"page":45},"Under the Hood","i-lucide-wrench","\u002Fdocs\u002Funder-the-hood","docs\u002F08.under-the-hood",[383,388,393,397,402,407,411,415],{"title":384,"path":385,"stem":386,"icon":387},"How the Compiler Works","\u002Fdocs\u002Funder-the-hood\u002Fhow-the-compiler-works","docs\u002F08.under-the-hood\u002F01.how-the-compiler-works","i-lucide-cog",{"title":389,"path":390,"stem":391,"icon":392},"Compiler","\u002Fdocs\u002Funder-the-hood\u002Fextending-the-compiler","docs\u002F08.under-the-hood\u002F02.extending-the-compiler","i-lucide-cpu",{"title":394,"path":395,"stem":396,"icon":357},"Compiler Diagnostics","\u002Fdocs\u002Funder-the-hood\u002Fcompiler-diagnostics","docs\u002F08.under-the-hood\u002F03.compiler-diagnostics",{"title":398,"path":399,"stem":400,"icon":401},"Library Mode","\u002Fdocs\u002Funder-the-hood\u002Flibrary-mode","docs\u002F08.under-the-hood\u002F04.library-mode","i-lucide-package",{"title":403,"path":404,"stem":405,"icon":406},"Other bundlers","\u002Fdocs\u002Funder-the-hood\u002Falternate-bundlers","docs\u002F08.under-the-hood\u002F05.alternate-bundlers","i-lucide-blocks",{"title":408,"path":409,"stem":410,"icon":401},"Packages","\u002Fdocs\u002Funder-the-hood\u002Fpackages","docs\u002F08.under-the-hood\u002F06.packages",{"title":412,"path":413,"stem":414,"icon":207},"AI Skills","\u002Fdocs\u002Funder-the-hood\u002Fai-and-agents","docs\u002F08.under-the-hood\u002F07.ai-and-agents",{"title":416,"path":417,"stem":418,"icon":419},"Advanced DI","\u002Fdocs\u002Funder-the-hood\u002Fadvanced-di","docs\u002F08.under-the-hood\u002F08.advanced-di","i-lucide-git-fork",{"title":421,"icon":422,"path":423,"stem":424,"children":425,"page":45},"Recipes","i-lucide-book-open-check","\u002Fdocs\u002Frecipes","docs\u002F09.recipes",[426,431,436,440,444,448,452,456,460,465,469,474,479,484,488],{"title":427,"path":428,"stem":429,"icon":430},"Send an Email","\u002Fdocs\u002Frecipes\u002Fsend-an-email","docs\u002F09.recipes\u002F01.send-an-email","i-lucide-send",{"title":432,"path":433,"stem":434,"icon":435},"Upload a File","\u002Fdocs\u002Frecipes\u002Fupload-a-file","docs\u002F09.recipes\u002F02.upload-a-file","i-lucide-upload",{"title":437,"path":438,"stem":439,"icon":24},"Cache an Expensive Call","\u002Fdocs\u002Frecipes\u002Fcache-an-expensive-call","docs\u002F09.recipes\u002F03.cache-an-expensive-call",{"title":441,"path":442,"stem":443,"icon":154},"Paginate a List","\u002Fdocs\u002Frecipes\u002Fpaginate-a-list","docs\u002F09.recipes\u002F04.paginate-a-list",{"title":445,"path":446,"stem":447,"icon":65},"Protect Admin Routes","\u002Fdocs\u002Frecipes\u002Fprotect-admin-routes","docs\u002F09.recipes\u002F05.protect-admin-routes",{"title":449,"path":450,"stem":451,"icon":178},"Health Probes and a Nightly Job","\u002Fdocs\u002Frecipes\u002Fhealth-probes-and-a-nightly-job","docs\u002F09.recipes\u002F06.health-probes-and-a-nightly-job",{"title":453,"path":454,"stem":455,"icon":80},"Build a CRUD API","\u002Fdocs\u002Frecipes\u002Fcrud-api","docs\u002F09.recipes\u002F07.crud-api",{"title":457,"path":458,"stem":459,"icon":100},"Add Authentication","\u002Fdocs\u002Frecipes\u002Fadd-authentication","docs\u002F09.recipes\u002F08.add-authentication",{"title":461,"path":462,"stem":463,"icon":464},"Background Jobs","\u002Fdocs\u002Frecipes\u002Fbackground-jobs","docs\u002F09.recipes\u002F09.background-jobs","i-lucide-timer",{"title":466,"path":467,"stem":468,"icon":149},"Decouple Features with Events","\u002Fdocs\u002Frecipes\u002Fevent-driven-module","docs\u002F09.recipes\u002F10.event-driven-module",{"title":470,"path":471,"stem":472,"icon":473},"Build a DDD Aggregate","\u002Fdocs\u002Frecipes\u002Fddd-aggregate","docs\u002F09.recipes\u002F11.ddd-aggregate","i-lucide-box",{"title":475,"path":476,"stem":477,"icon":478},"Publish a Feature Package","\u002Fdocs\u002Frecipes\u002Ffeature-package","docs\u002F09.recipes\u002F12.feature-package","i-lucide-package-open",{"title":480,"path":481,"stem":482,"icon":483},"Reliable Integration Events","\u002Fdocs\u002Frecipes\u002Freliable-integration-events","docs\u002F09.recipes\u002F13.reliable-integration-events","i-lucide-inbox",{"title":485,"path":486,"stem":487,"icon":95},"Reactive Choreography","\u002Fdocs\u002Frecipes\u002Freactive-choreography","docs\u002F09.recipes\u002F14.reactive-choreography",{"title":489,"path":490,"stem":491,"icon":492},"Build a Production CRUD API","\u002Fdocs\u002Frecipes\u002Fproduction-crud-api","docs\u002F09.recipes\u002F15.production-crud-api","i-lucide-layers",{"id":494,"title":214,"body":495,"description":1921,"extension":1922,"links":1923,"meta":1924,"navigation":1925,"path":215,"seo":1926,"stem":216,"__hash__":1927},"docs\u002Fdocs\u002F03.capabilities\u002F16.branded-ids.md",{"type":496,"value":497,"toc":1914},"minimark",[498,521,728,736,741,758,874,877,940,969,973,988,1117,1120,1171,1185,1196,1212,1216,1226,1549,1561,1565,1571,1732,1739,1843,1853,1857,1910],[499,500,501,502,506,507,510,511,514,515,517,518,520],"p",{},"A ",[503,504,505],"code",{},"UserId"," is a ",[503,508,509],{},"string"," at runtime, but you never want to pass one where the code expects an ",[503,512,513],{},"OrderId",".\nA branded type makes that a build error: ",[503,516,505],{}," and ",[503,519,513],{}," are both strings under the hood, yet\nTypeScript treats them as different types, so mixing them up is caught the moment you save the file.",[522,523,528],"pre",{"className":524,"code":525,"language":526,"meta":527,"style":527},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import type { Branded } from \"@heximon\u002Fprimitives\";\n\nexport type UserId = Branded\u003Cstring, \"UserId\">;\nexport type OrderId = Branded\u003Cstring, \"OrderId\">;\n\ndeclare function loadUser(id: UserId): Promise\u003CUser>;\n\nconst orderId = OrderId.generate();\nloadUser(orderId); \u002F\u002F build error — an OrderId is not a UserId\n","ts","",[503,529,530,569,576,611,639,644,682,687,712],{"__ignoreMap":527},[531,532,535,539,542,546,550,553,556,559,563,566],"span",{"class":533,"line":534},"line",1,[531,536,538],{"class":537},"s7zQu","import",[531,540,541],{"class":537}," type",[531,543,545],{"class":544},"sMK4o"," {",[531,547,549],{"class":548},"sTEyZ"," Branded",[531,551,552],{"class":544}," }",[531,554,555],{"class":537}," from",[531,557,558],{"class":544}," \"",[531,560,562],{"class":561},"sfazB","@heximon\u002Fprimitives",[531,564,565],{"class":544},"\"",[531,567,568],{"class":544},";\n",[531,570,572],{"class":533,"line":571},2,[531,573,575],{"emptyLinePlaceholder":574},true,"\n",[531,577,579,582,585,589,592,594,597,599,602,604,606,608],{"class":533,"line":578},3,[531,580,581],{"class":537},"export",[531,583,541],{"class":584},"spNyl",[531,586,588],{"class":587},"sBMFI"," UserId",[531,590,591],{"class":544}," =",[531,593,549],{"class":587},[531,595,596],{"class":544},"\u003C",[531,598,509],{"class":587},[531,600,601],{"class":544},",",[531,603,558],{"class":544},[531,605,505],{"class":561},[531,607,565],{"class":544},[531,609,610],{"class":544},">;\n",[531,612,614,616,618,621,623,625,627,629,631,633,635,637],{"class":533,"line":613},4,[531,615,581],{"class":537},[531,617,541],{"class":584},[531,619,620],{"class":587}," OrderId",[531,622,591],{"class":544},[531,624,549],{"class":587},[531,626,596],{"class":544},[531,628,509],{"class":587},[531,630,601],{"class":544},[531,632,558],{"class":544},[531,634,513],{"class":561},[531,636,565],{"class":544},[531,638,610],{"class":544},[531,640,642],{"class":533,"line":641},5,[531,643,575],{"emptyLinePlaceholder":574},[531,645,647,650,653,657,660,664,667,669,672,675,677,680],{"class":533,"line":646},6,[531,648,649],{"class":584},"declare",[531,651,652],{"class":584}," function",[531,654,656],{"class":655},"s2Zo4"," loadUser",[531,658,659],{"class":544},"(",[531,661,663],{"class":662},"sHdIc","id",[531,665,666],{"class":544},":",[531,668,588],{"class":587},[531,670,671],{"class":544},"):",[531,673,674],{"class":587}," Promise",[531,676,596],{"class":544},[531,678,679],{"class":587},"User",[531,681,610],{"class":544},[531,683,685],{"class":533,"line":684},7,[531,686,575],{"emptyLinePlaceholder":574},[531,688,690,693,696,699,701,704,707,710],{"class":533,"line":689},8,[531,691,692],{"class":584},"const",[531,694,695],{"class":548}," orderId ",[531,697,698],{"class":544},"=",[531,700,620],{"class":548},[531,702,703],{"class":544},".",[531,705,706],{"class":655},"generate",[531,708,709],{"class":548},"()",[531,711,568],{"class":544},[531,713,715,718,721,724],{"class":533,"line":714},9,[531,716,717],{"class":655},"loadUser",[531,719,720],{"class":548},"(orderId)",[531,722,723],{"class":544},";",[531,725,727],{"class":726},"sHwdD"," \u002F\u002F build error — an OrderId is not a UserId\n",[499,729,730,731,735],{},"The brand is ",[732,733,734],"strong",{},"type-only",": it exists in the type system and erases at compile time, so there is no\nwrapper class, no boxing, and nothing to construct at runtime. A branded id is a plain string everywhere\nyour program actually runs — the distinctness costs you nothing.",[737,738,740],"h2",{"id":739},"declare-a-branded-id-type","Declare a branded id type",[499,742,743,746,747,749,750,753,754,757],{},[503,744,745],{},"Branded\u003CT, B>"," from ",[503,748,562],{}," tags a base type ",[503,751,752],{},"T"," with a string brand ",[503,755,756],{},"B",". Two ids that\nshare a base but differ in brand are mutually unassignable — that's the whole point.",[522,759,761],{"className":524,"code":760,"language":526,"meta":527,"style":527},"import type { Branded } from \"@heximon\u002Fprimitives\";\n\n\u002F\u002F Same base type, different brands — not interchangeable.\nexport type UserId = Branded\u003Cstring, \"UserId\">;\nexport type OrderId = Branded\u003Cstring, \"OrderId\">;\nexport type ProductId = Branded\u003Cstring, \"ProductId\">;\n",[503,762,763,785,789,794,820,846],{"__ignoreMap":527},[531,764,765,767,769,771,773,775,777,779,781,783],{"class":533,"line":534},[531,766,538],{"class":537},[531,768,541],{"class":537},[531,770,545],{"class":544},[531,772,549],{"class":548},[531,774,552],{"class":544},[531,776,555],{"class":537},[531,778,558],{"class":544},[531,780,562],{"class":561},[531,782,565],{"class":544},[531,784,568],{"class":544},[531,786,787],{"class":533,"line":571},[531,788,575],{"emptyLinePlaceholder":574},[531,790,791],{"class":533,"line":578},[531,792,793],{"class":726},"\u002F\u002F Same base type, different brands — not interchangeable.\n",[531,795,796,798,800,802,804,806,808,810,812,814,816,818],{"class":533,"line":613},[531,797,581],{"class":537},[531,799,541],{"class":584},[531,801,588],{"class":587},[531,803,591],{"class":544},[531,805,549],{"class":587},[531,807,596],{"class":544},[531,809,509],{"class":587},[531,811,601],{"class":544},[531,813,558],{"class":544},[531,815,505],{"class":561},[531,817,565],{"class":544},[531,819,610],{"class":544},[531,821,822,824,826,828,830,832,834,836,838,840,842,844],{"class":533,"line":641},[531,823,581],{"class":537},[531,825,541],{"class":584},[531,827,620],{"class":587},[531,829,591],{"class":544},[531,831,549],{"class":587},[531,833,596],{"class":544},[531,835,509],{"class":587},[531,837,601],{"class":544},[531,839,558],{"class":544},[531,841,513],{"class":561},[531,843,565],{"class":544},[531,845,610],{"class":544},[531,847,848,850,852,855,857,859,861,863,865,867,870,872],{"class":533,"line":646},[531,849,581],{"class":537},[531,851,541],{"class":584},[531,853,854],{"class":587}," ProductId",[531,856,591],{"class":544},[531,858,549],{"class":587},[531,860,596],{"class":544},[531,862,509],{"class":587},[531,864,601],{"class":544},[531,866,558],{"class":544},[531,868,869],{"class":561},"ProductId",[531,871,565],{"class":544},[531,873,610],{"class":544},[499,875,876],{},"If a value object or entity just needs nominal distinctness and you mint its ids elsewhere, the type\nalias alone is enough — that's exactly how the DDD ladder example brands its user identifier:",[522,878,881],{"className":524,"code":879,"filename":880,"language":526,"meta":527,"style":527},"import type { Branded } from \"@heximon\u002Fprimitives\";\n\n\u002F** The branded primary-key type for a `User` — a zero-runtime nominal brand. *\u002F\nexport type UserId = Branded\u003Cstring, \"UserId\">;\n","src\u002Fusers\u002Fuser.entity.ts",[503,882,883,905,909,914],{"__ignoreMap":527},[531,884,885,887,889,891,893,895,897,899,901,903],{"class":533,"line":534},[531,886,538],{"class":537},[531,888,541],{"class":537},[531,890,545],{"class":544},[531,892,549],{"class":548},[531,894,552],{"class":544},[531,896,555],{"class":537},[531,898,558],{"class":544},[531,900,562],{"class":561},[531,902,565],{"class":544},[531,904,568],{"class":544},[531,906,907],{"class":533,"line":571},[531,908,575],{"emptyLinePlaceholder":574},[531,910,911],{"class":533,"line":578},[531,912,913],{"class":726},"\u002F** The branded primary-key type for a `User` — a zero-runtime nominal brand. *\u002F\n",[531,915,916,918,920,922,924,926,928,930,932,934,936,938],{"class":533,"line":613},[531,917,581],{"class":537},[531,919,541],{"class":584},[531,921,588],{"class":587},[531,923,591],{"class":544},[531,925,549],{"class":587},[531,927,596],{"class":544},[531,929,509],{"class":587},[531,931,601],{"class":544},[531,933,558],{"class":544},[531,935,505],{"class":561},[531,937,565],{"class":544},[531,939,610],{"class":544},[941,942,730,944,947,948,951,952,954,955,959,960,963,964,968],"callout",{"type":943},"info",[732,945,946],{},"weak",": a ",[503,949,950],{},"Branded\u003Cstring, \"UserId\">"," and a plain ",[503,953,509],{}," interchange freely in both\ndirections — the distinction is only ",[956,957,958],"em",{},"between brands",". That's deliberate. The brand keeps ids from\ncrossing wires; it does ",[732,961,962],{},"not"," validate format. Validate strings you adopt from the outside at the\nboundary with a ",[965,966,967],"a",{"href":210},"schema",", not with the brand.",[737,970,972],{"id":971},"mint-and-adopt-ids-with-the-id-helper","Mint and adopt ids with the Id helper",[499,974,975,976,979,980,983,984,987],{},"Most ids want a helper to go with the type — one place to mint a fresh id and one to adopt an inbound\nstring. ",[503,977,978],{},"Id\u003CBrand>()"," builds that helper; the canonical idiom declares the brand type, then mints the\nmatching helper under the same name. ",[503,981,982],{},"Id"," is re-exported from ",[503,985,986],{},"@heximon\u002Fruntime",", so entities and\ntests keep the core import path:",[522,989,992],{"className":524,"code":990,"filename":991,"language":526,"meta":527,"style":527},"import type { Branded } from \"@heximon\u002Fprimitives\";\nimport { Id } from \"@heximon\u002Fruntime\";\n\nexport type UserId = Branded\u003Cstring, \"UserId\">;\n\n\u002F** UserId.generate() mints a fresh v7 id; UserId.from(raw) adopts an inbound string as the brand. *\u002F\nexport const UserId: ReturnType\u003Ctypeof Id\u003CUserId>> = Id\u003CUserId>();\n","src\u002Fusers\u002Fuser.ts",[503,993,994,1016,1037,1041,1067,1071,1076],{"__ignoreMap":527},[531,995,996,998,1000,1002,1004,1006,1008,1010,1012,1014],{"class":533,"line":534},[531,997,538],{"class":537},[531,999,541],{"class":537},[531,1001,545],{"class":544},[531,1003,549],{"class":548},[531,1005,552],{"class":544},[531,1007,555],{"class":537},[531,1009,558],{"class":544},[531,1011,562],{"class":561},[531,1013,565],{"class":544},[531,1015,568],{"class":544},[531,1017,1018,1020,1022,1025,1027,1029,1031,1033,1035],{"class":533,"line":571},[531,1019,538],{"class":537},[531,1021,545],{"class":544},[531,1023,1024],{"class":548}," Id",[531,1026,552],{"class":544},[531,1028,555],{"class":537},[531,1030,558],{"class":544},[531,1032,986],{"class":561},[531,1034,565],{"class":544},[531,1036,568],{"class":544},[531,1038,1039],{"class":533,"line":578},[531,1040,575],{"emptyLinePlaceholder":574},[531,1042,1043,1045,1047,1049,1051,1053,1055,1057,1059,1061,1063,1065],{"class":533,"line":613},[531,1044,581],{"class":537},[531,1046,541],{"class":584},[531,1048,588],{"class":587},[531,1050,591],{"class":544},[531,1052,549],{"class":587},[531,1054,596],{"class":544},[531,1056,509],{"class":587},[531,1058,601],{"class":544},[531,1060,558],{"class":544},[531,1062,505],{"class":561},[531,1064,565],{"class":544},[531,1066,610],{"class":544},[531,1068,1069],{"class":533,"line":641},[531,1070,575],{"emptyLinePlaceholder":574},[531,1072,1073],{"class":533,"line":646},[531,1074,1075],{"class":726},"\u002F** UserId.generate() mints a fresh v7 id; UserId.from(raw) adopts an inbound string as the brand. *\u002F\n",[531,1077,1078,1080,1083,1085,1087,1090,1093,1095,1097,1099,1102,1104,1106,1108,1110,1113,1115],{"class":533,"line":684},[531,1079,581],{"class":537},[531,1081,1082],{"class":584}," const",[531,1084,588],{"class":548},[531,1086,666],{"class":544},[531,1088,1089],{"class":587}," ReturnType",[531,1091,1092],{"class":544},"\u003Ctypeof",[531,1094,1024],{"class":548},[531,1096,596],{"class":544},[531,1098,505],{"class":587},[531,1100,1101],{"class":544},">>",[531,1103,591],{"class":544},[531,1105,1024],{"class":655},[531,1107,596],{"class":544},[531,1109,505],{"class":587},[531,1111,1112],{"class":544},">",[531,1114,709],{"class":548},[531,1116,568],{"class":544},[499,1118,1119],{},"That gives you two methods, both typed as the brand:",[522,1121,1123],{"className":524,"code":1122,"language":526,"meta":527,"style":527},"const fresh = UserId.generate();        \u002F\u002F a brand-new, time-ordered UserId\nconst adopted = UserId.from(pathParam); \u002F\u002F an inbound string, re-typed as a UserId\n",[503,1124,1125,1147],{"__ignoreMap":527},[531,1126,1127,1129,1132,1134,1136,1138,1140,1142,1144],{"class":533,"line":534},[531,1128,692],{"class":584},[531,1130,1131],{"class":548}," fresh ",[531,1133,698],{"class":544},[531,1135,588],{"class":548},[531,1137,703],{"class":544},[531,1139,706],{"class":655},[531,1141,709],{"class":548},[531,1143,723],{"class":544},[531,1145,1146],{"class":726},"        \u002F\u002F a brand-new, time-ordered UserId\n",[531,1148,1149,1151,1154,1156,1158,1160,1163,1166,1168],{"class":533,"line":571},[531,1150,692],{"class":584},[531,1152,1153],{"class":548}," adopted ",[531,1155,698],{"class":544},[531,1157,588],{"class":548},[531,1159,703],{"class":544},[531,1161,1162],{"class":655},"from",[531,1164,1165],{"class":548},"(pathParam)",[531,1167,723],{"class":544},[531,1169,1170],{"class":726}," \u002F\u002F an inbound string, re-typed as a UserId\n",[499,1172,1173,1176,1177,1180,1181,1184],{},[503,1174,1175],{},"generate()"," mints a fresh, time-ordered (v7) UUID — time-ordered because that keeps freshly created ids\nroughly sortable and index-friendly. ",[503,1178,1179],{},"from(raw)"," is an ",[732,1182,1183],{},"intent wrapper",": it re-types a string you got\nfrom the outside (a path parameter, a database row) as the brand. It performs no validation by design —\nit documents that you've decided to trust this string as an id, and leaves format checking to the schema\nat the boundary.",[499,1186,1187,1188,1191,1192,1195],{},"The helper is DI-free — there is no ",[503,1189,1190],{},"UUIDFactory"," provider to inject. You call it directly in entities,\nvalue objects, scripts, and tests, which is exactly what lets the caller mint an id ",[956,1193,1194],{},"before"," dispatching\na command (the CQRS \"client-generated identity\" idiom — a command states intent and returns nothing, so\nthe id can't come back as a result).",[941,1197,1199,1200,1203,1204,1207,1208,1211],{"type":1198},"tip","For a one-off id without a declared helper, call ",[503,1201,1202],{},"uuid"," directly: ",[503,1205,1206],{},"uuid.v7\u003CUserId>()"," (time-ordered, the\ndefault) or ",[503,1209,1210],{},"uuid.v4\u003CUserId>()"," (fully random). The type parameter brands the return, so the call site\nreads it as the domain type with no cast.",[737,1213,1215],{"id":1214},"use-a-branded-id-as-an-aggregates-identity","Use a branded id as an aggregate's identity",[499,1217,1218,1219,1222,1223,1225],{},"A branded id is the natural identity type for a DDD ",[965,1220,1221],{"href":229},"aggregate",". The aggregate is\nparameterized by both its props and its id brand, so its ",[503,1224,663],{}," is typed end-to-end:",[522,1227,1229],{"className":524,"code":1228,"filename":880,"language":526,"meta":527,"style":527},"import type { Branded } from \"@heximon\u002Fprimitives\";\nimport { AggregateRoot } from \"@heximon\u002Fdomain\";\nimport { Email } from \".\u002Femail.value\";\n\nexport type UserId = Branded\u003Cstring, \"UserId\">;\n\ninterface UserProps extends Record\u003Cstring, unknown> {\n  name: string;\n  email: Email;\n}\n\nexport class User extends AggregateRoot\u003CUserProps, UserId> {\n  public static create(id: UserId, props: { name: string; email: string }): User {\n    return new User(id, { name: props.name, email: Email.create(props.email) });\n  }\n}\n",[503,1230,1231,1253,1275,1297,1301,1327,1331,1359,1372,1383,1389,1394,1422,1474,1538,1544],{"__ignoreMap":527},[531,1232,1233,1235,1237,1239,1241,1243,1245,1247,1249,1251],{"class":533,"line":534},[531,1234,538],{"class":537},[531,1236,541],{"class":537},[531,1238,545],{"class":544},[531,1240,549],{"class":548},[531,1242,552],{"class":544},[531,1244,555],{"class":537},[531,1246,558],{"class":544},[531,1248,562],{"class":561},[531,1250,565],{"class":544},[531,1252,568],{"class":544},[531,1254,1255,1257,1259,1262,1264,1266,1268,1271,1273],{"class":533,"line":571},[531,1256,538],{"class":537},[531,1258,545],{"class":544},[531,1260,1261],{"class":548}," AggregateRoot",[531,1263,552],{"class":544},[531,1265,555],{"class":537},[531,1267,558],{"class":544},[531,1269,1270],{"class":561},"@heximon\u002Fdomain",[531,1272,565],{"class":544},[531,1274,568],{"class":544},[531,1276,1277,1279,1281,1284,1286,1288,1290,1293,1295],{"class":533,"line":578},[531,1278,538],{"class":537},[531,1280,545],{"class":544},[531,1282,1283],{"class":548}," Email",[531,1285,552],{"class":544},[531,1287,555],{"class":537},[531,1289,558],{"class":544},[531,1291,1292],{"class":561},".\u002Femail.value",[531,1294,565],{"class":544},[531,1296,568],{"class":544},[531,1298,1299],{"class":533,"line":613},[531,1300,575],{"emptyLinePlaceholder":574},[531,1302,1303,1305,1307,1309,1311,1313,1315,1317,1319,1321,1323,1325],{"class":533,"line":641},[531,1304,581],{"class":537},[531,1306,541],{"class":584},[531,1308,588],{"class":587},[531,1310,591],{"class":544},[531,1312,549],{"class":587},[531,1314,596],{"class":544},[531,1316,509],{"class":587},[531,1318,601],{"class":544},[531,1320,558],{"class":544},[531,1322,505],{"class":561},[531,1324,565],{"class":544},[531,1326,610],{"class":544},[531,1328,1329],{"class":533,"line":646},[531,1330,575],{"emptyLinePlaceholder":574},[531,1332,1333,1336,1339,1342,1345,1347,1349,1351,1354,1356],{"class":533,"line":684},[531,1334,1335],{"class":584},"interface",[531,1337,1338],{"class":587}," UserProps",[531,1340,1341],{"class":584}," extends",[531,1343,1344],{"class":587}," Record",[531,1346,596],{"class":544},[531,1348,509],{"class":587},[531,1350,601],{"class":544},[531,1352,1353],{"class":587}," unknown",[531,1355,1112],{"class":544},[531,1357,1358],{"class":544}," {\n",[531,1360,1361,1365,1367,1370],{"class":533,"line":689},[531,1362,1364],{"class":1363},"swJcz","  name",[531,1366,666],{"class":544},[531,1368,1369],{"class":587}," string",[531,1371,568],{"class":544},[531,1373,1374,1377,1379,1381],{"class":533,"line":714},[531,1375,1376],{"class":1363},"  email",[531,1378,666],{"class":544},[531,1380,1283],{"class":587},[531,1382,568],{"class":544},[531,1384,1386],{"class":533,"line":1385},10,[531,1387,1388],{"class":544},"}\n",[531,1390,1392],{"class":533,"line":1391},11,[531,1393,575],{"emptyLinePlaceholder":574},[531,1395,1397,1399,1402,1405,1407,1409,1411,1414,1416,1418,1420],{"class":533,"line":1396},12,[531,1398,581],{"class":537},[531,1400,1401],{"class":584}," class",[531,1403,1404],{"class":587}," User",[531,1406,1341],{"class":584},[531,1408,1261],{"class":587},[531,1410,596],{"class":544},[531,1412,1413],{"class":587},"UserProps",[531,1415,601],{"class":544},[531,1417,588],{"class":587},[531,1419,1112],{"class":544},[531,1421,1358],{"class":544},[531,1423,1425,1428,1431,1434,1436,1438,1440,1442,1444,1447,1449,1451,1454,1456,1458,1460,1463,1465,1467,1470,1472],{"class":533,"line":1424},13,[531,1426,1427],{"class":584},"  public",[531,1429,1430],{"class":584}," static",[531,1432,1433],{"class":1363}," create",[531,1435,659],{"class":544},[531,1437,663],{"class":662},[531,1439,666],{"class":544},[531,1441,588],{"class":587},[531,1443,601],{"class":544},[531,1445,1446],{"class":662}," props",[531,1448,666],{"class":544},[531,1450,545],{"class":544},[531,1452,1453],{"class":1363}," name",[531,1455,666],{"class":544},[531,1457,1369],{"class":587},[531,1459,723],{"class":544},[531,1461,1462],{"class":1363}," email",[531,1464,666],{"class":544},[531,1466,1369],{"class":587},[531,1468,1469],{"class":544}," }):",[531,1471,1404],{"class":587},[531,1473,1358],{"class":544},[531,1475,1477,1480,1483,1485,1487,1489,1491,1493,1495,1497,1499,1501,1504,1506,1508,1510,1512,1514,1517,1519,1522,1524,1527,1530,1533,1536],{"class":533,"line":1476},14,[531,1478,1479],{"class":537},"    return",[531,1481,1482],{"class":544}," new",[531,1484,1404],{"class":655},[531,1486,659],{"class":1363},[531,1488,663],{"class":548},[531,1490,601],{"class":544},[531,1492,545],{"class":544},[531,1494,1453],{"class":1363},[531,1496,666],{"class":544},[531,1498,1446],{"class":548},[531,1500,703],{"class":544},[531,1502,1503],{"class":548},"name",[531,1505,601],{"class":544},[531,1507,1462],{"class":1363},[531,1509,666],{"class":544},[531,1511,1283],{"class":548},[531,1513,703],{"class":544},[531,1515,1516],{"class":655},"create",[531,1518,659],{"class":1363},[531,1520,1521],{"class":548},"props",[531,1523,703],{"class":544},[531,1525,1526],{"class":548},"email",[531,1528,1529],{"class":1363},") ",[531,1531,1532],{"class":544},"}",[531,1534,1535],{"class":1363},")",[531,1537,568],{"class":544},[531,1539,1541],{"class":533,"line":1540},15,[531,1542,1543],{"class":544},"  }\n",[531,1545,1547],{"class":533,"line":1546},16,[531,1548,1388],{"class":544},[499,1550,1551,1552,1180,1554,1557,1558,1560],{},"A domain prop can carry its own value object rather than a raw scalar — here ",[503,1553,1526],{},[503,1555,1556],{},"Email",", which\nvalidates the address on construction, so a ",[503,1559,679],{}," can never hold a malformed one.",[737,1562,1564],{"id":1563},"carry-an-id-end-to-end","Carry an id end to end",[499,1566,1567,1568,1570],{},"The same branded id stays one type from the moment you mint it, through the create call, into the\npersistence schema, and back out the API. The controller mints a fresh ",[503,1569,505],{}," up front and passes it\nstraight to the aggregate factory:",[522,1572,1575],{"className":524,"code":1573,"filename":1574,"language":526,"meta":527,"style":527},"public async create(\n  action: Post\u003C\"\u002F\", { body: typeof createUserSchema }>,\n): Promise\u003CTypedResponse> {\n  const body = await action.request.readValidatedBody();\n  const user = User.create(uuid.v7\u003CUserId>(), body);\n\n  await this.users.save(user);\n  await this.domainEvents.emitFrom(user);\n\n  return action.respond(201, UserController.toResponse(user));\n}\n","src\u002Fusers\u002Fuser.controller.ts",[503,1576,1577,1587,1619,1636,1662,1696,1700,1705,1710,1714,1728],{"__ignoreMap":527},[531,1578,1579,1582,1584],{"class":533,"line":534},[531,1580,1581],{"class":548},"public async ",[531,1583,1516],{"class":655},[531,1585,1586],{"class":548},"(\n",[531,1588,1589,1592,1594,1596,1599,1601,1603,1605,1608,1610,1613,1616],{"class":533,"line":571},[531,1590,1591],{"class":548},"  action: Post",[531,1593,596],{"class":544},[531,1595,565],{"class":544},[531,1597,1598],{"class":561},"\u002F",[531,1600,565],{"class":544},[531,1602,601],{"class":544},[531,1604,545],{"class":544},[531,1606,1607],{"class":1363}," body",[531,1609,666],{"class":544},[531,1611,1612],{"class":544}," typeof",[531,1614,1615],{"class":548}," createUserSchema ",[531,1617,1618],{"class":544},"}>,\n",[531,1620,1621,1624,1627,1629,1632,1634],{"class":533,"line":578},[531,1622,1623],{"class":548},"): ",[531,1625,1626],{"class":587},"Promise",[531,1628,596],{"class":544},[531,1630,1631],{"class":548},"TypedResponse",[531,1633,1112],{"class":544},[531,1635,1358],{"class":544},[531,1637,1638,1641,1643,1646,1649,1651,1654,1656,1659],{"class":533,"line":613},[531,1639,1640],{"class":548},"  const body ",[531,1642,698],{"class":544},[531,1644,1645],{"class":537}," await",[531,1647,1648],{"class":548}," action",[531,1650,703],{"class":544},[531,1652,1653],{"class":548},"request",[531,1655,703],{"class":544},[531,1657,1658],{"class":655},"readValidatedBody",[531,1660,1661],{"class":548},"();\n",[531,1663,1664,1667,1669,1671,1673,1675,1678,1680,1683,1685,1687,1689,1691,1693],{"class":533,"line":641},[531,1665,1666],{"class":548},"  const user ",[531,1668,698],{"class":544},[531,1670,1404],{"class":548},[531,1672,703],{"class":544},[531,1674,1516],{"class":655},[531,1676,1677],{"class":548},"(uuid",[531,1679,703],{"class":544},[531,1681,1682],{"class":655},"v7",[531,1684,596],{"class":544},[531,1686,505],{"class":587},[531,1688,1112],{"class":544},[531,1690,709],{"class":548},[531,1692,601],{"class":544},[531,1694,1695],{"class":548}," body);\n",[531,1697,1698],{"class":533,"line":646},[531,1699,575],{"emptyLinePlaceholder":574},[531,1701,1702],{"class":533,"line":684},[531,1703,1704],{"class":548},"  await this.users.save(user);\n",[531,1706,1707],{"class":533,"line":689},[531,1708,1709],{"class":548},"  await this.domainEvents.emitFrom(user);\n",[531,1711,1712],{"class":533,"line":714},[531,1713,575],{"emptyLinePlaceholder":574},[531,1715,1716,1719,1723,1725],{"class":533,"line":1385},[531,1717,1718],{"class":548},"  return action.respond(",[531,1720,1722],{"class":1721},"sbssI","201",[531,1724,601],{"class":544},[531,1726,1727],{"class":548}," UserController.toResponse(user));\n",[531,1729,1730],{"class":533,"line":1391},[531,1731,1388],{"class":544},[499,1733,1734,1735,1738],{},"The brand also pins a Drizzle column's type with ",[503,1736,1737],{},".$type\u003C...>()",", so a row read back from the database is\nalready branded — no cast at the persistence edge:",[522,1740,1743],{"className":524,"code":1741,"filename":1742,"language":526,"meta":527,"style":527},"export const Users = DrizzleSQLiteEntity.define(User, \"users\", {\n  id: text(\"id\").notNull().primaryKey().$type\u003CUserId>(),\n  \u002F\u002F …\n});\n","src\u002Fusers\u002Fuser.schema.ts",[503,1744,1745,1780,1830,1835],{"__ignoreMap":527},[531,1746,1747,1749,1751,1754,1756,1759,1761,1764,1767,1769,1771,1774,1776,1778],{"class":533,"line":534},[531,1748,581],{"class":537},[531,1750,1082],{"class":584},[531,1752,1753],{"class":548}," Users ",[531,1755,698],{"class":544},[531,1757,1758],{"class":548}," DrizzleSQLiteEntity",[531,1760,703],{"class":544},[531,1762,1763],{"class":655},"define",[531,1765,1766],{"class":548},"(User",[531,1768,601],{"class":544},[531,1770,558],{"class":544},[531,1772,1773],{"class":561},"users",[531,1775,565],{"class":544},[531,1777,601],{"class":544},[531,1779,1358],{"class":544},[531,1781,1782,1785,1787,1790,1792,1794,1796,1798,1800,1802,1805,1807,1809,1812,1814,1816,1819,1821,1823,1825,1827],{"class":533,"line":571},[531,1783,1784],{"class":1363},"  id",[531,1786,666],{"class":544},[531,1788,1789],{"class":655}," text",[531,1791,659],{"class":548},[531,1793,565],{"class":544},[531,1795,663],{"class":561},[531,1797,565],{"class":544},[531,1799,1535],{"class":548},[531,1801,703],{"class":544},[531,1803,1804],{"class":655},"notNull",[531,1806,709],{"class":548},[531,1808,703],{"class":544},[531,1810,1811],{"class":655},"primaryKey",[531,1813,709],{"class":548},[531,1815,703],{"class":544},[531,1817,1818],{"class":655},"$type",[531,1820,596],{"class":544},[531,1822,505],{"class":587},[531,1824,1112],{"class":544},[531,1826,709],{"class":548},[531,1828,1829],{"class":544},",\n",[531,1831,1832],{"class":533,"line":578},[531,1833,1834],{"class":726},"  \u002F\u002F …\n",[531,1836,1837,1839,1841],{"class":533,"line":613},[531,1838,1532],{"class":544},[531,1840,1535],{"class":548},[531,1842,568],{"class":544},[499,1844,1845,1846,1848,1849,1852],{},"One ",[503,1847,505],{}," runs from ",[503,1850,1851],{},"uuid.v7()",", through the aggregate, through the Drizzle schema, to the API\nresponse. The compiler enforces the chain at every hop, and because the brand erases at build time, all\nof that safety costs exactly zero at runtime.",[737,1854,1856],{"id":1855},"see-also","See also",[1858,1859,1860,1870,1875,1880,1887],"ul",{},[1861,1862,1863,1865,1866,1869],"li",{},[965,1864,209],{"href":210}," — validate the strings you adopt with ",[503,1867,1868],{},"from(...)"," at the request\nboundary, since the brand itself checks nothing.",[1861,1871,1872,1874],{},[965,1873,228],{"href":229}," — where a branded id becomes an aggregate's identity type.",[1861,1876,1877,1879],{},[965,1878,233],{"href":234}," — the client-generated-identity idiom that mints a branded id before a\ncommand and reads the result back with a query.",[1861,1881,1882,1884,1885,703],{},[965,1883,82],{"href":83}," — pin a column's type to a brand with ",[503,1886,1737],{},[1861,1888,1889,1897,1898,1900,1901,1903,1904,1906,1907,703],{},[965,1890,1894],{"href":1891,"rel":1892},"https:\u002F\u002Fgithub.com\u002Fheximon\u002Fheximon\u002Ftree\u002Fmain\u002Fexamples\u002Fladder\u002FL06-ddd",[1893],"nofollow",[732,1895,1896],{},"L06 — DDD","\n— a ",[503,1899,679],{}," aggregate keyed by a ",[503,1902,505],{},", with an ",[503,1905,1556],{}," value object flattened into its own Drizzle\ncolumn via ",[503,1908,1909],{},"valueObject(...)",[1911,1912,1913],"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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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}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 .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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":527,"searchDepth":571,"depth":571,"links":1915},[1916,1917,1918,1919,1920],{"id":739,"depth":571,"text":740},{"id":971,"depth":571,"text":972},{"id":1214,"depth":571,"text":1215},{"id":1563,"depth":571,"text":1564},{"id":1855,"depth":571,"text":1856},"Nominal entity identifiers with the zero-runtime Branded type and the DI-free Id helper — generate, from, uuid.v7, uuid.v4, $type, and end-to-end id safety.","md",null,{},{"icon":217},{"title":214,"description":1921},"55UHe9vZ2nI1eR2m_wc7FfLbRQ7PI5fsH_bzfKRWbJs",[1929,1931],{"title":209,"path":210,"stem":211,"description":1930,"icon":212,"children":-1},"Author request and response shapes with SchemaObject and SchemaArray — one class that is both the validated TypeScript type and a Standard Schema value, with partial, pick, omit, and extend derivations.",{"title":142,"path":225,"stem":226,"description":1932,"icon":220,"children":-1},"When to reach for CQRS, Domain-Driven Design, the repository pattern, integration events, sagas, and workflows — and when a plain controller and a plain provider are still the right call.",1783300761903]