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