This commit is contained in:
Benjamin Toby 2025-01-09 10:40:10 +01:00
parent 4bda9149c6
commit 0e49418bc4
3 changed files with 24 additions and 21 deletions

View File

@ -1225,22 +1225,24 @@ export type CookieObject = {
sameSite?: "Strict" | "Lax" | "None"; sameSite?: "Strict" | "Lax" | "None";
priority?: "Low" | "Medium" | "High"; priority?: "Low" | "Medium" | "High";
}; };
export type HttpRequestParams = RequestOptions & { export type HttpRequestParams<ReqObj> = RequestOptions & {
scheme?: "http" | "https"; scheme?: "http" | "https";
body?: { body?: ReqObj;
[key: string]: any; query?: ReqObj;
};
query?: {
[key: string]: any;
};
urlEncodedFormBody?: boolean; urlEncodedFormBody?: boolean;
}; };
export type HttpRequestFunctionType = (param: HttpRequestParams) => Promise<HttpFunctionResponse>; export type HttpRequestFunctionType<ReqObj extends {
export type HttpFunctionResponse = {
status: number;
data?: {
[key: string]: any; [key: string]: any;
}; } = {
[key: string]: any;
}, ResObj extends {
[key: string]: any;
} = {
[key: string]: any;
}> = (param: HttpRequestParams<ReqObj>) => Promise<HttpFunctionResponse<ResObj>>;
export type HttpFunctionResponse<ResObj> = {
status: number;
data?: ResObj;
error?: string; error?: string;
str?: string; str?: string;
}; };

View File

@ -1444,20 +1444,21 @@ export type CookieObject = {
priority?: "Low" | "Medium" | "High"; priority?: "Low" | "Medium" | "High";
}; };
export type HttpRequestParams = RequestOptions & { export type HttpRequestParams<ReqObj> = RequestOptions & {
scheme?: "http" | "https"; scheme?: "http" | "https";
body?: { [key: string]: any }; body?: ReqObj;
query?: { [key: string]: any }; query?: ReqObj;
urlEncodedFormBody?: boolean; urlEncodedFormBody?: boolean;
}; };
export type HttpRequestFunctionType = ( export type HttpRequestFunctionType<
param: HttpRequestParams ReqObj extends { [key: string]: any } = { [key: string]: any },
) => Promise<HttpFunctionResponse>; ResObj extends { [key: string]: any } = { [key: string]: any }
> = (param: HttpRequestParams<ReqObj>) => Promise<HttpFunctionResponse<ResObj>>;
export type HttpFunctionResponse = { export type HttpFunctionResponse<ResObj> = {
status: number; status: number;
data?: { [key: string]: any }; data?: ResObj;
error?: string; error?: string;
str?: string; str?: string;
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "@moduletrace/datasquirel", "name": "@moduletrace/datasquirel",
"version": "3.3.5", "version": "3.3.6",
"description": "Cloud-based SQL data management tool", "description": "Cloud-based SQL data management tool",
"main": "index.js", "main": "index.js",
"bin": { "bin": {