Skip to content
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

DEC-623: Switch from joi to zod #117

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion backend/.env.nest
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ LOG_INDEXER=false
EMAIL_TOKEN_EXPIRY_MIN=10
RESEND_VERIFICATION_RATE_LIMIT_MILLIS=2000

TELEGRAM_ENABLE_WEBHOOK=false
FRONTEND_BASE_URL=http://localhost:3000

FIREBASE_CLIENT_CONFIG={"apiKey":"AIzaSyAPEZMnzIy-JAi-Q-701bDXxygQCjqwxzs","authDomain":"developer-platform-local.firebaseapp.com","projectId":"developer-platform-local","storageBucket":"developer-platform-local.appspot.com","messagingSenderId":"78552755554","appId":"1:78552755554:web:e20f5431637aa1f0a8503b","measurementId":"G-MHKWBN39VF"}
6 changes: 3 additions & 3 deletions backend/.env.nest.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ FIREBASE_CLIENT_CONFIG=<required firebase client secret>
PROJECT_REF_PREFIX=<personal identifier and underscore (e.g. `mp_` for Michael Peter)>
MOCK_KEY_SERVICE=<true or false>

TELEGRAM_ENABLE_WEBHOOK=<true or false>
TELEGRAM_BOT_TOKEN=<required if TELEGRAM_ENABLE_WEBHOOK is true>
TELEGRAM_SECRET=<required if TELEGRAM_ENABLE_WEBHOOK is true>
# both keys below are required if you want to enable telegram hook
TELEGRAM_BOT_TOKEN=
TELEGRAM_SECRET=

MOCK_EMAIL_SERVICE=<true or false>
MAILGUN_DOMAIN=
Expand Down
2 changes: 1 addition & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ This is an RPC-style API. All endpoints are POSTs and all bodies are JSON. This

## Input Validation

All endpoints which accept input (JSON bodies) should validate that input with [Joi](https://joi.dev/). The best way to learn how to do this is to inspect an existing endpoint.
All endpoints which accept input (JSON bodies) should validate that input with [zod](https://github.com/colinhacks/zod). The best way to learn how to do this is to inspect an existing endpoint.

## Authentication

Expand Down
7 changes: 0 additions & 7 deletions backend/modules/template/dto.ts

This file was deleted.

5 changes: 2 additions & 3 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"express": "^4.18.1",
"firebase-admin": "^10.0.0",
"form-data": "^4.0.0",
"joi": "^17.4.2",
"kysely": "^0.20.0",
"luxon": "^3.0.1",
"mailgun.js": "^7.0.2",
Expand All @@ -47,15 +46,15 @@
"rimraf": "^3.0.2",
"rxjs": "^7.2.0",
"sequelize": "^6.12.0-alpha.1",
"verror": "^1.10.1"
"verror": "^1.10.1",
"zod-validation-error": "^0.2.1"
},
"devDependencies": {
"@nestjs/cli": "^9.1.3",
"@nestjs/schematics": "^8.0.0",
"@nestjs/testing": "^8.0.0",
"@types/express": "^4.17.13",
"@types/jest": "^27.0.1",
"@types/joi": "^17.2.3",
"@types/luxon": "^3.0.0",
"@types/node": "^16.0.0",
"@types/pg": "^8.6.5",
Expand Down
Loading