rework to work with non forked version

This commit is contained in:
Darius
2026-02-03 21:55:10 +01:00
parent fd27cac031
commit 6859ba27b9
3 changed files with 301 additions and 696 deletions

View File

@@ -2,24 +2,24 @@ import { BaseClient } from "@dpu/shared";
import { printNetworkError } from "@dpu/shared/dist/logger.js";
export class TidalClient extends BaseClient {
async get<T>(endpoint: string): Promise<T> {
try {
const response = await this.getAxios().get<T>(`/${endpoint}`);
async get<T>(endpoint: string): Promise<T> {
try {
const response = await this.getAxios().get<T>(`/${endpoint}`);
return response.data;
} catch (error) {
printNetworkError(error);
throw error;
}
}
return response.data;
} catch (error) {
printNetworkError(error);
throw error;
}
}
async post<T>(endpoint: string, data: unknown): Promise<T> {
try {
const response = await this.getAxios().post<T>(`/${endpoint}`, data);
return response.data;
} catch (error) {
printNetworkError(error);
throw error;
}
}
async put<T>(endpoint: string, data: unknown): Promise<T> {
try {
const response = await this.getAxios().put<T>(`/${endpoint}`, data);
return response.data;
} catch (error) {
printNetworkError(error);
throw error;
}
}
}