diff --git a/packages/compliance/README.md b/packages/compliance/README.md index 71b2100d..b0efe065 100644 --- a/packages/compliance/README.md +++ b/packages/compliance/README.md @@ -18,20 +18,19 @@ This client is using typescript and axios. Types are distributed with this packa 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). ```JS // api.js -import axios from 'axios'; -import { Configuration } from '@redhat-cloud-services/compliance-client'; -const instance = axios.create(); +import APIFactory from '@redhat-cloud-services/compliance-client/utils'; +import createEndpoint from '@redhat-cloud-services/compliance-client/AssignRule'; // BASE_PATH should be set in your constants file -const configApi = new Configuration(undefined, BASE_PATH, instance); -export configApi; +const complianceApi = APIFactory(BASE_PATH, undefined, { AssignRule }); +export complianceApi; ``` If you want to add some interceptors you can use axios build in interceptors ```JS // api.js import axios from 'axios'; -import { Configuration } from '@redhat-cloud-services/compliance-client'; +import { complianceApi } from '@redhat-cloud-services/compliance-client'; const instance = axios.create(); // Request interceptor @@ -50,8 +49,8 @@ instance.interceptors.response.use(null, (error) => { }); // BASE_PATH should be set in your constants file -const configApi = new Configuration(undefined, BASE_PATH, instance); -export configApi; +const complianceApi = APIFactory(BASE_PATH, instance, { AssignRule }); +export complianceApi; ``` ## Building diff --git a/packages/config-manager/README.md b/packages/config-manager/README.md index 1777bd2f..e530b3da 100644 --- a/packages/config-manager/README.md +++ b/packages/config-manager/README.md @@ -18,20 +18,19 @@ This client is using typescript and axios. Types are distributed with this packa 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). ```JS // api.js -import axios from 'axios'; -import { Configuration } from '@redhat-cloud-services/config-manager-client'; -const instance = axios.create(); +import APIFactory from '@redhat-cloud-services/config-manager-client/utils'; +import createEndpoint from '@redhat-cloud-services/config-manager-client/CreateProfile'; // BASE_PATH should be set in your constants file -const configApi = new Configuration(undefined, BASE_PATH, instance); -export configApi; +const configManagerApi = APIFactory(BASE_PATH, undefined, { CreateProfile }); +export configManagerApi; ``` If you want to add some interceptors you can use axios build in interceptors ```JS // api.js import axios from 'axios'; -import { Configuration } from '@redhat-cloud-services/host-inventory-client'; +import { configManagerApi } from '@redhat-cloud-services/config-manager-client'; const instance = axios.create(); // Request interceptor @@ -50,8 +49,8 @@ instance.interceptors.response.use(null, (error) => { }); // BASE_PATH should be set in your constants file -const configApi = new Configuration(undefined, BASE_PATH, instance); -export configApi; +const configManagerApi = APIFactory(BASE_PATH, instance, { CreateProfile }); +export configManagerApi; ``` ## Building