From 43393b3fd32d9aa512ac2833d0def3b4c5a9a4e3 Mon Sep 17 00:00:00 2001 From: Guillaume Dorce Date: Fri, 19 Aug 2022 16:04:20 +0200 Subject: [PATCH] add zod for validator --- package.json | 9 ++++++--- pnpm-lock.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9fa5e9e..8480654 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dev": "nodemon --watch src -e js,ts,json --exec 'ts-node src/index.ts'", "build": "tsc src/index.ts", "start": "node dist/index.js", - "db": "prisma studio" + "db": "prisma studio", + "db-build": "prisma generate; prisma db push" }, "keywords": [], "author": "", @@ -19,11 +20,13 @@ "nodemon": "^2.0.19", "ts-node": "^10.9.1", "tsconfig-paths": "^4.1.0", - "typescript": "^4.7.4" + "typescript": "^4.7.4", + "prisma": "^4.2.1" }, "dependencies": { + "@prisma/client": "^4.2.1", "cors": "^2.8.5", "express": "^4.18.1", - "prisma": "^4.2.1" + "zod": "^3.18.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b6db0cc..984b1de 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,6 +1,7 @@ lockfileVersion: 5.4 specifiers: + '@prisma/client': ^4.2.1 '@types/cors': ^2.8.12 '@types/express': ^4.17.13 '@types/node': ^18.7.4 @@ -11,11 +12,14 @@ specifiers: ts-node: ^10.9.1 tsconfig-paths: ^4.1.0 typescript: ^4.7.4 + zod: ^3.18.0 dependencies: + '@prisma/client': 4.2.1_prisma@4.2.1 cors: 2.8.5 express: 4.18.1 prisma: 4.2.1 + zod: 3.18.0 devDependencies: '@types/cors': 2.8.12 @@ -51,6 +55,24 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /@prisma/client/4.2.1_prisma@4.2.1: + resolution: {integrity: sha512-PZBkY60+k5oix+e6IUfl3ub8TbRLNsPLdfWrdy2eh80WcHTaT+/UfvXf/B7gXedH7FRtbPFHZXk1hZenJiJZFQ==} + engines: {node: '>=14.17'} + requiresBuild: true + peerDependencies: + prisma: '*' + peerDependenciesMeta: + prisma: + optional: true + dependencies: + '@prisma/engines-version': 4.2.0-33.2920a97877e12e055c1333079b8d19cee7f33826 + prisma: 4.2.1 + dev: false + + /@prisma/engines-version/4.2.0-33.2920a97877e12e055c1333079b8d19cee7f33826: + resolution: {integrity: sha512-tktkqdiwqE4QhmE088boPt+FwPj1Jub/zk+5F6sEfcRHzO5yz9jyMD5HFVtiwxZPLx/8Xg9ElnuTi8E5lWVQFQ==} + dev: false + /@prisma/engines/4.2.1: resolution: {integrity: sha512-0KqBwREUOjBiHwITsQzw2DWfLHjntvbqzGRawj4sBMnIiL5CXwyDUKeHOwXzKMtNr1rEjxEsypM14g0CzLRK3g==} requiresBuild: true @@ -862,3 +884,7 @@ packages: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} dev: true + + /zod/3.18.0: + resolution: {integrity: sha512-gwTm8RfUCe8l9rDwN5r2A17DkAa8Ez4Yl4yXqc5VqeGaXaJahzYYXbTwvhroZi0SNBqTwh/bKm2N0mpCzuw4bA==} + dev: false