@assetval/address
v0.3.6
Published
AssetVal's internal address model
Downloads
9
Readme
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