@sap-ux/backend-proxy-middleware 0.8.11 → 0.8.12

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateProxyEnv = void 0;
3
+ exports.updateProxyEnv = updateProxyEnv;
4
4
  /**
5
5
  * Updates the proxy configuration with values from runtime args (highest priority), given config value or environment variables.
6
6
  *
@@ -30,5 +30,4 @@ function updateProxyEnv(proxyFromConfig) {
30
30
  }
31
31
  }
32
32
  }
33
- exports.updateProxyEnv = updateProxyEnv;
34
33
  //# sourceMappingURL=config.js.map
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
1
  import type { ServerOptions } from 'http-proxy';
4
2
  import type { RequestHandler, Options } from 'http-proxy-middleware';
5
3
  import type { ClientRequest, IncomingMessage, ServerResponse } from 'http';
@@ -3,7 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createProxy = exports.generateProxyMiddlewareOptions = exports.enhanceConfigForSystem = exports.enhanceConfigsForDestination = exports.initI18n = exports.PathRewriters = exports.proxyErrorHandler = exports.ProxyEventHandlers = void 0;
6
+ exports.PathRewriters = exports.ProxyEventHandlers = void 0;
7
+ exports.proxyErrorHandler = proxyErrorHandler;
8
+ exports.initI18n = initI18n;
9
+ exports.enhanceConfigsForDestination = enhanceConfigsForDestination;
10
+ exports.enhanceConfigForSystem = enhanceConfigForSystem;
11
+ exports.generateProxyMiddlewareOptions = generateProxyMiddlewareOptions;
12
+ exports.createProxy = createProxy;
7
13
  const https_proxy_agent_1 = require("https-proxy-agent");
8
14
  const http_proxy_middleware_1 = require("http-proxy-middleware");
9
15
  const i18next_1 = __importDefault(require("i18next"));
@@ -78,7 +84,6 @@ function proxyErrorHandler(err, req, logger, _res, _target) {
78
84
  logger.debug(i18next_1.default.t('error.noCodeError', { error: JSON.stringify(err, null, 2), request: req.originalUrl }));
79
85
  }
80
86
  }
81
- exports.proxyErrorHandler = proxyErrorHandler;
82
87
  /**
83
88
  * Return the SAP API Hub key either provided as environment variable (including .env file) or from the secure store when not running in AppStudio.
84
89
  * not found or error while extracting the key.
@@ -183,7 +188,6 @@ async function initI18n() {
183
188
  ns: [ns]
184
189
  });
185
190
  }
186
- exports.initI18n = initI18n;
187
191
  /**
188
192
  * Enhance the proxy options and backend configurations for the usage of destinations in SAP Business Application Studio.
189
193
  *
@@ -210,7 +214,6 @@ async function enhanceConfigsForDestination(proxyOptions, backend) {
210
214
  }
211
215
  }
212
216
  }
213
- exports.enhanceConfigsForDestination = enhanceConfigsForDestination;
214
217
  /**
215
218
  * Enhance the proxy options with information read from the store.
216
219
  *
@@ -251,7 +254,6 @@ async function enhanceConfigForSystem(proxyOptions, system, oAuthRequired, token
251
254
  proxyOptions.auth = `${system.username}:${system.password}`;
252
255
  }
253
256
  }
254
- exports.enhanceConfigForSystem = enhanceConfigForSystem;
255
257
  /**
256
258
  * Generate options for the proxy middleware based on the input.
257
259
  *
@@ -337,7 +339,6 @@ async function generateProxyMiddlewareOptions(backend, options = {}, logger = ne
337
339
  logger.info(`Backend proxy created for ${proxyOptions.target} ${backend.path ? backend.path : ''}`);
338
340
  return proxyOptions;
339
341
  }
340
- exports.generateProxyMiddlewareOptions = generateProxyMiddlewareOptions;
341
342
  /**
342
343
  * Generate an instance of the proxy middleware based on the input.
343
344
  *
@@ -349,5 +350,4 @@ exports.generateProxyMiddlewareOptions = generateProxyMiddlewareOptions;
349
350
  async function createProxy(backend, options, logger) {
350
351
  return (0, http_proxy_middleware_1.createProxyMiddleware)(await generateProxyMiddlewareOptions(backend, options, logger));
351
352
  }
352
- exports.createProxy = createProxy;
353
353
  //# sourceMappingURL=proxy.js.map
package/dist/ext/bsp.js CHANGED
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.addOptionsForEmbeddedBSP = exports.promptUserPass = exports.convertAppDescriptorToManifest = void 0;
6
+ exports.convertAppDescriptorToManifest = convertAppDescriptorToManifest;
7
+ exports.promptUserPass = promptUserPass;
8
+ exports.addOptionsForEmbeddedBSP = addOptionsForEmbeddedBSP;
7
9
  const chalk_1 = require("chalk");
8
10
  const i18next_1 = __importDefault(require("i18next"));
9
11
  const prompts_1 = __importDefault(require("prompts"));
@@ -18,7 +20,6 @@ function convertAppDescriptorToManifest(bsp) {
18
20
  const regex = new RegExp('(' + bsp + '/manifest\\.appdescr\\b)');
19
21
  return (path) => (path.match(regex) ? '/manifest.json' : path);
20
22
  }
21
- exports.convertAppDescriptorToManifest = convertAppDescriptorToManifest;
22
23
  /**
23
24
  * Prompts the user for credentials.
24
25
  *
@@ -76,7 +77,6 @@ async function promptUserPass(log) {
76
77
  });
77
78
  return `${username}:${password}`;
78
79
  }
79
- exports.promptUserPass = promptUserPass;
80
80
  /**
81
81
  * Add additional options required for the special use case embedded FLP.
82
82
  *
@@ -107,5 +107,4 @@ async function addOptionsForEmbeddedBSP(bspPath, proxyOptions, logger) {
107
107
  proxyOptions.auth = await promptUserPass(logger);
108
108
  }
109
109
  }
110
- exports.addOptionsForEmbeddedBSP = addOptionsForEmbeddedBSP;
111
110
  //# sourceMappingURL=bsp.js.map
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%3Abackend-proxy-middleware"
11
11
  },
12
- "version": "0.8.11",
12
+ "version": "0.8.12",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "@sap-ux/axios-extension": "1.16.6",
32
32
  "@sap-ux/btp-utils": "0.15.2",
33
33
  "@sap-ux/logger": "0.6.0",
34
- "@sap-ux/store": "0.9.1"
34
+ "@sap-ux/store": "0.9.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/express": "4.17.21",
@@ -39,7 +39,7 @@
39
39
  "@types/prompts": "2.4.4",
40
40
  "@types/proxy-from-env": "1.0.1",
41
41
  "@types/supertest": "2.0.12",
42
- "express": "4.19.2",
42
+ "express": "4.21.0",
43
43
  "nock": "13.4.0",
44
44
  "supertest": "6.3.3",
45
45
  "yaml": "2.2.2"