-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(api): Fix inconsistencies in zod schema #240
Conversation
Failed to generate code suggestions for PR |
Hey Ritika! Glad that you put up this pr. The issue also mentions 3 other items that you would need to add to make this pr complete! Do let us know if you face any errors. |
Hi @rajdip-b , if you can kindly elaborate as to what needs to be done for the other issues. As I was not so much clear about them. thanks |
Okay look the second and 3rd bullets point to separate files where we have used The last point was to add another regex expression for email in the zod schema. You can just click on the hyperlinks and it will direct you to the files in concern. |
Hi @rajdip-b, so the 4th point is clear to me. But for the 2nd point - I have to remove the '@ts-expect-error' comments? and what about the 3rd point? I am sorry if I am taking time to understand this. |
No worries! Refer to this to understand how ts expect error works. You would need to remove ts error and also make sure that the value for For the 4th one, you would need to validate the email input in the zod schema. The 4th point in the issue points to the line you need to validate. Also, you can join our discord if you would like to discuss this more! https://discord.gg/tbsUq3Vv |
can't we just do z.string().email() rather than writing the regex manuallly |
Yeah totally but not for the first case. |
oh accha, I didn't check the format that we are using |
@rajdip-b I think we should add some zod middleware validation like hono https://hono.dev/guides/validation#zod-validator-middleware |
That would be an overkill since we are using the zod schema only during application startup |
Hi @rajdip-b, made some changes, kindly take a look |
@Ritika1705 Thanks! The PR looks clean. I'll just ask the guy who initially developed this to drop a review. @jamesfrye420 hey bro mind checking out the PR once? It aims to close those |
Cool will do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take your name <email@example.com>
into consideration for FROM_EMAIL
@jamesfrye420 , @rajdip-b updated the code as per review comments |
Looks good. @rajdip-b you can merge and close this. |
@Ritika1705 can you please try running The rest of the PR looks pretty nice, and I think I can merge it as soon as we can fix the error. |
2afbd9b
to
8c17ae8
Compare
@rajdip-b , not able to figure out what the issue is here. Some help will be appreciated. Tried in local too. Getting the same error |
@Ritika1705 I would recommend you to log the value of |
8c17ae8
to
a53f048
Compare
a53f048
to
998ec76
Compare
Quality Gate passedIssues Measures |
Hi @rajdip-b , errors are resolved. kindly look at the commits and merge the PR if you feel everything looks good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this works! Thanks for the PR :D
## [2.0.0](v1.4.0...v2.0.0) (2024-06-12) ### ⚠ BREAKING CHANGES * **api:** Refactor environment, [secure] and variable functionality ### 🚀 Features * **platform:** Workspace integrate ([#241](#241)) ([6107e7d](6107e7d)) ### 📚 Documentation * Fix broken links in README.md ([9266788](9266788)) * Modified environment-variable.md ([#256](#256)) ([4974756](4974756)) ### 🔧 Miscellaneous Chores * Added docker build and run commands to` package.json` ([#258](#258)) ([af61791](af61791)) * **api:** Fix inconsistencies in zod schema ([#240](#240)) ([f3a3632](f3a3632)) * **ci:** Update deploy web ([e80d47d](e80d47d)) * **docker:** Grant correct permissions to docker image ([#251](#251)) ([49546aa](49546aa)) * Update GitHub Action plugin versions ([#263](#263)) ([020bbf6](020bbf6)) * Update package versions for release ([93785be](93785be)) ### 🔨 Code Refactoring * **api:** Refactor environment, [secure] and variable functionality ([#270](#270)) ([55a6d37](55a6d37)) * **api:** Replace for loop with array indexing while decrypting [secure]s during bulk fetch [#265](#265) ([#266](#266)) ([62a1731](62a1731)) * **api:** Update return type while fetching [secure]s and variables ([#264](#264)) ([fd36abd](fd36abd))
🎉 This PR is included in version 2.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [2.0.0](v1.4.0...v2.0.0) (2024-06-12) ### ⚠ BREAKING CHANGES * **api:** Refactor environment, [secure] and variable functionality ### 🚀 Features * **platform:** Workspace integrate ([#241](#241)) ([6107e7d](6107e7d)) ### 📚 Documentation * Fix broken links in README.md ([9266788](9266788)) * Modified environment-variable.md ([#256](#256)) ([4974756](4974756)) ### 🔧 Miscellaneous Chores * Added docker build and run commands to` package.json` ([#258](#258)) ([af61791](af61791)) * **api:** Fix inconsistencies in zod schema ([#240](#240)) ([f3a3632](f3a3632)) * **ci:** Update deploy web ([e80d47d](e80d47d)) * **docker:** Grant correct permissions to docker image ([#251](#251)) ([49546aa](49546aa)) * Update GitHub Action plugin versions ([#263](#263)) ([020bbf6](020bbf6)) * Update package versions for release ([93785be](93785be)) ### 🔨 Code Refactoring * **api:** Refactor environment, [secure] and variable functionality ([#270](#270)) ([55a6d37](55a6d37)) * **api:** Replace for loop with array indexing while decrypting [secure]s during bulk fetch [#265](#265) ([#266](#266)) ([62a1731](62a1731)) * **api:** Update return type while fetching [secure]s and variables ([#264](#264)) ([fd36abd](fd36abd))
## [2.0.0](keyshade-xyz/keyshade@v1.4.0...v2.0.0) (2024-06-12) ### ⚠ BREAKING CHANGES * **api:** Refactor environment, [secure] and variable functionality ### 🚀 Features * **platform:** Workspace integrate ([keyshade-xyz#241](keyshade-xyz#241)) ([6107e7d](keyshade-xyz@6107e7d)) ### 📚 Documentation * Fix broken links in README.md ([9266788](keyshade-xyz@9266788)) * Modified environment-variable.md ([keyshade-xyz#256](keyshade-xyz#256)) ([4974756](keyshade-xyz@4974756)) ### 🔧 Miscellaneous Chores * Added docker build and run commands to` package.json` ([keyshade-xyz#258](keyshade-xyz#258)) ([af61791](keyshade-xyz@af61791)) * **api:** Fix inconsistencies in zod schema ([keyshade-xyz#240](keyshade-xyz#240)) ([f3a3632](keyshade-xyz@f3a3632)) * **ci:** Update deploy web ([e80d47d](keyshade-xyz@e80d47d)) * **docker:** Grant correct permissions to docker image ([keyshade-xyz#251](keyshade-xyz#251)) ([49546aa](keyshade-xyz@49546aa)) * Update GitHub Action plugin versions ([keyshade-xyz#263](keyshade-xyz#263)) ([020bbf6](keyshade-xyz@020bbf6)) * Update package versions for release ([93785be](keyshade-xyz@93785be)) ### 🔨 Code Refactoring * **api:** Refactor environment, [secure] and variable functionality ([keyshade-xyz#270](keyshade-xyz#270)) ([55a6d37](keyshade-xyz@55a6d37)) * **api:** Replace for loop with array indexing while decrypting [secure]s during bulk fetch [keyshade-xyz#265](keyshade-xyz#265) ([keyshade-xyz#266](keyshade-xyz#266)) ([62a1731](keyshade-xyz@62a1731)) * **api:** Update return type while fetching [secure]s and variables ([keyshade-xyz#264](keyshade-xyz#264)) ([fd36abd](keyshade-xyz@fd36abd))
Description
Email regex validation added.
z.string().regex(/^[a-zA-Z0-9.%+-]+ [<][a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}
In this single line, the regex pattern is directly embedded in the schema definition. This keeps the code concise and straightforward. (Expected format is "your-name your-name@email.com")
Fixes #216
Dependencies
Mention any dependencies/packages used
Future Improvements
Mention any improvements to be done in future related to any file/feature
Mentions
Mention and tag the people
Screenshots of relevant screens
Add screenshots of relevant screens
Developer's checklist
If changes are made in the code:
Documentation Update