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