From 549d0abc0213f91f4362a4ab4d90086264f2bf12 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Thu, 9 Jan 2025 14:35:19 +0100 Subject: [PATCH] Updates --- package-shared/functions/backend/httpRequest.d.ts | 8 ++++++-- package-shared/functions/backend/httpRequest.js | 8 ++++++-- package-shared/types/index.d.ts | 3 ++- package-shared/types/index.ts | 3 ++- package.json | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/package-shared/functions/backend/httpRequest.d.ts b/package-shared/functions/backend/httpRequest.d.ts index 61414c7..fca4e0f 100644 --- a/package-shared/functions/backend/httpRequest.d.ts +++ b/package-shared/functions/backend/httpRequest.d.ts @@ -1,2 +1,6 @@ -declare const _exports: import("../../types").HttpRequestFunctionType; -export = _exports; +export = httpRequest; +/** + * # Generate a http Request + * @type {import("../../types").HttpRequestFunction} + */ +declare const httpRequest: import("../../types").HttpRequestFunction; diff --git a/package-shared/functions/backend/httpRequest.js b/package-shared/functions/backend/httpRequest.js index d8d8c41..bf22ad9 100644 --- a/package-shared/functions/backend/httpRequest.js +++ b/package-shared/functions/backend/httpRequest.js @@ -8,9 +8,9 @@ const _ = require("lodash"); /** * # Generate a http Request - * @type {import("../../types").HttpRequestFunctionType} + * @type {import("../../types").HttpRequestFunction} */ -module.exports = function httpRequest(params) { +const httpRequest = (params) => { return new Promise((resolve, reject) => { const isUrlEncodedFormBody = params.urlEncodedFormBody; @@ -81,6 +81,7 @@ module.exports = function httpRequest(params) { status: response.statusCode || 404, data, str, + requestedPath: finalPath, }); }); @@ -89,6 +90,7 @@ module.exports = function httpRequest(params) { status: response.statusCode || 404, str, error: err.message, + requestedPath: finalPath, }); }); } @@ -105,3 +107,5 @@ module.exports = function httpRequest(params) { httpsRequest.end(); }); }; + +module.exports = httpRequest; diff --git a/package-shared/types/index.d.ts b/package-shared/types/index.d.ts index 0cc65bb..2821b5d 100644 --- a/package-shared/types/index.d.ts +++ b/package-shared/types/index.d.ts @@ -1235,7 +1235,7 @@ export type HttpRequestParams = (param: HttpRequestParams) => Promise>; @@ -1465,4 +1465,5 @@ export type HttpFunctionResponse< data?: ResObj; error?: string; str?: string; + requestedPath?: string; }; diff --git a/package.json b/package.json index fda12cc..ec23f12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "3.3.7", + "version": "3.3.8", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {