@debugg-ai/debugg-ai-mcp
Version:
Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.
32 lines (31 loc) • 1.17 kB
JavaScript
import { objToCamelCase, objToSnakeCase } from "./objectNaming.js";
import { destroy as destroyAxios, get as getAxios, post as postAxios, put as putAxios } from "./axios.js";
export async function get(url, params) {
const fmtdParams = objToSnakeCase(params);
return getAxios(url, fmtdParams).then((response) => {
console.error("response", response);
const fmtdData = objToCamelCase(response.data);
response.data = fmtdData;
return response;
});
}
export async function post(url, data, config) {
const fmtdData = objToSnakeCase(data);
return postAxios(url, fmtdData, config).then((response) => {
response.data = objToCamelCase(response.data);
return response;
});
}
export async function put(url, data, config) {
const fmtdData = objToSnakeCase(data);
return putAxios(url, fmtdData, config).then((response) => {
response.data = objToCamelCase(response.data);
return response;
});
}
export async function destroy(url, config) {
return destroyAxios(url, config).then((response) => {
response.data = objToCamelCase(response.data);
return response;
});
}