@sap/cds 8.9.2 → 8.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.
- package/CHANGELOG.md +10 -0
- package/lib/compile/to/edm.js +1 -1
- package/lib/srv/bindings.js +3 -2
- package/lib/srv/factory.js +4 -4
- package/libx/_runtime/ucl/Service.js +1 -1
- package/libx/odata/middleware/read.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
- The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
5
5
|
- This project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
6
|
|
|
7
|
+
## Version 8.9.3 - 2025-05-06
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- OData: `$value` access of primitive properties returned by custom handler
|
|
12
|
+
- UCL: Add missing declaration of variable `$input` in mutation for creating an application template
|
|
13
|
+
- Purge of `servers` from `.cds-services.json` file
|
|
14
|
+
- Loading of relative service implementations in plugins
|
|
15
|
+
- `cds.compile.to.edmx` in case the model was manipulated in a plugin
|
|
16
|
+
|
|
7
17
|
## Version 8.9.2 - 2025-04-14
|
|
8
18
|
|
|
9
19
|
### Fixed
|
package/lib/compile/to/edm.js
CHANGED
package/lib/srv/bindings.js
CHANGED
|
@@ -99,11 +99,12 @@ class Bindings {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
purge() {
|
|
102
|
-
if (this.done) return;
|
|
102
|
+
if (this.done) return;
|
|
103
103
|
this.load (fs.readFileSync)
|
|
104
104
|
LOG.debug ('purging bindings from:', registry)
|
|
105
105
|
this.cleanup()
|
|
106
106
|
this.store (fs.writeFileSync)
|
|
107
|
+
this.done = true
|
|
107
108
|
}
|
|
108
109
|
|
|
109
110
|
/**
|
|
@@ -113,7 +114,7 @@ class Bindings {
|
|
|
113
114
|
const { servers, provides } = this, { pid } = process
|
|
114
115
|
for (let [key,srv] of Object.entries (provides))
|
|
115
116
|
if (srv.server === pid || url && srv.credentials?.url?.startsWith(url)) delete provides [key]
|
|
116
|
-
delete servers [pid]
|
|
117
|
+
delete servers [pid.toString()]
|
|
117
118
|
return this
|
|
118
119
|
}
|
|
119
120
|
}
|
package/lib/srv/factory.js
CHANGED
|
@@ -23,9 +23,9 @@ function ServiceFactory (name, model, options) {
|
|
|
23
23
|
return _use (impl[name] || impl.default || _kind())
|
|
24
24
|
case 'string':
|
|
25
25
|
if (impl.startsWith('@sap/cds/')) impl = cds.home + impl.slice(8) //> for local tests in @sap/cds dev
|
|
26
|
-
if (impl.startsWith('./')) impl = path.
|
|
27
|
-
try { var resolved = require.resolve(
|
|
28
|
-
try { resolved = require.resolve(
|
|
26
|
+
if (impl.startsWith('./')) impl = path.join (_source4(def) || 'x', '.'+impl)
|
|
27
|
+
try { var resolved = require.resolve (path.join (cds.root, impl)) } catch (e) { // fetch local paths
|
|
28
|
+
try { resolved = require.resolve (impl, {paths:[ cds.root, cds.home ]}) } catch { // fetch in node_modules
|
|
29
29
|
throw cds.error(`Failed loading service implementation from ` + impl, { cause: e })
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -51,7 +51,7 @@ const _sibling = d => {
|
|
|
51
51
|
for (let subdir of ['/', '/lib/', '/handlers/']) {
|
|
52
52
|
for (let ext of exts) try {
|
|
53
53
|
const impl = dir + subdir + name + ext
|
|
54
|
-
return isfile(impl) || require.resolve (impl)
|
|
54
|
+
return isfile(impl) || require.resolve (impl, {paths:[ cds.root, cds.home ]})
|
|
55
55
|
} catch(e) {
|
|
56
56
|
if (e.code !== 'MODULE_NOT_FOUND') throw e
|
|
57
57
|
}
|
|
@@ -246,7 +246,7 @@ module.exports = adapter => {
|
|
|
246
246
|
|
|
247
247
|
// 204
|
|
248
248
|
if (result == null && query.SELECT.one) return res.sendStatus(204)
|
|
249
|
-
if (_propertyAccess && result[_propertyAccess]
|
|
249
|
+
if (_propertyAccess && result[_propertyAccess] == null) return res.sendStatus(204)
|
|
250
250
|
|
|
251
251
|
// 304
|
|
252
252
|
if (validateIfNoneMatch(cdsReq.target, req.headers?.['if-none-match'], result)) return res.sendStatus(304)
|