@pantherx.dev/common-api
v0.8.0
Published
Axios-powered, type-safe access to Central Management API
Downloads
19
Readme
Central Management Library - Common API
This library enables easy, axios-powered, type-safe access to Central Management API endpoints. It relies primarily on @pantherx.dev/common
.
The collection was initially developed for testing, hence the rather verbose approach (axios config for each request), however, it also makes it very flexible and accessible. One benefit of using this, is that all odities are documented, and DTO's are up to date.
This likely won't be useful to you unless you are working with us, or with / on one of our products.
Usage
Install with
npm i --save @pantherx.dev/common-api
and use like this:
import { cmDocuments } from '@pantherx.dev/common'
const axiosConfig = {
headers: {
authorization: `Bearer ${access_token}`,
},
baseURL: 'https://identity.domain.com',
}
// Shortcut: axiosConfigDefault(accessToken)
const documents = await cmDocuments.list(axiosConfig)
Similiarly for others: cmDevices
, cmUsers
, ...
Default operations include:
list
get
create
patch
(this might becomeupdate
in the future)delete