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";
priority?: "Low" | "Medium" | "High";
};
export type HttpRequestParams = RequestOptions & {
export type HttpRequestParams<ReqObj> = RequestOptions & {
scheme?: "http" | "https";
body?: {
[key: string]: any;
};
query?: {
[key: string]: any;
};
body?: ReqObj;
query?: ReqObj;
urlEncodedFormBody?: boolean;
};
export type HttpRequestFunctionType = (param: HttpRequestParams) => Promise<HttpFunctionResponse>;
export type HttpFunctionResponse = {
status: number;
data?: {
export type HttpRequestFunctionType<ReqObj extends {
[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;
str?: string;
};

View File

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

View File

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