This is the Veritas Models Schema workspace.
yarn add @assetval/models
import { Models } from '@assetval/models';
const models = new Models();
import { {Models}Schema, Models } from '@assetval/models';
import { Model } from 'mongoose';
export const {Models}Model = model<Models>('{models}es', {Models}Schema);
import { {Models}ValidationSchema } from '@assetval/models';
import { z } from 'zod';
import { MagikRoutes } from '../middleware/RouterManager.js';
const ProfileRoute = MagikRoutes.getRouter('/profile');
ProfileRoute.post('/updateModels', {
auth: 'ensureAuthenticated',
validationSchema: z.object({
body: {Models}ValidationSchema
}),
route: async (req, res): Promise<void> => {
// Do something
}
});
MIT
Download the Schema repository and make sure you have the following installed:
- asdf
- NodeJS (ASDF)
- PNPM (Corepack / Node / ASDF)
- NX
Then run the following commands:
pnpm install