{"_id":"@absolutejs/eden","_rev":"2-6430e170a063e8caf2c405cd383ea23f","name":"@absolutejs/eden","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@absolutejs/eden","version":"0.1.0","author":{"name":"Alex Kahn"},"license":"Apache-2.0","_id":"@absolutejs/eden@0.1.0","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/eden","bugs":{"url":"https://github.com/absolutejs/eden/issues"},"dist":{"shasum":"fee909c9f8983a2834fcdcbc50d3c6f5053d9622","tarball":"https://registry.npmjs.org/@absolutejs/eden/-/eden-0.1.0.tgz","fileCount":6,"integrity":"sha512-hOtl4CRuWsTQJXAYgfYg4lP442wzJhuLuf31Y4JW80uniJzifWWvKmqYPAbJg+up7WNmkJ2j4nGNalcqvyGPZg==","signatures":[{"sig":"MEUCIQCDv3j/72W3EPCqIPa1t1I7WVdX+OAfxKln6H3XgKgD+wIgPfSmhNVTRY9zxpirc/t36YGQZf+czVt+Xq39GJv+kAg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21281},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","scripts":{"build":"rm -rf dist && bun build src/index.ts --outdir dist --sourcemap && tsc --emitDeclarationOnly --project tsconfig.json","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"repository":{"url":"git+https://github.com/absolutejs/eden.git","type":"git"},"_npmVersion":"10.9.2","description":"Tiny error helpers for @absolutejs Eden Treaty clients. Unwraps Eden's { status, value } failure shape into a real Error that KEEPS the HTTP status, so call sites stop dropping it. Zero dependencies.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.14","typescript":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/eden_0.1.0_1782364343818_0.5291924640575005","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"author":{"name":"Alex Kahn"},"description":"Tiny error helpers for @absolutejs Eden Treaty clients. Unwraps Eden's { status, value } failure shape into a real Error that KEEPS the HTTP status, so call sites stop dropping it. Zero dependencies.","license":"Apache-2.0","publishConfig":{"access":"public"},"main":"./dist/index.js","module":"./dist/index.js","type":"module","name":"@absolutejs/eden","repository":{"type":"git","url":"git+https://github.com/absolutejs/eden.git"},"homepage":"https://github.com/absolutejs/eden","bugs":{"url":"https://github.com/absolutejs/eden/issues"},"scripts":{"build":"rm -rf dist && bun build src/index.ts --outdir dist --sourcemap && tsc --emitDeclarationOnly --project tsconfig.json","test":"bun test","typecheck":"tsc --noEmit"},"types":"./dist/index.d.ts","version":"0.2.0","devDependencies":{"@types/bun":"^1.3.14","typescript":"^6.0.3"},"_id":"@absolutejs/eden@0.2.0","gitHead":"7c040857bdcec59d65ea4e243b8dfc75da6a8cf6","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-T1cCR81l4p0EJb/EW9yVfckUWlmUwd9Ts2tnqnV3emQ3END9qssjvkZ1rljtZ7JxIe3i+0t0v3bIDn5ZrwAQGA==","shasum":"3c9d009d9f7aeda14ca625250fab6132fbfa2002","tarball":"https://registry.npmjs.org/@absolutejs/eden/-/eden-0.2.0.tgz","fileCount":6,"unpackedSize":27458,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD23dqubVLwew/LHjvK5Hgy35Rxqt4rJKwn9khqagxLhwIhAPrKr1OYOQ2SSxPsjNwxnL6BA1DyTDAEJnEvSNDzh7M+"}]},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"directories":{},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eden_0.2.0_1784721813085_0.779708210004473"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-25T05:12:23.677Z","modified":"2026-07-22T12:03:33.418Z","0.1.0":"2026-06-25T05:12:23.947Z","0.2.0":"2026-07-22T12:03:33.276Z"},"bugs":{"url":"https://github.com/absolutejs/eden/issues"},"author":{"name":"Alex Kahn"},"license":"Apache-2.0","homepage":"https://github.com/absolutejs/eden","repository":{"type":"git","url":"git+https://github.com/absolutejs/eden.git"},"description":"Tiny error helpers for @absolutejs Eden Treaty clients. Unwraps Eden's { status, value } failure shape into a real Error that KEEPS the HTTP status, so call sites stop dropping it. Zero dependencies.","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"readme":"# @absolutejs/eden\n\nTiny error helpers for [Eden Treaty](https://elysiajs.com/eden/treaty/overview)\nclients. Eden surfaces a failed call as `{ status, value }` — and most call\nsites `throw error.value`, dropping the HTTP status so a 402 paywall, a 409\nconflict, and a 500 all look the same downstream. This fixes that.\n\n```ts\nimport { apiError, isPaywallError } from \"@absolutejs/eden\";\n\nconst { data, error } = await api.things.get();\nif (error) throw apiError(error); // a real Error that KEEPS error.status\n\n// elsewhere\ntry {\n  await loadPremiumPanel();\n} catch (e) {\n  if (isPaywallError(e)) showUpgradeNudge();\n  else showError(apiErrorMessage(e));\n}\n```\n\n## API\n\n- `apiError(error, fallback?)` — normalize any thrown value (or an Eden\n  `{ status, value }`) into an `Error` that keeps `.status`.\n- `apiErrorMessage(error, fallback?)` — best-effort human message.\n- `apiErrorStatus(error)` — the HTTP status carried by an error, if any.\n- `isPaywallError(error)` — true for a 402 Payment Required.\n\n## Pagination\n\nList endpoints can share one bounded request/response contract without hiding\ntheir concrete database query:\n\n```ts\nimport {\n  normalizeOffsetPage,\n  type OffsetPage,\n} from \"@absolutejs/eden\";\n\nconst { limit, offset } = normalizeOffsetPage(request, {\n  defaultLimit: 25,\n  maxLimit: 100,\n});\n\nconst response: OffsetPage<User> = { data: rows, total };\n```\n\n`CursorPage<T>` is the corresponding envelope for stable keyset pagination.\n`getPageCount`, `clampPageIndex`, and `getPageRange` keep client pagination math\nconsistent with the server contract.\n\nZero dependencies; works in the browser and on the server.\n\nApache-2.0\n","readmeFilename":"README.md"}