@sap/cds 7.9.2 → 8.0.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.
Files changed (279) hide show
  1. package/CHANGELOG.md +139 -3656
  2. package/_i18n/i18n_en_US_saptrc.properties +113 -0
  3. package/_i18n/i18n_zh_CN.properties +7 -4
  4. package/app/index.css +129 -0
  5. package/app/index.html +16 -64
  6. package/app/index.js +14 -9
  7. package/bin/args.js +34 -0
  8. package/bin/serve.js +18 -24
  9. package/bin/test.js +97 -0
  10. package/common.cds +5 -12
  11. package/eslint.config.mjs +133 -0
  12. package/lib/auth/basic-auth.js +16 -20
  13. package/lib/auth/dummy-auth.js +1 -1
  14. package/lib/auth/ias-auth.js +12 -30
  15. package/lib/auth/index.js +1 -14
  16. package/lib/auth/jwt-auth.js +14 -30
  17. package/lib/compile/cds-compile.js +1 -2
  18. package/lib/compile/cdsc.js +21 -26
  19. package/lib/compile/etc/_localized.js +1 -6
  20. package/lib/compile/etc/csv.js +1 -1
  21. package/lib/compile/etc/properties.js +1 -1
  22. package/lib/compile/for/java.js +1 -1
  23. package/lib/compile/for/lean_drafts.js +4 -6
  24. package/lib/compile/for/nodejs.js +1 -1
  25. package/lib/compile/parse.js +4 -0
  26. package/lib/compile/resolve.js +4 -4
  27. package/lib/compile/to/edm-files.js +16 -23
  28. package/lib/compile/to/hana.js +27 -0
  29. package/lib/compile/to/json.js +1 -1
  30. package/lib/compile/to/sql.js +5 -1
  31. package/lib/compile/to/srvinfo.js +1 -1
  32. package/lib/compile/to/yaml.js +3 -3
  33. package/lib/dbs/cds-deploy.js +4 -2
  34. package/lib/env/cds-env.js +10 -14
  35. package/lib/env/cds-requires.js +29 -13
  36. package/lib/env/defaults.js +46 -16
  37. package/lib/env/plugins.js +1 -1
  38. package/lib/env/schemas/cds-rc.js +8 -4
  39. package/lib/env/schemas/index.js +7 -7
  40. package/lib/env/serviceBindings.js +1 -1
  41. package/lib/index.js +12 -10
  42. package/lib/lazy.js +1 -1
  43. package/lib/linked/classes.js +36 -8
  44. package/lib/linked/entities.js +2 -10
  45. package/lib/linked/models.js +2 -1
  46. package/lib/linked/validate.js +292 -0
  47. package/lib/log/cds-error.js +0 -6
  48. package/lib/log/cds-log.js +3 -3
  49. package/lib/log/format/json.js +1 -1
  50. package/lib/log/service/index.js +0 -1
  51. package/lib/plugins.js +3 -3
  52. package/lib/ql/Query.js +2 -10
  53. package/lib/ql/SELECT.js +1 -1
  54. package/lib/ql/Whereable.js +3 -2
  55. package/lib/req/cds-context.js +14 -25
  56. package/lib/req/context.js +23 -25
  57. package/lib/req/request.js +1 -34
  58. package/lib/req/user.js +47 -35
  59. package/lib/srv/bindings.js +1 -1
  60. package/lib/srv/cds-connect.js +4 -4
  61. package/lib/srv/cds-serve.js +2 -2
  62. package/lib/srv/factory.js +1 -1
  63. package/lib/srv/middlewares/cds-context.js +11 -22
  64. package/lib/srv/middlewares/ctx-model.js +2 -3
  65. package/lib/srv/middlewares/errors.js +41 -8
  66. package/lib/srv/middlewares/index.js +3 -3
  67. package/lib/srv/middlewares/trace.js +0 -2
  68. package/lib/srv/protocols/hcql.js +15 -10
  69. package/lib/srv/protocols/http.js +44 -49
  70. package/lib/srv/protocols/index.js +1 -23
  71. package/lib/srv/protocols/odata-v4.js +12 -74
  72. package/lib/srv/protocols/rest.js +1 -13
  73. package/lib/srv/srv-api.js +0 -20
  74. package/lib/srv/srv-dispatch.js +3 -2
  75. package/lib/srv/srv-handlers.js +22 -11
  76. package/lib/srv/srv-methods.js +2 -2
  77. package/lib/srv/srv-models.js +3 -36
  78. package/lib/test/expect.js +343 -0
  79. package/lib/test/index.js +2 -0
  80. package/lib/test/reporter.js +176 -0
  81. package/lib/utils/axios.js +10 -9
  82. package/lib/utils/cds-test.js +86 -37
  83. package/lib/utils/cds-utils.js +54 -7
  84. package/lib/utils/check-version.js +0 -4
  85. package/lib/utils/colors.js +49 -0
  86. package/lib/utils/data.js +5 -4
  87. package/libx/_runtime/cds-services/adapter/odata-v4/OData.js +2 -7
  88. package/libx/_runtime/cds-services/adapter/odata-v4/ODataRequest.js +3 -30
  89. package/libx/_runtime/cds-services/adapter/odata-v4/handlers/error.js +6 -12
  90. package/libx/_runtime/cds-services/adapter/odata-v4/handlers/metadata.js +1 -3
  91. package/libx/_runtime/cds-services/adapter/odata-v4/handlers/read.js +0 -1
  92. package/libx/_runtime/cds-services/adapter/odata-v4/handlers/request.js +4 -7
  93. package/libx/_runtime/cds-services/adapter/odata-v4/handlers/update.js +12 -6
  94. package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/ExpressionToCQN.js +2 -4
  95. package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/applyToCQN.js +1 -0
  96. package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/expandToCQN.js +1 -1
  97. package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/index.js +0 -1
  98. package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/readToCQN.js +1 -3
  99. package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/utils.js +1 -1
  100. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-commons/edm/AbstractEdmStructuredType.js +1 -2
  101. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/deserializer/ResourceJsonDeserializer.js +5 -0
  102. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/serializer/ContextURLFactory.js +1 -1
  103. package/libx/_runtime/cds-services/adapter/odata-v4/utils/data.js +9 -43
  104. package/libx/_runtime/cds-services/adapter/odata-v4/utils/metaInfo.js +0 -1
  105. package/libx/_runtime/cds-services/adapter/odata-v4/utils/readAfterWrite.js +8 -3
  106. package/libx/_runtime/cds-services/adapter/odata-v4/utils/request.js +4 -2
  107. package/libx/_runtime/cds-services/adapter/odata-v4/utils/result.js +1 -3
  108. package/libx/_runtime/cds-services/util/assert.js +1 -1
  109. package/libx/_runtime/cds.js +10 -3
  110. package/libx/_runtime/common/Service.js +12 -32
  111. package/libx/_runtime/common/aspects/any.js +1 -0
  112. package/libx/_runtime/common/code-ext/execute.js +1 -1
  113. package/libx/_runtime/common/code-ext/worker.js +0 -1
  114. package/libx/_runtime/common/composition/data.js +0 -1
  115. package/libx/_runtime/common/composition/delete.js +0 -1
  116. package/libx/_runtime/common/composition/insert.js +2 -2
  117. package/libx/_runtime/common/composition/tree.js +0 -1
  118. package/libx/_runtime/common/composition/update.js +3 -3
  119. package/libx/_runtime/common/error/frontend.js +21 -12
  120. package/libx/_runtime/common/error/log.js +36 -0
  121. package/libx/_runtime/common/error/utils.js +2 -5
  122. package/libx/_runtime/common/generic/auth/autoexpose.js +18 -17
  123. package/libx/_runtime/common/generic/auth/expand.js +1 -1
  124. package/libx/_runtime/common/generic/auth/readOnly.js +1 -2
  125. package/libx/_runtime/common/generic/auth/restrict.js +23 -42
  126. package/libx/_runtime/common/generic/auth/restrictions.js +2 -7
  127. package/libx/_runtime/common/generic/auth/utils.js +91 -88
  128. package/libx/_runtime/common/generic/crud.js +6 -5
  129. package/libx/_runtime/common/generic/etag.js +7 -12
  130. package/libx/_runtime/common/generic/input.js +70 -68
  131. package/libx/_runtime/common/generic/paging.js +1 -0
  132. package/libx/_runtime/common/generic/sorting.js +1 -0
  133. package/libx/_runtime/common/generic/temporal.js +8 -2
  134. package/libx/_runtime/common/i18n/index.js +1 -1
  135. package/libx/_runtime/common/i18n/messages.properties +3 -1
  136. package/libx/_runtime/common/utils/binary.js +8 -2
  137. package/libx/_runtime/common/utils/compareJson.js +5 -1
  138. package/libx/_runtime/common/utils/copy.js +6 -11
  139. package/libx/_runtime/common/utils/cqn2cqn4sql.js +16 -14
  140. package/libx/_runtime/common/utils/differ.js +3 -6
  141. package/libx/_runtime/common/utils/keys.js +77 -18
  142. package/libx/_runtime/common/utils/postProcess.js +12 -15
  143. package/libx/_runtime/common/utils/propagateForeignKeys.js +0 -1
  144. package/libx/_runtime/common/utils/resolveView.js +2 -3
  145. package/libx/_runtime/common/utils/restrictions.js +45 -17
  146. package/libx/_runtime/common/utils/rewriteAsterisks.js +1 -8
  147. package/libx/_runtime/common/utils/stream.js +3 -16
  148. package/libx/_runtime/common/utils/streamProp.js +8 -18
  149. package/libx/_runtime/common/utils/structured.js +1 -1
  150. package/libx/_runtime/common/utils/ucsn.js +0 -2
  151. package/libx/_runtime/db/Service.js +0 -72
  152. package/libx/_runtime/db/data-conversion/post-processing.js +0 -1
  153. package/libx/_runtime/db/expand/expandCQNToJoin.js +9 -9
  154. package/libx/_runtime/db/expand/rawToExpanded.js +0 -8
  155. package/libx/_runtime/db/generic/input.js +3 -8
  156. package/libx/_runtime/db/generic/rewrite.js +27 -4
  157. package/libx/_runtime/db/query/read.js +2 -2
  158. package/libx/_runtime/db/sql-builder/ExpressionBuilder.js +0 -1
  159. package/libx/_runtime/db/sql-builder/InsertBuilder.js +1 -1
  160. package/libx/_runtime/db/utils/columns.js +2 -6
  161. package/libx/_runtime/fiori/lean-draft.js +138 -56
  162. package/libx/_runtime/hana/Service.js +0 -1
  163. package/libx/_runtime/hana/driver.js +1 -1
  164. package/libx/_runtime/hana/dynatrace.js +1 -2
  165. package/libx/_runtime/hana/pool.js +11 -21
  166. package/libx/_runtime/hana/streaming.js +0 -1
  167. package/libx/_runtime/messaging/common-utils/AMQPClient.js +0 -1
  168. package/libx/_runtime/messaging/common-utils/authorizedRequest.js +1 -1
  169. package/libx/_runtime/messaging/common-utils/normalizeIncomingMessage.js +1 -1
  170. package/libx/_runtime/messaging/enterprise-messaging-utils/getTenantInfo.js +1 -1
  171. package/libx/_runtime/messaging/enterprise-messaging-utils/registerEndpoints.js +19 -33
  172. package/libx/_runtime/messaging/event-broker.js +0 -12
  173. package/libx/_runtime/messaging/file-based.js +3 -3
  174. package/libx/_runtime/messaging/http-utils/token.js +1 -1
  175. package/libx/_runtime/messaging/kafka.js +2 -2
  176. package/libx/_runtime/messaging/redis-messaging.js +0 -1
  177. package/libx/_runtime/remote/Service.js +25 -25
  178. package/libx/_runtime/remote/utils/client.js +4 -5
  179. package/libx/_runtime/remote/utils/cloudSdkProvider.js +0 -3
  180. package/libx/_runtime/remote/utils/data.js +0 -1
  181. package/libx/_runtime/sqlite/Service.js +1 -2
  182. package/libx/_runtime/ucl/Service.js +37 -78
  183. package/libx/common/assert/index.js +22 -21
  184. package/libx/common/assert/type-relaxed.js +39 -0
  185. package/libx/common/assert/utils.js +3 -2
  186. package/libx/common/assert/validation.js +3 -8
  187. package/libx/common/utils/index.js +5 -0
  188. package/libx/common/utils/path.js +51 -0
  189. package/libx/odata/ODataAdapter.js +126 -0
  190. package/libx/odata/index.js +15 -2
  191. package/libx/odata/middleware/batch.js +261 -72
  192. package/libx/odata/middleware/body-parser.js +33 -0
  193. package/libx/odata/middleware/create.js +44 -59
  194. package/libx/odata/middleware/delete.js +23 -12
  195. package/libx/odata/middleware/error.js +30 -6
  196. package/libx/odata/middleware/metadata.js +38 -26
  197. package/libx/odata/middleware/operation.js +93 -69
  198. package/libx/odata/middleware/parse.js +6 -8
  199. package/libx/odata/middleware/read.js +117 -93
  200. package/libx/odata/middleware/service-document.js +22 -19
  201. package/libx/odata/middleware/stream.js +54 -56
  202. package/libx/odata/middleware/update.js +79 -87
  203. package/libx/odata/parse/afterburner.js +191 -175
  204. package/libx/odata/parse/cqn2odata.js +8 -8
  205. package/libx/odata/parse/grammar.peggy +27 -20
  206. package/libx/odata/parse/multipartToJson.js +17 -9
  207. package/libx/odata/parse/parser.js +1 -1
  208. package/libx/odata/utils/etag.js +14 -6
  209. package/libx/odata/utils/index.js +84 -12
  210. package/libx/odata/utils/metadata.js +161 -0
  211. package/libx/odata/utils/postProcess.js +89 -0
  212. package/libx/odata/utils/readAfterWrite.js +134 -17
  213. package/libx/odata/utils/result.js +36 -142
  214. package/libx/outbox/index.js +5 -4
  215. package/libx/rest/RestAdapter.js +115 -182
  216. package/libx/rest/middleware/create.js +28 -24
  217. package/libx/rest/middleware/delete.js +7 -10
  218. package/libx/rest/middleware/error.js +19 -16
  219. package/libx/rest/middleware/operation.js +48 -41
  220. package/libx/rest/middleware/parse.js +128 -126
  221. package/libx/rest/middleware/read.js +20 -27
  222. package/libx/rest/middleware/update.js +26 -31
  223. package/package.json +16 -12
  224. package/server.js +4 -2
  225. package/tasks/enterprise-messaging-deploy.js +1 -1
  226. package/apis/cds.d.ts +0 -3
  227. package/apis/core.d.ts +0 -21
  228. package/apis/cqn.d.ts +0 -18
  229. package/apis/csn.d.ts +0 -21
  230. package/apis/events.d.ts +0 -18
  231. package/apis/internal/inference.d.ts +0 -18
  232. package/apis/linked.d.ts +0 -18
  233. package/apis/log.d.ts +0 -20
  234. package/apis/models.d.ts +0 -18
  235. package/apis/ql.d.ts +0 -18
  236. package/apis/reflect.d.ts +0 -32
  237. package/apis/server.d.ts +0 -18
  238. package/apis/services.d.ts +0 -22
  239. package/bin/cds-serve.js +0 -56
  240. package/lib/compile/to/gql.js +0 -15
  241. package/lib/srv/protocols/_legacy.js +0 -44
  242. package/lib/utils/jest.js +0 -43
  243. package/libx/_runtime/auth/index.js +0 -193
  244. package/libx/_runtime/auth/strategies/JWT.js +0 -37
  245. package/libx/_runtime/auth/strategies/basic.js +0 -20
  246. package/libx/_runtime/auth/strategies/dummy.js +0 -14
  247. package/libx/_runtime/auth/strategies/ias-auth.js +0 -1
  248. package/libx/_runtime/auth/strategies/mock.js +0 -77
  249. package/libx/_runtime/auth/strategies/xssecUtils.js +0 -93
  250. package/libx/_runtime/auth/strategies/xsuaa.js +0 -38
  251. package/libx/_runtime/common/perf/index.js +0 -19
  252. package/libx/_runtime/common/utils/ensureIEEE754.js +0 -29
  253. package/libx/_runtime/fiori/draft.js +0 -2
  254. package/libx/_runtime/fiori/generic/activate.js +0 -190
  255. package/libx/_runtime/fiori/generic/before.js +0 -201
  256. package/libx/_runtime/fiori/generic/cancel.js +0 -19
  257. package/libx/_runtime/fiori/generic/delete.js +0 -21
  258. package/libx/_runtime/fiori/generic/edit.js +0 -157
  259. package/libx/_runtime/fiori/generic/index.js +0 -25
  260. package/libx/_runtime/fiori/generic/new.js +0 -82
  261. package/libx/_runtime/fiori/generic/patch.js +0 -101
  262. package/libx/_runtime/fiori/generic/prepare.js +0 -57
  263. package/libx/_runtime/fiori/generic/read.js +0 -1340
  264. package/libx/_runtime/fiori/generic/readOverDraft.js +0 -146
  265. package/libx/_runtime/fiori/utils/csn.js +0 -13
  266. package/libx/_runtime/fiori/utils/delete.js +0 -114
  267. package/libx/_runtime/fiori/utils/handler.js +0 -264
  268. package/libx/_runtime/fiori/utils/lockInfo.js +0 -27
  269. package/libx/_runtime/fiori/utils/req.js +0 -23
  270. package/libx/_runtime/fiori/utils/stream.js +0 -36
  271. package/libx/_runtime/fiori/utils/where.js +0 -254
  272. package/libx/_runtime/index.js +0 -22
  273. package/libx/odata/utils/handler.js +0 -120
  274. package/libx/odata/utils/metaInfo.js +0 -410
  275. package/libx/odata/utils/path.js +0 -75
  276. package/libx/rest/RestRequest.js +0 -32
  277. package/libx/rest/index.js +0 -3
  278. package/libx/rest/readme.md +0 -1
  279. /package/libx/common/assert/{type.js → type-strict.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,143 @@
4
4
  - The format is based on [Keep a Changelog](http://keepachangelog.com/).
5
5
  - This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## Version 8.0.3 - 2024-07-12
8
+
9
+ ### Added
10
+
11
+ - Translations for the technical SAP language `1Q` used in support scenarios, for example for translation issues. See https://sapui5.hana.ondemand.com/sdk/#/topic/91f21f176f4d1014b6dd926db0e91070 for more.
12
+
13
+ ### Fixed
14
+
15
+ - Empty feature set by switched off feature toggles
16
+ - Allow deviating response types for `$batch`, e. g. input `multipart` and output `json`
17
+
18
+ ## Version 8.0.2 - 2024-07-09
19
+
20
+ ### Added
21
+
22
+ - `express` is now an optional peer dependency, to indicate to applications to install it as part of their dependencies. It is needed for all runtime scenarios, but can be omitted for pure designtime cases like `cds compile` calls.
23
+
24
+ ### Changed
25
+
26
+ - Creation via draft by association is forbidden with `403` response.
27
+ - New OData adapter captures input of `$search` as plain val without applying OData grammar.
28
+ - ´not null´ is not validated for action/function params. Use `@mandatory` instead.
29
+ - REST adapter rejects unknown input if not annotated with `@open`. Previously, it removed the unknown elements from the payload.
30
+
31
+ ### Fixed
32
+
33
+ - `cds.test` recommends version 7 of `chai-as-promised`. Version 8 is ESM-only and does not work with `cds.test` at the moment.
34
+ - Loading of `cds.plugins` now respects the (internal!) property `cds.env.plugins` again.
35
+ - Proper error handling for invalid draft requests in combination with `$apply`
36
+ - Usage of `Date` values in `cds.ql` expressions
37
+ - Error in `enterprise-messaging` deploy script
38
+ - Error handling for bad navigation properties (like in `$orderby=prop1/prop2`) in new OData adapter
39
+ - Properly forward path expression infront of lamda functions for `odata-v2` remote services
40
+
41
+ ### Removed
42
+
43
+ - Type information is no longer shipped as part of `@sap/cds`. Instead, the `@cap-js/cds-types` package has to be explicitly installed as devDependency for projects requiring type support. Installing the package is sufficient to add type support back in.
44
+ - Invalid annotations `@Common.FieldControl.Mandatory` and `@FieldControl.Mandatory` → use `@Common.FieldControl: #Mandatory` instead
45
+ - Invalid annotations `@Common.FieldControl.ReadOnly` and `@FieldControl.ReadOnly` → use `@Common.FieldControl: #ReadOnly` instead
46
+
47
+ ## Version 8.0.1 - 2024-06-20
48
+
49
+ ### Fixed
50
+
51
+ - always enforce `attic` profile
52
+
53
+ ## Version 8.0.0 - 2024-06-19
54
+
55
+ ### Added
56
+
57
+ - Profile `[attic]` to quickly test with deprecated features like so `CDS_ENV=attic cds watch` or `CDS_ENV=attic jest`.
58
+ - New OData Adapter: Default location header for actions that return an entity (custom handler must set the response status code to 201)
59
+ - New `cds.utils` methods `.stack()` and `.location()` to get the stack trace and location of the caller (not publicly released yet).
60
+ - Protected the methods inherited from `LinkedDefinitions` prototype against accidental and undetected interpretation and usage as CSN element: An error is thrown, when trying to access one of the usual CSN properties, like `.name`, `.kind`, `.type`, ... on them.
61
+ - Escaping single quotes with doubled ones `''` in `.properties` files
62
+ - Support for `@sap/xssec^4`
63
+ - New OData and REST adapter pass error to next such that a custom error middleware added to `cds.middlewares.after` is called
64
+ + Note: The custom middleware must preceed the default error middleware (if it remains), e.g., by adding via `unshift()`
65
+ - Support for extensibility scenarios in RESTful protocol adapters
66
+ - The built-in CORS middleware can be enabled explicitly with `cds.server.cors = true`. By default, this is `false` if in production.
67
+ - Remote Service: `useCache` destination option is enabled by default
68
+ - New model processor `cds.compile.to.hana` to generate `.hdbtable`, `.hdbview` files including migration table support.
69
+ - Added `cds.requires.connectivity` indicating whether SAP BTP Connectivity service is required.
70
+ - Support inline where conditions in `@restrict` like `where: (prop = $user.id)`.
71
+
72
+ ### Changed
73
+
74
+ - Meant for tests only: `cds.User.default` points to a singleton instance of `cds.User` instead of a class now.
75
+ - Never public: `express.Request.user` or `.tenant` must not be used anywhere
76
+ > NOTE: that was never public nor guaranteed to exist at all!
77
+ > Always only use `cds.Request.user/tenant` or `cds.context.user/tenant`.
78
+ - Never public: `cds.Request.protocol` was 'odata-v4' and is now 'odata'.
79
+ - Errors sent to clients now include a stack trace in the `stack` property during development and in tests
80
+ > NEVER test with `.toEqual()` but always only with `.toMatchObject()`.
81
+ - Node.js 18 is now the minimum required Node.js version. Version 16 is no longer supported.
82
+ - `cds.fiori.draft_deletion_timeout` is enabled with default value `30d`
83
+ - `srv.on('error')` is only invoked for errors during `srv.dispatch()`, i.e., for errors that occur while the respective request is being processed by a service instance
84
+ + Specifically, `srv.on('error')` is no longer invoked for an error that occurs in the protocol adapter. Instead, use a custom middleware added to the beginning of `cds.middlewares.after`.
85
+ + This change does not affect the legacy OData adapter.
86
+ - In `bypass_draft`, direct active modifications now have event `CREATE` instead of `NEW`.
87
+ - `cds compile --to serviceinfo` returns the correct URL path for Java applications.
88
+ - The default index page is no longer served if `NODE_ENV` is set to `production`. Set `cds.server.index = true` to restore previous behavior.
89
+ - Delete deprecated cds build stub.
90
+ - Multiple entries in `cds.requires.<name>.vcap` are now ANDed instead of ORed, so that e.g. multiple bound services of the same kind can be filtered more easily. For example, `{ "vcap": { "label": "xsuaa", "tag": "broker" }}` can be used to only bind an XSUAA instance (out of many) with the `xsuaa` label AND the `broker` tag.
91
+ - Role `cds.Subscriber` removed from predefined mock users.
92
+ - REST adapter uses managed transactions
93
+ - The default index page got a new design.
94
+ - Syntax error in batch body is handled as bad request
95
+
96
+ ### Fixed
97
+
98
+ - Failing logins with internal pre-release versions from git main branches.
99
+ - Prevent inconsistent ordering when selecting messages from outbox
100
+ - Creating child-nodes with `@Core.Immutable` fields
101
+ - ETag handling in draft cancel
102
+ - `if-none-match` with asterisk in update handler
103
+ - `odata.mediaContentType` for empty stream is always `null`
104
+ - `$select/$expand` large binaries by draft edit and activate does not return large binaries
105
+ - Error message for actions/functions with wrong path
106
+ - Direct `READ` of entities that are `@cds.autoexposed` when the `cds.env.features.odata_new_adapter` flag is set to `true`
107
+ - Reject `PATCH` requests where foreign keys cannot be determined statically or where multiple entities need to be updated
108
+ - actions / functions bound to a collection of entities in case `cds.features.odata_new_parser` is enabled
109
+ - `cds.compile.to.hana` generates `afterImage` only if migration tables exist.
110
+
111
+ ### Removed
112
+
113
+ - Legacy leftovers for old middlewares: `ExtensedModel:middleware4` (in combination with extensibility)
114
+ - Legacy request header `x-correlationid` which was ajways just a misspelled variant of `x-correlation-id`.
115
+ - Legacy configuration option `cds.requires.middlewares = false`
116
+ - Legacy configuration option `cds.features.serve_on_root = true`
117
+ - Legacy draft implementation `cds.fiori.lean_draft = false`
118
+ - Legacy API `req.user.locale`. Use `req.locale` instead.
119
+ - Legacy API `req.user.tenant`. Use `req.tenant` instead.
120
+ - Legacy configuration `cds.drafts.cancellationTimeout`. Use `cds.fiori.draft_lock_timeout` instead.
121
+ - Legacy annotation `@assert.enum`. Use `@assert.range` instead.
122
+ - Legacy properties of `cds.Request`: `req.tokenInfo`, `req._.shared`, and `req.attr`
123
+ - Legacy type facade files from `@sap/cds/apis/...`. Use `@sap/cds` as only type import.
124
+ - Legacy quirks mode. From now on, `cds.ql` generates spec compliant `ref` paths in INSERT/UPDATE/DELETE CQNs. The database services expect the same.
125
+ + Use `{ INSERT: { into: { ref: ['Authors']}}}` instead of `{ INSERT: { into: 'Authors' }}`
126
+ + Use `{ UPDATE: { entity: { ref: ['Authors']}}}` instead of `{ UPDATE: { entity: 'Authors' }}`
127
+ + Use `{ DELETE: { from: { ref: ['Authors']}}}` instead of `{ DELETE: { from: 'Authors' }}`
128
+ - Deprecated csn entity proxy `<entity>_texts`. Use `<entity>.texts` instead.
129
+ - Deprecated built-in `cds.compile.to.gql` and `cds.compile.to.graphql` compile targets. These are provided by `@cap-js/graphql` plugin versions >= 0.9.0.
130
+ - Deprecated API `srv.stream`. Use `SELECT` with a single `cds.LargeBinary` column instead.
131
+
132
+
133
+ ## Version 7.9.3 - 2024-06-27
134
+
135
+ ### Fixed
136
+
137
+ - `cds compile --to serviceinfo` returns the correct URL path for Java applications.
138
+ - Prevent HANA deadlocks when processing outbox table
139
+ - Invalid cache for `SiblingEntity` requests
140
+ - `cds.test` recommends version 7 of `chai-as-promised`. Version 8 is ESM-only and does not work with `cds.test` at the moment.
141
+ - Loading of `cds.plugins` now respects the (internal!) property `cds.env.plugins` again.
142
+ - `req.data` and `req.INSERT.entries` were not pointing to same object if it contains more than one entry.
143
+
7
144
  ## Version 7.9.2 - 2024-05-22
8
145
 
9
146
  ### Fixed
@@ -19,7 +156,7 @@
19
156
  ### Fixed
20
157
 
21
158
  - `cds.compile.to.sql` doesn't fail for older compiler versions if `postgres` keywords aren't defined
22
- - `cds compile --to serviceinfo` no longer detects a Java project if there is a poml.xml file in a subfolder of `app/`
159
+ - `cds compile --to serviceinfo` no longer detects a Java project if there is a pom.xml file in a subfolder of `app/`
23
160
  - `acquireTimeoutMillis` is ensured if custom pool config is provided
24
161
 
25
162
  ## Version 7.9.0 - 2024-04-30
@@ -486,7 +623,7 @@ POST /Orders
486
623
  - Improve error message for unsupported transformations with `$apply`
487
624
  - For database dialect H2, specialized, localized views for languages `de` and `fr` are no longer generated.
488
625
  - Authentication kinds `jwt`, `xsuaa`, and `ias` throw an error during bootstrapping if the necessary credentials are
489
- unavailable.
626
+ unavailable.
490
627
  Previously, a warning was logged, and authentication was skipped.
491
628
  See `cds bind`/ Hybrid Testing in CAPire for how to combine local development and cloud resources.
492
629
  - The Typescript definitions now make use of the default export.
@@ -662,3657 +799,3 @@ parser now removes all unneeded `*`.
662
799
  - `cds deploy --to hana` is now part of `@sap/cds-dk`.
663
800
  - Deprecated compat mode `cds.env.features.cds_tx_protection = false`
664
801
  - Beta `AuditLogService` and out-of-the-box audit logging. Use the plugin `@cap-js/audit-logging` instead.
665
-
666
- ## Version 6.8.4 - 2023-06-14
667
-
668
- ### Fixed
669
-
670
- - `$metadata` requests for multitenant applications
671
-
672
- ## Version 6.8.3 - 2023-06-13
673
-
674
- ### Fixed
675
-
676
- - `cds build` no longer reports CAP Java Classic runtime usage by mistake.
677
- - `cds version` prints the local `@sap/cds` version, even if called from a different `@sap/cds` installation.
678
- - User challenges handling in case of `cds.env.requires.auth.restrict_all_services: false`
679
-
680
- ## Version 6.8.2 - 2023-05-26
681
-
682
- ### Fixed
683
-
684
- - EDMX texts for extended tenants based on `@sap/cds-mtx` now appear correctly again.
685
- - `@assert.range` for DateTime/Date/Time/Timestamp
686
- - Nested `$expand` OData query to the `texts` compiler-generated composition for entities with localized elements.
687
- For example, similar OData requests `Entity?$expand=items($expand=item($expand=texts))` now should work as expected.
688
- - `req.subject` would occasionally be incorrect when a query had been executed prior to it.
689
- - cds plugins are also fetched from the development dependencies (`devDependencies`) section in `package.json`
690
- - `cds build` now correctly resolves complex models of mtx extension projects
691
-
692
- ## Version 6.8.1 - 2023-05-04
693
-
694
- ### Fixed
695
-
696
- - DROP statements for SQLite and PostgreSQL no longer miss a comma at the end
697
-
698
- ## Version 6.8.0 - 2023-05-02
699
-
700
- ### Added
701
-
702
- - Global cds-dk version is now included in tabular output of `cds v -i`.
703
- - Audit logging support for the OAuth2 Plan
704
- - Feature flag to limit the maximum number of requests in an OData batch request. The max number can be specified with a number in `cds.odata.batch_limit`.
705
- - Custom authentication in `enterprise-messaging`
706
- - Requests with lambda expressions are rejected by remote services of kind `odata-v2`
707
- - `cds build` ignores invalid entries in `undeploy.json`
708
- - New `minorUnit` element in `sap.common.Currencies` for how many fractions the minor unit takes (e.g., `0` or `2`). See https://www.npmjs.com/package/@sap/cds-common-content for matching content.
709
- - Support for `$user.<attr> is null` and `$user.<attr> is not null` in `@restrict.where`. `is null` matches `null` and `[]`, `is not null` matches arrays with at least one entry as well as `!= null` if no array.
710
- - Plugins are now also fetched from `devDependencies`, unless `NODE_ENV === 'production'`
711
- - Plugins can now provide `cds` configurations in their package.json.
712
- - Support in OData entities with special letters (like ó,â,ü) in names.
713
-
714
- ### Changed
715
-
716
- - Texts for _Country_ are changed to _Country/Region_ in `@sap.common.Countries`
717
- - Resolved an issue where selection strategies of destination options in multitenant applications were not working correctly, resulting in runtime errors.
718
- The fix relies on the `@sap-cloud-sdk/connectivity` npm package to be installed.
719
- - Precision of timestamp used in outbox message increased to 100 nanoseconds (`YYYY-MM-DD hh:mm:ss.nnnnnnn`)
720
- - When another user locks a draft, the error message now includes the username of that user
721
-
722
- ### Fixed
723
-
724
- - Fix exported types of the `cds` core API
725
- - cds build uses the correct path if no project dir is given
726
- - Read after write for updates on-to-one navigation
727
- - Error in $orderBy in combination with @Core.MediaType property
728
- - Fixes in lean-draft
729
- - Fixed an issue where the combined `$search` and `$expand` query and localized data was returning empty results on SAP HANA
730
- - Tests using `cds.test` no longer crash with a segmentation fault if `injectGlobals: false` is set in the Jest configuration.
731
- - Handlers registered with `cds.on('shutdown')` are now called with an `err` argument if the shutdown happened in response to uncaught exceptions or unhandled rejected Promises.
732
- - Log output on uncaught exceptions, or unhandled rejected Promises now is done via `cds.log` instead of `console`.
733
- - New config option `cds.env.server.force_exit_timeout` allows to configure the timeout in ms, after which we force-exit the server (default: 1111) if it didn't do so as expected after a prior `server.close()`. Values `false` or `0` disable force-exit.
734
- - Require custom auth relative to project root when using pluggable middlewares
735
-
736
- ## Version 6.7.2 - 2023-04-24
737
-
738
- ### Fixed
739
-
740
- - Try to destroy nonexistent socket in case of custom streaming implementation
741
- - Draft: Missing field `IsActiveEntity` in target path of error messages during `draftActivate`
742
- - Minor fixes for `cds.fiori.lean_draft`
743
- - Error in media type check when no `Content-Type` header is found
744
-
745
- ## Version 6.7.1 - 2023-04-14
746
-
747
- ### Changed
748
-
749
- - Calling a parameterized view without params error now results in the status code 400 with an improved error message.
750
-
751
- ### Fixed
752
-
753
- - cds build error CreateListFromArrayLike
754
- - Disabling of arbitrary user config in mock auth config using `"users": { "*": false }`
755
- - Various fixes for `cds.fiori.lean_draft`
756
- - User attributes that look like numbers are quoted in SQL clause for `@restrict`
757
-
758
- ## Version 6.7.0 - 2023-03-28
759
-
760
- ### Added
761
-
762
- - Config `cds.ql.quirks_mode` as a compatibility flag to still support behaviors which are undocumented or even against the specifications, for example, CQN:
763
- ```js
764
- let q = INSERT.into('Books')
765
- //> According to CQN spec should return:
766
- {SELECT:{from:{ref:['Books']}}}
767
- //> But today returns:
768
- {SELECT:{from:'Books'}}
769
- ```
770
- The default in cds6 is `true` → to be changed to `false` with cds7.
771
- - `cds build` now checks extension point restrictions defined by the SaaS app provider. `cds build` fails if any restrictions are violated.
772
- - Typings for `cds.spawn()`
773
- - Typings for `entity.drafts`
774
- - Typings for Winston logger
775
- - Typings for `cds.context`
776
- - Typings for `service.on`, `service.before`, and `service.after` for actions and CRUD events
777
- - CLI command `cds env` now allows property paths with `/` instead of `.`, which allows usages like that:
778
- ```sh
779
- cds env requires/cds.xt.ModelProviderService
780
- ```
781
- - `cds.env` now allows to statically set/add profiles via `cds.profile` and `cds.profiles` in package.json.
782
- - `cds.env` now also supports using profiles in preset definitions, i.e., in `cds.requires.kinds`.
783
- - `cds deploy` prints a warning when using Cloud Foundry client version less than 8.
784
- - `req.subject` to conveniently operate on the subjects targeted by the request. Example usage:
785
- SELECT.one.from(req.subject) //> returns single
786
- SELECT.from(req.subject) //> returns array
787
- UPDATE(req.subject) //> updates one or many
788
- DELETE(req.subject) //> deletes one or many
789
- - `cds-serve` as a future replacement for `cds serve` in npm scripts. Applications can adopt this now to ease the transition to the next major version.
790
-
791
- ### Changed
792
-
793
- - CQL types now attach additional functionality to entities where appropriate
794
- - `cds.log().trace()` now logs stack traces in `DEBUG` level, before that was on `TRACE`/`SILLY` level only
795
- - Plain SQL queries now have `req.event === undefined`. Formerly this had non-deterministic values.
796
- - Plain SQL queries don't allow registering custom handlers, other than for event `'*'`.
797
- - Plain SQL queries are only supported on database services, not on application services.
798
- - CQN representation of `columns=*` is not allowed anymore, instead `columns=['*']` should be used. This also applies to expand.
799
- - Only draft roots can be created via direct, non-navigation OData `POST` requests.
800
- - Flag `cds.features.fiori_preview` changed to `cds.fiori.preview`. The old flag still works as well.
801
- - Flag `cds.features.fiori_routes` changed to `cds.fiori.routes`. The old flag still works as well.
802
-
803
- ### Fixed
804
-
805
- - Specifying a key in `SELECT.from(...)` is now typed to produce a single result instead of an array of results
806
- - Proper handling of `IsActiveEntity` in error paths
807
- - For cloud events using AMQP, the type is set to `application/cloudevents+json`
808
- - Use `message` property in typings.
809
- - Typings for `cds.on('bootstrap', app => {app.use(...)`
810
- - Return types for `User` and `delete` in typescript
811
- - Typings for connect options
812
- - Typings for `req.error`
813
- - Deployment in sidecar
814
- - Error with restricting an entity and requesting it with `$apply` in combination with aggregate
815
- - Combined usage of `$skiptoken` and `$skip`
816
- - Error `package.json file is missing` in mtx extension builds
817
- - CLI commands w/ unknown arguments (`cds --foo`) fail again with a proper error message
818
-
819
- ## Version 6.6.2 - 2023-03-17
820
-
821
- ### Fixed
822
-
823
- - Exception during `cds deploy` without mtx
824
- - Service name specified with `cds deploy --to hana:serviceName` takes precedence over environment variables.
825
-
826
- ## Version 6.6.1 - 2023-03-09
827
-
828
- ### Added
829
-
830
- - `cds.xt.TENANT_UPDATED` event is emitted once a tenant is extended
831
-
832
- ### Fixed
833
-
834
- - `TypeError` when using the query API with an unknown target in x4 flavor
835
- - The setting for `cds.requires['cds.xt.DeploymentService'].lazyT0` is now recognized in the VS Code schema validation.
836
- - The HDI deployment `stdout` logs are now only visible for `DEBUG` level if triggered via `cds-mtxs`. They are also streamed to `logs/<tenant>.log` in case you need the full deployment output, even without `DEBUG` enabled.
837
- - `.forUpdate` when used for etags
838
- - Prevent `TypeError` if an existing draft does not have admin data
839
- - Outbound-streaming error handling
840
-
841
- ## Version 6.6.0 - 2023-02-27
842
-
843
- ### Added
844
-
845
- - Improved error handling for `cds build` if the SaaS base model is missing in an extension project.
846
- - Support for reliable paging using `$skiptoken`. Can be activated via `cds.query.limit.reliablePaging = true`
847
- - Built-in models are now added to existing model options of custom build tasks.
848
-
849
- ### Changed
850
-
851
- - `cds.serve(ServiceName)` (and `cds serve -s ServiceName`) now exactly serve services with the given names. Previously, all services that ended with the given name were served as well, e.g., `MyServiceName` and `ServiceName`, which might be problematic for applications that bootstrap services one by one.
852
- - Optimize `@cds.persistence.journal` filtering for `last-dev` CSN file.
853
-
854
- ### Fixed
855
-
856
- - `cds deploy --to hana` no longer calls `cds bind` when `VCAP_SERVICES` is provided, for example, via `default-env.json`.
857
- - `$search` on an entity without String elements
858
- - Only elements from type `cds.String` are searchable when combining `$apply` and `$search`
859
- - Error message for missing database connection in draft case
860
- - Extensibility with in-memory Sqlite
861
- - OData adapter error messages
862
- - Columns in navigation path are now added to the SELECT.columns in the new parser
863
- - Application service calls on draft-enabled entities using aliases
864
- - Custom mtxs build tasks now use the correct default `src` folder value.
865
- - `cds build` adds a `.hdiconfig` file when creating SAP HANA migration tables if none exists.
866
- - UPSERTs using reserved keywords
867
- - Fix outbound-streaming error handling
868
- - Rollback transaction if inbound streaming fails
869
- - Custom database initialization in `db/init.js` now skips the `t0` tenant for multitenant apps.
870
- - Concurrent etag calculation for UPDATE and DELETE
871
- - Typings for `cds.delete()`
872
- - CQN for `not` operator with OData functions
873
- - Expand on composition of aspect for draft-enabled entities
874
- - Better error messages are provided for errors with HTTP status codes `400`, `500`, and `501`
875
-
876
- ## Version 6.5.0 - 2023-01-27
877
-
878
- ### Added
879
-
880
- - New aspect `sap.common.TextsAspect` in common.cds
881
- - New syntax for collection-bound entities
882
-
883
- ### Changed
884
-
885
- - Successive calls to `SELECT.where()` wraps existing clause in brackets if it contains `or`. E.g.
886
- ```js
887
- SELECT.from `X` .where `x` .or `y` .where `z`
888
- //> SELECT from X where (x or y) and z`
889
- ```
890
- - `cds build` for SAP HANA now adds an `engines.node` version to the generated `db/package.json`. This will help in the future when runtime environments change their default to some version higher than the one supported by `@sap/hdi-deploy`.
891
- - `cds build` checks the consistency of built-in models for Java projects. An error is logged if some model files cannot successfully be resolved, indicating that a required npm module might be missing.
892
- - Status code of draft actions are set in respective handler instead of protocol adapter
893
- - `cds deploy --dry` no longer loads the `sqlite3` module by mistake. This fixes a regression when building Java projects. As a side effect, a file with the name `undefined` was created in the project root folder.
894
- - Internal representation of pseudo roles `internal-user` and `system-user`
895
-
896
- ### Fixed
897
-
898
- - Resolve i18n folders from the root directory
899
- - Types for `cds.test`
900
- - Types for `srv.send`
901
- - Optimized Search: Search queries for localized entities will now use default values if no localized data is found in the corresponding localized tables on SAP HANA. Correct aliasing by search queries with navigation.
902
- - Resolution of `type of` references during minify in bootstrap
903
- - Generation of odata-v2 URL in case of select=* in `urlify()`
904
- - Build resets changed `cds.env` and `cds.root` when finished
905
- - Expand error when using infix filters
906
- - CDS configuration schema validation for `@sap/cds-mtxs`
907
- - Typings for QL API
908
- - Return types of asynchronous service API
909
-
910
- ## Version 6.4.1 - 2022-01-16
911
-
912
- ### Fixed
913
-
914
- - `cds build` correctly creates a `resources.tgz` file for MTXS projects on Windows
915
- - `cds.deploy` for SAP HANA now doesn't try to search for a globally installed `@sap/hdi-deploy` if there's no `npm` installed, e.g., on a Node.js server without `npm`
916
- - Signature for `cds.ql.UPSERT`
917
- - Signature for `<srv>.delete().where()`
918
- - Signature for `SELECT.alias`
919
- - `UPSERT` requests for SQLite if only keys are provided
920
- - `cds.test` doesn't log database resets with `autoReset` enabled anymore
921
- - The `cds.deploy` output for SAP HANA is now correctly formatted in Kibana
922
- - SAP HANA stored procedures containing implicit selects
923
- - Shorthand configuration for `graphql` in `cds.env.protocols`
924
- - If `cds.env.protocols` is set, `cds.requires.middlewares` is automatically turned on
925
- - `cds.context` middleware is split to initial handling of request correlation and user propagation
926
- - Fix view resolving and managed data for UPSERT
927
- - `cds.linked` supports polymorphic self links like in: `action foo( self: [many] $self, ...)`
928
- - Error with `@odata.draft.enabled` and `@restrict`
929
- - Skip mandatory check on navigation properties for write requests
930
-
931
- ## Version 6.4.0 - 2022-12-15
932
-
933
- ### Added
934
-
935
- - Signatures for `ql.UPSERT`
936
- - Runtime support for flat database UPSERTs
937
- - `enterprise-messaging`: Support for `@sap/cds-mtxs`
938
- - `persistent-outbox`: Support for parallel processing with option `parallel: true` as well as pluggable processor functions through `service.outbox.process` (beta)
939
- - `cds version` now also lists packages with `@cap-js/` prefix from dependencies
940
- - `cds.context.http` is now available for webhook-based requests
941
- - `cds build` for SAP HANA migration tables now only saves model entities annotated with `@cds.persistence.journal` as `last-dev` version.
942
- - `cds deploy` now uses the `VCAP_SERVICES` environment variable (if set), and skips `cf` operations in this case
943
- - Support for timestamp precision greater than 3 digits of fractional seconds
944
-
945
- ### Changed
946
-
947
- - Added several missing signatures in CQN types that are now in accordance with the current documentation.
948
- - `.columns(…)` of both `cql.SELECT` and `cql.INSERT` give improved code completion when paired when appropriate type definitions are present
949
- - Status code of error messages caused by empty `not null` fields is changed from `400` to `500` on database layer. As a result, the error message `Value is required` in production will be replaced by `Internal server error` in the HTTP response.
950
- - Underscores in environment variables can now be escaped by two `__` to set keys in `cds.env`. For example, use `CDS_FEATURES_WITH__MOCKS=...` to set `features.with_mocks`. Note that previously, this ended up as `features: { with_: { mocks:... }}`, so in rare cases, it might yield unexpected results.
951
- - `persistent-outbox`: Only programming errors lead to `process.exit()`, unrecoverable ones are only logged, and their `attempts` are updated to `options.maxAttempts`
952
- - Global configuration of CSRF-token handling for remote services `cds.env.features.fetch_csrf` is deprecated. Instead, please use `csrf: true/false` and `csrfInBatch: true/false` in the configuration of your remote services. These options will allow to configure CSRF-token handling for each remote service separately.
953
- - `cds build` no longer creates `engines` entry in package.json in case none has been defined. The Node.js version matched the minimal supported version of the CDS runtime and might, therefore already be outdated.
954
- - For streamlined MTX, `@sap/cds` now uses the custom SAP Service Manager client built into `@sap/cds-mtxs`
955
- - Require new package `@cap-js/graphql` for `cds compile -2 graphql`
956
-
957
- ### Fixed
958
-
959
- - Type `expr` of CQN can now describe function calls
960
- - Added missing optional `options` parameter in signature of `cds.serve`
961
- - `cds deploy` handles empty result from `cf` call correctly
962
- - When using CQL projections with array types, the type of the projection variable will now be correctly inferred as a single element of that array
963
- - `cds deploy` logs without label
964
- - Localized draft requests with nested expand in the case of `to many` now return localized data
965
- - Protected service root for REST adapter
966
- - `cds build` logs tar error message
967
- - Resolve view only with renamed fields in `orderBy` case
968
- - In case of `$apply`, no default values for `top` or `skip` are set in subselects
969
- - Environment variables like `cds.requires.<service>.kind...` now consistently override services set in, e.g. `package.json`
970
- - Expand of composition backlink now accesses draft instance instead of active
971
- - Performance of server bootstrap for services with lots of entities
972
- - Error with virtual properties in expand combined with draft
973
- - `req.tenant` is properly propagated by custom authentication in odata and rest
974
- - Error with `SiblingEntity` in draft
975
- - Quoting of keys typed as `cds.String` in error targets. Error targets are a relative resource path to correlate error
976
- messages with the corresponding text input filed in the UI in an OData HTTP error response body for errors, warnings,
977
- and info messages. For example:
978
- - Error with `GET` on `actions`
979
-
980
- ```diff
981
- HTTP/1.1 400 Bad Request
982
- OData-Version: 4.0
983
- content-type: application/json;odata.metadata=minimal
984
- Connection: close
985
- Content-Length: 145
986
-
987
- {
988
- "error": {
989
- "code": "400",
990
- "message": "Value is required",
991
- - "target": "items(ID=string-key-1)/text",
992
- + "target": "items(ID='string-key-1')/text",
993
- "@Common.numericSeverity": 4
994
- }
995
- }
996
- ```
997
-
998
- - Application crash if batched Uri uses invalid percent-encoding
999
- - `cds build` for SAP HANA no longer produces `hdbtabledata` for CSV files that refer to non-existing entities. This can be the case for imported content packages that bring CSV files for entities not used in the application model.
1000
- - `cds build` for SAP HANA now gives precedence for CSV files from application layer. This is important for imported content packages that bring CSV files that shall be overwritten in the application layer.
1001
- - `cds build` for Java no longer adds the service `cds.xt.MTXServices` to the application model.
1002
- - `cds build` no longer fails when creating large resource TAR archives for MTXS projects.
1003
-
1004
- ### Removed
1005
-
1006
- - Removed `PreconditionFailedError` when sending a request with an `if-match` header on an entity without an ETag
1007
- - Check for forbidden deep operations for associations on database layer. All non-key fields for associations provided by request are ignored. Please check https://cap.cloud.sap/docs/guides/providing-services#associations-vs-compositions for more information. Note that this is a breaking change for applications that rely on checks for forbidden deep operations by runtime.
1008
-
1009
- ## Version 6.3.2 - 2022-11-21
1010
-
1011
- ### Fixed
1012
-
1013
- - `cds deploy` reports errors correctly
1014
- - Reference resolution in QL API
1015
- - `cds.parse.path` to correctly handle special characters
1016
- - `cds build` issues on Windows: build with a large number of files and build on Git Bash.
1017
- - `odata` as default protocol for enabled middlewares feature
1018
-
1019
- ## Version 6.3.1 - 2022-11-04
1020
-
1021
- ### Fixed
1022
-
1023
- - `cds build` no longer reports false positive validation errors for built-in MTX models like `@sap/cds/srv/mtx` or `@sap/cds-mtxs/srv/bootstrap`
1024
- - `cds deploy` handles empty result from `cf` call correctly
1025
- - `$search` fails on columns composed by a CQL expression that uses the SAP HANA `coalesce` predicate
1026
- - Draft ownership was erroneously checked for bound actions on active instances
1027
- - `cds watch/run/serve --with-mocks` no longer start randomly with missing mocked services. This could happen if previous runs crashed with errors and left a bad state in the local service registry.
1028
-
1029
- ## Version 6.3.0 - 2022-10-28
1030
-
1031
- ### Added
1032
-
1033
- - Additional type signatures for service methods in the query API
1034
- - In case of an error in a batch request, the @Core.ContentID is added to the details of the error message
1035
- - Extensibility: Use i18n files from extensions in edmx calculation
1036
- - In messaging, you can listen to all messages in a queue by subscribing to `'*'`
1037
- - Improved Log formatting for Cloud Foundry
1038
- - In remote services: Correct OData type conversion when using an imported csn
1039
- - Types for `SELECT.forUpdate({wait})`
1040
-
1041
- - `cds.ql` now provides a dedicated method `.alias()` to choose table aliases, e.g.:
1042
- ```js
1043
- SELECT.from(Authors).alias(a)
1044
- ```
1045
- > Note: unfortunately we can't use method `.as()` instead of `.alias()` for compatibility reasons
1046
-
1047
- - `cds.ql` now supports constructing queries with `where exists` clauses, e.g.:
1048
- ```js
1049
- SELECT.from(Authors).where({exists:'books'})
1050
- SELECT.from(Authors).where({'not exists':'books'})
1051
- SELECT.from(Authors).alias('a').where({ exists: // or 'not exists'
1052
- SELECT.from(Books).where({author_ID:{ref:['a','ID']}})
1053
- })
1054
- ```
1055
- > Note: last query is equivalent to first
1056
- - `cds compile` and `cds deploy` now also support dialect `h2`
1057
- - New (easier) `jwt` and `xsuaa` authentication middleware for pluggable middlewares
1058
-
1059
- ### Changed
1060
-
1061
- - In `enterprise-messaging`, emitting CloudEvents messages sets the HTTP header `Content-Type: application/cloudevents+json`
1062
- - Added type definition for `cds.User`
1063
-
1064
- ### Fixed
1065
-
1066
- - Change signature of cqn `SELECT.limit.offset` and `SELECT.limit.rows` to `val` instead of `number`
1067
- - Parsing of store procedure SQL calls, including the schema name. For example, `CALL "SCHEMA"."PROC"(?)` and `CALL SCHEMA.PROC(?)`
1068
- - Add property name in the error message on validation of the value
1069
- - Kibana and Cloud Foundry formatter: do not log cookie header value
1070
- - Missing SQL aliases for `$search` queries combined with `$orderBy` query option
1071
- - The return value of `cds.connect` is now correctly typed as a `Promise`
1072
- - `req.data` is no longer modified for remote services in the case of `odata-v2` inserts
1073
- - `cds.localize` no longer ignores i18n files defined within CDS model scope and outside project scope
1074
- - Don't modify query in `fioriGenericRead` handler
1075
-
1076
- ## Version 6.2.3 - 2022-10-21
1077
-
1078
- ### Fixed
1079
-
1080
- - New continuation for incoming messages
1081
- - `cds.test` no longer fails if used in ESM modules with `mocha` (`ERR_REQUIRE_ESM` error)
1082
- - Collection-bound actions/functions don't need draft ownership check
1083
-
1084
- ## Version 6.2.2 - 2022-10-13
1085
-
1086
- ### Fixed
1087
-
1088
- - Fix environment variable `OLD_MTX`, allowing `cds build` to create artifacts for classic `@sap/cds-mtx` library
1089
-
1090
- ## Version 6.2.1 - 2022-10-05
1091
-
1092
- ### Fixed
1093
-
1094
- - In the CDS configuration, custom profiles now have precedence over the (implicit) default `[development]` profile, irrespective of insertion order.
1095
- - `cds test` is now compatible with new `axios` 1.x
1096
-
1097
- ## Version 6.2.0 - 2022-10-04
1098
-
1099
- ### Added
1100
-
1101
- - Types for using tagged template variants of several CQL constructs
1102
- - Types for calling shortcut versions of CQL constructs (`SELECT(...)` in addition to `SELECT.from(...)`, etc.)
1103
- - Types for `cds.test`
1104
- - Types for `cds.log().setFormat()`
1105
- - Support for `redis-messaging` (beta)
1106
- - Log the cds version when starting the server
1107
- - Support for non-root entities as the main draft entity
1108
- - Support for IAS authentication using kind `ias-auth`
1109
- - Warning if multiple installations of `@sap/cds` were found when serving requests
1110
- - Wildcard expansion `('*')` of properties in QL is now typed
1111
- - Support for extended models in custom transactions and background processes
1112
- - `cds build` logs detailed error messages if required service models cannot be resolved or aren't defined in custom build tasks.
1113
- - Support for additional data types `cds.UInt8`, `cds.Int16`, `cds.Int32`, `cds.Int64`
1114
- - Typings for `cds.utils`, `req.entity`
1115
- - Optimized server startup for projects with large models and high numbers of services.
1116
- Can be switched off by setting config `cds.features.precompile_edms = false` in case of problems.
1117
- - Set default header to `application/octet-stream` while sending binary to remote
1118
- - OData temporal query params `$at`, `$from`, `$to`, `$toInclusive` can be used in custom handlers
1119
- - Reserved keywords from compiler api available at `cds.compile.to.[cdl, sql.sqlite]`
1120
- - Improved `winston` integration in `cds.log`
1121
-
1122
- ### Changed
1123
-
1124
- - `cds.debug()` now returns undefined instead of falsy if debug is switched off. This allows usages like that:
1125
- ```js
1126
- const DEBUG = cds.debug('whatever')
1127
- DEBUG?.(...)
1128
- ```
1129
- - All MTX-related modules have been refactored and moved to `@sap/cds-mtxs`.
1130
- Ensure to also upgrade to the latest version of `@sap/cds-mtxs` when upgrading `@sap/cds` to avoid any breaking change effects.
1131
- - SQLite database file endings have been changed to `.sqlite`, so third-party tools (e.g. VS Code extensions) can deduce the file type.
1132
- - Method `disconnect()` in db services empties db pool w/o removing db services. In special cases (like tests), cleaning-up db service should be done manually while deleting `cds.services.db` and `cds.db`.
1133
- - Prefer HANA driver that is required in package.json of project root
1134
-
1135
- ### Fixed
1136
-
1137
- - Queries like `SELECT.from(Foo).where({a:1}).or({b:2}).and({c:3})` erroneously resulted in `SELECT from Foo where (a=1 or b=2) and c=3`
1138
- - Signatures for QN `order_by` expressions are now in line with the capire doc
1139
- - Signatures for QL operations are now more specific
1140
- - `basic-auth` does not inherit users of `mocked-auth`
1141
- - `cds.localize` now ignores i18n files defined outside the project scope.
1142
- - Allow `@Capabilities.NavigationRestrictions.RestrictedProperties` to be specified in the format `{ InsertRestrictions: { Insertable: false } }`
1143
- - Bound actions/functions while calling remote service
1144
- - `$search`: Search on localized projections/views does not always return the localized data
1145
- - `cds push` now shows better output for failed extension validations
1146
- - Aliased parameters in REST parser
1147
- - `cds.deploy` now logs the correct filename for multitenant SQLite
1148
- - HDI configuration data (e.g., `./cfg`, `.hdiignore`) and HANA native artifacts have not always been copied into the `sdc` folder of an MTX sidecar module
1149
- - OData URL to CQN parser (`cds.env.features.odata_new_parser`) now supports functions with no arguments
1150
- - Runtime exception for `PATCH` HTTP request with an empty payload body and read-only field
1151
- - Streams in draft caused SQL error
1152
- - Better response state handling during `cds deploy` to Cloud Foundry.
1153
- - Draft: patch on draft-enabled entity with a composition of one
1154
- - Maximum stack trace exceeded in generic audit logging implementation
1155
- - The protocol adapter logs the decoded URI or the original one if it is invalid
1156
- - REST: reject action calls with round brackets (parentheses). For example, the request `/Books(1)/bookShelf.CatalogService.rate()` is now rejected.
1157
- - `cds deploy` and `cds run/serve/watch` no longer print terminal escape sequences (`x1b...`) if they run non-interactively.
1158
- - Some fields in entities like `path` generated invalid SQL
1159
-
1160
- ## Version 6.1.3 - 2022-09-13
1161
-
1162
- ### Added
1163
-
1164
- - Configuration to change maximum body size in bytes for remote requests: `cds.env.remote.max_body_length: 1000` sets it to 1 MB
1165
-
1166
- ### Changed
1167
-
1168
- - For structured input, foreign keys are generated as non-enumerable properties on application-service layer
1169
-
1170
- ### Fixed
1171
-
1172
- - Deep insert/update/upsert requests where the key of an association is provided in a structured format will not be rejected anymore if the target has default or mandatory fields
1173
- - For some configurations, mtxs services were bootstrapped twice
1174
-
1175
- ## Version 6.1.2 - 2022-09-05
1176
-
1177
- ### Fixed
1178
-
1179
- - Missing key insertion from where clauses in references for deep update statements
1180
- - Prevent duplicate entries for some `INSERT` statements
1181
- - Log details were not properly displayed in Kibana
1182
- - getCsn in model-provider if `cds.requires.toggles` is false
1183
- - HTTP calls in messaging have the correct content length
1184
- - Performance issue for OData <entity>/$count requests
1185
- - Typescript definition for SQL-native variant of `srv.run`, like `srv.run('SELECT * from Authors where name like ?',['%Poe%'])`
1186
- - Typescript definitions for `srv.run( [query] )` and `srv.send( {query, headers} )`
1187
- - Typescript definitions for `cds.log` are improved, and level indicators like `cds.log()._debug` added
1188
- - Typescript definitions for `tx` now carry additional service methods
1189
- - `cds login` now returns errors with better root cause messages
1190
- - `$expand` requests for to-one associations that do not select the foreign key
1191
- - `UPDATE` statement accepts empty objects: `UPDATE('Foo').with({ bar: {} })`
1192
- - URI encoding of parameters in remote service calls
1193
-
1194
- ## Version 6.1.1 - 2022-08-24
1195
-
1196
- ### Added
1197
- - The configuration schema now includes `cds.extends` and `new-fields` (in `cds.xt.ExtensibilityService`)
1198
- - Ability to run extension validations as part of `cds lint`
1199
- - The `/-/cds/login` endpoint now also supports client credentials authentication
1200
- - `srv.run(fn)` now accepts a function as first argument, which will be run in an active outer transaction, if any, or in a newly created one. This is in contrast to `srv.tx(fn)`, which always creates a new tx.
1201
- ```js
1202
- cds.run (tx => { // nested operations are guaranteed to run in a tx
1203
- await INSERT.into (Foo, ...)
1204
- await INSERT.into (Bar, ...)
1205
- })
1206
- ```
1207
-
1208
- ### Fixed
1209
-
1210
- - Erroneous checks for `join` in `SELECT.from(SELECT.from('xxx'))`
1211
- - Virtual fields with default values in draft context
1212
- - View resolving without model information doesn't crash
1213
- - Unable to upload large attachments. Uploading a large attachment (base64 encoded) caused a runtime exception.
1214
- - `cds.Query.then()` is using `AsyncResource.runInAsyncScope` from now on. &rarr; this avoids callstacks being cut off, e.g. in debuggers.
1215
- - `cds.tx()` and `cds.context` have been fixed to avoid accidental fallbacks to auto-commit mode.
1216
- - HDI configuration data (e.g. `./cfg`, `.hdiignore`) is now included in the `resources.tgz` file which is required for Streamlined MTX.
1217
- - `cds deploy` accepts in addition to `VCAP_SERVICES` also `TARGET_CONTAINER` and `SERVICE_REPLACEMENTS` from vcap file when using `--vcap-file` parameter.
1218
- - `cds build` doesn't duplicate CSV files that are contained in `db/src/**`.
1219
- - Typescript issues in `apis/log.d.ts`
1220
- - `cds build` adds OS agnostic base model path to generated feature CSN.
1221
- - Unhandled promise rejection in `expand` handling
1222
- - `cds.context.model` middleware is not mounted for not extensible services
1223
- - `cds.context` continuation was sometimes not reset in REST adapter
1224
-
1225
- ## Version 6.1.0 - 2022-08-10
1226
-
1227
- ### Added
1228
-
1229
- - Support for `@sap/cds-mtxs` in `enterprise-messaging`
1230
- - Detailed information about pool state: `borrowed`, `pending`, `size`, `available`, `max` to the timeout error
1231
- - Odata v2 payloads for `cds.Time` are converted from hh:mm:ss to PThhHmmMssS e.g. 12:34:56 to PT12H34M56S if provided in hh:mm:ss format
1232
- - Odata v2 payloads for `cds.Integer` are converted to String if not provided as String
1233
- - New OData parser supports aliased parameters e.g. `...function(ID=@p)?@p=5`
1234
- - Support for locale "en_US_x_saprigi"
1235
- - Parameter `rows` in ql API function `limit` can be omitted for remote services, e.g. `SELECT.limit(undefined, 5)`
1236
- - New OData parser supports $filter with "in" operator, e.g. `$filter=ID in (1,2,3)`
1237
- - `cds build` copies `package.json` and `.cdsrc.json` into _main folder of MTX sidecar app.
1238
- - New OData parser supports null parameter in function/action, e.g `/findBooks(author=1,title=null)`
1239
- - New environment variable `schemas` contains locations for json schemas validating `package.json`, `.cdsrc.json` and `.cdsrc-private.json` in VS Code
1240
- - `cds.test` can now listen on a fixed port by way of additional arguments '--port', '<PORT_NUMBER>
1241
- - `cds.requires.db.kind = 'sql-mt'` is introduced as a shorthand for
1242
- ```js
1243
- "db": {
1244
- "kind": "sqlite",
1245
- "[production]": {
1246
- "kind": "hana-mt"
1247
- }
1248
- }
1249
- ```
1250
- - `cds build` support for Streamlined MTX extension projects based on build task `mtx-extension`
1251
- - TS definitions for `SELECT.forSharedLock` and `SELECT.forUpdate`
1252
- - TS definitions for `log`
1253
- - Support for new cds build task option `deploy-format`. Java apps may use this option instead of the corresponding global CDS config option.
1254
- - The `ExtensibilityService` serves an endpoint to retrieve a subdomain-specific JWT, which is used by `cds login`
1255
- - The endpoint `/-/cds/extensibility/push` now checks restrictions for new extensions. The configuration is added to the `cds.xt.ExtensibilityService`
1256
- ```js
1257
- "requires": {
1258
- "cds.xt.ExtensibilityService": {
1259
- "element-prefix": ["Z_", "ZZ_"],
1260
- "namespace-blocklist": ["com.sap.", "sap."],
1261
- "extension-allowlist": [
1262
- {
1263
- "for": ["my.bookshop"],
1264
- "kind": "entity",
1265
- "new-fields": 2
1266
- },
1267
- {
1268
- "for": ["CatalogService"],
1269
- "new-entities": 2
1270
- }
1271
- ]
1272
- }
1273
- }
1274
- ```
1275
- - `cds build` validates required service models `@sap/**` for MTX sidecar app and logs an ERROR if some couldn't be resolved.
1276
- - Configuration schema for many properties of the `cds` configuration block in `package.json` or `.cdsrc.json`, especially for `cds.requires...`
1277
-
1278
- ### Changed
1279
-
1280
- - Streamlined calculation of the difference for `DELETE` queries using `req.diff()`
1281
- - Improved error messages for rest / new odata parser
1282
- - Adjust types for `SELECT.from` and `SELECT.one` to accept array classes as well
1283
- - No `"` added around search values in OData v2 e.g. Foo?search=name is passed through as is
1284
- - If an entity can not be read after write (e.g. insert only entity) no error is shown in the log
1285
- - Throw not supported error for pagination in `$expand`
1286
-
1287
- ### Fixed
1288
-
1289
- - Wrong context in `tx.run(query)` when `query` is an array
1290
- - We now detect and ignore erroneous attempts to re-register framework-generated stubs as handlers for custom actions/functions.
1291
- - Emits with `persistent-outbox` also work with manual transactions
1292
- - You can now use `cds.ql` fluent API to query tables not in the model, but in database.
1293
- For example, within `cap/samples/bookshop` this works now:
1294
- ```sql
1295
- await SELECT.from('sqlite_master')
1296
- await cds.read('sqlite_master')
1297
- ```
1298
- Caveat: The following undocumented usage of unqualified names happened to work in the past.
1299
- But this was very fragile and caused lots of issues, and therefore was removed:
1300
- ```sql
1301
- await SELECT.from('Books')
1302
- await cds.read('Books')
1303
- ```
1304
- Always use qualified names or reflected definitions instead:
1305
- ```sql
1306
- const Books = 'sap.capire.bookshop.Books'
1307
- await SELECT.from(Books)
1308
- await cds.read(Books)
1309
- ```
1310
- ```sql
1311
- const {Books} = cds.entities ('sap.capire.bookshop')
1312
- await SELECT.from(Books)
1313
- await cds.read(Books)
1314
- ```
1315
- - Wrong results for expand to many without `orderBy`
1316
- - `cds deploy` api endpoint regex for cli now ignores trailing version info in url
1317
- - Default values no longer overwrite payload values on fields of new drafts
1318
- - Unmanaged to-one navigation caused malformed SQL statement in draft
1319
- - `cds.compile.to.serviceinfo` fix failure to detect Java services if `odataV4.endpoint.path` or `odataV2.endpoint.path` missing in `cds` configuration in `application.yaml`
1320
- - Data type conversion did not work in some expand cases
1321
- - Failed connection to SAP HANA with no or malformed credentials was leading to credentials being written to the log
1322
- - `cds build` no longer fails with an error `no such file` if one of the following files has been defined in some `srv` subfolder - `package.json, package-lock.json, .cdsrc.json, .npmrc`
1323
- - Tar issue on Windows: 'The command line is too long'.
1324
- - `$search`: Lifecycle issue that causes an empty search result when the `$search` and `$expand` query options were combined
1325
- - Operator `IN` with Tagged Template String Literals e.g.:
1326
- ```sql
1327
- SELECT.from(Object).where`userId IN ${aUserIDs}`
1328
- ```
1329
- - `cds build` now uses a closed version range in the node engines version of the deployed application's `package.json`
1330
- - `cds build` no longer generates EDMX files for services that aren't odata protocol enabled
1331
- - `cds deploy` handles orgs and spaces containing commas correctly
1332
- - Incorrect decoding of special characters when reading data of type `cds.LargeString` from SAP HANA using `hdb@^0.19.5` driver
1333
- - The payload is added to the delete request in rest adapter as `req.data`
1334
-
1335
- ## Version 6.0.4 - 2022-07-20
1336
-
1337
- ### Fixed
1338
-
1339
- - Local mocking of external services using `cds watch`
1340
-
1341
- ## Version 6.0.3 - 2022-07-14
1342
-
1343
- ### Changed
1344
-
1345
- - On Business Application Studio, `@sap/cds` now rejects starting on Node 12, as it does locally. This avoids cryptic follow-up errors.
1346
-
1347
- ### Fixed
1348
-
1349
- - Generic handlers for draft-related operations will trigger a READ event afterwards
1350
- - `file-based-messaging` only watches the file when at least one handler is registered
1351
- - `--vap-file` parameter of `cds deploy` is available again
1352
- - `cds build` no longer throws an error if `@sap/cds-mtx` library (classic MTX) isn't installed locally.
1353
- - `cds.spawn` no longer tries to reuse a transaction
1354
- - Custom query parameter caused bad request on certain characters in REST adapter
1355
- - `cds-ts` no longer fails with an `ERR_UNKNOWN_FILE_EXTENSION` error
1356
- - Timeouts when sending string payloads to remote services
1357
- - `cds.context.http` for `$batch` using atomicity groups
1358
-
1359
- ## Version 6.0.2 - 2022-07-06
1360
-
1361
- ### Fixed
1362
-
1363
- - Jest tests do not fail any longer because of logs during app shutdown
1364
- - `cds build` now uses the correct `mtx/sidecar` context. This avoids redundant `cds-mtxs` npm dependency for Java projects.
1365
-
1366
- ## Version 6.0.1 - 2022-07-05
1367
-
1368
- ### Added
1369
-
1370
- - Config option `cds.env.server.port` allows to configure the port to use (in addition to `process.env.PORT` and CLI option `--port`)
1371
-
1372
- ### Changed
1373
-
1374
- - Plugins cannot be loaded as ES modules, but need to remain CommonJS modules
1375
-
1376
- ### Fixed
1377
-
1378
- - Removed debug log about shutdown from `cds serve`
1379
- - Hiding timeout error in production mode
1380
-
1381
- ## Version 6.0.0 - 2022-06-30
1382
-
1383
- ### Added
1384
-
1385
- - Listeners for `commit` events on the request object are now awaited
1386
- - Experimental support for ECMAScript modules (ESM): You can now write your custom code, i.e.,
1387
- service implementations, `server.js`, `db/init.js` using ES6 `import` statements.
1388
- **Note though** that this is _experimental_ for now. Known limitation: _jest_ doesn't
1389
- support dynamic imports, which are required for that.
1390
-
1391
- - Improved `cds.error` to allow these using variants:
1392
- ```js
1393
- cds.error `Message with formatted: ${{foo:'bar'}}`
1394
- cds.error ({ message, code, ... })
1395
- cds.error (message, { code, ... })
1396
- let e = new cds.error(...) //> will not throw
1397
- ```
1398
- > Calling `cds.error()` with `new` returns the newly created Error,
1399
- > while calling it without `new` it throws immediately. The latter is
1400
- > useful for usages like that:
1401
-
1402
- - Improved `req.error` to always turn each recorded error into an instance of `Error` with its own stack trace.
1403
- Multiple errors are finally thrown as an array of these errors with `.message = 'MULTIPLE_ERRORS'`
1404
- and `.details = this` (the latter is for compatibility to former releases).
1405
-
1406
- - Public API for `cds.User.roles`: For example, this allows to construct new instances of `cds.User` like so:
1407
- ```js
1408
- let user = new cds.User ({ id:'me', roles:['admin'] })
1409
- user.is('admin') //> true
1410
- ```
1411
-
1412
- - Public API for `cds.context.tx`: This provides access to the current global root `tx`, if any.
1413
- (This replaces the former undocumented `req._tx`)
1414
-
1415
- - Public API `cds.User.anonymous` and `cds.User.privileged` which are sealed instances you can use directly
1416
- instead of always passing `new cds.UserPrivileged`.
1417
-
1418
- - Public API `cds.context.http` to reliably access inbound http `req` and `res` objects.
1419
-
1420
- - Persistent outbox now contains last error and timestamp of last attempt
1421
- - Enable PUT requests for UPDATE queries with CQN for remote services
1422
- - Support for new major version 2 of SAP Cloud SDK
1423
- - Support for the `@assert.target` annotation for managed-to-one associations
1424
- - Support for `FOR SHARE LOCK` on SAP HANA to acquire shared locks on the queried records so that the locked records
1425
- stay intact until the transaction is committed or rolled back.
1426
- - Consistent error information for remote batch requests
1427
- - `cds.env` now supports expanding scalar `cds.requires` entries from `cds.requires.kinds` as follows:
1428
- ```jsonc
1429
- { "cds": {
1430
- "requires": {
1431
- "mtx-sidecar": true,
1432
- "db": "sql",
1433
- "kinds": {
1434
- "sql": {/* detailed config for sql */},
1435
- "mtx-sidecar": {/* detailed config */},
1436
- }
1437
- }
1438
- }}
1439
- ```
1440
- - Support for mTLS in `enterprise-messaging-shared` and `message-queuing`
1441
- - Allow empty publish and subscribe prefixes for SAP Event Mesh when using the format `cloudevents`
1442
- - Custom type `sap.common.Locale` in common.cds
1443
- - Ordering by aggregated value for draft-enabled active entity
1444
- - `cds build` support for model provider service-based resource deployment.
1445
- - Remote service:
1446
- + Conversion of OData V2 (`"kind": "odata-v2"`) function and action results to OData V4 format
1447
- + Conversion of binary data in CQN queries to `base64url` in URL and payload
1448
- + Key predicate is omitted for single-key entities in resulting URL (e.g. `GET /Foo(1)` instead of `GET /Foo(ID=1)`)
1449
- + Support of views with parameters
1450
- - Add `@odata.mediaContentType` if selecting stream property
1451
- - Kubernetes service bindings: Support for servicebinding.io and SAP BTP Service Operator based bindings
1452
- - `cds build` copies an existing `.npmrc` file located in the root or srv folder of your project into the deployment folder (usually `gen/srv`). This allows for dedicated npm configuration in cloud environments. Can be switched off by cds build option `contentNpmrc`.
1453
- - `cds build` copies an existing `.cdsrc.json` file located in the root or srv folder of your project into the deployment folder (usually `gen/srv`). The effective CDS configuration is created from the `.cdsrc.json` and CDS configuration defined in the `package.json` file. Can be switched off by cds build option `contentCdsrcJson`.
1454
- - Beta OData URL to CQN parser (`cds.env.features.odata_new_parser = true`):
1455
- + `@odata.context` is derived without using okra, not yet supported:
1456
- + `$expand=*` query option
1457
- + Support for actions and functions
1458
- + Further `$apply` transformations supported
1459
- + (nested) `concat` transformations
1460
- + `orderBy` transformation
1461
- + `top` & `skip` transformation
1462
- + `identity` transformation
1463
- - Log `BEGIN`/`COMMIT`/`ROLLBACK` commands when using SAP HANA as the underlying database
1464
- - Binary data in payload is validated to be RFC-4648 and OData ABNF conformed
1465
- - Support multiple media (streaming) properties in one entity
1466
- - Support for annotation `@protocol:'none'` to mark services as internal
1467
- - New build task aliases `java` and `nodejs` deprecating `java-cf`and `node-cf`, which are still supported for compatibility reasons.
1468
- - New shutdown event sent by `cds serve` (beta)
1469
- - $filter in $expand for remote services
1470
- - Mapping of aliases in $expand for remote services
1471
-
1472
- ### Changed
1473
-
1474
- - `@sap/cds` can now be loaded from different install locations like any other module, i.e. `@require('@sap/cds')` will no longer return the same singleton instance.
1475
- - SAP Cloud SDK is now only an optional dependency and must be installed manually
1476
- - Improved `cds.context` implementation to use `AsyncLocalStorage` instead of plain `async_hooks` (-> [see Node.js docs](https://nodejs.org/api/async_context.html)); APIs stay the same.
1477
- - Improved `cds.tx(tx=>{ ... })`: The new `tx` will be set as `cds.context.tx` for the function body's continuation,
1478
- so all nested service or database operations will be executed within this transaction automatically.
1479
- - Node.js 14.15 is now the minimum required Node.js version. Version 12 is no longer supported.
1480
- - Node.js 14.15 is now enforced on loading of `@sap/cds`, for example, on server startup.
1481
- - Improve error messages in messaging management
1482
- - `cds.env.requires` formerly inherited from `cds.env.requires.kinds`. This is not the case anymore; hence things like this worked before but don't anymore:
1483
- ```js
1484
- let sql = cds.requires.sql //> is undefined now
1485
- let sql = cds.requires.kinds.sql //> use this instead
1486
- ```
1487
- Alternatively you can add this to your cds config:
1488
- ```json
1489
- { "cds": { "requires": { "sql": true } }}
1490
- ```
1491
- - Details of errors from remote services are now in property `reason` (before it was `innererror`)
1492
- - `innererror` is not removed from OData error response
1493
- - The `file` option of file-based messaging is now on top level (before it was in `credentials`)
1494
- - Optimized Search: `cds.env.features.optimized_search=true` is now the default behavior.
1495
- - `cds build` no longer generates CF manifest files for Nodejs and HANA db deployer modules.
1496
- - `cds build` no longer supports WebIDE Fullstack compatibility mode. Consequently, SAP HANA artifacts and service EDMX files for Fiori modules might no longer be correctly generated.
1497
- - Remote services: Batched `GET` requests will not fetch CSRF tokens
1498
- - CQN now uses `xpr` correctly instead of brackets in `where`
1499
- - `process.exit` is called again by `cds run/serve` and `watch`, to gain a reliable `exit` event for cleanup tasks. Before, this would be spoiled by apps that do not shut down the event loop properly.
1500
- - `cds build` no longer filters `./` file dependencies from package.json in the build output.
1501
- - Fiori preview no longer supports URL pattern with `service` and `entity` query parameters, e.g. `$fiori-preview?service=...&entity=...`. These URLs were created back in `@sap/cds` 3.x.
1502
- - `cds build` no longer copies the `node_modules` folder into the deployment folder (usually `gen/db/**` and `gen/srv/**`).
1503
- - Set default tenant to `undefined` in single-tenant mode
1504
- - Handle foreign keys of to-one associations which should be set to `null` on db layer
1505
- - `cds build` uses the native `fs` functions instead of `fs-extra`.
1506
- - `cds build` supports initial data in CSV files that are located in any 'csv' or 'data' subfolder of some CDS model file. This also implies CSV files stored in reuse modules. Now, this behaviour is consistent with SQLite deployment. If the location of some CSV file has changed, a deployment error might be returned. In that case previously deployed `hdbtabledata` files have to be undeployed.
1507
- - `cds deploy` reads Cloud Foundry file `config.json` to get org and space information.
1508
- - New REST adapter replaced old (limited) implementation
1509
- - Default behavior for runtime integrity checks. From now on no integrity checks will be done by default.
1510
- Note that this is a breaking change for applications that rely on automatic integrity checks by runtime. We recommend using `cds.env.features.assert_integrity`: `db` to switch on database integrity constraints. The value `app` can be used as fallback to previous behavior.
1511
- - `cds build` no longer copies `.env` or `default-env.json` files into the deployment folder.
1512
- - OData `POST`, `PATCH`, and `PUT` requests and draft-related `draftEdit` and `draftActivate` actions are now followed by an additional `READ` request to the application service. Consequently, affected functionality:
1513
- + It is now sufficient to have a custom `READ` handler in order to adjust the response (e.g., to handle virtual properties) of the modification request.
1514
- + A user is now required to be authorized to read updated data e.g. a user having a role restricted with "INSERT-only" annotation pattern will get empty results in response to `POST` request.
1515
- + For compatibility reasons, `req._` of the modification request is uplinked to `req._` of the follow-up `READ` request so that one still can access original `req._.req/res` request objects of the modification request within the corresponding `READ` handlers.
1516
- + Modification logs are now followed by corresponding access logs.
1517
- + More details can be found in cds v6.0.0 release notes.
1518
- - Message for PreconditionFailedError is now configurable in messages.properties
1519
- - Remove circular references in Kibana logging
1520
- - Error sanitization in production is skipped for custom errors with HTTP code `5xx`. From now on, an app developer can return any error message to the client.
1521
- Note that this is a breaking change for applications that rely on error sanitization for custom errors in production. The behavior of errors thrown by CAP framework is unchanged.
1522
-
1523
- ### Fixed
1524
-
1525
- - We don't rely on `global.cds` anymore -> allows to load and correctly work with multiple versions of `cds`
1526
- - Improved shutdown for AMQP connections and file listeners
1527
- - Using `CQL` with a tagged template string `SELECT from Foo { null as boo }` threw an exception.
1528
- - In case of `MULTIPLE_ERRORS` throw an `Error` instead of an object
1529
- - `cds build` ensures correct precedence of feature annotations. Fixes `Duplicate assignment` compilation errors.
1530
- - Compatibility with former support to find service `@impl: 'relative/to/cdw'`.
1531
- - Views on views with parameters where erroneously inherited params through `cds.linked()`.
1532
- - Authentication: Return HTTP `404 Not Found` rather than `204 No Content` status code for invalid requests.
1533
- For example, given the following request `/ReqAdmin(1)/toIntermediate/toa` and assuming that the `toIntermediate` instance does not exist,
1534
- the runtime returned an HTTP `204 No Content` success status response code indicating that the request has succeeded.
1535
- In such scenarios, now the HTTP `404 Not Found` status code is returned rather than `204 No Content`.
1536
- - Errors from HTTP requests sent via `cds.test.axios` now are the original Axios errors, i.e. including properties like `request` and `response`, with stack traces from caller.
1537
- - Errors constructed and thrown by `req.reject()` now have a stack starting at the code calling `req.reject()`.
1538
- - Auth annotations `@restrict` and `@requires` with empty array do not allow access anymore
1539
- - Delete on restricted singleton caused request to fail
1540
- - Add workaround of typescript not complete literal unions, specially when union strings.
1541
- - Accidental handling of non-proxy entities as they would have been proxies (`cds.env.odata.proxies`) in expands
1542
- - Boolean keys are properly parsed into JS boolean values
1543
- - Navigation path segments with aliased keys in structured mode (OData flavors `w4` and `x4`) when using beta OData URL to CQN parser (`cds.env.features.odata_new_parser`)
1544
- - All entities in `@sap/cds/common` have now proper CDS doc comments
1545
- - `cds build` uses `package.json` and `package-lock.json` files located in `srv` folder for deployment if existing. Before, `package.json` and `package-lock.json` files of the project root folder have always been taken.
1546
- - Pass options from `cds.parse.expr` to `cdsc.parse.expr`.
1547
- - Avoid error that is caused, e.g., in a streaming scenario when there is an issue while processing the stream. Trying to change/send the response object could cause a crash because the response was sent already.
1548
- - Correct URL generation for `Integer64` and `Decimal` for remote services
1549
- - Operation parameters from structured type and annotated with @open are not filtered from the input query
1550
- - Services are secured by default in production. Can be disabled via feature flag `cds.env.requires.auth.restrict_all_services: false` or by using `mocked-auth`.
1551
- - Optimized Search: Exception when searching on views using built-in SQL SAP HANA functions
1552
- - In some cases, custom error handlers were not called for rest
1553
- - `cds build` adds newline at EOF for `hdbmigrationtable` files
1554
- - Static values in on condition were ignored when inserting on navigation
1555
- - Removed entity key validation by POST request in rest
1556
- - `$count=false` returned count
1557
- - `odata_new_parser`: `format=json` allowed as query parameter, other formats not supported and returning 501, trailing `?` allowed e.g. `/Employees?`
1558
- - `odata_new_parser`: Piped use of same transformations is now supported, like `/Students?$apply=filter(BIRTHYEAR ge 2000)/groupby((UNIVERSITY),aggregate(SUBJECT with countdistinct as distinctSubjects))/filter(UNIVERSITY eq 'Hamburg')`
1559
- - `odata_new_parser`: Behavior of piped transformations while using `topcount` or `bottomcount` is now correct
1560
- - Better error message for missing `exists` predicate in `@restrict.where`
1561
- - Reading raw Binary data provided as a `base64` (standard or url-safe) string by means of a `$value` query option
1562
- - Selecting a navigation with `$select` ended up in database error
1563
- - `cds.compile` no longer fails for cds sources that contain the `file:` pattern
1564
- - $select=IsActiveEntity did not work on draft enabled entity, when requesting active data via navigation
1565
- - not equal operator `<>` treated the same way as `!=`
1566
- - `cds.localize` now respects custom i18n file names (which is not recommended though)
1567
- - `cds version` now handles array-valued entries for `folders.db`and `folders.srv` gracefully when looking for MTX sidecar
1568
- - OData access of entities named `get` and `set`
1569
- - missing brackets for OR condition in `.where()` when requesting by navigation
1570
- - `cds build` now correctly supports Node.js apps that do not have a service module defined. In these cases, the build task's _src_ folder has to be configured as "."
1571
- - `cds build <dir>` is now correctly executed if called by npm script or mta build.
1572
- - `cds deploy` now shows a better error message on INSERT errors (on SQLite).
1573
-
1574
- ### Removed
1575
-
1576
- - Deprecated option to send synchronous requests via `srv.emit()` -> use `srv.send()` for that
1577
- - Deprecated feature flag `cds.env.features.implicit_sorting`
1578
- - Deprecated feature flag `cds.env.features.update_managed_properties`
1579
- - Deprecated feature flag `cds.env.features.resolve_views`
1580
- - Deprecated feature flag `cds.env.features.spaced_columns`
1581
- - Deprecated feature flag `cds.env.features.throw_diff_error`
1582
- - Deprecated feature flag `cds.env.features.delay_assert_deep_assoc`
1583
- - Deprecated feature flag `cds.env.features.auto_fetch_expand_keys`
1584
- - Deprecation warning for query parameters `sap-valid-from` and `sap-valid-to`
1585
- - Built-in graphql support &rarr; moved to new `@sap/cds-graphql`
1586
- - Deprecated feature flag `cds.env.features.extract_vals`
1587
- - Support for CQN `where in` syntax `{ val: [1, 2, 3] }` without `list`. Use `{ list: [{ val: 1 }, { val: 2 }, { val: 3 }] }` instead.
1588
- - Support for selects in restrict entries, e.g. `where : 'exists (select 1 from MyTable where a = b)'` is not allowed anymore
1589
- - Input validation for deep `INSERT`/`UPDATE` for associations in the service layer
1590
- - Support for `@odata.contained` annotation. Use Compositions instead.
1591
- - Support for `@odata.on.insert/update` annotation. Use `cds.on.insert/update` instead.
1592
- - Support for expressions in references, for example: `ref: ['foo as bar']`).
1593
- - Generic support of `$expand` and `$select` OData query options for custom actions and functions
1594
-
1595
- ## Version 5.9.8 - 2022-06-24
1596
-
1597
- ### Fixed
1598
-
1599
- - Application model is now again properly updated after extension activation
1600
- - Avoid crashes during `cds version` when `folders.db` or `folders.srv` are array-valued instead of strings
1601
- - `cds build` correctly validates MTX extension allow lists and doesn't log false positive warning messages
1602
-
1603
- ## Version 5.9.7 - 2022-06-13
1604
-
1605
- ### Fixed
1606
-
1607
- - Deleting a parent will delete all compositions, also texts
1608
- - Views with aliased elements in `orderBy`
1609
-
1610
- ## Version 5.9.6 - 2022-05-24
1611
-
1612
- ### Fixed
1613
-
1614
- - Ignored requests in batch requests
1615
- - `pool` module for logger facade is separated from `hana` database logger. Timeout error by acquiring client from pool is now enhanced with `_poolState` providing current pool attibutes.
1616
- - Multiple errors did not have correct HTTP response status code
1617
- - `POST|PUT|PATCH` requests with `charset` directive in `Content-Type` header (e.g., `Content-Type: application/json; charset=utf-8`) no longer issues an error "Invalid content type" in REST adapters
1618
- - Call SAP HANA procedure:
1619
- + accepted are any symbols in a procedure name if it is delimited with a double quotation (`"`)
1620
- + fixed results for table output parameters when using `@sap/hana-client`; **limitation**: output parameters in a `CALL` statement must follow the same order used in a stored procedure definition
1621
- - `@odata.context` considers `cds.env.odata.contextAbsoluteUrl` when requesting an OData Service
1622
-
1623
- ## Version 5.9.5 - 2022-05-09
1624
-
1625
- ### Fixed
1626
-
1627
- - `HDB_TCP_KEEP_ALIVE_IDLE` config
1628
- - A combination of `!=` operator and `or` in `where` clauses of `@restrict` annotations or when adjusting `req.query` in custom handlers (OData services only)
1629
- - Programmatic calls to bound actions/functions do have keys in `req.data` again if compat flag `cds.env.features.keys_in_data_compat` is set
1630
-
1631
- ## Version 5.9.4 - 2022-05-02
1632
-
1633
- ### Fixed
1634
-
1635
- - Error messages are improved if no `passport` module was found or if no `xsuaa` service binding is available
1636
- - Issue fixed for `srv.get()`. It was returning `TypeError` in plain REST usage for external services, e.g. `srv.get('/some/arbitrary/path/111')`
1637
- - Allow unrestricted services to run unauthenticated, removing the `Unable to require required package/file "passport"` error. Totally not recommended in production. Note that though this restores pre 5.9.0 behavior, this will come again starting in 6.0.
1638
- - Audit logging of sensitive data in a composition child if its parent is annotated with `@PersonalData.EntitySemantics: 'Other'` and has no data privacy annotations other than `@PersonalData.FieldSemantics: 'DataSubjectID'` annotating a corresponding composition, for example:
1639
- ```js
1640
- annotate Customers with @PersonalData : {
1641
- DataSubjectRole : 'Address',
1642
- EntitySemantics : 'Other'
1643
- } {
1644
- addresses @PersonalData.FieldSemantics: 'DataSubjectID';
1645
- }
1646
- annotate CustomerPostalAddress with @PersonalData : {
1647
- DataSubjectRole : 'Address',
1648
- EntitySemantics : 'DataSubject'
1649
- } {
1650
- ID @PersonalData.FieldSemantics : 'DataSubjectID';
1651
- street @PersonalData.IsPotentiallyPersonal;
1652
- town @PersonalData.IsPotentiallySensitive;
1653
- }
1654
- ```
1655
-
1656
- ## Version 5.9.3 - 2022-04-25
1657
-
1658
- ### Fixed
1659
-
1660
- - Since 5.8.2 `req.target` for requests like `srv.put('/MyService.entity')` is defined, but `req.query` undefined (before `req.target` was also undefined). This was leading to accessing undefined, which has been fixed.
1661
- - Custom actions with names conflicting with methods from service base classes, e.g. `run()`, could lead to hard-to-detect errors. This is now detected and avoided with a warning.
1662
- - Typed methods for custom actions were erroneously applied to `cds.db` service, which led to server crashes, for example, when the action was named `deploy()`.
1663
- - Invalid batch requests were further processed after error response was already sent to client, leading to an InternalServerError
1664
- - Full support of `SELECT` queries with operator expressions (`xpr`)
1665
-
1666
- ## Version 5.9.2 - 2022-04-07
1667
-
1668
- ### Fixed
1669
-
1670
- - i18n translation for errors did not work correctly in some cases
1671
- - Normalization in custom `getRestrictions`
1672
- - Throw exception by `INSERT` into HANA queries if number of provided rows deviates from number of affected rows returned by hdb to prevent data losses
1673
- - Handler detection for extended services
1674
- - Speed-up in localization handling
1675
- - Draft: navigation via an association to many from a non-draft enabled entity to a draft-enabled entity
1676
- - Limited support of `SELECT` queries with operator expressions (`xpr`)
1677
-
1678
- ## Version 5.9.1 - 2022-03-31
1679
-
1680
- ### Fixed
1681
-
1682
- - Function arguments might be escaped too often
1683
- - URL encoding for remote services for CQN queries
1684
- - `cds serve` during development again redirects URLs for UI apps in a folder with the same name as a service, so `/foo/webapp` would redirect to `/foo` again. This got broken in 5.8.3.
1685
- - Endless loop in localization handling
1686
- - Ensure service implementation while extending entity from the service
1687
- - Post-processing of custom draft queries
1688
- - `cds build` no longer omits unused CDS type definitions, leading to Java compiler errors
1689
-
1690
- ## Version 5.9.0 - 2022-03-25
1691
-
1692
- ### Added
1693
-
1694
- - Enable custom audit logging implementation by subclassing or prepending `cds.AuditLogService`
1695
- - Log authentication/authorization traces, for example, authentication strategy and access control decisions to facilitate troubleshooting in debug mode.
1696
- - Bound functions and actions calls with odata-v2 from remote service
1697
- - Beta support for procedure calls with table output data (SAP HANA only)
1698
- + Both hdb and `@sap/hana-client` currently do not support parameter metadata for table output. To provide the functionality anyways, CAP must fetch the metadata itself. As this is not CAP's expertise, the feature is only beta.
1699
- + All parameters must be named or unnamed, that is `CALL EXAMPLE_PROC(PARAM_1 => ?,PARAM_2 => ?)` or `CALL EXAMPLE_PROC(?,?)`
1700
- - Alpha `cds.ApplicationService.getRestrictions(definition, event, user)`, which returns the applicable restrictions for the current request as follows:
1701
- + `null`: unrestricted access
1702
- + `[]`: no applicable restrictions -> no access
1703
- + `[{ grant: '...', to: ['...'], where: '...' }, ...]`: applicable restrictions with grant normalized to strings
1704
- + That is, `grant: ['CREATE', 'UPDATE']` in model becomes `[{ grant: 'CREATE' }, { grant: 'UPDATE' }]`
1705
- + Promise resolving to any of the above (needed for CAS override)
1706
- - Internal model provider service can be used for obtaining dynamic csn, including features and key user extensions
1707
- - Support insert of SQL snippets for HANA migration tables using @sql.append and @sql.prepend annotations.
1708
- - Support for the `@odata.draft.enclosed` annotation on associations targeted via navigation — previously only supported for `$expand`
1709
- - Pseudo role `internal-user` for technical user tokens acquired from own XSUAA instance
1710
- - Include globally-installed cds-dk version in output of `cds version`.
1711
- - Include version of cds-mtx in output of `cds version`, if available.
1712
- - Feature toggle support in `cds build` for cloud deployments. Create language bundles and parsed CSN for all features.
1713
- - Support for `@Aggregation.default` in new OData parser (`cds.env.features.odata_new_parser = true`)
1714
-
1715
- ### Changed
1716
-
1717
- - Cleaned up `cds.env.requires` towards a consistent usage:
1718
- + Moved all entries of `cds.requires` to `cds.requires.kinds` → `cds.requires` is empty now by default, but has `cds.requires.kinds` as prototype, so e.g. `cds.requires.sql` will still return a match.
1719
- + Added support for db-specific `cds.requires.db.deploy-format` → deprecating `cds.hana.deploy-format` (which is still supported for compatibility)
1720
- + Introduced `cds.requires.kinds.hana-cloud` as `{kind:hana, deploy-format:hdbtable}` → to be used by default for production
1721
- + Changed `cds.requires.audit-log` to be consistent to all other; also got moved to `cds.requires.kinds.audit-log`, so it is no longer activated by default.
1722
- + Added support for `cds.requires.foo: true` with `foo` being a preset/prototype entry in `cds.requires.kinds` → allows to more easily switch on pre-configured services.
1723
- - Update-managed properties (`@cds.on.update`) are always updated
1724
- + Example: `UPDATE('Books').set({}).where({ ID: 1 })` leads to new modifiedAt and modifiedBy
1725
- + Does not apply to nested entities that are only preserved by specifying their primary keys in the data
1726
- + Deactivate during two month grace period via compact feature flag `cds.env.features.update_managed_properties = false`
1727
- - Response no longer contains keys neither technical draft properties (e.g. `HasDraftEntity` or `InProcessByUser`) in expanded data if they were not requested explicitly when using `cds.Service` API
1728
- + Example:
1729
- ```js
1730
- > await srv.read('Authors', a => { a.name, a.books(b => { b.title }) }).where({ ID: 1 })
1731
- // -> "old behaviour" result
1732
- [{ name: 'Emily Brontë', books: [{ title: 'Wuthering Heights', ID: 201 }] }]
1733
- // -> "new behaviour" result
1734
- [{ name: 'Emily Brontë', books: [{ title: 'Wuthering Heights' }] }]
1735
- ```
1736
- + Technical draft properties are not automatically fetched also on a root level
1737
- + Deactivate during two month grace period via compat feature flag `cds.env.features.auto_fetch_expand_keys = true`
1738
- - Access control is checked in generic handlers (rather than handlers materialized on app startup)
1739
- - Expand restriction check moved to pre-before phase
1740
- - The active state of an entity is read instead of the draft state when navigating from a draft entity to a draft-enabled entity via an association.
1741
- - Authentication middleware is always mounted (used to be only for restricted services)
1742
- - Fiori preview now uses the Horizon theme
1743
- - 'Preview' links in generic index.html page no longer get the word _preview_ appended automatically, allowing for more flexible naming. Link providers should make sure to add the _preview_ word if necessary.
1744
- - Don't throw error in GraphQL adapter if update mutation filter does not match any entries (to be consistent with delete mutations)
1745
- - Remote call of unbound action/function returns octet-stream instead of string by default
1746
- - Default pool's behavior has been changed from `FIFO` (queue) to `LIFO` (stack). Can be changed in pool configuration.
1747
- - `cds run/serve` now gracefully shuts down the HTTP server before exiting. Custom handlers for signals like `SIGTERM` or `SIGINT` can now be processed.
1748
- - `cds build` no longer creates `COMMENT` statements for HANA if doc comments are present in CDS models. The statements caused superfluous table migrations during HANA deployments.
1749
-
1750
- ### Fixed
1751
-
1752
- - Logging of failed requests to remote services was incompatible to Elasticsearch
1753
- - `cds serve --project <dir>` didn't serve static web resources from `<dir>`
1754
- - `cds serve -p <dir>` was meant to be a shortcut for `cds serve --project <dir>`
1755
- - Messaging: Use correct kind for logging
1756
- - Incorrect return values for update-managed properties (`@cds.on.update`) of child entities that were not changed in request
1757
- - `$filter` with navigation to-one eq null
1758
- - Calculation of `DraftIsProcessedByMe` when navigating to `DraftAdministrativeData`
1759
- - Inbound streaming with media type annotated as `@Core.Computed`
1760
- - Pass column expression into `SELECT()` (example: `SELECT('SUBSTRING(locale,0,2) as loc').from(<entity>)`)
1761
- - Annotation `@cds.api.ignore` ignores key in new parser
1762
- - Inconsistencies in actions and functions API
1763
- - Opening root transaction in `srv.run` if none exists
1764
- - Glitches in handling of `req.user.tenant` and `req.user.locale`
1765
- - Flattened keys in URL are resolved correctly if they are unique in new REST adapter
1766
- - Actions and functions in REST adapter
1767
- - Empty string as key does not work in new parser
1768
- - Requesting property of an entity caused error in new parser
1769
- - The SQLite CSV import now imports `"true"` and `"false"` as strings instead of Booleans
1770
- - Fixed loading mechanism for custom build task handlers
1771
- - `req.diff()` for `UPDATE` on a view with renamed property in `orderBy`
1772
- - `$user.<attr>` for managed properties (`@cds.on.insert`/`@cds.on.update`)
1773
- - GraphQL `__typename` meta field if it is the only selected field of an association/composition
1774
- - Command shortcuts like `cds c` are now handled properly if executed in an NPM script
1775
- - ETag is not included in expanded entities using `$select`, for example: `Books(1)?$expand=author($select=ID)`
1776
- - `cds.compile.to...` no longer crashes if called with a CSN that has a dangling ref
1777
- - Requests to remote services via navigation path without explicit `$select`, but having `$expand` query option
1778
- - `cds.compile` correctly supports reserved namespaces like `cds.foundation`.
1779
- - `cds.compile.to.serviceinfo` now uses the correct configuration for the base URL paths for Java services
1780
- - `cds deploy --to sqlite` correctly localizes texts in deployed views. Before not all localized texts have been correctly resolved.
1781
- - `cds deploy --to hana` reports missing org or space info with a better message.
1782
- - Using combinations of `.` and `_` in CSN definition names
1783
-
1784
- ### Removed
1785
-
1786
- - Redundant locale implementation
1787
-
1788
- ## Version 5.8.4 - 2022-03-17
1789
-
1790
- ### Fixed
1791
-
1792
- - `UPDATE` singleton entity does not require to provide singleton keys in a payload
1793
- - CQN queries with operator expressions (`xpr`) in ON-conditions of unmanaged associations and compositions
1794
-
1795
- ## Version 5.8.3 - 2022-03-01
1796
-
1797
- ### Fixed
1798
-
1799
- - `queries` property for application-defined destinations of remote services
1800
- - `cds serve --watch` no longer fails if `@sap/cds-dk` is installed only globally
1801
- - `cds serve` during development longer redirects URLs with similar path segments from different services, like `/service/one` and `/service`
1802
- - `cds deploy --to sqlite` now ignores a `_texts.csv` file again if there is a language-specific file like `_texts_en.csv` present
1803
- - Using logical blocks (surrounded with `(` and `)`) in ON-conditions of unmanaged associations and compositions
1804
- - Skip "with parameters" clause if no order by clause or all columns in the order by clause are not strings when using parametrized views on SAP HANA
1805
- - Limited support for binary data in OData
1806
- - Using of `base64` encoded string values in `WHERE IN` on SAP HANA
1807
- - `base64url` values in `@odata.context` annotation
1808
- - `cds.context` is set in GraphQL adapter
1809
- - Using payloads with `@odata.type` annotating primitive properties no longer crashes the application. `#` in type value may be omitted. Example:
1810
-
1811
- ```json
1812
- {
1813
- "ID": 201,
1814
- "title@odata.type": "#String",
1815
- "title": "Wuthering Heights",
1816
- "stock@odata.type": "Int32",
1817
- "stock": 12
1818
- }
1819
- ```
1820
-
1821
- - Unicode support for i18n bundles
1822
-
1823
- ## Version 5.8.2 - 2022-02-22
1824
-
1825
- ### Fixed
1826
-
1827
- - Crash if error does not have a stack in Kibana logging
1828
- - Allow short names for bound operations in odata-server
1829
- - Performance issue during deep operations
1830
- - Resolving views with parameters
1831
- - Expanding association-to-many within draft union scenario
1832
- - Erroneous invalidation of deep `INSERT|UPDATE|DELETE` operations if root entity has managed to-one association to non-writable view
1833
- - Handling of falsy results when sending requests to remote services
1834
- - Resolving foreign key propagations for views with union
1835
-
1836
- ## Version 5.8.1 - 2022-02-11
1837
-
1838
- ### Fixed
1839
-
1840
- - Use single transaction for update mutations in GraphQL adapter
1841
- - ODATA to CQN parser returned not selected keys in `@odata.context`
1842
- - Draft: `$expand` with special draft columns in `$orderBy` for active entities
1843
- - Reading distinct values of draft enabled entity
1844
- - Handling of LOB data on HANA
1845
- - Fix streaming draft by navigation
1846
- - Empty to-many arrays are not removed from req.data for inserts
1847
- - `$filter` query option in structured mode (OData flavors `w4` and `x4`)
1848
- + Using JSON-stringified objects no longer occasionally crashes an application
1849
- + Filtering on a structured element with `ne null` condition also selects data having some `null` properties within
1850
- - Rest: `Content-type` header is set to `text/plain` for primitive data types in response (except for `Boolean`)
1851
-
1852
- ## Version 5.8.0 - 2022-01-27
1853
-
1854
- ### Added
1855
-
1856
- - Custom `server.js` don't have to export `cds.server` anymore -> we use that by default now.
1857
- - In `cds.requires`: Support to replace primitive values with objects
1858
- - Support filter functions on renamed properties from external service
1859
- - Results of database queries use `big.js` for values of type `cds.Decimal` and `cds.Integer64` if enabled via `cds.env.features.bigjs`
1860
- - Support lambda in `$filter` in `$expand`
1861
- - Support for `GET` requests on service root in REST adapter (old and new)
1862
- - Support for `HEAD` requests in REST adapter (old and new)
1863
- - New hook `req.before('commit')`
1864
- - Draft (Access control for bound actions): Only the user that is the owner of the draft can execute its bound actions.
1865
- - Check that all keys are provided in REST adapter
1866
- - Restrict access to all services via `cds.env.requires.auth.restrict_all_services = true`
1867
- - That is, all unrestricted services (i.e., w/o own `@requires`) are treated as having `@requires: 'authenticated-user'`
1868
- - Threshold for automatically sending GET requests as `$batch` (beta, cf. @sap/cds@5.6.0) can be configured per remote service via `cds.env.requires.<srv>.max_get_url_length` (if not configured on service, the global config applies)
1869
- - Limited support for binary data in OData
1870
- - In payloads, the binary data must be a base64 encoded string
1871
- - In URLs, the binary data must have the following format: `binary'<url-safe base64 encoded>'`, e.g., `$filter=ID eq binary'Q0FQIE5vZGUuanM='`
1872
- - The use of binary data in some advanced constructs like `$apply` and `/any()` may be limited
1873
- - On SQLite, the base64 encoded string is stored in the database
1874
- - It’s strongly discouraged to use binary data as keys. See "Primary Keys — Best Practices" in the documentation.
1875
- - Support for OData annotation `@Core.ContentDisposition.Type` with `attachment` as the default value
1876
- - Support for returning custom stream objects in custom handlers (beta):
1877
- - Example:
1878
-
1879
- ```js
1880
- return {
1881
- value: instanceof Readable || null,
1882
- $mediaContentType = 'image/jpeg',
1883
- $mediaContentDispositionFilename = 'foo.bar', // > optional
1884
- $mediaContentDispositionType = 'inline' // > optional
1885
- }
1886
- ```
1887
-
1888
- ### Changed
1889
-
1890
- - `cds deploy --to hana` now uses `cf curl` instead of `cf` command natively
1891
- - Event Mesh: In multitenancy mode, messaging artifacts are also deployed for provider accounts (unless the service option `deployForProvider` is set to `false`)
1892
- - Status code in case of multiple errors (rules apply in order):
1893
- + If all errors have the same status code, that status code is used
1894
- + If there is at least one 5xx status code, the resulting status code is 500
1895
- + If there is at least one 4xx status code, the resulting status code is 400
1896
- + If none of the rules apply, the resulting status code is 500
1897
- - Ignore the `If-Match` HTTP request header for `UPDATE`/`DELETE` requests whose target entities are not annotated with the `@odata.etag` annotation.
1898
- - I18n template strings now are replaced in EDMX documents such that they can occur multiple times. For example, the `{i18n>key1} - {i18n>key2}` template results in `value1 - value2`, while previously only the first string was replaced, leading to `value1 - {i18n>key2}`. This is helpful for the [`Template` strings of `UI.ConnectedFields`](https://github.com/SAP/odata-vocabularies/blob/ac9fe832df9b8c8d35517c637dba7c0ac2753b0f/vocabularies/UI.xml#L168).
1899
-
1900
- ### Fixed
1901
-
1902
- - At Node.js runtime, the `development` configuration profile is no longer active if `CDS_ENV` is set to `production` and `NODE_ENV` is undefined
1903
- - Enterprise Messaging: The user is now privileged for AMQP
1904
- - `cds.spawn` also works with synchronous functions
1905
- - Foreign keys in parent are set to `null` when deleting composition of one
1906
- - `cds version` now always prints the version of `@sap/cds-dk`, especially if `cds version` was called from within an npm script, i.e. not from `cds-dk`'s CLI.
1907
- - Better error message in case destination of Remote Service isn’t found
1908
- - Differentiate between draft already exists and entity locked
1909
- - OData adapter: roll back transaction before re-throwing standard error in case of atomicity group
1910
- - Results of actions/functions do not ignore custom data when using `$expand` query option
1911
- - `req.data` is available in custom error handler in case of deserialization error thrown by legacy OData server
1912
- - Joining entities with renamed foreign keys (limited to single-level projections)
1913
- - Requests with draft and `$expand=*` caused problems in some cases
1914
- - `cds serve` during development longer redirects URLs with similar path segments like `/browse/123/browse/` to e.g. `/browse/`
1915
- - Post-processing for renamed columns in expand
1916
- - Deploy to SAP HANA: passing of options to `hdi-deploy` via `HDI_DEPLOY_OPTIONS` now possible
1917
- - Keys as path segments in beta OData to CQN parser
1918
- - OData V2 Remote Service (`"kind": "odata-v2"`):
1919
- + Request data properties of types `cds.Date`, `cds.DateTime`, and `cds.Timestamp` are converted accordingly to OData V2 specification
1920
- + Response data properties of types `cds.Decimal`, `cds.DecimalFloat` (deprecated) and `cds.Integer64` are handled properly when using `Accept` header with `IEEE754Compatible=true/false` and `ExponentialDecimals=true/false` format parameters
1921
-
1922
- ## Version 5.7.6 - 2022-02-23
1923
-
1924
- ### Fixed
1925
-
1926
- - `draftActivate` action does not return children if not requested
1927
-
1928
- ## Version 5.7.5 - 2022-01-14
1929
-
1930
- ### Fixed
1931
-
1932
- - Instance-based restriction for activation of draft-enabled entities using `or` in restriction
1933
- - Messaging: Duplicate handler execution if application service registered events twice
1934
- - Post of a deeply nested sub-entity with structured parent keys
1935
- - Negating lambda expressions in OData using the `not` operator
1936
- - Event Mesh: Redelivery count when using AMQP
1937
- - OData requests using lambda expressions on localized data
1938
- - `cds.db.exists` wrongly generated a `SELECT * FROM ...` for OData flavor x4
1939
- - Return localized texts on draft activate
1940
- - Unicode characters in unquoted search terms in beta OData to CQN parser
1941
-
1942
- ## Version 5.7.4 - 2021-12-22
1943
-
1944
- ### Fixed
1945
-
1946
- - Complex `@restrict.where: 'exists [...] or (... or ...) or ...'` in draft union scenario no longer crashes the application
1947
- - Sanitization of null values for `cds.RemoteService`
1948
- - Handling of boolean values in draft union scenario with `$expand` query option
1949
- - `_4odata` flag in CQN stays non-enumerable when forwarding to another application service
1950
- - Handling of type references on properties of associations in `cds.minify`
1951
-
1952
- ## Version 5.7.3 - 2021-12-16
1953
-
1954
- ### Fixed
1955
-
1956
- - Message Queuing now accepts `amqp` options
1957
- - OData requests using lambda expressions with `contains` function
1958
- - Result of OData query option `$count=true` when using `$apply`
1959
- - `$filter` with navigation to-one equals value crashes
1960
- - `$skiptoken` query option allows using arbitrary symbols except of `&` with beta OData URL to CQN parser (`cds.env.features.odata_new_parser`). In this non-integer value case, the value won’t be parsed into CQN.
1961
- - Function names in `$filter` can now be case insensitive (as per OData 4.01)
1962
- - `$count` in `$expand` caused server to crash
1963
-
1964
- ## Version 5.7.2 - 2021-12-09
1965
-
1966
- ### Fixed
1967
-
1968
- - Instance-based restriction for activation of draft-enabled entities
1969
- - `.columns('*')` on projections of remote services using renamed properties
1970
- - GraphQL filters on nested fields are now applied correctly
1971
- - Performance degradation during the processing of `where exists`
1972
- - Read drafts via navigation with complex filter expression
1973
-
1974
- ## Version 5.7.1 - 2021-12-06
1975
-
1976
- ### Fixed
1977
-
1978
- - Draft (OData flavors `w4`, `x4`, and `v4` with structs): Flags `HasActiveEntity`, `HasDraftEntity`, and `IsActiveEntity` are now included in the HTTP response for GET requests.
1979
- - Instance-based restriction on entities using localized fields in draft
1980
- - Results of actions/functions do not ignore nested data if query options are present
1981
-
1982
- ## Version 5.7.0 - 2021-12-03
1983
-
1984
- ### Added
1985
-
1986
- - Deferred emitting via persistent outbox, enabled through service `outbox` of kind `persistent-outbox`
1987
- - Support for compiler-generated referential constraints (beta)
1988
- + Activate via `cds.env.features.assert_integrity: '<preset>'`
1989
- + Available presets:
1990
- + `off`: no database constraints and no runtime checks
1991
- + `app`: runtime checks by default
1992
- + `db`: database constraints by default
1993
- + "by default": if not excluded, the runtime check or database constraint applies
1994
- + "opt-in": if included, the runtime check or database constraint applies
1995
- + Behavior can be overridden via `@assert.integrity: <true/false/'RT'/'DB'>` on property, entity, or service level (lowest applies)
1996
- - Allow `--with-mocks` in production via `cds.env.features.with_mocks = true`
1997
- - Set media type from content-type header while inbound streaming
1998
- - Support for navigations with `$count` in `$filter`, for example `GET Entity?$filter=toMany/$count gt 0`
1999
- - Draft: Generate UUIDs for request payloads to which extra data items are added (without the UUID keys) in a custom application handler.
2000
- - Generate GraphQL schema via `cds compile -2 gql` (alpha)
2001
- - Log requests to remote services if the respective log level is set to `debug`
2002
- - Beta OData URL to CQN parser (`cds.env.features.odata_new_parser`):
2003
- + Support for `$skiptoken` query option
2004
- + Limited support for `$apply` query option
2005
- + Supported are the following transformations and their combinations: `aggregate`, `groupby`, `topcount`, `bottomcount`, `filter`, `search`
2006
- + Not supported:
2007
- + Transformations `topsum`, `bottomsum`, `toppercent`, `bottompercent`, `expand`, `concat`, `compute`, `identity`
2008
- + `rollup` and `$all` in `groupby` transformation
2009
- + Filter function `isdefined`
2010
- + Custom aggregation methods, arithmetic operators (`add`, `sub`, `mul`, and so on), and keyword `from` in `aggregate` transformation
2011
- + OData vocabulary for Data Aggregation, `@Aggregation.default` annotation
2012
- + Out of scope:
2013
- + Draft handling
2014
- - Out-of-the-box audit logging for draft enabled entities
2015
- - Support for `@sap/instance-manager`'s hybrid mode
2016
- + Enable via `cds.env.features.hybrid_instance_manager`
2017
- + Respective version of `@sap/instance-manager` required
2018
- - `cds.minify()` (alpha) as static method
2019
- - Annotation `@open` for actions in new Rest Adapter
2020
- - Audit logging (`cds.env.features.audit_personal_data`) supports annotation `@PersonalData.EntitySemantics: 'Other'` and allows an arbitrary composition of entities with respect to `@PersonalData.EntitySemantics` annotations
2021
-
2022
- ### Changed
2023
-
2024
- - `if-match` and `if-none-match` headers are ignored for entities without etags
2025
- - Improve response time of `SELECT` queries that check referential integrity by adding an upper bound `LIMIT 1`
2026
- - Leaner implementation for `sap-statistics`
2027
- - Leading and trailing whitespaces are allowed for `$search` query parameter
2028
- - Insert / Update of Composition of one with empty object is not allowed for non UUID keys
2029
- - Search behavior of whitespaces changed as follows:
2030
- + Searches for plain whitespace, for example, `"$search= "` matches the complete data set.
2031
- + Searches for whitespace surrounded by double-quotes, for example, `$search=" "` matches all entries containing whitespaces.
2032
- - In single-tenant mode, the default SQLite database is used, regardless of `context.tenant`
2033
- - `cds build` for Node.js projects now copies `package-lock.json` files into the staging folder (usually `gen/srv`). This allows the execution of `npm ci` there.
2034
- - Relaxed UUIDs in beta URL to CQN parser (`cds.env.features.odata_new_parser`)
2035
- - Authentication strategies `dummy` and `mock` no longer require `passport`
2036
- - In production, debug logs of `cds.DatabaseService` and `cds.RemoteService` have sanitized values
2037
- + Deactivate via `cds.env.log.sanitize_values = false`
2038
-
2039
- ### Fixed
2040
-
2041
- - Path resolution for references in sub-selects
2042
- - Where exists without infix filter, e.g., `@restrict.where: 'exists author'`
2043
- - `@restrict.where: 'exists [...]'` in draft union scenario
2044
- - Select query with path exists predicates, for example, `WHERE EXISTS books[year = 2000].pages[wordcount > 1000]`
2045
- - Proper registration of audit log event handlers
2046
- - Draft: Generate foreign keys for request payloads to which extra data items are added in a custom application handler.
2047
- - `cds build` correctly merges `hdbmigrationtable` files that have multiple new migration versions defined.
2048
- - `cds.test` converts response data of failed requests to JSON to prevent lost error details
2049
- - Instance-based restriction for draft enabled entities
2050
- - Delete requests for localized with compositions
2051
- - Ignore input for static and calculated fields during draft activate
2052
- - Clear extension map entry on error during CSN fetching
2053
- - Do not ignore errors during diff calculation
2054
- - Requests to mocked remote service when using custom service name with `.service` property
2055
- - Rollback on already backrolled or committed transactions are ignored
2056
- - Rollback handling in spawned background job
2057
- - `cds.spawn()` throws error if passed option is an instance of `cds.EventContext`
2058
- - Delete `timestamp` from options passed to `cds.spawn()` (transactions create their own timestamp)
2059
- - Type error during programmatic action/function call if no params defined
2060
- - Fully qualified bound actions/ functions in beta URL to CQN parser (`cds.env.features.odata_new_parser`)
2061
- - Draft handling: `GET` requests with navigation via `SiblingEntity` and expand to-one
2062
- - No audit log if sensitive data not selected
2063
- - Kibana formatter: do not log authorization header value
2064
- - Audit logging (`cds.env.features.audit_personal_data`) no longer crashes the application
2065
- + when using the same entity as a composition child in different parent entities
2066
- + when accessing a not existing entity
2067
-
2068
- ### Removed
2069
-
2070
- - Deprecated feature flags `cds.env.runtime.skipWithParameters` and `cds.env.features.skip_with_parameters`. Use `cds.env.features.with_parameters` instead.
2071
-
2072
- ## Version 5.6.4 - 2021-11-23
2073
-
2074
- ### Fixed
2075
-
2076
- - Preserve log level in Kibana formatter
2077
- - RFC 3986 compliant segment recognition in beta URL to CQN parser (`cds.env.features.odata_new_parser`)
2078
- - Support for `$skiptoken` OData query option when using beta URL to CQN parser (`cds.env.features.odata_new_parser`)
2079
- - OData requests with `$skip` and without `$top` query option to services with defined default limit (`cds.query.limit.default`)
2080
- - Creating entities with binary keys. Currently, the binary keys may be provided only as Node.js `Buffer` instances using a custom handler.
2081
- - Requests with a payload containing nested arrayed elements no longer crash the application
2082
-
2083
- ## Version 5.6.3 - 2021-11-15
2084
-
2085
- ### Fixed
2086
-
2087
- - `cds run` does not fail if `cds.requires.multitenancy` is explicitly set to `false`
2088
- - Calculation of `DraftIsCreatedByMe` or `DraftIsProcessedByMe` when expanding or navigating to `DraftAdministrativeData`
2089
- - Nested `any` in `$filter` query option
2090
- - Crash on draft activate after draft edit for not existing composition of one if no explicit DB service is defined
2091
- - Typescript definition of `srv.delete` no longer leads to a duplication error
2092
-
2093
- ## Version 5.6.2 - 2021-11-08
2094
-
2095
- ### Fixed
2096
-
2097
- - Handle arrayed elements using templating mechanism
2098
- - OData requests to `$count` endpoint of ETag enabled entity
2099
- - `cds.test` does no longer crash if executed in `cds repl` on a remote service call
2100
- - Crash on draft activate after draft edit for not existing composition of one
2101
- - Ensure request correlation (with default server)
2102
- - `<entity>.texts` points to real text entity
2103
- - Draft union with expand to to-one and to-many
2104
- - No columns in draft lock statement (i.e., use `SELECT 1`)
2105
-
2106
- ## Version 5.6.1 - 2021-11-02
2107
-
2108
- ### Fixed
2109
-
2110
- - UAA credentials lookup
2111
- - Revert return type validation for `cds.String` for compatibility with older `@sap/cds-mtx` versions
2112
- - Messaging: Ill-defined incoming AMQP messages will not crash the app
2113
- - `cds compile -l` does no longer crash if called without `--to` option
2114
-
2115
- ## Version 5.6.0 - 2021-10-29
2116
-
2117
- ### Added
2118
-
2119
- - New REST protocol adapter (beta)
2120
- + Makes use of the beta OData URL to CQN parser. Hence, almost all OData requests are supported (see limitations below).
2121
- + Activate via `cds.env.features.rest_new_adapter = true`
2122
- + Out of scope (compared to OData protocol adapter):
2123
- + OData query option `$apply`
2124
- + Batch requests (with or without atomicity groups)
2125
- + Draft handling
2126
- - New GraphQL protocol adapter (alpha)
2127
- + Serves single endpoint for all services based on `served` event at `/graphql` (subject to change).
2128
- + Activate via `cds.env.features.graphql = true`
2129
- + Required additional dependencies: `@graphql-tools/schema`, `express-graphql`, and `graphql`
2130
- + Not meant for productive use! For example, authentication and authorization are out of scope.
2131
- - Support of the following features when using beta OData URL to CQN parser (`cds.env.features.odata_new_parser`):
2132
- + REST-style URLs (example: `GET /Foo/1`)
2133
- + `$expand=*` query option on different nested expand levels (`$levels` isn’t yet supported)
2134
- + Draft handling
2135
- + Structured keys
2136
- + Streaming
2137
- + Navigation to primitive properties without `$value` query option
2138
- - Optimized Search: Support `$filter` query option in combination with optimize `$search` and localized data (when the environment variable `cds.env.features.optimized_search` is set to `true`)
2139
- - `GET` requests support static values in ON-conditions of composition parents when using unmanaged backlinks
2140
- - `destinationOptions` can be configured for Remote Services
2141
- + Example:
2142
- ```json
2143
- {"cds":{"requires":{
2144
- "S4": {
2145
- "destinationOptions": {
2146
- "selectionStrategy": "subscriberFirst",
2147
- ...
2148
- }
2149
- }
2150
- }}}
2151
- ```
2152
- - `forwardAuthToken` can be configured for Remote Services
2153
- + Example:
2154
- ```json
2155
- {"cds":{"requires":{
2156
- "credentials": {
2157
- "url": "...",
2158
- "forwardAuthToken": true
2159
- }
2160
- }
2161
- }}}
2162
- ```
2163
- - File to store private project settings `.cdsrc-private.json` (shouldn’t be checked in source code management)
2164
- - Read additional configuration from JSON files or directory structures using `CDS_CONFIG` env variable
2165
- - Missing typescript definitions for services' `.send` shortcuts `get`, `put`, `post`, `patch`, and `delete`
2166
- - Build VCAP_SERVICES env variable dynamically for compatibility (`cds.env.features.emulate_vcap_services`)
2167
- - GET requests to Remote OData Service are automatically sent as `$batch` if the generated URL is too long
2168
- + Can be configured via `cds.env.remote.max_get_url_length` (beta, default: 1028).
2169
- - Provide ETag in response headers in case of `prefer: return=minimal`
2170
- - Kibana formatter: log the user's id via `cds.env.log.user = true` (beta)
2171
- + Consider the data privacy implications!
2172
- - Experimental support for uiflex running locally on sqlite by setting `cds.requires.extensibility.kind = uiflex`
2173
- - Minified `cds.model` (deactivate via `cds.env.features.skip_unused = false`)
2174
-
2175
- ### Changed
2176
-
2177
- - Query API: Specified keys are now part of the target path, e.g. `SELECT.from('Books', 1)` will move the key condition into `SELECT.from.ref`.
2178
- + Deactivate during two-month grace period via compat feature flag `cds.env.features.keys_into_where = true`
2179
- - Removed duplicate integrity checks
2180
- - Optimized search: Optimize queries for non-localized elements
2181
- - OData to CQN parsing changed to enable remote service consumption. As a side effect, application code in `srv.on('READ', handler)` custom handlers relaying on CQN might need to be adapted. The following has changed:
2182
- - Previously, columns in `req.query.SELECT.columns` were always defined. Now, in case there is no `$select` and `$expand` query options in the OData query, `req.query.SELECT.columns` is `undefined`.
2183
- - Previously, if the `$expand` query option was specified in the OData query, all elements of the expanded navigation property were listed explicitly in the CQN query. Now, an `*` (asterisk) is listed instead.
2184
- - Non-specified columns are resolved at database layer
2185
- - `cds deploy` no longer enforces the presence of SAP CommonCryptoLib (checked with env variable `SECUDIR`) on Windows since it uses now the built-in security libraries
2186
- - Target keys are not included in the body when sending `PATCH` requests to external services
2187
-
2188
- ### Fixed
2189
-
2190
- - Audit logging of non-string values
2191
- - Query API compilation error when keys start with `{`
2192
- - Handling of wrong Edm.DateTimeOffset values
2193
- - Using UUIDs in search with beta OData URL to CQN parser (`cds.env.features.odata_new_parser`)
2194
- - Runtime exception for READ requests with deeply nested navigation and structured keys, for example:
2195
- `GET foo/Bar/b708ad6c-2dd4-40d5-91c0-2e3eacf306d2/Info/sales(a='1010',b='10',c='00')/functions(functionName='error')`
2196
- - The check for the minimum Node.js version now properly enforces version 12.18, i.e. aborts server startup.
2197
- - `cds.test` fails with a clearer error message if the server wasn't started at all
2198
- - Audit logging for modification of personal or sensitive data when using same entity as a composition child in different parent entities
2199
- - Deleting an entity defined with managed composition of one, whereas a dependent entity is defined as having an independent managed association to its composition parent no longer crashes the application
2200
- - Audit logging for entities having arrayed elements
2201
- - Filtering for `cds.Date` on Remote OData V2 services
2202
- - Crash when `rollup` function was used in groupBy in OData requests
2203
- - Or for $filter with IsActiveEntity=true for access to active entities
2204
- - Reading draft-enabled entity with `$expand` targeting non-draft associations
2205
- - Delete with sub-select
2206
- - Runtime exception when streaming property annotated with `@Core.MediaType: 'application/json'`
2207
- - Reading streams via navigation when entity containing large data is a part of a draft-enabled composition tree
2208
- - Read draft entity with nested exists restriction
2209
- - Activate draft of entity having `to-one` and `to-many` compositions
2210
- - Caching issue that causes the OData `omit-values` preference in `Prefer` HTTP headers to misbehaves
2211
- - Deletion of draft instances if multiple draft enabled entities are used within one service
2212
- - Queries with `contains` filter targeting a remote OData v2 service
2213
- - Schema evolution support for nested CDS entities in `cds build`
2214
- - I18n texts with quotes and other special characters get escaped correctly if they appear in XML and JSON documents
2215
- - Execution of plain SQL statements on SQLite
2216
- - `Content-Disposition` header is now URL encoded
2217
-
2218
- ### Removed
2219
-
2220
- - Usage of `@sap/xsenv` is superseded with `cds.env` in node.js cds-runtime
2221
- - `@odata.on.insert/update` and `#user/now` are deprecated and will be removed in the next major version. Use `@cds.on.insert/update` and `$user/now` instead.
2222
-
2223
- ## Version 5.5.5 - 2021-10-20
2224
-
2225
- ### Fixed
2226
-
2227
- - Action parameters set to null
2228
- - Restrictions with "where exists" clause and filter on ambiguous fields
2229
- - Nulled user attribute in restrictions with "where exists" clause
2230
- - Wait for all queries to settle during deep operation
2231
-
2232
- ## Version 5.5.4 - 2021-10-12
2233
-
2234
- ### Fixed
2235
-
2236
- - Backwards compatibility for `cds.tx({ user: new User ({ tenant, locale }) })`
2237
- - Transaction API fix: `cds.tx ({ tenant }, tx => { ... })` instead of `cds.tx (tx => { ... }, { tenant })`
2238
- - Writable and reliable `query._target`
2239
- - `req.target` in REST with navigations in URL
2240
-
2241
- ## Version 5.5.3 - 2021-10-06
2242
-
2243
- ### Fixed
2244
-
2245
- - Resolving of views for view definitions using aliases
2246
- - `cds.test` in `cds repl` no longer yields an error with the `beforeEach` function not found
2247
- - Aliasing in case of draft union when expanding more than one `to-one` association
2248
- - Resolving of views if intermediate views are defined in database namespace
2249
-
2250
- ## Version 5.5.2 - 2021-09-29
2251
-
2252
- ### Fixed
2253
-
2254
- - `$expand` requests with virtual fields with the same name in root and child
2255
- - Requests expanding `DraftAdministrativeData` when compound keys are used
2256
- - `SELECT.columns` with an empty array as argument
2257
- - Queries with complex lambda filters
2258
-
2259
- ## Version 5.5.1 - 2021-09-24
2260
-
2261
- ### Added
2262
-
2263
- - Support for casting SQL function input
2264
-
2265
- ### Fixed
2266
-
2267
- - Typo in `DELETE` method of `cds.test`
2268
- - View resolving for intermediate queries
2269
- - Result post-processing for renamed expands
2270
- - Don't use placeholder values for `null`
2271
-
2272
- ## Version 5.5.0 - 2021-09-23
2273
-
2274
- ### Added
2275
-
2276
- - Support for minified models
2277
- - Messaging: Support for string payloads
2278
- - Messaging: Webhooks use 'application/json' as the default content type
2279
- - Messaging: If senders don't use `data` as a property of the payload, then the whole payload is interpreted as `data`
2280
- - Messaging: Support for `$namespace` placeholer in queue name
2281
- - Support for deletable singletons with `@odata.singleton.nullable`
2282
- - Remote requests set the `accept-language` header according to the original request or the user's locale
2283
- - Support for choosing data source names different from names of respective service definitions.
2284
- + Example:
2285
- ```json
2286
- {"cds":{"requires":{
2287
- "S4": {
2288
- "model": "...", "service": "API_BUSINESS_PARTNER"
2289
- }
2290
- }}}
2291
- ```
2292
- - When calling `cds.tx()` to create new transactions, this now automatically inherits the current event context from `cds.context`. In case that creates issues set `cds.env.features.cds_tx_inheritance = false` to restore the former behaviour. You can still overwrite individual context settings, for example:
2293
- ```js
2294
- const tx = cds.tx() // inherits tenant and user
2295
- const tx = cds.tx({ // inherits tenant
2296
- user: new cds.User.Privileged
2297
- })
2298
- ```
2299
- - Method `cds.tx()` now allows to pass a function which will be executed within a new managed transaction, with `tx.commit/rollback()` handled automatically. For example:
2300
- ```js
2301
- await cds.tx (tx => {
2302
- await tx.insert (...)
2303
- await tx.read (...)
2304
- })
2305
- ```
2306
- is equivalent to:
2307
- ```js
2308
- const tx = cds.tx ()
2309
- try {
2310
- await tx.insert (...)
2311
- await tx.read (...)
2312
- await tx.commit()
2313
- } catch {
2314
- await tx.rollback()
2315
- }
2316
- ```
2317
- - Method `cds.tx({user})` now allows specifying a user as a plain string, for example:
2318
- ```js
2319
- cds.tx ({ user:'me' })
2320
- ```
2321
- is equivalent to:
2322
- ```js
2323
- cds.tx ({ user: new cds.User('me') })
2324
- ```
2325
- - Newly introduced method `cds.spawn()` allows correctly and conveniently spawning background jobs from within event handlers. Thereby ensuring a detached fully-managed ACID transaction set as `cds.context` for each execution of the background job, inheriting the current event context from the outer `cds.context` by default. Usage options:
2326
- ```js
2327
- cds.spawn (async ()=>{
2328
- await INSERT.into ('Ticker') ...
2329
- })
2330
- ```
2331
- ```js
2332
- cds.spawn (async ()=>{
2333
- await INSERT.into ('Ticker') ...
2334
- },{ after: 111 /* ms */ })
2335
- ```
2336
- ```js
2337
- let n=0, handle = cds.spawn (async ()=>{
2338
- await INSERT.into ('Ticker') ...
2339
- if (++n>9) clearTimeout (handle)
2340
- },{ every: 111 /* ms */ })
2341
- ```
2342
- ```js
2343
- cds.spawn (async ()=>{
2344
- await INSERT.into ('Ticker') ...
2345
- },{ // inherits tenant
2346
- every: 111 /* ms */,
2347
- user: new cds.User.Privileged
2348
- })
2349
- ```
2350
- - Default server is CORS-enabled for all origins if not in production
2351
- - Default lock acquire timeout for `SELECT FOR UPDATE` via `cds.env.sql.lock_acquire_timeout`
2352
- - Optimized search: Support `groupby` for localized data (when the environment variable `cds.env.features.optimized_search` is set to `true` on SAP HANA)
2353
- - Out-of-the-box audit logging for deep structures without own association to data subject
2354
- + limited to one data subject per role per composition tree
2355
- - Support for reading streams via `GET /<Entity>(<ID>)/$value`
2356
- - Draft choreography: support of navigation with `SiblingEntity`
2357
- - Support for where exists with infix filters in `@restrict`
2358
- - Support annotation `@Capabilities.ExpandRestrictions.NonExpandableProperties`
2359
- - `@Core.ContentID` added to OData error responses if `content-id` header is specified
2360
- - New OData URL to CQN parser (`cds.env.features.odata_new_parser`):
2361
- + support of navigation to primitive properties using `$value`
2362
- + support of `not` operator with string functions (`contains`, `startswith`, `endswith`)
2363
- - Support for default values for virtual fields
2364
- - Payload for non-writable navigation targets removed from `req.data`
2365
- - `cds build` supports i18n message bundles for Java and Nodejs apps and a default CSN format option for Java
2366
- - View resolving considers renaming of foreign keys and `excluding` names when `columns` are explicitly provided in CQN
2367
- - Resilient acquire for SAP HANA via `cds.env.requires.db.connection_attempts = <number>` (alpha; hard max of 3 enforced)
2368
-
2369
- ### Changed
2370
-
2371
- - Messaging: Webhooks will always generate tokens
2372
- - Messaging: In multitenancy mode, messaging artifacts are only deployed to subscribers (unless the service option `deployForProvider` is set to `true`)
2373
- - Messaging: Incoming messages without corresponding handlers aren’t acknowledged
2374
- - If a service executes a query targeting a projection on one of its entities, the query is resolved along with projections to an entity known by the executing service. The result is post-processed to reflect the expected result of the incoming query. The reason is that no handlers of the executing service were executed as they didn’t know the query target.
2375
- + Deactivate during two-month grace period via compat feature flag `cds.env.features.resolve_views = false`
2376
- - Use `@sap/cds-compiler`'s `smartId` function to determine whether a reference needs to be quoted.
2377
- + Allows the use of non-word characters in column names, for example `entity Foo { ![bar/bz]: String; }`.
2378
- + Support for columns with spaces with feature flag `cds.env.features.spaced_columns`.
2379
- + Note: Restrictions in other layers (example: OData's simple identifier schema) still apply.
2380
- + Note: Expressions in references (example: `ref: ['foo as bar']`) currently works but were never intended to and will be removed in future versions.
2381
- - Clear draft data based on their draft UUID instead of via deep delete
2382
- - Support `@sap/cds-compiler`'s changes for DB constraints: managed and unmanaged compositions of one behave like associations. This means that only `$self`-managed composition of one gets `DELETE CASCADE` constraint. Since all other "2one" cases require extra `DELETE` handled by the runtime, that constraint is ignored.
2383
- - Value with regards to date and time functions aren’t converted to strings in the OData protocol adapter
2384
- - No placeholders for `LIMIT` to enable statement caching during pagination
2385
- - Arrayed elements stringified in DB layer
2386
- - Return values of handlers will have precedence over database reads
2387
- - Error of a failed request to a Remote Service contains now the response payload if available
2388
- - Configuring ad-hoc destinations via `credentials.url` is now allowed in `NODE_ENV=production`
2389
- - New OData URL to CQN parser (`cds.env.features.odata_new_parser`):
2390
- + CQN for `$select` and `$expand` columns
2391
-
2392
- ### Fixed
2393
-
2394
- - `SELECT.from (Foo, f => f.bar('*').where(...))` resulted in a runtime exception
2395
- - Preserved locales are now considered when accessing database tables
2396
- - Integrity checks for compositions by draft enabled entities
2397
- - Constant columns must not be quoted anymore, i.e. `{ val: "'myValue'", as: "myColumn"}` must be changed to `{ val: "myValue", as: "myColumn" }`
2398
- - Accidental `tx.run()` after prior `tx.commit/rollback()` lead to acquired connections not returned to pool. This is detected and disallowed now. In case that creates issues set `cds.env.features.cds_tx_protection = false` to restore the former behaviour.
2399
- - Structured keys are correctly resolved with pegjs-based parser
2400
- - Template processing for columns with spaces in their name
2401
- - Deep delete with recursions in composition tree (with limited recursion depth)
2402
- - Draft edit with recursions in composition tree (with limited recursion depth)
2403
- - `emit` for messaging services now also works in custom express middlewares
2404
- - `req.query` is a CQN object (previously array with one entry) in case of batch insert in REST adapter
2405
- - HasActiveEntity flag with expand
2406
- - `compile.to.serviceinfo` now honors default Java endpoint paths if none are configured in `application.yaml`
2407
- - `PATCH` request to a non-existent entity annotated with the `@PersonalData` annotation
2408
- - `req.diff()` while deep updating via composition
2409
- - Convert data type of elements in sub-entities (to one association) when forwarding responses to external services
2410
- - Update children of a composition of many (`INSERT > DELETE`) with `PATCH/PUT` having at the same time another association to one composition child respects foreign key constraints.
2411
- - Handling of virtual fields used in the `$filter` query option of navigation requests
2412
- - Copy texts in default language from active to draft table on draft edit
2413
- - Optimized search: Escape double quotation marks and backslashes (when the environment variable `cds.env.features.optimized_search` is set to `true`)
2414
- - Update for multiple rows
2415
- - Expand during draft union
2416
- - Validate content type for `$batch` requests
2417
- - Support for `SELECT` statements in `where` clauses when resolving views
2418
- - `INSERT.rows()` doesn’t silently fill in `INSERT.entries` anymore &rarr; use `INSERT.entries()` to do so instead.
2419
- - `UPDATE(Foo).with({foo:{'=':'bar'})` erroneously produced:
2420
- ```js
2421
- {UPDATE:{..., with:{foo:{ref:['bar']}}}} //> wrong
2422
- ```
2423
- instead of:
2424
- ```js
2425
- {UPDATE:{..., data:{foo:'bar'}}} // correct
2426
- ```
2427
- &rarr; to produce the ref, use one of:
2428
- ```js
2429
- UPDATE(Foo).with ({foo:{ref:['bar']}})
2430
- UPDATE(Foo).with `foo=bar`
2431
- ```
2432
- - `UPDATE.with` property stays undefined until actually filled with data
2433
- - Differentiate between require and initialize error of audit logging client
2434
- - The built-in model tree-shaking erroneously deleted explicitly modeled `.texts` entities
2435
- - Actions and functions with `Integer` response type in REST services
2436
- - Occasional drop of conditions in `WHERE` depending on the value when using structured types
2437
- - `PATCH` fixed for singletons and when having a keyless, for example, managed to-one navigation path
2438
- - Internal server error when forwarding a query to an external service whose target entity doesn’t contain keys
2439
- - Nested where exists in `@restrict` via navigation (CRUD-only; beta)
2440
- - Expand to one in draft union
2441
- - Patch to auto exposed entity through composition of aspect from SAP Fiori Elements
2442
- - Diff for delete in draft
2443
- - Streaming requests on views with joins no longer crash the application
2444
-
2445
- ### Removed
2446
-
2447
- - Direct usage of body-parser
2448
- - Queries constructed from `cds.ql` do not have the _internal_ property `cqn` anymore
2449
- - Inofficial variant `SELECT({'expand(foo)':['a','b']})` is not supported anymore
2450
- &rarr; use one of these official APIs for expands instead:
2451
- ```js
2452
- SELECT(x => { x.a, x.foo (f =>{ f.b, f.c }) })
2453
- SELECT(['a',{ref:['foo'], expand:['b','c']}])
2454
- ```
2455
- - Inofficial variant `SELECT.orderBy('foo','desc')` is not supported anymore
2456
- &rarr; use one of these official APIs instead:
2457
- ```js
2458
- SELECT.from(Foo).orderBy({foo:'desc'})
2459
- SELECT.from(Foo).orderBy('foo desc')
2460
- ```
2461
- - Inofficial variant `SELECT.orderBy('foo, bar desc')` is not supported anymore
2462
- &rarr; use one of these official APIs instead:
2463
- ```js
2464
- SELECT.from(Foo).orderBy({foo:1,bar:-1})
2465
- SELECT.from(Foo).orderBy('foo','bar desc')
2466
- SELECT.from(Foo).orderBy `foo, bar desc`
2467
- ```
2468
- - Inofficial variant `SELECT.where({ or: [{ foo: 'bar' }, { foo: 'baz' }] })` is not supported anymore
2469
- &rarr; use one of these official APIs instead:
2470
- ```js
2471
- SELECT.from(Foo).where({ foo: 'bar', or: { foo: 'baz' } })
2472
- SELECT.from(Foo).where `foo='bar' or foo='baz'`
2473
- ```
2474
- - Usage of SQL window functions during expand on SAP HANA
2475
- - Hidden symbol for where clause elements originating from `@restrict`
2476
- - Error masking gate keeper for `cds.env.log.levels.cli`
2477
-
2478
- ## Version 5.4.6 - 2021-09-18
2479
-
2480
- ### Added
2481
-
2482
- - Support for nested where exists in `@restrict` (CRUD-only; beta)
2483
-
2484
- ### Fixed
2485
-
2486
- - Inverse transition mapping calculation
2487
- - Skip empty structures during deep update
2488
-
2489
- ## Version 5.4.5 - 2021-09-15
2490
-
2491
- ### Fixed
2492
-
2493
- - Processing of null elements during deep update
2494
- - Performance issue during template processing
2495
-
2496
- ## Version 5.4.4 - 2021-09-09
2497
-
2498
- ### Fixed
2499
-
2500
- - For drafts, the query parameter `$top=0` in combination with `$count=true` now returns the correct `@odata.count` value
2501
- - Deep delete with composition of one with structured key in target
2502
- - Implicit delete of child with structured key
2503
- - Update of deeply nested entity with structured key
2504
- - Order by join column during draft union
2505
- - Skip calculated properties while following projections
2506
- - The `with parameters` clause is now correctly handled in sub-selects if the locale parameter exceeds three characters
2507
- - Statement already finalized error on SQLite
2508
-
2509
- ## Version 5.4.3 - 2021-08-16
2510
-
2511
- ### Fixed
2512
-
2513
- - Skip calculated properties while following projections
2514
- - Unrestricted subclauses in `@restrict.where`
2515
- - Safe access to `cds.env.log.levels.cli`
2516
-
2517
- ## Version 5.4.2 - 2021-08-11
2518
-
2519
- ### Fixed
2520
-
2521
- - Where condition in draft union in case of multiple keys
2522
- - Handling of nulled properties in Service Consumption
2523
- - Requests to Remote Services returning `text/html` result in an error
2524
- - View resolving is more robust for path expressions
2525
- - Skip foreign properties (e.g., mixins via associations) while following projections
2526
- - UPDATE entity with composition to aspect with structure type property
2527
-
2528
- ## Version 5.4.1 - 2021-08-03
2529
-
2530
- ### Fixed
2531
-
2532
- - Erroneously added Brazilian Portuguese (`pt_BR`) removed from the list of normalized locales
2533
-
2534
- ## Version 5.4.0 - 2021-08-02
2535
-
2536
- ### Added
2537
-
2538
- - Messaging: Support for format `cloudevents`
2539
- - Messaging: Support for `@topic`
2540
- - Messaging: Support for `subscribePrefix` and `publishPrefix`
2541
- - Support for `ReadByKeyRestrictions` annotations
2542
- - Support for OData `omit-values` preference in `Prefer` HTTP header
2543
- - Object variant of service methods
2544
- - Brazilian Portuguese (`pt_BR`) is now on the list of [normalized locales](https://cap.cloud.sap/docs/guides/i18n#normalized-locales)
2545
- - Support for actions and functions on Remote Service
2546
-
2547
- ### Changed
2548
-
2549
- - In multitenant `enterprise-messaging`: If a tenant subscribes, the messaging artifact generation is awaited. In your provisioning service configuration, make sure to set `onSubscriptionAsync` to `true` and `callbackTimeoutMillis` to more than 10 minutes.
2550
- - In `enterprise-messaging`: Messages are sent via HTTP
2551
- - Computed values are preserved during draft activate
2552
- - Messaging: No more topic manipulation per default
2553
- - For consistency reasons `cds build` now determines the default model path using cds resolve
2554
- - Match XSUAA's user attribute value `$UNRESTRICTED` case insensitive
2555
- - CDS build now uses new CDS logging facade to allow for consistent logging behaviour across the different CDS modules
2556
-
2557
- ### Fixed
2558
-
2559
- - Disable persistency check for requests without a target
2560
- - Expand at draft edit
2561
- - Remove restriction for `$search` queries not accepting brackets
2562
- - Select query with infix filter in custom handler
2563
- - Order by on same named properties of different associations in draft
2564
- - Allow to call bound actions and functions of read-only entities
2565
- - Writing draft-enabled entities with composition of aspects (a.k.a. managed compositions)
2566
- - Expand to autoexposed association/composition in draft case
2567
- - `cds.parse.xpr()` always returns an array
2568
- - Allow boolean options in `cds build` CLI
2569
- - Integrity check in case of bulk query execution
2570
-
2571
- ### Removed
2572
-
2573
- - Messaging: The topic prefix `topic:` is deprecated
2574
- - Messaging: No default headers for format not equal to `cloudevents`
2575
-
2576
- ## Version 5.3.3 - 2021-07-28
2577
-
2578
- ### Fixed
2579
-
2580
- - Validation of arrayed parameters of actions and functions
2581
- - Skip not-to-be-audited entities in composition tree
2582
- - In draft, `<entity>.texts` can be used without explicit exposure
2583
-
2584
- ## Version 5.3.2 - 2021-07-16
2585
-
2586
- ### Added
2587
-
2588
- - `enterprise-messaging`: Experimental support to send messages via HTTP (`emitPerHTTP: true`)
2589
-
2590
- ### Changed
2591
-
2592
- - Aligned Node.js and Java auditlog APIs
2593
- - `enterprise-messaging`: No topic manipulation for outbound events beginning with a different namespace
2594
-
2595
- ### Fixed
2596
-
2597
- - Call `init()` and register custom handlers for every new `cds.ApplicationService` created in extensibility scenarios
2598
- - Structured keys for deep operations in OData flavor `x4`
2599
- - Wrong user in messaging requests coming from webhooks
2600
- - Improvements in log formatter for Kibana:
2601
- + Remove redundant metadata information
2602
- + Add information from `req.headers`
2603
- + Treat error-like objects like errors
2604
- + Custom fields (alpha)
2605
- - Minor fix for *optimized search* on SAP HANA
2606
-
2607
- ## Version 5.3.1 - 2021-07-12
2608
-
2609
- ### Changed
2610
-
2611
- - Task `@sap/cds-runtime/lib/messaging/deploy.js` moved to `@sap/cds/tasks/enterprise-messaging-deploy.js` after module merge
2612
- - Parse OData lambda expression on collection of scalars with equals operator (i.e., `.../any(d:d = "<val>")`) to CQN with `contains` (pegjs-based parser only)
2613
-
2614
- ### Fixed
2615
-
2616
- - Improved error message in case custom `server.js` doesn't export a function
2617
- - Kibana formatter: `stacktrace` as array of strings
2618
- - Bootstrapping for feature toggles
2619
- - Deep operations for certain composition constellations
2620
- - Aliasing on SQL layer for OData `ne` operator
2621
- - Fixed scope issues in manual deployment for messaging
2622
- - Projections with infix filters and cardinality changes are safely ignored during `CREATE`/`UPDATE`
2623
- - Resolving of views if underlying projection has explicit aliases
2624
-
2625
- ## Version 5.3.0 - 2021-07-07
2626
-
2627
- ### Added
2628
-
2629
- - `cds serve` and `cds deploy` now also load `.ts` Typescript files if started with [`ts-node`](https://www.npmjs.com/package/ts-node)
2630
- - Log formatter for Kibana (beta) via `cds.env.features.kibana_formatter`
2631
- - First version of the `AuditLogService` (beta)
2632
- + Supported events: `dataAccessLog`, `dataModificationLog`, `configChangeLog`, and `securityLog`
2633
- + Usage: `const AuditLogService = await cds.connect.to('audit-log'); await AuditLogService.emit/send('<event>', <data>)`
2634
- + Out-of-the-box audit logging for modification of personal data and access to sensitive personal data via `cds.env.features.audit_personal_data`
2635
- - Support for deep updates with compositions of one in `UPDATE(...).with(...)`
2636
- - Support for logical events in `composite-messaging`
2637
- - Initial support for generating OData V2 queries
2638
- - Preserve `DraftAdministrativeData_DraftUUID` if OData v2 client (indicated by `@sap/cds-odata-v2-adapter-proxy`)
2639
- - Use placeholder values for numbers with `cds.env.features.parameterized_numbers` (alpha)
2640
- - Support for argument-less SQL functions (e.g., `current_date`)
2641
- - Performance optimization: Resolve localized texts for `$search` queries at runtime (alternative to localized views resolution) to avoid the performance overhead of the SQL `coalesce` function in filter operations. To enable this *experimental feature* for SAP HANA, you can set the `cds.env.features.optimized_search` environment variable to `true`
2642
- - Performance optimization: Optimize `$search` queries using the `CONTAINS` predicate instead of the `LIKE` predicate in the `WHERE` clause of a `SELECT` statement. To enable this *experimental feature* for SAP HANA, you can set the `cds.env.features.optimized_search` environment variable to `true`
2643
- - OData lambda expressions in `$filter`:
2644
- + Basic support of structured types (`cds.env.odata.flavor = x4`) on SAP HANA
2645
- + Support of navigation paths on SAP HANA, for example, `GET /Books?$filter=author/books/all(d:d/stock gt 10)`
2646
-
2647
- ### Changed
2648
-
2649
- - Custom build tasks are no longer restricted to `@SAP` namespace.
2650
- - CDS build tasks of type `fiori` are no longer copying files located in the UI module folder into the deployment staging folder.
2651
- - Leaner error messages for unsuccessful remote service calls
2652
- - Incoming messages now contain a privileged user
2653
- - `SELECT.where(...)` generates CQN with list of values for `in` operator
2654
- - Always use flag `u` during input validation via `@assert.format`
2655
- - Intermediate CQN format for lambda expressions with preceding navigation path
2656
- - Better error messages for draft enabled entities
2657
-
2658
- ### Fixed
2659
-
2660
- - Projecting data works also for projections where one field maps to multiple entries
2661
- - `SELECT` queries without user-specified columns only modify draft columns if the entity is draft-enabled.
2662
- - Generated `index.html` erroneously showed entries for `contained` entities from managed compositions.
2663
- - Use OData simple identifier format for links to entity sets in generated `index.html`.
2664
- - `cds build` logged duplicate compilation errors for the identical `.cds` file, but with different relative path names.
2665
- - `cds serve` no longer tries to redirect Fiori URLs starting with `$` to service URLs.
2666
- - `cds build` now supports `HANA Table data properties files` in SaaS applications. These files haven’t been copied into the sidecar folder.
2667
- - `cds deploy --dry` generates DROP/CREATE DDL statements with an order that also H2 can handle, i.e. with dependant views dropped before basic views.
2668
- - `cds build` now correctly handles symbolic links for nodejs projects on Windows.
2669
- - `cds build` now correctly filters CDS source files when building SaaS applications.
2670
- - Deploy endpoint for messaging artifacts includes the needed roles
2671
- - Detection of mocked services and forced resolving of views
2672
- - `POST/PATCH/PUT` requests on `Composition of many` with association as key and custom `on` conditions
2673
- - `$expand` on entities with `.` in name
2674
- - Filter on external service when using `ne null`
2675
- - Primitive property access of Singletons defined without keys via URL like `/Singleton/name`
2676
- - Expand and navigation in draft-enabled entity with composition of aspects
2677
- - `@Core.ContentDisposition.Filename` instead of `@Core.ContentDisposition`
2678
- - Select query with `$count` with combination with `$search`
2679
- - Parsing of `Timestamp`, `DateTime` and `Date` values in OData request when using beta URL to CQN parser (`cds.env.features.odata_new_parser`)
2680
- - Reset temporal session contexts
2681
- - Caching of runtime aspects
2682
- - Handling of foreign keys as well as an input validation when using nested associations as keys
2683
- - Transaction handling in case of multiple changesets
2684
- - Hana procedure call with output parameter
2685
- - Skip foreign key propagation if target is annotated with `@cds.persistence.skip`
2686
- - Values misidentified as operators in `$search`
2687
- - Ensure UTC valus are written to DB
2688
- - Etag handling in case of action with `$select`
2689
- - Fix draft related issues in odata2cqn
2690
- - Where clause in `@restrict` gets duplicated if `$search` query option is used
2691
-
2692
- ## Version 5.2.0 - 2021-05-31
2693
-
2694
- ### Fixed
2695
-
2696
- - Virtual fields are not filtered out before application service handlers
2697
- - Clarification: the minimum required Node.js version is 12.18. Versions < 12.18 might not work.
2698
- - `cds build` supports validation of `extension-allowlist` which is replacing `entity-whitelist` or `service-whitelist` with cds-mtx 2.0. Warnings are no longer returned if neither entity-whitelist nor service-whitelist is defined.
2699
- - `cds compile -2 sql/edmx` erroneously wrote excessive compiler output to stderr
2700
- - Resolve the correct `enterprise-messaging-shared` credentials from VCAP_SERVICES by default
2701
- - `cds compile --to sql` now completes the last SQL statement with a proper semicolon
2702
-
2703
- ## Version 5.1.5 - 2021-05-21
2704
-
2705
- ### Added
2706
-
2707
- - `cds build` adds `engines.node` version to `package.json` if not present, in order to match the minimum required node version of CDS.
2708
- - Generate an invocation context identifier (`cds.context.id`) if none can be derived
2709
-
2710
- ### Changed
2711
-
2712
- - Better support for UI tools to get metadata for projects with both a Node.js and Java server
2713
-
2714
- ### Fixed
2715
-
2716
- - Match locales in all upper-case (for example `ZH-CN` instead of `zh-CN`)
2717
- - Key elements got lost in `cds.linked` when using type refs referring to other key elements
2718
- - Tree shaking erroneously removed types `Foo` when only referred to by type refs like `bar : Foo:bar`
2719
- - Fixed an error in transaction handling, that lead to db connections not released in rare cases
2720
- - SQL names option gets properly propagated
2721
- - No longer erroneously exclude entities explicitly marked with `cds.persistence:{table, skip:false}`, as in [cap/samples/suppliers](https://github.com/SAP-samples/cloud-cap-samples/blob/6b08826af51651f6b31fce8454fbadd23c634b85/suppliers/srv/mashup.cds#L46)
2722
-
2723
- ## Version 5.1.4 - 2021-05-12
2724
-
2725
- ### Fixed
2726
-
2727
- - Error when using complex type references, as in:
2728
- ```swift
2729
- entity Foo { bar: Tic:tac.toe; }
2730
- entity Tic { tac: Composition of { toe:String } }
2731
- ```
2732
-
2733
- ## Version 5.1.3 - 2021-05-12
2734
-
2735
- ### Fixed
2736
-
2737
- - `cds` does not check for the min. Node.js on BAS, for now
2738
-
2739
- ## Version 5.1.2 - 2021-05-12
2740
-
2741
- ### Fixed
2742
-
2743
- - `cds compile --for odata` now honors the OData version again
2744
- - `cds compile --for odata` now honors the SQL naming mode (`sql.names`) again
2745
- - `cds serve` does not run in an infinite bootstrap loop if `cds.server()` is called in `server.js`
2746
-
2747
- ## Version 5.1.1 - 2021-05-07
2748
-
2749
- ### Fixed
2750
-
2751
- - `cds build` is now always adding `.hdbview, .hdbtable, .hdbconstraint or .hdbindex` plugin mappings to `.hdiconfig` to avoid that deployment is failing in case such files exist in an already deployed container, but are no longer generated.
2752
- - `cds compile --dest <dir>` no longer crashes creating the destination folder
2753
-
2754
- ## Version 5.1.0 - 2021-05-05
2755
-
2756
- ### Added
2757
-
2758
- - Custom error handler via `srv.on('error', function (err, req) { ... })` (beta)
2759
- + Synchronous modification of passed error only
2760
- - `cds.log.format()` for custom log formatting
2761
-
2762
- ### Fixed
2763
-
2764
- - `cds build` now correctly handles `message.properties` files used for Nodejs runtime messages if these files have been defined in an i18n content folder located at project root.
2765
- - Nodejs custom handlers are now correctly resolved if a dedicated destination folder has been configured for the build task.
2766
- - Now, the `.csv` file reader correctly closes open file descriptors to avoid memory leaks during `cds build`.
2767
-
2768
- ### Changed
2769
-
2770
- - Clean up obsolete compiler option `snapi`.
2771
- - `cds build` is no longer validating Nodejs custom service handlers that have been registered using service `@impl` annotation.
2772
-
2773
- ## Version 4.6.6 - 2021-05-05
2774
-
2775
- ### Fixed
2776
-
2777
- - Now, the `.csv` file reader correctly closes open file descriptors to avoid memory leaks during `cds build`.
2778
- - Fixed i18n handling causing `cds build` to fail with error message `bundle is not iterable`.
2779
- - Nodejs custom handlers are now correctly resolved if a dedicated destination folder has been configured for the build task.
2780
-
2781
- ## Version 5.0.7 - 2021-04-21
2782
-
2783
- ### Fixed
2784
-
2785
- - Internal test stabilizations
2786
-
2787
- ## Version 5.0.6 - 2021-04-16
2788
-
2789
- ### Fixed
2790
-
2791
- - `cds build` no longer fails with `TypeError: x.startsWith is not a function` in some situations
2792
-
2793
- ## Version 5.0.5 - 2021-04-15
2794
-
2795
- ### Changed
2796
-
2797
- - Internal errors are no longer decorated with `Please report this`. People interpreted the text as to only include the stack trace in error reports and to omit other valuable context information.
2798
-
2799
- ### Fixed
2800
-
2801
- - `cds build` now correctly creates the deployment layout for multitenant applications (sdc folder contents) that have dedicated folder paths configured for db, srv, and app modules.
2802
- - `cds deploy --to sqlite` now ignores a `_texts.csv` file again if there is a language-specific file like `_texts_en.csv` present
2803
- - `cds env` no longer fails to parse `.env` files with JSON values containing `=` characters
2804
-
2805
- ## Version 5.0.4 - 2021-04-07
2806
-
2807
- ### Fixed
2808
-
2809
- - `cds build` no longer fails with a `task.apply is not a function` error when used in an npm script.
2810
-
2811
- ## Version 5.0.3 - 2021-04-06
2812
-
2813
- ### Fixed
2814
-
2815
- - `cds.compile` got thoroughly cleaned up and enhanced as the single API to compile models
2816
- - `cds.compile.to.cdl` was missing in 5.0.2
2817
- - `cds build` no longer uses reflected CSN which caused odata and EDMX transformation to fail.
2818
- As a consequence language specific EDMX files were missing.
2819
-
2820
- ### Removed
2821
-
2822
- The following undocumented, internal functions have been removed.
2823
- In case you spotted and used them, please replace as given below.
2824
-
2825
- - `cds.compile.cdl` &rarr; use `cds.compile` instead
2826
- - `cds.compile.to.parsed.csn` &rarr; use `cds.parse` instead
2827
- - `cds.compile.to.xtended.csn` &rarr; use `cds.compile` instead
2828
- - `cds.compile.to.inferred.csn` &rarr; use `cds.compile` instead
2829
- - `cds.compile.to.hdi` &rarr; use `cds.compile.to.hdbtable` instead
2830
- - `cds.compile.to.hana` &rarr; use `cds.compile.to.hdbcds` instead
2831
- - `cds.compile.to.xsuaa` &rarr; still available in CLI thru `cds compile -2 xsuaa`
2832
- - `cds.compile.to.serviceinfo` &rarr; still available in CLI thru `cds compile -2 serviceinfo`
2833
- - `cds.compile.to['edmx-v2']` &rarr; still available in CLI thru `cds compile -2 edmx-v2`
2834
- - `cds.compile.to['edmx-v4']` &rarr; still available in CLI thru `cds compile -2 edmx-v4`
2835
- - `cds.compile.to['edmx-w4']` &rarr; still available in CLI thru `cds compile -2 edmx-w4`
2836
- - `cds.compile.to['edmx-x4']` &rarr; still available in CLI thru `cds compile -2 edmx-x4`
2837
-
2838
-
2839
- ## Version 5.0.2 - 2021-03-30
2840
-
2841
- ### Added
2842
-
2843
- - Ensure correlation id and set intermediate `cds.context` in default `server.js`
2844
-
2845
- ### Fixed
2846
-
2847
- - `cds build` no longer aborts for CAP Java SDK based projects with `compiler version 2 not supported` message.
2848
-
2849
- ## Version 5.0.1 - 2021-03-25
2850
-
2851
- ### Added
2852
-
2853
- - `cds.load.properties` and `cds.parse.properties` to load and parse content in .properties format
2854
- - `cds.load.csv` and `cds.parse.csv` to load and parse csv content
2855
- - `CDL`, `CQL`, and `CXL` as new global methods for tagged template strings generating [CSN], [CQN], or [CXN] objects
2856
- - Fluent API classes provided through `cds.ql` also support tagged template strings now in these methods: `SELECT`, `SELECT.from`, `SELECT.where`, `UPDATE`, `UPDATE.with`, `UPDATE.where`, `INSERT.into`, `DELETE.from`, `DELETE.where`
2857
-
2858
- Example:
2859
- ```js
2860
- let Authors = SELECT `ID` .from `Authors` .where `name like ${'%Brontë%'}`
2861
- let Books = SELECT `ID,title` .from `Books` .where `author_ID in ${Authors}`
2862
- await UPDATE`Books`.with`x = x-${amount}`.where`ID=${ID}`
2863
- ```
2864
-
2865
- ### Changed
2866
-
2867
- - Minimum required Node.js version is now 12. Support for Node.js 10 is dropped.
2868
- - `req.timestamp` is a Date object now; was a UNIX epoch integer before, i.e., Date.now()
2869
-
2870
- ### Fixed
2871
-
2872
- - Fixed race conditions in `cds.serve` leading to broken services
2873
- - Fixed typos in API type definitions
2874
- - Fixed `cds.reflect.forall` for CSN extensions
2875
- - Fixed orphaned `_texts` proxies, causing init from csv to fail with "no such table" errors
2876
-
2877
- ## Version 5.0.0 - 2021-03-19
2878
-
2879
- ### Added
2880
-
2881
- - MTX APIs are now automatically served when `cds.requires.multitenancy` exists. This renders an application-level server start script for multitenancy unnecessary.
2882
- - Auto-connect to a live reload server started by `cds watch`
2883
- - `cds.parse` now offers tagged template strings. E.g. const {CDL,CQL,CXL} = cds.parse; CQL`SELECT from Books where stock > 111`.
2884
- - `cds.log` now supports config options for Loggers and log levels via `cds.env.log`
2885
- - `cds.entity.draft` as a stable way to read from draft data
2886
- - `cds.linked` now correctly links, events, action params and results, which were not linked before
2887
- - `cds.env.features.skip_unused = 'all'` removes all definitions from csn which are not reachable by defined services. Especially when using comprehensive reuse models, like ODM, this significantly reduces both, memory consumption as well as excess tables and views in databases
2888
-
2889
- ### Changed
2890
-
2891
- - Upgraded major version of dependency `@sap/cds-compiler`
2892
- - `cds.requires.db.multiTenant` is deprecated. Multitenancy can now be enabled by adding a `cds.requires.multitenancy` configuration.
2893
- - `cds deploy --to hana` no longer adds a driver for SAP HANA to `package.json`. This can be done with `cds add hana`.
2894
- - `cds deploy --to hana` no longer adds configuration for SAP HANA to `package.json`. This can be done with `cds add hana`.
2895
- - `cds deploy --to hana` drops support for the classic CAP Java runtime, i.e. longer writes credentials for SAP HANA to `connection.properties`.
2896
- - Fiori preview now [loads and shows data initially](https://sapui5.hana.ondemand.com/1.84.0/#/topic/1cf5c7f5b81c4cb3ba98fd14314d4504) in its list page
2897
- - I18n template strings now are replaced in EDMX documents such that they retain their surrounding string. For example, the `"{i18n>key1} - {i18n>key2}"` template results in `"value1 - value2"`, while previously the first match replaced the entire string, leading to `"value1"`. This is helpful for the [`Template` strings of `UI.ConnectedFields`](https://github.com/SAP/odata-vocabularies/blob/ac9fe832df9b8c8d35517c637dba7c0ac2753b0f/vocabularies/UI.xml#L168).
2898
- - CDS drops compiler v2 support for classic CAP Java runtime projects. `cds build` returns an error if compiler version 2 is used. For further details regarding migration to CAP Java SDK runtime see https://cap.cloud.sap/docs/java/migration.
2899
-
2900
- ### Fixed
2901
-
2902
- - `cds.connect.to` no longer returns `undefined` in concurrent cases where `connect` is called again while a datasource is about to be connected.
2903
- - `cds.log` formerly wrote log and debug output to stderr, now writes that to stdout
2904
- - `cds.server` now accepts port `0` as a number
2905
- - Race conditions in `cds.serve` and `cds.connect` lead to wrong Service instances to lost handler registrations
2906
-
2907
- ### Removed
2908
-
2909
- - Compiler non-snapi support &rarr; see `cds.env.features.snapi` option
2910
- - In recent releases we added methods `cds.compile.to.hdbtabledata` and `cds.compile.to.hdbmigration`, intentionally undocumented, as they were meant to be private. Nobody should ever have used these methods, hence nobody should be affected by their removal.
2911
-
2912
- ## Version 4.6.5 - 2021-03-12
2913
-
2914
- ### Fixed
2915
-
2916
- - `cds build` now correctly parses `.hdbtablemigration` files on Windows
2917
- - `compile --to serviceinfo` no longer crashes for Spring configuration in multi-root `yaml` files
2918
-
2919
- ## Version 4.6.4 - 2021-03-01
2920
-
2921
- ### Fixed
2922
-
2923
- - Fix call to `to.hdi.migration` compiler API
2924
- - `cds build` for SAP HANA now correctly passes `sql_mapping` options to new hdimigration compiler API.
2925
-
2926
- ## Version 4.6.3 - 2021-02-26
2927
-
2928
- ### Added
2929
-
2930
- - [beta] `cds build` for SAP HANA now provides schema evolution support for multitenant application extensions.
2931
-
2932
- ### Fixed
2933
-
2934
- - `cds compile --to serviceinfo` returns better results for Java projects
2935
- - `cds.connect.to('srv-missing')` called twice with `srv-missing` not configured, would have failed with an error on the first call, but got stuck in the Promise chain for all subsequent calls.
2936
- - `.after` handlers are called with result based on request, e.g., array for collection and object for entity, instead of always array
2937
- - Deactivate during two month grace period via compat feature flag `cds.env.features.arrayed_after = true`
2938
-
2939
- ## Version 4.6.1 - 2021-02-11
2940
-
2941
- ### Added
2942
-
2943
- - [beta] `cds build` for SAP HANA now supports the generation of `hdbmigrationtable` design-time artifacts for big volume tables allowing for schema evolution capabilities. Model entities annotated with `@cds.persistence.journal` will be deployed as `hdbmigrationtable` artifacts instead of `hdbtable`.
2944
-
2945
- ## Version 4.5.3 - 2021-02-19
2946
-
2947
- ### Fixed
2948
-
2949
- - `cds deploy` and `build` now refer to the latest HDI deployer which supports Node.js 14
2950
-
2951
- ## Version 4.5.2 - 2021-02-17
2952
-
2953
- ### Fixed
2954
-
2955
- - `cds serve --with-mocks` now also works in `production` environment if `cds.features.mocked_bindings` is true. Previously, mocks were always disabled in `production`.
2956
- - `cds serve` now only fires the `listening` event once
2957
- - `cds build` redacts cds configuration data in log messages
2958
-
2959
- ## Version 4.5.1 - 2021-02-01
2960
-
2961
- ### Fixed
2962
-
2963
- - Update `@sap/cds-runtime` dependency
2964
-
2965
- ## Version 4.5.0 - 2021-02-01
2966
-
2967
- ### Added
2968
-
2969
- - `cds.server` provides an option to switch off automatically generated `index.html` served at `/`:
2970
- Do that in a custom `server.js`:
2971
- ```js
2972
- const cds = require('@sap/cds')
2973
- // ...
2974
- module.exports = (o) => cds.server({ ...o, index:false })
2975
- ```
2976
- - The default `index.html` now honors the system's setting for dark mode.
2977
- - Former package `@sap/cds-reflect` is now embedded in `@sap/cds`
2978
-
2979
- ### Changed
2980
-
2981
- - Fiori preview is now disabled if `NODE_ENV` is `production`, to avoid any runtime overhead there. You can enable it with configuration `cds.features.fiori_preview: true`.
2982
-
2983
- ### Fixed
2984
-
2985
- - `cds build` now correctly supports multitenant applications defining multiple database modules, e.g. one database for tenant related data and one for shared data.
2986
- - `cds deploy --to hana` does no longer fail with an invalid service name error if '.' is used in the MTA ID.
2987
-
2988
- ## Version 4.4.10 - 2021-01-18
2989
-
2990
- ### Changed
2991
-
2992
- - `cds build` for SAP HANA now only filters csv files if it's needed, e.g. if they contain comment lines.
2993
-
2994
- ## Version 4.4.9 - 2021-01-12
2995
-
2996
- ### Fixed
2997
- - `cds build` for SAP HANA no longer fails sporadically with `ENOENT` when writing CSV files.
2998
-
2999
-
3000
- ## Version 4.4.8 - 2021-01-07
3001
-
3002
- ### Fixed
3003
-
3004
- - Add missing setter for `user.locale`
3005
-
3006
- ## Version 4.4.7 - 2020-12-18
3007
-
3008
- ### Fixed
3009
-
3010
- - `cds build` for Java now also creates a default edmx file (the one w/o language suffix) if the `cds.i18n.languages` array is configured with a set of languages. Runtime systems expect this file.
3011
- - `cds build` now skips empty lines in CSV files when preparing SAP HANA deployment. This doesn’t happens if the build target folder is `.`, because there CSV files are sources that are not touched.
3012
- - `cds build` for SAP HANA now writes CSV files more reliably, avoiding sporadic `ENOENT` errors.
3013
-
3014
- ## Version 4.4.6 - 2020-12-08
3015
-
3016
- ### Fixed
3017
-
3018
- - Compat `.emit()` for synchronous events with object as first parameter
3019
-
3020
- ## Version 4.4.5 - 2020-12-07
3021
-
3022
- ### Fixed
3023
-
3024
- - Revert of _cds serve --at / now can overwrite the default /index.html route_, which caused problems in some applications
3025
-
3026
- ## Version 4.4.4 - 2020-12-04
3027
-
3028
- ### Added
3029
-
3030
- - `cds.User.default` allows to override the default user, e.g. to be `cds.User.Privileged` in tests. By default this is `cds.User.Anonymous`.
3031
-
3032
- ### Changed
3033
-
3034
- - `cds compile` and `build` now do a faster localization of edmx files. If there are no text keys inside these files, the content is no longer duplicated in memory.
3035
- - `cds serve --at /` now can overwrite the default `/index.html` route
3036
-
3037
-
3038
- ## Version 4.4.3 - 2020-12-03
3039
-
3040
- ### Fixed
3041
-
3042
- - `srv.on` can now be used for async events w/o having to call `next` in each handler
3043
- - `srv.emit` constructs instances of `cds.Event` from given arguments, as intended
3044
- - `srv.send` constructs instances of `cds.Request` from given arguments
3045
- - Revert of: `cds build` filters `i18n` files for nodejs staging builds
3046
-
3047
- ## Version 4.4.2 - 2020-12-01
3048
-
3049
- ### Added
3050
-
3051
- - `cds.context` always allows access to the current request context when running in Node v12.18 and higher. It uses Node.js' `async_hooks` API for so-called continuation-local storage, and supercedes the need for `srv.tx(req)` in custom handlers.
3052
- - Custom functions/actions can now be implemented with plain JavaScript methods in subclasses of `cds.Service`
3053
-
3054
- ### Changed
3055
-
3056
- - `cds.unfold` was long-term deprecated, and removed now &rarr; use `cds.compile`
3057
- - `cds.config` was long-term deprecated, and removed now &rarr; use `cds.env`
3058
- - `cds.session` was long-term deprecated, and removed now &rarr; use `cds.db`
3059
-
3060
- ## Version 4.4.1 - 2020-11-27
3061
-
3062
- ### Fixed
3063
-
3064
- - When two services `Foo` and `FooBar` were defined, with one services's name being a substring of the other service's name,
3065
- it may have happened that the same EDMX, i.e. that of `FooBar`, was erroneously returned for both.
3066
- - On Windows, the index page now shows normalized links to embedded html pages, i.e. `foo/bar.html` instead of `foo\bar.html`.
3067
- - `cds build` now consistently uses build target folder `'.'` as default for Java projects - also if custom build tasks have been defined.
3068
- - Requests that contain `*` as `Accept-Language` header value do no longer fail.
3069
-
3070
- ## Version 4.4.0 - 2020-11-18
3071
-
3072
- ### Changed
3073
-
3074
- - Propagate correlation id header to subrequests
3075
-
3076
- ### Fixed
3077
-
3078
- - `cds.debug` now reacts on the `DEBUG` environment variable set in a `.env` file
3079
- - `cds build` filters `i18n` files for nodejs staging builds
3080
- - Language headers with values `en-US-x-[saptrc, sappsd]` are now mapped to user locale `en-US-[saptrc, sappsd]`.
3081
- - Messages are kept in their respective request (i.e., not propagated to the request's context, if exists)
3082
- - Log requests in atomicity groups
3083
- - `cds build` now creates correct custom handler path for nodejs projects in WebIDE fullstack.
3084
-
3085
- ## Version 4.3.2 - 2020-12-18
3086
-
3087
- ### Fixed
3088
-
3089
- - use `@sap/cds-runtime~2.6`
3090
-
3091
- ## Version 4.3.1 - 2020-11-20
3092
-
3093
- ### Fixed
3094
-
3095
- - `cds build` now creates correct custom handler path for nodejs projects in WebIDE fullstack.
3096
-
3097
- ## Version 4.3.0 - 2020-11-03
3098
-
3099
- ### Added
3100
-
3101
- - Helper function `cds.utils.uuid` to generate a UUID
3102
- - Support `SELECT[...].limit(0, ...)`
3103
- - `hdbtabledata` generation can be disabled using `cds build` task option `skipHdbtabledataGeneration`.
3104
-
3105
- ### Changed
3106
-
3107
- - Optimized `cds build` performance when creating OData EDMX output.
3108
-
3109
- ### Fixed
3110
-
3111
- - `cds build` now classifies the severity of compile messages the same way as the low-level compiler. As a consequence, messages with severity _warning_ might now be classified as _error_.
3112
- - Now, cds CLI logs errors based on _log-level_ setting.
3113
- - `cds compile --to sql` no longer creates SQLite-specific views if in `hana` SQL dialect
3114
- - The `node-cf` build task of `cds build` now also filters `./` file dependencies from package.json in the build output.
3115
-
3116
-
3117
- # Version 4.2.8 - 2020-10-27
3118
-
3119
- ### Fixed
3120
-
3121
- - `cds compile --to edmx --dest` creates files with `.xml` ending again.
3122
-
3123
-
3124
- # Version 4.2.7 - 2020-10-26
3125
-
3126
- ### Fixed
3127
-
3128
- - SAP Fiori Elements preview finds the `express` package again in the case where no `express` is installed in the application's `node_modules`.
3129
-
3130
-
3131
- # Version 4.2.6 - 2020-10-26
3132
-
3133
- ### Fixed
3134
-
3135
- - `cds run` finds the `express` package again in the case where no `express` is installed in the application's `node_modules`.
3136
-
3137
-
3138
- # Version 4.2.5 - 2020-10-23
3139
-
3140
- ### Fixed
3141
-
3142
- - `cds compile --to edmx-v2` and `edmx-v4` now again write to the folder given with `--dest`.
3143
-
3144
-
3145
- # Version 4.2.4 - 2020-10-16
3146
-
3147
- ### Fixed
3148
-
3149
- - `cds compile --to edmx-v2/4` no longer crashes
3150
- - `cds watch` no longer shows an error in absence of model files
3151
- - `cds build` no longer fails with an error about module './old/compile'
3152
- - Stack trace of some errors have been improved
3153
- - The `.hdiconfig` file created by `cds build` now includes SAP HANA artifact types from undeploy.json
3154
-
3155
- # Version 4.2.3 - 2020-10-12
3156
-
3157
- ### Fixed
3158
-
3159
- - Leading `#` comments in CSV files sporadically caused `cds build` to fail on Windows with error `EPERM: operation not permitted`.
3160
- - Method `req.user.is()` returns boolean
3161
-
3162
- # Version 4.2.2 - 2020-10-07
3163
-
3164
- ## Added
3165
-
3166
- - `cds.env.odata.containment` to use OData v4 Containment NavigationProperties feature
3167
- - `cds.env.odata.structs` to preserve struct elements as ComplexTypes in OData EDMX instead of flattening
3168
- - `cds.env.odata.refs` which uses NavigationProperties in OData EDMX instead of adding foreign keys
3169
- - `cds.env.odata.proxies` to add proxy EntityTypes for external Association targets
3170
- - `cds.env.odata.flavors` which contain presets for the afore-mentioned flags
3171
- - `cds.env.odata.flavor` to choose from the afore-mentioned presets
3172
- - `cds.load` option `plain` replacing former option `clean` (which still is silently supported for compatibility).
3173
- - `cds.get` now supports option `flavor` with values: `files` | `sources` | `parsed` | `resolved` | `compiled`.
3174
- - `sap.common.Currencies`, `Countries`, and `Languages` now have their `code` element annotated with `@Common.Text` pointing to the `name`. In SAP Fiori's value list with fixed values, this will show the `name` rather than the code itself. As before, this only has an effect if `@Common.TextArrangement` is set to `#TextOnly` on the entity the code list is used as `ValueList` for.
3175
-
3176
- ## Changed
3177
-
3178
- - Replaced `cds.PrivilegedUser` with `cds.User.Privileged`
3179
- - `cuid` in `@sap/cds/common` is now defined as an `aspect` to align it with the other definitions. The previous definition as `abstract entity` is equivalent and was only needed for historic reasons.
3180
- - `cds deploy --to sqlite` now skips columns from csv files if the header value is empty. This allows for ad-hoc 'disabling' of columns. For SAP HANA, the generated `hdbtabledata` files now also skip empty columns, restoring the behavior from cds 3.
3181
- - `cds deploy --to sqlite` has aligned its escaping rules for parsing csv data with SAP HANA's `hdbtabledata`. A `"` character can be escaped by another `"` as before, but only if contained in a quoted string, i.e. `"A""B"` leads to `A"B`, while `A""B` stays `A""B`, and `""` results in an empty string.
3182
-
3183
- ## Fixed
3184
-
3185
- - A `manifest.yml` file is now also generated for nodejs applications if a sqlite database is used.
3186
- - `cds build` did not correctly validate custom service handler implementations, warnings have been logged by mistake.
3187
- - The default memory size for nodejs applications has been increased in `manifest.yml` to avoid out-of-memory issues for cloud native deployments.
3188
- - `cds build` is now correctly creating external CSN output for Java multi-tenant applications.
3189
-
3190
- # Version 4.1.10 - 2020-09-11
3191
-
3192
- ## Added
3193
-
3194
- - Much like SQLite deployment, `cds deploy --to hana` and `cds build` can now cope with leading `#` comments in csv files, i.e. the comments get removed before deployment.
3195
- - `cds deploy` now can handle empty strings in CSV values (use `""`)
3196
-
3197
- ## Fixed
3198
- - `cds v` and `cds --version` now work again when called from `npm run` or `npx`.
3199
-
3200
-
3201
- # Version 4.1.9 - 2020-09-02
3202
-
3203
- ## Added
3204
-
3205
- - `cds.PrivilegedUser`, e.g., for transactions with super user
3206
-
3207
- # Version 4.1.8 - 2020-09-02
3208
-
3209
- ## Changed
3210
-
3211
- - The `node-cf` build task of `cds build` now removes file dependencies in `package.json` in the build output. These are anyways not resolvable on CF, but are handy at build time to [refer to other CDS modules](https://github.com/SAP-samples/cloud-cap-samples/blob/6fdd91b8c810d4367aa6dfc0a91e06dc467686ed/bookshop/package.json#L6).
3212
- - `cds deploy --to sqlite` can now cope with leading `#` comments in csv files
3213
- - `cds version --all` now includes `@sap/cds-sidecar-client`
3214
-
3215
- ## Fixed
3216
-
3217
- - `cds.entities` w/o namespace parameter now works properly when running out of a compiled model (aka `csn.json` aka 'on Cloud Foundry').
3218
- - `cds deploy --to hana` now also handles SAP HANA Cloud services on trial, which are created by the `hana` broker (in contrast to the `hanatrial` broker which still provisions older SAP HANA instances).
3219
- - `cds deploy --to hana` no longer uses `cf marketplace`, which has changed its parameters in CF CLI v7.
3220
- - SAP Fiori Elements preview's html no longer provokes Javascript errors in the SAP Fiori client.
3221
- - For DB services of kind `sql` the service implementation is now set correctly in the cds configuration. Previously, `sql` services got a `sqlite` implementation even if they were set to `hana` in production.
3222
- - Custom event handlers that do not register with a path (only with event and function) no longer crash the runtime
3223
- - In Typescript typings, the API declaration for `cds.load` and the `bootstrap` event is now fixed.
3224
-
3225
- # Version 4.1.7 - 2020-08-17
3226
-
3227
- ## Added
3228
-
3229
- - Shortcut to class `cds.ApplicationService` in cds facade
3230
- - Shortcut to class `cds.DatabaseService` in cds facade
3231
- - Shortcut to class `cds.RemoteService` in cds facade
3232
- - Shortcut to class `cds.MessagingService` in cds facade
3233
- - Shortcut to class `cds.Event` as new base class of `cds.Request`
3234
-
3235
- ## Fixed
3236
-
3237
- - Race condition on two parallel `cds.connect` to same service
3238
- - **`cds deploy --no-save`** extends the list of files it does not modify to `package.json`, `default-env.json` and `connection.properties`
3239
- - **Add meaningful error message if hdi-deploy cannot be loaded** &mdash; during `cds deploy --to hana`.
3240
-
3241
- # Version 4.1.6 - 2020-08-07
3242
-
3243
- ## Added
3244
-
3245
- - `req.notify()` as a new varient besides `req.info()`, which should display as toaster notifications on Fiori elements or other UIs.
3246
-
3247
- ## Fixed
3248
-
3249
- - `req.target` for unbound actions/functions is now `undefined` again, as documented
3250
- - Handlers registered with `srv.on(<CRUD>, 'Some/path', ...)` were never invoked
3251
- - Queries to remote services via `srv.on(..., ()=> other.read('Something'))` weren't sent to remote
3252
-
3253
- # Version 4.1.5 - 2020-07-31
3254
-
3255
- ## Removed
3256
-
3257
- The following changes affect undocumented internal implementations, and hence should not affect CAP-based projects.
3258
- Nevertheless, they are listed here for your reference.
3259
-
3260
- - `db.disconnect()` &rarr; no replacement; no need to disconnect before shutdown.
3261
- - `db.run(()=>{})` &rarr; use `cds.run([...multiple queries])` instead.
3262
-
3263
-
3264
- ## Changed
3265
-
3266
- - **Most CLI commands have moved** to `@sap/cds-dk`. Make sure to install the latest version with `npm i -g @sap/cds-dk`.
3267
-
3268
- - **Default OData version** in `cds configuration` is now `v4`. For `Node.js` projects and `Java` projects using new stack the cds configuration of `odata.version = 'v4'` is no longer required. For `Java` projects using old Java stack, OData v2 will still be used.
3269
-
3270
- - **Always do `await cds.connect.to()`** &mdash; in former versions `cds.connect.to()` returned some magic thenables, meant to ease the [_Promise Hell_](https://medium.com/@pyrolistical/how-to-get-out-of-promise-hell-8c20e0ab0513); now it always returns plain-standard Promises. Likely you never used this undocumented former behaviour, but in case: Just ensure to always call `cds.connect` with `await`.
3271
-
3272
- - **Deprecated `cds.connect()`** &mdash; please prefer `cds.connect.to('db')` instead, which has the very same effect but is more in line with the notion of potentially working with multiple database services.
3273
-
3274
- - **Deprecated `cds.hana.syntax` configuration**. Use `cds.hana.deploy-format`=`hdbtable` instead to switch deployment from `hdbcds` to `hdbtable` for SAP HANA Cloud.
3275
-
3276
- - **Faster generation of `hdbtabledata` files** from csv data. It no longer tries to check the existence of element or column names. Such checks are anyways done during SAP HANA deployment. This behavior is now symmetrical to SQLite deployment.
3277
-
3278
- - **Removed legacy cds build system** &mdash; the fallback using `cds.features.build.legacy` is no longer supported.
3279
-
3280
- - **`cds deploy --to hana` changes kind** to `hana` only if it is not already `sql`.
3281
-
3282
- - **Consistent default naming scheme for applications and services deployed to CF** across the following `cds` commands `build`, `deploy`, `init` and `add`. For an application named `myapp` the SAP HANA deployer app name is `myapp-db-deployer`, the SAP HANA DB service name is `myapp-db`. `cds build` now generates the application manifest file with a different name `manifest.yml`.
3283
-
3284
- - **`cds build`** no longer creates service metadata for the UI service binding by default. For SAP Web IDE Full-Stack compatibility a corresponding metadata.xml is still generated. A `fiori` build task has to be defined otherwise.
3285
-
3286
- - **`cds build` creates `hana` build results only** if either a corresponding build task has been configured or if kind `hana` or kind `sql` has been defined. A `production` build is required for the latter. A fallback is used for Web IDE Fullstack and legacy build configs.
3287
-
3288
- ## Added
3289
-
3290
- - **Common `cds.service.factory`** &mdash; `cds.serve` and `cds.connect` now use a common `cds.service.factory` to construct instances of `cds.Service`, as well as adding custom-provided handlers and implementations. This applies the same consistent ways to register new implementations via `cds.env.requires` options, model annotations `@impl` and `@kind`, or the well known `.cds`/`.js` sibling files mechanism.
3291
-
3292
- - **Common `cds.Service` base class** &mdash; `cds.Service` is the newly introduced common base class for all connected or provided services &mdash; i.e. all service instances contructed thru `cds.service.factory`. It provides uniform consumption APIs, as well as event handling APIs and capabilities for all services.
3293
-
3294
- - **Custom `cds.Service` subclasses** &mdash; besides providing `cds.service.impl` functions as of before, custom service implementations can now return subclasses of `cds.Service`, thereby plugging into the framework even more.
3295
-
3296
- - **New `srv.after('each', row => ...)`** &mdash; the former technique to register per-row handlers `srv.after('READ', each => ...)` broke when code was minified. The new method using pseudo event `'each'` is minifier-safe.
3297
-
3298
- - **New `srv.prepend(srv => ...)`** &mdash; use `srv.prepend(...)` to register event handlers to be executed _before_ the already reistered handlers. For example, extensions of reused implementations sometimes need to use this.
3299
-
3300
- - **Reflect `srv.events`** &mdash; base class `cds.Service` provides a new getter `srv.events` to reflect on declared events in the service definition, similar to the already existing `srv.entities`, `srv.types` and `srv.operations`.
3301
-
3302
- - **Experimental `cds.ql(req)`** &mdash; event handlers can now use the like of `const {SELECT} = cds.ql(req)` to ensure transaction-managed and tenant-isolated execution of queries, instead of `srv.tx(req)`. **Note** though, that this is an **experimental** feature, which might change or be removed in future versions.
3303
-
3304
- - **Using `await` in `cds repl`** &mdash; we now support using `await` directly on `cds repl` prompt inputs. This feature is provided through [Node's _--experimental-repl-await_ option](https://nodejs.org/api/repl.html#repl_await_keyword).
3305
-
3306
- - **CLI shortcut `--odata <v2|v4|x4>`** &mdash; the newly introduced general CLI option _**--odata** <v2/v4>_ acts as a shortcut to _--odata-version <v2/v4>_. In addition, _--odata **x4**_ acts as shortcut to _--odata-version v4 --odata-format structured --odata-containement true_.
3307
-
3308
- - **`cds build --production`** &mdash; builds the project using the `production` profile - same when `NODE_ENV` or `CDS_ENV` environment variable is set to `production`. This will create HANA deployment artifacts if `kind: "sql"` has been defined.
3309
-
3310
- - **`cds build --for <hana|java-cf|node-cf|mtx> --opts <...>`** &mdash; now supports execution of auto-created or configured build tasks. Individual properties can be overwritten by passing corresponding CLI options, defaults are used otherwise. For example, `cds build --for hana --dest target --opts model=[data,srv,app]`. **Note:** The parameter `options-model` has been deprecated use `--opts model=[...]`instead.
3311
-
3312
- - The set of languages that is honored for the `i18n.json` language pack can now be configured through `i18n.languages`. Default is still `all`, which means the sum of language files found next to models.
3313
-
3314
- ## Fixed
3315
- - SAP Fiori Elements preview is now working again with the latest version of SAP UI5.
3316
-
3317
- - **Use latest SAP CommonCryptoLib help** &mdash; when SAP CommonCryptoLib is missing during `cds deploy --to hana`.
3318
-
3319
- - `sql_mapping` is only written to `csn.json` if the classic Java runtime and no default naming is used.
3320
-
3321
- - SAP Fiori Elements dev support in `cds run` now also honors `/v2` URLs. These are installed by default by the `@sap/cds-odata-v2-adapter-proxy`.
3322
-
3323
- - npm scripts that wrap around cds-dk commands like `cds watch` now also work on Windows. Previously they couldn't find the cds command.
3324
-
3325
- - When extracting the base model of a multi-tenant application `cds build` now ensures that only files having project scope are copied, a warning is logged otherwise.
3326
-
3327
- - `cds build` now no longer crashes if exactly one custom language is given in `options.lang` of the `java-cf` build task.
3328
-
3329
- - `cds compile` now fails with a non-zero exit code in case of compilation errors.
3330
-
3331
- # Version 3.35.0 - 2020-05-08
3332
-
3333
- ## Changed
3334
- - The new compiler implementation, a.k.a SNAPI, is now the default. Can be disabled with `cds.features.snapi=false`.
3335
-
3336
- # Version 3.34.3 - 2020-06-19
3337
-
3338
- ## Changed
3339
-
3340
- - Faster generation of `hdbtabledata` files from csv data. It no longer tries to check the existence of element or column names. Such checks are anyways done during SAP HANA deployment. This behavior is now symmetrical to SQLite deployment.
3341
-
3342
- # Version 3.34.2 - 2020-05-30
3343
-
3344
- ## Changed
3345
-
3346
- - Use `cds.hana.deploy-format`=`hdbtable` instead of `cds.hana.syntax` to switch deployment from `hdbcds` to `hdbtable` for SAP HANA Cloud.
3347
- - `cds run` now supports relative `dataSource` URLs in SAP UI5 manifests again, so that UI5 apps can be served w/o approuter. This support is only active in development mode.
3348
- - `cds deploy --to hana` changes kind to `hana` only if it is not already `sql`
3349
-
3350
- ## Fixed
3351
-
3352
- - The `UI.Identification` annotation for `sap.common.CodeList` got a correct value, pointing to its `name` element.
3353
- - Configuration `requires.<foo>.credentials.destination` is now preserved again when running with `VCAP_SERVICES`. In version 3.34.1 it was cleared.
3354
- - Entities annotated with `@cds.persistence.skip:if-unused` (like `sap.common.Languages`) now again are skipped when compiling to SAP HANA output. This got broken in previous versions when using the new compiler APIs.
3355
- - `sql_mapping` is again written to `csn.json` as it's required by classic Java runtime.
3356
- - `default-env.json` is now read even in production, which is in line with the behavior of other modules that honor this file. Real prod environments like CF will still overwrite these defaults.
3357
- - `cds build` caused error `invalid option` &mdash; when passing command line options like `log-level`, `src` or `for`.
3358
-
3359
- # Version 3.34.0 - 2020-04-27
3360
-
3361
- ## Added
3362
-
3363
- - `cds version` option `-ls` prints an `npm ls` subtree.
3364
- - `cds serve` / `run` now also accept package names as arguments, e.g. `cds serve --project @capire/bookshop`.
3365
- - `cds compile` option `--parse` provides minimal, parsed-only CSN output.
3366
- - New Node.js method `cds.compile()` allows compiling CDS sources in-process.
3367
- - `cds build` now supports cds configuration `requires.db.kind:"sql"` which allows seamless production deployments using HANA db and development deployments using sqlite db.
3368
- - Default maximum query size limit of 1000 (overridable via `@cds.query.limit.max`).
3369
- - Improved error message during `cds deploy` on Windows when `SAP CommonCryptoLib` is missing.
3370
- - `cds build` now checks that `entity-whitelist` and `service-whitelist` have been defined for SaaS applications - a warning is reported otherwise. `cds build` will fail if invalid entries exist.
3371
- - Parameter `--vcap-file` lets `cds deploy --to hana` use an existing `default-env.json` file for the deployment credentials, instead of always creating new credentials from Cloud Foundry. Note that this is a beta feature.
3372
- - `cds build --log-level` allows to choose which messages to see, default log level is `warn`.
3373
- - Labels of `@sap/cds/common` texts are now available in many languages
3374
-
3375
- ## Changed
3376
-
3377
- - Node.js method `cds.parse()` has been changed to now truely return parsed-only models, with extensions not applied yet.
3378
- **Note:** If you'need the former (erroneous) behaviour, please use `cds.compile` for that from now on.
3379
- - Node.js method `cds.get()` now returns parsed-only models; same as `cds.parse()`.
3380
- - `cds serve` / `run` / `watch` now reduce logging of details for the bound DB on connect, leading to less clutter.
3381
- - Precision for `validTo` and `validFrom` defined in the `temporal` aspect in `@sap/cds/common` changed from `DateTime` to `Timestamp`.
3382
- - Some administrative fields of SAP Fiori draft documents are now hidden on the UI. The rest got labels.
3383
- - Renamed cds configuration setting `features.messageLevel` to `log-level` to be consistent with command line option, e.g. `cds build --log-level`.
3384
-
3385
- - `cds extend` and `cds activate` commands have been moved to `@sap/cds-dk`. `cds disconnect` has been moved there under a different name.
3386
-
3387
- ## Fixed
3388
- - `cds build` - improvements in the area of error handling and error reporting.
3389
- - `cds env` and Node.js runtime now properly complete configuration like `requires.db.kind.sql` with VCAP_SERVICES, so that in `production` an SAP HANA service is bound.
3390
- - `cds build` now localizes edmx files properly if `cds.env.features.snapi` is turned on.
3391
- - `cds deploy --to hana` no longer crashes if called with `NODE_ENV=production`.
3392
-
3393
- ## Removed
3394
-
3395
- # Version 3.33.1 - 2020-03-24
3396
-
3397
- ## Fixed
3398
- - `cds build` now correctly supports options.model definitions of type string
3399
- - Details navigation in Fiori preview works again since it's pinned to SAP UI5 1.73. Actual cause still needs to be investigated.
3400
- - `cds deploy` now adds `@sap/hana-client` to package.json instead of `hdb`.
3401
- - `cds deploy` adds kind `sql` to requires section.
3402
-
3403
- # Version 3.33.0 - 2020-03-19
3404
-
3405
- ## Added
3406
- - `cds deploy` uses information from existing `default-env.json`.
3407
-
3408
- - `cds version` now also lists all dependencies of your local package.json and has an updated CLI commend help, documenting option `--all`.
3409
- - `cds compile` option `--docs` preserve contents of `/** ... */` doc comments in CSN output as well as in EDMX outputs (as _Core.Description_ annotations).
3410
- - `cds compile` option `--clean` tells the compiler to not add any derived information, but return a CSN which reflects only what was actually found in a `.cds` source.
3411
- - `cds serve` option `--watch` starts the specific serve command in nodemon watch mode
3412
- - Node.js: `cds.env` now supports camel case env variables as well as dot-notated keys in `.env`
3413
-
3414
- ## Changed
3415
-
3416
- - Labels for the `createdAt` and `changedAt` in the `@sap/cds/common#managed` entity have been adjusted to reflect the SAP Fiori design guidelines.
3417
- - `cds build` now delegates to the modular build system by default (known as `cds build/all`). The modular build system is compatible, but supports additional features, e.g. staging build, SAP HANA Cloud Edition support, populating initial data from .csv by generating .hdbtabledata files, etc. The legacy build is still available as a fallback in case of issues - use setting `cds.features.build.legacy: true` or ENV variable `CDS_FEATURES_BUILD_LEGACY=true`.
3418
-
3419
- ## Fixed
3420
-
3421
- - `cds build` now correctly logs warnings returned by cds compiler. The message log level can be customized using cds configuration setting `cds.features.messageLevel` - default is `warn`.
3422
- - `cds.env.roots` now properly picks up a changed value of `cds.env.folders`
3423
- - `hdbtabledata` is no longer generated for entities that are marked with `@cds.persistence.skip`
3424
-
3425
- ## Removed
3426
-
3427
-
3428
- # Version 3.32.0 - 2020-03-06
3429
-
3430
- ## Fixed
3431
- - An issue where all Node.js runtime sessions where disconnected when one tenant offboarded.
3432
-
3433
-
3434
- # Version 3.31.2 - 2020-03-05
3435
-
3436
- ## Fixed
3437
- - `cds deploy` does not crash if _texts.csv is provided for skipped entities
3438
- - `cds serve foo.cds` does no longer load same model twice
3439
- - `cds compile --to edmx` no longer creates files with csn instead of edmx content in case no language bundles are found
3440
- - Both `cds env` and `cds compile` no longer write terminal escape sequences if only stdout is redirected, but not stderr.
3441
- - No longer enforce Node.js version 8 in `db/package.json`. Cloud Foundry environment does not support it anymore, as this version is out of maintenance.
3442
-
3443
-
3444
- # Version 3.31.1 - 2020-02-26
3445
-
3446
-
3447
- ## Fixed
3448
-
3449
- - Removed `npm-shrinkwrap.json`
3450
-
3451
-
3452
- # Version 3.31.0 - 2020-02-25
3453
-
3454
- ## Added
3455
-
3456
- Generation of `hdbtabledata` files now reports if CSV file names don't match entity names, and if header names don't match element names in an entity. Watch out for such logs in case CSV files are not deployed to SAP HANA.
3457
-
3458
- ## Fixed
3459
-
3460
- - `cds compile --to hdbtabledata` no longer crashes with `_texts.csv` files referring to a non-`localized` entity
3461
- - `cds build/all` adds `app` folder to the list of model folders for HANA database builds. Draft tables are missing if the corresponding annotation model is missing.
3462
-
3463
-
3464
- # Version 3.30.0 - 2020-02-10
3465
-
3466
- ## Added
3467
-
3468
- - `cds compile --log-level` allows to choose which messages to see
3469
- - `cds deploy --dry` prints DDL statements to stdout instead of executing them
3470
- - `cds deploy --with-mocks` also adds tables for required services
3471
- - `cds serve --mocked` allows mocking individual required services
3472
- - ( &rarr; learn more about these things using `cds help ...` )
3473
- - `cds.env` now also loads from `.env` files in properties format
3474
- - [`cds.resolve/load('*')`](https://cap.cloud.sap/docs/node.js/api#cds-load) resolves or loads all models in a project including those for required services. It ist controlled and configurable through `cds.env.folders` and `.roots``. Try this in `cds repl` launched from your project root to see that in action:
3475
- ```js
3476
- cds.env.folders // = folders db, srv, app by default
3477
- cds.env.roots // + schema and services in cwd
3478
- cds.resolve('*',false) // + models in cds.env.requires
3479
- cds.resolve('*') // > the resolved existing files
3480
- ```
3481
-
3482
- - Added `cds.debug(<id>)` as a convenient helper for debug output controlled by `process.env.DEBUG`. For example, use it as follows:
3483
- ```js
3484
- const DEBUG = cds.debug('my-module')
3485
- DEBUG && DEBUG ('my debug info:', foo, ...)
3486
- ```
3487
- ```sh
3488
- > DEBUG=my-module cds run
3489
- ```
3490
-
3491
- - Added `cds.error(<msg>)` as a convenient helper for throwing errors whose stack traces start from the actual point of invocation. For example, use it as follows:
3492
- ```js
3493
- const {error} = cds
3494
- if (...) throw error `Something's wrong with ${whatever}`
3495
- const foo = bar || error `Bar is missing!` // short circuit exits
3496
- ```
3497
-
3498
- ## Changed
3499
-
3500
- This version brings a major refactoring and streamlining of service runtime implementations,
3501
- which stays fully compatible regarding all documented APIs but in case you used internal
3502
- not documented (non-)APIs, you should know these:
3503
-
3504
- Removed undocumented features
3505
-
3506
- - Annotation `@source` from models loaded for runtime
3507
- - Property `cds.serve.app` &rarr; use `cds.app` instead
3508
- - Property `source` from CSN entity/view definition objects
3509
-
3510
- > It's very unlikely that you ever used these undocumented internal features at all.
3511
- > In case you did, this should never have been done and you should fix that asap.
3512
-
3513
-
3514
- Deprecated features (&rarr; might get removed in upcoming versions)
3515
-
3516
- - Property `cds.session` &rarr; use `cds.db` instead
3517
- - Property `cds.options` &rarr; use `cds.db.options` instead
3518
- - Property `cds.unfold` &rarr; use `cds.compile` instead
3519
- - Property `cds.config` &rarr; use `cds.env` instead
3520
-
3521
- > These properties actually where duplicates to the mentioned alternatives.
3522
-
3523
-
3524
- `cds run` and `cds watch` have been re-implemented as convenience shortcuts to `cds serve`, which acts as the central orchestrator for bootstrapping now. (&rarr; see `cds run ?` or `cds watch ?` to learn more)
3525
-
3526
- `cds serve` now optionally bootstraps from project-local `./server.js` or `./srv/server.js`, if exist, thus giving more control while still benefitting from `cds serve`'s intrinsic support for options like `--in-memory` or `--with-mocks`.
3527
-
3528
- `cds serve` now uses `cds.load('*')` to load a single effective model once, assigned to `cds.model`, and reused for db as well as all provided and required services . As that avoids loading models redundantly, it drastically improves both, bootstrapping performance as well as memory consumption.
3529
-
3530
- `cds deploy` does not (have to) register the default models to `package.json` anymore. For example, unlike before, `cds deploy -2 sqlite` will merely add an entry: `db:{kind:'sqlite'}`, without an additional `model` property anymore.
3531
-
3532
- `cds deploy --to hana` does not create `connection.properties` file any longer, but only modify existing one
3533
-
3534
- `modifiedAt` and `modifiedBy` from `@sap/cds/common`
3535
- - Are now mutable for OData, i.e. no longer carry the `@Core.Immutable: true` annotation.
3536
- - Are set by the Node.js runtime whenever the respective row was modified, i.e. also during `CREATE` operations.
3537
-
3538
- Support for `cds init` is now moved to `@sap/cds-dk`.
3539
-
3540
- ## Fixed
3541
-
3542
- - There was a bug in that caused a service names `FooBarV2` to erroneously be mapped to mount point `/foo-barv2` instead of `/foo-bar-v2` as intended and was the case before. &rarr; in case you started a project in this interims phase and had a service name with that pattern you may encounter this fix as an incompatible change, but it's actually reverting to the former compatible way.
3543
-
3544
- - `cds.env` erroneously overrode profiled entries depending on properties order
3545
-
3546
- - Fiori preview now uses latest version of SAP UI5 again
3547
-
3548
- - `cds deploy` verifies returned service key to ensure target service is not of type `managed`.
3549
-
3550
-
3551
-
3552
-
3553
- # Version 3.21.3 - 2020-02-05
3554
- ## Fixed
3555
- - Fiori preview no longer catches service URLs with an arbitrary prefix (e.g. `/foo/browse` instead of just `/browse`).
3556
-
3557
-
3558
- # Version 3.21.1 - 2020-01-07
3559
- ## Fixed
3560
- - SAP Fiori Elements preview no longer crashes since it's pinned to SAP UI5 1.72.3. Actual cause still needs to be investigated.
3561
-
3562
- ## Version 3.21.0 - 2019-12-11
3563
-
3564
- - `cds add`, `import`, and `watch` now print installation hints if `@sap/cds-dk` is not installed
3565
-
3566
- - Experimental option `hana.syntax=hdi` to create `hdbtable` files instead of `hdbcds`. May still change!
3567
-
3568
-
3569
- ## Changed
3570
-
3571
- - In development mode, the `mock` authorization strategy is automatically activated with two fake users `alice` and `bob`, which allows for out-of-the-box testing of `@requires` annotations. This means that, unlike before, the `JWT` authorization strategy needs to be activated explicitly (through `{auth: { passport: { strategy: 'mock' }}}`. In production, no change is required.
3572
-
3573
- - You might see a `MODULE_NOT_FOUND` error for `@sap/xsenv` in case you use the `JWT` strategy but have not bound any xsuaa service. In this case either bind such a service instance, add the `@sap/xsenv` dependency, or use a different strategy like `mock`. The trigger of this error is `@sap/xssec` 2.2.4 no longer requiring `@sap/xsenv`.
3574
-
3575
- - Renovated and streamlined `cds init`. It prints a hint now if it's called with old-style parameters, as well as that it wants to be used from `@sap/cds-dk`. Check out `cds help init` for more.
3576
-
3577
- - Removed the experimental `--args` parameter of `cds compile`. This turned out to be cumbersome to use in shells. Replacement is the standard configuration mechanism, e.g. use an environment variable `CDS_FOO_BAR` to activate option `cds.foo.bar`.
3578
-
3579
- ## Fixed
3580
- - `SELECT.one/distinct(Fool,[...])` failed when passing an array for columns as argument two
3581
-
3582
-
3583
-
3584
- # Version 3.20.1 - 2019-11-26
3585
- ## Fixed
3586
- - Fix 'duplicate versions' errors by loading `@sap/cds` again from the current project if possible.
3587
-
3588
- # Version 3.20.0 - 2019-11-19
3589
-
3590
- ## Added
3591
- - Mention xsuaa in help of `cds compile`
3592
-
3593
- ## Fixed
3594
- - Typings for `UPDATE` function no longer contain duplicates.
3595
-
3596
- ## Also see
3597
- - Changes of `@sap/cds-compiler` 1.20.3
3598
- - Changes of `@sap/cds-ql` 1.21.0
3599
- - Changes of `@sap/cds-services` 1.21.0
3600
- - Changes of `@sap/cds-messaging` 1.4.0
3601
- - Changes of `@sap/generator-cds` 2.10.2
3602
-
3603
-
3604
-
3605
- # Version 3.18.4 - 2019-11-15
3606
-
3607
- ## Fixed
3608
- - `.cfignore` files now get created by `cds build/all` to improve the overall deployment turnaround
3609
- of `cf push`. Also, this avoids failures of CF node.js buildpack trying to rebuild sqlite binaries.
3610
- - Generated `manifest.yaml` files for Cloud Foundry now contain a `path` attribute that allows
3611
- pushing from an outside folder. Also, they specify reduced memory requirements.
3612
- - Generated `manifest.yaml` for HDI deployer does not create a route, and specifies a valid `health-check-type`.
3613
- - `cds deploy --to hana` now also includes models in the `srv` folder.
3614
- - `cds deploy` no longer writes model folders to `package.json` that do not exist.
3615
-
3616
-
3617
- # Version 3.19.0 - 2019-10-31
3618
-
3619
- ## Added
3620
- - Deployments for sqlite and SAP HANA now find CSV files in the form `_texts_LOCALE.csv`,
3621
- like `Books_texts_fr.csv`. This file layout allows splitting translated texts into one file
3622
- per language.
3623
- - Deployment for sqlite now also imports initial data from JSON files
3624
- - `cds version` has learned about `@sap/cds-dk`
3625
-
3626
- ## Fixed
3627
- - `cds watch --help` works again, if used from `@sap/cds-dk`
3628
-
3629
-
3630
- # Version 3.18.3 - 2019-10-28
3631
- ## Fixed
3632
- - Fixed a crash in `cds run --watch` with changing directories.
3633
- - `cds watch` is now also found if called from an NPM script.
3634
- - `cds watch` now uses the same lookup paths for models as `cds run`
3635
-
3636
-
3637
- # Version 3.18.1 - 2019-10-17
3638
- ## Fixed
3639
- - Fixed a crash during sqlite deployment if there were csv files that did not match an entity name
3640
- - `cds deploy --to hana` now does a build for SAP HANA even if no matching build task is available.
3641
- - `cds deploy` now tries to add `.gitignore` entries only once
3642
- - In `@source` annotations of csn.json files generated for cloud deployments,
3643
- now posix file paths (with `/`) are written, and no Windows paths.
3644
- - `cds serve` and `run` now shuts down gracefully in case of `SIGHUP` signals emitted by
3645
- e.g. the VS Code terminal.
3646
- - `cds watch` now is found even if `@sap/cds-dk` is not installed locally.
3647
-
3648
- ## Also see
3649
- - Changes of `@sap/cds-ql` 1.19.2
3650
- - Changes of `@sap/cds-services` 1.19.1
3651
- - Changes of `@sap/cds-messaging` 1.2.1
3652
-
3653
-
3654
- # Version 3.18.0 - 2019-10-09
3655
-
3656
- ## Added
3657
- - Compiler options for SAP HANA backend can now be set in configuration in the `cdsc.toHana` block
3658
- (e.g. `cds.cdsc.toHana.joins`)
3659
- - `service.tx()` as a shortcut for `service.transaction()`
3660
-
3661
- ## Fixed
3662
- - `cds deploy --to hana` now adds the tunnel address to the JDBC URL
3663
- - Boolean and number values from `default-env.json` now are accepted in configuration (`cds env`)
3664
- - For applications deployed to Cloud Foundry, custom handlers are now properly resolved using their names.
3665
- - `cds serve`/`run` now properly log `$batch` requests of OData
3666
-
3667
- ## Also see
3668
- - Changes of `@sap/cds-compiler` 1.19.1
3669
- - Changes of `@sap/cds-messaging` 1.2.0
3670
- - Changes of `@sap/cds-ql` 1.19.1
3671
- - Changes of `@sap/cds-reflect` 2.8.0
3672
- - Changes of `@sap/cds-rest` 1.2.0
3673
- - Changes of `@sap/cds-services` 1.19.0
3674
- - Changes of `@sap/generator-cds` 2.9.0
3675
-
3676
-
3677
- # Version 3.17.8 - 2019-09-25
3678
-
3679
- ## Fixed
3680
-
3681
- - `UPDATE(entity, key)` statement
3682
-
3683
-
3684
- # Version 3.17.7 - 2019-09-24
3685
-
3686
- ## Fixed
3687
-
3688
- - `cds deploy`
3689
-
3690
-
3691
- # Version 3.17.6 - 2019-09-23
3692
-
3693
- ## Changed
3694
-
3695
- - Improved `cds env`
3696
-
3697
-
3698
- # Version 3.17.5 - 2019-09-20
3699
-
3700
- ## Fixed
3701
-
3702
- - `cds deploy` did not work properly
3703
-
3704
-
3705
- # Version 3.17.4 - 2019-09-19
3706
-
3707
- ## Also see
3708
- - Changes of `@sap/cds-rest` 1.1.2
3709
-
3710
-
3711
- # Version 3.17.3 - 2019-09-19
3712
-
3713
- ## Fixed
3714
-
3715
- - `cds deploy --to hana`
3716
-
3717
-
3718
- # Version 3.17.2 - 2019-09-19
3719
-
3720
- ## Also see
3721
- - Changes of `@sap/cds-services` 1.18.2
3722
- - Changes of `@sap/generator-cds` 2.8.2
3723
-
3724
-
3725
- # Version 3.17.1 - 2019-09-18
3726
-
3727
- ## Also see
3728
- - Changes of `@sap/cds-compiler` 1.18.2
3729
- - Changes of `@sap/cds-ql` 1.18.2
3730
- - Changes of `@sap/cds-services` 1.18.1
3731
-
3732
-
3733
- # Version 3.17.0 - 2019-09-10
3734
-
3735
- ## Added
3736
- - `cds run` has learned a new `--watch` option, which provides automatic restarts of the server on file changes. [nodemon](https://www.npmjs.com/package/nodemon) package is required for this to work.
3737
-
3738
- ## Fixed
3739
- - `cds deploy` now writes `true` and `false` values in csv files as boolean to sqlite
3740
- - Console output of `cds run` now waits until the server is really up and running before it declares success.
3741
- - `cds deploy` and `build/all` do not write `hdbtabledata` files if some are already present.
3742
-
3743
- ## Also see
3744
- - Changes of `@sap/cds-compiler` 1.18.1
3745
- - Changes of `@sap/cds-ql` 1.18.1
3746
- - Changes of `@sap/cds-reflect` 2.7.1
3747
- - Changes of `@sap/cds-services` 1.18.0
3748
- - Changes of `@sap/generator-cds` 2.8.1
3749
-
3750
-
3751
-
3752
- # Version 3.16.2 - 2019-08-27
3753
-
3754
- ## Also see
3755
- - Changes of `@sap/cds-compiler` 1.17.1
3756
-
3757
-
3758
-
3759
- # Version 3.16.0 - 2019-08-22
3760
-
3761
- ## Added
3762
- - `cds run` has learned a new `--in-memory` option, which connects and deploys to an SQLite in-memory database. There is no need to call `cds deploy` before.
3763
- - `cds deploy --to hana` now can also be executed in Java projects
3764
- - `cds run`'s index.html got a favicon, to give a visual clue in browsers.
3765
- - `cds.requires.<datasource>.model` configuration can now also point to a node.js module, e.g. `@my/module`.
3766
- Previously, only a relative file path was supported.
3767
- - Improved logging of query objects
3768
- - `cds compile` now understands `--to edmx-v2` and `--to edmx-v4` to produce OData metadata of versions 2 or 4, respectively.
3769
-
3770
- ## Changed
3771
- - SAP Fiori Elements preview in `cds run` now is only added if OData services are being served.
3772
- For other protocols like `rest`, no SAP Fiori Elements preview is provided. Same holds true for the `$metadata` link.
3773
- - `cds compile` now behaves better in non-TTY scenarios (e.g. when piping to files). It writes a proper JSON
3774
- string instead of a Javascript object. Previously, one had to enforce JSON using the `--to json` processor. Compare e.g. the output of `cds compile model.cds` to `cds compile model.cds > model.json`.
3775
-
3776
- ## Fixed
3777
- - Fiori preview in `cds run` now also works for services with namespaces
3778
- - In services of CF marketplace, `cds deploy --to hana` now only accepts services with plan `hdi-shared`.
3779
- Previously, it could get confused with services of type `hana` but of other (non-HDI) plans.
3780
- - Localized edmx files are now produced also for i18n.json files.
3781
-
3782
- ## Also see
3783
- - Changes of `@sap/cds-compiler` 1.17.0
3784
- - Changes of `@sap/cds-ql` 1.17.0
3785
- - Changes of `@sap/cds-services` 1.17.0
3786
- - Changes of `@sap/generator-cds` 2.7.0
3787
-
3788
-
3789
-
3790
- # Version 3.15.0 - 2019-07-26
3791
-
3792
- ## Added
3793
- - `hdbtabledata` files are now generated automatically as part of `cds deploy --to hana` for given set of CSV files. CSV file names must follow the pattern `<namespace>-entity.csv` (same as for SQLite deployment) and be located in `db/csv` or `db/data`.
3794
- - For Node.js, multiple configuration profiles can now be activated at the same time, e.g. by setting both `NODE_ENV` and `CDS_ENV`, or by setting a multi-value list: `CDS_ENV=profile1,profile2`.
3795
- - New labels for `sap.common.*.code` and `sap.common.Currencies.symbol` (part of `@sap/cds/common`).
3796
- - Better message for `Duplicate definition` errors, where the same `cds` file is referenced from different locations.
3797
- To fix this, check all dependencies to `@sap/cds` in your package.json and those of reused packages and ensure they allow deduped use of `@sap/cds`.
3798
-
3799
- ## Also see
3800
- - Changes of `@sap/cds-compiler` 1.16.1
3801
- - Changes of `@sap/cds-ql` 1.16.0
3802
- - Changes of `@sap/cds-services` 1.16.0
3803
- - Changes of `@sap/generator-cds` 2.6.1
3804
-
3805
-
3806
- # Version 3.14.0 - 2019-07-11
3807
-
3808
- ## Added
3809
- - Support for `SELECT.distinct.from(Foo)` and `SELECT.one.from(Foo)` queries in Node.js
3810
- - [Beta] `cds deploy --to hana` deploys to SAP HANA on Cloud Foundry
3811
- - For Node.js, `cds env` now activates the `development` profile automatically,
3812
- unless `CDS_ENV` or `NODE_ENV` are set. This is in line with `NODE_ENV` defaulting to `development`.
3813
-
3814
- ## Also see
3815
- - Changes of `@sap/cds-ql` 1.15.0
3816
- - Changes of `@sap/cds-services` 1.15.0
3817
- - Changes of `@sap/generator-cds` 2.5.0
3818
-
3819
-
3820
- # Version 3.13.0 - 2019-06-26
3821
-
3822
- ## Added
3823
- - `cds serve` now provides a preview of the services in a list page of SAP Fiori Elements
3824
-
3825
- ## Changed
3826
- - `cds serve` now yields an error if there are no services defined in the model
3827
-
3828
- ## Also see
3829
- - Changes of `@sap/cds-compiler` 1.15.0
3830
- - Changes of `@sap/cds-ql` 1.14.0
3831
- - Changes of `@sap/cds-services` 1.14.0
3832
- - Changes of `@sap/generator-cds` 2.4.11
3833
-
3834
-
3835
-
3836
- # Version 3.12.0 - 2019-06-17
3837
-
3838
- ## Added
3839
- - On request, `cds build/all` now generates OData EDMX files for node.js services
3840
- - Performance optimizations for `cds build/all`
3841
-
3842
- ## Fixed
3843
- - `cds deploy` no longer fails if `data` dir is not present
3844
- - `cds build/all` no longer prints a message if `mta.yaml` does not exist
3845
-
3846
-
3847
- ## Also see
3848
- - Changes of `@sap/cds-compiler` 1.14.1
3849
- - Changes of `@sap/cds-ql` 1.13.0
3850
- - Changes of `@sap/cds-services` 1.13.0
3851
-
3852
-
3853
- # Version 3.11.1 - 2019-06-03
3854
-
3855
- ## Fixed
3856
- - `cds deploy` honors saved datasource configuration again
3857
- - localization works again for sqlite datasources defined in `package.json`
3858
-
3859
-
3860
- # Version 3.11.0 - 2019-06-03
3861
-
3862
- ## Added
3863
-
3864
- - `cds deploy` now also finds `.csv` files in imported reuse packages
3865
- - Better error messages for various `cds` CLI calls
3866
-
3867
- ## Changed
3868
- - `cds build/all` for Node.js projects generates proper CSN in `gen/csn.json`.
3869
- A warning is emitted if `cds serve` is run with the previous format. Rebuild the project if you see this warning.
3870
-
3871
- ## Also see
3872
- - Changes of `@sap/cds-compiler` 1.14.0
3873
- - Changes of `@sap/cds-ql` 1.12.0
3874
- - Changes of `@sap/cds-services` 1.12.0
3875
- - Changes of `@sap/generator-cds` 2.4.10
3876
-
3877
- # Version 3.10.0 - 2019-05-21
3878
-
3879
- ## Added
3880
- - Tables and view for localized entities are created by default now, both for SAP HANA and SQLite.
3881
- - Internal errors are now marked as such in all CLI commands, with a request to report them.
3882
-
3883
- ## Changed
3884
- - `cds compile --service all` no longer fails in case no services are found.
3885
- This better matches higher level commands like `cds build` that should not fail in this instance.
3886
- Note that `--service Foo` fails as before in case `Foo` is not found.
3887
- - `cds run` and `cds serve` now serve the generic index page at `/`, while previously this was `/$index`.
3888
- - `cds build/all` now auto-creates build tasks from `mta.yaml` definition if no build tasks have been
3889
- defined in `.cdsrc.json`. If no `mta.yaml` file exists, cds configuration data respectively defaults
3890
- are used for build task configuration.
3891
-
3892
- ## Fixed
3893
- - CLI now shows compilation warnings in all commands, e.g. in `build`, `deploy`, or `compile`.
3894
- Previously warnings were only shown in case of compilation errors.
3895
- - `cds help` no longer inserts terminal escape sequences if stdout is redirected to a file.
3896
- - Errors in custom handlers are no longer shadowed in `cds serve` or `cds run`.
3897
-
3898
- ## Also see
3899
- - Changes of `@sap/cds-compiler` 1.13.4
3900
- - Changes of `@sap/cds-ql` 1.11.1
3901
- - Changes of `@sap/cds-reflect` 2.5.0
3902
- - Changes of `@sap/cds-services` 1.11.1
3903
- - Changes of `@sap/generator-cds` 2.4.8
3904
-
3905
-
3906
-
3907
- # Version 3.9.0 - 2019-05-08
3908
-
3909
- ## Added
3910
- - `cds.serve` now reads passport for services from `auth.passport` configuration property
3911
-
3912
- ## Fixed
3913
- - `cds.compile` now really skips entities marked with `if-unused`
3914
- - Build tasks are now listed with `cds env`
3915
- - `cds serve` now supports the `--at`, `--to`, and `--with` arguments as specified.
3916
- - `cds deploy --to sqlite` now better handles csv files with empty values
3917
-
3918
- ## Also see
3919
- - Changes of `@sap/cds-compiler` 1.12.0
3920
- - Changes of `@sap/cds-ql` 1.10.2
3921
- - Changes of `@sap/cds-reflect` 2.5.0
3922
- - Changes of `@sap/cds-services` 1.10.2
3923
- - Changes of `@sap/generator-cds` 2.4.6
3924
-
3925
-
3926
-
3927
- # Version 3.8.1 - 2019-04-30
3928
-
3929
- ## Fixed
3930
- - Texts in deep annotations, e.g. `@UI.Facet`, are now properly localized in OData metadata
3931
-
3932
-
3933
- # Version 3.8.0 - 2019-04-09
3934
-
3935
- ## Fixed
3936
- - Make tests run on Windows again
3937
- - Various fixes in `cds build/all`
3938
- - Adjustments to latest compiler for localizing models
3939
- - `.hdbcds` and `.hdbtabledata` files are now copied over in `cds build/all`
3940
-
3941
- ## Also see
3942
- - Changes of `@sap/cds-compiler` 1.11.0
3943
- - Changes of `@sap/cds-ql` 1.8.1
3944
- - Changes of `@sap/cds-services` 1.8.1
3945
- - Changes of `@sap/generator-cds` 2.4.4
3946
-
3947
-
3948
-
3949
- # Version 3.7.1 - 2019-03-25
3950
-
3951
- ## Fixed
3952
- - `cds serve` now honors `newCsn` configuration when serving from precompiled csn.json files.
3953
- - `cds init` creates samples correctly when project already contains files.
3954
- - `cds build` for node.js projects will now show up compilation errors. Formatting has been improved as well.
3955
- - Better support for finding `cds` executable in VSCode.
3956
-
3957
-
3958
- ## Also see
3959
- - Changes of `@sap/cds-compiler` 1.10.0
3960
- - Changes of `@sap/cds-ql` 1.7.1
3961
- - Changes of `@sap/cds-services` 1.7.2
3962
- - Changes of `@sap/generator-cds` 2.4.4
3963
-
3964
-
3965
-
3966
- # Version 3.6.0 - 2019-02-27
3967
-
3968
- ## Added
3969
- - In `cds init`:
3970
- - Add modules via `cds init --modules` to an existing project.
3971
- - Do not allow project creation via `cds init` outside of current working folder, e.g. init ../../some/where/else is not allowed.
3972
- - No output at all (not even error messages) when using `cds init --quiet`.
3973
- - Create a module folder using `cds init --modules...` even if it is empty based on the supplied options.
3974
- - Parameter `--modules` only supports one folder of each type.
3975
- - Alpha support for `@cds.odata.valuelist`: Adding `@cds.odata.valuelist` to `@cds.autoexposed` entities will automatically equip all associations referring to such entities with a corresponding `@Common.ValueList.entity`
3976
-
3977
- ## Changed
3978
- - Simplified code lists: removed superfluous types `LanguageCode`, `CountryCode`, and `CurrencyCode` from `@sap/cds/common`
3979
- - `cds build/all` now does `--clean` by default and is less verbose in its output
3980
-
3981
- ## Fixed
3982
- - `cds.load` no longer fails if reading in a CSN file in version `0.1.0`
3983
-
3984
- ## Also see
3985
- - Changes of `@sap/cds-compiler` 1.9.0
3986
- - Changes of `@sap/cds-reflect` 2.4.0
3987
- - Changes of `@sap/cds-ql` 1.6.0
3988
- - Changes of `@sap/cds-services` 1.6.0
3989
- - Changes of `@sap/generator-cds` 2.4.0
3990
-
3991
-
3992
-
3993
- # Version 3.5.2 - 2019-02-20
3994
-
3995
- ## Fixed
3996
- - Node.js projects created with `cds init` now
3997
- - Bind the service module to an HDI service in `mta.yaml`.
3998
- - Invoke CDS build when building the database module.
3999
- - No longer create old-style `service` configuration in `package.json`.
4000
- - For datasources with kind `hana` we now also find `hanatrial` services in trial landscapes by matching their tag `hana`.
4001
-
4002
-
4003
-
4004
- # Version 3.5.1 - 2019-02-14
4005
-
4006
- ## Fixed
4007
- - In `cds serve` service providers where added twice to the express app. This is fixed.
4008
- - In the logs of `cds serve` false warnings on SAP Fiori Elements requests are now gone.
4009
- - `cds serve` no longer fails on localization for unbound actions.
4010
- - The project template was fixed to properly wire up the connection to SAP HANA.
4011
-
4012
- ## Also see
4013
- - Changes of `@sap/cds-compiler` 1.8.1
4014
- - Changes of `@sap/cds-ql` 1.5.1
4015
- - Changes of `@sap/cds-services` 1.5.2
4016
- - Changes of `@sap/generator-cds` 2.3.7
4017
-
4018
-
4019
-
4020
- # Version 3.5.0 - 2019-02-07
4021
-
4022
- ## Added
4023
- - `cds compile -2 xsuaa` now generates default values for `xsappname` and `tenant-mode`
4024
- - All commands now can be called with `--help`, where previously only `cds help <command>` was allowed.
4025
-
4026
- ## Changed
4027
- - The minimum required Node.js version is now set more specifically to _8.9_ LTS. Previously, just Node.js 8 was mentioned.
4028
- - The `cds build/all` (experimental build command for Node.js) emits a warning for existing projects to add build task configuration. Watch out for such a warning in the console and follow its instructions.
4029
-
4030
- ## Fixed
4031
- - Service handlers are now also found on CF if CDS models are served from a `csn.json` file instead as from `.cds` sources.
4032
- - An issue where projects w/o `db` dir could not be built using `cds build`.
4033
- - Unclear documentation of `cds deploy` on where it looks up the data source.
4034
- - `cds env` to load configuration profiles in lower-prio files (`.cdsrc.json`) with higher precedence than default configuration in higher-prio files (`package.json`).
4035
-
4036
- ## Also see
4037
- - Changes of `@sap/cds-compiler` 1.8.0
4038
- - Changes of `@sap/cds-reflect` 2.3.0
4039
- - Changes of `@sap/cds-ql` 1.5.0
4040
- - Changes of `@sap/cds-services` 1.5.0
4041
- - Changes of `@sap/generator-cds` 2.3.6
4042
-
4043
-
4044
- # Version 3.4.1 - 2019-01-24
4045
-
4046
- ## Fixed
4047
-
4048
- - Restore cds-compiler `.version`
4049
-
4050
- ## Also see
4051
- - Changes of `@sap/cds-compiler` 1.7.1
4052
- - Changes of `@sap/cds-reflect` 2.2.1
4053
- - Changes of `@sap/cds-ql` 1.4.0
4054
- - Changes of `@sap/cds-services` 1.4.0
4055
- - Changes of `@sap/generator-cds` 2.2.0
4056
-
4057
-
4058
- # Version 3.4.0 - 2019-01-22
4059
-
4060
- ## Added
4061
-
4062
- - `cds.env` supports loading from `default-env.json`
4063
- - Support base models for `cds compile -2 xsuaa`
4064
-
4065
- ## Also see
4066
- - Changes of `@sap/cds-compiler` 1.7.0
4067
- - Changes of `@sap/cds-reflect` 2.2.0
4068
- - Changes of `@sap/cds-ql` 1.4.0
4069
- - Changes of `@sap/cds-services` 1.4.0
4070
- - Changes of `@sap/generator-cds` 2.2.0
4071
-
4072
-
4073
- # Version 3.3.0 - 2019-01-11
4074
-
4075
- ## Also see
4076
- - Changes of `@sap/cds-compiler` 1.6.0
4077
- - Changes of `@sap/cds-reflect` 2.1.0
4078
- - Changes of `@sap/cds-ql` 1.3.0
4079
- - Changes of `@sap/cds-services` 1.3.0
4080
- - Changes of `@sap/generator-cds` 2.2.0
4081
-
4082
-
4083
- # Version 3.2.0 - 2018-12-21
4084
- ## Changed
4085
- - cdsc 2sql output may also contain .types
4086
- - Add labels to CodeLists in common.cds
4087
- - Improved cds error messages
4088
-
4089
- ## Also see
4090
- - Changes of `@sap/cds-compiler` 1.6.0
4091
- - Changes of `@sap/cds-reflect` 2.1.0
4092
- - Changes of `@sap/cds-ql` 1.2.0
4093
- - Changes of `@sap/cds-services` 1.2.0
4094
- - Changes of `@sap/generator-cds` 2.2.0
4095
-
4096
-
4097
- # Version 3.1.1 - 2018-12-13
4098
- ## Changed
4099
- - Better console output from cds compile
4100
-
4101
- ## Fixed
4102
- - cds.compile ignored configured odata.version
4103
-
4104
- ## Also see
4105
- - Changes of `@sap/cds-compiler` 1.6.0
4106
- - Changes of `@sap/cds-reflect` 2.1.0
4107
- - Changes of `@sap/cds-ql` 1.1.0
4108
- - Changes of `@sap/cds-services` 1.1.0
4109
- - Changes of `@sap/generator-cds` 2.2.0
4110
-
4111
-
4112
- # Version 3.0.0
4113
- ## Changed
4114
- - Reworked configuration options to center around required 'data sources'.
4115
- - As an example see the snippted that e.g. `cds deploy --to sqlite:my.db` generates into `package.json`.
4116
- - The former `cds` options from `package.json` are deprectated but still supported.
4117
- - Clean up of many Node.js APIs, mainly for `cds.serve` and `cds.connect`. See the [Javacript APIs documentation](https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/a131984aefe94ff884e6b6819ee76bd9.html) for details.
4118
- - Node.js 8 is now the minimum required runtime version.
4119
- - Simplified `cds init`. By default it creates a plain project suitable for local CDS development.
4120
-
4121
- ## Added
4122
- - `cds env` allows for inspecting the effective configuration
4123
-
4124
- ## Also see
4125
- - Changes of `@sap/cds-compiler` 1.5.0
4126
- - Changes of `@sap/cds-reflect` 2.0.0
4127
- - Changes of `@sap/cds-ql` 1.0.0
4128
- - Changes of `@sap/cds-services` 1.0.0
4129
- - Changes of `@sap/generator-cds` 2.0.0
4130
-
4131
-
4132
- # Version 2.11.2
4133
- ## Fixes
4134
- - During `cds init/new` only install `@sap/generator-cds` 1.x
4135
-
4136
-
4137
- # Version 2.11.0
4138
- ## Added
4139
- - Reuse aspect `cuid` to `@sap/cds/common`
4140
- - Support for smart to-many Associations finding backlinks automatically (&rarr;not for production!)
4141
- - Support to fill DBs with initial data from CSV files (fetched from folder `db/csv/`)
4142
- - New CLI command `cds run` - today a mere wrapper for `cds serve all` but meant to serve microservice test scenarios
4143
- - `cds deploy` can be configured not to modify `package.json` through the `--no-save` option.
4144
-
4145
- ## Also see
4146
- - Changes of `@sap/cds-compiler` 1.2.0
4147
- - Changes of `@sap/cds-reflect` 1.8.0
4148
- - Changes of `@sap/cds-ql` 0.12.0
4149
- - Changes of `@sap/cds-services` 0.12.0
4150
-
4151
-
4152
- # Version 2.10.3
4153
- ## Fixes
4154
- - During `cds init/new` only install `@sap/generator-cds` 1.x
4155
-
4156
-
4157
- # Version 2.10.0
4158
- ## Added
4159
- - Support for Fiori Draft
4160
-
4161
- ## Fixes
4162
- - Enhanced server.js to also include links to entities
4163
-
4164
- ## Also see
4165
- - Changes of `@sap/cds-compiler` 1.1.3
4166
- - Changes of `@sap/cds-reflect` 1.7.0
4167
- - Changes of `@sap/cds-ql` 0.11.0
4168
- - Changes of `@sap/cds-services` 0.11.0
4169
-
4170
-
4171
- # Version 2.9.1
4172
- ## Fixes
4173
- - `cds build` no longer blocks if running inside a Maven build.
4174
-
4175
-
4176
- # Version 2.9.0
4177
- ## Added
4178
- - `common.cds` model got annotations for title, description, and value lists.
4179
- - `cds` executable now can read from stdin, e.g. `echo 'entity Foo {ID:UUID;}' | cds -2 sql`
4180
- - `cds -2 sql` now outputs plain (non-HANA) SQL. Use `-2 hana` for HANA SQL.
4181
- - `cds config` shows the current CDS configuration. Use `cds help config` to learn more.
4182
-
4183
- ## Fixes
4184
- - Entities from `common.cds` like `Languages`, `Countries`, and `Currencies` are now only persisted to the database if they are actually used.
4185
-
4186
- ## Also see
4187
- - Changes of `@sap/cds-compiler` 1.1.2
4188
- - Changes of `@sap/cds-reflect` 1.6.0
4189
- - Changes of `@sap/cds-ql` 0.10.0
4190
- - Changes of `@sap/cds-services` 0.10.1
4191
-
4192
-
4193
- # Version 2.8.0
4194
- ## Added
4195
- - Support was added to build node.js service modules
4196
- - `cds init` has been reimplemented with a better commandline experience, along with updated templates. Plugin `@sap/generator-cds`, which is required for `cds init`, is now automatically installed when `init` is called for the first time. `cds new` is still available and is now just a synonym for `init`.
4197
-
4198
- ## Also see
4199
- - Changes of `@sap/cds-compiler` 1.1.1
4200
- - Changes of `@sap/cds-services` 0.9.0
4201
- - Changes of `@sap/cds-ql` 0.9.0
4202
-
4203
-
4204
- # Version 2.7.0
4205
- ## Also see
4206
- - Changes of `@sap/cds-compiler` 1.0.32
4207
- - Changes of `@sap/cds-services` 0.8.1
4208
- - Changes of `@sap/cds-ql` 0.8.1
4209
-
4210
-
4211
- # Version 2.6.0
4212
- ## Also see
4213
- - Changes of `@sap/cds-compiler` 1.0.31
4214
- - Changes of `@sap/cds-services` 0.7.0
4215
- - Changes of `@sap/cds-ql` 0.7.0
4216
-
4217
-
4218
- # Version 2.5.1
4219
- ## Also see
4220
- - Changes of `@sap/cds-services` 0.6.0
4221
- - Changes of `@sap/cds-ql` 0.6.0
4222
-
4223
-
4224
- # Version 2.5.0
4225
- ## Added
4226
- - Instead of compiling each `.cds` service file separately, `cds build` now combines all those files from the same folder, creating only one `csn.json` file for them.
4227
-
4228
- ## Fixes
4229
- - Shortcuts of `cds init` work again
4230
-
4231
- ## Also see
4232
- - Changes of `@sap/cds-compiler` 1.0.30
4233
- - Changes of `@sap/cds-services` 0.5.0
4234
- - Changes of `@sap/cds-ql` 0.5.0
4235
-
4236
-
4237
- # Version 2.4.2
4238
- Same as version 2.3.2, but including the generic service provider for Node.js (`@sap/cds-services` and `@sap/cds-ql`).
4239
-
4240
-
4241
- # Version 2.3.2
4242
- ## Changed
4243
- - The default for SQL name mapping is changed to `plain`. This means that
4244
- - The name of a table/view in the database catalog is obtained from the name of the corresponding entity in the CDS model in the following way:
4245
- - replace all "." by "_"
4246
- - convert everything to upper case
4247
- - The name of a table/view column in the database catalog is obtained from the name of the corresponding entity element in the csn in the following way:
4248
- - convert everything to upper case
4249
-
4250
- Note that this is a breaking change for appliations that rely on the previous value of `quoted`. In order to get this value back, add the following to `package.json`: `"cds": { "data": { "sql_mapping" : "quoted" } }`
4251
-
4252
- ## Fixes
4253
- - Special output formatting in CLI is only done for `cds eval` and `cds repl`, but not for programmatic usage.
4254
- - Links to external documentation are now point to correct help documents.
4255
-
4256
- ## Also see
4257
- - Changes of `@sap/cds-compiler` 1.0.30
4258
-
4259
-
4260
-
4261
- # Version 2.3.0
4262
- ## Added
4263
- - SQL names can now be configured with `{ data: {sql_mapping: "plain/quoted"} }`. Default is `quoted`, but will be changed to `plain` soon. If you need to stay with `quoted` in the futute, e.g. due to data compatibility reasons, you can configure this mode already now.
4264
-
4265
- ## Fixes
4266
- - The `csn.json` file produced by `cds build` now contains the properly unfolded model for OData. Previously this was the normalized model, which led to runtime errors in the Java service provider.
4267
- - Invalid configuration data in `package.json` now leads to a build error again.
4268
- - Console output of `cds build` now presents files paths sorted.
4269
-
4270
- ## Also see
4271
- - Changes of CDS compiler 1.0.27
4272
-
4273
-
4274
-
4275
- # Version 2.2.0
4276
- ## Added
4277
- - CDS configuration in `package.json` can now be omitted if you follow the standard project layout, i.e. if you place your model files in `db/`, `srv/`, and `app/` folders.
4278
-
4279
- ## Changed
4280
- - Previously data models needed to include import statements to the service models (e.g. `using from '../srv'`), so that the Java runtime could use these service views on the DB to execute queries. The views are now included automatically, so that you can remove the explicit `using` clauses.
4281
- - Calling just `cds` on the command line now prints its help. The previously started REPL is now available with `cds repl` (or just `cds r`).
4282
-
4283
- ## Fixes
4284
- - Some cds commands failed on Windows. This is fixed.
4285
-
4286
- ## Also see
4287
- - Changes of CDS compiler 1.0.24
4288
-
4289
-
4290
-
4291
- # Version 2.1.0
4292
- ## Added
4293
- - Service edmx files are now written to UI app folders if their manifest.json contains a reference to the service. This allows Web IDE's annotation modeler to work on up to date service files.
4294
- - The results of `cds.compile.to...` commands are now automatically formatted if called in `cds -e...` or cds repl. You don't need to append `console.log` to the call chain.
4295
-
4296
- ## Fixes
4297
- - Language properties are now found in all folders, also ones that are outside of the current module
4298
- - csn.json is written with line breaks and indentation
4299
-
4300
- ## Also see
4301
- - Changes of CDS compiler 1.0.21
4302
-
4303
-
4304
- # Version 2.0.0
4305
- ## Added
4306
- - All-new command-line interface. See `cds help` for information on the available commands.
4307
- - `cds compile` exposes CDS model transformations with various options.
4308
- - `cds build` automatically writes localized edmx files.
4309
- - `cds build` now writes the version to the build log.
4310
- - `cds version` does the usual thing.
4311
- - `cds init` scaffolds CDS projects.
4312
- - CDS repl (read-eval-print-loop): just type `cds` and play with CDS API.
4313
-
4314
- ## Fixes
4315
- Too many to mention :)
4316
-
4317
- ## Also see
4318
- - Changes of CDS compiler 1.0.19