@assetval/requestor
v0.0.1
Published
AssetVal's internal requestor model
Downloads
2
Readme
Requestor
This is the Veritas Requestor Schema workspace.
Installation
yarn add @assetval/requestor
Usage
As a Class (Front End)
import { Requestor } from '@assetval/requestor';
const requestor = new Requestor();
As Schema (Back End)
import { {Requestor}Schema, Requestor } from '@assetval/requestor';
import { Model } from 'mongoose';
export const {Requestor}Model = model<Requestor>('{requestor}es', {Requestor}Schema);
As Validation (Back End)
import { {Requestor}ValidationSchema } from '@assetval/requestor';
import { z } from 'zod';
import { MagikRoutes } from '../middleware/RouterManager.js';
const ProfileRoute = MagikRoutes.getRouter('/profile');
ProfileRoute.post('/updateRequestor', {
auth: 'ensureAuthenticated',
validationSchema: z.object({
body: {Requestor}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)
- Yarn (Corepack / Node / ASDF)
- moonrepo
- git-chglog (ASDF)
Then run the following commands:
yarn install