@sap/cds-dk 7.9.1 → 7.9.3
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.
|
@@ -26,7 +26,10 @@ class BindingResolver {
|
|
|
26
26
|
|
|
27
27
|
const resolvedBindings = {}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
// Serialized because of parallelization issues in the cf CLI,
|
|
30
|
+
// see https://github.com/cloudfoundry/cli/issues/2232
|
|
31
|
+
// await Promise.all(Object.keys(bindings).map(async name => {
|
|
32
|
+
for (const name of Object.keys(bindings)) {
|
|
30
33
|
const binding = bindings[name]
|
|
31
34
|
const cacheKey = JSON.stringify(binding)
|
|
32
35
|
let resolvedBinding
|
|
@@ -37,7 +40,7 @@ class BindingResolver {
|
|
|
37
40
|
resolvedBinding = cache[cacheKey]
|
|
38
41
|
}
|
|
39
42
|
resolvedBindings[name] = resolvedBinding
|
|
40
|
-
}
|
|
43
|
+
}
|
|
41
44
|
return Object.keys(resolvedBindings).length > 0 ? resolvedBindings : undefined
|
|
42
45
|
}
|
|
43
46
|
|
package/lib/bind/index.js
CHANGED
|
@@ -31,10 +31,13 @@ async function bind(options) {
|
|
|
31
31
|
|
|
32
32
|
const onText = { 'cf': 'Cloud Foundry', 'k8s': 'Kubernetes' }[on];
|
|
33
33
|
if (!options['to-app-services']) logger.log(`Retrieving data from ${bold(onText)}...`);
|
|
34
|
-
let resolvedServices
|
|
35
34
|
|
|
36
35
|
const targets = options.to.split(/,/g);
|
|
37
|
-
|
|
36
|
+
// Serialized because of parallelization issues in the cf CLI,
|
|
37
|
+
// see https://github.com/cloudfoundry/cli/issues/2232
|
|
38
|
+
// resolvedServices = await Promise.all(targets.map(async target => {
|
|
39
|
+
const resolvedServices = [];
|
|
40
|
+
for (const target of targets) {
|
|
38
41
|
let binding;
|
|
39
42
|
if (on === 'k8s') {
|
|
40
43
|
binding = { type: on, name: target };
|
|
@@ -48,8 +51,8 @@ async function bind(options) {
|
|
|
48
51
|
resolvedService._target = target;
|
|
49
52
|
delete resolvedService.credentials;
|
|
50
53
|
resolvedService.binding.resolved = false;
|
|
51
|
-
|
|
52
|
-
}
|
|
54
|
+
resolvedServices.push(resolvedService);
|
|
55
|
+
}
|
|
53
56
|
|
|
54
57
|
if (options.kind) {
|
|
55
58
|
resolvedServices.forEach(service => service.kind = options.kind);
|
|
@@ -289,32 +289,44 @@ function randomFromReferenceData (entity, csn, referenceData) {
|
|
|
289
289
|
.map(([file]) => file)
|
|
290
290
|
if (files.length === 0) return
|
|
291
291
|
|
|
292
|
-
|
|
293
|
-
const content = cds.utils.fs.readFileSync(files[0]).toString()
|
|
292
|
+
const toCSV = (content) => {
|
|
294
293
|
const records = cds.parse.csv(content)
|
|
295
294
|
if (records?.length > 1) {
|
|
296
295
|
const header = records[0] // 0 is header line
|
|
297
296
|
const randomRecord = records.length === 2 ? records[1] : records[randomIntInRange({from: 1, to: records.length-1} )]
|
|
298
297
|
let result = {}
|
|
299
298
|
for (let i = 0; i < records[0].length; i++) {
|
|
300
|
-
|
|
299
|
+
// For csv, which is all strings, convert decimal values to numbers
|
|
300
|
+
// boolean is already covered by CSV parser
|
|
301
|
+
const val = /^cds\.(U?Int|Decimal|Double)/.test(entity.elements[header[i]]?.type) ? +randomRecord[i] : randomRecord[i]
|
|
302
|
+
result[header[i]] = val
|
|
301
303
|
}
|
|
302
304
|
return result
|
|
303
305
|
}
|
|
304
306
|
}
|
|
307
|
+
const toJSON = (records) => {
|
|
308
|
+
if (records.length === 1)
|
|
309
|
+
return records[0]
|
|
310
|
+
else if (records.length > 1)
|
|
311
|
+
return records[randomIntInRange({from: 0, to: records.length-1} )]
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (files[0].endsWith('.csv')) {
|
|
315
|
+
const content = cds.utils.fs.readFileSync(files[0]).toString()
|
|
316
|
+
return toCSV(content)
|
|
317
|
+
}
|
|
318
|
+
else if (files[0].endsWith('.json')) {
|
|
319
|
+
const content = cds.utils.fs.readFileSync(files[0]).toString()
|
|
320
|
+
const records = JSON.parse(content)
|
|
321
|
+
return toJSON(records)
|
|
322
|
+
}
|
|
305
323
|
else {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
content = cds.utils.fs.readFileSync(files[0]).toString()
|
|
309
|
-
} else {
|
|
310
|
-
content = files[0] // for tests, assuming the content is given inline
|
|
311
|
-
}
|
|
312
|
-
if (content) {
|
|
324
|
+
const content = files[0] // for tests, assuming the content is given inline
|
|
325
|
+
try {
|
|
313
326
|
const records = JSON.parse(content)
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
return records[randomIntInRange({from: 0, to: records.length-1} )]
|
|
327
|
+
return toJSON(records)
|
|
328
|
+
} catch {
|
|
329
|
+
return toCSV(content)
|
|
318
330
|
}
|
|
319
331
|
}
|
|
320
332
|
}
|
|
@@ -27,13 +27,13 @@ modules:
|
|
|
27
27
|
{{/isNodejs}}
|
|
28
28
|
{{#isJava}}
|
|
29
29
|
parameters:
|
|
30
|
-
buildpack:
|
|
30
|
+
buildpack: sap_java_buildpack_jakarta
|
|
31
31
|
readiness-health-check-type: http
|
|
32
32
|
readiness-health-check-http-endpoint: /
|
|
33
33
|
properties:
|
|
34
34
|
SPRING_PROFILES_ACTIVE: cloud,sandbox
|
|
35
35
|
JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jre.SAPMachineJRE']"
|
|
36
|
-
JBP_CONFIG_SAP_MACHINE_JRE: '{
|
|
36
|
+
JBP_CONFIG_SAP_MACHINE_JRE: '{ version: {{jdkVersion}}.+ }'
|
|
37
37
|
build-parameters:
|
|
38
38
|
builder: custom
|
|
39
39
|
commands:
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap/cds-dk",
|
|
3
|
-
"version": "7.9.
|
|
3
|
+
"version": "7.9.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@sap/cds-dk",
|
|
9
|
-
"version": "7.9.
|
|
9
|
+
"version": "7.9.3",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@sap/cds": "^7",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"node_modules/@eslint-community/regexpp": {
|
|
56
|
-
"version": "4.10.
|
|
56
|
+
"version": "4.10.1",
|
|
57
57
|
"license": "MIT",
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"node_modules/@eslint/eslintrc/node_modules/debug": {
|
|
84
|
-
"version": "4.3.
|
|
84
|
+
"version": "4.3.5",
|
|
85
85
|
"license": "MIT",
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"ms": "2.1.2"
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
"node_modules/@humanwhocodes/config-array/node_modules/debug": {
|
|
127
|
-
"version": "4.3.
|
|
127
|
+
"version": "4.3.5",
|
|
128
128
|
"license": "MIT",
|
|
129
129
|
"dependencies": {
|
|
130
130
|
"ms": "2.1.2"
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
}
|
|
209
209
|
},
|
|
210
210
|
"node_modules/@sap/cds": {
|
|
211
|
-
"version": "7.9.
|
|
211
|
+
"version": "7.9.2",
|
|
212
212
|
"license": "SEE LICENSE IN LICENSE",
|
|
213
213
|
"dependencies": {
|
|
214
214
|
"@cap-js/cds-types": "<1",
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
}
|
|
226
226
|
},
|
|
227
227
|
"node_modules/@sap/cds-compiler": {
|
|
228
|
-
"version": "4.9.
|
|
228
|
+
"version": "4.9.4",
|
|
229
229
|
"license": "SEE LICENSE IN LICENSE",
|
|
230
230
|
"dependencies": {
|
|
231
231
|
"antlr4": "4.9.3"
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
}
|
|
262
262
|
},
|
|
263
263
|
"node_modules/@sap/cds-mtxs": {
|
|
264
|
-
"version": "1.18.
|
|
264
|
+
"version": "1.18.1",
|
|
265
265
|
"license": "SEE LICENSE IN LICENSE",
|
|
266
266
|
"dependencies": {
|
|
267
267
|
"@sap/hdi-deploy": "^4",
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
}
|
|
274
274
|
},
|
|
275
275
|
"node_modules/@sap/eslint-plugin-cds": {
|
|
276
|
-
"version": "3.0.
|
|
276
|
+
"version": "3.0.3",
|
|
277
277
|
"license": "See LICENSE file",
|
|
278
278
|
"dependencies": {
|
|
279
279
|
"@sap/cds": ">=5.6.0",
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
}
|
|
288
288
|
},
|
|
289
289
|
"node_modules/@sap/hana-client": {
|
|
290
|
-
"version": "2.20.
|
|
290
|
+
"version": "2.20.22",
|
|
291
291
|
"hasInstallScript": true,
|
|
292
292
|
"license": "SEE LICENSE IN developer-license-3_1.txt",
|
|
293
293
|
"dependencies": {
|
|
@@ -320,17 +320,17 @@
|
|
|
320
320
|
}
|
|
321
321
|
},
|
|
322
322
|
"node_modules/@sap/hdi-deploy": {
|
|
323
|
-
"version": "4.9.
|
|
323
|
+
"version": "4.9.5",
|
|
324
324
|
"license": "See LICENSE file",
|
|
325
325
|
"dependencies": {
|
|
326
|
-
"@sap/hana-client": "2.20.
|
|
326
|
+
"@sap/hana-client": "2.20.22",
|
|
327
327
|
"@sap/hdi": "4.5.2",
|
|
328
328
|
"@sap/xsenv": "4.2.0",
|
|
329
329
|
"async": "3.2.3",
|
|
330
330
|
"dotenv": "10.0.0",
|
|
331
331
|
"handlebars": "4.7.7",
|
|
332
|
-
"hdb": "0.19.
|
|
333
|
-
"micromatch": "4.0.
|
|
332
|
+
"hdb": "0.19.8",
|
|
333
|
+
"micromatch": "4.0.7"
|
|
334
334
|
},
|
|
335
335
|
"engines": {
|
|
336
336
|
"node": "^12.0.0 || ^14.0.0 || ^16.0.0 || ^18.0.0 || ^20.0.0"
|
|
@@ -424,7 +424,7 @@
|
|
|
424
424
|
}
|
|
425
425
|
},
|
|
426
426
|
"node_modules/agent-base/node_modules/debug": {
|
|
427
|
-
"version": "4.3.
|
|
427
|
+
"version": "4.3.5",
|
|
428
428
|
"license": "MIT",
|
|
429
429
|
"optional": true,
|
|
430
430
|
"dependencies": {
|
|
@@ -549,7 +549,7 @@
|
|
|
549
549
|
"license": "MIT"
|
|
550
550
|
},
|
|
551
551
|
"node_modules/axios": {
|
|
552
|
-
"version": "1.
|
|
552
|
+
"version": "1.7.2",
|
|
553
553
|
"license": "MIT",
|
|
554
554
|
"dependencies": {
|
|
555
555
|
"follow-redirects": "^1.15.6",
|
|
@@ -647,10 +647,10 @@
|
|
|
647
647
|
}
|
|
648
648
|
},
|
|
649
649
|
"node_modules/braces": {
|
|
650
|
-
"version": "3.0.
|
|
650
|
+
"version": "3.0.3",
|
|
651
651
|
"license": "MIT",
|
|
652
652
|
"dependencies": {
|
|
653
|
-
"fill-range": "^7.
|
|
653
|
+
"fill-range": "^7.1.1"
|
|
654
654
|
},
|
|
655
655
|
"engines": {
|
|
656
656
|
"node": ">=8"
|
|
@@ -1141,7 +1141,7 @@
|
|
|
1141
1141
|
}
|
|
1142
1142
|
},
|
|
1143
1143
|
"node_modules/eslint/node_modules/debug": {
|
|
1144
|
-
"version": "4.3.
|
|
1144
|
+
"version": "4.3.5",
|
|
1145
1145
|
"license": "MIT",
|
|
1146
1146
|
"dependencies": {
|
|
1147
1147
|
"ms": "2.1.2"
|
|
@@ -1312,7 +1312,7 @@
|
|
|
1312
1312
|
"optional": true
|
|
1313
1313
|
},
|
|
1314
1314
|
"node_modules/fill-range": {
|
|
1315
|
-
"version": "7.
|
|
1315
|
+
"version": "7.1.1",
|
|
1316
1316
|
"license": "MIT",
|
|
1317
1317
|
"dependencies": {
|
|
1318
1318
|
"to-regex-range": "^5.0.1"
|
|
@@ -1624,7 +1624,7 @@
|
|
|
1624
1624
|
}
|
|
1625
1625
|
},
|
|
1626
1626
|
"node_modules/hdb": {
|
|
1627
|
-
"version": "0.19.
|
|
1627
|
+
"version": "0.19.8",
|
|
1628
1628
|
"license": "Apache-2.0",
|
|
1629
1629
|
"dependencies": {
|
|
1630
1630
|
"iconv-lite": "^0.4.18"
|
|
@@ -1666,7 +1666,7 @@
|
|
|
1666
1666
|
}
|
|
1667
1667
|
},
|
|
1668
1668
|
"node_modules/http-proxy-agent/node_modules/debug": {
|
|
1669
|
-
"version": "4.3.
|
|
1669
|
+
"version": "4.3.5",
|
|
1670
1670
|
"license": "MIT",
|
|
1671
1671
|
"optional": true,
|
|
1672
1672
|
"dependencies": {
|
|
@@ -1699,7 +1699,7 @@
|
|
|
1699
1699
|
}
|
|
1700
1700
|
},
|
|
1701
1701
|
"node_modules/https-proxy-agent/node_modules/debug": {
|
|
1702
|
-
"version": "4.3.
|
|
1702
|
+
"version": "4.3.5",
|
|
1703
1703
|
"license": "MIT",
|
|
1704
1704
|
"optional": true,
|
|
1705
1705
|
"dependencies": {
|
|
@@ -2008,11 +2008,11 @@
|
|
|
2008
2008
|
}
|
|
2009
2009
|
},
|
|
2010
2010
|
"node_modules/micromatch": {
|
|
2011
|
-
"version": "4.0.
|
|
2011
|
+
"version": "4.0.7",
|
|
2012
2012
|
"license": "MIT",
|
|
2013
2013
|
"dependencies": {
|
|
2014
|
-
"braces": "^3.0.
|
|
2015
|
-
"picomatch": "^2.
|
|
2014
|
+
"braces": "^3.0.3",
|
|
2015
|
+
"picomatch": "^2.3.1"
|
|
2016
2016
|
},
|
|
2017
2017
|
"engines": {
|
|
2018
2018
|
"node": ">=8.6"
|
|
@@ -2214,7 +2214,7 @@
|
|
|
2214
2214
|
"license": "MIT"
|
|
2215
2215
|
},
|
|
2216
2216
|
"node_modules/node-abi": {
|
|
2217
|
-
"version": "3.
|
|
2217
|
+
"version": "3.63.0",
|
|
2218
2218
|
"license": "MIT",
|
|
2219
2219
|
"optional": true,
|
|
2220
2220
|
"dependencies": {
|
|
@@ -2684,15 +2684,12 @@
|
|
|
2684
2684
|
"license": "MIT"
|
|
2685
2685
|
},
|
|
2686
2686
|
"node_modules/sax": {
|
|
2687
|
-
"version": "1.
|
|
2687
|
+
"version": "1.4.1",
|
|
2688
2688
|
"license": "ISC"
|
|
2689
2689
|
},
|
|
2690
2690
|
"node_modules/semver": {
|
|
2691
|
-
"version": "7.6.
|
|
2691
|
+
"version": "7.6.2",
|
|
2692
2692
|
"license": "ISC",
|
|
2693
|
-
"dependencies": {
|
|
2694
|
-
"lru-cache": "^6.0.0"
|
|
2695
|
-
},
|
|
2696
2693
|
"bin": {
|
|
2697
2694
|
"semver": "bin/semver.js"
|
|
2698
2695
|
},
|
|
@@ -2700,20 +2697,6 @@
|
|
|
2700
2697
|
"node": ">=10"
|
|
2701
2698
|
}
|
|
2702
2699
|
},
|
|
2703
|
-
"node_modules/semver/node_modules/lru-cache": {
|
|
2704
|
-
"version": "6.0.0",
|
|
2705
|
-
"license": "ISC",
|
|
2706
|
-
"dependencies": {
|
|
2707
|
-
"yallist": "^4.0.0"
|
|
2708
|
-
},
|
|
2709
|
-
"engines": {
|
|
2710
|
-
"node": ">=10"
|
|
2711
|
-
}
|
|
2712
|
-
},
|
|
2713
|
-
"node_modules/semver/node_modules/yallist": {
|
|
2714
|
-
"version": "4.0.0",
|
|
2715
|
-
"license": "ISC"
|
|
2716
|
-
},
|
|
2717
2700
|
"node_modules/send": {
|
|
2718
2701
|
"version": "0.18.0",
|
|
2719
2702
|
"license": "MIT",
|
|
@@ -2905,7 +2888,7 @@
|
|
|
2905
2888
|
}
|
|
2906
2889
|
},
|
|
2907
2890
|
"node_modules/socks-proxy-agent/node_modules/debug": {
|
|
2908
|
-
"version": "4.3.
|
|
2891
|
+
"version": "4.3.5",
|
|
2909
2892
|
"license": "MIT",
|
|
2910
2893
|
"optional": true,
|
|
2911
2894
|
"dependencies": {
|
|
@@ -3297,7 +3280,7 @@
|
|
|
3297
3280
|
}
|
|
3298
3281
|
},
|
|
3299
3282
|
"node_modules/yaml": {
|
|
3300
|
-
"version": "2.4.
|
|
3283
|
+
"version": "2.4.3",
|
|
3301
3284
|
"license": "ISC",
|
|
3302
3285
|
"bin": {
|
|
3303
3286
|
"yaml": "bin.mjs"
|