@assetval/models
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @assetval/models

Weekly Downloads

7

Version

0.0.4

License

MIT

Unpacked Size

5.62 MB

Total Files

196

Last publish

Collaborators

  • abaccus
  • lekxy_