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