0.2.8 • Published 11 months ago
@assetval/client v0.2.8
Client
This is the Veritas Client Schema workspace.
Installation
yarn add @assetval/client
Usage
As a Class (Front End)
import { Client } from '@assetval/client';
const client = new Client();
As Schema (Back End)
import { ClientSchema, Client } from '@assetval/client';
import { Model } from 'mongoose';
export const ClientModel = model<Client>('clients', ClientSchema);
As Validation (Back End)
import { ClientValidationSchema } from '@assetval/client';
import { z } from 'zod';
import { MagikRoutes } from '../middleware/RouterManager.js';
const ProfileRoute = MagikRoutes.getRouter('/profile');
ProfileRoute.post('/updateClient', {
auth: 'ensureAuthenticated',
validationSchema: z.object({
body: ClientValidationSchema
}),
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)
- Yarn (Corepack / Node / ASDF)
- moonrepo
- git-chglog (ASDF)
Then run the following commands:
yarn install