{"_id":"@dkuida/ts-transformer-fastest-validator","_rev":"2-c6c68f8bf7a813f39c5d5117d50a0de1","name":"@dkuida/ts-transformer-fastest-validator","dist-tags":{"latest":"0.6.7"},"versions":{"0.6.6":{"name":"@dkuida/ts-transformer-fastest-validator","version":"0.6.6","description":"A TypeScript custom transformer to obtain JSON schema from interface.","main":"index.js","scripts":{"build":"npm run clean && ttsc","prepublish":"ttsc","pretest":"ttsc --project tsconfig.test.json ","lint":"tslint -p tsconfig.json","lint:fix":"tslint -p tsconfig.json --fix","clean":"rimraf coverage test/*.js  \"!(*.config|*.support).js\" ","compile":"npm run clean && ttsc","preversion":"npm run lint && npm run tsc && npm run test","postversion":"git push && git push --follow-tags","deploy":"npm run build && npm run lint && npm run test && npm publish","test":"jest --coverage"},"repository":{"type":"git","url":"git+https://github.com/ipetrovic11/ts-transformer-json-schema.git"},"publishConfig":{"access":"public"},"keywords":["TypeScript"],"author":{"name":"ipetrovic11"},"license":"MIT","bugs":{"url":"https://github.com/ipetrovic11/ts-transformer-json-schema/issues"},"homepage":"https://github.com/ipetrovic11/ts-transformer-json-schema","devDependencies":{"@types/jest":"^24.0.17","@types/node":"^12.7.2","fastest-validator":"^0.6.17","jest":"^24.9.0","pre-commit":"^1.2.2","jest-cli":"^24.9.0","@typescript-eslint/parser":"^1.13.0","tslint-eslint-rules":"^5.4.0","tslint":"^5.18.0","ttypescript":"^1.5.7","jest-environment-node":"^24.9.0","jest-runner-tsc":"^1.5.1","typescript":"^3.5.3","copyfiles":"^2.1.1"},"pre-commit":["lint","test"],"peerDependencies":{"typescript":">=2.4.1"},"gitHead":"104ad5325d44df548ee42593f25b74a0097740fb","_id":"@dkuida/ts-transformer-fastest-validator@0.6.6","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-FINacDq2S6+XdWsvufFnZfVTzGH3IkT5uK8OeUE8bc5NWCsjJ1OmdncQ5i56M3ggfj4Nrxh+wkE8Bpc1swh1xw==","shasum":"27904952c38c50cc6b290b9332cec6f4b4265fff","tarball":"https://registry.npmjs.org/@dkuida/ts-transformer-fastest-validator/-/ts-transformer-fastest-validator-0.6.6.tgz","fileCount":9,"unpackedSize":29981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVp0qCRA9TVsSAnZWagAA5zUP/24yrXEh9XexxN03crhE\nrOfILb8apMRbPCvzwSjwUR4LJTXJVBEX4WN29ww5KWxSQVDW3shxPymtNk5z\n6HvW4Svz3GRz7U5KMk5jY8iiDPTUZgP+krqYMgDaW1Hwd0mXZoD6obDhNkaG\nwKcnTDTNIrbcIjsja46GfpoakgEgYt8eTEVlvf2OaLF4lr9ffBTh6IQSaagZ\ndvnerq7URuPTQ0HA7HIbGjY7jVy4Jff+EhKd1yjrgVOYp/7GAgTPZaj4hFc2\nyYTj+hirVF/zP5TJD6jQDOsIr1cWKi6Q55tAhEltMKuf19EtV6t/uQNGfbvH\naSyQtRnmXRnQYLXaz4fQC0Mv/XeTl6IhQgAq+m5W/Zt9MdC0pDL+f2DRRV3I\nrPT7vlJU0iGFA+q8O4z11HzEsnXQ9ytWiszKzD2hOw4ndMzmqBdysd1EIKz2\nqASKp4ndiEMmFGPDmKAHaYj3t0gbUUEWOlkwJRg9cYsJistrgLCy8wlijvX2\nRsORh5bGZvby8P+fOmPLRoonKOoiZlMpm21HB7CEUsUvhY0q9trDHga6zXms\n9pxEKO77lWyLfM1PRj22ZLgOVMQS45OdLLDNTP9MbckM0hbi9HCWn6Z60pOW\nXmxir+CNNxbI7yseceO/Vx2l4GhZGnlBresCAoF4D1R4imrVJ972YqHk4sOc\nvX7N\r\n=rcdu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBPM4sJKuNXLfWpUnaJjt7i6P6s1DqPkqeOiYbKsD0cYAiEAwhBjhQptwTI98LrRfR8S5+Vkcg5EucRMfHR+p41iG/I="}]},"maintainers":[{"name":"dkuida","email":"dan@kuida.org"}],"_npmUser":{"name":"dkuida","email":"dan@kuida.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transformer-fastest-validator_0.6.6_1565957417771_0.017320004388769572"},"_hasShrinkwrap":false},"0.6.7":{"name":"@dkuida/ts-transformer-fastest-validator","version":"0.6.7","description":"A TypeScript custom transformer to obtain JSON schema from interface.","main":"index.js","scripts":{"build":"npm run clean && ttsc","prepublish":"ttsc","pretest":"ttsc --project tsconfig.test.json ","lint":"tslint -p tsconfig.json","lint:fix":"tslint -p tsconfig.json --fix","clean":"rimraf coverage test/*.js  \"!(*.config|*.support).js\" ","compile":"npm run clean && ttsc","preversion":"npm run lint && npm run tsc && npm run test","postversion":"git push && git push --follow-tags","deploy":"npm run build && npm run lint && npm run test && npm publish","test":"jest --coverage"},"repository":{"type":"git","url":"git+https://github.com/ipetrovic11/ts-transformer-json-schema.git"},"publishConfig":{"access":"public"},"keywords":["TypeScript"],"author":{"name":"ipetrovic11"},"license":"MIT","bugs":{"url":"https://github.com/ipetrovic11/ts-transformer-json-schema/issues"},"homepage":"https://github.com/ipetrovic11/ts-transformer-json-schema","devDependencies":{"@types/jest":"^24.0.17","@types/node":"^12.7.2","fastest-validator":"^0.6.17","jest":"^24.9.0","pre-commit":"^1.2.2","jest-cli":"^24.9.0","@typescript-eslint/parser":"^1.13.0","tslint-eslint-rules":"^5.4.0","tslint":"^5.18.0","ttypescript":"^1.5.7","jest-environment-node":"^24.9.0","jest-runner-tsc":"^1.5.1","typescript":"^3.5.3","copyfiles":"^2.1.1"},"pre-commit":["lint","test"],"peerDependencies":{"typescript":">=2.4.1"},"gitHead":"104ad5325d44df548ee42593f25b74a0097740fb","_id":"@dkuida/ts-transformer-fastest-validator@0.6.7","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-+3qNjZnLvCPdQAU+U8yZ8bckvbtDhucJCtqpltiv5vvhTa4YSpK1KHTAitc4o+IEhB6e+6T9H6+QKV5sBHU9IA==","shasum":"0e5e12390ad8a71f9c53c65bd848e1d0dc27cbde","tarball":"https://registry.npmjs.org/@dkuida/ts-transformer-fastest-validator/-/ts-transformer-fastest-validator-0.6.7.tgz","fileCount":9,"unpackedSize":29981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdWO9bCRA9TVsSAnZWagAAxawP/RmjpylnmL/h/KKWTrAW\neuqvPjq/iQjNqaz9Vb2BQVOxk5xyxZa6Fq9F/W+4y/Z3+6Ag39w7TeyY7pho\npjAe3ey3NCItn5x2R+jAbN7rQ4ew6sr94rQannT92ZHiGGFTS6jFJPVySTUY\nIGYCUfohPqxgNTEKZcaPaneQM/QlgY+u9C5tg3V10cAKzaWcFMx9z2VRe6ty\nRvtZbYw8jsogiRoGIDpEQPZ39atwVPNMUYP1TxDhnfq5kt6Ezp7TegreZ04H\n/J2i2WBZYnJcnFtNDLghwe8ird5O1/7VWS89W1Y4rD0cwV80xaW0iwECbxcH\nWSY2cEwCdR585mFSyNxCIYyP8AUXnUHiPXTFMOyxG5zoorze4ryM18IHkMFm\n9Xadj1rL8jTD0N49sES8hhK84/fQDxLhNlGeSTx5eULLYnkAz9hEMhSJ37fP\ngD9DkfPKFI+NJhxNfVUutylWN+bgcxtxTDpZLaCgc7WgBTHSHnVlxIU32F+7\neuag4lQ0qncZnwxPqyoWLylKlKKo1bSXSBUAMHZkBkDbh+UH3AXbLJhBMhZP\ngnQs0vILtKKxvJ+94n7GFTETz4fyBR1xANK+ZL2/XHhc4PK+TNg9wNvF3VpS\ntikBqecFww+0QDrEx34WmmlKEy7xVPyI5spqvOMSb5SL0+I+8jD39u22+SG4\nfS6v\r\n=E+5M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA/BHgZjF7R4/e16FIo9QieVrkKaIvPcvUE9jy4p+yDYAiB4fgR/qsqGTPsTFVXppGSZnIQVKgDRe+mmYPsvG4p5mg=="}]},"maintainers":[{"name":"dkuida","email":"dan@kuida.org"}],"_npmUser":{"name":"dkuida","email":"dan@kuida.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-transformer-fastest-validator_0.6.7_1566109529853_0.6521504247358993"},"_hasShrinkwrap":false}},"time":{"created":"2019-08-16T12:10:17.534Z","0.6.6":"2019-08-16T12:10:17.875Z","modified":"2022-04-05T04:51:27.561Z","0.6.7":"2019-08-18T06:25:30.031Z"},"maintainers":[{"name":"dkuida","email":"dan@kuida.org"}],"description":"A TypeScript custom transformer to obtain JSON schema from interface.","homepage":"https://github.com/ipetrovic11/ts-transformer-json-schema","keywords":["TypeScript"],"repository":{"type":"git","url":"git+https://github.com/ipetrovic11/ts-transformer-json-schema.git"},"author":{"name":"ipetrovic11"},"bugs":{"url":"https://github.com/ipetrovic11/ts-transformer-json-schema/issues"},"license":"MIT","readme":"[![Build Status][travis-image]][travis-url] [![Downloads](https://img.shields.io/npm/dm/ts-transformer-json-schema.svg)](https://www.npmjs.com/package/ts-transformer-json-schema)\n\n# ts-transformer-json-schema [![NPM version][npm-image]][npm-url]\nA TypeScript custom transformer to obtain json schema for [fastest-validator](https://github.com/icebob/fastest-validator) from TypeScript interface\n\n```\n$ npm install ts-transformer-json-schema --save\n```\n\n# Requirement\nTypeScript >= 2.4.1\nTTypeScript\n\n## How to use directly with fastest-validator\n```ts\nimport { schema } from 'ts-transformer-json-schema';\nimport Validator from 'fastest';\n\ninterface IExample {\n  str: string;\n}\n\nconst v = new Validator();\nv.validate({ str: 'string' }, schema<IExample>());\n```\n\n## How to use with Moleculer\n```ts\nimport { schema } from 'ts-transformer-json-schema';\n\ninterface IUser {\n\tname: string;\n}\n\nconst GreeterService: ServiceSchema = {\n  actions: {\n    welcome: {\n      params: schema<IUser>(),\n      handler({ params: user }: Context<IUser>) {\n        return `Welcome, ${user.name}`;\n      }\n    }\n  }\n}\n```\n\nThere is moleculer template that comes with this transformer and configure compiler to use it:\nhttps://github.com/ipetrovic11/moleculer-template-typescript\n\n## How to use the custom transformer\n\nUnfortunately, TypeScript itself does not currently provide any easy way to use custom transformers (See https://github.com/Microsoft/TypeScript/issues/14419).\n\n### For ttypescript\n\nSee [ttypescript's README](https://github.com/cevek/ttypescript/blob/master/README.md) for how to use this with module bundlers such as webpack or Rollup.\n\n```json\n// tsconfig.json\n{\n  \"compilerOptions\": {\n    // ...\n    \"plugins\": [\n      { \"transform\": \"ts-transformer-json-schema/transformer\" }\n    ]\n  },\n  // ...\n}\n```\n\n### What can be transformed\n\nCurrently transformer can handle:\n* Interfaces\n* Neasted interfaces\n* Extended interfaces\n\n* Intersections and Unions\n\n* Enums\n* Emails - Predefined - IEmail\n* Dates - Predefined - IDate\n* UUID - Predefined - IUUID\n* Forbidden - Predefined - IForbidden\n\n* Additional properties\n\nTake a look at [tests](https://github.com/ipetrovic11/ts-transformer-json-schema/blob/master/test/schema.spec.ts) for all possibilities.\nAll cases from fastest-validator should be covered, if not please report the issue.\n\n# License\n\nMIT\n\n[travis-image]:https://travis-ci.org/ipetrovic11/ts-transformer-json-schema.svg?branch=master\n[travis-url]:https://travis-ci.org/ipetrovic11/ts-transformer-json-schema\n[npm-image]:https://img.shields.io/npm/v/ts-transformer-json-schema.svg?style=flat\n[npm-url]:https://www.npmjs.com/package/ts-transformer-json-schema\n","readmeFilename":"README.md"}