Files
dpu-shared/dist/fastify.js
2026-02-06 21:35:25 +01:00

39 lines
747 B
JavaScript

import { logWarning } from "./logger.js";
export class API_Error {
error;
constructor(error) {
this.error = error;
}
}
export class BaseClient {
axiosInstance;
constructor(axiosInstance) {
this.axiosInstance = axiosInstance;
}
getAxios() {
return this.axiosInstance;
}
}
export class BaseService {
client;
constructor(client) {
this.client = client;
}
getClient() {
return this.client;
}
getSuccessfulResult(result) {
return {
result,
successful: true,
};
}
getErrorResult(error) {
logWarning(error);
return {
result: error,
successful: false,
};
}
}