@jacob-schroder/api-types
v1.1.37
Published
Shared type collection for the backend API.
Downloads
6
Keywords
Readme
API Types package for YOUANDX 3.0 Microservices.
Consuming the types as a client
To use these types in API consumer clients, first install the package using npm i -D @jacob-schroder/api-types
. If the package is already installed and needs updating, use npm update
.
From here, you can use any type directly, eg. import { IAddSpeakerArgs, ICreateRes } from '@jacob-schroder/api-types';
.
Adding and updating to types
To add new types, please use a corresponding type declaration file within the /types
directory.
Eg. for types on the "product" entity, please use /types/product
.
If you create a new entity type file, please make sure to re-export it in the api.ts
file in the root directory.
! Notice the /types/shared
directory, meant for types shared across multiple entities.
Pushing / publishing new work
! Before pushing to NPM, please make sure you are logged into NPM on an owner account.
Use npm login
to do so. If you require access, contact the package owner (Mark).
Modifications can be published by running npm run push
. This command does three thing;
- It compiles the project using tsc.
- It increments the version number in the package.json by 0.1.
- It publishes the package itself to npm.