{"_id":"@adaskothebeast/typewriter-http-fetch","_rev":"5-35b9ead4a31184a74d7829237d71fdf2","name":"@adaskothebeast/typewriter-http-fetch","dist-tags":{"latest":"11.0.1"},"versions":{"10.0.0":{"name":"@adaskothebeast/typewriter-http-fetch","version":"10.0.0","keywords":["typewriter","fetch","typescript","json","hydration"],"author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","_id":"@adaskothebeast/typewriter-http-fetch@10.0.0","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"homepage":"https://github.com/AdaskoTheBeAsT/date-interceptors#readme","bugs":{"url":"https://github.com/AdaskoTheBeAsT/date-interceptors/issues"},"dist":{"shasum":"83a083a298255bdece1acd3c429096ff01fb5d3b","tarball":"https://registry.npmjs.org/@adaskothebeast/typewriter-http-fetch/-/typewriter-http-fetch-10.0.0.tgz","fileCount":14,"integrity":"sha512-FjPCVlfe62Ga9LzoXyZtxCz0votWluJIv78ecwZL7PPJkUzWX3jIv0WvhrV/ZaIpGfeCLoprwjzqhGNJnjNI2Q==","signatures":[{"sig":"MEUCIQD52tgacCRUpNScSNdWJ3vHKSzaUuMPhxiSbMO/M/BuAwIgMptWbzXTzXhBwNWxCI5YFk5h9HmPF3CggTR5w7HEhzc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13587},"main":"./index.esm.js","module":"./index.esm.js","gitHead":"d939a562c5f5947e98df253b28d384399481063e","_npmUser":{"name":"adasko","email":"adaskothebeast@gmail.com"},"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/date-interceptors.git","type":"git","directory":"libs/typewriter-http-fetch"},"_npmVersion":"11.16.0","description":"Fetch helpers for Typewriter runtime schemas.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"@adaskothebeast/typewriter-schema":"0.0.1","@adaskothebeast/typewriter-runtime":"0.0.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/typewriter-http-fetch_10.0.0_1785247039102_0.9210344399831727","host":"s3://npm-registry-packages-npm-production"}},"10.0.1":{"name":"@adaskothebeast/typewriter-http-fetch","version":"10.0.1","keywords":["typewriter","fetch","typescript","json","hydration"],"author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","_id":"@adaskothebeast/typewriter-http-fetch@10.0.1","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"homepage":"https://github.com/AdaskoTheBeAsT/date-interceptors#readme","bugs":{"url":"https://github.com/AdaskoTheBeAsT/date-interceptors/issues"},"dist":{"shasum":"c42f3f98840fb2df9ba1311c50bee4755cdfef70","tarball":"https://registry.npmjs.org/@adaskothebeast/typewriter-http-fetch/-/typewriter-http-fetch-10.0.1.tgz","fileCount":7,"integrity":"sha512-z5+rVSzvTf6r8tE6trP2PV0u8JGqzGI3lqXz93WE8H0z4wZmCefbDW1dQcOeHfnJwKKQ6nuuUivKRPU1nEJMuw==","signatures":[{"sig":"MEUCIQDYwtRyMyuZS93DobUhijBzxr1pv7unF6C3WTUqv7OilwIgUJ2IdRLYmLAW8k5HjzZpLd1jk794sXqxLc3VPV8R3eA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adaskothebeast%2ftypewriter-http-fetch@10.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4752},"main":"./index.esm.js","type":"module","types":"./index.d.ts","module":"./index.esm.js","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:579a4062-72c9-40ac-8f13-880453bf9353"}},"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/date-interceptors.git","type":"git","directory":"libs/typewriter-http-fetch"},"_npmVersion":"11.16.0","description":"Fetch helpers for Typewriter runtime schemas.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"@adaskothebeast/typewriter-schema":"^10.0.0","@adaskothebeast/typewriter-runtime":"^10.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/typewriter-http-fetch_10.0.1_1785250683944_0.5952485803541228","host":"s3://npm-registry-packages-npm-production"}},"10.0.2":{"name":"@adaskothebeast/typewriter-http-fetch","version":"10.0.2","keywords":["typewriter","fetch","typescript","json","hydration"],"author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","_id":"@adaskothebeast/typewriter-http-fetch@10.0.2","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"homepage":"https://github.com/AdaskoTheBeAsT/date-interceptors#readme","bugs":{"url":"https://github.com/AdaskoTheBeAsT/date-interceptors/issues"},"dist":{"shasum":"3732489d31b27024b3bb759840f7275eba9f4212","tarball":"https://registry.npmjs.org/@adaskothebeast/typewriter-http-fetch/-/typewriter-http-fetch-10.0.2.tgz","fileCount":7,"integrity":"sha512-7zHC3THz1v5EV/lFHNKVGyaU1Y/toKegzoeff7o+G4PAhpKCdb3o82Pe/gGWuG1N0VIFXwXxce8xTNEPPDJcwg==","signatures":[{"sig":"MEUCIQCdbD1zSX7R2zpmOASqBI2bfQxmRGFoM9gHI05Lv105PAIgbfpWfzGzFVPdpJmEaaaIUmlpuw5kcCa54+6IX+fatzg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adaskothebeast%2ftypewriter-http-fetch@10.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4752},"main":"./index.esm.js","type":"module","types":"./index.d.ts","module":"./index.esm.js","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:579a4062-72c9-40ac-8f13-880453bf9353"}},"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/date-interceptors.git","type":"git","directory":"libs/typewriter-http-fetch"},"_npmVersion":"11.16.0","description":"Fetch helpers for Typewriter runtime schemas.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"@adaskothebeast/typewriter-schema":"^10.0.0","@adaskothebeast/typewriter-runtime":"^10.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/typewriter-http-fetch_10.0.2_1785252317519_0.8332650335912315","host":"s3://npm-registry-packages-npm-production"}},"11.0.0":{"name":"@adaskothebeast/typewriter-http-fetch","version":"11.0.0","keywords":["typewriter","fetch","typescript","json","hydration"],"author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","_id":"@adaskothebeast/typewriter-http-fetch@11.0.0","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"homepage":"https://github.com/AdaskoTheBeAsT/date-interceptors/tree/main/libs/typewriter-http-fetch#readme","bugs":{"url":"https://github.com/AdaskoTheBeAsT/date-interceptors/issues"},"dist":{"shasum":"072f3fa91d75fabcd6c71ee3e833edcc4042ed5b","tarball":"https://registry.npmjs.org/@adaskothebeast/typewriter-http-fetch/-/typewriter-http-fetch-11.0.0.tgz","fileCount":11,"integrity":"sha512-SzTxaZusHd5hdZGuA1DmmrRkaeZGyZmuZ/nMSm5SRG2mjRPZvi4Fu9lBNpP9OSxd2kmNSMzSNFB8E8lAb6Rtkw==","signatures":[{"sig":"MEUCIQDv0PdXcuwWbSp1gjfpXYXILgV+Otj2vw0i3u0HQ25TaQIgdhM/6wPYhj1n4dvLNCbu+/YElVHyhNw3MxAmcRCw+ks=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQC51rfgbRk5y7wGUfux2BEyU+NMNjGAxmVa3dBK6gJ1VAIgZvjv/faSNIXLlYIPeYG5S3I9xd3BgU7JsauIO0FveqM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adaskothebeast%2ftypewriter-http-fetch@11.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20863},"main":"./index.cjs","type":"module","types":"./index.d.ts","module":"./index.esm.js","engines":{"node":">=22.12"},"exports":{".":{"import":{"types":"./index.d.ts","default":"./index.esm.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}},"./package.json":"./package.json"},"gitHead":"23dc193eb4d8d834b51de51e1900225a26c143ff","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:579a4062-72c9-40ac-8f13-880453bf9353"}},"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/date-interceptors.git","type":"git","directory":"libs/typewriter-http-fetch"},"_npmVersion":"11.19.0","description":"fetch helpers that hydrate and serialize JSON with Typewriter runtime schemas.","directories":{},"sideEffects":false,"_nodeVersion":"26.10.0","dependencies":{"@adaskothebeast/hierarchical-convert-core":"^11.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@adaskothebeast/typewriter-runtime":"^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/typewriter-http-fetch_11.0.0_1790551420001_0.7238977106460784","host":"s3://npm-registry-packages-npm-production"}},"11.0.1":{"_id":"@adaskothebeast/typewriter-http-fetch@11.0.1","bugs":{"url":"https://github.com/AdaskoTheBeAsT/date-interceptors/issues"},"dist":{"shasum":"4180d07ee3769b66623b7a80dfa6c80f1d94ec93","tarball":"https://registry.npmjs.org/@adaskothebeast/typewriter-http-fetch/-/typewriter-http-fetch-11.0.1.tgz","fileCount":11,"integrity":"sha512-o0G3jrUVwaIcGEYHs5Lvvi2TXw+SP+vkjykgBjue7h7o6i229LfiUPw+KujNFVaAZHq2nPzOVWbrzMoPfO/x5A==","signatures":[{"sig":"MEUCIAsty2/B+cgqXT9i0lMNfgaOKmGvPgnIwIWu1w8RZleHAiEAhDrLVj8CW3txrCmfCAG4OUkx7LWgkYGJoekZgpWiXUQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDLa42/C1U035GyQXLgc4upynzRZkGo6oqYnJzlKM3/sAiEA1keIKyRmJzTZaeOd6fXcek0e9l49loJMr4R9g45WucA="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@adaskothebeast%2ftypewriter-http-fetch@11.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":20863},"main":"./index.cjs","name":"@adaskothebeast/typewriter-http-fetch","type":"module","types":"./index.d.ts","author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"module":"./index.esm.js","engines":{"node":">=22.12"},"exports":{".":{"import":{"types":"./index.d.ts","default":"./index.esm.js"},"require":{"types":"./index.d.cts","default":"./index.cjs"}},"./package.json":"./package.json"},"gitHead":"f9edf319c5e23bf1a17f5ec4eb8dac0008b9fd26","license":"MIT","version":"11.0.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"579a4062-72c9-40ac-8f13-880453bf9353"}},"homepage":"https://github.com/AdaskoTheBeAsT/date-interceptors/tree/main/libs/typewriter-http-fetch#readme","keywords":["typewriter","fetch","typescript","json","hydration"],"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/date-interceptors.git","type":"git","directory":"libs/typewriter-http-fetch"},"_npmVersion":"11.19.0","description":"fetch helpers that hydrate and serialize JSON with Typewriter runtime schemas.","directories":{},"maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"sideEffects":false,"_nodeVersion":"26.10.0","dependencies":{"@adaskothebeast/hierarchical-convert-core":"^11.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@adaskothebeast/typewriter-runtime":"^11.0.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/typewriter-http-fetch_11.0.1_1790749932061_0.510381507294559"}}},"time":{"created":"2026-07-28T13:57:18.926Z","modified":"2026-09-30T06:32:12.575Z","10.0.0":"2026-07-28T13:57:19.233Z","10.0.1":"2026-07-28T14:58:04.213Z","10.0.2":"2026-07-28T15:25:17.671Z","11.0.0":"2026-09-27T23:23:40.075Z","11.0.1":"2026-09-30T06:32:12.144Z"},"bugs":{"url":"https://github.com/AdaskoTheBeAsT/date-interceptors/issues"},"author":{"url":"https://github.com/adaskothebeast","name":"Adam Pluciński","email":"adaskothebeast@gmail.com"},"license":"MIT","homepage":"https://github.com/AdaskoTheBeAsT/date-interceptors/tree/main/libs/typewriter-http-fetch#readme","keywords":["typewriter","fetch","typescript","json","hydration"],"repository":{"url":"git+https://github.com/AdaskoTheBeAsT/date-interceptors.git","type":"git","directory":"libs/typewriter-http-fetch"},"description":"fetch helpers that hydrate and serialize JSON with Typewriter runtime schemas.","maintainers":[{"name":"adasko","email":"adaskothebeast@gmail.com"}],"readme":"# Typewriter Fetch\n\nFetch helpers for Typewriter runtime schemas.\n\n`serializeJsonBody` always returns a JSON string or throws. An `undefined` root\nthrows `TypeError`, including with an optional schema. Omit the request's `body`\nwhen no payload is wanted. Optional properties inside objects remain supported.\n\n```bash\nnpm install @adaskothebeast/typewriter-http-fetch\n```\n\n```ts\nimport { fetchJson, serializeJsonBody } from '@adaskothebeast/typewriter-http-fetch';\n\nconst invoice = await fetchJson('/api/invoices/1', InvoiceSchema, undefined, {\n  registry: apiTypeRegistry,\n});\n\nawait fetch('/api/invoices', {\n  method: 'POST',\n  headers: { 'content-type': 'application/json' },\n  body: serializeJsonBody(invoice, InvoiceSchema, {\n    registry: apiTypeRegistry,\n  }),\n});\n```\n\n`fetchJson` rejects non-success responses with `TypewriterFetchError`. A custom Fetch implementation can be provided through the `fetch` option.\n\n`fetchJson` returns `Promise<T | undefined>`: 204/205 and empty successful bodies return `undefined`. Nonempty malformed JSON rejects with `SyntaxError`. HTTP errors expose the original, unconsumed `Response` through `error.response` for headers and error-body inspection.\n\nJSON Problem Details (`application/problem+json`) bypass success conversion, including HTTP 200 responses. Use the exported `isProblemDetailsError(error)` guard to read `httpStatus`, typed `problem` members, and the original decoded `body`. Extension members such as `errors` and `traceId` are preserved. See the repository [conversion contract](https://github.com/AdaskoTheBeAsT/date-interceptors/blob/main/docs/conversion-contract.md#json-problem-details) for transport-specific behavior.\n","readmeFilename":"README.md"}