diff --git a/package-shared/types/index.d.ts b/package-shared/types/index.d.ts index 26a4ba1..bf4519e 100644 --- a/package-shared/types/index.d.ts +++ b/package-shared/types/index.d.ts @@ -1225,22 +1225,24 @@ export type CookieObject = { sameSite?: "Strict" | "Lax" | "None"; priority?: "Low" | "Medium" | "High"; }; -export type HttpRequestParams = RequestOptions & { +export type HttpRequestParams = RequestOptions & { scheme?: "http" | "https"; - body?: { - [key: string]: any; - }; - query?: { - [key: string]: any; - }; + body?: ReqObj; + query?: ReqObj; urlEncodedFormBody?: boolean; }; -export type HttpRequestFunctionType = (param: HttpRequestParams) => Promise; -export type HttpFunctionResponse = { +export type HttpRequestFunctionType = (param: HttpRequestParams) => Promise>; +export type HttpFunctionResponse = { status: number; - data?: { - [key: string]: any; - }; + data?: ResObj; error?: string; str?: string; }; diff --git a/package-shared/types/index.ts b/package-shared/types/index.ts index 050a880..417da19 100644 --- a/package-shared/types/index.ts +++ b/package-shared/types/index.ts @@ -1444,20 +1444,21 @@ export type CookieObject = { priority?: "Low" | "Medium" | "High"; }; -export type HttpRequestParams = RequestOptions & { +export type HttpRequestParams = RequestOptions & { scheme?: "http" | "https"; - body?: { [key: string]: any }; - query?: { [key: string]: any }; + body?: ReqObj; + query?: ReqObj; urlEncodedFormBody?: boolean; }; -export type HttpRequestFunctionType = ( - param: HttpRequestParams -) => Promise; +export type HttpRequestFunctionType< + ReqObj extends { [key: string]: any } = { [key: string]: any }, + ResObj extends { [key: string]: any } = { [key: string]: any } +> = (param: HttpRequestParams) => Promise>; -export type HttpFunctionResponse = { +export type HttpFunctionResponse = { status: number; - data?: { [key: string]: any }; + data?: ResObj; error?: string; str?: string; }; diff --git a/package.json b/package.json index 6ec020a..f4adc0c 100644 --- a/package.json +++ b/package.json @@ -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": {