{"_id":"@anushka_kohli/muse-common-app","_rev":"2-dc9e5a7dbc96f9360fdfc3fba73f0061","name":"@anushka_kohli/muse-common-app","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@anushka_kohli/muse-common-app","version":"1.0.0","keywords":[],"author":{"name":"Anushka Kohli"},"license":"ISC","_id":"@anushka_kohli/muse-common-app@1.0.0","maintainers":[{"name":"anushka_kohli","email":"anushkakohli2021@gmail.com"}],"dist":{"shasum":"4f84a8d4f35fd13653226e19b50699fbd3142a79","tarball":"https://registry.npmjs.org/@anushka_kohli/muse-common-app/-/muse-common-app-1.0.0.tgz","fileCount":6,"integrity":"sha512-evmrWlKI/ti3p5UImJPYQkpghonBwVZ7gj2VNpeT0ItGnrPzAXvz3d0joXD+mbxUKMhsPvz0umQygr3x0m+Row==","signatures":[{"sig":"MEUCIAqYHwPGwFyiq03JIvPKwoAJel4IHy2ma0EPuxjSz5tXAiEAkg4TuFdYVGVAiJvlxDhrUEYr8WnV7oUrerIU4RyiRFw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17856},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"e8e80120f67fe33084a68b7fcc84c00d832c6fed","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"anushka_kohli","email":"anushkakohli2021@gmail.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.2","description":"Zod schemas for input validation and TypeScript types inferred from these schemas","directories":{},"_nodeVersion":"20.9.0","dependencies":{"zod":"^3.23.8","typescript":"^5.5.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/muse-common-app_1.0.0_1722766900267_0.07477625180796799","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@anushka_kohli/muse-common-app","version":"1.0.1","keywords":[],"author":{"name":"Anushka Kohli"},"license":"ISC","_id":"@anushka_kohli/muse-common-app@1.0.1","maintainers":[{"name":"anushka_kohli","email":"anushkakohli2021@gmail.com"}],"dist":{"shasum":"899b872a1b4ffce34b66008da85a8ca63a001ca2","tarball":"https://registry.npmjs.org/@anushka_kohli/muse-common-app/-/muse-common-app-1.0.1.tgz","fileCount":5,"integrity":"sha512-y7iciW4NBSeMQX7pnma6e4PbGK3xcP6tY7NuTULLlwMIeTvdchcjb3suW5K8i8MbIljQ8yo4iWaggnoYU+ToPw==","signatures":[{"sig":"MEUCIBoMMqSYWacOuv2UErMFmYCczSMdTW1DDiSNzeFZNlW4AiEAk/evM9VZUfpkLLkB1DIPA3eoiThYfFO3yX6PQqbXM0Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18305},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"4629be094571d4e18e72ddca74547543998647a8","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"anushka_kohli","email":"anushkakohli2021@gmail.com"},"repository":{"url":"","type":"git"},"_npmVersion":"10.8.2","description":"Zod schemas for input validation and TypeScript types inferred from these schemas","directories":{},"_nodeVersion":"20.9.0","dependencies":{"zod":"^3.23.8","typescript":"^5.5.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/muse-common-app_1.0.1_1722787136956_0.6767964131427286","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@anushka_kohli/muse-common-app","version":"1.0.2","description":"Zod schemas for input validation and TypeScript types inferred from these schemas","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":""},"keywords":[],"author":{"name":"Anushka Kohli"},"license":"ISC","dependencies":{"typescript":"^5.5.3","zod":"^3.23.8"},"_id":"@anushka_kohli/muse-common-app@1.0.2","gitHead":"4629be094571d4e18e72ddca74547543998647a8","types":"./dist/index.d.ts","_nodeVersion":"20.9.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-l650SGFxmPhVupnmjonGtytuBySO3WDaL2E4WKVJXMkRwBWPZDuNozJ+JOLA4jlxGAXukG9M8Rn1TkpzQ8euaQ==","shasum":"38f6788fce568d3e60a94bfdcda615cb37860cc0","tarball":"https://registry.npmjs.org/@anushka_kohli/muse-common-app/-/muse-common-app-1.0.2.tgz","fileCount":5,"unpackedSize":18304,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD8uyoQf7DDKqAynFBIF9wSKmi0qMXPLM4XISpwYCQ1OwIhAIO+r3O3ZMV3MA/uULWczVMo1zpQI8Xd8xqwX+OdEHI1"}]},"_npmUser":{"name":"anushka_kohli","email":"anushkakohli2021@gmail.com"},"directories":{},"maintainers":[{"name":"anushka_kohli","email":"anushkakohli2021@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/muse-common-app_1.0.2_1722787251888_0.9416835757860422"},"_hasShrinkwrap":false}},"time":{"created":"2024-08-04T10:21:40.180Z","modified":"2024-08-04T16:00:52.294Z","1.0.0":"2024-08-04T10:21:40.427Z","1.0.1":"2024-08-04T15:58:57.162Z","1.0.2":"2024-08-04T16:00:52.110Z"},"author":{"name":"Anushka Kohli"},"license":"ISC","keywords":[],"repository":{"type":"git","url":""},"description":"Zod schemas for input validation and TypeScript types inferred from these schemas","maintainers":[{"name":"anushka_kohli","email":"anushkakohli2021@gmail.com"}],"readme":"# Common Folder\r\n\r\nThis folder contains shared validation schemas and types used by both the backend and frontend of the Muse blogging website.\r\n\r\n## Overview\r\n\r\nThe common folder includes Zod schemas for input validation and TypeScript types inferred from these schemas. These are essential for ensuring data integrity and consistency across the application.\r\n\r\n## File Structure\r\n\r\n```plaintext\r\nsrc/\r\n└── index.ts\r\n```\r\n\r\n## Schemas and Types\r\n\r\n### Signup Input\r\n\r\nThe `signupInput` schema validates the data for user signup.\r\n\r\n### Signin Input\r\n\r\nThe `signinInput` schema validates the data for user signin.\r\n\r\n### UpdateUserDetails Input\r\n\r\nThe `updateUserDetailsInput` schema validates the data for updating user details.\r\n\r\n### Create Blog Input\r\n\r\nThe `createBlogInput` schema validates the data for creating a new blog post.\r\n\r\n### Update Blog Input\r\n\r\nThe `updateBlogInput` schema validates the data for updating an existing blog post.\r\n\r\n## Usage\r\n\r\nThese schemas and types are used across both backend and frontend to ensure that the data being handled conforms to the expected structure. This helps prevent errors and maintain consistency.\r\n\r\n### Generate Output\r\n\r\nTo generate the output, run:\r\n\r\n```bash\r\ntsc -b\r\n```\r\n\r\n### Publishing to npm\r\n\r\nTo publish the package to npm, use:\r\n\r\n```bash\r\nnpm publish --access public\r\n```\r\n\r\n### Accessing in Backend\r\n\r\nTo use this package in the backend, follow these steps:\r\n\r\n1. Navigate to the backend folder:\r\n\r\n    ```bash\r\n    cd backend\r\n    ```\r\n\r\n2. Install the package you published to npm:\r\n\r\n    ```bash\r\n    npm install your_package_name\r\n    ```\r\n\r\n3. Explore the package:\r\n\r\n    ```bash\r\n    cd node_modules/your_package_name\r\n    ```\r\n\r\n4. Update the routes to include Zod validation. Example usage:\r\n\r\n    ```typescript\r\n    import { signinInput, signupInput, createPostInput, updatePostInput } from \"@muse/common-app\";\r\n\r\n    userRouter.post(\"/signup\", async (c) => {\r\n        const prisma = c.get(\"prisma\") as PrismaClient;\r\n        const body = await c.req.json();\r\n        const { success } = signupInput.safeParse(body);\r\n        if (!success) {\r\n            c.status(400);\r\n            return c.json({ error: \"invalid input\" });\r\n        }\r\n    });\r\n    ```\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please ensure that any new schemas or types added are well-documented and tested.\r\n\r\n<!-- ## License\r\n\r\nThis project is licensed under the MIT License. -->","readmeFilename":"Readme.md"}