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