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