[{"data":1,"prerenderedAt":4026},["ShallowReactive",2],{"navigation_docs":3,"-learn-catalogs":612,"-learn-catalogs-surround":4021},[4,35,85,148,328,489,548,587],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Start","\u002Fstart","1.start",[9,14,19,24,29],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Why start with evlog","\u002Fstart\u002Fwhy-evlog","1.start\u002F2.why-evlog","i-lucide-rocket",{"title":20,"path":21,"stem":22,"icon":23},"Installation","\u002Fstart\u002Finstallation","1.start\u002F3.installation","i-lucide-download",{"title":25,"path":26,"stem":27,"icon":28},"Quick Start","\u002Fstart\u002Fquick-start","1.start\u002F4.quick-start","i-lucide-zap",{"title":30,"path":31,"stem":32,"icon":33},"Choose your logger","\u002Fstart\u002Ftypescript-logging-library","1.start\u002F5.typescript-logging-library","i-lucide-file-code",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Learn","\u002Flearn","2.learn",[40,45,50,55,60,65,70,75,80],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flearn\u002Foverview","2.learn\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flearn\u002Fsimple-logging","2.learn\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flearn\u002Fwide-events","2.learn\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flearn\u002Fstructured-errors","2.learn\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Lifecycle","\u002Flearn\u002Flifecycle","2.learn\u002F4.lifecycle","i-lucide-arrow-right-left",{"title":66,"path":67,"stem":68,"icon":69},"Sampling","\u002Flearn\u002Fsampling","2.learn\u002F5.sampling","i-lucide-filter",{"title":71,"path":72,"stem":73,"icon":74},"Auto-Redaction","\u002Flearn\u002Fredaction","2.learn\u002F6.redaction","i-lucide-eye-off",{"title":76,"path":77,"stem":78,"icon":79},"Typed Fields","\u002Flearn\u002Ftyped-fields","2.learn\u002F7.typed-fields","i-simple-icons-typescript",{"title":81,"path":82,"stem":83,"icon":84},"Catalogs","\u002Flearn\u002Fcatalogs","2.learn\u002F8.catalogs","i-lucide-book-open",{"title":86,"path":87,"stem":88,"children":89,"page":34},"CLI","\u002Fcli","3.cli",[90,93,98,103,108,113,118,123,128,133,138,143],{"title":41,"path":91,"stem":92,"icon":49},"\u002Fcli\u002Foverview","3.cli\u002F0.overview",{"title":94,"path":95,"stem":96,"icon":97},"init","\u002Fcli\u002Finit","3.cli\u002F1.init","i-lucide-wand-sparkles",{"title":99,"path":100,"stem":101,"icon":102},"logs","\u002Fcli\u002Flogs","3.cli\u002F10.logs","i-lucide-scroll-text",{"title":104,"path":105,"stem":106,"icon":107},"config","\u002Fcli\u002Fconfig","3.cli\u002F11.config","i-lucide-settings-2",{"title":109,"path":110,"stem":111,"icon":112},"map","\u002Fcli\u002Fmap","3.cli\u002F2.map","i-lucide-radar",{"title":114,"path":115,"stem":116,"icon":117},"Rules","\u002Fcli\u002Frules","3.cli\u002F3.rules","i-lucide-list-checks",{"title":119,"path":120,"stem":121,"icon":122},"Scoring","\u002Fcli\u002Fscoring","3.cli\u002F4.scoring","i-lucide-gauge",{"title":124,"path":125,"stem":126,"icon":127},"CI","\u002Fcli\u002Fci","3.cli\u002F5.ci","i-lucide-git-pull-request",{"title":129,"path":130,"stem":131,"icon":132},"doctor","\u002Fcli\u002Fdoctor","3.cli\u002F6.doctor","i-lucide-stethoscope",{"title":134,"path":135,"stem":136,"icon":137},"telemetry","\u002Fcli\u002Ftelemetry","3.cli\u002F7.telemetry","i-lucide-bar-chart-3",{"title":139,"path":140,"stem":141,"icon":142},"agents","\u002Fcli\u002Fagents","3.cli\u002F8.agents","i-lucide-bot",{"title":144,"path":145,"stem":146,"icon":147},"Observability Score","\u002Fcli\u002Fobservability-score","3.cli\u002F9.observability-score","i-lucide-activity",{"title":149,"path":150,"stem":151,"children":152,"page":34},"Integrate","\u002Fintegrate","4.integrate",[153,157,240],{"title":41,"path":154,"stem":155,"icon":156},"\u002Fintegrate\u002Foverview","4.integrate\u002F0.overview","i-lucide-plug",{"title":158,"path":159,"stem":160,"children":161,"page":34},"Adapters","\u002Fintegrate\u002Fadapters","4.integrate\u002Fadapters",[162,165,195,220],{"title":41,"path":163,"stem":164,"icon":44},"\u002Fintegrate\u002Fadapters\u002Foverview","4.integrate\u002Fadapters\u002F01.overview",{"title":166,"path":167,"stem":168,"children":169,"page":34},"Cloud","\u002Fintegrate\u002Fadapters\u002Fcloud","4.integrate\u002Fadapters\u002Fcloud",[170,175,180,185,190],{"title":171,"path":172,"stem":173,"icon":174},"Axiom","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Faxiom","4.integrate\u002Fadapters\u002Fcloud\u002F01.axiom","i-custom-axiom",{"title":176,"path":177,"stem":178,"icon":179},"PostHog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog","4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog","i-simple-icons-posthog",{"title":181,"path":182,"stem":183,"icon":184},"Sentry","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fsentry","4.integrate\u002Fadapters\u002Fcloud\u002F03.sentry","i-simple-icons-sentry",{"title":186,"path":187,"stem":188,"icon":189},"Better Stack","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fbetter-stack","4.integrate\u002Fadapters\u002Fcloud\u002F04.better-stack","i-simple-icons-betterstack",{"title":191,"path":192,"stem":193,"icon":194},"Datadog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fdatadog","4.integrate\u002Fadapters\u002Fcloud\u002F05.datadog","i-simple-icons-datadog",{"title":196,"path":197,"stem":198,"children":199,"page":34},"Cloud or Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fhybrid","4.integrate\u002Fadapters\u002Fhybrid",[200,205,210,215],{"title":201,"path":202,"stem":203,"icon":204},"Grafana Loki","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Floki","4.integrate\u002Fadapters\u002Fhybrid\u002F01.loki","i-simple-icons-grafana",{"title":206,"path":207,"stem":208,"icon":209},"ClickHouse","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fclickhouse","4.integrate\u002Fadapters\u002Fhybrid\u002F02.clickhouse","i-simple-icons-clickhouse",{"title":211,"path":212,"stem":213,"icon":214},"OTLP","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fotlp","4.integrate\u002Fadapters\u002Fhybrid\u002F03.otlp","i-simple-icons-opentelemetry",{"title":216,"path":217,"stem":218,"icon":219},"HyperDX","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fhyperdx","4.integrate\u002Fadapters\u002Fhybrid\u002F04.hyperdx","i-custom-hyperdx",{"title":221,"path":222,"stem":223,"children":224,"page":34},"Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fself-hosted","4.integrate\u002Fadapters\u002Fself-hosted",[225,230,235],{"title":226,"path":227,"stem":228,"icon":229},"File System","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Ffs","4.integrate\u002Fadapters\u002Fself-hosted\u002F01.fs","i-lucide-hard-drive",{"title":231,"path":232,"stem":233,"icon":234},"NuxtHub","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fnuxthub","4.integrate\u002Fadapters\u002Fself-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":236,"path":237,"stem":238,"icon":239},"Memory","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fmemory","4.integrate\u002Fadapters\u002Fself-hosted\u002F03.memory","i-lucide-cpu",{"title":241,"path":242,"stem":243,"children":244,"page":34},"Frameworks","\u002Fintegrate\u002Fframeworks","4.integrate\u002Fframeworks",[245,249,254,259,264,269,274,279,284,289,294,299,304,309,313,318,323],{"title":41,"path":246,"stem":247,"icon":248},"\u002Fintegrate\u002Fframeworks\u002Foverview","4.integrate\u002Fframeworks\u002F00.overview","i-lucide-layout-grid",{"title":250,"path":251,"stem":252,"icon":253},"Nuxt","\u002Fintegrate\u002Fframeworks\u002Fnuxt","4.integrate\u002Fframeworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":255,"path":256,"stem":257,"icon":258},"Next.js","\u002Fintegrate\u002Fframeworks\u002Fnextjs","4.integrate\u002Fframeworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":260,"path":261,"stem":262,"icon":263},"SvelteKit","\u002Fintegrate\u002Fframeworks\u002Fsveltekit","4.integrate\u002Fframeworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":265,"path":266,"stem":267,"icon":268},"Nitro","\u002Fintegrate\u002Fframeworks\u002Fnitro","4.integrate\u002Fframeworks\u002F04.nitro","i-custom-nitro",{"title":270,"path":271,"stem":272,"icon":273},"TanStack Start","\u002Fintegrate\u002Fframeworks\u002Ftanstack-start","4.integrate\u002Fframeworks\u002F05.tanstack-start","i-custom-tanstack",{"title":275,"path":276,"stem":277,"icon":278},"NestJS","\u002Fintegrate\u002Fframeworks\u002Fnestjs","4.integrate\u002Fframeworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":280,"path":281,"stem":282,"icon":283},"Express","\u002Fintegrate\u002Fframeworks\u002Fexpress","4.integrate\u002Fframeworks\u002F07.express","i-simple-icons-express",{"title":285,"path":286,"stem":287,"icon":288},"Hono","\u002Fintegrate\u002Fframeworks\u002Fhono","4.integrate\u002Fframeworks\u002F08.hono","i-simple-icons-hono",{"title":290,"path":291,"stem":292,"icon":293},"Fastify","\u002Fintegrate\u002Fframeworks\u002Ffastify","4.integrate\u002Fframeworks\u002F09.fastify","i-simple-icons-fastify",{"title":295,"path":296,"stem":297,"icon":298},"Elysia","\u002Fintegrate\u002Fframeworks\u002Felysia","4.integrate\u002Fframeworks\u002F10.elysia","i-custom-elysia",{"title":300,"path":301,"stem":302,"icon":303},"React Router","\u002Fintegrate\u002Fframeworks\u002Freact-router","4.integrate\u002Fframeworks\u002F11.react-router","i-custom-reactrouter",{"title":305,"path":306,"stem":307,"icon":308},"Cloudflare Workers","\u002Fintegrate\u002Fframeworks\u002Fcloudflare-workers","4.integrate\u002Fframeworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":310,"path":311,"stem":312,"icon":79},"Standalone","\u002Fintegrate\u002Fframeworks\u002Fstandalone","4.integrate\u002Fframeworks\u002F13.standalone",{"title":314,"path":315,"stem":316,"icon":317},"Astro","\u002Fintegrate\u002Fframeworks\u002Fastro","4.integrate\u002Fframeworks\u002F14.astro","i-simple-icons-astro",{"title":319,"path":320,"stem":321,"icon":322},"oRPC","\u002Fintegrate\u002Fframeworks\u002Forpc","4.integrate\u002Fframeworks\u002F15.orpc","i-lucide-network",{"title":324,"path":325,"stem":326,"icon":327},"AWS Lambda","\u002Fintegrate\u002Fframeworks\u002Faws-lambda","4.integrate\u002Fframeworks\u002F16.aws-lambda","i-custom-lambda",{"title":329,"path":330,"stem":331,"children":332,"page":34},"Use Cases","\u002Fuse-cases","5.use-cases",[333,336,341,369,396,428,449,454,459,463],{"title":41,"path":334,"stem":335,"icon":117},"\u002Fuse-cases\u002Foverview","5.use-cases\u002F0.overview",{"title":337,"path":338,"stem":339,"icon":340},"Client Logging","\u002Fuse-cases\u002Fclient-logging","5.use-cases\u002F1.client-logging","i-lucide-monitor",{"title":342,"icon":343,"path":344,"stem":345,"children":346,"page":34},"AI SDK","i-simple-icons-vercel","\u002Fuse-cases\u002Fai-sdk","5.use-cases\u002F2.ai-sdk",[347,350,355,360,365],{"title":41,"path":348,"stem":349,"icon":44},"\u002Fuse-cases\u002Fai-sdk\u002Foverview","5.use-cases\u002F2.ai-sdk\u002F01.overview",{"title":351,"path":352,"stem":353,"icon":354},"Usage","\u002Fuse-cases\u002Fai-sdk\u002Fusage","5.use-cases\u002F2.ai-sdk\u002F02.usage","i-lucide-code",{"title":356,"path":357,"stem":358,"icon":359},"Options","\u002Fuse-cases\u002Fai-sdk\u002Foptions","5.use-cases\u002F2.ai-sdk\u002F03.options","i-lucide-sliders",{"title":361,"path":362,"stem":363,"icon":364},"Metadata","\u002Fuse-cases\u002Fai-sdk\u002Fmetadata","5.use-cases\u002F2.ai-sdk\u002F04.metadata","i-lucide-database",{"title":366,"path":367,"stem":368,"icon":147},"Telemetry","\u002Fuse-cases\u002Fai-sdk\u002Ftelemetry","5.use-cases\u002F2.ai-sdk\u002F05.telemetry",{"title":370,"icon":371,"path":372,"stem":373,"children":374,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Fuse-cases\u002Fbetter-auth","5.use-cases\u002F3.better-auth",[375,378,383,388,392],{"title":41,"path":376,"stem":377,"icon":44},"\u002Fuse-cases\u002Fbetter-auth\u002Foverview","5.use-cases\u002F3.better-auth\u002F01.overview",{"title":379,"path":380,"stem":381,"icon":382},"Identify User","\u002Fuse-cases\u002Fbetter-auth\u002Fidentify-user","5.use-cases\u002F3.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":384,"path":385,"stem":386,"icon":387},"Middleware","\u002Fuse-cases\u002Fbetter-auth\u002Fmiddleware","5.use-cases\u002F3.better-auth\u002F03.middleware","i-lucide-shield",{"title":389,"path":390,"stem":391,"icon":340},"Client Sync","\u002Fuse-cases\u002Fbetter-auth\u002Fclient-sync","5.use-cases\u002F3.better-auth\u002F04.client-sync",{"title":393,"path":394,"stem":395,"icon":122},"Performance","\u002Fuse-cases\u002Fbetter-auth\u002Fperformance","5.use-cases\u002F3.better-auth\u002F05.performance",{"title":397,"icon":398,"path":399,"stem":400,"children":401,"page":34},"Audit Logs","i-lucide-shield-check","\u002Fuse-cases\u002Faudit","5.use-cases\u002F4.audit",[402,405,410,415,420,424],{"title":41,"path":403,"stem":404,"icon":44},"\u002Fuse-cases\u002Faudit\u002Foverview","5.use-cases\u002F4.audit\u002F01.overview",{"title":406,"path":407,"stem":408,"icon":409},"Schema","\u002Fuse-cases\u002Faudit\u002Fschema","5.use-cases\u002F4.audit\u002F02.schema","i-lucide-file-text",{"title":411,"path":412,"stem":413,"icon":414},"Recording","\u002Fuse-cases\u002Faudit\u002Frecording","5.use-cases\u002F4.audit\u002F03.recording","i-lucide-pen-line",{"title":416,"path":417,"stem":418,"icon":419},"Drains","\u002Fuse-cases\u002Faudit\u002Fpipeline","5.use-cases\u002F4.audit\u002F04.pipeline","i-lucide-link",{"title":421,"path":422,"stem":423,"icon":398},"Compliance","\u002Fuse-cases\u002Faudit\u002Fcompliance","5.use-cases\u002F4.audit\u002F05.compliance",{"title":425,"path":426,"stem":427,"icon":84},"Recipes","\u002Fuse-cases\u002Faudit\u002Frecipes","5.use-cases\u002F4.audit\u002F06.recipes",{"title":366,"icon":122,"path":429,"stem":430,"children":431,"page":34},"\u002Fuse-cases\u002Ftelemetry","5.use-cases\u002F4.telemetry",[432,435,440,445],{"title":41,"path":433,"stem":434,"icon":44},"\u002Fuse-cases\u002Ftelemetry\u002Foverview","5.use-cases\u002F4.telemetry\u002F01.overview",{"title":436,"path":437,"stem":438,"icon":439},"Setup","\u002Fuse-cases\u002Ftelemetry\u002Fsetup","5.use-cases\u002F4.telemetry\u002F02.setup","i-lucide-wrench",{"title":441,"path":442,"stem":443,"icon":444},"Ingest","\u002Fuse-cases\u002Ftelemetry\u002Fingest","5.use-cases\u002F4.telemetry\u002F03.ingest","i-lucide-server",{"title":446,"path":447,"stem":448,"icon":84},"Reference","\u002Fuse-cases\u002Ftelemetry\u002Freference","5.use-cases\u002F4.telemetry\u002F04.reference",{"title":450,"path":451,"stem":452,"icon":453},"Enrichers","\u002Fuse-cases\u002Fenrichers","5.use-cases\u002F5.enrichers","i-lucide-sparkles",{"title":455,"path":456,"stem":457,"icon":458},"eve","\u002Fuse-cases\u002Feve","5.use-cases\u002F5.eve","i-custom-eve",{"title":460,"path":461,"stem":462,"icon":444},"Node.js request logging","\u002Fuse-cases\u002Fstructured-logging-nodejs","5.use-cases\u002F6.structured-logging-nodejs",{"title":464,"icon":465,"path":466,"stem":467,"children":468,"page":34},"Signals","i-lucide-scan-search","\u002Fuse-cases\u002Fsignals","5.use-cases\u002F7.signals",[469,472,477,482,485],{"title":41,"path":470,"stem":471,"icon":44},"\u002Fuse-cases\u002Fsignals\u002Foverview","5.use-cases\u002F7.signals\u002F01.overview",{"title":473,"path":474,"stem":475,"icon":476},"What You Can Ask","\u002Fuse-cases\u002Fsignals\u002Fask","5.use-cases\u002F7.signals\u002F02.ask","i-lucide-message-circle-question",{"title":478,"path":479,"stem":480,"icon":481},"What It Costs","\u002Fuse-cases\u002Fsignals\u002Fcost","5.use-cases\u002F7.signals\u002F03.cost","i-lucide-coins",{"title":446,"path":483,"stem":484,"icon":84},"\u002Fuse-cases\u002Fsignals\u002Freference","5.use-cases\u002F7.signals\u002F04.reference",{"title":425,"path":486,"stem":487,"icon":488},"\u002Fuse-cases\u002Fsignals\u002Frecipes","5.use-cases\u002F7.signals\u002F05.recipes","i-lucide-lightbulb",{"title":490,"path":491,"stem":492,"children":493,"page":34},"Extend","\u002Fextend","6.extend",[494,498,503,508,512,517,521,525,529,533,538,543],{"title":41,"path":495,"stem":496,"icon":497},"\u002Fextend\u002Foverview","6.extend\u002F0.overview","i-lucide-blocks",{"title":499,"path":500,"stem":501,"icon":502},"Stream","\u002Fextend\u002Fstream","6.extend\u002F1.stream","i-lucide-radio-tower",{"title":504,"path":505,"stem":506,"icon":507},"Custom framework","\u002Fextend\u002Fcustom-framework","6.extend\u002F10.custom-framework","i-lucide-puzzle",{"title":509,"path":510,"stem":511,"icon":502},"Diagnostics channel","\u002Fextend\u002Fdiagnostics-channel","6.extend\u002F11.diagnostics-channel",{"title":513,"path":514,"stem":515,"icon":516},"FS reader","\u002Fextend\u002Ffs-reader","6.extend\u002F2.fs-reader","i-lucide-folder-search",{"title":425,"path":518,"stem":519,"icon":520},"\u002Fextend\u002Fconsumer-recipes","6.extend\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":522,"path":523,"stem":524,"icon":497},"Plugins","\u002Fextend\u002Fplugins","6.extend\u002F4.plugins",{"title":526,"path":527,"stem":528,"icon":453},"Custom enrichers","\u002Fextend\u002Fcustom-enrichers","6.extend\u002F5.custom-enrichers",{"title":530,"path":531,"stem":532,"icon":69},"Tail sampling","\u002Fextend\u002Ftail-sampling","6.extend\u002F6.tail-sampling",{"title":534,"path":535,"stem":536,"icon":537},"Identity headers","\u002Fextend\u002Fidentity-headers","6.extend\u002F7.identity-headers","i-lucide-fingerprint",{"title":539,"path":540,"stem":541,"icon":542},"Custom drains","\u002Fextend\u002Fcustom-drains","6.extend\u002F8.custom-drains","i-lucide-share-2",{"title":544,"path":545,"stem":546,"icon":547},"Drain pipeline","\u002Fextend\u002Fdrain-pipeline","6.extend\u002F9.drain-pipeline","i-lucide-workflow",{"title":446,"path":549,"stem":550,"children":551,"page":34},"\u002Freference","7.reference",[552,556,561,564,569,573,578,582],{"title":41,"path":553,"stem":554,"icon":555},"\u002Freference\u002Foverview","7.reference\u002F0.overview","i-lucide-book-marked",{"title":557,"path":558,"stem":559,"icon":560},"Configuration","\u002Freference\u002Fconfiguration","7.reference\u002F1.configuration","i-lucide-settings",{"title":393,"path":562,"stem":563,"icon":122},"\u002Freference\u002Fperformance","7.reference\u002F2.performance",{"title":565,"path":566,"stem":567,"icon":568},"Vite Plugin","\u002Freference\u002Fvite-plugin","7.reference\u002F3.vite-plugin","i-custom-vite",{"title":570,"path":571,"stem":572,"icon":398},"Best Practices","\u002Freference\u002Fbest-practices","7.reference\u002F4.best-practices",{"title":574,"path":575,"stem":576,"icon":577},"vs Other Loggers","\u002Freference\u002Fvs-other-loggers","7.reference\u002F5.vs-other-loggers","i-lucide-scale",{"title":579,"path":580,"stem":581,"icon":453},"Agent Skills","\u002Freference\u002Fagent-skills","7.reference\u002F6.agent-skills",{"title":583,"path":584,"stem":585,"icon":586},"Cost","\u002Freference\u002Fcost","7.reference\u002F7.cost","i-lucide-receipt",{"title":588,"path":589,"stem":590,"children":591,"page":34},"Compare","\u002Fcompare","8.compare",[592,596,600,604,608],{"title":593,"path":594,"stem":595,"icon":577},"evlog vs Pino","\u002Fcompare\u002Fpino","8.compare\u002F1.pino",{"title":597,"path":598,"stem":599,"icon":214},"evlog vs OpenTelemetry","\u002Fcompare\u002Fopentelemetry","8.compare\u002F2.opentelemetry",{"title":601,"path":602,"stem":603,"icon":577},"evlog vs LogTape","\u002Fcompare\u002Flogtape","8.compare\u002F3.logtape",{"title":605,"path":606,"stem":607,"icon":577},"evlog vs Winston: formats and request events","\u002Fcompare\u002Fwinston","8.compare\u002F4.winston",{"title":609,"path":610,"stem":611,"icon":577},"evlog vs Consola: reporters and request context","\u002Fcompare\u002Fconsola","8.compare\u002F5.consola",{"id":613,"title":81,"body":614,"description":4011,"extension":4012,"links":4013,"meta":4017,"navigation":4018,"path":82,"seo":4019,"stem":83,"__hash__":4020},"docs\u002F2.learn\u002F8.catalogs.md",{"type":615,"value":616,"toc":3984},"minimark",[617,636,787,800,805,808,911,917,921,924,929,940,1340,1344,1358,1366,1579,1589,1593,1605,1611,1791,1801,1805,1815,1821,1825,1831,1837,2088,2092,2382,2395,2399,2471,2528,2677,2698,2702,2706,2716,2944,2948,2951,2996,3118,3122,3146,3283,3287,3306,3310,3369,3375,3379,3382,3428,3511,3520,3524,3644,3651,3655,3671,3684,3700,3777,3781,3937,3943,3947,3980],[618,619,620,621,625,626,625,629,625,632,635],"p",{},"The catalog primitives (",[622,623,624],"code",{},"defineError",", ",[622,627,628],{},"defineErrorCatalog",[622,630,631],{},"defineAuditAction",[622,633,634],{},"defineAuditCatalog",") are the same regardless of project size. What changes is how you organise them. This page is the deep-dive: conventions, scaling recipes from one file to a published npm package, composition patterns, and the opt-in type augmentation.",[637,638,641,647,778],"prompt",{":actions":639,"description":640,"icon":84},"[\"copy\",\"cursor\",\"claude\"]","Set up typed error and audit catalogs in my app",[618,642,643,644,646],{},"Group errors and audit actions in typed catalogs to eliminate magic strings, get autocomplete on ",[622,645,622],{}," everywhere, and ship them as npm packages in a monorepo.",[648,649,650,662,672,686,695,705,712,719,737,744,758,768],"ul",{},[651,652,653,654,657,658,661],"li",{},"Use ",[622,655,656],{},"defineErrorCatalog(prefix, map)"," for error bundles, ",[622,659,660],{},"defineAuditCatalog(prefix, map)"," for audit bundles",[651,663,653,664,667,668,671],{},[622,665,666],{},"defineError(code, options)"," and ",[622,669,670],{},"defineAuditAction(action, opts?)"," for one-off factories that don't fit a catalog",[651,673,674,675,678,679,625,682,685],{},"Convention: UPPER_SNAKE_CASE keys, lower.dot.case prefix, wire format is ",[622,676,677],{},"${prefix}.${KEY}"," (e.g. ",[622,680,681],{},"billing.PAYMENT_DECLINED",[622,683,684],{},"billing.INVOICE_REFUND",")",[651,687,688,689,625,692,685],{},"One catalog = one bounded context = one prefix = one file (e.g. ",[622,690,691],{},"errors\u002Fbilling.ts",[622,693,694],{},"audit\u002Fbilling.ts",[651,696,697,698,701,702],{},"Throw with ",[622,699,700],{},"billingErrors.PAYMENT_DECLINED({ cause, internal })",", audit with ",[622,703,704],{},"log.audit(billingAudit.INVOICE_REFUND({ actor, target }))",[651,706,707,708,711],{},"Use templated messages (",[622,709,710],{},"message: ({ id }) => \\","User ${id} not found``) when params are dynamic and required",[651,713,714,715,718],{},"Catalog defaults for ",[622,716,717],{},"internal"," are shallow-merged with call-site values (call-site wins)",[651,720,721,722,725,726,625,729,732,733,736],{},"Add the opt-in ",[622,723,724],{},"declare module 'evlog' { interface RegisteredErrorCatalogs { billing: typeof billingErrors } }"," augmentation to surface autocomplete on ",[622,727,728],{},"createError({ code })",[622,730,731],{},"parseError(err).code",", and ",[622,734,735],{},"throwError(code)"," everywhere",[651,738,739,740,743],{},"Scale by sharding: single file → folder per domain → sub-prefixes (",[622,741,742],{},"billing.payment",") → one npm package per bounded context (each owns its prefix, no conflicts possible)",[651,745,746,747,750,751,754,755],{},"Each shared package ships its own ",[622,748,749],{},"declare module 'evlog'"," block in ",[622,752,753],{},"src\u002Findex.ts"," so the type augmentation propagates to consumers via the published ",[622,756,757],{},".d.ts",[651,759,760,761,764,765],{},"Compare on ",[622,762,763],{},"factory.code"," in tests instead of string literals so renames are TS errors, not silent breaks: ",[622,766,767],{},"expect(err.code).toBe(billingErrors.PAYMENT_DECLINED.code)",[651,769,770,771,773,774,777],{},"Never override ",[622,772,622],{}," at the call site (the catalog defines the code identity); never put ",[622,775,776],{},"declare module"," blocks in test files (they leak into the main type-checker)",[618,779,780,781],{},"Docs: ",[782,783,784],"a",{"href":784,"rel":785},"https:\u002F\u002Fwww.evlog.dev\u002Flearn\u002Fcatalogs",[786],"nofollow",[788,789,790,791,667,795,799],"tip",{},"If you haven't yet, start with ",[782,792,794],{"href":793},"\u002Flearn\u002Fstructured-errors#error-catalogs","Structured Errors → Error Catalogs",[782,796,798],{"href":797},"\u002Fuse-cases\u002Faudit\u002Frecording#defineauditcatalog","Audit → defineAuditCatalog"," for the basics. This page assumes you've used the primitives at least once.",[801,802,804],"h2",{"id":803},"conventions","Conventions",[618,806,807],{},"A single set of conventions covers both error and audit catalogs.",[809,810,811,826],"table",{},[812,813,814],"thead",{},[815,816,817,820,823],"tr",{},[818,819],"th",{},[818,821,822],{},"Convention",[818,824,825],{},"Example",[827,828,829,852,876,895],"tbody",{},[815,830,831,838,844],{},[832,833,834],"td",{},[835,836,837],"strong",{},"Catalog key",[832,839,840,843],{},[622,841,842],{},"UPPER_SNAKE_CASE"," (enum-style, scales to hundreds of entries)",[832,845,846,625,849],{},[622,847,848],{},"PAYMENT_DECLINED",[622,850,851],{},"INVOICE_REFUND",[815,853,854,859,865],{},[832,855,856],{},[835,857,858],{},"Prefix",[832,860,861,864],{},[622,862,863],{},"lower.dot.case",", can be hierarchical",[832,866,867,625,870,625,873],{},[622,868,869],{},"'billing'",[622,871,872],{},"'billing.payment'",[622,874,875],{},"'auth.session'",[815,877,878,883,888],{},[832,879,880],{},[835,881,882],{},"Wire format",[832,884,885,887],{},[622,886,677],{}," (preserved casing)",[832,889,890,625,892],{},[622,891,681],{},[622,893,894],{},"auth.INVALID_TOKEN",[815,896,897,902,905],{},[832,898,899],{},[835,900,901],{},"One catalog =",[832,903,904],{},"One bounded context, one prefix, one file",[832,906,907,625,909],{},[622,908,691],{},[622,910,694],{},[618,912,913,914,916],{},"The wire format ends up in HTTP responses, wide events, drains, and dashboards. Stick to it across services so a ",[622,915,622],{}," from one service is recognisable in another.",[801,918,920],{"id":919},"scaling-story","Scaling story",[618,922,923],{},"The same primitives cover four scales without API change.",[925,926,928],"h3",{"id":927},"_1-file-small-repo","1 file: small repo",[618,930,931,932,935,936,939],{},"One ",[622,933,934],{},"errors.ts",", one ",[622,937,938],{},"audit.ts",". Done.",[941,942,943,1189],"code-group",{},[944,945,951],"pre",{"className":946,"code":947,"filename":948,"language":949,"meta":950,"style":950},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineErrorCatalog } from 'evlog'\n\nexport const errors = defineErrorCatalog('app', {\n  USER_NOT_FOUND: { status: 404, message: 'User not found' },\n  FORBIDDEN: { status: 403, message: 'Forbidden' },\n  VALIDATION_FAILED: {\n    status: 400,\n    message: ({ field }: { field: string }) => `Invalid ${field}`,\n  },\n})\n","src\u002Ferrors.ts","typescript","",[622,952,953,986,993,1029,1067,1099,1109,1123,1174,1180],{"__ignoreMap":950},[954,955,958,962,966,970,973,976,979,983],"span",{"class":956,"line":957},"line",1,[954,959,961],{"class":960},"s7zQu","import",[954,963,965],{"class":964},"sMK4o"," {",[954,967,969],{"class":968},"sTEyZ"," defineErrorCatalog",[954,971,972],{"class":964}," }",[954,974,975],{"class":960}," from",[954,977,978],{"class":964}," '",[954,980,982],{"class":981},"sfazB","evlog",[954,984,985],{"class":964},"'\n",[954,987,989],{"class":956,"line":988},2,[954,990,992],{"emptyLinePlaceholder":991},true,"\n",[954,994,996,999,1003,1006,1009,1012,1015,1018,1021,1023,1026],{"class":956,"line":995},3,[954,997,998],{"class":960},"export",[954,1000,1002],{"class":1001},"spNyl"," const",[954,1004,1005],{"class":968}," errors ",[954,1007,1008],{"class":964},"=",[954,1010,969],{"class":1011},"s2Zo4",[954,1013,1014],{"class":968},"(",[954,1016,1017],{"class":964},"'",[954,1019,1020],{"class":981},"app",[954,1022,1017],{"class":964},[954,1024,1025],{"class":964},",",[954,1027,1028],{"class":964}," {\n",[954,1030,1032,1036,1039,1041,1044,1046,1050,1052,1055,1057,1059,1062,1064],{"class":956,"line":1031},4,[954,1033,1035],{"class":1034},"swJcz","  USER_NOT_FOUND",[954,1037,1038],{"class":964},":",[954,1040,965],{"class":964},[954,1042,1043],{"class":1034}," status",[954,1045,1038],{"class":964},[954,1047,1049],{"class":1048},"sbssI"," 404",[954,1051,1025],{"class":964},[954,1053,1054],{"class":1034}," message",[954,1056,1038],{"class":964},[954,1058,978],{"class":964},[954,1060,1061],{"class":981},"User not found",[954,1063,1017],{"class":964},[954,1065,1066],{"class":964}," },\n",[954,1068,1070,1073,1075,1077,1079,1081,1084,1086,1088,1090,1092,1095,1097],{"class":956,"line":1069},5,[954,1071,1072],{"class":1034},"  FORBIDDEN",[954,1074,1038],{"class":964},[954,1076,965],{"class":964},[954,1078,1043],{"class":1034},[954,1080,1038],{"class":964},[954,1082,1083],{"class":1048}," 403",[954,1085,1025],{"class":964},[954,1087,1054],{"class":1034},[954,1089,1038],{"class":964},[954,1091,978],{"class":964},[954,1093,1094],{"class":981},"Forbidden",[954,1096,1017],{"class":964},[954,1098,1066],{"class":964},[954,1100,1102,1105,1107],{"class":956,"line":1101},6,[954,1103,1104],{"class":1034},"  VALIDATION_FAILED",[954,1106,1038],{"class":964},[954,1108,1028],{"class":964},[954,1110,1112,1115,1117,1120],{"class":956,"line":1111},7,[954,1113,1114],{"class":1034},"    status",[954,1116,1038],{"class":964},[954,1118,1119],{"class":1048}," 400",[954,1121,1122],{"class":964},",\n",[954,1124,1126,1129,1131,1134,1138,1141,1143,1145,1147,1151,1154,1157,1160,1163,1166,1169,1172],{"class":956,"line":1125},8,[954,1127,1128],{"class":1011},"    message",[954,1130,1038],{"class":964},[954,1132,1133],{"class":964}," ({",[954,1135,1137],{"class":1136},"sHdIc"," field",[954,1139,1140],{"class":964}," }:",[954,1142,965],{"class":964},[954,1144,1137],{"class":1034},[954,1146,1038],{"class":964},[954,1148,1150],{"class":1149},"sBMFI"," string",[954,1152,1153],{"class":964}," })",[954,1155,1156],{"class":1001}," =>",[954,1158,1159],{"class":964}," `",[954,1161,1162],{"class":981},"Invalid ",[954,1164,1165],{"class":964},"${",[954,1167,1168],{"class":968},"field",[954,1170,1171],{"class":964},"}`",[954,1173,1122],{"class":964},[954,1175,1177],{"class":956,"line":1176},9,[954,1178,1179],{"class":964},"  },\n",[954,1181,1183,1186],{"class":956,"line":1182},10,[954,1184,1185],{"class":964},"}",[954,1187,1188],{"class":968},")\n",[944,1190,1193],{"className":946,"code":1191,"filename":1192,"language":949,"meta":950,"style":950},"import { defineAuditCatalog } from 'evlog'\n\nexport const audit = defineAuditCatalog('app', {\n  USER_LOGIN: { target: 'user', severity: 'medium' },\n  USER_DELETE: { target: 'user', severity: 'high', requiresChanges: true, requiresReason: true },\n})\n","src\u002Faudit.ts",[622,1194,1195,1214,1218,1243,1280,1334],{"__ignoreMap":950},[954,1196,1197,1199,1201,1204,1206,1208,1210,1212],{"class":956,"line":957},[954,1198,961],{"class":960},[954,1200,965],{"class":964},[954,1202,1203],{"class":968}," defineAuditCatalog",[954,1205,972],{"class":964},[954,1207,975],{"class":960},[954,1209,978],{"class":964},[954,1211,982],{"class":981},[954,1213,985],{"class":964},[954,1215,1216],{"class":956,"line":988},[954,1217,992],{"emptyLinePlaceholder":991},[954,1219,1220,1222,1224,1227,1229,1231,1233,1235,1237,1239,1241],{"class":956,"line":995},[954,1221,998],{"class":960},[954,1223,1002],{"class":1001},[954,1225,1226],{"class":968}," audit ",[954,1228,1008],{"class":964},[954,1230,1203],{"class":1011},[954,1232,1014],{"class":968},[954,1234,1017],{"class":964},[954,1236,1020],{"class":981},[954,1238,1017],{"class":964},[954,1240,1025],{"class":964},[954,1242,1028],{"class":964},[954,1244,1245,1248,1250,1252,1255,1257,1259,1262,1264,1266,1269,1271,1273,1276,1278],{"class":956,"line":1031},[954,1246,1247],{"class":1034},"  USER_LOGIN",[954,1249,1038],{"class":964},[954,1251,965],{"class":964},[954,1253,1254],{"class":1034}," target",[954,1256,1038],{"class":964},[954,1258,978],{"class":964},[954,1260,1261],{"class":981},"user",[954,1263,1017],{"class":964},[954,1265,1025],{"class":964},[954,1267,1268],{"class":1034}," severity",[954,1270,1038],{"class":964},[954,1272,978],{"class":964},[954,1274,1275],{"class":981},"medium",[954,1277,1017],{"class":964},[954,1279,1066],{"class":964},[954,1281,1282,1285,1287,1289,1291,1293,1295,1297,1299,1301,1303,1305,1307,1310,1312,1314,1317,1319,1323,1325,1328,1330,1332],{"class":956,"line":1069},[954,1283,1284],{"class":1034},"  USER_DELETE",[954,1286,1038],{"class":964},[954,1288,965],{"class":964},[954,1290,1254],{"class":1034},[954,1292,1038],{"class":964},[954,1294,978],{"class":964},[954,1296,1261],{"class":981},[954,1298,1017],{"class":964},[954,1300,1025],{"class":964},[954,1302,1268],{"class":1034},[954,1304,1038],{"class":964},[954,1306,978],{"class":964},[954,1308,1309],{"class":981},"high",[954,1311,1017],{"class":964},[954,1313,1025],{"class":964},[954,1315,1316],{"class":1034}," requiresChanges",[954,1318,1038],{"class":964},[954,1320,1322],{"class":1321},"sfNiH"," true",[954,1324,1025],{"class":964},[954,1326,1327],{"class":1034}," requiresReason",[954,1329,1038],{"class":964},[954,1331,1322],{"class":1321},[954,1333,1066],{"class":964},[954,1335,1336,1338],{"class":956,"line":1101},[954,1337,1185],{"class":964},[954,1339,1188],{"class":968},[925,1341,1343],{"id":1342},"_1-folder-1-file-per-domain-medium-repo","1 folder, 1 file per domain: medium repo",[618,1345,1346,1347,667,1350,1353,1354,1357],{},"Group by bounded context. One file per domain in ",[622,1348,1349],{},"src\u002Ferrors\u002F",[622,1351,1352],{},"src\u002Faudit\u002F",". An ",[622,1355,1356],{},"index.ts"," re-exports for ergonomic imports and centralises the type augmentation.",[944,1359,1364],{"className":1360,"code":1362,"language":1363},[1361],"language-text","src\u002F\n├── errors\u002F\n│   ├── billing.ts        → billingErrors (prefix: 'billing')\n│   ├── auth.ts           → authErrors    (prefix: 'auth')\n│   ├── user.ts           → userErrors    (prefix: 'user')\n│   └── index.ts          → re-export + declare module\n├── audit\u002F\n│   ├── billing.ts        → billingAudit\n│   ├── auth.ts           → authAudit\n│   └── index.ts\n","text",[622,1365,1362],{"__ignoreMap":950},[944,1367,1370],{"className":946,"code":1368,"filename":1369,"language":949,"meta":950,"style":950},"import type { authErrors } from '.\u002Fauth'\nimport type { billingErrors } from '.\u002Fbilling'\nimport type { userErrors } from '.\u002Fuser'\n\nexport { authErrors } from '.\u002Fauth'\nexport { billingErrors } from '.\u002Fbilling'\nexport { userErrors } from '.\u002Fuser'\n\ndeclare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    auth: typeof authErrors\n    billing: typeof billingErrors\n    user: typeof userErrors\n  }\n}\n","src\u002Ferrors\u002Findex.ts",[622,1371,1372,1395,1417,1439,1443,1461,1479,1497,1501,1517,1527,1541,1554,1567,1573],{"__ignoreMap":950},[954,1373,1374,1376,1379,1381,1384,1386,1388,1390,1393],{"class":956,"line":957},[954,1375,961],{"class":960},[954,1377,1378],{"class":960}," type",[954,1380,965],{"class":964},[954,1382,1383],{"class":968}," authErrors",[954,1385,972],{"class":964},[954,1387,975],{"class":960},[954,1389,978],{"class":964},[954,1391,1392],{"class":981},".\u002Fauth",[954,1394,985],{"class":964},[954,1396,1397,1399,1401,1403,1406,1408,1410,1412,1415],{"class":956,"line":988},[954,1398,961],{"class":960},[954,1400,1378],{"class":960},[954,1402,965],{"class":964},[954,1404,1405],{"class":968}," billingErrors",[954,1407,972],{"class":964},[954,1409,975],{"class":960},[954,1411,978],{"class":964},[954,1413,1414],{"class":981},".\u002Fbilling",[954,1416,985],{"class":964},[954,1418,1419,1421,1423,1425,1428,1430,1432,1434,1437],{"class":956,"line":995},[954,1420,961],{"class":960},[954,1422,1378],{"class":960},[954,1424,965],{"class":964},[954,1426,1427],{"class":968}," userErrors",[954,1429,972],{"class":964},[954,1431,975],{"class":960},[954,1433,978],{"class":964},[954,1435,1436],{"class":981},".\u002Fuser",[954,1438,985],{"class":964},[954,1440,1441],{"class":956,"line":1031},[954,1442,992],{"emptyLinePlaceholder":991},[954,1444,1445,1447,1449,1451,1453,1455,1457,1459],{"class":956,"line":1069},[954,1446,998],{"class":960},[954,1448,965],{"class":964},[954,1450,1383],{"class":968},[954,1452,972],{"class":964},[954,1454,975],{"class":960},[954,1456,978],{"class":964},[954,1458,1392],{"class":981},[954,1460,985],{"class":964},[954,1462,1463,1465,1467,1469,1471,1473,1475,1477],{"class":956,"line":1101},[954,1464,998],{"class":960},[954,1466,965],{"class":964},[954,1468,1405],{"class":968},[954,1470,972],{"class":964},[954,1472,975],{"class":960},[954,1474,978],{"class":964},[954,1476,1414],{"class":981},[954,1478,985],{"class":964},[954,1480,1481,1483,1485,1487,1489,1491,1493,1495],{"class":956,"line":1111},[954,1482,998],{"class":960},[954,1484,965],{"class":964},[954,1486,1427],{"class":968},[954,1488,972],{"class":964},[954,1490,975],{"class":960},[954,1492,978],{"class":964},[954,1494,1436],{"class":981},[954,1496,985],{"class":964},[954,1498,1499],{"class":956,"line":1125},[954,1500,992],{"emptyLinePlaceholder":991},[954,1502,1503,1506,1509,1511,1513,1515],{"class":956,"line":1176},[954,1504,1505],{"class":1001},"declare",[954,1507,1508],{"class":1001}," module",[954,1510,978],{"class":964},[954,1512,982],{"class":981},[954,1514,1017],{"class":964},[954,1516,1028],{"class":964},[954,1518,1519,1522,1525],{"class":956,"line":1182},[954,1520,1521],{"class":1001},"  interface",[954,1523,1524],{"class":1149}," RegisteredErrorCatalogs",[954,1526,1028],{"class":964},[954,1528,1530,1533,1535,1538],{"class":956,"line":1529},11,[954,1531,1532],{"class":1034},"    auth",[954,1534,1038],{"class":964},[954,1536,1537],{"class":964}," typeof",[954,1539,1540],{"class":968}," authErrors\n",[954,1542,1544,1547,1549,1551],{"class":956,"line":1543},12,[954,1545,1546],{"class":1034},"    billing",[954,1548,1038],{"class":964},[954,1550,1537],{"class":964},[954,1552,1553],{"class":968}," billingErrors\n",[954,1555,1557,1560,1562,1564],{"class":956,"line":1556},13,[954,1558,1559],{"class":1034},"    user",[954,1561,1038],{"class":964},[954,1563,1537],{"class":964},[954,1565,1566],{"class":968}," userErrors\n",[954,1568,1570],{"class":956,"line":1569},14,[954,1571,1572],{"class":964},"  }\n",[954,1574,1576],{"class":956,"line":1575},15,[954,1577,1578],{"class":964},"}\n",[618,1580,1581,1582,1584,1585,1588],{},"The augmentation is purely type-level: there is no ",[622,1583,94],{}," step, no runtime registration. Importing ",[622,1586,1587],{},"~\u002Ferrors"," once anywhere in your app is enough for TypeScript to pick up the merged type.",[925,1590,1592],{"id":1591},"sub-prefixes-very-large-repo","Sub-prefixes: very large repo",[618,1594,1595,1596,625,1598,625,1601,1604],{},"Hierarchical prefixes (",[622,1597,742],{},[622,1599,1600],{},"billing.subscription",[622,1602,1603],{},"auth.session",") keep keys short while preserving namespace clarity. One catalog per sub-domain.",[944,1606,1609],{"className":1607,"code":1608,"language":1363},[1361],"src\u002Ffeatures\u002F\n├── billing\u002F\n│   └── errors\u002F\n│       ├── payment.ts        → billingPaymentErrors (prefix: 'billing.payment')\n│       ├── subscription.ts   → billingSubscriptionErrors\n│       └── invoice.ts        → billingInvoiceErrors\n├── auth\u002F\n│   └── errors\u002F\n│       ├── session.ts        → authSessionErrors (prefix: 'auth.session')\n│       ├── oauth.ts          → authOAuthErrors\n│       └── mfa.ts            → authMfaErrors\n",[622,1610,1608],{"__ignoreMap":950},[944,1612,1615],{"className":946,"code":1613,"filename":1614,"language":949,"meta":950,"style":950},"import { defineErrorCatalog } from 'evlog'\n\nexport const billingPaymentErrors = defineErrorCatalog('billing.payment', {\n  DECLINED: { status: 402, message: 'Card declined' },\n  INSUFFICIENT_FUNDS: { status: 402, message: 'Insufficient funds' },\n  EXPIRED_CARD: { status: 402, message: 'Card expired' },\n  CVV_MISMATCH: { status: 402, message: 'CVV mismatch' },\n})\n","src\u002Ffeatures\u002Fbilling\u002Ferrors\u002Fpayment.ts",[622,1616,1617,1635,1639,1664,1695,1725,1755,1785],{"__ignoreMap":950},[954,1618,1619,1621,1623,1625,1627,1629,1631,1633],{"class":956,"line":957},[954,1620,961],{"class":960},[954,1622,965],{"class":964},[954,1624,969],{"class":968},[954,1626,972],{"class":964},[954,1628,975],{"class":960},[954,1630,978],{"class":964},[954,1632,982],{"class":981},[954,1634,985],{"class":964},[954,1636,1637],{"class":956,"line":988},[954,1638,992],{"emptyLinePlaceholder":991},[954,1640,1641,1643,1645,1648,1650,1652,1654,1656,1658,1660,1662],{"class":956,"line":995},[954,1642,998],{"class":960},[954,1644,1002],{"class":1001},[954,1646,1647],{"class":968}," billingPaymentErrors ",[954,1649,1008],{"class":964},[954,1651,969],{"class":1011},[954,1653,1014],{"class":968},[954,1655,1017],{"class":964},[954,1657,742],{"class":981},[954,1659,1017],{"class":964},[954,1661,1025],{"class":964},[954,1663,1028],{"class":964},[954,1665,1666,1669,1671,1673,1675,1677,1680,1682,1684,1686,1688,1691,1693],{"class":956,"line":1031},[954,1667,1668],{"class":1034},"  DECLINED",[954,1670,1038],{"class":964},[954,1672,965],{"class":964},[954,1674,1043],{"class":1034},[954,1676,1038],{"class":964},[954,1678,1679],{"class":1048}," 402",[954,1681,1025],{"class":964},[954,1683,1054],{"class":1034},[954,1685,1038],{"class":964},[954,1687,978],{"class":964},[954,1689,1690],{"class":981},"Card declined",[954,1692,1017],{"class":964},[954,1694,1066],{"class":964},[954,1696,1697,1700,1702,1704,1706,1708,1710,1712,1714,1716,1718,1721,1723],{"class":956,"line":1069},[954,1698,1699],{"class":1034},"  INSUFFICIENT_FUNDS",[954,1701,1038],{"class":964},[954,1703,965],{"class":964},[954,1705,1043],{"class":1034},[954,1707,1038],{"class":964},[954,1709,1679],{"class":1048},[954,1711,1025],{"class":964},[954,1713,1054],{"class":1034},[954,1715,1038],{"class":964},[954,1717,978],{"class":964},[954,1719,1720],{"class":981},"Insufficient funds",[954,1722,1017],{"class":964},[954,1724,1066],{"class":964},[954,1726,1727,1730,1732,1734,1736,1738,1740,1742,1744,1746,1748,1751,1753],{"class":956,"line":1101},[954,1728,1729],{"class":1034},"  EXPIRED_CARD",[954,1731,1038],{"class":964},[954,1733,965],{"class":964},[954,1735,1043],{"class":1034},[954,1737,1038],{"class":964},[954,1739,1679],{"class":1048},[954,1741,1025],{"class":964},[954,1743,1054],{"class":1034},[954,1745,1038],{"class":964},[954,1747,978],{"class":964},[954,1749,1750],{"class":981},"Card expired",[954,1752,1017],{"class":964},[954,1754,1066],{"class":964},[954,1756,1757,1760,1762,1764,1766,1768,1770,1772,1774,1776,1778,1781,1783],{"class":956,"line":1111},[954,1758,1759],{"class":1034},"  CVV_MISMATCH",[954,1761,1038],{"class":964},[954,1763,965],{"class":964},[954,1765,1043],{"class":1034},[954,1767,1038],{"class":964},[954,1769,1679],{"class":1048},[954,1771,1025],{"class":964},[954,1773,1054],{"class":1034},[954,1775,1038],{"class":964},[954,1777,978],{"class":964},[954,1779,1780],{"class":981},"CVV mismatch",[954,1782,1017],{"class":964},[954,1784,1066],{"class":964},[954,1786,1787,1789],{"class":956,"line":1125},[954,1788,1185],{"class":964},[954,1790,1188],{"class":968},[618,1792,1793,1794,625,1797,1800],{},"Wire codes become ",[622,1795,1796],{},"billing.payment.DECLINED",[622,1798,1799],{},"billing.payment.INSUFFICIENT_FUNDS",", etc. The convention scales to hundreds of entries without collisions.",[925,1802,1804],{"id":1803},"npm-packages-monorepo","npm packages: monorepo",[618,1806,1807,1808,1810,1811,1814],{},"In a monorepo, each bounded context can ship as its own npm package. Type augmentation propagates through the published ",[622,1809,757],{},", so consumers get autocomplete just by ",[622,1812,1813],{},"pnpm add @acme\u002Ferrors-billing",".",[944,1816,1819],{"className":1817,"code":1818,"language":1363},[1361],"acme-monorepo\u002F\n├── packages\u002F\n│   ├── errors-billing\u002F         → @acme\u002Ferrors-billing\n│   │   └── src\u002Findex.ts\n│   ├── errors-auth\u002F            → @acme\u002Ferrors-auth\n│   │   └── src\u002Findex.ts\n│   └── audit-billing\u002F          → @acme\u002Faudit-billing\n│       └── src\u002Findex.ts\n└── apps\u002F\n    ├── api\u002F                    → imports + re-exports the catalogs\n    └── worker\u002F\n",[622,1820,1818],{"__ignoreMap":950},[801,1822,1824],{"id":1823},"publishing-a-catalog-as-an-npm-package","Publishing a catalog as an npm package",[618,1826,1827,1828,1830],{},"A catalog is just regular TypeScript that depends on ",[622,1829,982],{}," as a peer dep. Here is the minimal recipe.",[925,1832,1834],{"id":1833},"packagejson",[622,1835,1836],{},"package.json",[944,1838,1843],{"className":1839,"code":1840,"filename":1841,"language":1842,"meta":950,"style":950},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"name\": \"@acme\u002Ferrors-billing\",\n  \"version\": \"1.0.0\",\n  \"type\": \"module\",\n  \"main\": \".\u002Fdist\u002Findex.mjs\",\n  \"types\": \".\u002Fdist\u002Findex.d.ts\",\n  \"exports\": {\n    \".\": {\n      \"import\": \".\u002Fdist\u002Findex.mjs\",\n      \"types\": \".\u002Fdist\u002Findex.d.ts\"\n    }\n  },\n  \"peerDependencies\": {\n    \"evlog\": \"^3.0.0\"\n  },\n  \"files\": [\"dist\"]\n}\n","packages\u002Ferrors-billing\u002Fpackage.json","json",[622,1844,1845,1850,1873,1893,1913,1933,1953,1966,1979,1998,2015,2020,2024,2037,2054,2058,2083],{"__ignoreMap":950},[954,1846,1847],{"class":956,"line":957},[954,1848,1849],{"class":964},"{\n",[954,1851,1852,1855,1858,1861,1863,1866,1869,1871],{"class":956,"line":988},[954,1853,1854],{"class":964},"  \"",[954,1856,1857],{"class":1001},"name",[954,1859,1860],{"class":964},"\"",[954,1862,1038],{"class":964},[954,1864,1865],{"class":964}," \"",[954,1867,1868],{"class":981},"@acme\u002Ferrors-billing",[954,1870,1860],{"class":964},[954,1872,1122],{"class":964},[954,1874,1875,1877,1880,1882,1884,1886,1889,1891],{"class":956,"line":995},[954,1876,1854],{"class":964},[954,1878,1879],{"class":1001},"version",[954,1881,1860],{"class":964},[954,1883,1038],{"class":964},[954,1885,1865],{"class":964},[954,1887,1888],{"class":981},"1.0.0",[954,1890,1860],{"class":964},[954,1892,1122],{"class":964},[954,1894,1895,1897,1900,1902,1904,1906,1909,1911],{"class":956,"line":1031},[954,1896,1854],{"class":964},[954,1898,1899],{"class":1001},"type",[954,1901,1860],{"class":964},[954,1903,1038],{"class":964},[954,1905,1865],{"class":964},[954,1907,1908],{"class":981},"module",[954,1910,1860],{"class":964},[954,1912,1122],{"class":964},[954,1914,1915,1917,1920,1922,1924,1926,1929,1931],{"class":956,"line":1069},[954,1916,1854],{"class":964},[954,1918,1919],{"class":1001},"main",[954,1921,1860],{"class":964},[954,1923,1038],{"class":964},[954,1925,1865],{"class":964},[954,1927,1928],{"class":981},".\u002Fdist\u002Findex.mjs",[954,1930,1860],{"class":964},[954,1932,1122],{"class":964},[954,1934,1935,1937,1940,1942,1944,1946,1949,1951],{"class":956,"line":1101},[954,1936,1854],{"class":964},[954,1938,1939],{"class":1001},"types",[954,1941,1860],{"class":964},[954,1943,1038],{"class":964},[954,1945,1865],{"class":964},[954,1947,1948],{"class":981},".\u002Fdist\u002Findex.d.ts",[954,1950,1860],{"class":964},[954,1952,1122],{"class":964},[954,1954,1955,1957,1960,1962,1964],{"class":956,"line":1111},[954,1956,1854],{"class":964},[954,1958,1959],{"class":1001},"exports",[954,1961,1860],{"class":964},[954,1963,1038],{"class":964},[954,1965,1028],{"class":964},[954,1967,1968,1971,1973,1975,1977],{"class":956,"line":1125},[954,1969,1970],{"class":964},"    \"",[954,1972,1814],{"class":1149},[954,1974,1860],{"class":964},[954,1976,1038],{"class":964},[954,1978,1028],{"class":964},[954,1980,1981,1984,1986,1988,1990,1992,1994,1996],{"class":956,"line":1176},[954,1982,1983],{"class":964},"      \"",[954,1985,961],{"class":1048},[954,1987,1860],{"class":964},[954,1989,1038],{"class":964},[954,1991,1865],{"class":964},[954,1993,1928],{"class":981},[954,1995,1860],{"class":964},[954,1997,1122],{"class":964},[954,1999,2000,2002,2004,2006,2008,2010,2012],{"class":956,"line":1182},[954,2001,1983],{"class":964},[954,2003,1939],{"class":1048},[954,2005,1860],{"class":964},[954,2007,1038],{"class":964},[954,2009,1865],{"class":964},[954,2011,1948],{"class":981},[954,2013,2014],{"class":964},"\"\n",[954,2016,2017],{"class":956,"line":1529},[954,2018,2019],{"class":964},"    }\n",[954,2021,2022],{"class":956,"line":1543},[954,2023,1179],{"class":964},[954,2025,2026,2028,2031,2033,2035],{"class":956,"line":1556},[954,2027,1854],{"class":964},[954,2029,2030],{"class":1001},"peerDependencies",[954,2032,1860],{"class":964},[954,2034,1038],{"class":964},[954,2036,1028],{"class":964},[954,2038,2039,2041,2043,2045,2047,2049,2052],{"class":956,"line":1569},[954,2040,1970],{"class":964},[954,2042,982],{"class":1149},[954,2044,1860],{"class":964},[954,2046,1038],{"class":964},[954,2048,1865],{"class":964},[954,2050,2051],{"class":981},"^3.0.0",[954,2053,2014],{"class":964},[954,2055,2056],{"class":956,"line":1575},[954,2057,1179],{"class":964},[954,2059,2061,2063,2066,2068,2070,2073,2075,2078,2080],{"class":956,"line":2060},16,[954,2062,1854],{"class":964},[954,2064,2065],{"class":1001},"files",[954,2067,1860],{"class":964},[954,2069,1038],{"class":964},[954,2071,2072],{"class":964}," [",[954,2074,1860],{"class":964},[954,2076,2077],{"class":981},"dist",[954,2079,1860],{"class":964},[954,2081,2082],{"class":964},"]\n",[954,2084,2086],{"class":956,"line":2085},17,[954,2087,1578],{"class":964},[925,2089,2091],{"id":2090},"source-catalog-augmentation-in-the-same-file","Source: catalog + augmentation in the same file",[944,2093,2096],{"className":946,"code":2094,"filename":2095,"language":949,"meta":950,"style":950},"import { defineErrorCatalog } from 'evlog'\n\nexport const billingErrors = defineErrorCatalog('billing', {\n  PAYMENT_DECLINED: {\n    status: 402,\n    message: 'Card declined',\n    why: 'Issuer declined the charge',\n    fix: 'Try a different payment method',\n    link: 'https:\u002F\u002Fdocs.example.com\u002Ferrors\u002Fbilling.payment_declined',\n  },\n  INSUFFICIENT_FUNDS: {\n    status: 402,\n    message: ({ available, required }: { available: number, required: number }) =>\n      `Insufficient funds: $${available}\u002F$${required}`,\n  },\n  \u002F\u002F ...\n})\n\ndeclare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    billing: typeof billingErrors\n  }\n}\n","packages\u002Ferrors-billing\u002Fsrc\u002Findex.ts",[622,2097,2098,2116,2120,2146,2155,2165,2179,2195,2211,2227,2231,2239,2249,2289,2316,2320,2326,2332,2337,2352,2361,2372,2377],{"__ignoreMap":950},[954,2099,2100,2102,2104,2106,2108,2110,2112,2114],{"class":956,"line":957},[954,2101,961],{"class":960},[954,2103,965],{"class":964},[954,2105,969],{"class":968},[954,2107,972],{"class":964},[954,2109,975],{"class":960},[954,2111,978],{"class":964},[954,2113,982],{"class":981},[954,2115,985],{"class":964},[954,2117,2118],{"class":956,"line":988},[954,2119,992],{"emptyLinePlaceholder":991},[954,2121,2122,2124,2126,2129,2131,2133,2135,2137,2140,2142,2144],{"class":956,"line":995},[954,2123,998],{"class":960},[954,2125,1002],{"class":1001},[954,2127,2128],{"class":968}," billingErrors ",[954,2130,1008],{"class":964},[954,2132,969],{"class":1011},[954,2134,1014],{"class":968},[954,2136,1017],{"class":964},[954,2138,2139],{"class":981},"billing",[954,2141,1017],{"class":964},[954,2143,1025],{"class":964},[954,2145,1028],{"class":964},[954,2147,2148,2151,2153],{"class":956,"line":1031},[954,2149,2150],{"class":1034},"  PAYMENT_DECLINED",[954,2152,1038],{"class":964},[954,2154,1028],{"class":964},[954,2156,2157,2159,2161,2163],{"class":956,"line":1069},[954,2158,1114],{"class":1034},[954,2160,1038],{"class":964},[954,2162,1679],{"class":1048},[954,2164,1122],{"class":964},[954,2166,2167,2169,2171,2173,2175,2177],{"class":956,"line":1101},[954,2168,1128],{"class":1034},[954,2170,1038],{"class":964},[954,2172,978],{"class":964},[954,2174,1690],{"class":981},[954,2176,1017],{"class":964},[954,2178,1122],{"class":964},[954,2180,2181,2184,2186,2188,2191,2193],{"class":956,"line":1111},[954,2182,2183],{"class":1034},"    why",[954,2185,1038],{"class":964},[954,2187,978],{"class":964},[954,2189,2190],{"class":981},"Issuer declined the charge",[954,2192,1017],{"class":964},[954,2194,1122],{"class":964},[954,2196,2197,2200,2202,2204,2207,2209],{"class":956,"line":1125},[954,2198,2199],{"class":1034},"    fix",[954,2201,1038],{"class":964},[954,2203,978],{"class":964},[954,2205,2206],{"class":981},"Try a different payment method",[954,2208,1017],{"class":964},[954,2210,1122],{"class":964},[954,2212,2213,2216,2218,2220,2223,2225],{"class":956,"line":1176},[954,2214,2215],{"class":1034},"    link",[954,2217,1038],{"class":964},[954,2219,978],{"class":964},[954,2221,2222],{"class":981},"https:\u002F\u002Fdocs.example.com\u002Ferrors\u002Fbilling.payment_declined",[954,2224,1017],{"class":964},[954,2226,1122],{"class":964},[954,2228,2229],{"class":956,"line":1182},[954,2230,1179],{"class":964},[954,2232,2233,2235,2237],{"class":956,"line":1529},[954,2234,1699],{"class":1034},[954,2236,1038],{"class":964},[954,2238,1028],{"class":964},[954,2240,2241,2243,2245,2247],{"class":956,"line":1543},[954,2242,1114],{"class":1034},[954,2244,1038],{"class":964},[954,2246,1679],{"class":1048},[954,2248,1122],{"class":964},[954,2250,2251,2253,2255,2257,2260,2262,2265,2267,2269,2271,2273,2276,2278,2280,2282,2284,2286],{"class":956,"line":1556},[954,2252,1128],{"class":1011},[954,2254,1038],{"class":964},[954,2256,1133],{"class":964},[954,2258,2259],{"class":1136}," available",[954,2261,1025],{"class":964},[954,2263,2264],{"class":1136}," required",[954,2266,1140],{"class":964},[954,2268,965],{"class":964},[954,2270,2259],{"class":1034},[954,2272,1038],{"class":964},[954,2274,2275],{"class":1149}," number",[954,2277,1025],{"class":964},[954,2279,2264],{"class":1034},[954,2281,1038],{"class":964},[954,2283,2275],{"class":1149},[954,2285,1153],{"class":964},[954,2287,2288],{"class":1001}," =>\n",[954,2290,2291,2294,2297,2299,2302,2304,2307,2309,2312,2314],{"class":956,"line":1569},[954,2292,2293],{"class":964},"      `",[954,2295,2296],{"class":981},"Insufficient funds: $",[954,2298,1165],{"class":964},[954,2300,2301],{"class":968},"available",[954,2303,1185],{"class":964},[954,2305,2306],{"class":981},"\u002F$",[954,2308,1165],{"class":964},[954,2310,2311],{"class":968},"required",[954,2313,1171],{"class":964},[954,2315,1122],{"class":964},[954,2317,2318],{"class":956,"line":1575},[954,2319,1179],{"class":964},[954,2321,2322],{"class":956,"line":2060},[954,2323,2325],{"class":2324},"sHwdD","  \u002F\u002F ...\n",[954,2327,2328,2330],{"class":956,"line":2085},[954,2329,1185],{"class":964},[954,2331,1188],{"class":968},[954,2333,2335],{"class":956,"line":2334},18,[954,2336,992],{"emptyLinePlaceholder":991},[954,2338,2340,2342,2344,2346,2348,2350],{"class":956,"line":2339},19,[954,2341,1505],{"class":1001},[954,2343,1508],{"class":1001},[954,2345,978],{"class":964},[954,2347,982],{"class":981},[954,2349,1017],{"class":964},[954,2351,1028],{"class":964},[954,2353,2355,2357,2359],{"class":956,"line":2354},20,[954,2356,1521],{"class":1001},[954,2358,1524],{"class":1149},[954,2360,1028],{"class":964},[954,2362,2364,2366,2368,2370],{"class":956,"line":2363},21,[954,2365,1546],{"class":1034},[954,2367,1038],{"class":964},[954,2369,1537],{"class":964},[954,2371,1553],{"class":968},[954,2373,2375],{"class":956,"line":2374},22,[954,2376,1572],{"class":964},[954,2378,2380],{"class":956,"line":2379},23,[954,2381,1578],{"class":964},[618,2383,2384,2385,2387,2388,2391,2392,2394],{},"The ",[622,2386,776],{}," block lives inside the source file so the bundler emits it into the ",[622,2389,2390],{},"dist\u002Findex.d.ts",". Any consumer that imports from ",[622,2393,1868],{}," gets the augmentation transitively, with no extra setup required on their side.",[925,2396,2398],{"id":2397},"consumption","Consumption",[944,2400,2403],{"className":946,"code":2401,"filename":2402,"language":949,"meta":950,"style":950},"\u002F\u002F Importing the package activates both the runtime catalog and the type augmentation.\nimport { billingErrors } from '@acme\u002Ferrors-billing'\nimport { authErrors } from '@acme\u002Ferrors-auth'\n\n\u002F\u002F Re-export from a central place so the rest of the app has one import path.\nexport { billingErrors, authErrors }\n","apps\u002Fapi\u002Fsrc\u002Finit.ts",[622,2404,2405,2410,2428,2447,2451,2456],{"__ignoreMap":950},[954,2406,2407],{"class":956,"line":957},[954,2408,2409],{"class":2324},"\u002F\u002F Importing the package activates both the runtime catalog and the type augmentation.\n",[954,2411,2412,2414,2416,2418,2420,2422,2424,2426],{"class":956,"line":988},[954,2413,961],{"class":960},[954,2415,965],{"class":964},[954,2417,1405],{"class":968},[954,2419,972],{"class":964},[954,2421,975],{"class":960},[954,2423,978],{"class":964},[954,2425,1868],{"class":981},[954,2427,985],{"class":964},[954,2429,2430,2432,2434,2436,2438,2440,2442,2445],{"class":956,"line":995},[954,2431,961],{"class":960},[954,2433,965],{"class":964},[954,2435,1383],{"class":968},[954,2437,972],{"class":964},[954,2439,975],{"class":960},[954,2441,978],{"class":964},[954,2443,2444],{"class":981},"@acme\u002Ferrors-auth",[954,2446,985],{"class":964},[954,2448,2449],{"class":956,"line":1031},[954,2450,992],{"emptyLinePlaceholder":991},[954,2452,2453],{"class":956,"line":1069},[954,2454,2455],{"class":2324},"\u002F\u002F Re-export from a central place so the rest of the app has one import path.\n",[954,2457,2458,2460,2462,2464,2466,2468],{"class":956,"line":1101},[954,2459,998],{"class":960},[954,2461,965],{"class":964},[954,2463,1405],{"class":968},[954,2465,1025],{"class":964},[954,2467,1383],{"class":968},[954,2469,2470],{"class":964}," }\n",[944,2472,2475],{"className":946,"code":2473,"filename":2474,"language":949,"meta":950,"style":950},"import { billingErrors } from '~\u002Finit'\n\nthrow billingErrors.PAYMENT_DECLINED({ cause: stripeErr })\n","apps\u002Fapi\u002Fsrc\u002Froutes\u002Fcheckout.post.ts",[622,2476,2477,2496,2500],{"__ignoreMap":950},[954,2478,2479,2481,2483,2485,2487,2489,2491,2494],{"class":956,"line":957},[954,2480,961],{"class":960},[954,2482,965],{"class":964},[954,2484,1405],{"class":968},[954,2486,972],{"class":964},[954,2488,975],{"class":960},[954,2490,978],{"class":964},[954,2492,2493],{"class":981},"~\u002Finit",[954,2495,985],{"class":964},[954,2497,2498],{"class":956,"line":988},[954,2499,992],{"emptyLinePlaceholder":991},[954,2501,2502,2505,2507,2509,2511,2513,2516,2519,2521,2524,2526],{"class":956,"line":995},[954,2503,2504],{"class":960},"throw",[954,2506,1405],{"class":968},[954,2508,1814],{"class":964},[954,2510,848],{"class":1011},[954,2512,1014],{"class":968},[954,2514,2515],{"class":964},"{",[954,2517,2518],{"class":1034}," cause",[954,2520,1038],{"class":964},[954,2522,2523],{"class":968}," stripeErr ",[954,2525,1185],{"class":964},[954,2527,1188],{"class":968},[944,2529,2532],{"className":946,"code":2530,"filename":2531,"language":949,"meta":950,"style":950},"import { createError, parseError } from 'evlog'\n\nthrow createError({\n  code: 'billing.PAYMENT_DECLINED', \u002F\u002F ← autocomplete from the registered catalog\n  message: 'Card declined',\n  status: 402,\n})\n\nconst err = parseError(caught)\nif (err.code === 'billing.PAYMENT_DECLINED') retry()\n\u002F\u002F                ↑ TypeScript knows the union of all registered codes\n","Anywhere in the app — autocomplete works",[622,2533,2534,2558,2562,2572,2590,2605,2616,2622,2626,2641,2672],{"__ignoreMap":950},[954,2535,2536,2538,2540,2543,2545,2548,2550,2552,2554,2556],{"class":956,"line":957},[954,2537,961],{"class":960},[954,2539,965],{"class":964},[954,2541,2542],{"class":968}," createError",[954,2544,1025],{"class":964},[954,2546,2547],{"class":968}," parseError",[954,2549,972],{"class":964},[954,2551,975],{"class":960},[954,2553,978],{"class":964},[954,2555,982],{"class":981},[954,2557,985],{"class":964},[954,2559,2560],{"class":956,"line":988},[954,2561,992],{"emptyLinePlaceholder":991},[954,2563,2564,2566,2568,2570],{"class":956,"line":995},[954,2565,2504],{"class":960},[954,2567,2542],{"class":1011},[954,2569,1014],{"class":968},[954,2571,1849],{"class":964},[954,2573,2574,2577,2579,2581,2583,2585,2587],{"class":956,"line":1031},[954,2575,2576],{"class":1034},"  code",[954,2578,1038],{"class":964},[954,2580,978],{"class":964},[954,2582,681],{"class":981},[954,2584,1017],{"class":964},[954,2586,1025],{"class":964},[954,2588,2589],{"class":2324}," \u002F\u002F ← autocomplete from the registered catalog\n",[954,2591,2592,2595,2597,2599,2601,2603],{"class":956,"line":1069},[954,2593,2594],{"class":1034},"  message",[954,2596,1038],{"class":964},[954,2598,978],{"class":964},[954,2600,1690],{"class":981},[954,2602,1017],{"class":964},[954,2604,1122],{"class":964},[954,2606,2607,2610,2612,2614],{"class":956,"line":1101},[954,2608,2609],{"class":1034},"  status",[954,2611,1038],{"class":964},[954,2613,1679],{"class":1048},[954,2615,1122],{"class":964},[954,2617,2618,2620],{"class":956,"line":1111},[954,2619,1185],{"class":964},[954,2621,1188],{"class":968},[954,2623,2624],{"class":956,"line":1125},[954,2625,992],{"emptyLinePlaceholder":991},[954,2627,2628,2631,2634,2636,2638],{"class":956,"line":1176},[954,2629,2630],{"class":1001},"const",[954,2632,2633],{"class":968}," err ",[954,2635,1008],{"class":964},[954,2637,2547],{"class":1011},[954,2639,2640],{"class":968},"(caught)\n",[954,2642,2643,2646,2649,2651,2654,2657,2659,2661,2663,2666,2669],{"class":956,"line":1182},[954,2644,2645],{"class":960},"if",[954,2647,2648],{"class":968}," (err",[954,2650,1814],{"class":964},[954,2652,2653],{"class":968},"code ",[954,2655,2656],{"class":964},"===",[954,2658,978],{"class":964},[954,2660,681],{"class":981},[954,2662,1017],{"class":964},[954,2664,2665],{"class":968},") ",[954,2667,2668],{"class":1011},"retry",[954,2670,2671],{"class":968},"()\n",[954,2673,2674],{"class":956,"line":1529},[954,2675,2676],{"class":2324},"\u002F\u002F                ↑ TypeScript knows the union of all registered codes\n",[2678,2679,2682,2685,2686,2688,2689,625,2692,2688,2694,2697],"callout",{"color":2680,"icon":2681},"neutral","i-lucide-package",[835,2683,2684],{},"Each shared package owns its prefix."," ",[622,2687,1868],{}," owns ",[622,2690,2691],{},"billing.*",[622,2693,2444],{},[622,2695,2696],{},"auth.*",". Conflicts are impossible by construction. Bumping a catalog to a new minor (adding entries) propagates to consumers via the regular semver upgrade path: no codegen, no migration step.",[801,2699,2701],{"id":2700},"composition-patterns","Composition patterns",[925,2703,2705],{"id":2704},"mix-catalogs-and-standalone-factories","Mix catalogs and standalone factories",[618,2707,2708,667,2710,2712,2713,2715],{},[622,2709,624],{},[622,2711,628],{}," produce identical call-site shapes. Use catalogs for grouped errors, ",[622,2714,624],{}," for one-offs (e.g. cross-cutting concerns like rate-limiting that don't belong to a specific domain).",[944,2717,2719],{"className":946,"code":2718,"filename":1369,"language":949,"meta":950,"style":950},"import { defineError, defineErrorCatalog } from 'evlog'\n\nexport const billingErrors = defineErrorCatalog('billing', {\n  PAYMENT_DECLINED: { status: 402, message: 'Card declined' },\n})\n\nexport const rateLimited = defineError('app.RATE_LIMITED', {\n  status: 429,\n  message: ({ retryAfter }: { retryAfter: number }) =>\n    `Rate limited: retry in ${retryAfter}s`,\n})\n\n\u002F\u002F Both look identical at the call site:\nthrow billingErrors.PAYMENT_DECLINED()\nthrow rateLimited({ retryAfter: 30 })\n",[622,2720,2721,2744,2748,2772,2800,2806,2810,2836,2847,2872,2895,2901,2905,2910,2922],{"__ignoreMap":950},[954,2722,2723,2725,2727,2730,2732,2734,2736,2738,2740,2742],{"class":956,"line":957},[954,2724,961],{"class":960},[954,2726,965],{"class":964},[954,2728,2729],{"class":968}," defineError",[954,2731,1025],{"class":964},[954,2733,969],{"class":968},[954,2735,972],{"class":964},[954,2737,975],{"class":960},[954,2739,978],{"class":964},[954,2741,982],{"class":981},[954,2743,985],{"class":964},[954,2745,2746],{"class":956,"line":988},[954,2747,992],{"emptyLinePlaceholder":991},[954,2749,2750,2752,2754,2756,2758,2760,2762,2764,2766,2768,2770],{"class":956,"line":995},[954,2751,998],{"class":960},[954,2753,1002],{"class":1001},[954,2755,2128],{"class":968},[954,2757,1008],{"class":964},[954,2759,969],{"class":1011},[954,2761,1014],{"class":968},[954,2763,1017],{"class":964},[954,2765,2139],{"class":981},[954,2767,1017],{"class":964},[954,2769,1025],{"class":964},[954,2771,1028],{"class":964},[954,2773,2774,2776,2778,2780,2782,2784,2786,2788,2790,2792,2794,2796,2798],{"class":956,"line":1031},[954,2775,2150],{"class":1034},[954,2777,1038],{"class":964},[954,2779,965],{"class":964},[954,2781,1043],{"class":1034},[954,2783,1038],{"class":964},[954,2785,1679],{"class":1048},[954,2787,1025],{"class":964},[954,2789,1054],{"class":1034},[954,2791,1038],{"class":964},[954,2793,978],{"class":964},[954,2795,1690],{"class":981},[954,2797,1017],{"class":964},[954,2799,1066],{"class":964},[954,2801,2802,2804],{"class":956,"line":1069},[954,2803,1185],{"class":964},[954,2805,1188],{"class":968},[954,2807,2808],{"class":956,"line":1101},[954,2809,992],{"emptyLinePlaceholder":991},[954,2811,2812,2814,2816,2819,2821,2823,2825,2827,2830,2832,2834],{"class":956,"line":1111},[954,2813,998],{"class":960},[954,2815,1002],{"class":1001},[954,2817,2818],{"class":968}," rateLimited ",[954,2820,1008],{"class":964},[954,2822,2729],{"class":1011},[954,2824,1014],{"class":968},[954,2826,1017],{"class":964},[954,2828,2829],{"class":981},"app.RATE_LIMITED",[954,2831,1017],{"class":964},[954,2833,1025],{"class":964},[954,2835,1028],{"class":964},[954,2837,2838,2840,2842,2845],{"class":956,"line":1125},[954,2839,2609],{"class":1034},[954,2841,1038],{"class":964},[954,2843,2844],{"class":1048}," 429",[954,2846,1122],{"class":964},[954,2848,2849,2851,2853,2855,2858,2860,2862,2864,2866,2868,2870],{"class":956,"line":1176},[954,2850,2594],{"class":1011},[954,2852,1038],{"class":964},[954,2854,1133],{"class":964},[954,2856,2857],{"class":1136}," retryAfter",[954,2859,1140],{"class":964},[954,2861,965],{"class":964},[954,2863,2857],{"class":1034},[954,2865,1038],{"class":964},[954,2867,2275],{"class":1149},[954,2869,1153],{"class":964},[954,2871,2288],{"class":1001},[954,2873,2874,2877,2880,2882,2885,2887,2890,2893],{"class":956,"line":1182},[954,2875,2876],{"class":964},"    `",[954,2878,2879],{"class":981},"Rate limited: retry in ",[954,2881,1165],{"class":964},[954,2883,2884],{"class":968},"retryAfter",[954,2886,1185],{"class":964},[954,2888,2889],{"class":981},"s",[954,2891,2892],{"class":964},"`",[954,2894,1122],{"class":964},[954,2896,2897,2899],{"class":956,"line":1529},[954,2898,1185],{"class":964},[954,2900,1188],{"class":968},[954,2902,2903],{"class":956,"line":1543},[954,2904,992],{"emptyLinePlaceholder":991},[954,2906,2907],{"class":956,"line":1556},[954,2908,2909],{"class":2324},"\u002F\u002F Both look identical at the call site:\n",[954,2911,2912,2914,2916,2918,2920],{"class":956,"line":1569},[954,2913,2504],{"class":960},[954,2915,1405],{"class":968},[954,2917,1814],{"class":964},[954,2919,848],{"class":1011},[954,2921,2671],{"class":968},[954,2923,2924,2926,2929,2931,2933,2935,2937,2940,2942],{"class":956,"line":1575},[954,2925,2504],{"class":960},[954,2927,2928],{"class":1011}," rateLimited",[954,2930,1014],{"class":968},[954,2932,2515],{"class":964},[954,2934,2857],{"class":1034},[954,2936,1038],{"class":964},[954,2938,2939],{"class":1048}," 30",[954,2941,972],{"class":964},[954,2943,1188],{"class":968},[925,2945,2947],{"id":2946},"re-export-from-one-entry-per-domain","Re-export from one entry per domain",[618,2949,2950],{},"If a feature ships errors and audits together, give it a single re-export module so call sites only import once.",[944,2952,2955],{"className":946,"code":2953,"filename":2954,"language":949,"meta":950,"style":950},"export { billingErrors } from '.\u002Ferrors\u002Fbilling'\nexport { billingAudit } from '.\u002Faudit\u002Fbilling'\n","src\u002Ffeatures\u002Fbilling\u002Findex.ts",[622,2956,2957,2976],{"__ignoreMap":950},[954,2958,2959,2961,2963,2965,2967,2969,2971,2974],{"class":956,"line":957},[954,2960,998],{"class":960},[954,2962,965],{"class":964},[954,2964,1405],{"class":968},[954,2966,972],{"class":964},[954,2968,975],{"class":960},[954,2970,978],{"class":964},[954,2972,2973],{"class":981},".\u002Ferrors\u002Fbilling",[954,2975,985],{"class":964},[954,2977,2978,2980,2982,2985,2987,2989,2991,2994],{"class":956,"line":988},[954,2979,998],{"class":960},[954,2981,965],{"class":964},[954,2983,2984],{"class":968}," billingAudit",[954,2986,972],{"class":964},[954,2988,975],{"class":960},[954,2990,978],{"class":964},[954,2992,2993],{"class":981},".\u002Faudit\u002Fbilling",[954,2995,985],{"class":964},[944,2997,3000],{"className":946,"code":2998,"filename":2999,"language":949,"meta":950,"style":950},"import { billingErrors, billingAudit } from '~\u002Ffeatures\u002Fbilling'\n\nif (!cart.items.length) throw billingErrors.CART_EMPTY()\n\nlog.audit(billingAudit.INVOICE_REFUND({ actor, target: { id: 'inv_889' } }))\n","services\u002Frefund.ts",[622,3001,3002,3025,3029,3063,3067],{"__ignoreMap":950},[954,3003,3004,3006,3008,3010,3012,3014,3016,3018,3020,3023],{"class":956,"line":957},[954,3005,961],{"class":960},[954,3007,965],{"class":964},[954,3009,1405],{"class":968},[954,3011,1025],{"class":964},[954,3013,2984],{"class":968},[954,3015,972],{"class":964},[954,3017,975],{"class":960},[954,3019,978],{"class":964},[954,3021,3022],{"class":981},"~\u002Ffeatures\u002Fbilling",[954,3024,985],{"class":964},[954,3026,3027],{"class":956,"line":988},[954,3028,992],{"emptyLinePlaceholder":991},[954,3030,3031,3033,3036,3039,3042,3044,3047,3049,3052,3054,3056,3058,3061],{"class":956,"line":995},[954,3032,2645],{"class":960},[954,3034,3035],{"class":968}," (",[954,3037,3038],{"class":964},"!",[954,3040,3041],{"class":968},"cart",[954,3043,1814],{"class":964},[954,3045,3046],{"class":968},"items",[954,3048,1814],{"class":964},[954,3050,3051],{"class":968},"length) ",[954,3053,2504],{"class":960},[954,3055,1405],{"class":968},[954,3057,1814],{"class":964},[954,3059,3060],{"class":1011},"CART_EMPTY",[954,3062,2671],{"class":968},[954,3064,3065],{"class":956,"line":1031},[954,3066,992],{"emptyLinePlaceholder":991},[954,3068,3069,3072,3074,3077,3080,3082,3084,3086,3088,3091,3093,3095,3097,3099,3102,3104,3106,3109,3111,3113,3115],{"class":956,"line":1069},[954,3070,3071],{"class":968},"log",[954,3073,1814],{"class":964},[954,3075,3076],{"class":1011},"audit",[954,3078,3079],{"class":968},"(billingAudit",[954,3081,1814],{"class":964},[954,3083,851],{"class":1011},[954,3085,1014],{"class":968},[954,3087,2515],{"class":964},[954,3089,3090],{"class":968}," actor",[954,3092,1025],{"class":964},[954,3094,1254],{"class":1034},[954,3096,1038],{"class":964},[954,3098,965],{"class":964},[954,3100,3101],{"class":1034}," id",[954,3103,1038],{"class":964},[954,3105,978],{"class":964},[954,3107,3108],{"class":981},"inv_889",[954,3110,1017],{"class":964},[954,3112,972],{"class":964},[954,3114,972],{"class":964},[954,3116,3117],{"class":968},"))\n",[925,3119,3121],{"id":3120},"override-catalog-defaults-at-the-call-site","Override catalog defaults at the call site",[618,3123,3124,3125,625,3128,625,3131,625,3134,625,3137,625,3140,3142,3143,3145],{},"Every entry's defaults (",[622,3126,3127],{},"message",[622,3129,3130],{},"status",[622,3132,3133],{},"why",[622,3135,3136],{},"fix",[622,3138,3139],{},"link",[622,3141,717],{},") are overridable per call. ",[622,3144,717],{}," is shallow-merged (call-site wins on conflict).",[944,3147,3149],{"className":946,"code":3148,"language":949,"meta":950,"style":950},"\u002F\u002F Catalog default:\n\u002F\u002F message: 'Card declined'\n\u002F\u002F internal: { category: 'gateway' }\n\nthrow billingErrors.PAYMENT_DECLINED({\n  message: 'Custom message for this specific call',\n  internal: { stripeRef: 'ch_x', category: 'gateway-overridden' },\n  cause: stripeErr,\n})\n\n\u002F\u002F Resulting EvlogError:\n\u002F\u002F - message: 'Custom message for this specific call' (override)\n\u002F\u002F - status: 402 (catalog default)\n\u002F\u002F - why: 'Issuer declined the charge' (catalog default)\n\u002F\u002F - internal: { category: 'gateway-overridden', stripeRef: 'ch_x' }\n",[622,3150,3151,3156,3161,3166,3170,3184,3199,3236,3248,3254,3258,3263,3268,3273,3278],{"__ignoreMap":950},[954,3152,3153],{"class":956,"line":957},[954,3154,3155],{"class":2324},"\u002F\u002F Catalog default:\n",[954,3157,3158],{"class":956,"line":988},[954,3159,3160],{"class":2324},"\u002F\u002F message: 'Card declined'\n",[954,3162,3163],{"class":956,"line":995},[954,3164,3165],{"class":2324},"\u002F\u002F internal: { category: 'gateway' }\n",[954,3167,3168],{"class":956,"line":1031},[954,3169,992],{"emptyLinePlaceholder":991},[954,3171,3172,3174,3176,3178,3180,3182],{"class":956,"line":1069},[954,3173,2504],{"class":960},[954,3175,1405],{"class":968},[954,3177,1814],{"class":964},[954,3179,848],{"class":1011},[954,3181,1014],{"class":968},[954,3183,1849],{"class":964},[954,3185,3186,3188,3190,3192,3195,3197],{"class":956,"line":1101},[954,3187,2594],{"class":1034},[954,3189,1038],{"class":964},[954,3191,978],{"class":964},[954,3193,3194],{"class":981},"Custom message for this specific call",[954,3196,1017],{"class":964},[954,3198,1122],{"class":964},[954,3200,3201,3204,3206,3208,3211,3213,3215,3218,3220,3222,3225,3227,3229,3232,3234],{"class":956,"line":1111},[954,3202,3203],{"class":1034},"  internal",[954,3205,1038],{"class":964},[954,3207,965],{"class":964},[954,3209,3210],{"class":1034}," stripeRef",[954,3212,1038],{"class":964},[954,3214,978],{"class":964},[954,3216,3217],{"class":981},"ch_x",[954,3219,1017],{"class":964},[954,3221,1025],{"class":964},[954,3223,3224],{"class":1034}," category",[954,3226,1038],{"class":964},[954,3228,978],{"class":964},[954,3230,3231],{"class":981},"gateway-overridden",[954,3233,1017],{"class":964},[954,3235,1066],{"class":964},[954,3237,3238,3241,3243,3246],{"class":956,"line":1125},[954,3239,3240],{"class":1034},"  cause",[954,3242,1038],{"class":964},[954,3244,3245],{"class":968}," stripeErr",[954,3247,1122],{"class":964},[954,3249,3250,3252],{"class":956,"line":1176},[954,3251,1185],{"class":964},[954,3253,1188],{"class":968},[954,3255,3256],{"class":956,"line":1182},[954,3257,992],{"emptyLinePlaceholder":991},[954,3259,3260],{"class":956,"line":1529},[954,3261,3262],{"class":2324},"\u002F\u002F Resulting EvlogError:\n",[954,3264,3265],{"class":956,"line":1543},[954,3266,3267],{"class":2324},"\u002F\u002F - message: 'Custom message for this specific call' (override)\n",[954,3269,3270],{"class":956,"line":1556},[954,3271,3272],{"class":2324},"\u002F\u002F - status: 402 (catalog default)\n",[954,3274,3275],{"class":956,"line":1569},[954,3276,3277],{"class":2324},"\u002F\u002F - why: 'Issuer declined the charge' (catalog default)\n",[954,3279,3280],{"class":956,"line":1575},[954,3281,3282],{"class":2324},"\u002F\u002F - internal: { category: 'gateway-overridden', stripeRef: 'ch_x' }\n",[801,3284,3286],{"id":3285},"type-augmentation-deep-dive","Type augmentation: deep dive",[618,3288,3289,3290,3292,3293,625,3295,3297,3298,3301,3302,3305],{},"The opt-in ",[622,3291,749],{}," block is what surfaces autocomplete on ",[622,3294,728],{},[622,3296,731],{},", and the typed ",[622,3299,3300],{},"ErrorCode"," \u002F ",[622,3303,3304],{},"AuditAction"," exports.",[925,3307,3309],{"id":3308},"where-to-put-the-augmentation","Where to put the augmentation",[809,3311,3312,3322],{},[812,3313,3314],{},[815,3315,3316,3319],{},[818,3317,3318],{},"Repo shape",[818,3320,3321],{},"Recommended location",[827,3323,3324,3334,3348,3361],{},[815,3325,3326,3331],{},[832,3327,3328,3329,685],{},"Single file (",[622,3330,948],{},[832,3332,3333],{},"At the bottom of the same file",[815,3335,3336,3342],{},[832,3337,3338,3339,685],{},"Folder (",[622,3340,3341],{},"src\u002Ferrors\u002F*.ts",[832,3343,3344,3345,3347],{},"In ",[622,3346,1369],{}," (centralised) or each catalog file (decentralised)",[815,3349,3350,3353],{},[832,3351,3352],{},"npm package",[832,3354,3355,3356,3358,3359],{},"At the bottom of the package's main ",[622,3357,753],{}," so it ships in the published ",[622,3360,757],{},[815,3362,3363,3366],{},[832,3364,3365],{},"Monorepo",[832,3367,3368],{},"One augmentation per package, no central registry needed",[618,3370,3371,3372,3374],{},"Both centralised and decentralised work, because TypeScript merges multiple ",[622,3373,749],{}," blocks across files automatically.",[925,3376,3378],{"id":3377},"how-to-add-custom-domains","How to add custom domains",[618,3380,3381],{},"Each augmentation key is the namespace name. Multiple catalogs sharing a prefix can either be merged into one key or split:",[944,3383,3386],{"className":946,"code":3384,"filename":3385,"language":949,"meta":950,"style":950},"declare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    billing: typeof billingErrors\n  }\n}\n","Centralised — one key per package",[622,3387,3388,3402,3410,3420,3424],{"__ignoreMap":950},[954,3389,3390,3392,3394,3396,3398,3400],{"class":956,"line":957},[954,3391,1505],{"class":1001},[954,3393,1508],{"class":1001},[954,3395,978],{"class":964},[954,3397,982],{"class":981},[954,3399,1017],{"class":964},[954,3401,1028],{"class":964},[954,3403,3404,3406,3408],{"class":956,"line":988},[954,3405,1521],{"class":1001},[954,3407,1524],{"class":1149},[954,3409,1028],{"class":964},[954,3411,3412,3414,3416,3418],{"class":956,"line":995},[954,3413,1546],{"class":1034},[954,3415,1038],{"class":964},[954,3417,1537],{"class":964},[954,3419,1553],{"class":968},[954,3421,3422],{"class":956,"line":1031},[954,3423,1572],{"class":964},[954,3425,3426],{"class":956,"line":1069},[954,3427,1578],{"class":964},[944,3429,3432],{"className":946,"code":3430,"filename":3431,"language":949,"meta":950,"style":950},"declare module 'evlog' {\n  interface RegisteredErrorCatalogs {\n    'billing.payment': typeof billingPaymentErrors\n    'billing.subscription': typeof billingSubscriptionErrors\n    'billing.invoice': typeof billingInvoiceErrors\n  }\n}\n","Decentralised — one key per sub-domain",[622,3433,3434,3448,3456,3472,3487,3503,3507],{"__ignoreMap":950},[954,3435,3436,3438,3440,3442,3444,3446],{"class":956,"line":957},[954,3437,1505],{"class":1001},[954,3439,1508],{"class":1001},[954,3441,978],{"class":964},[954,3443,982],{"class":981},[954,3445,1017],{"class":964},[954,3447,1028],{"class":964},[954,3449,3450,3452,3454],{"class":956,"line":988},[954,3451,1521],{"class":1001},[954,3453,1524],{"class":1149},[954,3455,1028],{"class":964},[954,3457,3458,3461,3463,3465,3467,3469],{"class":956,"line":995},[954,3459,3460],{"class":964},"    '",[954,3462,742],{"class":981},[954,3464,1017],{"class":964},[954,3466,1038],{"class":964},[954,3468,1537],{"class":964},[954,3470,3471],{"class":968}," billingPaymentErrors\n",[954,3473,3474,3476,3478,3480,3482,3484],{"class":956,"line":1031},[954,3475,3460],{"class":964},[954,3477,1600],{"class":981},[954,3479,1017],{"class":964},[954,3481,1038],{"class":964},[954,3483,1537],{"class":964},[954,3485,3486],{"class":968}," billingSubscriptionErrors\n",[954,3488,3489,3491,3494,3496,3498,3500],{"class":956,"line":1069},[954,3490,3460],{"class":964},[954,3492,3493],{"class":981},"billing.invoice",[954,3495,1017],{"class":964},[954,3497,1038],{"class":964},[954,3499,1537],{"class":964},[954,3501,3502],{"class":968}," billingInvoiceErrors\n",[954,3504,3505],{"class":956,"line":1101},[954,3506,1572],{"class":964},[954,3508,3509],{"class":956,"line":1111},[954,3510,1578],{"class":964},[618,3512,2384,3513,3516,3517,3519],{},[622,3514,3515],{},"_codes"," literal union is what produces the actual ",[622,3518,3300],{}," type. The keys themselves are arbitrary, choose what feels right for your structure.",[925,3521,3523],{"id":3522},"verifying-the-augmentation","Verifying the augmentation",[944,3525,3528],{"className":946,"code":3526,"filename":3527,"language":949,"meta":950,"style":950},"import type { ErrorCode, AuditAction } from 'evlog'\n\n\u002F\u002F Hover the type in your IDE — should show the union of all registered codes.\ntype AllErrorCodes = ErrorCode\ntype AllAuditActions = AuditAction\n\n\u002F\u002F Compile-time check:\nconst validCode: ErrorCode = 'billing.PAYMENT_DECLINED' \u002F\u002F OK\nconst invalidCode: ErrorCode = 'billing.NOPE' \u002F\u002F ← TS error if catalog is registered\n","Anywhere in the codebase",[622,3529,3530,3556,3560,3565,3578,3590,3594,3599,3621],{"__ignoreMap":950},[954,3531,3532,3534,3536,3538,3541,3543,3546,3548,3550,3552,3554],{"class":956,"line":957},[954,3533,961],{"class":960},[954,3535,1378],{"class":960},[954,3537,965],{"class":964},[954,3539,3540],{"class":968}," ErrorCode",[954,3542,1025],{"class":964},[954,3544,3545],{"class":968}," AuditAction",[954,3547,972],{"class":964},[954,3549,975],{"class":960},[954,3551,978],{"class":964},[954,3553,982],{"class":981},[954,3555,985],{"class":964},[954,3557,3558],{"class":956,"line":988},[954,3559,992],{"emptyLinePlaceholder":991},[954,3561,3562],{"class":956,"line":995},[954,3563,3564],{"class":2324},"\u002F\u002F Hover the type in your IDE — should show the union of all registered codes.\n",[954,3566,3567,3569,3572,3575],{"class":956,"line":1031},[954,3568,1899],{"class":1001},[954,3570,3571],{"class":1149}," AllErrorCodes",[954,3573,3574],{"class":964}," =",[954,3576,3577],{"class":1149}," ErrorCode\n",[954,3579,3580,3582,3585,3587],{"class":956,"line":1069},[954,3581,1899],{"class":1001},[954,3583,3584],{"class":1149}," AllAuditActions",[954,3586,3574],{"class":964},[954,3588,3589],{"class":1149}," AuditAction\n",[954,3591,3592],{"class":956,"line":1101},[954,3593,992],{"emptyLinePlaceholder":991},[954,3595,3596],{"class":956,"line":1111},[954,3597,3598],{"class":2324},"\u002F\u002F Compile-time check:\n",[954,3600,3601,3603,3606,3608,3610,3612,3614,3616,3618],{"class":956,"line":1125},[954,3602,2630],{"class":1001},[954,3604,3605],{"class":968}," validCode",[954,3607,1038],{"class":964},[954,3609,3540],{"class":1149},[954,3611,3574],{"class":964},[954,3613,978],{"class":964},[954,3615,681],{"class":981},[954,3617,1017],{"class":964},[954,3619,3620],{"class":2324}," \u002F\u002F OK\n",[954,3622,3623,3625,3628,3630,3632,3634,3636,3639,3641],{"class":956,"line":1176},[954,3624,2630],{"class":1001},[954,3626,3627],{"class":968}," invalidCode",[954,3629,1038],{"class":964},[954,3631,3540],{"class":1149},[954,3633,3574],{"class":964},[954,3635,978],{"class":964},[954,3637,3638],{"class":981},"billing.NOPE",[954,3640,1017],{"class":964},[954,3642,3643],{"class":2324}," \u002F\u002F ← TS error if catalog is registered\n",[618,3645,3646,3647,3650],{},"If autocomplete is empty, either no catalog is registered yet, or the augmentation file is not in the TypeScript program (check ",[622,3648,3649],{},"tsconfig.json"," includes).",[801,3652,3654],{"id":3653},"common-pitfalls","Common pitfalls",[3656,3657,3658,3664,3665,3667,3668,1814],"warning",{},[835,3659,3660,3661,3663],{},"Don't put ",[622,3662,776],{}," blocks in test files."," Augmentations from test files leak into the type-checker for the rest of the codebase if the test files are included in the main ",[622,3666,3649],{},". Keep augmentations next to the catalog source, never inside ",[622,3669,3670],{},"*.test.ts",[3656,3672,3673,3676,3677,3680,3681,3683],{},[835,3674,3675],{},"Avoid prefix collisions across packages."," If two packages augment the same ",[622,3678,3679],{},"RegisteredErrorCatalogs"," key (say both ship a ",[622,3682,2139],{}," catalog), TypeScript merges them silently and the runtime keeps the last-registered factory. Convention: one prefix per package, no overlap.",[3656,3685,3686,3692,3693,3696,3697,3699],{},[835,3687,3688,3689,3691],{},"Never override the ",[622,3690,622],{}," at the call site."," The catalog defines the code identity, and overriding it would break dashboards, alerts, and consumer code branching on ",[622,3694,3695],{},"err.code",". The factory's call-site signature deliberately omits ",[622,3698,622],{}," from the overridable fields.",[788,3701,3702,3711],{},[618,3703,3704,3710],{},[835,3705,3706,3707,3709],{},"Prefer ",[622,3708,763],{}," over string comparisons in tests."," Both forms below are valid; the first survives renames (refactor-safe), the second doesn't.",[944,3712,3714],{"className":946,"code":3713,"language":949,"meta":950,"style":950},"expect(err.code).toBe(billingErrors.PAYMENT_DECLINED.code) \u002F\u002F ✓ refactor-safe\nexpect(err.code).toBe('billing.PAYMENT_DECLINED')          \u002F\u002F ✗ string literal\n",[622,3715,3716,3749],{"__ignoreMap":950},[954,3717,3718,3721,3724,3726,3729,3731,3734,3737,3739,3741,3743,3746],{"class":956,"line":957},[954,3719,3720],{"class":1011},"expect",[954,3722,3723],{"class":968},"(err",[954,3725,1814],{"class":964},[954,3727,3728],{"class":968},"code)",[954,3730,1814],{"class":964},[954,3732,3733],{"class":1011},"toBe",[954,3735,3736],{"class":968},"(billingErrors",[954,3738,1814],{"class":964},[954,3740,848],{"class":968},[954,3742,1814],{"class":964},[954,3744,3745],{"class":968},"code) ",[954,3747,3748],{"class":2324},"\u002F\u002F ✓ refactor-safe\n",[954,3750,3751,3753,3755,3757,3759,3761,3763,3765,3767,3769,3771,3774],{"class":956,"line":988},[954,3752,3720],{"class":1011},[954,3754,3723],{"class":968},[954,3756,1814],{"class":964},[954,3758,3728],{"class":968},[954,3760,1814],{"class":964},[954,3762,3733],{"class":1011},[954,3764,1014],{"class":968},[954,3766,1017],{"class":964},[954,3768,681],{"class":981},[954,3770,1017],{"class":964},[954,3772,3773],{"class":968},")          ",[954,3775,3776],{"class":2324},"\u002F\u002F ✗ string literal\n",[801,3778,3780],{"id":3779},"api-reference","API reference",[809,3782,3783,3796],{},[812,3784,3785],{},[815,3786,3787,3790,3793],{},[818,3788,3789],{},"Symbol",[818,3791,3792],{},"Kind",[818,3794,3795],{},"Purpose",[827,3797,3798,3810,3821,3832,3861,3877,3891,3903,3915,3926],{},[815,3799,3800,3804,3807],{},[832,3801,3802],{},[622,3803,666],{},[832,3805,3806],{},"factory",[832,3808,3809],{},"Standalone single-error factory. No prefix derivation.",[815,3811,3812,3816,3818],{},[832,3813,3814],{},[622,3815,656],{},[832,3817,3806],{},[832,3819,3820],{},"Bundle of typed errors sharing a prefix.",[815,3822,3823,3827,3829],{},[832,3824,3825],{},[622,3826,670],{},[832,3828,3806],{},[832,3830,3831],{},"Standalone single-action audit factory.",[815,3833,3834,3838,3840],{},[832,3835,3836],{},[622,3837,660],{},[832,3839,3806],{},[832,3841,3842,3843,625,3846,625,3849,625,3852,625,3855,625,3858,1814],{},"Bundle of typed audit actions sharing a prefix. Each entry accepts ",[622,3844,3845],{},"target",[622,3847,3848],{},"description",[622,3850,3851],{},"severity",[622,3853,3854],{},"requiresChanges",[622,3856,3857],{},"requiresReason",[622,3859,3860],{},"redactPaths",[815,3862,3863,3868,3870],{},[832,3864,3865],{},[622,3866,3867],{},"AuditCatalogEntry",[832,3869,1899],{},[832,3871,3872,3873,3876],{},"Metadata shape for a single catalog entry (alias of ",[622,3874,3875],{},"AuditActionDefinition",").",[815,3878,3879,3884,3886],{},[832,3880,3881],{},[622,3882,3883],{},"AuditSeverity",[832,3885,1899],{},[832,3887,3888,1814],{},[622,3889,3890],{},"'low' | 'medium' | 'high' | 'critical'",[815,3892,3893,3897,3900],{},[832,3894,3895],{},[622,3896,3679],{},[832,3898,3899],{},"interface",[832,3901,3902],{},"Augmentable registry of error catalogs.",[815,3904,3905,3910,3912],{},[832,3906,3907],{},[622,3908,3909],{},"RegisteredAuditCatalogs",[832,3911,3899],{},[832,3913,3914],{},"Augmentable registry of audit catalogs.",[815,3916,3917,3921,3923],{},[832,3918,3919],{},[622,3920,3300],{},[832,3922,1899],{},[832,3924,3925],{},"Union of all registered error codes.",[815,3927,3928,3932,3934],{},[832,3929,3930],{},[622,3931,3304],{},[832,3933,1899],{},[832,3935,3936],{},"Union of all registered audit actions.",[618,3938,3939,3940,3942],{},"Everything ships from the main ",[622,3941,982],{}," entrypoint.",[801,3944,3946],{"id":3945},"next-steps","Next Steps",[648,3948,3949,3962,3975],{},[651,3950,3951,3953,3954,3957,3958,3961],{},[782,3952,56],{"href":57},": The full ",[622,3955,3956],{},"createError"," API and ",[622,3959,3960],{},"parseError"," reference.",[651,3963,3964,3967,3968,625,3971,3974],{},[782,3965,3966],{"href":412},"Audit → Recording",": All audit-emission APIs (",[622,3969,3970],{},"log.audit",[622,3972,3973],{},"withAudit",", etc.).",[651,3976,3977,3979],{},[782,3978,241],{"href":246},": Auto-managed per-request loggers and HTTP error serialization.",[3981,3982,3983],"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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}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":950,"searchDepth":988,"depth":988,"links":3985},[3986,3987,3993,3998,4003,4008,4009,4010],{"id":803,"depth":988,"text":804},{"id":919,"depth":988,"text":920,"children":3988},[3989,3990,3991,3992],{"id":927,"depth":995,"text":928},{"id":1342,"depth":995,"text":1343},{"id":1591,"depth":995,"text":1592},{"id":1803,"depth":995,"text":1804},{"id":1823,"depth":988,"text":1824,"children":3994},[3995,3996,3997],{"id":1833,"depth":995,"text":1836},{"id":2090,"depth":995,"text":2091},{"id":2397,"depth":995,"text":2398},{"id":2700,"depth":988,"text":2701,"children":3999},[4000,4001,4002],{"id":2704,"depth":995,"text":2705},{"id":2946,"depth":995,"text":2947},{"id":3120,"depth":995,"text":3121},{"id":3285,"depth":988,"text":3286,"children":4004},[4005,4006,4007],{"id":3308,"depth":995,"text":3309},{"id":3377,"depth":995,"text":3378},{"id":3522,"depth":995,"text":3523},{"id":3653,"depth":988,"text":3654},{"id":3779,"depth":988,"text":3780},{"id":3945,"depth":988,"text":3946},"Scale typed error and audit catalogs from one file to a monorepo: conventions, an npm packaging recipe, and type augmentation.","md",[4014,4016],{"label":56,"icon":59,"to":57,"color":2680,"variant":4015},"subtle",{"label":397,"icon":398,"to":403,"color":2680,"variant":4015},{},{"icon":84},{"title":81,"description":4011},"WQv6C4Nkwj_7msd9aQEsksauBTliO5hTpmtYUOnz3fs",[4022,4024],{"title":76,"path":77,"stem":78,"description":4023,"icon":79,"children":-1},"Add compile-time type safety to your wide events with TypeScript module augmentation. Prevent typos and ensure consistent field names across your codebase.",{"title":41,"path":91,"stem":92,"description":4025,"icon":49,"children":-1},"Use the evlog CLI to check logging patterns in supported source files, diagnose your setup, and control telemetry. Includes flags and exit codes.",1791704394829]