@sap-ux/ui5-proxy-middleware 1.4.21 → 1.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import type { ClientRequest, IncomingMessage, ServerResponse } from 'http';
2
2
  import type { ToolsLogger } from '@sap-ux/logger';
3
3
  import { type Manifest } from '@sap-ux/project-access';
4
4
  import type { RequestHandler, NextFunction, Request, Response } from 'express';
5
+ import type http from 'http';
5
6
  import type { ProxyConfig } from './types';
6
7
  import type { Url } from 'url';
7
8
  import type { ReaderCollection } from '@ui5/fs';
@@ -67,11 +68,14 @@ export declare const getYamlFile: (args: string[]) => string;
67
68
  export declare const getWebAppFolderFromYaml: (ui5YamlPath: string) => Promise<string>;
68
69
  /**
69
70
  * Sends HTML content as a response.
71
+ * Ensure compliance with common APIs in express and connect.
70
72
  *
71
73
  * @param res - The http response object
72
74
  * @param html - The HTML content
73
75
  */
74
- export declare const setHtmlResponse: (res: any, html: string) => void;
76
+ export declare const sendResponse: (res: (Response | http.ServerResponse) & {
77
+ _livereload?: boolean;
78
+ }, html: string) => void;
75
79
  /**
76
80
  * Determines which UI5 version to use when previewing the application.
77
81
  *
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterCompressedHtmlFiles = exports.injectScripts = exports.setHtmlResponse = exports.getWebAppFolderFromYaml = exports.getYamlFile = exports.getHtmlFile = exports.hideProxyCredentials = exports.getCorporateProxyServer = exports.proxyRequestHandler = exports.proxyResponseHandler = void 0;
3
+ exports.filterCompressedHtmlFiles = exports.injectScripts = exports.sendResponse = exports.getWebAppFolderFromYaml = exports.getYamlFile = exports.getHtmlFile = exports.hideProxyCredentials = exports.getCorporateProxyServer = exports.proxyRequestHandler = exports.proxyResponseHandler = void 0;
4
4
  exports.updateProxyEnv = updateProxyEnv;
5
5
  exports.resolveUI5Version = resolveUI5Version;
6
6
  exports.injectUI5Url = injectUI5Url;
@@ -164,11 +164,12 @@ const getWebAppFolderFromYaml = async (ui5YamlPath) => {
164
164
  exports.getWebAppFolderFromYaml = getWebAppFolderFromYaml;
165
165
  /**
166
166
  * Sends HTML content as a response.
167
+ * Ensure compliance with common APIs in express and connect.
167
168
  *
168
169
  * @param res - The http response object
169
170
  * @param html - The HTML content
170
171
  */
171
- const setHtmlResponse = (res, html) => {
172
+ const sendResponse = (res, html) => {
172
173
  if (res['_livereload']) {
173
174
  res.write(html);
174
175
  res.end();
@@ -181,7 +182,7 @@ const setHtmlResponse = (res, html) => {
181
182
  res.end();
182
183
  }
183
184
  };
184
- exports.setHtmlResponse = setHtmlResponse;
185
+ exports.sendResponse = sendResponse;
185
186
  /**
186
187
  * Determines which UI5 version to use when previewing the application.
187
188
  *
@@ -260,7 +261,7 @@ const injectScripts = async (req, res, next, ui5Configs, rootProject) => {
260
261
  else {
261
262
  const originalHtml = await files[0].getString();
262
263
  const html = injectUI5Url(originalHtml, ui5Configs);
263
- (0, exports.setHtmlResponse)(res, html);
264
+ (0, exports.sendResponse)(res, html);
264
265
  }
265
266
  }
266
267
  catch (error) {
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-proxy-middleware"
11
11
  },
12
- "version": "1.4.21",
12
+ "version": "1.4.22",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -26,8 +26,8 @@
26
26
  "https-proxy-agent": "5.0.1",
27
27
  "i18next": "20.6.1",
28
28
  "proxy-from-env": "1.1.0",
29
- "@sap-ux/logger": "0.6.0",
30
- "@sap-ux/ui5-config": "0.26.5"
29
+ "@sap-ux/ui5-config": "0.26.5",
30
+ "@sap-ux/logger": "0.6.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/express": "4.17.21",