Refactor Code to typescript

This commit is contained in:
Benjamin Toby
2025-01-10 20:10:28 +01:00
parent 549d0abc02
commit eb0992f28d
270 changed files with 3535 additions and 9062 deletions
-1258
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+9 -32
View File
@@ -171,15 +171,11 @@ export interface PackageUserLoginLocalBody {
skipPassword?: boolean;
}
type Request = IncomingMessage;
type Response = ServerResponse;
type ImageInputFileToBase64FunctionReturn = {
imageBase64: string;
imageBase64Full: string;
imageName: string;
imageSize: number;
export type ImageInputFileToBase64FunctionReturn = {
imageBase64?: string;
imageBase64Full?: string;
imageName?: string;
imageSize?: number;
};
export interface GetReqQueryObject {
@@ -189,8 +185,6 @@ export interface GetReqQueryObject {
tableName?: string;
}
export type SerializeQueryFnType = (query: any) => string;
export type DATASQUIREL_LoggedInUser = {
id: number;
uuid?: string;
@@ -1172,16 +1166,6 @@ export type ServerQueryParamsJoinMatchSourceTargetObject = {
fieldName: string;
};
export type SqlGeneratorFn = (Param0: {
genObject?: ServerQueryParam;
tableName: string;
}) =>
| {
string: string;
values: string[];
}
| undefined;
export type ApiConnectBody = {
url: string;
key: string;
@@ -1238,9 +1222,6 @@ export type APILoginFunctionReturn = {
csrf?: string;
cookieNames?: any;
};
export type APILoginFunction = (
params: APILoginFunctionParams
) => Promise<APILoginFunctionReturn>;
export type APICreateUserFunctionParams = {
encryptionKey?: string;
@@ -1264,10 +1245,6 @@ export type APIGetUserFunctionParams = {
useLocal?: boolean;
};
export type APIGetUserFunction = (
params: APIGetUserFunctionParams
) => Promise<GetUserFunctionReturn>;
/**
* API Google Login Function
*/
@@ -1445,7 +1422,7 @@ export type CookieObject = {
};
export type HttpRequestParams<
ReqObj extends { [key: string]: any } = { [key: string]: any }
ReqObj extends { [k: string]: any } = { [k: string]: any }
> = RequestOptions & {
scheme?: "http" | "https";
body?: ReqObj;
@@ -1454,12 +1431,12 @@ export type HttpRequestParams<
};
export type HttpRequestFunction<
ReqObj extends { [key: string]: any } = { [key: string]: any },
ResObj extends { [key: string]: any } = { [key: string]: any }
ReqObj extends { [k: string]: any } = { [k: string]: any },
ResObj extends { [k: string]: any } = { [k: string]: any }
> = (param: HttpRequestParams<ReqObj>) => Promise<HttpFunctionResponse<ResObj>>;
export type HttpFunctionResponse<
ResObj extends { [key: string]: any } = { [key: string]: any }
ResObj extends { [k: string]: any } = { [k: string]: any }
> = {
status: number;
data?: ResObj;