@sap/cds 8.9.1 → 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 CHANGED
@@ -4,6 +4,23 @@
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
+
17
+ ## Version 8.9.2 - 2025-04-14
18
+
19
+ ### Fixed
20
+
21
+ - `forUpdate` will not consider `wait` if `ignoreLocked` is set
22
+ - Do not crash in case of custom `DraftAdministrativeData` table
23
+
7
24
  ## Version 8.9.1 - 2025-04-03
8
25
 
9
26
  ### Fixed
@@ -144,7 +144,7 @@ module.exports = function cds_compile_for_lean_drafts(csn) {
144
144
  }
145
145
  if (e.name === 'DraftAdministrativeData') {
146
146
  // redirect to DraftAdministrativeData service entity
147
- _redirect(newEl, active._service.entities.DraftAdministrativeData)
147
+ if (active._service?.entities.DraftAdministrativeData) _redirect(newEl, active._service.entities.DraftAdministrativeData)
148
148
  }
149
149
  Object.defineProperty (newEl,'parent',{value:draft,enumerable:false, configurable: true, writable: true})
150
150
 
@@ -71,7 +71,7 @@ function _4odata (csn,o) {
71
71
  }
72
72
 
73
73
  // o.service is specified now
74
- return cds.compile.for.odata(csn,o)
74
+ return cds.env.features.compile_to_edmx_compat ? cds.compile.for.odata(csn,o) : csn //> leave that to cdsc: cds.compile.for.odata(csn,o)
75
75
  }
76
76
 
77
77
 
package/lib/ql/SELECT.js CHANGED
@@ -152,8 +152,8 @@ class SELECT extends Whereable {
152
152
  forUpdate ({ of, wait = cds.env.sql.lock_acquire_timeout || -1, ignoreLocked } = {}) {
153
153
  const sfu = this.SELECT.forUpdate = {}
154
154
  if (of) sfu.of = of.map (c => ({ref:c.split('.')}))
155
- if (wait >= 0) sfu.wait = wait
156
155
  if (ignoreLocked) sfu.ignoreLocked = true
156
+ else if (wait >= 0) sfu.wait = wait
157
157
  return this
158
158
  }
159
159
 
@@ -99,11 +99,12 @@ class Bindings {
99
99
  }
100
100
 
101
101
  purge() {
102
- if (this.done) return; else this.done = true
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
  }
@@ -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.resolve (cds.root, _source4(def) || '.', '..', impl.slice(2))
27
- try { var resolved = require.resolve(impl, {paths:[ cds.root, cds.home ]}) } catch {
28
- try { resolved = require.resolve(path.join(cds.root, impl)) } catch (e) { // compatibility
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
  }
@@ -155,7 +155,7 @@ const READ_QUERY = `
155
155
  }`
156
156
 
157
157
  const CREATE_MUTATION = `
158
- mutation {
158
+ mutation ($input: ApplicationTemplateInput!) {
159
159
  result: createApplicationTemplate (
160
160
  in: $input
161
161
  ) {
@@ -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] === null) return res.sendStatus(204)
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds",
3
- "version": "8.9.1",
3
+ "version": "8.9.3",
4
4
  "description": "SAP Cloud Application Programming Model - CDS for Node.js",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [