{"_id":"@2ssk/medium-common","_rev":"3-e3787cad251c7e5c4db1423d9bbb8036","name":"@2ssk/medium-common","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@2ssk/medium-common","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@2ssk/medium-common@1.0.0","maintainers":[{"name":"2ssk","email":"sauravchp2@gmail.com"}],"dist":{"shasum":"5de485eae5f6ba57c01bded5088f486633cd9328","tarball":"https://registry.npmjs.org/@2ssk/medium-common/-/medium-common-1.0.0.tgz","fileCount":4,"integrity":"sha512-NtcaYeZx8rN0Pdxt426+noVbHVfkYeNrwrcjIPM61FM00NgqufOx1sADQLhZzL+99UcjQk+12ufDoiODdRJkbg==","signatures":[{"sig":"MEYCIQCHrJAXLow84GnxWlmd/uoQ00rp+aya0DNzQaWvSQrPIAIhALRNW1quLoH/UV7w8PYq/s4KqFPc11v7SXrWb1OBwzEO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13908},"main":"index.js","gitHead":"bd8414016ecc4b2f3f7d4278a524a6e368a30ad6","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"2ssk","email":"sauravchp2@gmail.com"},"_npmVersion":"10.9.0","directories":{},"_nodeVersion":"22.10.0","dependencies":{"zod":"^3.23.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","@eslint/js":"^9.13.0","typescript-eslint":"^8.10.0"},"_npmOperationalInternal":{"tmp":"tmp/medium-common_1.0.0_1729341353034_0.4416813208241477","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@2ssk/medium-common","version":"1.0.1","keywords":[],"author":"","license":"ISC","_id":"@2ssk/medium-common@1.0.1","maintainers":[{"name":"2ssk","email":"sauravchp2@gmail.com"}],"dist":{"shasum":"7cbe3f25458c5ff4c4a01d0d1bfa97a1b6130f88","tarball":"https://registry.npmjs.org/@2ssk/medium-common/-/medium-common-1.0.1.tgz","fileCount":5,"integrity":"sha512-QS0QDVbmnUII6Ue3aCnqefY5db5w2ai5JbmXUkzBUzonhLiFOM01Slvzsfogk9aR41qTU7xWB/bIA0q5Ziz+sw==","signatures":[{"sig":"MEUCIBcmz8lXLoKVXK4vR++1CC8ykPYLvEREWoSPEG8BlVUmAiEAiqIxu3ie+CmbxGY8kCuYvGPi6SWr5BxFg4fY4vzfArI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17083},"main":"index.js","gitHead":"bd8414016ecc4b2f3f7d4278a524a6e368a30ad6","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"2ssk","email":"sauravchp2@gmail.com"},"_npmVersion":"10.9.0","description":"A TypeScript utility library that provides Zod schemas and TypeScript types for handling common inputs such as authentication and post management. This library can be used to validate input data for user signup, and post creation or updates in a TypeScrip","directories":{},"_nodeVersion":"22.10.0","dependencies":{"zod":"^3.23.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","@eslint/js":"^9.13.0","typescript-eslint":"^8.10.0"},"_npmOperationalInternal":{"tmp":"tmp/medium-common_1.0.1_1729343050722_0.9367710204183077","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@2ssk/medium-common","version":"1.0.2","keywords":[],"author":"","license":"ISC","_id":"@2ssk/medium-common@1.0.2","maintainers":[{"name":"2ssk","email":"sauravchp2@gmail.com"}],"dist":{"shasum":"986321397a9e273381c80097255976ef21ae6386","tarball":"https://registry.npmjs.org/@2ssk/medium-common/-/medium-common-1.0.2.tgz","fileCount":5,"integrity":"sha512-Qq4KarWWF5X8QfW3ET4UcEbw0PdMYGUbY6MAYvve+IWoW5tAIqgA7hlWdKOTNQSAvVcdeSWc5TtnCglqpGu1mw==","signatures":[{"sig":"MEUCIQCzsauzLNBqKK2ber4UeiHzs+qK7RDU9w/ktTD2qM+W1wIgb29WNCp1sePvS42MKjqKlWpCKRSzNPFDqwGYv7VBTVg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17088},"main":"dist/index.js","gitHead":"bd8414016ecc4b2f3f7d4278a524a6e368a30ad6","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"2ssk","email":"sauravchp2@gmail.com"},"_npmVersion":"10.9.0","description":"A TypeScript utility library that provides Zod schemas and TypeScript types for handling common inputs such as authentication and post management. This library can be used to validate input data for user signup, and post creation or updates in a TypeScrip","directories":{},"_nodeVersion":"22.10.0","dependencies":{"zod":"^3.23.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.13.0","globals":"^15.11.0","@eslint/js":"^9.13.0","typescript-eslint":"^8.10.0"},"_npmOperationalInternal":{"tmp":"tmp/medium-common_1.0.2_1729343606489_0.4671622979667178","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@2ssk/medium-common","version":"1.0.3","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":"","license":"ISC","description":"A TypeScript utility library that provides Zod schemas and TypeScript types for handling common inputs such as authentication and post management. This library can be used to validate input data for user signup, and post creation or updates in a TypeScrip","dependencies":{"zod":"^3.23.8"},"devDependencies":{"@eslint/js":"^9.13.0","eslint":"^9.13.0","globals":"^15.11.0","typescript-eslint":"^8.10.0"},"publishConfig":{"access":"public"},"_id":"@2ssk/medium-common@1.0.3","gitHead":"bd8414016ecc4b2f3f7d4278a524a6e368a30ad6","types":"./dist/index.d.ts","_nodeVersion":"22.10.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-W/dA4mpxY0kko0faVNJmjdDC5f5j9Ll16keSv63poToJOI1kNd4G9bHTQoQPWfUN2fb28wZ5aM91R3OW9YUu8g==","shasum":"f2f3f9776dafe3412564e79e670550219bf1c4d9","tarball":"https://registry.npmjs.org/@2ssk/medium-common/-/medium-common-1.0.3.tgz","fileCount":7,"unpackedSize":18660,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAIuqelfZ47GZhEqrtSKFzkQd14DpISj8WWPDTSqpN/fAiASbRz46+alRcnK60QRMa80d9/on7p8lrFWTA5mrOI0fg=="}]},"_npmUser":{"name":"2ssk","email":"sauravchp2@gmail.com"},"directories":{},"maintainers":[{"name":"2ssk","email":"sauravchp2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/medium-common_1.0.3_1729343767299_0.613227689714045"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-19T12:35:52.933Z","modified":"2024-10-19T13:16:07.689Z","1.0.0":"2024-10-19T12:35:53.220Z","1.0.1":"2024-10-19T13:04:10.907Z","1.0.2":"2024-10-19T13:13:26.699Z","1.0.3":"2024-10-19T13:16:07.506Z"},"license":"ISC","keywords":[],"description":"A TypeScript utility library that provides Zod schemas and TypeScript types for handling common inputs such as authentication and post management. This library can be used to validate input data for user signup, and post creation or updates in a TypeScrip","maintainers":[{"name":"2ssk","email":"sauravchp2@gmail.com"}],"readme":"# @2ssk/medium-common\n\nA TypeScript utility library that provides Zod schemas and TypeScript types for handling common inputs such as authentication and post management. This library can be used to validate input data for user signup, and post creation or updates in a TypeScript or JavaScript application.\n\n## Features\n\n- **Zod schemas** for validating user and post input data.\n- **TypeScript** inferred from Zod schemas, ensuring type safety.\n- Ready to integrate into your backend or frontend for input validation.\n\n## Installation\n\n```bash\nnpm install @2ssk/medium-common\n```\n\nor with yarn:\n\n```bash\nyarn add @2ssk/medium-common\n```\n\n## Usage\n\n#### Importing Schemas and Types\n\nYou can import the Zod schemas and types for validating and typing your input data.\n\n```typescript\nimport {\n  signupInput,\n  signinInput,\n  createPostInput,\n  updatePostInput,\n} from \"@2ssk/medium-common\";\nimport type {\n  SignupInput,\n  SigninInput,\n  CreatePostInput,\n  UpdatePostInput,\n} from \"@2ssk/medium-common\";\n```\n\n#### Validating Example\n\nUse the schemas to validate data for signup, signin, and post creation or updates.\n\n```typescript\nimport {\n  signupInput,\n  signinInput,\n  createPostInput,\n  updatePostInput,\n} from \"@2ssk/medium-common\";\n\nconst signupData = {\n  email: \"user@email.com\",\n  password: \"password\",\n  name: \"User\",\n};\n\ntry {\n  signupInput.parse(signupData); // Validates the signup data\n  console.log(\"Signup data is valid\");\n} catch (error) {\n  console.error(\"Signup validation error\", error);\n}\n\nconst postData = {\n  title: \"My First Post\",\n  content: \"This is the content of the post.\",\n};\n\ntry {\n  createPostInput.parse(postData); // validates the post creation data\n  console.log(\"Post data is valid\");\n} catch (error) {\n  console.error(\"Post creation validation error\", error);\n}\n```\n\n## TypeScript Integration Example\n\nYou can also infer TypeScript types from the Zod schemas for strict checking.\n\n```typescript\nimport { SigninInput, createPostType } from \"@2ssk/medium-common\";\n\nconst signup: SignupInput = {\n  email: \"user@example.com\",\n  password: \"password\",\n  name: \"SSK\", // Optional field\n};\n\nconst newPost: CreatePostType = {\n  title: \"My First Post\",\n  content: \"This is the content of the post.\",\n};\n```\n\n## Zod Schemas\n\n- **Signup Input:**\n\n```typescript\nconst signupInput = z.object({\n  email: z.string().email(),\n  password: z.string(),\n  name: z.string().optional(),\n});\n```\n\n- **Signin Input:**\n\n```typescript\nconst signinInput = z.object({\n  email: z.string().email(),\n  password: z.string(),\n});\n```\n\n- **Create Post Input:**\n\n```typescript\nconst createPostInput = z.object({\n  title: z.string(),\n  content: z.string(),\n});\n```\n\n- **Update Post Input:**\n\n```typescript\nconst updatePostInput = z.object({\n  title: z.string().optional(),\n  content: z.string().optional(),\n});\n```\n\n## TypeScript Types\n\n- **SignupInput** - TypeScript type for the `signupInput` schema.\n- **SigninInput** - TypeScript type for the `signinInput` schema.\n- **createPostInput** - TypeScript type for the `createPostInput` schema.\n- **updatePostInput** - TypeScript type for the `updatePostInput` schema.\n\n## License\n\nThis project is licensed under the MIT License.\n","readmeFilename":"README.md"}