1.4.3 • Published 1 day ago

@redhat-cloud-services/config-manager-client v1.4.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 day ago

Javascript client for Config Manager API

If you want to use RedHatInsights/config-manager you shouldn't use get requests directly, but rather use this client to integrate with this service.

Install

NPM

npm install --save @redhat-cloud-services/config-manager-client

Or Yarn

yarn add @redhat-cloud-services/config-manager-client

Usage

This client is using typescript and axios. Types are distributed with this package, so no need to define or install them separately.

To correctly bootstrap this API you should use this config (no need to define it multiple times, just one config and reimport it anywhere you want to use it).

// api.js
import axios from 'axios';
import { Configuration } from '@redhat-cloud-services/config-manager-client';
const instance = axios.create();

// BASE_PATH should be set in your constants file
const configApi = new Configuration(undefined, BASE_PATH, instance);
export configApi;

If you want to add some interceptors you can use axios build in interceptors

// api.js
import axios from 'axios';
import { Configuration } from '@redhat-cloud-services/host-inventory-client';
const instance = axios.create();

// Request interceptor
instance.interceptors.request.use((request) => {
    // some logic to do with request
});

// Response interceptor
instance.interceptors.response.use((response) => {
    // some logic to do with request
});

// Error interceptor
instance.interceptors.response.use(null, (error) => {
    // some logic to do with error
});

// BASE_PATH should be set in your constants file
const configApi = new Configuration(undefined, BASE_PATH, instance);
export configApi;

Building

Run nx build @redhat-cloud-services/config-manager-client to build the library.

Running unit tests

Run nx test @redhat-cloud-services/config-manager-client to execute the unit tests via Jest.

API documentation

1.4.3

1 day ago

1.4.2

8 days ago

1.4.1

8 days ago

1.4.0

17 days ago

1.3.3

1 month ago

1.3.2

1 month ago

1.3.1

1 month ago

1.2.13

5 months ago

1.2.8

8 months ago

1.2.7

8 months ago

1.2.6

9 months ago

1.2.5

10 months ago

1.2.9

7 months ago

1.2.12

6 months ago

1.2.10

7 months ago

1.2.11

7 months ago

1.2.4

11 months ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.84

2 years ago

1.0.83

2 years ago

1.0.82

2 years ago

1.0.81

2 years ago

1.0.87

1 year ago

1.0.86

1 year ago

1.0.85

2 years ago

1.0.80

2 years ago

1.0.79

2 years ago

1.0.78

2 years ago

1.0.77

2 years ago

1.0.76

2 years ago

1.0.75

2 years ago

1.0.74

2 years ago

1.0.73

2 years ago

1.0.72

3 years ago

1.0.71

3 years ago

1.0.70

3 years ago

1.0.69

3 years ago

1.0.68

3 years ago

1.0.67

3 years ago

1.0.66

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago