@sap/cds-dk 9.9.4 → 9.9.6

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/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ This project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  The format is based on [Keep a Changelog](https://keepachangelog.com/).
8
8
 
9
+ ## Version 9.9.6 - 2026-09-11
10
+
11
+ ### Changed
12
+
13
+ - Use cds-mtxs 3.9.8
14
+
15
+ ## Version 9.9.5 - 2026-08-24
16
+
17
+ ### Changed
18
+
19
+ - `cds login` now uses the renamed login endpoints `/-/cds/login/grant` and `/-/cds/login/grant-metadata` with a legacy fallback, and updates saved legacy token URLs.
20
+
9
21
  ## Version 9.9.4 - 2026-07-31
10
22
 
11
23
  ### Changed
@@ -1,5 +1,5 @@
1
1
  const cds = require('../cds');
2
- const { SettingsManager } = require('./settings_manager');
2
+ const { SettingsManager, OAUTH_PATH, OAUTH_PATH_LEGACY_TOKEN } = require('./settings_manager');
3
3
  const { ParamCollection } = require('./params');
4
4
  const { getMessage } = require('./util/logging');
5
5
  const { buildResponseError, buildNetworkError, parseResponseBody } = require('./util/request');
@@ -63,6 +63,32 @@ function reqParams(method, params) {
63
63
  : { url: `${url}?${data}`, data: undefined, ignored };
64
64
  }
65
65
 
66
+ async function postTokenTo(url, data, method, params) {
67
+ DEBUG?.(`Getting authentication token from ${method.toUpperCase()} ${params.obfuscateQueryParams(url)}`);
68
+ const response = await fetch(url, {
69
+ method: method.toUpperCase(),
70
+ body: data,
71
+ headers: { 'content-type': 'application/x-www-form-urlencoded' }
72
+ });
73
+ if (!response.ok) {
74
+ throw await buildResponseError(method, url, response);
75
+ }
76
+ return parseResponseBody(response);
77
+ }
78
+
79
+ async function postToken(params, url, data, method) {
80
+ try {
81
+ return await postTokenTo(url, data, method, params);
82
+ } catch (e) {
83
+ if (e.status !== 404 || !url.includes(OAUTH_PATH)) {
84
+ throw e;
85
+ }
86
+ const legacyUrl = url.replace(OAUTH_PATH, OAUTH_PATH_LEGACY_TOKEN);
87
+ DEBUG?.(`Token endpoint not found, retrying against legacy path ${params.obfuscateQueryParams(legacyUrl)}`);
88
+ return postTokenTo(legacyUrl, data, method, params);
89
+ }
90
+ }
91
+
66
92
  async function fetchToken(params) {
67
93
  if (params.has('token') || !(params.has('refreshToken') || params.has('passcode') || params.has('clientid') || !params.has('passcodeUrl'))) {
68
94
  return;
@@ -75,25 +101,12 @@ async function fetchToken(params) {
75
101
  if (Object.keys(ignored).length) {
76
102
  console.log(`Ignoring parameters for fetching token: ${Object.entries(ignored).map(([param, reason]) => `${param} (${reason})`).join(', ')}.`);
77
103
  }
78
- DEBUG?.(`Getting authentication token from ${method.toUpperCase()} ${params.obfuscateQueryParams(url)}`);
79
104
  error = undefined;
80
105
  try {
81
- const response = await fetch(url, {
82
- method: method.toUpperCase(),
83
- body: data,
84
- headers: { 'content-type': 'application/x-www-form-urlencoded' }
85
- });
86
- if (!response.ok) {
87
- throw await buildResponseError(method, url, response);
88
- }
89
- responseData = await parseResponseBody(response);
106
+ responseData = await postToken(params, url, data, method);
90
107
  break;
91
108
  } catch (e) {
92
- if (e.status) {
93
- error = e;
94
- } else {
95
- error = buildNetworkError(method, url, e);
96
- }
109
+ error = e.status ? e : buildNetworkError(method, url, e);
97
110
  DEBUG?.(`HTTP status ${error.status}`);
98
111
  if (params.has('refreshToken')) {
99
112
  DEBUG?.('Discarding invalid refresh token');
@@ -122,7 +135,7 @@ async function fetchToken(params) {
122
135
  message += `. Ensure the client credentials are correct`;
123
136
  }
124
137
  } else {
125
- message = 'error on token request';
138
+ message = 'token request failed';
126
139
  }
127
140
  throw new Error(message + '.', { cause: error });
128
141
  }
@@ -35,8 +35,9 @@ const KEYRING_DESC = {
35
35
 
36
36
  const MTX_FULLY_QUALIFIED = 'com.sap.cds.mtx';
37
37
  const OAUTH_PATH_LEGACY = '/mtx/v1/oauth/token';
38
- const OAUTH_PATH = '/-/cds/login/token';
39
- const OAUTH_META_PATH = '/-/cds/login/authorization-metadata';
38
+ const OAUTH_PATH_LEGACY_TOKEN = '/-/cds/login/token';
39
+ const OAUTH_PATH = '/-/cds/login/grant';
40
+ const OAUTH_META_PATH = '/-/cds/login/grant-metadata';
40
41
 
41
42
  const SETTINGS_DIR = path.join(os.homedir(), CONFIG_SUBDIRS[os.platform()] || '', MTX_FULLY_QUALIFIED);
42
43
  const SETTINGS_FILE = 'projects.json';
@@ -295,7 +296,7 @@ class SettingsManager {
295
296
  async function updateTokenUrl() {
296
297
  const tokenUrl = secure(params.get('tokenUrl'), 'token URL');
297
298
  const renewUrl = !logout && !params.get('skipToken')
298
- && (!tokenUrl || tokenUrl.includes('//-/cds') || tokenUrl.includes(OAUTH_PATH_LEGACY)
299
+ && (!tokenUrl || tokenUrl.includes('//-/cds') || tokenUrl.includes(OAUTH_PATH_LEGACY) || tokenUrl.includes(OAUTH_PATH_LEGACY_TOKEN)
299
300
  || params.get('appUrl') !== loadedSettings.get('appUrl')
300
301
  || params.get('subdomain') !== loadedSettings.get('subdomain'));
301
302
  if (renewUrl) {
@@ -719,5 +720,7 @@ class SettingsManager {
719
720
  module.exports = {
720
721
  SettingsManager,
721
722
  other,
722
- notifyLogin
723
+ notifyLogin,
724
+ OAUTH_PATH,
725
+ OAUTH_PATH_LEGACY_TOKEN
723
726
  };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "9.9.4",
3
+ "version": "9.9.6",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@sap/cds-dk",
9
- "version": "9.9.4",
9
+ "version": "9.9.6",
10
10
  "license": "SEE LICENSE IN LICENSE",
11
11
  "dependencies": {
12
12
  "@cap-js/asyncapi": "^1.0.0",
@@ -41,20 +41,20 @@
41
41
  }
42
42
  },
43
43
  "node_modules/@cap-js/db-service": {
44
- "version": "2.11.0",
45
- "integrity": "sha512-sl33LcxZYAJgMCQZDw4lMGe4kWYq6685Xc6ze4qcoM+rd6aqiyVsSC6C7XH5yerXs7cVHhRC+Dgo8AsaapFzlQ==",
44
+ "version": "2.11.1",
45
+ "integrity": "sha512-IifaMVCmOBKIwlqKnir/Di1gcHx7DjuqmyyWwVCbLH5bdcHO8y8bYozHYXvn4gUthxQFBa5pTrXUSzjheJad7g==",
46
46
  "devOptional": true,
47
47
  "license": "Apache-2.0",
48
48
  "dependencies": {
49
49
  "generic-pool": "^3.9.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@sap/cds": ">=9.8"
52
+ "@sap/cds": "^9.8"
53
53
  }
54
54
  },
55
55
  "node_modules/@cap-js/openapi": {
56
- "version": "1.5.0",
57
- "integrity": "sha512-JDzENNC80vnP9W31Skz6PfgPnpaxNTgIP8CtDK3bJ0FCbr5sXshRqes1pc17kNMXDbJAtEshS0dN7GYBW2THWA==",
56
+ "version": "1.6.0",
57
+ "integrity": "sha512-1Knrn9dU3CBAlKRlhTzZTlzbg1IULbUV39mvhcuDZrgMhSWhJ3OuJVcNWtMClq+VkUeYTkMYpysbPqrMRoeEdw==",
58
58
  "license": "Apache-2.0",
59
59
  "dependencies": {
60
60
  "pluralize": "^8.0.0"
@@ -64,16 +64,16 @@
64
64
  }
65
65
  },
66
66
  "node_modules/@cap-js/sqlite": {
67
- "version": "2.4.0",
68
- "integrity": "sha512-Ao+AzIN6BWHNpLbGxAzF79OezFNHzDG2srwiBABs0FYxIxEGkc2hg6ETo79pTTt66gcWtx7pWh/N9xk2M6SFBQ==",
67
+ "version": "2.4.1",
68
+ "integrity": "sha512-xJcMESlMcgD6u2O8tugGBb4lCX/YF707zkAuF95hPgBzLerdQGzR+3fDGXLyoWSSEB32Esz8SyhnFXoS5b6Svw==",
69
69
  "license": "Apache-2.0",
70
70
  "optional": true,
71
71
  "dependencies": {
72
- "@cap-js/db-service": "^2.11.0",
72
+ "@cap-js/db-service": "^2.11.1",
73
73
  "better-sqlite3": "^12.0.0"
74
74
  },
75
75
  "peerDependencies": {
76
- "@sap/cds": ">=9.8",
76
+ "@sap/cds": "^9.8",
77
77
  "sql.js": "^1.13.0"
78
78
  },
79
79
  "peerDependenciesMeta": {
@@ -130,8 +130,8 @@
130
130
  }
131
131
  },
132
132
  "node_modules/@sap/cds-compiler": {
133
- "version": "6.9.4",
134
- "integrity": "sha512-gz7PeE3vjl0OdnK+XWH/aslQ6WNsqA1EDwqKOXho0tTDwqXSgpe3BT85PKy49ozytRkUGh/YU1/3ztO+dWeUvQ==",
133
+ "version": "6.9.5",
134
+ "integrity": "sha512-zce4nu9Q5ZasCKOsqLDEZ1u3047CT3gebM3ziMOftn4W8Ip6qddBXd8HVVrKxY/PZrhJOnhaYqGirQFD9zmFxg==",
135
135
  "license": "SEE LICENSE IN LICENSE",
136
136
  "bin": {
137
137
  "cdsc": "bin/cdsc.js",
@@ -151,8 +151,8 @@
151
151
  }
152
152
  },
153
153
  "node_modules/@sap/cds-mtxs": {
154
- "version": "3.9.5",
155
- "integrity": "sha512-R7SLGJ5eCIGiR5uX6QWBG+SVDvCj3OpjxhpcHF1NwhJ0mqMHC3FCrHrutIpX4slc0ZTYyoJnEyL7gaPhrjK50g==",
154
+ "version": "3.9.8",
155
+ "integrity": "sha512-h3ldNx7Kn0loySsCPaRUhRrFT8G0iCJR+a1kT6A5bNF8F3mJlw6WQa6MBQC8wZ032T9woewR2z6iQY0OGBvETQ==",
156
156
  "license": "SEE LICENSE IN LICENSE",
157
157
  "dependencies": {
158
158
  "@sap/hdi-deploy": "^5"
@@ -162,7 +162,7 @@
162
162
  "cds-mtx-migrate": "bin/cds-mtx-migrate.js"
163
163
  },
164
164
  "peerDependencies": {
165
- "@sap/cds": ">=9"
165
+ "@sap/cds": "^9"
166
166
  }
167
167
  },
168
168
  "node_modules/@sap/hdi": {
@@ -217,8 +217,8 @@
217
217
  }
218
218
  },
219
219
  "node_modules/@sap/xsenv": {
220
- "version": "6.2.1",
221
- "integrity": "sha512-R1p7VdD3N3jvdkL8av4vLqF+cTQihTz9mCqqF+oa9rVZvgLaCb4ODyZ1dln5/fBgg1OSuch0ESxu3AqZrXVknw==",
220
+ "version": "6.2.2",
221
+ "integrity": "sha512-SGn+yaVKeXND/rQaQhqTZC+M6g5ASW1YnqAdQiZqNL74E1T1kUsDHttgOjQNkLObMZ0fsxgQxRPMnuVcAgIODg==",
222
222
  "license": "SEE LICENSE IN LICENSE",
223
223
  "dependencies": {
224
224
  "debug": "4.4.3",
@@ -332,8 +332,8 @@
332
332
  }
333
333
  },
334
334
  "node_modules/body-parser/node_modules/content-type": {
335
- "version": "2.0.0",
336
- "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
335
+ "version": "2.1.0",
336
+ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
337
337
  "license": "MIT",
338
338
  "engines": {
339
339
  "node": ">=18"
@@ -841,8 +841,8 @@
841
841
  }
842
842
  },
843
843
  "node_modules/hdb": {
844
- "version": "2.29.5",
845
- "integrity": "sha512-3DFwpAdURCKz7mI4Ahsu12dVUCev4Epd+OfgR6L13K36c0yyU3Tf7i9Q1bZt9wN9sBczpmUf0hHnshqygtBIsw==",
844
+ "version": "2.29.6",
845
+ "integrity": "sha512-I9AQxpTn6OKm66rzzNWbJeKnxn1ylJinzSsq0J1O0HOwxv3VNuwQttKem2/DG/Sv/yRIU20dBiqZTqXjqs6Eog==",
846
846
  "license": "Apache-2.0",
847
847
  "dependencies": {
848
848
  "iconv-lite": "0.7.0"
@@ -1089,11 +1089,30 @@
1089
1089
  "optional": true
1090
1090
  },
1091
1091
  "node_modules/negotiator": {
1092
- "version": "1.0.0",
1093
- "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
1092
+ "version": "1.1.0",
1093
+ "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==",
1094
1094
  "license": "MIT",
1095
+ "dependencies": {
1096
+ "content-type": "^2.1.0"
1097
+ },
1095
1098
  "engines": {
1096
- "node": ">= 0.6"
1099
+ "node": ">=18"
1100
+ },
1101
+ "funding": {
1102
+ "type": "opencollective",
1103
+ "url": "https://opencollective.com/express"
1104
+ }
1105
+ },
1106
+ "node_modules/negotiator/node_modules/content-type": {
1107
+ "version": "2.1.0",
1108
+ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
1109
+ "license": "MIT",
1110
+ "engines": {
1111
+ "node": ">=18"
1112
+ },
1113
+ "funding": {
1114
+ "type": "opencollective",
1115
+ "url": "https://opencollective.com/express"
1097
1116
  }
1098
1117
  },
1099
1118
  "node_modules/neo-async": {
@@ -1102,8 +1121,8 @@
1102
1121
  "license": "MIT"
1103
1122
  },
1104
1123
  "node_modules/node-abi": {
1105
- "version": "3.94.0",
1106
- "integrity": "sha512-W5ZNO5KRPB5TkYmGVD9F6YqhsglXJzE6etpbmT+f6EQElhiX/UTG551cnsRGvLG3fyZEg9HwaDmNmj5nwJ4z9g==",
1124
+ "version": "3.96.0",
1125
+ "integrity": "sha512-rebQ/lz7i0EkoLzUVSrKRzA69zMkwLp95kKMWoMDkkM00Suxz0D7zEQPwRml5fQum24mj7bPvmlgLAmu2JCiYg==",
1107
1126
  "license": "MIT",
1108
1127
  "optional": true,
1109
1128
  "dependencies": {
@@ -1229,8 +1248,8 @@
1229
1248
  }
1230
1249
  },
1231
1250
  "node_modules/qs": {
1232
- "version": "6.15.3",
1233
- "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
1251
+ "version": "6.16.0",
1252
+ "integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
1234
1253
  "license": "BSD-3-Clause",
1235
1254
  "dependencies": {
1236
1255
  "es-define-property": "^1.0.1",
@@ -1630,8 +1649,8 @@
1630
1649
  }
1631
1650
  },
1632
1651
  "node_modules/type-is/node_modules/content-type": {
1633
- "version": "2.0.0",
1634
- "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
1652
+ "version": "2.1.0",
1653
+ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
1635
1654
  "license": "MIT",
1636
1655
  "engines": {
1637
1656
  "node": ">=18"
@@ -1699,8 +1718,8 @@
1699
1718
  "license": "ISC"
1700
1719
  },
1701
1720
  "node_modules/ws": {
1702
- "version": "8.21.1",
1703
- "integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==",
1721
+ "version": "8.21.3",
1722
+ "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==",
1704
1723
  "license": "MIT",
1705
1724
  "engines": {
1706
1725
  "node": ">=10.0.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds-dk",
3
- "version": "9.9.4",
3
+ "version": "9.9.6",
4
4
  "description": "Command line client and development toolkit for the SAP Cloud Application Programming Model",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [