@sap-ux/nodejs-utils 0.1.9 → 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.
- package/dist/httpsUtils.d.ts +7 -0
- package/dist/httpsUtils.js +23 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +3 -3
|
@@ -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
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.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Nodejs utility wrappers",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"fast-glob": "3.3.1",
|
|
18
18
|
"read-pkg-up": "7.0.1",
|
|
19
19
|
"semver": "7.5.4",
|
|
20
|
-
"@sap-ux/btp-utils": "1.0
|
|
20
|
+
"@sap-ux/btp-utils": "1.1.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/semver": "7.5.2",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"!dist/**/*.map"
|
|
32
32
|
],
|
|
33
33
|
"engines": {
|
|
34
|
-
"node": ">=
|
|
34
|
+
"node": ">=20.x"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsc --build",
|