@sap/cds-dk 8.2.1 → 8.2.2
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
|
@@ -7,6 +7,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
The format is based on [Keep a Changelog](http://keepachangelog.com/).
|
|
9
9
|
|
|
10
|
+
## Version 8.2.2 - 2024-09-17
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- BDSA-2024-6188: vulnerability with express.js 4.19.2
|
|
15
|
+
- `cds import --out` copies the given metadata file to the correct output folder. CLI options are propagated to the `cds.import` API.
|
|
16
|
+
- `cds add sample` no longer creates a irregular whitespace in `admin-service.js`.
|
|
17
|
+
- `cds login` now correctly fetches tokens again with client credentials (or hints at invalid credentials).
|
|
18
|
+
- `cds add handler` can now also be called from the `srv` dir.
|
|
19
|
+
|
|
10
20
|
## Version 8.2.1 - 2024-09-05
|
|
11
21
|
|
|
12
22
|
### Fixed
|
package/lib/import/common.js
CHANGED
|
@@ -17,7 +17,7 @@ let optionsMapping = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
let apiOptions = ['includeNamespaces', 'keepNamespace', 'beta'];
|
|
20
|
-
let commonOptions = ['no_copy', 'no_save', 'out', 'dry', 'as', 'from', 'force', 'config'];
|
|
20
|
+
let commonOptions = ['no_copy', 'no_save', 'out', 'dry', 'as', 'from', 'force', 'config', 'destination'];
|
|
21
21
|
|
|
22
22
|
async function generateEDMX2JSON(edmx) {
|
|
23
23
|
let cjson = convert.xml2json(edmx, {
|
|
@@ -155,7 +155,7 @@ async function preProcess(file, options, cwd) {
|
|
|
155
155
|
return srcFilePath;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
async function processOptions(cliOptions,
|
|
158
|
+
async function processOptions(cliOptions, options) {
|
|
159
159
|
// maps to renaming of variables
|
|
160
160
|
for (let [key, value] of Object.entries(optionsMapping)) {
|
|
161
161
|
if (cliOptions[key]) {
|
|
@@ -165,9 +165,18 @@ async function processOptions(cliOptions, odataOptions) {
|
|
|
165
165
|
}
|
|
166
166
|
// segregating cli/odata options
|
|
167
167
|
apiOptions.forEach(function (item) {
|
|
168
|
-
|
|
169
|
-
|
|
168
|
+
if (cliOptions[item]) {
|
|
169
|
+
options[item] = cliOptions[item];
|
|
170
|
+
delete cliOptions[item];
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
// forward cli options to api options
|
|
174
|
+
commonOptions.forEach(function (item) {
|
|
175
|
+
if (cliOptions[item]) {
|
|
176
|
+
options[item] = cliOptions[item];
|
|
177
|
+
}
|
|
170
178
|
});
|
|
179
|
+
|
|
171
180
|
// reads cli options from environment
|
|
172
181
|
readEnvVariables(cliOptions, true);
|
|
173
182
|
}
|
|
@@ -361,8 +370,7 @@ async function postProcess(filePath, options, csn, cwd) {
|
|
|
361
370
|
config.credentials = { destination: options.destination };
|
|
362
371
|
}
|
|
363
372
|
|
|
364
|
-
const
|
|
365
|
-
const destFilePath = path.join(external, path.basename(filePath));
|
|
373
|
+
const destFilePath = path.resolve(cwd, options.out ? path.join(options.out, path.basename(filePath)) : path.join('srv/external/', path.basename(filePath)));
|
|
366
374
|
if (options.out) options.out = _validateAndComputeOutputFilePath(options.out, options.as, destFilePath);
|
|
367
375
|
const kind = options.inputFileKind;
|
|
368
376
|
const result = await _getResult(csn, options.as, options.out || destFilePath.replace(/\.[^.]+$/, ''), options.force, kind);
|
package/lib/init/mvn.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const util = require('util')
|
|
2
|
-
const path = require('path');
|
|
3
2
|
const { exec } = require('child_process')
|
|
4
3
|
const execAsync = util.promisify(exec)
|
|
5
4
|
|
|
@@ -105,11 +104,11 @@ module.exports.init = async function (projectName, options = cds.cli.options) {
|
|
|
105
104
|
|
|
106
105
|
module.exports.generate = async function (feature, options = cds.cli.options) {
|
|
107
106
|
const command = this.generateMvnParams(feature, options)
|
|
108
|
-
const cwd = options.cwd
|
|
107
|
+
const cwd = options.cwd ?? cds.root
|
|
109
108
|
|
|
110
109
|
try {
|
|
111
110
|
console.log(`Executing command: `, term.highlight('mvn ' + command.join(' ')))
|
|
112
|
-
await cmd.spawnCommand('mvn', command, { cwd: cwd
|
|
111
|
+
await cmd.spawnCommand('mvn', command, { cwd: cwd })
|
|
113
112
|
return command
|
|
114
113
|
} catch (err) {
|
|
115
114
|
if (err.code === 'ENOENT' && err.path === 'mvn') {
|
|
@@ -125,7 +124,7 @@ module.exports.generateMvnParams = function (feature, options = cds.cli.options)
|
|
|
125
124
|
const { 'java:mvn': javaMvn, force, filter, out } = options
|
|
126
125
|
if (javaMvn) _scan(javaMvn).forEach(([k,v]) => params.set(k,v))
|
|
127
126
|
const archVersion = params.get(`-DarchetypeVersion`) ?? ''
|
|
128
|
-
params.set(`cds:${archVersion}:generate`)
|
|
127
|
+
params.set(`com.sap.cds:cds-maven-plugin:${archVersion}:generate`)
|
|
129
128
|
|
|
130
129
|
switch (feature) {
|
|
131
130
|
case 'handler':
|
|
@@ -9,8 +9,8 @@ module.exports = class AdminService extends cds.ApplicationService { init(){
|
|
|
9
9
|
*/
|
|
10
10
|
this.before ('NEW', Books.drafts, async (req) => {
|
|
11
11
|
if (req.data.ID) return
|
|
12
|
-
const {
|
|
13
|
-
const {
|
|
12
|
+
const { ID:id1 } = await SELECT.one.from(Books).columns('max(ID) as ID')
|
|
13
|
+
const { ID:id2 } = await SELECT.one.from(Books.drafts).columns('max(ID) as ID')
|
|
14
14
|
req.data.ID = Math.max(id1||0, id2||0) + 1
|
|
15
15
|
})
|
|
16
16
|
return super.init()
|
|
@@ -13,7 +13,7 @@ const Question = require('./util/question');
|
|
|
13
13
|
const { httpSchema, httpsSchema, schemaRegex, localhostRegex } = require('./util/urls');
|
|
14
14
|
const { capitalize } = require('./util/strings');
|
|
15
15
|
|
|
16
|
-
const
|
|
16
|
+
const DEBUG = cds.debug('cli');
|
|
17
17
|
|
|
18
18
|
const { ParamCollection, Persistence } = require('./params');
|
|
19
19
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/cds-dk",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@sap/cds-dk",
|
|
9
|
-
"version": "8.2.
|
|
9
|
+
"version": "8.2.2",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@cap-js/asyncapi": "^1.0.0",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
}
|
|
140
140
|
},
|
|
141
141
|
"node_modules/@eslint/js": {
|
|
142
|
-
"version": "9.
|
|
142
|
+
"version": "9.10.0",
|
|
143
143
|
"license": "MIT",
|
|
144
144
|
"engines": {
|
|
145
145
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
@@ -152,6 +152,16 @@
|
|
|
152
152
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
|
+
"node_modules/@eslint/plugin-kit": {
|
|
156
|
+
"version": "0.1.0",
|
|
157
|
+
"license": "Apache-2.0",
|
|
158
|
+
"dependencies": {
|
|
159
|
+
"levn": "^0.4.1"
|
|
160
|
+
},
|
|
161
|
+
"engines": {
|
|
162
|
+
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
155
165
|
"node_modules/@humanwhocodes/module-importer": {
|
|
156
166
|
"version": "1.0.1",
|
|
157
167
|
"license": "Apache-2.0",
|
|
@@ -204,7 +214,7 @@
|
|
|
204
214
|
}
|
|
205
215
|
},
|
|
206
216
|
"node_modules/@sap/cds": {
|
|
207
|
-
"version": "8.2.
|
|
217
|
+
"version": "8.2.2",
|
|
208
218
|
"license": "SEE LICENSE IN LICENSE",
|
|
209
219
|
"dependencies": {
|
|
210
220
|
"@sap/cds-compiler": ">=5.1",
|
|
@@ -278,7 +288,7 @@
|
|
|
278
288
|
}
|
|
279
289
|
},
|
|
280
290
|
"node_modules/@sap/eslint-plugin-cds": {
|
|
281
|
-
"version": "3.0.
|
|
291
|
+
"version": "3.0.5",
|
|
282
292
|
"license": "See LICENSE file",
|
|
283
293
|
"dependencies": {
|
|
284
294
|
"@sap/cds": ">=7",
|
|
@@ -314,7 +324,7 @@
|
|
|
314
324
|
}
|
|
315
325
|
},
|
|
316
326
|
"node_modules/@sap/hdi-deploy": {
|
|
317
|
-
"version": "5.2.
|
|
327
|
+
"version": "5.2.3",
|
|
318
328
|
"hasInstallScript": true,
|
|
319
329
|
"license": "See LICENSE file",
|
|
320
330
|
"dependencies": {
|
|
@@ -482,7 +492,7 @@
|
|
|
482
492
|
"optional": true
|
|
483
493
|
},
|
|
484
494
|
"node_modules/better-sqlite3": {
|
|
485
|
-
"version": "11.
|
|
495
|
+
"version": "11.3.0",
|
|
486
496
|
"hasInstallScript": true,
|
|
487
497
|
"license": "MIT",
|
|
488
498
|
"optional": true,
|
|
@@ -492,7 +502,7 @@
|
|
|
492
502
|
}
|
|
493
503
|
},
|
|
494
504
|
"node_modules/big.js": {
|
|
495
|
-
"version": "6.2.
|
|
505
|
+
"version": "6.2.2",
|
|
496
506
|
"license": "MIT",
|
|
497
507
|
"engines": {
|
|
498
508
|
"node": "*"
|
|
@@ -521,7 +531,7 @@
|
|
|
521
531
|
}
|
|
522
532
|
},
|
|
523
533
|
"node_modules/body-parser": {
|
|
524
|
-
"version": "1.20.
|
|
534
|
+
"version": "1.20.3",
|
|
525
535
|
"license": "MIT",
|
|
526
536
|
"dependencies": {
|
|
527
537
|
"bytes": "3.1.2",
|
|
@@ -532,7 +542,7 @@
|
|
|
532
542
|
"http-errors": "2.0.0",
|
|
533
543
|
"iconv-lite": "0.4.24",
|
|
534
544
|
"on-finished": "2.4.1",
|
|
535
|
-
"qs": "6.
|
|
545
|
+
"qs": "6.13.0",
|
|
536
546
|
"raw-body": "2.5.2",
|
|
537
547
|
"type-is": "~1.6.18",
|
|
538
548
|
"unpipe": "1.0.0"
|
|
@@ -824,7 +834,7 @@
|
|
|
824
834
|
"license": "MIT"
|
|
825
835
|
},
|
|
826
836
|
"node_modules/encodeurl": {
|
|
827
|
-
"version": "
|
|
837
|
+
"version": "2.0.0",
|
|
828
838
|
"license": "MIT",
|
|
829
839
|
"engines": {
|
|
830
840
|
"node": ">= 0.8"
|
|
@@ -870,14 +880,15 @@
|
|
|
870
880
|
}
|
|
871
881
|
},
|
|
872
882
|
"node_modules/eslint": {
|
|
873
|
-
"version": "9.
|
|
883
|
+
"version": "9.10.0",
|
|
874
884
|
"license": "MIT",
|
|
875
885
|
"dependencies": {
|
|
876
886
|
"@eslint-community/eslint-utils": "^4.2.0",
|
|
877
887
|
"@eslint-community/regexpp": "^4.11.0",
|
|
878
888
|
"@eslint/config-array": "^0.18.0",
|
|
879
889
|
"@eslint/eslintrc": "^3.1.0",
|
|
880
|
-
"@eslint/js": "9.
|
|
890
|
+
"@eslint/js": "9.10.0",
|
|
891
|
+
"@eslint/plugin-kit": "^0.1.0",
|
|
881
892
|
"@humanwhocodes/module-importer": "^1.0.1",
|
|
882
893
|
"@humanwhocodes/retry": "^0.3.0",
|
|
883
894
|
"@nodelib/fs.walk": "^1.2.8",
|
|
@@ -900,7 +911,6 @@
|
|
|
900
911
|
"is-glob": "^4.0.0",
|
|
901
912
|
"is-path-inside": "^3.0.3",
|
|
902
913
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
|
903
|
-
"levn": "^0.4.1",
|
|
904
914
|
"lodash.merge": "^4.6.2",
|
|
905
915
|
"minimatch": "^3.1.2",
|
|
906
916
|
"natural-compare": "^1.4.0",
|
|
@@ -1015,35 +1025,35 @@
|
|
|
1015
1025
|
}
|
|
1016
1026
|
},
|
|
1017
1027
|
"node_modules/express": {
|
|
1018
|
-
"version": "4.
|
|
1028
|
+
"version": "4.21.0",
|
|
1019
1029
|
"license": "MIT",
|
|
1020
1030
|
"dependencies": {
|
|
1021
1031
|
"accepts": "~1.3.8",
|
|
1022
1032
|
"array-flatten": "1.1.1",
|
|
1023
|
-
"body-parser": "1.20.
|
|
1033
|
+
"body-parser": "1.20.3",
|
|
1024
1034
|
"content-disposition": "0.5.4",
|
|
1025
1035
|
"content-type": "~1.0.4",
|
|
1026
1036
|
"cookie": "0.6.0",
|
|
1027
1037
|
"cookie-signature": "1.0.6",
|
|
1028
1038
|
"debug": "2.6.9",
|
|
1029
1039
|
"depd": "2.0.0",
|
|
1030
|
-
"encodeurl": "~
|
|
1040
|
+
"encodeurl": "~2.0.0",
|
|
1031
1041
|
"escape-html": "~1.0.3",
|
|
1032
1042
|
"etag": "~1.8.1",
|
|
1033
|
-
"finalhandler": "1.
|
|
1043
|
+
"finalhandler": "1.3.1",
|
|
1034
1044
|
"fresh": "0.5.2",
|
|
1035
1045
|
"http-errors": "2.0.0",
|
|
1036
|
-
"merge-descriptors": "1.0.
|
|
1046
|
+
"merge-descriptors": "1.0.3",
|
|
1037
1047
|
"methods": "~1.1.2",
|
|
1038
1048
|
"on-finished": "2.4.1",
|
|
1039
1049
|
"parseurl": "~1.3.3",
|
|
1040
|
-
"path-to-regexp": "0.1.
|
|
1050
|
+
"path-to-regexp": "0.1.10",
|
|
1041
1051
|
"proxy-addr": "~2.0.7",
|
|
1042
|
-
"qs": "6.
|
|
1052
|
+
"qs": "6.13.0",
|
|
1043
1053
|
"range-parser": "~1.2.1",
|
|
1044
1054
|
"safe-buffer": "5.2.1",
|
|
1045
|
-
"send": "0.
|
|
1046
|
-
"serve-static": "1.
|
|
1055
|
+
"send": "0.19.0",
|
|
1056
|
+
"serve-static": "1.16.2",
|
|
1047
1057
|
"setprototypeof": "1.2.0",
|
|
1048
1058
|
"statuses": "2.0.1",
|
|
1049
1059
|
"type-is": "~1.6.18",
|
|
@@ -1117,11 +1127,11 @@
|
|
|
1117
1127
|
}
|
|
1118
1128
|
},
|
|
1119
1129
|
"node_modules/finalhandler": {
|
|
1120
|
-
"version": "1.
|
|
1130
|
+
"version": "1.3.1",
|
|
1121
1131
|
"license": "MIT",
|
|
1122
1132
|
"dependencies": {
|
|
1123
1133
|
"debug": "2.6.9",
|
|
1124
|
-
"encodeurl": "~
|
|
1134
|
+
"encodeurl": "~2.0.0",
|
|
1125
1135
|
"escape-html": "~1.0.3",
|
|
1126
1136
|
"on-finished": "2.4.1",
|
|
1127
1137
|
"parseurl": "~1.3.3",
|
|
@@ -1173,7 +1183,7 @@
|
|
|
1173
1183
|
"license": "ISC"
|
|
1174
1184
|
},
|
|
1175
1185
|
"node_modules/follow-redirects": {
|
|
1176
|
-
"version": "1.15.
|
|
1186
|
+
"version": "1.15.9",
|
|
1177
1187
|
"funding": [
|
|
1178
1188
|
{
|
|
1179
1189
|
"type": "individual",
|
|
@@ -1554,8 +1564,11 @@
|
|
|
1554
1564
|
}
|
|
1555
1565
|
},
|
|
1556
1566
|
"node_modules/merge-descriptors": {
|
|
1557
|
-
"version": "1.0.
|
|
1558
|
-
"license": "MIT"
|
|
1567
|
+
"version": "1.0.3",
|
|
1568
|
+
"license": "MIT",
|
|
1569
|
+
"funding": {
|
|
1570
|
+
"url": "https://github.com/sponsors/sindresorhus"
|
|
1571
|
+
}
|
|
1559
1572
|
},
|
|
1560
1573
|
"node_modules/methods": {
|
|
1561
1574
|
"version": "1.1.2",
|
|
@@ -1795,7 +1808,7 @@
|
|
|
1795
1808
|
}
|
|
1796
1809
|
},
|
|
1797
1810
|
"node_modules/path-to-regexp": {
|
|
1798
|
-
"version": "0.1.
|
|
1811
|
+
"version": "0.1.10",
|
|
1799
1812
|
"license": "MIT"
|
|
1800
1813
|
},
|
|
1801
1814
|
"node_modules/picomatch": {
|
|
@@ -1863,7 +1876,7 @@
|
|
|
1863
1876
|
"license": "MIT"
|
|
1864
1877
|
},
|
|
1865
1878
|
"node_modules/pump": {
|
|
1866
|
-
"version": "3.0.
|
|
1879
|
+
"version": "3.0.2",
|
|
1867
1880
|
"license": "MIT",
|
|
1868
1881
|
"optional": true,
|
|
1869
1882
|
"dependencies": {
|
|
@@ -1879,10 +1892,10 @@
|
|
|
1879
1892
|
}
|
|
1880
1893
|
},
|
|
1881
1894
|
"node_modules/qs": {
|
|
1882
|
-
"version": "6.
|
|
1895
|
+
"version": "6.13.0",
|
|
1883
1896
|
"license": "BSD-3-Clause",
|
|
1884
1897
|
"dependencies": {
|
|
1885
|
-
"side-channel": "^1.0.
|
|
1898
|
+
"side-channel": "^1.0.6"
|
|
1886
1899
|
},
|
|
1887
1900
|
"engines": {
|
|
1888
1901
|
"node": ">=0.6"
|
|
@@ -2037,7 +2050,7 @@
|
|
|
2037
2050
|
}
|
|
2038
2051
|
},
|
|
2039
2052
|
"node_modules/send": {
|
|
2040
|
-
"version": "0.
|
|
2053
|
+
"version": "0.19.0",
|
|
2041
2054
|
"license": "MIT",
|
|
2042
2055
|
"dependencies": {
|
|
2043
2056
|
"debug": "2.6.9",
|
|
@@ -2069,18 +2082,25 @@
|
|
|
2069
2082
|
"version": "2.0.0",
|
|
2070
2083
|
"license": "MIT"
|
|
2071
2084
|
},
|
|
2085
|
+
"node_modules/send/node_modules/encodeurl": {
|
|
2086
|
+
"version": "1.0.2",
|
|
2087
|
+
"license": "MIT",
|
|
2088
|
+
"engines": {
|
|
2089
|
+
"node": ">= 0.8"
|
|
2090
|
+
}
|
|
2091
|
+
},
|
|
2072
2092
|
"node_modules/send/node_modules/ms": {
|
|
2073
2093
|
"version": "2.1.3",
|
|
2074
2094
|
"license": "MIT"
|
|
2075
2095
|
},
|
|
2076
2096
|
"node_modules/serve-static": {
|
|
2077
|
-
"version": "1.
|
|
2097
|
+
"version": "1.16.2",
|
|
2078
2098
|
"license": "MIT",
|
|
2079
2099
|
"dependencies": {
|
|
2080
|
-
"encodeurl": "~
|
|
2100
|
+
"encodeurl": "~2.0.0",
|
|
2081
2101
|
"escape-html": "~1.0.3",
|
|
2082
2102
|
"parseurl": "~1.3.3",
|
|
2083
|
-
"send": "0.
|
|
2103
|
+
"send": "0.19.0"
|
|
2084
2104
|
},
|
|
2085
2105
|
"engines": {
|
|
2086
2106
|
"node": ">= 0.8.0"
|