import { getAuthHTTPClient } from "./index.js";
const sdkBaseQuery = ({ baseUrl } = {}) => async ({ url, method, data, params, headers }) => {
  try {
    const result = await getAuthHTTPClient({
      baseURL: baseUrl,
      headers
      // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
    }).request({ url, method, data, params });
    return { data: result.data };
  } catch (axiosError) {
    const err = axiosError;
    return {
      error: {
        status: err.response?.status,
        data: err.response?.data || err.message
      }
    };
  }
};
export {
  sdkBaseQuery
};
