diff --git a/package-shared/functions/backend/httpRequest.js b/package-shared/functions/backend/httpRequest.js index cdaea51..6827570 100644 --- a/package-shared/functions/backend/httpRequest.js +++ b/package-shared/functions/backend/httpRequest.js @@ -8,8 +8,7 @@ import _ from "lodash"; /** * # Generate a http Request - * @param {import("../../types").HttpRequestParams} params * - * @returns { Promise | string | null> } + * @type {import("../../types").HttpRequestFunctionType} */ async function httpRequest(params) { return new Promise((resolve, reject) => { diff --git a/package-shared/types/index.d.ts b/package-shared/types/index.d.ts index 408ec0d..201fa8c 100644 --- a/package-shared/types/index.d.ts +++ b/package-shared/types/index.d.ts @@ -1235,4 +1235,7 @@ export type HttpRequestParams = RequestOptions & { }; urlEncodedFormBody?: boolean; }; +export type HttpRequestFunctionType = (param: HttpRequestParams) => Promise<{ + [key: string]: any; +} | string | null>; export {}; diff --git a/package-shared/types/index.ts b/package-shared/types/index.ts index 18936fc..f60df71 100644 --- a/package-shared/types/index.ts +++ b/package-shared/types/index.ts @@ -1450,3 +1450,7 @@ export type HttpRequestParams = RequestOptions & { query?: { [key: string]: any }; urlEncodedFormBody?: boolean; }; + +export type HttpRequestFunctionType = ( + param: HttpRequestParams +) => Promise<{ [key: string]: any } | string | null>; diff --git a/package.json b/package.json index a9e1034..f9abc09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "3.3.2", + "version": "3.3.3", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {