import { createAxios } from '../../utils/src/http/createAxios.mjs';
import { resetBaseURLInterceptorsRequest } from './resetAxiosBaseUrl.mjs';

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

export { createGiimeService, resetGiimeServiceFactory, setGiimeServiceFactory };
//# sourceMappingURL=createGiimeService.mjs.map
