Repository URL to install this package:
|
Version:
1.1.13 ▾
|
import 'isomorphic-fetch'
import { asyncWrap, defineFinal } from 'uxui-modules/chain-able'
import { axiosInstance } from './ENV'
export * from './ENV'
export * from './cookieConfig'
export * from './urlConfig'
// @todo Need to make domain name as configurable. List of absoluteUrl's which are not having common patterns have to be added here
export const absoluteUrlConfig = {
getKeyTokenUrl: `https://encrypt-stg.skavaone.com/apiadmin/remote/skavakeystore/getKeyForToken`,
getServiceToken: `https://encrypt-stg.skavaone.com/apiadmin/v1/token/create`,
}
// wrapper around axios for handling errors in a sane way
// without rejected promises that are hard to track
const GET = asyncWrap(axiosInstance.get)
const POST = asyncWrap(axiosInstance.post)
const AXIOSER = asyncWrap(axiosInstance)
const FETCHREQUEST = asyncWrap(axiosInstance.request)
defineFinal(GET, 'methodName', 'GET')
defineFinal(POST, 'methodName', 'POST')
defineFinal(AXIOSER, 'methodName', 'AXIOSER')
defineFinal(FETCHREQUEST, 'methodName', 'REQUEST')
export { GET, POST, AXIOSER, FETCHREQUEST }
export { asyncWrap }
export { axiosInstance as axios }
// fetch specific settings - unused currently because we are using axios
// these will be used for when we use webworkers
//
// getInit = {
// method: 'GET',
// mode: 'no-cors',
// }