Compare commits

...

11 Commits

Author SHA1 Message Date
Darius
c3f0fd84ac 1.2.1 2025-11-21 17:19:56 +01:00
Darius
64eb6fbf4e Generic Commit; Most likely a fix or small feature 2025-11-21 17:19:50 +01:00
Darius
50c951e0d3 1.2.0 2025-11-21 17:13:31 +01:00
Darius
6086c6dbcc Generic Commit; Most likely a fix or small feature 2025-11-21 17:13:20 +01:00
Darius
30b5c74c06 1.1.5 2025-11-21 17:11:18 +01:00
Darius
a835f220e2 Generic Commit; Most likely a fix or small feature 2025-11-21 17:11:14 +01:00
Darius
a35a3e7ecb 1.1.4 2025-11-21 16:24:14 +01:00
Darius
9b61909eab Generic Commit; Most likely a fix or small feature 2025-11-21 16:24:10 +01:00
Darius
a3689f4cd2 Generic Commit; Most likely a fix or small feature 2025-11-21 16:24:04 +01:00
Darius
bf7f3ee77c 1.1.3 2025-11-21 16:22:20 +01:00
Darius
d0e9f28c8c Generic Commit; Most likely a fix or small feature 2025-11-21 16:22:14 +01:00
10 changed files with 112 additions and 20 deletions

18
dist/fastify.d.ts vendored
View File

@@ -1,5 +1,21 @@
import type { AxiosInstance } from "axios";
export type ServiceResult<T = unknown> = {
result: T;
succesful: boolean;
successful: boolean;
};
export type API_Error = {
error: string;
};
export declare abstract class BaseClient {
private axiosInstance;
constructor(axiosInstance: AxiosInstance);
getAxios(): AxiosInstance;
}
export declare abstract class BaseService<T> {
private client;
constructor(client: T);
getClient(): T;
getSuccessfulResult<R = unknown>(result: R): ServiceResult<R>;
getErrorResult(error: string): ServiceResult<string>;
}
//# sourceMappingURL=fastify.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,IAAI;IACvC,MAAM,EAAE,CAAC,CAAC;IACV,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC"}
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,IAAI;IACvC,MAAM,EAAE,CAAC,CAAC;IACV,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,8BAAsB,UAAU;IAC9B,OAAO,CAAC,aAAa,CAAgB;gBAEzB,aAAa,EAAE,aAAa;IAIxC,QAAQ,IAAI,aAAa;CAG1B;AAED,8BAAsB,WAAW,CAAC,CAAC;IACjC,OAAO,CAAC,MAAM,CAAI;gBAEN,MAAM,EAAE,CAAC;IAIrB,SAAS,IAAI,CAAC;IAId,mBAAmB,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;IAO7D,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;CAMrD"}

31
dist/fastify.js vendored
View File

@@ -1 +1,30 @@
export {};
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) {
return {
result: error,
successful: false,
};
}
}

9
dist/index.d.ts vendored
View File

@@ -1,5 +1,6 @@
export * from "./homeassistant";
export * as Logger from "./logger";
export * from "./tidal";
export * as TimeHelper from "./timehelper";
export * from "./fastify.js";
export * from "./homeassistant.js";
export * from "./logger.js";
export * from "./tidal.js";
export * from "./timehelper.js";
//# sourceMappingURL=index.d.ts.map

2
dist/index.d.ts.map vendored
View File

@@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC"}

9
dist/index.js vendored
View File

@@ -1,4 +1,5 @@
export * from "./homeassistant";
export * as Logger from "./logger";
export * from "./tidal";
export * as TimeHelper from "./timehelper";
export * from "./fastify.js";
export * from "./homeassistant.js";
export * from "./logger.js";
export * from "./tidal.js";
export * from "./timehelper.js";

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@dpu/shared",
"version": "1.1.2",
"version": "1.2.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@dpu/shared",
"version": "1.1.2",
"version": "1.2.1",
"dependencies": {
"axios": "^1.7.9",
"chalk": "^5.6.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@dpu/shared",
"version": "1.1.2",
"version": "1.2.1",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -1,4 +1,48 @@
import type { AxiosInstance } from "axios";
export type ServiceResult<T = unknown> = {
result: T;
succesful: boolean;
successful: boolean;
};
export type API_Error = {
error: string;
};
export abstract class BaseClient {
private axiosInstance: AxiosInstance;
constructor(axiosInstance: AxiosInstance) {
this.axiosInstance = axiosInstance;
}
getAxios(): AxiosInstance {
return this.axiosInstance;
}
}
export abstract class BaseService<T> {
private client: T;
constructor(client: T) {
this.client = client;
}
getClient(): T {
return this.client;
}
getSuccessfulResult<R = unknown>(result: R): ServiceResult<R> {
return {
result,
successful: true,
};
}
getErrorResult(error: string): ServiceResult<string> {
return {
result: error,
successful: false,
};
}
}

View File

@@ -1,4 +1,5 @@
export * from "./homeassistant";
export * as Logger from "./logger";
export * from "./tidal";
export * as TimeHelper from "./timehelper";
export * from "./fastify.js";
export * from "./homeassistant.js";
export * from "./logger.js";
export * from "./tidal.js";
export * from "./timehelper.js";