Compare commits

..

5 Commits

Author SHA1 Message Date
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
10 changed files with 39 additions and 13 deletions

11
dist/fastify.d.ts vendored
View File

@@ -1,15 +1,20 @@
import { AxiosInstance } from "axios";
import type { AxiosInstance } from "axios";
export type ServiceResult<T = unknown> = {
result: T;
successful: boolean;
};
export declare abstract class Client {
export type API_Error = {
error: string;
};
export declare abstract class BaseClient {
private axiosInstance;
constructor(axiosInstance: AxiosInstance);
getAxios(): AxiosInstance;
}
export declare abstract class Service<T> {
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>;
}

View File

@@ -1 +1 @@
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,OAAO,IAAI;IACvC,MAAM,EAAE,CAAC,CAAC;IACV,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,8BAAsB,MAAM;IAC1B,OAAO,CAAC,aAAa,CAAgB;gBAEzB,aAAa,EAAE,aAAa;CAGzC;AAED,8BAAsB,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,MAAM,CAAI;gBAEN,MAAM,EAAE,CAAC;IAIrB,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"}
{"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"}

10
dist/fastify.js vendored
View File

@@ -1,14 +1,20 @@
export class Client {
export class BaseClient {
axiosInstance;
constructor(axiosInstance) {
this.axiosInstance = axiosInstance;
}
getAxios() {
return this.axiosInstance;
}
export class Service {
}
export class BaseService {
client;
constructor(client) {
this.client = client;
}
getClient() {
return this.client;
}
getSuccessfulResult(result) {
return {
result,

1
dist/index.d.ts vendored
View File

@@ -1,3 +1,4 @@
export * from "./fastify";
export * from "./homeassistant";
export * as Logger from "./logger";
export * from "./tidal";

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,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}

1
dist/index.js vendored
View File

@@ -1,3 +1,4 @@
export * from "./fastify";
export * from "./homeassistant";
export * as Logger from "./logger";
export * from "./tidal";

4
package-lock.json generated
View File

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

View File

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

View File

@@ -1,25 +1,37 @@
import { AxiosInstance } from "axios";
import type { AxiosInstance } from "axios";
export type ServiceResult<T = unknown> = {
result: T;
successful: boolean;
};
export abstract class Client {
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 Service<T> {
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,

View File

@@ -1,3 +1,4 @@
export * from "./fastify";
export * from "./homeassistant";
export * as Logger from "./logger";
export * from "./tidal";