@sap/cli-core 2023.12.0 → 2023.14.0
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/cache/utils.js +2 -1
- package/commands/handler/authentication/technicalJWT/exec.d.ts +1 -1
- package/constants.js +1 -1
- package/package.json +3 -3
- package/types.js +1 -1
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +5 -1
package/cache/utils.js
CHANGED
|
@@ -7,10 +7,11 @@ exports.getPath = void 0;
|
|
|
7
7
|
const os_1 = require("os");
|
|
8
8
|
const path_1 = __importDefault(require("path"));
|
|
9
9
|
const core_1 = require("../config/core");
|
|
10
|
+
const utils_1 = require("../utils/utils");
|
|
10
11
|
const getPath = (...args) => {
|
|
11
12
|
const rootPath = process.env.CLI_LEGACY_CACHE_LOCATION === "true"
|
|
12
13
|
? __dirname
|
|
13
|
-
: path_1.default.join((0, os_1.homedir)(), ".@sap", (0, core_1.
|
|
14
|
+
: path_1.default.join((0, os_1.homedir)(), ".@sap", (0, utils_1.removeScopeFromPackageName)((0, core_1.getPackageName)()));
|
|
14
15
|
return path_1.default.join(rootPath, ".cache", ...args);
|
|
15
16
|
};
|
|
16
17
|
exports.getPath = getPath;
|
package/constants.js
CHANGED
|
@@ -12,7 +12,7 @@ var AuthenticationMethod;
|
|
|
12
12
|
(function (AuthenticationMethod) {
|
|
13
13
|
AuthenticationMethod["oauth"] = "oauth";
|
|
14
14
|
AuthenticationMethod["passcode"] = "passcode";
|
|
15
|
-
})(AuthenticationMethod
|
|
15
|
+
})(AuthenticationMethod || (exports.AuthenticationMethod = AuthenticationMethod = {}));
|
|
16
16
|
exports.CLI_NAME = "cli-name";
|
|
17
17
|
exports.CLI_PACKAGE_NAME = "cli-package-name";
|
|
18
18
|
exports.CLI_DESCRIPTION = "cli-description";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/cli-core",
|
|
3
|
-
"version": "2023.
|
|
3
|
+
"version": "2023.14.0",
|
|
4
4
|
"description": "Command-Line Interface (CLI) Core Module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "SAP SE",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"axios": "1.4.0",
|
|
21
21
|
"commander": "10.0.1",
|
|
22
22
|
"config": "3.3.9",
|
|
23
|
-
"dotenv": "16.
|
|
23
|
+
"dotenv": "16.1.3",
|
|
24
24
|
"fs-extra": "11.1.1",
|
|
25
25
|
"https": "1.0.0",
|
|
26
26
|
"lodash": "4.17.21",
|
|
27
27
|
"open": "8.4.2",
|
|
28
28
|
"path": "0.12.7",
|
|
29
29
|
"prompts": "2.4.2",
|
|
30
|
-
"qs": "6.11.
|
|
30
|
+
"qs": "6.11.2"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/types.js
CHANGED
|
@@ -9,7 +9,7 @@ var LogLevel;
|
|
|
9
9
|
LogLevel[LogLevel["INFO"] = 4] = "INFO";
|
|
10
10
|
LogLevel[LogLevel["DEBUG"] = 5] = "DEBUG";
|
|
11
11
|
LogLevel[LogLevel["TRACE"] = 6] = "TRACE";
|
|
12
|
-
})(LogLevel
|
|
12
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
13
13
|
/* jscpd:ignore-start */
|
|
14
14
|
exports.CHARACTERS = [
|
|
15
15
|
"a",
|
package/utils/utils.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare const getName: (cwd?: string) => string;
|
|
|
10
10
|
export declare const getPackageName: (cwd?: string) => string;
|
|
11
11
|
export declare const getDescription: (cwd?: string) => string;
|
|
12
12
|
export declare const getBin: (cwd?: string) => string;
|
|
13
|
+
export declare const removeScopeFromPackageName: (packageName: string) => string;
|
|
13
14
|
export declare const parseTenant: (tenant: string) => string;
|
|
14
15
|
export declare const getInfoFromTenant: (tenant: string, verbose: boolean, printOutput?: boolean) => {
|
|
15
16
|
host: string;
|
package/utils/utils.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.openUrlInBrowser = exports.toConstantCase = exports.sha256 = exports.getInfoFromTenant = exports.parseTenant = exports.getBin = exports.getDescription = exports.getPackageName = exports.getName = exports.getVersion = exports.readPackageJson = exports.requireFile = exports.parseVersion = void 0;
|
|
29
|
+
exports.openUrlInBrowser = exports.toConstantCase = exports.sha256 = exports.getInfoFromTenant = exports.parseTenant = exports.removeScopeFromPackageName = exports.getBin = exports.getDescription = exports.getPackageName = exports.getName = exports.getVersion = exports.readPackageJson = exports.requireFile = exports.parseVersion = void 0;
|
|
30
30
|
const crypto = __importStar(require("crypto"));
|
|
31
31
|
const path_1 = __importDefault(require("path"));
|
|
32
32
|
const lodash_1 = require("lodash");
|
|
@@ -94,6 +94,10 @@ const getBin = (cwd = "") => {
|
|
|
94
94
|
return keys[0];
|
|
95
95
|
};
|
|
96
96
|
exports.getBin = getBin;
|
|
97
|
+
const removeScopeFromPackageName = (packageName) =>
|
|
98
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
99
|
+
packageName.split("/").pop();
|
|
100
|
+
exports.removeScopeFromPackageName = removeScopeFromPackageName;
|
|
97
101
|
const removeProtocol = (tenant) => tenant.replace(REGEX_HTTPS, "");
|
|
98
102
|
const parseTenant = (tenant) => {
|
|
99
103
|
const t = REGEX_HTTPS.test(tenant) ? tenant : `https://${tenant}`;
|