0.0.1 • Published 11 months ago

@assetval/requestor v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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