@pantherx.dev/common-api
TypeScript icon, indicating that this package has built-in type declarations

0.8.0 • Public • Published

Central Management Library - Common API

npm version

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 become update in the future)
  • delete

Readme

Keywords

none

Package Sidebar

Install

npm i @pantherx.dev/common-api

Weekly Downloads

1

Version

0.8.0

License

MIT

Unpacked Size

55.2 kB

Total Files

77

Last publish

Collaborators

  • franzos