{"_id":"@adi-family/http","_rev":"4-7e4660d0bbe13467ac8ddb97d9367b18","name":"@adi-family/http","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@adi-family/http","version":"1.0.0","keywords":["http","framework-agnostic","type-safe","validation","contracts","zod","typescript"],"author":{"name":"ADI Family"},"license":"MIT","_id":"@adi-family/http@1.0.0","maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"homepage":"https://github.com/adi-family/http#readme","bugs":{"url":"https://github.com/adi-family/http/issues"},"dist":{"shasum":"fbccd7a9c80ccfc3db5985d296f27c5cfad5678b","tarball":"https://registry.npmjs.org/@adi-family/http/-/http-1.0.0.tgz","fileCount":22,"integrity":"sha512-5dd3KKGcLnbdx9XXYmp3ZsOLaiKvJFCq4g9B+33LoD44RrJQTJwxFUAdNlBQDrFDhleKjS3w6tjgg8w+ZHhv3w==","signatures":[{"sig":"MEUCIQDX7ilnBaJwPLFza/ipPQhObSDEqvSzolrxizn4w9ZFhwIgdnk3BMGhaxNmUEG9hocWer+ZEz0etk7Kn1yRW8PmnqQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39395},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"f47297207e8b0a091f6b00875f9d54bac0b21915","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"},"repository":{"url":"git+https://github.com/adi-family/http.git","type":"git","directory":"packages/http"},"_npmVersion":"10.9.2","description":"Framework-agnostic, type-safe HTTP interface system","directories":{},"_nodeVersion":"23.10.0","_hasShrinkwrap":false,"devDependencies":{"zod":"^3.22.4","typescript":"^5.3.0","@types/node":"^20.10.0"},"peerDependencies":{"zod":"^3.22.0"},"_npmOperationalInternal":{"tmp":"tmp/http_1.0.0_1762107110081_0.38017575843203666","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@adi-family/http","version":"1.0.1","keywords":["http","framework-agnostic","type-safe","validation","contracts","zod","typescript"],"author":{"name":"ADI Family"},"license":"MIT","_id":"@adi-family/http@1.0.1","maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"homepage":"https://github.com/adi-family/http#readme","bugs":{"url":"https://github.com/adi-family/http/issues"},"dist":{"shasum":"c5ce309b7d2967349a78cd425c402e6e6312d4ec","tarball":"https://registry.npmjs.org/@adi-family/http/-/http-1.0.1.tgz","fileCount":22,"integrity":"sha512-K6jZ1QMVsu7jXHdzjaS7yTli1JwQAgcPysaRnSq108Vd8cNy2HuCFgP1VEkPnwwz1FhigQy5QidknDre3sCuIA==","signatures":[{"sig":"MEUCIQCE78xFwwuj9ydLAfWJxdtIUftCSNQ7BqbPDYGJ0cchJwIgIAwMMZHeHwd5Wvqv31hl/ICgBi4WrV152LhUZYnSzDY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39395},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"f47297207e8b0a091f6b00875f9d54bac0b21915","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"},"repository":{"url":"git+https://github.com/adi-family/http.git","type":"git","directory":"packages/http"},"_npmVersion":"10.9.2","description":"Framework-agnostic, type-safe HTTP interface system","directories":{},"_nodeVersion":"23.10.0","_hasShrinkwrap":false,"devDependencies":{"zod":"^3.22.4","typescript":"^5.3.0","@types/node":"^20.10.0"},"peerDependencies":{"zod":"^3.22.0"},"_npmOperationalInternal":{"tmp":"tmp/http_1.0.1_1762108842969_0.6468622005447591","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@adi-family/http","version":"1.0.2","keywords":["http","framework-agnostic","type-safe","validation","contracts","zod","typescript"],"author":{"name":"ADI Family"},"license":"MIT","_id":"@adi-family/http@1.0.2","maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"homepage":"https://github.com/adi-family/http#readme","bugs":{"url":"https://github.com/adi-family/http/issues"},"dist":{"shasum":"dbbbadd151360fbf4858eece6bd2bbc63f377c0e","tarball":"https://registry.npmjs.org/@adi-family/http/-/http-1.0.2.tgz","fileCount":22,"integrity":"sha512-gNHZVaJ+f41xZzm1BAHIsLjeD4IinXvskVgoU+rQFTZQ9QluWY1CG86EPXQnOfrcmyLcYW13Mo4yQnO5pluB7Q==","signatures":[{"sig":"MEUCIQDOffHB55dbmYiH4DHshelRzs4gtpL1J8sO2LdIYN0BlwIgDQoMgv+juzMzLTaph/SPWS9v+o74bK0fQ+XIQx7uO/A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39415},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"b83b53691026e1e7c3782c2a2dcfa4d350f190cf","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"},"repository":{"url":"git+https://github.com/adi-family/http.git","type":"git","directory":"packages/http"},"_npmVersion":"10.9.2","description":"Framework-agnostic, type-safe HTTP interface system","directories":{},"_nodeVersion":"23.10.0","_hasShrinkwrap":false,"devDependencies":{"zod":"^3.22.4","typescript":"^5.3.0","@types/node":"^20.10.0"},"peerDependencies":{"zod":"^3.22.0"},"_npmOperationalInternal":{"tmp":"tmp/http_1.0.2_1762649667777_0.09513706151996604","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@adi-family/http","version":"1.0.3","type":"module","description":"Framework-agnostic, type-safe HTTP interface system","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"keywords":["http","framework-agnostic","type-safe","validation","contracts","zod","typescript"],"author":{"name":"ADI Family"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/adi-family/http.git","directory":"packages/http"},"bugs":{"url":"https://github.com/adi-family/http/issues"},"homepage":"https://github.com/adi-family/http#readme","peerDependencies":{"zod":"^3.22.0"},"devDependencies":{"@types/node":"^20.10.0","typescript":"^5.3.0","zod":"^3.22.4"},"_id":"@adi-family/http@1.0.3","gitHead":"b83b53691026e1e7c3782c2a2dcfa4d350f190cf","_nodeVersion":"23.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-JNcpJqaWxfo0icQT0qRxw91Znjob6zhfBcsUsK1XEzgor7bry/nPUWdn6i7N1rWIei48i24A0KwSfeL8ohU7nA==","shasum":"f1f2bba5211b2e51c784e6160609fd4ff4baec47","tarball":"https://registry.npmjs.org/@adi-family/http/-/http-1.0.3.tgz","fileCount":22,"unpackedSize":39454,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDqt1MJrlMpmv0juCC0JMxhLyVkng9tbBt7iPwLgpC0MAiBq/INN7jw1lPpOg3+j3eOphX2N+6onSbOZDCTclZVVmA=="}]},"_npmUser":{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"},"directories":{},"maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/http_1.0.3_1762650293766_0.009109963290906409"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-02T18:11:49.853Z","modified":"2025-11-09T01:04:54.203Z","1.0.0":"2025-11-02T18:11:50.298Z","1.0.1":"2025-11-02T18:40:43.172Z","1.0.2":"2025-11-09T00:54:27.973Z","1.0.3":"2025-11-09T01:04:53.963Z"},"bugs":{"url":"https://github.com/adi-family/http/issues"},"author":{"name":"ADI Family"},"license":"MIT","homepage":"https://github.com/adi-family/http#readme","keywords":["http","framework-agnostic","type-safe","validation","contracts","zod","typescript"],"repository":{"type":"git","url":"git+https://github.com/adi-family/http.git","directory":"packages/http"},"description":"Framework-agnostic, type-safe HTTP interface system","maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"readme":"# @adi-family/http\n\nFramework-agnostic, type-safe HTTP interface system that separates API contracts from implementation, enabling end-to-end type safety between client and server.\n\n## Installation\n\n```bash\nnpm install @adi-family/http zod\n# or\nbun add @adi-family/http zod\n```\n\n## Quick Start\n\n### 1. Define API Contract\n\n```typescript\nimport { z } from 'zod'\nimport { route } from '@adi-family/http'\nimport type { HandlerConfig } from '@adi-family/http'\n\nexport const getUserConfig = {\n  method: 'GET',\n  route: route.pattern('/api/users/:id', z.object({ id: z.string() })),\n  response: {\n    schema: z.object({\n      id: z.string(),\n      name: z.string(),\n      email: z.string().email()\n    })\n  }\n} as const satisfies HandlerConfig\n```\n\n### 2. Create Server Handler\n\n```typescript\nimport { handler } from '@adi-family/http'\nimport { getUserConfig } from './contracts'\n\nexport const getUserHandler = handler(getUserConfig, async (ctx) => {\n  const user = await db.users.findById(ctx.params.id)\n  return user\n})\n```\n\n### 3. Use in Client\n\n```typescript\nimport { BaseClient } from '@adi-family/http'\nimport { getUserConfig } from './contracts'\n\nconst client = new BaseClient({\n  baseUrl: 'http://localhost:3000'\n})\n\n// Fully type-safe!\nconst user = await client.run(getUserConfig, {\n  params: { id: '123' }\n})\n```\n\n## Features\n\n- **Framework Agnostic** - Works with Express, Hono, Fastify, or any HTTP framework\n- **Type Safety** - Full TypeScript inference from config to client\n- **Config-Based Contracts** - API definitions are pure configuration objects\n- **Validation** - Body and query validated with Zod schemas\n- **No Param Validation** - URL params used only for building paths\n- **Separation of Concerns** - Contracts live separately from server handlers\n\n## Documentation\n\nFor complete documentation, examples, and guides, visit:\nhttps://github.com/adi-family/http\n\n## Framework Adapters\n\n- [@adi-family/http-express](https://www.npmjs.com/package/@adi-family/http-express) - Express adapter\n\n## License\n\nMIT - See LICENSE file for details\n\nCopyright (c) 2025 ADI Family (https://github.com/adi-family)\n","readmeFilename":"README.md"}