@sap/cds 8.9.5 → 8.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
@@ -4,6 +4,12 @@
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.6 - 2025-07-29
8
+
9
+ ### Fixed
10
+
11
+ - Batch insert using `INSERT.entries()` on draft enabled entities
12
+
7
13
  ## Version 8.9.5 - 2025-07-25
8
14
 
9
15
  ### Fixed
@@ -464,7 +464,7 @@ cds.ApplicationService.prototype.handle = async function (req) {
464
464
  if (!containsDraftRoot) req.reject({ code: 403, statusCode: 403, message: 'DRAFT_MODIFICATION_ONLY_VIA_ROOT' })
465
465
 
466
466
  const isDirectAccess = typeof req.query.INSERT.into === 'string' || req.query.INSERT.into.ref?.length === 1
467
- const data = Object.assign({}, req.data) // IsActiveEntity is not enumerable
467
+ const data = Array.isArray(req.data) ? [...req.data] : Object.assign({}, req.data) // IsActiveEntity is not enumerable
468
468
  const draftsRootRef =
469
469
  typeof query.INSERT.into === 'string'
470
470
  ? [req.target.drafts.name]
@@ -489,7 +489,9 @@ cds.ApplicationService.prototype.handle = async function (req) {
489
489
 
490
490
  const cqn = INSERT.into(query.INSERT.into).entries(data)
491
491
  await run(cqn, { event: 'CREATE' })
492
- const result = { ...data, IsActiveEntity: true }
492
+ const result = Array.isArray(data)
493
+ ? data.map(d => ({ ...d, IsActiveEntity: true }))
494
+ : { ...data, IsActiveEntity: true }
493
495
  req.data = result //> make keys available via req.data (as with normal crud)
494
496
  return result
495
497
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds",
3
- "version": "8.9.5",
3
+ "version": "8.9.6",
4
4
  "description": "SAP Cloud Application Programming Model - CDS for Node.js",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [