{"_id":"@typeschema/json","_rev":"4-700e825a90e9ad3feea597a9b81b058a","name":"@typeschema/json","dist-tags":{"latest":"0.14.0"},"versions":{"0.13.0":{"name":"@typeschema/json","version":"0.13.0","keywords":["typescript","type","schema","adapter","validation","inference","assert"],"author":{"name":"André Costa","email":"andrefonsecacosta@gmail.com"},"license":"MIT","_id":"@typeschema/json@0.13.0","maintainers":[{"name":"decs","email":"andrefonsecacosta@gmail.com"}],"homepage":"https://typeschema.com","bugs":{"url":"https://github.com/decs/typeschema/issues"},"//":"This file is partially generated. Only some fields can be modified manually!","dist":{"shasum":"be36d3ec3bc27f13c31d2c00baa59622369edc4f","tarball":"https://registry.npmjs.org/@typeschema/json/-/json-0.13.0.tgz","fileCount":7,"integrity":"sha512-Vu8BkX1efC25f4qA/WlBZKdRZeT/BD/fGcloEpGWFk8n/FDOvx19EOLwLOCmeF5fLEnzNnEpBOl+KhEfmpvnQg==","signatures":[{"sig":"MEQCIGKqEgBCIoUBXSweT3RyRG/AwxE9rQo+g8tCGLJcXa0YAiBs1DzhkeN1YEIn9WK/99gg8jdz5hYclpdIVkh79kvnQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10881},"main":"dist/index.js","_from":"file:typeschema-json-0.13.0.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"lint":"eslint src --fix","test":"vitest --config ../../vitest.config.ts","build":"tsup --config ../../tsup.config.ts","lint:package":"publint && attw --pack"},"_npmUser":{"name":"decs","email":"andrefonsecacosta@gmail.com"},"//version":"This field is manually maintained.","_resolved":"/private/var/folders/dq/77g3z6095pj93wyfv7wj52rm0000gn/T/9727242d57b2594a971f6c4e897fe620/typeschema-json-0.13.0.tgz","_integrity":"sha512-Vu8BkX1efC25f4qA/WlBZKdRZeT/BD/fGcloEpGWFk8n/FDOvx19EOLwLOCmeF5fLEnzNnEpBOl+KhEfmpvnQg==","repository":{"url":"git+https://github.com/decs/typeschema.git","type":"git"},"_npmVersion":"10.2.4","description":"Reusable adapter for JSON schemas","directories":{},"sideEffects":false,"_nodeVersion":"20.11.0","dependencies":{"@typeschema/core":"0.13.0"},"//description":"This field is manually maintained.","_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.12.0"},"peerDependencies":{"ajv":"^8.12.0"},"//devDependencies":"This field is manually maintained.","//peerDependencies":"This field is manually maintained.","peerDependenciesMeta":{"ajv":{"optional":true}},"//peerDependenciesMeta":"This field is manually maintained.","_npmOperationalInternal":{"tmp":"tmp/json_0.13.0_1708584809749_0.03650808317048626","host":"s3://npm-registry-packages"}},"0.13.1":{"name":"@typeschema/json","version":"0.13.1","keywords":["typescript","type","schema","adapter","validation","inference","assert"],"author":{"name":"André Costa","email":"andrefonsecacosta@gmail.com"},"license":"MIT","_id":"@typeschema/json@0.13.1","maintainers":[{"name":"decs","email":"andrefonsecacosta@gmail.com"}],"homepage":"https://typeschema.com","bugs":{"url":"https://github.com/decs/typeschema/issues"},"//":"This file is partially generated. Only some fields can be modified manually!","dist":{"shasum":"01beb81e3376dd0a24a4ee1a95d3e4b21fe2a6e5","tarball":"https://registry.npmjs.org/@typeschema/json/-/json-0.13.1.tgz","fileCount":7,"integrity":"sha512-2oFy+MvN6HCirNyfU5ADyh4yEwzNEaE9EuRrRuGVzcEqh2dwMtWKpXK4uvRp39P0ajPboWhaCifTSBenvhPMVQ==","signatures":[{"sig":"MEYCIQCI1xSJ811ky8vEoCFv572sWPqaN8lbIARJFx+0PqGGKwIhANFAWL6tS+0if2lmuDCgTDSmG6IAhh0049npx7D0A527","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11061},"main":"dist/index.js","_from":"file:typeschema-json-0.13.1.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"lint":"eslint src --fix","test":"vitest --config ../../vitest.config.ts","build":"tsup --config ../../tsup.config.ts","lint:package":"publint && attw --pack"},"_npmUser":{"name":"decs","email":"andrefonsecacosta@gmail.com"},"//version":"This field is manually maintained.","_resolved":"/private/var/folders/dq/77g3z6095pj93wyfv7wj52rm0000gn/T/7a68a0a7901472ac55cfa056ba4a88d3/typeschema-json-0.13.1.tgz","_integrity":"sha512-2oFy+MvN6HCirNyfU5ADyh4yEwzNEaE9EuRrRuGVzcEqh2dwMtWKpXK4uvRp39P0ajPboWhaCifTSBenvhPMVQ==","repository":{"url":"git+https://github.com/decs/typeschema.git","type":"git"},"_npmVersion":"10.2.4","description":"Reusable adapter for JSON schemas","directories":{},"sideEffects":false,"_nodeVersion":"20.11.0","dependencies":{"@typeschema/core":"0.13.1"},"//description":"This field is manually maintained.","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.12.0"},"peerDependencies":{"ajv":"^8.12.0"},"//devDependencies":"This field is manually maintained.","//peerDependencies":"This field is manually maintained.","peerDependenciesMeta":{"ajv":{"optional":true}},"//peerDependenciesMeta":"This field is manually maintained.","_npmOperationalInternal":{"tmp":"tmp/json_0.13.1_1708712690940_0.14426926306240162","host":"s3://npm-registry-packages"}},"0.13.2":{"name":"@typeschema/json","version":"0.13.2","keywords":["typescript","type","schema","adapter","validation","inference","assert"],"author":{"name":"André Costa","email":"andrefonsecacosta@gmail.com"},"license":"MIT","_id":"@typeschema/json@0.13.2","maintainers":[{"name":"decs","email":"andrefonsecacosta@gmail.com"}],"homepage":"https://typeschema.com","bugs":{"url":"https://github.com/decs/typeschema/issues"},"//":"This file is partially generated. Only some fields can be modified manually!","dist":{"shasum":"bb8f680eb20d45810fe9e4e698f66a98fe07101a","tarball":"https://registry.npmjs.org/@typeschema/json/-/json-0.13.2.tgz","fileCount":7,"integrity":"sha512-AonTISLggyR4T0OzqQSv18lZVbfuQ40CaAX/qvJX8Z/71gXGRrNi6OHX+6g68wb76r/ww36aIbAeqk/Gqqacbg==","signatures":[{"sig":"MEQCIEKqfm8yciHrsV2zpf72PBrFkQp85lb0W1pGi6JDt6PbAiA4Jf/CzdoEtxtfWl5YCvlqeVzaDXFIXEt+O+Djsjr8Lg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11691},"main":"dist/index.js","_from":"file:typeschema-json-0.13.2.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"lint":"eslint src --fix","test":"vitest --config ../../vitest.config.ts","build":"tsup --config ../../tsup.config.ts","lint:package":"publint && attw --pack"},"_npmUser":{"name":"decs","email":"andrefonsecacosta@gmail.com"},"//version":"This field is manually maintained.","_resolved":"/tmp/1ef68fb8fe78a7d5c3f4f7cb0133298f/typeschema-json-0.13.2.tgz","_integrity":"sha512-AonTISLggyR4T0OzqQSv18lZVbfuQ40CaAX/qvJX8Z/71gXGRrNi6OHX+6g68wb76r/ww36aIbAeqk/Gqqacbg==","repository":{"url":"git+https://github.com/decs/typeschema.git","type":"git"},"_npmVersion":"10.2.4","description":"Reusable adapter for JSON schemas","directories":{},"sideEffects":false,"_nodeVersion":"20.11.1","dependencies":{"@typeschema/core":"0.13.2"},"//description":"This field is manually maintained.","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.12.0","json-schema-to-ts":"^3.0.0"},"peerDependencies":{"ajv":"^8.12.0","json-schema-to-ts":"^3.0.0"},"//devDependencies":"This field is manually maintained.","//peerDependencies":"This field is manually maintained.","peerDependenciesMeta":{"ajv":{"optional":true},"json-schema-to-ts":{"optional":true}},"//peerDependenciesMeta":"This field is manually maintained.","_npmOperationalInternal":{"tmp":"tmp/json_0.13.2_1709024739052_0.01919726639556285","host":"s3://npm-registry-packages"}},"0.13.3":{"name":"@typeschema/json","version":"0.13.3","keywords":["typescript","type","schema","adapter","validation","inference","assert"],"author":{"name":"André Costa","email":"andrefonsecacosta@gmail.com"},"license":"MIT","_id":"@typeschema/json@0.13.3","maintainers":[{"name":"decs","email":"andrefonsecacosta@gmail.com"}],"homepage":"https://typeschema.com","bugs":{"url":"https://github.com/decs/typeschema/issues"},"//":"This file is partially generated. Only some fields can be modified manually!","dist":{"shasum":"eff5d472730c3c12b4c82948531a9afbd1ac2703","tarball":"https://registry.npmjs.org/@typeschema/json/-/json-0.13.3.tgz","fileCount":7,"integrity":"sha512-RMGs09PpaI8PvkoLwdKtnRkYgl476CTSmSgsMapmXYxwxqmK3G+Qt8YvmxUJdBELoREWGRlNVN6NQ1v/V/efwQ==","signatures":[{"sig":"MEYCIQD75ZxisP/v5skW/I/jzppsnTVoQzVYNfVCFXRQIgCVYgIhAJdZjQTCbxdnuh1ZBKodOCvi/FrQtEUwSJxSAx7zu1eW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12566},"main":"dist/index.js","_from":"file:typeschema-json-0.13.3.tgz","types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"lint":"eslint src --fix","test":"vitest --config ../../vitest.config.ts","build":"tsup --config ../../tsup.config.ts","lint:package":"publint && attw --pack"},"_npmUser":{"name":"decs","email":"andrefonsecacosta@gmail.com"},"//version":"This field is manually maintained.","_resolved":"/tmp/374339d1b7d3ffc22def9721dcffdcf7/typeschema-json-0.13.3.tgz","_integrity":"sha512-RMGs09PpaI8PvkoLwdKtnRkYgl476CTSmSgsMapmXYxwxqmK3G+Qt8YvmxUJdBELoREWGRlNVN6NQ1v/V/efwQ==","repository":{"url":"git+https://github.com/decs/typeschema.git","type":"git"},"_npmVersion":"10.2.4","description":"Reusable adapter for JSON schemas","directories":{},"sideEffects":false,"_nodeVersion":"20.11.1","dependencies":{"@typeschema/core":"0.13.2"},"//description":"This field is manually maintained.","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"ajv":"^8.12.0","json-schema-to-ts":"^3.0.0"},"peerDependencies":{"ajv":"^8.12.0","json-schema-to-ts":"^3.0.0"},"//devDependencies":"This field is manually maintained.","//peerDependencies":{"//":"This field is manually maintained.","ajv":"Required for validation and serialization","json-schema-to-ts":"Required for inference"},"peerDependenciesMeta":{"ajv":{"optional":true},"json-schema-to-ts":{"optional":true}},"//peerDependenciesMeta":"This field is manually maintained.","_npmOperationalInternal":{"tmp":"tmp/json_0.13.3_1709278972570_0.42758853020766807","host":"s3://npm-registry-packages"}},"0.14.0":{"//":"This file is partially generated. Only some fields can be modified manually!","name":"@typeschema/json","//version":"This field is manually maintained.","version":"0.14.0","//description":"This field is manually maintained.","description":"Reusable adapter for JSON schemas","keywords":["typescript","type","schema","adapter","validation","inference","assert"],"homepage":"https://typeschema.com","license":"MIT","author":{"name":"André Costa","email":"andrefonsecacosta@gmail.com"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"sideEffects":false,"repository":{"type":"git","url":"git+https://github.com/decs/typeschema.git"},"dependencies":{"@typeschema/core":"0.14.0"},"//devDependencies":"This field is manually maintained.","devDependencies":{"ajv":"^8.17.1","json-schema-to-ts":"^3.1.0"},"//peerDependencies":{"//":"This field is manually maintained.","ajv":"Required for validation and serialization","json-schema-to-ts":"Required for inference"},"peerDependencies":{"ajv":"^8.17.1","json-schema-to-ts":"^3.1.0"},"//peerDependenciesMeta":"This field is manually maintained.","peerDependenciesMeta":{"ajv":{"optional":true},"json-schema-to-ts":{"optional":true}},"scripts":{"build":"tsup --config ../../tsup.config.ts","lint":"eslint src --fix","lint:package":"publint && attw --pack","test":"vitest --config ../../vitest.config.ts","upgrade:deps":"ncu -u --dep=dev,peer --reject ow"},"_id":"@typeschema/json@0.14.0","bugs":{"url":"https://github.com/decs/typeschema/issues"},"_integrity":"sha512-QU6hQzx9U3VKXSK0egNDanASGCE0CryjQVso3KdWldf1/rVAn5MRi6c3iyTdrayg3ZMETAT8wS7IXHVtcClo0Q==","_resolved":"/tmp/d1f2601fbd710a25a4901f6b28efc338/typeschema-json-0.14.0.tgz","_from":"file:typeschema-json-0.14.0.tgz","_nodeVersion":"20.16.0","_npmVersion":"10.8.1","dist":{"integrity":"sha512-QU6hQzx9U3VKXSK0egNDanASGCE0CryjQVso3KdWldf1/rVAn5MRi6c3iyTdrayg3ZMETAT8wS7IXHVtcClo0Q==","shasum":"e5f445c86e77564e5c441479da24e23f594e5fc2","tarball":"https://registry.npmjs.org/@typeschema/json/-/json-0.14.0.tgz","fileCount":7,"unpackedSize":12791,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDekhF6V3EXCZpGYL2rQvLnYYbHoFz+lxER+8HG20xvnAIhALzAxij8EANYyyYdnxEnQ2zniT2n9l0QLYl4WBkV9UXY"}]},"_npmUser":{"name":"decs","email":"andrefonsecacosta@gmail.com"},"directories":{},"maintainers":[{"name":"decs","email":"andrefonsecacosta@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json_0.14.0_1724625238487_0.7010789075568991"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-22T06:53:29.618Z","modified":"2024-08-25T22:33:58.859Z","0.13.0":"2024-02-22T06:53:29.925Z","0.13.1":"2024-02-23T18:24:51.264Z","0.13.2":"2024-02-27T09:05:39.254Z","0.13.3":"2024-03-01T07:42:52.719Z","0.14.0":"2024-08-25T22:33:58.668Z"},"bugs":{"url":"https://github.com/decs/typeschema/issues"},"author":{"name":"André Costa","email":"andrefonsecacosta@gmail.com"},"license":"MIT","homepage":"https://typeschema.com","keywords":["typescript","type","schema","adapter","validation","inference","assert"],"repository":{"type":"git","url":"git+https://github.com/decs/typeschema.git"},"description":"Reusable adapter for JSON schemas","maintainers":[{"name":"decs","email":"andrefonsecacosta@gmail.com"}],"readme":"<!-- This file is generated. Do not modify it manually! -->\n\n<img src=\"https://typeschema.com/assets/logo.png\" width=\"64px\" alt=\"TypeSchema\" />\n<h1>@typeschema/json</h1>\n<p>\n  <a href=\"https://opensource.org/licenses/MIT\" rel=\"nofollow\"><img src=\"https://img.shields.io/github/license/decs/typeschema\" alt=\"License\"></a>\n  <a href=\"https://bundlephobia.com/package/@typeschema/json\" rel=\"nofollow\"><img src=\"https://img.shields.io/bundlephobia/minzip/%40typeschema%2Fjson\" alt=\"Bundle size\"></a>\n  <a href=\"https://www.npmjs.com/package/@typeschema/json\" rel=\"nofollow\"><img src=\"https://img.shields.io/npm/dw/@typeschema/json.svg\" alt=\"npm downloads\"></a>\n  <a href=\"https://github.com/decs/typeschema/stargazers\" rel=\"nofollow\"><img src=\"https://img.shields.io/github/stars/decs/typeschema\" alt=\"GitHub stars\"></a>\n</p>\n<p>\n  Reusable adapter for JSON schemas\n  <br />\n  <a href=\"https://typeschema.com\">https://typeschema.com</a> ✨\n</p>\n\n```ts\nimport {initTRPC} from '@trpc/server';\n\nimport {wrap} from '@typeschema/json';\n\nconst schema = {\n  additionalProperties: false,\n  properties: {name: {type: 'string'}},\n  required: ['name'],\n  type: 'object',\n} as const;\n\nconst t = initTRPC.create();\nconst appRouter = t.router({\n  hello: t.procedure\n    .input(wrap(schema))\n    .query(({input}) => `Hello, ${(input as any).name}!`),\n  //         ^? {name: string}\n});\n\n```\n\nUse it directly or through [`@typeschema/main`](https://github.com/decs/typeschema/tree/main/packages/main)\n\n## Dependencies\n- [`ajv`](https://www.npmjs.com/package/ajv): Required for validation and serialization (`^8.17.1`)\n- [`json-schema-to-ts`](https://www.npmjs.com/package/json-schema-to-ts): Required for inference (`^3.1.0`)\n\n## API\n\n### Inference\n- `Infer<TSchema>`: Extracts the output type of a schema\n- `InferIn<TSchema>`: Extracts the input type of a schema\n\n### Validation\n- `wrap(schema)`: Returns the wrapped schema with access to its operations\n- `validate(schema, data)`: Returns the validated data or a list of validation issues\n- `assert(schema, data)`: Returns the validated data or throws an `AggregateError`\n\n### Serialization\n- `toJSONSchema(schema)`: Converts the schema into the equivalent JSON schema\n","readmeFilename":"README.md"}