{"_id":"@apie/responses","_rev":"3-fe21a7bd5c40d8678e4f0547f71980bc","name":"@apie/responses","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@apie/responses","version":"1.0.0","description":"Typed HTTP responses","keywords":["typescript","typed","http"],"author":{"name":"Arthur @Refzlund"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/refzlund/apie-monorepo.git","directory":"packages/responses"},"homepage":"https://github.com/refzlund/apie-monorepo/packages/@api-responses","bugs":{"url":"https://github.com/refzlund/apie-monorepo/labels/bug"},"publishConfig":{"access":"public"},"type":"module","scripts":{"typecheck":"tsc --project ./tsconfig.json --noEmit --checkJs false","test":"bun test","package":"bun run ./package"},"main":"./dist/index.js","exports":{".":{"default":"./dist/index.js","require":"./dist/index.umd.cjs","types":"./dist/index.d.js"},"./types":{"default":"./dist/types.js","require":"./dist/types.umd.cjs","types":"./dist/types.d.ts"}},"dependencies":{"@apie/utility":"^1.0.0"},"devDependencies":{"@apie/utility":"workspace:*"},"_id":"@apie/responses@1.0.0","gitHead":"61e983c926d778c94610e866e2d502d8201602e7","types":"./dist/index.d.ts","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-ekucUKRQ75xStYEpD9hkL/sakdafIFUaRqMkzXHIE0Ee0k2vT/Cn+2TlNwyTY5Ez56ZBs67CImrbO9nQ1s0s6w==","shasum":"e71e7d78a90a06fba79c39768e9362d60c2174de","tarball":"https://registry.npmjs.org/@apie/responses/-/responses-1.0.0.tgz","fileCount":10,"unpackedSize":66642,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDqxZJiFE0usCS6Sva6cT+XWav1ATDaxbSTrkfV9w6XoAiEA9fyKCkRl1x0AQEC5BPV1TcRmF06NLZ1mGOUkW4mDLiM="}]},"_npmUser":{"name":"refzlund","email":"arthur@refzlund.com"},"directories":{},"maintainers":[{"name":"refzlund","email":"arthur@refzlund.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responses_1.0.0_1706838096055_0.04291986887514554"},"_hasShrinkwrap":false},"1.0.1":{"name":"@apie/responses","version":"1.0.1","description":"Typed HTTP responses","keywords":["typescript","typed","http"],"author":{"name":"Arthur @Refzlund"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/refzlund/apie-monorepo.git","directory":"packages/responses"},"homepage":"https://github.com/refzlund/apie-monorepo/packages/@api-responses","bugs":{"url":"https://github.com/refzlund/apie-monorepo/labels/bug"},"publishConfig":{"access":"public"},"type":"module","scripts":{"typecheck":"tsc --project ./tsconfig.json --noEmit --checkJs false","test":"bun test","package":"bun run ./package"},"main":"./dist/index.js","exports":{".":{"default":"./dist/index.js","require":"./dist/index.umd.cjs","types":"./dist/index.d.js"},"./types":{"default":"./dist/types.js","require":"./dist/types.umd.cjs","types":"./dist/types.d.ts"}},"dependencies":{"@apie/utility":"^1.2.0"},"devDependencies":{"@apie/utility":"workspace:*"},"_id":"@apie/responses@1.0.1","gitHead":"28297be9327f7014e49da1717888ba66b18fc31a","types":"./dist/index.d.ts","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-WYJGsfB2P7cRsAsMfnJDE3PgwjTQWD9edAMaHTc0qrMcCAfolyI4ObrVKkvmP1Z3hPd119OYCVO7J+05R2CUvw==","shasum":"fc5edd97a5d869d0ebddda24f56cdae936554c36","tarball":"https://registry.npmjs.org/@apie/responses/-/responses-1.0.1.tgz","fileCount":10,"unpackedSize":66768,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA9Qex4twrn5LArwZDCk+fl0qN5aeXBR3mOU9MUj8JckAiEA+eaJ9TZRnIfm6jQyhUrbMR7GWx0fVl8TYGd1TfDfnZk="}]},"_npmUser":{"name":"refzlund","email":"arthur@refzlund.com"},"directories":{},"maintainers":[{"name":"refzlund","email":"arthur@refzlund.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responses_1.0.1_1708887940939_0.957058810224235"},"_hasShrinkwrap":false},"1.0.2":{"name":"@apie/responses","version":"1.0.2","description":"Typed HTTP responses","keywords":["typescript","typed","http"],"author":{"name":"Arthur @Refzlund"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/refzlund/apie-monorepo.git","directory":"packages/responses"},"homepage":"https://github.com/refzlund/apie-monorepo/packages/@api-responses","bugs":{"url":"https://github.com/refzlund/apie-monorepo/labels/bug"},"publishConfig":{"access":"public"},"type":"module","scripts":{"typecheck":"tsc --project ./tsconfig.json --noEmit --checkJs false","test":"bun test","package":"bun run ./package"},"main":"./dist/index.js","types":"./dist/index.d.ts","typesVersions":{"*":{"*":["./dist/index.d.ts"],"./types":["./dist/types.d.ts"]}},"exports":{".":{"default":"./dist/index.js","require":"./dist/index.umd.cjs","types":"./dist/index.d.js"},"./types":{"default":"./dist/types.js","require":"./dist/types.umd.cjs","types":"./dist/types.d.ts"}},"dependencies":{"@apie/utility":"^1.2.1"},"devDependencies":{"@apie/utility":"workspace:*"},"_id":"@apie/responses@1.0.2","gitHead":"d9b92db5733322d4b054ca2c59121e19ca599ab2","_nodeVersion":"18.19.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-G9TeJCAWJHf/hpj3fmscxub5o3/QE688wR0RWtmlY/s/O+VZlBceWM91bHZmpqinEeCH2OWoA6vc3UI4Wk8z9g==","shasum":"abe3bb85a8e03b388129b6fc945184bd5161a651","tarball":"https://registry.npmjs.org/@apie/responses/-/responses-1.0.2.tgz","fileCount":10,"unpackedSize":66921,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGcs6PYTMKwEQEM8fjf6fQWdAh2qTyv5F3TTSpDZBjZ6AiEAw+6np1B2aoOAnOKK/a5mbe3LmAIPnMX+J+PWAyvbMBg="}]},"_npmUser":{"name":"refzlund","email":"arthur@refzlund.com"},"directories":{},"maintainers":[{"name":"refzlund","email":"arthur@refzlund.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responses_1.0.2_1710717768642_0.662826640819782"},"_hasShrinkwrap":false},"1.1.0":{"name":"@apie/responses","version":"1.1.0","description":"Typed HTTP responses","keywords":["typescript","typed","http"],"author":{"name":"Arthur @Refzlund"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/refzlund/apie-monorepo.git","directory":"packages/responses"},"homepage":"https://github.com/Refzlund/apie-monorepo/tree/main/packages/responses","bugs":{"url":"https://github.com/refzlund/apie-monorepo/labels/bug"},"publishConfig":{"access":"public"},"type":"module","scripts":{"typecheck":"tsc --project ./tsconfig.json --noEmit --checkJs false","test":"bun test","package":"bun run ./package"},"main":"./dist/index.js","types":"./dist/index.d.ts","typesVersions":{"*":{"*":["./dist/index.d.ts"],"./types":["./dist/types.d.ts"]}},"exports":{".":{"default":"./dist/index.js","require":"./dist/index.umd.cjs","types":"./dist/index.d.js"},"./types":{"default":"./dist/types.js","require":"./dist/types.umd.cjs","types":"./dist/types.d.ts"}},"dependencies":{"@apie/utility":"^1.2.1"},"devDependencies":{"@apie/utility":"workspace:*"},"_id":"@apie/responses@1.1.0","gitHead":"825db2a9b788310a1cc1d6ebc9396ca27a671b7a","_nodeVersion":"18.20.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-+fB/AnGigVAm0Bo1qlG0FLkjDO9TsN/Hy00b2dgX5M3ovdgfo2OiRGt50mxRF478OSIfnOXr80qrMd91ERQzsw==","shasum":"ba58611f3ae28742217149aca13ce33c2a8cb07e","tarball":"https://registry.npmjs.org/@apie/responses/-/responses-1.1.0.tgz","fileCount":10,"unpackedSize":67310,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFMoXrNx/fki21axheL096SOYRJoJphoewudO2eSnBXHAiEAzsQ1fqCQVyeBloOS2U5SIBrwSC2+RmJA//UD3OmH9gM="}]},"_npmUser":{"name":"refzlund","email":"arthur@refzlund.com"},"directories":{},"maintainers":[{"name":"refzlund","email":"arthur@refzlund.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responses_1.1.0_1713832042418_0.5195522214238417"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-02T01:41:35.949Z","1.0.0":"2024-02-02T01:41:36.227Z","modified":"2024-04-23T00:27:22.791Z","1.0.1":"2024-02-25T19:05:41.091Z","1.0.2":"2024-03-17T23:22:48.814Z","1.1.0":"2024-04-23T00:27:22.590Z"},"maintainers":[{"name":"refzlund","email":"arthur@refzlund.com"}],"description":"Typed HTTP responses","homepage":"https://github.com/Refzlund/apie-monorepo/tree/main/packages/responses","keywords":["typescript","typed","http"],"repository":{"type":"git","url":"git+https://github.com/refzlund/apie-monorepo.git","directory":"packages/responses"},"author":{"name":"Arthur @Refzlund"},"bugs":{"url":"https://github.com/refzlund/apie-monorepo/labels/bug"},"license":"MIT","readme":"<h1 align='center' vertical-align='baseline' >\n@apie/responses\n<small>\n<img src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAQAAACR313BAAAAEUlEQVR42mNkwAsYR6WHmDQAEFkAEMvRoosAAAAASUVORK5CYII=\" />\n<a href='https://www.npmjs.com/package/@apie/responses' >\n\t<img src='https://img.shields.io/npm/v/%40apie%2Fresponses?style=for-the-badge&logo=npm&label=%20' alt='NPM Package'/>\n</a>\n</small>\n</h1>\n<h3 align=\"center\">\n\n<a href='https://github.com/refzlund/apie-monorepo/actions/workflows/main.yml/badge.svg'>\n\t<img src='https://github.com/refzlund/apie-monorepo/actions/workflows/main.yml/badge.svg' alt='Linting & Tests'/>\n</a>\n\n<a href='https://semver.org'>\n\t<img src='https://img.shields.io/badge/Semantic_Versioning-v2-orange' alt='Semantic Versioning V2'/>\n</a>\n\n<a href='https://www.paypal.com/paypalme/refzlund'>\n\t<img src='https://img.shields.io/badge/Donate-%40Refzlund-green?logo=paypal' alt='Donation Link'/>\n</a>\n\n<br/>\n\n</h3>\n\n### What is @apie and @apie/responses?\n\nAn eco-system for infrastructure around REST API. It's worth noting that it is designed so that it can be used in all applications besides a REST API.\n\n`@apie/responses` provides typed HTTP responses such as 200: OK. \n\nLook at [./src/types](./src/types.ts) to see \"supported\" HTTP statuses.\n\n### Examples\n\n#### `getBody`\n\nWhen working with a response, you can directly get the body via `getBody`.\n\nIt's worth noting, it doesn't work if this response is sent to ex. a frontend.\\n\nEach responses stores `response._body` which is the RAW version of its content.\n\n```ts\nimport { OK, getBody } from '@apie/responses'\n\nconst response = OK({ value: 123 })\ngetBody(response) // => { value: 123 }\n```\n\n#### `isResponse`\n\nYou can check if you have a response:\n\n```ts\nimport { OK, isResponse } from '@apie/responses'\n\nconst response = OK({ value: 123 })\nif(isResponse(response)) {\n\t// ...\n}\n```\n\nThe reason we do this, is because `response instance Response` will simplify the type to `APIResponse` which is generic for the responses of `@apie/responses`.","readmeFilename":"README.md"}