@sap/cds 8.1.0 → 8.2.0

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/app/index.css +3 -0
  3. package/app/index.js +50 -4
  4. package/bin/serve.js +1 -1
  5. package/lib/compile/cdsc.js +2 -2
  6. package/lib/compile/etc/_localized.js +1 -1
  7. package/lib/compile/for/lean_drafts.js +1 -0
  8. package/lib/compile/to/sql.js +2 -2
  9. package/lib/env/cds-requires.js +6 -0
  10. package/lib/env/defaults.js +14 -3
  11. package/lib/env/plugins.js +6 -22
  12. package/lib/index.js +3 -2
  13. package/lib/linked/classes.js +0 -14
  14. package/lib/linked/types.js +12 -0
  15. package/lib/linked/validate.js +3 -2
  16. package/lib/log/cds-log.js +3 -3
  17. package/lib/log/format/aspects/als.js +23 -29
  18. package/lib/log/format/aspects/cls.js +9 -0
  19. package/lib/log/format/json.js +42 -6
  20. package/lib/ql/Whereable.js +5 -1
  21. package/lib/req/context.js +1 -0
  22. package/lib/req/locale.js +1 -1
  23. package/lib/srv/cds-connect.js +33 -32
  24. package/lib/srv/cds-serve.js +2 -1
  25. package/lib/srv/srv-tx.js +1 -0
  26. package/lib/utils/cds-utils.js +4 -2
  27. package/libx/_runtime/cds-services/adapter/odata-v4/utils/metaInfo.js +1 -5
  28. package/libx/_runtime/cds-services/adapter/odata-v4/utils/result.js +2 -31
  29. package/libx/_runtime/common/generic/auth/utils.js +2 -0
  30. package/libx/_runtime/common/generic/input.js +2 -11
  31. package/libx/_runtime/common/generic/put.js +1 -10
  32. package/libx/_runtime/common/utils/binary.js +1 -7
  33. package/libx/_runtime/common/utils/cqn2cqn4sql.js +10 -1
  34. package/libx/_runtime/common/utils/resolveView.js +2 -2
  35. package/libx/_runtime/common/utils/search2cqn4sql.js +1 -1
  36. package/libx/_runtime/common/utils/streamProp.js +12 -1
  37. package/libx/_runtime/common/utils/template.js +26 -16
  38. package/libx/_runtime/common/utils/templateProcessor.js +8 -7
  39. package/libx/_runtime/common/utils/ucsn.js +2 -5
  40. package/libx/_runtime/db/expand/expandCQNToJoin.js +43 -2
  41. package/libx/_runtime/db/generic/input.js +1 -5
  42. package/libx/_runtime/fiori/lean-draft.js +287 -96
  43. package/libx/_runtime/messaging/event-broker.js +105 -40
  44. package/libx/_runtime/remote/Service.js +3 -1
  45. package/libx/_runtime/remote/utils/client.js +12 -4
  46. package/libx/_runtime/ucl/Service.js +16 -6
  47. package/libx/odata/middleware/batch.js +2 -2
  48. package/libx/odata/middleware/create.js +5 -0
  49. package/libx/odata/middleware/delete.js +5 -0
  50. package/libx/odata/middleware/error.js +1 -0
  51. package/libx/odata/middleware/operation.js +6 -0
  52. package/libx/odata/middleware/read.js +16 -11
  53. package/libx/odata/middleware/stream.js +4 -5
  54. package/libx/odata/middleware/update.js +9 -4
  55. package/libx/odata/parse/afterburner.js +3 -2
  56. package/libx/odata/parse/multipartToJson.js +1 -1
  57. package/libx/odata/utils/index.js +3 -3
  58. package/libx/odata/utils/postProcess.js +3 -25
  59. package/libx/rest/middleware/error.js +1 -0
  60. package/libx/rest/middleware/parse.js +1 -6
  61. package/package.json +2 -2
@@ -6,7 +6,6 @@ const { getKeysAndParamsFromPath } = require('../../common/utils')
6
6
  const { base64ToBuffer } = require('../../_runtime/common/utils/binary')
7
7
  const { convertStructured } = require('../../_runtime/common/utils/ucsn')
8
8
  const getTemplate = require('../../_runtime/common/utils/template')
9
- const templateProcessor = require('../../_runtime/common/utils/templateProcessor')
10
9
 
11
10
  const { checkStaticElementByKey } = require('../../_runtime/cds-services/util/assert')
12
11
 
@@ -151,11 +150,7 @@ module.exports = adapter => {
151
150
  cleanupStruct: cds.env.features.rest_struct_data
152
151
  })
153
152
  const template = getTemplate(_cache(req), service, definition, { pick: _picker })
154
- if (template && template.elements.size) {
155
- for (const row of Array.isArray(payload) ? payload : [payload]) {
156
- templateProcessor({ processFn: _processorFn(errs), row, template })
157
- }
158
- }
153
+ template.process(payload, _processorFn(errs))
159
154
  if (errs.length) {
160
155
  if (errs.length === 1) throw errs[0]
161
156
  throw Object.assign(new Error('MULTIPLE_ERRORS'), { statusCode: 400, details: errs })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "description": "SAP Cloud Application Programming Model - CDS for Node.js",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [
@@ -35,7 +35,7 @@
35
35
  "node": ">=18"
36
36
  },
37
37
  "dependencies": {
38
- "@sap/cds-compiler": ">=5",
38
+ "@sap/cds-compiler": ">=5.1",
39
39
  "@sap/cds-fiori": "^1",
40
40
  "@sap/cds-foss": "^5.0.0"
41
41
  },