angles-javascript-client
Version:
This is the javascript client for the Angles Dashboard. It allows you to store your test results.
57 lines • 1.64 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseRequests = void 0;
class BaseRequests {
constructor(axiosInstance) {
this.axios = axiosInstance;
}
success(response) {
return response.data;
}
post(url, body, config) {
return new Promise((resolve, reject) => {
this.axios.post(url, body, config)
.then((response) => {
resolve(this.success(response));
})
.catch((error) => {
reject(error);
});
});
}
get(url, config) {
return new Promise((resolve, reject) => {
this.axios.get(url, config)
.then((response) => {
resolve(this.success(response));
})
.catch((error) => {
reject(error);
});
});
}
put(url, body, config) {
return new Promise((resolve, reject) => {
this.axios.put(url, body, config)
.then((response) => {
resolve(this.success(response));
})
.catch((error) => {
reject(error);
});
});
}
delete(url, config) {
return new Promise((resolve, reject) => {
this.axios.delete(url, config)
.then((response) => {
resolve(this.success(response));
})
.catch((error) => {
reject(error);
});
});
}
}
exports.BaseRequests = BaseRequests;
//# sourceMappingURL=BaseRequests.js.map