'use strict';

var createAxios = require('../../utils/src/http/createAxios.js');
var resetAxiosBaseUrl = require('./resetAxiosBaseUrl.js');

const defaultFactory = (desc) => {
  const { __id__: _id, baseUrlEnvKey, serviceType, ...axiosCfg } = desc;
  const { service } = createAxios.createAxios(axiosCfg);
  resetAxiosBaseUrl.resetBaseURLInterceptorsRequest(service, { baseUrlEnvKey, serviceType });
  return service;
};
let factory = defaultFactory;
const setGiimeServiceFactory = (fn) => {
  factory = fn;
};
const resetGiimeServiceFactory = () => {
  factory = defaultFactory;
};
const createGiimeService = (desc) => factory(desc);

exports.createGiimeService = createGiimeService;
exports.resetGiimeServiceFactory = resetGiimeServiceFactory;
exports.setGiimeServiceFactory = setGiimeServiceFactory;
//# sourceMappingURL=createGiimeService.js.map
