@assetval/models
v0.0.4
Published
AssetVal's models workspace
Downloads
130
Readme
Models
This is the Veritas Models Schema workspace.
Installation
yarn add @assetval/models
Usage
As a Class (Front End)
import { Models } from '@assetval/models';
const models = new Models();
As Schema (Back End)
import { {Models}Schema, Models } from '@assetval/models';
import { Model } from 'mongoose';
export const {Models}Model = model<Models>('{models}es', {Models}Schema);
As Validation (Back End)
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
}
});
License
MIT
Authors
Contributing
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