@sap/cli-core 2026.2.1 → 2026.4.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/secrets/SecretsStorageImpl.js +0 -1
- package/cache/secrets/utils.js +0 -2
- package/commands/config.command/cache.command/init.command/utils.js +0 -2
- package/commands/handler/authentication/oauth/tokenProvider/utils.js +1 -0
- package/commands/handler/fetch/utils.js +0 -3
- package/commands/login.command.js +2 -2
- package/commands/openAPI.command/index.js +0 -1
- package/commands/openAPI.command/utils.js +0 -2
- package/config/index.js +5 -6
- package/dwc/dwc.js +0 -1
- package/logger/index.js +1 -3
- package/module.js +0 -1
- package/package.json +7 -8
- package/utils/commands.js +2 -1
- package/utils/openUtils.js +11 -10
- package/utils/utils.js +1 -2
package/cache/secrets/utils.js
CHANGED
|
@@ -46,9 +46,7 @@ export async function updateUrls(secret) {
|
|
|
46
46
|
if (!tokenUrl || !authorizationUrl) {
|
|
47
47
|
throw new Error("invalid token url or authorization url");
|
|
48
48
|
}
|
|
49
|
-
// eslint-disable-next-line no-param-reassign
|
|
50
49
|
secret.authorization_url = removeQueryParametersFromUrl(authorizationUrl);
|
|
51
|
-
// eslint-disable-next-line no-param-reassign
|
|
52
50
|
secret.token_url = removeQueryParametersFromUrl(tokenUrl);
|
|
53
51
|
}
|
|
54
52
|
return secret;
|
|
@@ -5,8 +5,6 @@ export function getLowerVersion(a, b) {
|
|
|
5
5
|
}
|
|
6
6
|
export function mergeDiscoveries(discovery, newDiscovery) {
|
|
7
7
|
merge(discovery, newDiscovery);
|
|
8
|
-
// eslint-disable-next-line no-param-reassign
|
|
9
8
|
discovery.info.version = getLowerVersion(discovery.info.version, newDiscovery.info.version);
|
|
10
|
-
// eslint-disable-next-line no-param-reassign
|
|
11
9
|
discovery.info["x-document-version"] = getLowerVersion(discovery.info["x-document-version"], newDiscovery.info["x-document-version"]);
|
|
12
10
|
}
|
|
@@ -44,6 +44,7 @@ export const retrieveCode = async () => new Promise((resolve, reject) => {
|
|
|
44
44
|
const secrets = await SecretsStorageSingleton.SINGLETON.getDefaultSecret();
|
|
45
45
|
const defaultPort = secrets.customClient ? "8080" : "65000";
|
|
46
46
|
const PORT = parseInt(process.env.CLI_HTTP_PORT ?? defaultPort, 10);
|
|
47
|
+
// eslint-disable-next-line prefer-const
|
|
47
48
|
let timeout;
|
|
48
49
|
const server = createServer((req, res) => {
|
|
49
50
|
void (async () => {
|
|
@@ -44,16 +44,13 @@ export const handleMappingIn = (mapping, url, value, headers, bodyWrapper) => {
|
|
|
44
44
|
url.searchParams.append(mapping.name, value);
|
|
45
45
|
}
|
|
46
46
|
else if (mapping.in === "header") {
|
|
47
|
-
// eslint-disable-next-line no-param-reassign
|
|
48
47
|
headers[mapping.name] = value;
|
|
49
48
|
}
|
|
50
49
|
else if (mapping.in === "path") {
|
|
51
|
-
// eslint-disable-next-line no-param-reassign
|
|
52
50
|
url.pathname = url.pathname.replace(new RegExp(`${CURLY_OPEN_ENCODED}${mapping.name}${CURLY_CLOSED_ENCODED}`, "g"), encodeURIComponent(value));
|
|
53
51
|
}
|
|
54
52
|
else {
|
|
55
53
|
if (!bodyWrapper.body) {
|
|
56
|
-
// eslint-disable-next-line no-param-reassign
|
|
57
54
|
bodyWrapper.body = {};
|
|
58
55
|
}
|
|
59
56
|
set(bodyWrapper.body, mapping.name, value);
|
|
@@ -16,7 +16,7 @@ export const verifyHost = async () => async () => {
|
|
|
16
16
|
const url = getTenantUrl();
|
|
17
17
|
logger.debug(`url defined as ${url}`);
|
|
18
18
|
}
|
|
19
|
-
catch
|
|
19
|
+
catch {
|
|
20
20
|
logger.error("tenant URL not defined. use option -H, --host");
|
|
21
21
|
logVerbose(logger, "specify the tenant URL using option --host");
|
|
22
22
|
throw new Error("tenant URL not defined. use option -H, --host");
|
|
@@ -41,7 +41,7 @@ const initializeCache = async () => async () => {
|
|
|
41
41
|
getOptionValueFromConfig(OPTION_HOST);
|
|
42
42
|
await (await init())();
|
|
43
43
|
}
|
|
44
|
-
catch
|
|
44
|
+
catch {
|
|
45
45
|
warn(`option ${buildOptionName(ROOT_COMMAND, OPTION_HOST)} not defined, skipping cache init`);
|
|
46
46
|
}
|
|
47
47
|
};
|
|
@@ -41,7 +41,6 @@ const addCommandToArray = (document, commands, segments, index) => {
|
|
|
41
41
|
return { command, remove: () => commands.splice(commands.length - 1, 1) };
|
|
42
42
|
};
|
|
43
43
|
const setHandler = (command, method, path, parameterMappings, readPathResponseHandler, ...handler) => {
|
|
44
|
-
// eslint-disable-next-line no-param-reassign
|
|
45
44
|
command.handler = createNextHandler("openAPI.command", createParseArgumentsHandler(), createMandatoryOptionsHandler(), createAuthenticationHandler(), ...handler, createFetchHandler(method, path, parameterMappings, readPathResponseHandler));
|
|
46
45
|
};
|
|
47
46
|
export const addCommands = async (program) => {
|
|
@@ -107,7 +107,6 @@ const getKeysFromSchema = (schema, doc, key = "", required = false) => {
|
|
|
107
107
|
const { trace } = getLogger();
|
|
108
108
|
trace(`retrieving keys for key ${key} from schema ${JSON.stringify(schema)}`);
|
|
109
109
|
if (schema.$ref) {
|
|
110
|
-
// eslint-disable-next-line no-param-reassign
|
|
111
110
|
schema = getSchema(schema, doc);
|
|
112
111
|
}
|
|
113
112
|
if (schema.type === "object" && schema.properties) {
|
|
@@ -302,7 +301,6 @@ export const handleParameters = (operation, doc, parameterMappings, command, top
|
|
|
302
301
|
};
|
|
303
302
|
export const handleDeprecationNotice = (operation, command) => {
|
|
304
303
|
if (operation.deprecated && command.type === "command") {
|
|
305
|
-
// eslint-disable-next-line no-param-reassign
|
|
306
304
|
command.deprecationInfo = {
|
|
307
305
|
deprecated: true,
|
|
308
306
|
deprecatedWithWave: operation["x-deprecated-with-wave"],
|
package/config/index.js
CHANGED
|
@@ -45,11 +45,11 @@ export const setCustomConfig = () => {
|
|
|
45
45
|
debug("setting custom configuration");
|
|
46
46
|
const sources = customConfig.util.getConfigSources();
|
|
47
47
|
trace("config.custom.getConfigSources", JSON.stringify(sources, null, 2));
|
|
48
|
-
trace("config.custom.NODE_CONFIG_DIR",
|
|
49
|
-
trace("config.custom.NODE_ENV",
|
|
50
|
-
trace("config.custom.NODE_CONFIG", JSON.stringify(
|
|
51
|
-
trace("config.custom.HOSTNAME",
|
|
52
|
-
trace("config.custom.NODE_APP_INSTANCE",
|
|
48
|
+
trace("config.custom.NODE_CONFIG_DIR", process.env.NODE_CONFIG_DIR);
|
|
49
|
+
trace("config.custom.NODE_ENV", process.env.NODE_ENV);
|
|
50
|
+
trace("config.custom.NODE_CONFIG", JSON.stringify(process.env.NODE_CONFIG, null, 2));
|
|
51
|
+
trace("config.custom.HOSTNAME", process.env.HOSTNAME);
|
|
52
|
+
trace("config.custom.NODE_APP_INSTANCE", process.env.NODE_APP_INSTANCE);
|
|
53
53
|
if (customConfig.has(CUSTOM_HOST)) {
|
|
54
54
|
config.host = customConfig.get(CUSTOM_HOST);
|
|
55
55
|
config.hostSetFromCustomConfig = true;
|
|
@@ -64,7 +64,6 @@ export const setCustomConfig = () => {
|
|
|
64
64
|
setCustomConfig();
|
|
65
65
|
const setTenant = (tenant) => {
|
|
66
66
|
const info = getInfoFromTenant(tenant, config.verbose);
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
68
67
|
set({ ...info, newTenant: tenant });
|
|
69
68
|
};
|
|
70
69
|
export const set = (c) => {
|
package/dwc/dwc.js
CHANGED
|
@@ -134,7 +134,6 @@ export const executeCommand = async (command) => {
|
|
|
134
134
|
};
|
|
135
135
|
const buildCommandsObject = (name, command, object = {}) => {
|
|
136
136
|
const commandName = name || "dwc";
|
|
137
|
-
// eslint-disable-next-line no-param-reassign
|
|
138
137
|
object[commandName] = async (options) => {
|
|
139
138
|
await executeCommand(new Array(2)
|
|
140
139
|
.fill("dummy")
|
package/logger/index.js
CHANGED
|
@@ -35,7 +35,6 @@ const logMessage = (namespace, level) => (...args) => {
|
|
|
35
35
|
? // @ts-expect-error ts(7053)
|
|
36
36
|
customLogger[LogLevel2Console[level]](...args)
|
|
37
37
|
: // @ts-expect-error ts(7053)
|
|
38
|
-
// eslint-disable-next-line
|
|
39
38
|
console[LogLevel2Console[level]](...[
|
|
40
39
|
`[${namespace}:${level === LogLevel.TRACE ? "trace" : LogLevel2Console[level]}:${new Date().toISOString()}] ${args[0]}`,
|
|
41
40
|
...args.slice(1),
|
|
@@ -46,8 +45,7 @@ export const get = (namespace) => {
|
|
|
46
45
|
return {
|
|
47
46
|
output: customLogger?.output
|
|
48
47
|
? customLogger.output
|
|
49
|
-
:
|
|
50
|
-
(...args) => console.log(...args),
|
|
48
|
+
: (...args) => console.log(...args),
|
|
51
49
|
error: logMessage(namespace, LogLevel.ERROR),
|
|
52
50
|
warn: logMessage(namespace, LogLevel.WARN),
|
|
53
51
|
info: logMessage(namespace, LogLevel.INFO),
|
package/module.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/cli-core",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.4.0",
|
|
4
4
|
"description": "Command-Line Interface (CLI) Core Module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "SAP SE",
|
|
@@ -19,20 +19,19 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"ajv": "8.17.1",
|
|
22
|
-
"axios": "1.13.
|
|
23
|
-
"commander": "
|
|
22
|
+
"axios": "1.13.3",
|
|
23
|
+
"commander": "14.0.2",
|
|
24
24
|
"compare-versions": "6.1.1",
|
|
25
|
-
"config": "4.
|
|
25
|
+
"config": "4.2.0",
|
|
26
26
|
"dotenv": "17.2.3",
|
|
27
27
|
"form-data": "4.0.5",
|
|
28
|
-
"fs-extra": "11.3.
|
|
29
|
-
"https": "1.0.0",
|
|
28
|
+
"fs-extra": "11.3.3",
|
|
30
29
|
"https-proxy-agent": "7.0.6",
|
|
31
30
|
"jszip": "3.10.1",
|
|
32
|
-
"lodash-es": "4.17.
|
|
31
|
+
"lodash-es": "4.17.23",
|
|
33
32
|
"open": "11.0.0",
|
|
34
33
|
"path": "0.12.7",
|
|
35
34
|
"prompts": "2.4.2",
|
|
36
|
-
"qs": "6.14.
|
|
35
|
+
"qs": "6.14.1"
|
|
37
36
|
}
|
|
38
37
|
}
|
package/utils/commands.js
CHANGED
|
@@ -29,6 +29,7 @@ export const createCommand = (name) => {
|
|
|
29
29
|
command.exitOverride();
|
|
30
30
|
command.configureOutput({ writeErr: output, writeOut: output });
|
|
31
31
|
command.allowUnknownOption();
|
|
32
|
+
command.allowExcessArguments();
|
|
32
33
|
return command;
|
|
33
34
|
};
|
|
34
35
|
export function getAbsoluteCommandName(command) {
|
|
@@ -77,7 +78,7 @@ export const registerLongName = (command, option) => {
|
|
|
77
78
|
try {
|
|
78
79
|
return getShortFlagForLongName(command, option);
|
|
79
80
|
}
|
|
80
|
-
catch
|
|
81
|
+
catch {
|
|
81
82
|
let possibleShortFlags = getInitialShortFlagOptions(option);
|
|
82
83
|
possibleShortFlags = removeUsedShortFlags(possibleShortFlags);
|
|
83
84
|
if (possibleShortFlags.length === 0) {
|
package/utils/openUtils.js
CHANGED
|
@@ -10,18 +10,19 @@ export async function getSupportedBrowsers() {
|
|
|
10
10
|
for (const key of Object.keys(apps)) {
|
|
11
11
|
const name = key;
|
|
12
12
|
// Skip private browser
|
|
13
|
-
if (name
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
catch {
|
|
22
|
-
// Silently skip apps not supported on this platform (e.g., safari on Windows)
|
|
13
|
+
if (name === "browserPrivate") {
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
// Access the lazy property - may throw if not supported on this platform
|
|
18
|
+
const value = apps[name];
|
|
19
|
+
if (value !== undefined) {
|
|
20
|
+
browsers.push({ name, app: value });
|
|
23
21
|
}
|
|
24
22
|
}
|
|
23
|
+
catch {
|
|
24
|
+
// Silently skip apps not supported on this platform (e.g., safari on Windows)
|
|
25
|
+
}
|
|
25
26
|
}
|
|
26
27
|
return browsers;
|
|
27
28
|
}
|
package/utils/utils.js
CHANGED
|
@@ -35,7 +35,7 @@ export const readPackageJson = (cwd = "", force = false) => {
|
|
|
35
35
|
trace(`reading ${p}`);
|
|
36
36
|
pgk = requireFile(p);
|
|
37
37
|
}
|
|
38
|
-
catch
|
|
38
|
+
catch {
|
|
39
39
|
trace("failed to read package.json second time", err.stack);
|
|
40
40
|
const p = path.join(cwdPath, "../../package.json");
|
|
41
41
|
trace(`reading ${p}`);
|
|
@@ -89,7 +89,6 @@ export const parseTenant = (tenant) => {
|
|
|
89
89
|
export function isValidURL(url) {
|
|
90
90
|
const { debug, error } = getLogger();
|
|
91
91
|
try {
|
|
92
|
-
// eslint-disable-next-line no-new
|
|
93
92
|
new URL(url);
|
|
94
93
|
debug(`url ${url} is valid`);
|
|
95
94
|
return true;
|