@sap-ux/nodejs-utils 0.2.0 → 0.2.1

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.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Set the rejectUnauthorized option of the global https agent.
3
+ *
4
+ * @param rejectUnauthorized - true to reject unauthorized certificates, false to accept them
5
+ */
6
+ export declare function setGlobalRejectUnauthorized(rejectUnauthorized: boolean): void;
7
+ //# sourceMappingURL=httpsUtils.d.ts.map
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.setGlobalRejectUnauthorized = setGlobalRejectUnauthorized;
7
+ const https_1 = __importDefault(require("https"));
8
+ /**
9
+ * Set the rejectUnauthorized option of the global https agent.
10
+ *
11
+ * @param rejectUnauthorized - true to reject unauthorized certificates, false to accept them
12
+ */
13
+ function setGlobalRejectUnauthorized(rejectUnauthorized) {
14
+ if (https_1.default.globalAgent.options) {
15
+ https_1.default.globalAgent.options.rejectUnauthorized = rejectUnauthorized;
16
+ }
17
+ //@ts-expect-error - fallbackAgent is only present in BoundHttpsProxyAgent implementation and is not part of the Node.js API
18
+ if (https_1.default.globalAgent.fallbackAgent?.options) {
19
+ //@ts-expect-error - fallbackAgent is not typed in Node.js API
20
+ https_1.default.globalAgent.fallbackAgent.options.rejectUnauthorized = rejectUnauthorized;
21
+ }
22
+ }
23
+ //# sourceMappingURL=httpsUtils.js.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './commandRunner';
2
2
  export * from './installedCheck';
3
+ export * from './httpsUtils';
3
4
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./commandRunner"), exports);
18
18
  __exportStar(require("./installedCheck"), exports);
19
+ __exportStar(require("./httpsUtils"), exports);
19
20
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/nodejs-utils",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Nodejs utility wrappers",
5
5
  "repository": {
6
6
  "type": "git",