Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/graphql / src / bootstrapper / api / config.ts
Size: Mime:
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',
// }