0.3.6 • Published 11 months ago

@assetval/address v0.3.6

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

Address

This is the Veritas Address Schema workspace.

Installation

yarn add @assetval/address

Usage

As a Class (Front End)

import { Address } from '@assetval/address';

const address = new Address();

As Schema (Back End)

import { AddressSchema, Address } from '@assetval/address';
import { Model } from 'mongoose';

export const AddressModel = model<Address>('addresses', AddressSchema);

As Validation (Back End)

import { AddressValidationSchema } from '@assetval/address';
import { z } from 'zod';
import { MagikRoutes } from '../middleware/RouterManager.js';

const ProfileRoute = MagikRoutes.getRouter('/profile');

ProfileRoute.post('/updateAddress', {
  auth: 'ensureAuthenticated',
  validationSchema: z.object({
    body: AddressValidationSchema
  }),
  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