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