@sap/cds 7.2.1 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +161 -126
  2. package/README.md +1 -1
  3. package/apis/core.d.ts +6 -4
  4. package/apis/services.d.ts +24 -4
  5. package/apis/test.d.ts +24 -10
  6. package/bin/serve.js +4 -3
  7. package/lib/auth/ias-auth.js +7 -8
  8. package/lib/compile/cdsc.js +5 -7
  9. package/lib/compile/etc/csv.js +22 -11
  10. package/lib/dbs/cds-deploy.js +1 -2
  11. package/lib/env/cds-env.js +26 -20
  12. package/lib/env/defaults.js +4 -3
  13. package/lib/env/schema.js +9 -0
  14. package/lib/i18n/localize.js +83 -77
  15. package/lib/index.js +6 -2
  16. package/lib/linked/classes.js +13 -13
  17. package/lib/plugins.js +41 -45
  18. package/lib/req/user.js +2 -2
  19. package/lib/srv/protocols/_legacy.js +0 -1
  20. package/lib/srv/protocols/odata-v4.js +4 -0
  21. package/lib/utils/axios.js +7 -1
  22. package/lib/utils/cds-test.js +140 -133
  23. package/lib/utils/cds-utils.js +1 -1
  24. package/lib/utils/check-version.js +6 -0
  25. package/lib/utils/data.js +19 -6
  26. package/libx/_runtime/cds-services/adapter/odata-v4/OData.js +20 -19
  27. package/libx/_runtime/cds-services/adapter/odata-v4/handlers/action.js +10 -1
  28. package/libx/_runtime/cds-services/adapter/odata-v4/handlers/error.js +1 -1
  29. package/libx/_runtime/cds-services/adapter/odata-v4/handlers/request.js +2 -3
  30. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-commons/utils/ValueConverter.js +0 -14
  31. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/core/OdataRequest.js +1 -0
  32. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/deserializer/BatchRequestListBuilder.js +5 -2
  33. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/handler/MetadataHandler.js +1 -1
  34. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/handler/ServiceHandler.js +1 -1
  35. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/invocation/DispatcherCommand.js +2 -2
  36. package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/utils/BufferedWriter.js +1 -3
  37. package/libx/_runtime/cds-services/adapter/odata-v4/utils/metaInfo.js +1 -1
  38. package/libx/_runtime/common/composition/update.js +18 -2
  39. package/libx/_runtime/common/error/frontend.js +46 -34
  40. package/libx/_runtime/common/generic/auth/capabilities.js +33 -14
  41. package/libx/_runtime/common/generic/input.js +1 -1
  42. package/libx/_runtime/common/utils/cqn2cqn4sql.js +3 -3
  43. package/libx/_runtime/db/query/update.js +48 -30
  44. package/libx/_runtime/fiori/lean-draft.js +2 -3
  45. package/libx/_runtime/hana/conversion.js +3 -2
  46. package/libx/_runtime/messaging/enterprise-messaging-utils/getTenantInfo.js +1 -1
  47. package/libx/_runtime/messaging/outbox/utils.js +1 -1
  48. package/libx/_runtime/remote/Service.js +1 -17
  49. package/libx/_runtime/remote/utils/client.js +3 -3
  50. package/libx/_runtime/remote/utils/data.js +5 -7
  51. package/libx/odata/{grammar.pegjs → grammar.peggy} +1 -1
  52. package/libx/odata/metadata.js +121 -0
  53. package/libx/odata/parser.js +1 -1
  54. package/libx/odata/service-document.js +61 -0
  55. package/libx/odata/utils.js +102 -48
  56. package/libx/rest/RestAdapter.js +2 -2
  57. package/libx/rest/middleware/error.js +1 -1
  58. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,36 @@
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 7.3.0 - 2023-10-04
8
+
9
+ ### Added
10
+
11
+ - `cds.localized` now caches i18n bundles per locale and per model to speed up repeated usages of the same bundle at runtime, for example, in repeated calls to `cds.compile.for.edmx()`.
12
+ - Based on `cds.localized` with cached bundles, a new operation `cds.localized.lookup(i18n_key, locale)` is provided.
13
+ - If env variable `CDS_TEST_ENV_CHECK` is set, `cds.test.in()` detects if `cds.env` was loaded before from a different folder.
14
+ - `cds.test.log()` allows to capture and analyse any console log output. `cds.test.verbose()` is now deprecated.
15
+ - Typings for `cds.tx`
16
+ - Add method `cds.schema.default4(schemaId)` to retrieve json schema based on its id
17
+ - Support for pseudo role `internal-user` with authentication kind `ias`
18
+ - CSV files with multiline values, i.e. line breaks, are now supported with `cds deploy`
19
+
20
+ ### Changed
21
+
22
+ - If ommitted in the accept header, `ExponentialDecimals` no longer gets defaulted (to `true`), which violated the OData 4.0 specification.
23
+ This change can _temporarily_ be overridden via `cds.env.odata.defaultExponentialDecimals = 'true/false'`.
24
+ - Make type signature of `extend.with` more general
25
+ - `cds.test.data.autoReset()` is deprecated in favor of explicit `cds.test.data.reset()` call, like `beforeEach (test.data.reset)`.
26
+ - `cds.utils.uuid()` now uses `randomUUID` function of node `crypto` module instead of `uuid` package
27
+ - `@Capabilities` restrictions defined on entity level are also applied if navigating to the entity. Restrictions defined directly on the navigation now override restrictions defined on the target entity.
28
+
29
+ ### Fixed
30
+
31
+ - Draft: activate managed fields were miscalculated in some cases
32
+ - Error with `exists` predicate in `@restrict.where` when calling compositions
33
+ - `IsActiveEntity` in error target for lean draft
34
+ - Remote Service: OData v2 compliant representation of Edm.Decimal, Edm.Double, and Edm.Int64 in URL
35
+ - In draft activate managed fields were calculated wrongly in some cases
36
+ - On draft save, missing entries in `req.headers`
7
37
 
8
38
  ## Version 7.2.1 - 2023-09-21
9
39
 
@@ -24,11 +54,11 @@
24
54
  - Typescript definition for:
25
55
  - The `cds.exit()` method.
26
56
  - The `label` option parameter in the `cds.log()` API. For example: `cds.log('log message', { label: 'adapter' }`.
27
- - `@restrict` annotations can now prevent the creation of drafts([see documentation](https://pages.github.tools.sap/cap/docs/guides/authorization#restrictions-and-draft-mode))
57
+ - A variant of the `roles` property of the `cds.User` class.
58
+ - `@restrict` annotations can now prevent the creation of drafts ([see documentation](https://cap.cloud.sap/docs/guides/authorization#restrictions-and-draft-mode))
28
59
  - JSON Schema validation for `cds.requires.multitenancy.jobs` settings.
29
- - Managed associations to-one with exactly one foreign key can now have a default value.
30
- - Skip Okra's parsing of query options via experimental feature flag `cds.env.features.okra_skip_query_options = true`.
31
- Only allowed in combination with new OData parser, i.e., `cds.env.features.odata_new_parser = true`.
60
+ - Managed associations to one with exactly one foreign key can now have a default value.
61
+ - Experimental feature flag `cds.env.features.okra_skip_query_options`. This feature allows you to bypass the parsing of query options by the legacy OData V4 Server (Okra). Please note that this feature can only be utilized in conjunction with the new OData parser, which is activated by setting the feature flag `cds.env.features.odata_new_parser = true`.
32
62
  - Support for `@requires: 'any'` to make service public, i.e., no authenticated user is required
33
63
 
34
64
  ### Changed
@@ -36,9 +66,10 @@
36
66
  - The built-in `java` profile sets `build.target` to `.` by default
37
67
  - Decimals from query options (e.g., `$filter`) are represented as strings in CQN
38
68
  - Improve error message for unsupported transformations with `$apply`
39
- - For database dialect H2, specialized localized views for languages `de` and `fr` are no longer generated.
40
- - Authentication kinds `jwt`, `xsuaa`, and `ias` throw an error during bootstrapping if the necessary credentials are not available.
41
- Previously, a warning was logged and authentication was skipped.
69
+ - For database dialect H2, specialized, localized views for languages `de` and `fr` are no longer generated.
70
+ - Authentication kinds `jwt`, `xsuaa`, and `ias` throw an error during bootstrapping if the necessary credentials are
71
+ unavailable.
72
+ Previously, a warning was logged, and authentication was skipped.
42
73
  See `cds bind`/ Hybrid Testing in CAPire for how to combine local development and cloud resources.
43
74
  - The Typescript definitions now make use of the default export.
44
75
 
@@ -46,25 +77,27 @@
46
77
 
47
78
  - Trace middleware: Adapted usage of `performance.now()` for Node 20.
48
79
  - Draft: Associations to non-draft enabled entities must never point to drafts
49
- - Avoid type error in old db post processing
50
- - `<remote-srv>.run('/arbitrary-url')` properly defaults to a get request and does not add request body
80
+ - Avoided type error in old db post-processing
81
+ - `<remote-srv>.run('/arbitrary-url')` now defaults to a get request and doesn't add request body
51
82
  - `@cds.query.limit` is cached per projection
52
83
  - Application crash for incorrect usage of REST-style API to run queries
53
84
  - The `@requires` annotation on entity level didn't get applied to bound operations
54
- - `cds.test` run with a profile parameter such as `cds.test('run', '--profile', 'integration-tests')` will use the correct profile.
85
+ - `cds.test` run with a profile parameter such as `cds.test('run', '--profile', 'integration-tests')` will use the
86
+ correct profile.
55
87
  - `cds.env.requires.auth.restrict_all_services = false` in combination with `cds.env.requires.middlewares = true` (the default)
56
88
 
57
89
  ## Version 7.1.2 - 2023-08-11
58
90
 
59
91
  ### Fixed
60
92
 
61
- - `req.tenant` is undefined when using new OData parser
62
- - Draft: replace some occurrences of the `arr.push(...largeArray)` pattern when copying large arrays to prevent maximum call stack size exceeded errors due to large deep update processing when saving the draft
63
- - Do not add keys to diff as they could be renamed (which leads to SQL error)
64
- - Custom bound actions for draft-enabled entities don't trigger a READ request on application service anymore
93
+ - `req.tenant` is undefined when using the new OData parser
94
+ - Draft: Replace some occurrences of the `arr.push(...largeArray)` pattern when copying large arrays to prevent maximum
95
+ call stack size exceeded errors due to large deep update processing when saving the draft
96
+ - Keys are no longer added to the diff as they could be renamed, leading to SQL errors
97
+ - Custom-bound actions for draft-enabled entities don't trigger a READ request on application service anymore
65
98
  - `cds.connect.to('db', options)`: add-hoc options for SAP HANA Database Service
66
99
  - Reading key-less singleton with `$select` clause while using the new OData parser `cds.env.features.odata_new_parser`
67
- - Don't use colored logs if `process.env.NO_COLOR` is set or not logging to a terminal (i.e., `!process.stdout.isTTY || !process.stderr.isTTY`)
100
+ - Avoided using colored logs if process.env.NO_COLOR is set or not logging to a terminal (i.e., `!process.stdout.isTTY || !process.stderr.isTTY`)
68
101
 
69
102
  ## Version 7.1.1 - 2023-08-01
70
103
 
@@ -78,7 +111,7 @@
78
111
 
79
112
  ### Added
80
113
 
81
- - Enable PDF export via GET to collection with accept header `appplication/pdf`.
114
+ - Enable PDF export via GET to collection with accept header `application/pdf`.
82
115
  Custom handler must return the following:
83
116
  ```
84
117
  {
@@ -105,26 +138,27 @@
105
138
  to: ['authenticated-user']
106
139
  }])
107
140
  ```
108
- - Support for resolving of experimental `STREAM` CQN queries that point to views
141
+ - Support for resolving experimental `STREAM` CQN queries that point to views
109
142
 
110
143
  ### Fixed
111
144
 
112
- - Multiple TypeScript improvements
145
+ - Multiple TypeScript fixes/improvements
113
146
  - Proper handling for `expand=*` for OData URL to CQN parser (`cds.env.features.odata_new_parser`)
114
- - Fully qualified operation names are correctly resolved in rest adapter
115
- - Log level for odata metadata cache was not handled correctly
147
+ - Corrected the resolution of fully qualified operation names in the REST adapter.
148
+ - Log level for OData metadata cache was not handled correctly
116
149
  - Protocol paths are normalized to always have a leading slash
117
150
  - `@odata` shortcut for `odata-v4` protocol with custom configuration
118
- - Default protocol is `odata-v4`, independent of the order in `cds.env.protocols`
119
- - Data is not logged for GET and DELETE remote requests
151
+ - Set default protocol to `odata-v4`, independent of the order in `cds.env.protocols`
152
+ - Now data is correctly logged for `GET` and `DELETE` remote requests
120
153
  - draft: deep update without change should not update the `modifiedAt` field
121
154
  - Lean draft: do not propagate `@Capabilities.NavigationRestrictions.RestrictedProperties`
122
- - Commit db transaction only once outbound streaming has ended
155
+ - Commit database transactions only once outbound streaming has ended
123
156
  - Lean draft: deactivate legacy `drafts` getter
124
- - Updated typings for srv.send
157
+ - Updated typings for `srv.send()`
125
158
  - `$search`: exclude calculated fields/expressions from default search in projection of projections
126
- - Immutable properties are always removed from payload during UPDATE
127
- - `serviceinfo.urlPath` contains the first endpoint of the service (cf. `srv.endpoints`), which is the legacy path if `cds.env.features.serve_on_root === true`
159
+ - Immutable properties are always removed from payload during `UPDATE`
160
+ - `serviceinfo.urlPath` contains the first endpoint of the service (cf. `srv.endpoints`), which is the legacy path if
161
+ `cds.env.features.serve_on_root === true`
128
162
 
129
163
  ## Version 7.0.3 - 2023-07-19
130
164
 
@@ -136,7 +170,7 @@
136
170
  - `SELECT.one.localized`
137
171
  - `COPYFILE_DISABLE=1` is now set for building `tar` archives by default
138
172
  - Actions of projection target are no longer accessible in linked models
139
- - Batch execute model-less mass inputs when on `@sap/hana-client`
173
+ - Batch executes model-less mass inputs when on `@sap/hana-client`
140
174
  - Requests to `/<path>/webapp` return 404 for absolute `@path` specifications
141
175
  - `cds compile --to serviceinfo` no longer returns paths w/ Windows `\` path characters
142
176
 
@@ -153,48 +187,49 @@
153
187
 
154
188
  ### Fixed
155
189
 
156
- - Feature toggle detection in single tenant mode
190
+ - Feature toggle detection in single-tenant mode
157
191
  - Log output for OData $batch requests
158
- - Avoid "catastrophic backtracking" issue in okra's tokenizer
192
+ - Avoid "catastrophic backtracking" issue in Okra's (OData V4 server) tokenizer
159
193
  - Transaction marked as committed too early
160
194
 
161
195
  ## Version 7.0.0 - 2023-06-21
162
196
 
163
197
  ### Added
164
198
 
165
- - Handling of expand with multiple `*` (e.g. $expand=*,*) in new parser. When using `*` in an expand the new OData parser now removes all unneeded `*`.
199
+ - Handling of expand with multiple `*` (e.g. `$expand=*,*`) in new parser. When using `*` in an `$expand`, the new OData
200
+ parser now removes all unneeded `*`.
166
201
  - Tests run with `cds.test()` now also load `cds-plugins`
167
202
 
168
203
  ### Changed
169
204
 
170
- - Result of `READ` events is now always an array. Previously, it could be `null/undefined` (now empty array), single object (now array with one entry) or array.
205
+ - Result of `READ` events is now always an array. Previously, it could be `null/undefined` (now empty array), a single object (now array with one entry), or array.
171
206
  - OData: `PUT`/`PATCH` requests resulting in a new entity (i.e., the `UPSERT` effectively was an `INSERT`) return status code 201
172
207
  - Draft: Draft activate requests resulting in an `UPDATE` return status code 200
173
208
  - ETags are validated via `WHERE EXISTS` clause attached to query on `GET`, `PUT`/`PATCH`, and `DELETE`
174
209
  - OData: `PUT`/`PATCH` with `if-match` header prevents `UPSERT`, i.e., only an existing entity can be updated by such a request
175
210
  - Runtime support for `@sap/instance-manager` is removed in favor of the `cds-mtxs` Service Manager client.
176
- - In multitenant mode, the HANA pool uses the `cds-mtxs` credentials cache
211
+ - In multitenant mode, the SAP HANA pool uses the `cds-mtxs` credentials cache
177
212
  - Draft handlers are registered for all entities.
178
213
  - Decimals in client input are validated in runtime's assert framework (previously OData adapter)
179
214
  - `cds build` and `cds deploy --to hana` have moved to `@sap/cds-dk`. Upgrade `@sap/cds-dk` to version 7 to continue using these commands.
180
215
  - Changed the behavior of `SELECT` queries for single entities to return `undefined` instead of `null` when no record is found.
181
- - Fiori preview has moved to new `@sap/cds-fiori` module.
182
- - Numbers are now always used as placeholders in SQL, except for `SELECT 1 From...`, `LIMIT` and the comparison of two numeric values (e.g. `1 eq 1`).
216
+ - Fiori preview has moved to the new `@sap/cds-fiori` module.
217
+ - Numbers are now always used as placeholders in SQL, except for `SELECT 1 From...`, `LIMIT`, and the comparison of two numeric values (e.g., `1 eq 1`).
183
218
  - Only new major version 3 of SAP Cloud SDK is from now on supported. Please make sure to upgrade. Version 2 is not maintained anymore.
184
- - `@protocol` annotation can be used to serve multiple protocols per service.
185
- - Per default, services are served with a protocol-specific prefix (for example '/odata/v4' for a service using the OData V4 protocol). To also serve without this prefix, as it was the case in older @sap/cds versions, the flag `cds.env.features.serve_on_root` can be set to `true`. Alternatively, the `@path` annotation can be used to explicitely specify an absolute path (with a leading `/`).
219
+ - `@protocol` annotation can serve multiple protocols per service.
220
+ - Per default, services are served with a protocol-specific prefix (for example, '/odata/v4' for a service using the OData V4 protocol). To also serve without this prefix, as was the case in older `@sap/cds` versions, the flag `cds.env.features.serve_on_root` can be set to `true`. Alternatively, the `@path` annotation can be used to explicitly specify an absolute path (with a leading `/`).
186
221
  - `cds.requires.middlewares` is enabled by default.
187
- - The order of csv files that `cds deploy --to sqlite` uses now reflects the dependency order of cds models. This is needed if `UPSERT` is used to create a logically correct deployment.
188
- - `cds.fiori.lean_draft` is activated by default. You can still set it to `false` as fallback.
222
+ - The order of CSV files that `cds deploy --to sqlite` uses now reflects the dependency order of cds models. This is needed if `UPSERT` is used to create a logically correct deployment.
223
+ - `cds.fiori.lean_draft` is activated by default. You can still set it to `false` as a fallback.
189
224
 
190
225
  ### Fixed
191
226
 
192
227
  - UUID typed key properties are no longer automatically filled during UPSERT
193
228
  - OData: When undefined in the payload, requests for actions with not nullable array-type parameters result in a client-side error
194
- - Missing `GROUP BY` in request with $apply in combination with aggregate on restricted entity
195
- - When `@sap/cds` was not installed underneath project root, cds-plugins where not found
229
+ - Missing `GROUP BY` in request with `$apply` in combination with aggregate on restricted entity
230
+ - When `@sap/cds` was not installed underneath project root, cds-plugins were not found
196
231
  - Support for multiline texts in `properties` files
197
- - Error when reading auth protected entities with infix filter in expand
232
+ - Error when reading auth-protected entities with infix filter in expand
198
233
  - Glitch in transaction handling in case of concurrent async before handlers
199
234
 
200
235
  ### Removed
@@ -208,7 +243,7 @@
208
243
  - Internal `req.getUriInfo()` and `req.getUrlObject()`
209
244
  - `cds deploy --to hana` is now part of `@sap/cds-dk`.
210
245
  - Deprecated compat mode `cds.env.features.cds_tx_protection = false`
211
- - Beta `AuditLogService` and out-of-the-box audit logging. Use plugin `@cap-js/audit-logging` instead.
246
+ - Beta `AuditLogService` and out-of-the-box audit logging. Use the plugin `@cap-js/audit-logging` instead.
212
247
 
213
248
  ## Version 6.8.4 - 2023-06-14
214
249
 
@@ -233,7 +268,7 @@
233
268
  - Nested `$expand` OData query to the `texts` compiler-generated composition for entities with localized elements.
234
269
  For example, similar OData requests `Entity?$expand=items($expand=item($expand=texts))` now should work as expected.
235
270
  - `req.subject` would occasionally be incorrect when a query had been executed prior to it.
236
- - cds plugins are also fetched from `devDependencies`
271
+ - cds plugins are also fetched from the development dependencies (`devDependencies`) section in `package.json`
237
272
  - `cds build` now correctly resolves complex models of mtx extension projects
238
273
 
239
274
  ## Version 6.8.1 - 2023-05-04
@@ -247,12 +282,12 @@ For example, similar OData requests `Entity?$expand=items($expand=item($expand=t
247
282
  ### Added
248
283
 
249
284
  - Global cds-dk version is now included in tabular output of `cds v -i`.
250
- - Audit logging support for OAuth2 Plan
251
- - Feature flag to limit the max number of requests in a Odata batch request. The max number can be specified with a number in `cds.odata.batch_limit`.
285
+ - Audit logging support for the OAuth2 Plan
286
+ - 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`.
252
287
  - Custom authentication in `enterprise-messaging`
253
288
  - Requests with lambda expressions are rejected by remote services of kind `odata-v2`
254
289
  - `cds build` ignores invalid entries in `undeploy.json`
255
- - 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.
290
+ - 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.
256
291
  - 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.
257
292
  - Plugins are now also fetched from `devDependencies`, unless `NODE_ENV === 'production'`
258
293
  - Plugins can now provide `cds` configurations in their package.json.
@@ -261,30 +296,30 @@ For example, similar OData requests `Entity?$expand=items($expand=item($expand=t
261
296
  ### Changed
262
297
 
263
298
  - Texts for _Country_ are changed to _Country/Region_ in `@sap.common.Countries`
264
- - Resolved issue where selection strategies of destination options in multitenant applications were not working correctly, resulting in runtime errors.
299
+ - Resolved an issue where selection strategies of destination options in multitenant applications were not working correctly, resulting in runtime errors.
265
300
  The fix relies on the `@sap-cloud-sdk/connectivity` npm package to be installed.
266
301
  - Precision of timestamp used in outbox message increased to 100 nanoseconds (`YYYY-MM-DD hh:mm:ss.nnnnnnn`)
267
- - When a draft is locked by another user, the error message now includes the username of that user
302
+ - When another user locks a draft, the error message now includes the username of that user
268
303
 
269
304
  ### Fixed
270
305
 
271
- - fix exported types of the `cds` core API
306
+ - Fix exported types of the `cds` core API
272
307
  - cds build uses the correct path if no project dir is given
273
- - Read after write for updates on to-one navigation
308
+ - Read after write for updates on-to-one navigation
274
309
  - Error in $orderBy in combination with @Core.MediaType property
275
310
  - Fixes in lean-draft
276
311
  - Fixed an issue where the combined `$search` and `$expand` query and localized data was returning empty results on SAP HANA
277
312
  - Tests using `cds.test` no longer crash with a segmentation fault if `injectGlobals: false` is set in the Jest configuration.
278
- - Handlers registered with `cds.on('shutdown')` are now called with an `err` argument in case the shutdown happened in response to uncaught exceptions or unhandled rejected Promises.
279
- - Log output on uncaught exceptions or unhandled rejected Promises now is done via `cds.log` instead of `console`.
280
- - 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.
313
+ - 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.
314
+ - Log output on uncaught exceptions, or unhandled rejected Promises now is done via `cds.log` instead of `console`.
315
+ - 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.
281
316
  - Require custom auth relative to project root when using pluggable middlewares
282
317
 
283
318
  ## Version 6.7.2 - 2023-04-24
284
319
 
285
320
  ### Fixed
286
321
 
287
- - Try to destroy nonexistant socket in case of custom streaming implementation
322
+ - Try to destroy nonexistent socket in case of custom streaming implementation
288
323
  - Draft: Missing field `IsActiveEntity` in target path of error messages during `draftActivate`
289
324
  - Minor fixes for `cds.fiori.lean_draft`
290
325
  - Error in media type check when no `Content-Type` header is found
@@ -306,7 +341,7 @@ The fix relies on the `@sap-cloud-sdk/connectivity` npm package to be installed.
306
341
 
307
342
  ### Added
308
343
 
309
- - Config `cds.ql.quirks_mode` as a compatibility flag to still support behaviours which are undocumented, or even against the specifications, for example CQN:
344
+ - Config `cds.ql.quirks_mode` as a compatibility flag to still support behaviors which are undocumented or even against the specifications, for example, CQN:
310
345
  ```js
311
346
  let q = INSERT.into('Books')
312
347
  //> According to CQN spec should return:
@@ -318,7 +353,7 @@ The fix relies on the `@sap-cloud-sdk/connectivity` npm package to be installed.
318
353
  - `cds build` now checks extension point restrictions defined by the SaaS app provider. `cds build` fails if any restrictions are violated.
319
354
  - Typings for `cds.spawn()`
320
355
  - Typings for `entity.drafts`
321
- - Typings for winston logger
356
+ - Typings for Winston logger
322
357
  - Typings for `cds.context`
323
358
  - Typings for `service.on`, `service.before`, and `service.after` for actions and CRUD events
324
359
  - CLI command `cds env` now allows property paths with `/` instead of `.`, which allows usages like that:
@@ -326,7 +361,7 @@ The fix relies on the `@sap-cloud-sdk/connectivity` npm package to be installed.
326
361
  cds env requires/cds.xt.ModelProviderService
327
362
  ```
328
363
  - `cds.env` now allows to statically set/add profiles via `cds.profile` and `cds.profiles` in package.json.
329
- - `cds.env` now also supports using profiles in definitions of presets, i.e., in `cds.requires.kinds`.
364
+ - `cds.env` now also supports using profiles in preset definitions, i.e., in `cds.requires.kinds`.
330
365
  - `cds deploy` prints a warning when using Cloud Foundry client version less than 8.
331
366
  - `req.subject` to conveniently operate on the subjects targeted by the request. Example usage:
332
367
  SELECT.one.from(req.subject) //> returns single
@@ -339,8 +374,8 @@ cds env requires/cds.xt.ModelProviderService
339
374
 
340
375
  - CQL types now attach additional functionality to entities where appropriate
341
376
  - `cds.log().trace()` now logs stack traces in `DEBUG` level, before that was on `TRACE`/`SILLY` level only
342
- - Plain SQL queries now have `req.event === undefined`, formerly this had non-deterministic values.
343
- - Plain SQL queries don't allow to register custom handlers, other than for event `'*'`.
377
+ - Plain SQL queries now have `req.event === undefined`. Formerly this had non-deterministic values.
378
+ - Plain SQL queries don't allow registering custom handlers, other than for event `'*'`.
344
379
  - Plain SQL queries are only supported on database services, not on application services.
345
380
  - CQN representation of `columns=*` is not allowed anymore, instead `columns=['*']` should be used. This also applies to expand.
346
381
  - Only draft roots can be created via direct, non-navigation OData `POST` requests.
@@ -349,19 +384,19 @@ cds env requires/cds.xt.ModelProviderService
349
384
 
350
385
  ### Fixed
351
386
 
352
- - Specifying a key in `SELECT.from(...)` is now typed to produce a single result, instead of an array of results
387
+ - Specifying a key in `SELECT.from(...)` is now typed to produce a single result instead of an array of results
353
388
  - Proper handling of `IsActiveEntity` in error paths
354
- - For cloudevents using AMQP, the type is set to `application/cloudevents+json`
389
+ - For cloud events using AMQP, the type is set to `application/cloudevents+json`
355
390
  - Use `message` property in typings.
356
391
  - Typings for `cds.on('bootstrap', app => {app.use(...)`
357
392
  - Return types for `User` and `delete` in typescript
358
393
  - Typings for connect options
359
394
  - Typings for `req.error`
360
395
  - Deployment in sidecar
361
- - Error with restricting an entity and request it with $apply in combination with aggregate
396
+ - Error with restricting an entity and requesting it with `$apply` in combination with aggregate
362
397
  - Combined usage of `$skiptoken` and `$skip`
363
398
  - Error `package.json file is missing` in mtx extension builds
364
- - CLI commands w/ unknown arguments (`cds --foo`) clearly fail again with a proper error message
399
+ - CLI commands w/ unknown arguments (`cds --foo`) fail again with a proper error message
365
400
 
366
401
  ## Version 6.6.2 - 2023-03-17
367
402
 
@@ -374,7 +409,7 @@ cds env requires/cds.xt.ModelProviderService
374
409
 
375
410
  ### Added
376
411
 
377
- - `cds.xt.TENANT_UPDATED` event is emitted once a tenant was extended
412
+ - `cds.xt.TENANT_UPDATED` event is emitted once a tenant is extended
378
413
 
379
414
  ### Fixed
380
415
 
@@ -395,21 +430,21 @@ cds env requires/cds.xt.ModelProviderService
395
430
 
396
431
  ### Changed
397
432
 
398
- - `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.
433
+ - `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.
399
434
  - Optimize `@cds.persistence.journal` filtering for `last-dev` CSN file.
400
435
 
401
436
  ### Fixed
402
437
 
403
- - `cds deploy --to hana` no longer calls `cds bind` when `VCAP_SERVICES` is provided, e.g via `default-env.json`.
438
+ - `cds deploy --to hana` no longer calls `cds bind` when `VCAP_SERVICES` is provided, for example, via `default-env.json`.
404
439
  - `$search` on an entity without String elements
405
440
  - Only elements from type `cds.String` are searchable when combining `$apply` and `$search`
406
441
  - Error message for missing database connection in draft case
407
442
  - Extensibility with in-memory Sqlite
408
443
  - OData adapter error messages
409
- - Columns in navigation path are now added to the SELECT.columns in new parser
410
- - Application service calls on draft enabled entities using aliases
444
+ - Columns in navigation path are now added to the SELECT.columns in the new parser
445
+ - Application service calls on draft-enabled entities using aliases
411
446
  - Custom mtxs build tasks now use the correct default `src` folder value.
412
- - `cds build` adds a `.hdiconfig` file when creating HANA migration tables if none is existing.
447
+ - `cds build` adds a `.hdiconfig` file when creating SAP HANA migration tables if none exists.
413
448
  - UPSERTs using reserved keywords
414
449
  - Fix outbound-streaming error handling
415
450
  - Rollback transaction if inbound streaming fails
@@ -417,15 +452,15 @@ cds env requires/cds.xt.ModelProviderService
417
452
  - Concurrent etag calculation for UPDATE and DELETE
418
453
  - Typings for `cds.delete()`
419
454
  - CQN for `not` operator with OData functions
420
- - Expand on composition of aspect for draft enabled entities
421
- - Better error messages are provided for errors with HTTP status code `400`, `500` and `501`
455
+ - Expand on composition of aspect for draft-enabled entities
456
+ - Better error messages are provided for errors with HTTP status codes `400`, `500`, and `501`
422
457
 
423
458
  ## Version 6.5.0 - 2023-01-27
424
459
 
425
460
  ### Added
426
461
 
427
462
  - New aspect `sap.common.TextsAspect` in common.cds
428
- - New syntax for collection bound entities
463
+ - New syntax for collection-bound entities
429
464
 
430
465
  ### Changed
431
466
 
@@ -434,10 +469,10 @@ cds env requires/cds.xt.ModelProviderService
434
469
  SELECT.from `X` .where `x` .or `y` .where `z`
435
470
  //> SELECT from X where (x or y) and z`
436
471
  ```
437
- - `cds build` for 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`.
438
- - `cds build` checks the consistency of built-in models for java projects. An error is logged if some model files could not successfully be resolved indicating that a required npm module might be missing.
472
+ - `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`.
473
+ - `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.
439
474
  - Status code of draft actions are set in respective handler instead of protocol adapter
440
- - `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.
475
+ - `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.
441
476
  - Internal representation of pseudo roles `internal-user` and `system-user`
442
477
 
443
478
  ### Fixed
@@ -445,7 +480,7 @@ cds env requires/cds.xt.ModelProviderService
445
480
  - Resolve i18n folders from the root directory
446
481
  - Types for `cds.test`
447
482
  - Types for `srv.send`
448
- - 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.
483
+ - 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.
449
484
  - Resolution of `type of` references during minify in bootstrap
450
485
  - Generation of odata-v2 URL in case of select=* in `urlify()`
451
486
  - Build resets changed `cds.env` and `cds.root` when finished
@@ -459,18 +494,18 @@ cds env requires/cds.xt.ModelProviderService
459
494
  ### Fixed
460
495
 
461
496
  - `cds build` correctly creates a `resources.tgz` file for MTXS projects on Windows
462
- - `cds.deploy` for 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`
497
+ - `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`
463
498
  - Signature for `cds.ql.UPSERT`
464
499
  - Signature for `<srv>.delete().where()`
465
500
  - Signature for `SELECT.alias`
466
501
  - `UPSERT` requests for SQLite if only keys are provided
467
- - `cds.test` doesn't log database resets with `autoReset` enabled any more
468
- - The `cds.deploy` output for HANA is now correctly formatted in Kibana
502
+ - `cds.test` doesn't log database resets with `autoReset` enabled anymore
503
+ - The `cds.deploy` output for SAP HANA is now correctly formatted in Kibana
469
504
  - SAP HANA stored procedures containing implicit selects
470
505
  - Shorthand configuration for `graphql` in `cds.env.protocols`
471
506
  - If `cds.env.protocols` is set, `cds.requires.middlewares` is automatically turned on
472
507
  - `cds.context` middleware is split to initial handling of request correlation and user propagation
473
- - fix view resolving and managed data for UPSERT
508
+ - Fix view resolving and managed data for UPSERT
474
509
  - `cds.linked` supports polymorphic self links like in: `action foo( self: [many] $self, ...)`
475
510
  - Error with `@odata.draft.enabled` and `@restrict`
476
511
  - Skip mandatory check on navigation properties for write requests
@@ -493,11 +528,11 @@ cds env requires/cds.xt.ModelProviderService
493
528
 
494
529
  - Added several missing signatures in CQN types that are now in accordance with the current documentation.
495
530
  - `.columns(…)` of both `cql.SELECT` and `cql.INSERT` give improved code completion when paired when appropriate type definitions are present
496
- - Status code of error messages caused by empty `not null` fields is changed from `400` to `500` on database layer. Note, that as result the error message `Value is required` in production will be replaced by `Internal server error` in the HTTP response.
531
+ - 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.
497
532
  - 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.
498
- - `persistent-outbox`: Only programming errors lead to `process.exit()`, unrecoverable ones are only logged and their `attempts` are updated to `options.maxAttempts`
533
+ - `persistent-outbox`: Only programming errors lead to `process.exit()`, unrecoverable ones are only logged, and their `attempts` are updated to `options.maxAttempts`
499
534
  - 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.
500
- - `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.
535
+ - `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.
501
536
  - For streamlined MTX, `@sap/cds` now uses the custom SAP Service Manager client built into `@sap/cds-mtxs`
502
537
  - Require new package `@cap-js/graphql` for `cds compile -2 graphql`
503
538
 
@@ -511,13 +546,13 @@ cds env requires/cds.xt.ModelProviderService
511
546
  - Localized draft requests with nested expand in the case of `to many` now return localized data
512
547
  - Protected service root for REST adapter
513
548
  - `cds build` logs tar error message
514
- - Resolve view only with renamed fields in orderBy case
515
- - In case of `$apply` no default values for `top` or `skip` are set in subselects
516
- - Environment variables like `cds.requires.<service>.kind...` now consistently override services set in e.g. `package.json`
549
+ - Resolve view only with renamed fields in `orderBy` case
550
+ - In case of `$apply`, no default values for `top` or `skip` are set in subselects
551
+ - Environment variables like `cds.requires.<service>.kind...` now consistently override services set in, e.g. `package.json`
517
552
  - Expand of composition backlink now accesses draft instance instead of active
518
553
  - Performance of server bootstrap for services with lots of entities
519
554
  - Error with virtual properties in expand combined with draft
520
- - req.tenant is properly propagated by custom authentication in odata and rest
555
+ - `req.tenant` is properly propagated by custom authentication in odata and rest
521
556
  - Error with `SiblingEntity` in draft
522
557
  - Quoting of keys typed as `cds.String` in error targets. Error targets are a relative resource path to correlate error
523
558
  messages with the corresponding text input filed in the UI in an OData HTTP error response body for errors, warnings,
@@ -542,16 +577,16 @@ Content-Length: 145
542
577
  }
543
578
  ```
544
579
 
545
- - Application crash if batched Uri uses invalid percent encoding
546
- - `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 that are not used in the application model.
547
- - `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.
580
+ - Application crash if batched Uri uses invalid percent-encoding
581
+ - `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.
582
+ - `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.
548
583
  - `cds build` for Java no longer adds the service `cds.xt.MTXServices` to the application model.
549
584
  - `cds build` no longer fails when creating large resource TAR archives for MTXS projects.
550
585
 
551
586
  ### Removed
552
587
 
553
- - Removed `PreconditionFailedError` when sending a request with an `if-match` header on an entity without an etag
554
- - 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.
588
+ - Removed `PreconditionFailedError` when sending a request with an `if-match` header on an entity without an ETag
589
+ - 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.
555
590
 
556
591
  ## Version 6.3.2 - 2022-11-21
557
592
 
@@ -560,7 +595,7 @@ Content-Length: 145
560
595
  - `cds deploy` reports errors correctly
561
596
  - Reference resolution in QL API
562
597
  - `cds.parse.path` to correctly handle special characters
563
- - `cds build` issues on Windows: build with large number of files and build on Git Bash.
598
+ - `cds build` issues on Windows: build with a large number of files and build on Git Bash.
564
599
  - `odata` as default protocol for enabled middlewares feature
565
600
 
566
601
  ## Version 6.3.1 - 2022-11-04
@@ -571,14 +606,14 @@ Content-Length: 145
571
606
  - `cds deploy` handles empty result from `cf` call correctly
572
607
  - `$search` fails on columns composed by a CQL expression that uses the SAP HANA `coalesce` predicate
573
608
  - Draft ownership was erroneously checked for bound actions on active instances
574
- - `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 bad state in the local service registry.
609
+ - `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.
575
610
 
576
611
  ## Version 6.3.0 - 2022-10-28
577
612
 
578
613
  ### Added
579
614
 
580
615
  - Additional type signatures for service methods in the query API
581
- - In case of error in a batch request, the @Core.ContentID is added to the details of the error message
616
+ - In case of an error in a batch request, the @Core.ContentID is added to the details of the error message
582
617
  - Extensibility: Use i18n files from extensions in edmx calculation
583
618
  - In messaging, you can listen to all messages in a queue by subscribing to `'*'`
584
619
  - Improved Log formatting for Cloud Foundry
@@ -611,7 +646,7 @@ Content-Length: 145
611
646
  ### Fixed
612
647
 
613
648
  - Change signature of cqn `SELECT.limit.offset` and `SELECT.limit.rows` to `val` instead of `number`
614
- - Parsing of store procedure SQL calls including the schema name. For example, `CALL "SCHEMA"."PROC"(?)` and `CALL SCHEMA.PROC(?)`
649
+ - Parsing of store procedure SQL calls, including the schema name. For example, `CALL "SCHEMA"."PROC"(?)` and `CALL SCHEMA.PROC(?)`
615
650
  - Add property name in the error message on validation of the value
616
651
  - Kibana and Cloud Foundry formatter: do not log cookie header value
617
652
  - Missing SQL aliases for `$search` queries combined with `$orderBy` query option
@@ -674,9 +709,9 @@ Content-Length: 145
674
709
  DEBUG?.(...)
675
710
  ```
676
711
  - All MTX-related modules have been refactored and moved to `@sap/cds-mtxs`.
677
- Ensure to also upgrade to latest version of `@sap/cds-mtxs` when upgrading `@sap/cds` to avoid any breaking change effects.
712
+ Ensure to also upgrade to the latest version of `@sap/cds-mtxs` when upgrading `@sap/cds` to avoid any breaking change effects.
678
713
  - SQLite database file endings have been changed to `.sqlite`, so third-party tools (e.g. VS Code extensions) can deduce the file type.
679
- - 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`.
714
+ - 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`.
680
715
  - Prefer HANA driver that is required in package.json of project root
681
716
 
682
717
  ### Fixed
@@ -685,24 +720,24 @@ Content-Length: 145
685
720
  - Signatures for QN `order_by` expressions are now in line with the capire doc
686
721
  - Signatures for QL operations are now more specific
687
722
  - `basic-auth` does not inherit users of `mocked-auth`
688
- - `cds.localize` now ignores i18n files defined outside project scope.
723
+ - `cds.localize` now ignores i18n files defined outside the project scope.
689
724
  - Allow `@Capabilities.NavigationRestrictions.RestrictedProperties` to be specified in the format `{ InsertRestrictions.Insertable: false }`
690
725
  - Bound actions/functions while calling remote service
691
726
  - `$search`: Search on localized projections/views does not always return the localized data
692
727
  - `cds push` now shows better output for failed extension validations
693
728
  - Aliased parameters in REST parser
694
729
  - `cds.deploy` now logs the correct filename for multitenant SQLite
695
- - HDI configuration data (e.g. `./cfg`, `.hdiignore`) and HANA native artifacts have not always been copied into the `sdc` folder of a MTX sidecar module
730
+ - 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
696
731
  - OData URL to CQN parser (`cds.env.features.odata_new_parser`) now supports functions with no arguments
697
732
  - Runtime exception for `PATCH` HTTP request with an empty payload body and read-only field
698
733
  - Streams in draft caused SQL error
699
734
  - Better response state handling during `cds deploy` to Cloud Foundry.
700
- - Draft: patch on draft enabled entity with a composition of one
735
+ - Draft: patch on draft-enabled entity with a composition of one
701
736
  - Maximum stack trace exceeded in generic audit logging implementation
702
- - The protocol adapter logs the decoded URI or the original one, if it is invalid
737
+ - The protocol adapter logs the decoded URI or the original one if it is invalid
703
738
  - REST: reject action calls with round brackets (parentheses). For example, the request `/Books(1)/bookShelf.CatalogService.rate()` is now rejected.
704
739
  - `cds deploy` and `cds run/serve/watch` no longer print terminal escape sequences (`x1b...`) if they run non-interactively.
705
- - Some fields in entities like `path` generated invalid sql
740
+ - Some fields in entities like `path` generated invalid SQL
706
741
 
707
742
  ## Version 6.1.3 - 2022-09-13
708
743
 
@@ -731,9 +766,9 @@ Content-Length: 145
731
766
  - Performance issue for OData <entity>/$count requests
732
767
  - Typescript definition for SQL-native variant of `srv.run`, like `srv.run('SELECT * from Authors where name like ?',['%Poe%'])`
733
768
  - Typescript definitions for `srv.run( [query] )` and `srv.send( {query, headers} )`
734
- - Typescript definitions for `cds.log` are improved, level indicators like `cds.log()._debug` added
769
+ - Typescript definitions for `cds.log` are improved, and level indicators like `cds.log()._debug` added
735
770
  - Typescript definitions for `tx` now carry additional service methods
736
- - `cds login` now returns errors with a better root cause messages
771
+ - `cds login` now returns errors with better root cause messages
737
772
  - `$expand` requests for to-one associations that do not select the foreign key
738
773
  - `UPDATE` statement accepts empty objects: `UPDATE('Foo').with({ bar: {} })`
739
774
  - URI encoding of parameters in remote service calls
@@ -744,7 +779,7 @@ Content-Length: 145
744
779
  - The configuration schema now includes `cds.extends` and `new-fields` (in `cds.xt.ExtensibilityService`)
745
780
  - Ability to run extension validations as part of `cds lint`
746
781
  - The `/-/cds/login` endpoint now also supports client credentials authentication
747
- - `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.
782
+ - `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.
748
783
  ```js
749
784
  cds.run (tx => { // nested operations are guaranteed to run in a tx
750
785
  await INSERT.into (Foo, ...)
@@ -842,13 +877,13 @@ Content-Length: 145
842
877
  await SELECT.from('sqlite_master')
843
878
  await cds.read('sqlite_master')
844
879
  ```
845
- Caveat: the following undocumented usage of unqualified names happened to work in the past.
880
+ Caveat: The following undocumented usage of unqualified names happened to work in the past.
846
881
  But this was very fragile and caused lots of issues, and therefore was removed:
847
882
  ```sql
848
883
  await SELECT.from('Books')
849
884
  await cds.read('Books')
850
885
  ```
851
- Always use qualified names, or reflected definitions instead:
886
+ Always use qualified names or reflected definitions instead:
852
887
  ```sql
853
888
  const Books = 'sap.capire.bookshop.Books'
854
889
  await SELECT.from(Books)
@@ -877,7 +912,7 @@ Content-Length: 145
877
912
  - `cds build` no longer generates EDMX files for services that aren't odata protocol enabled
878
913
  - `cds deploy` handles orgs and spaces containing commas correctly
879
914
  - Incorrect decoding of special characters when reading data of type `cds.LargeString` from SAP HANA using `hdb@^0.19.5` driver
880
- - The payload is added to the delete request in rest adapter as req.data
915
+ - The payload is added to the delete request in rest adapter as `req.data`
881
916
 
882
917
  ## Version 6.0.4 - 2022-07-20
883
918
 
@@ -898,7 +933,7 @@ Content-Length: 145
898
933
  - `--vap-file` parameter of `cds deploy` is available again
899
934
  - `cds build` no longer throws an error if `@sap/cds-mtx` library (classic MTX) isn't installed locally.
900
935
  - `cds.spawn` no longer tries to reuse a transaction
901
- - Custom query parameter caused bad request on certain characters in rest adapter
936
+ - Custom query parameter caused bad request on certain characters in REST adapter
902
937
  - `cds-ts` no longer fails with an `ERR_UNKNOWN_FILE_EXTENSION` error
903
938
  - Timeouts when sending string payloads to remote services
904
939
  - `cds.context.http` for `$batch` using atomicity groups
@@ -908,7 +943,7 @@ Content-Length: 145
908
943
  ### Fixed
909
944
 
910
945
  - Jest tests do not fail any longer because of logs during app shutdown
911
- - `cds build` now uses correct `mtx/sidecar` context. This avoids redundant `cds-mtxs` npm dependency for Java projects.
946
+ - `cds build` now uses the correct `mtx/sidecar` context. This avoids redundant `cds-mtxs` npm dependency for Java projects.
912
947
 
913
948
  ## Version 6.0.1 - 2022-07-05
914
949
 
@@ -946,7 +981,7 @@ Content-Length: 145
946
981
  > while calling it without `new` it throws immediately. The latter is
947
982
  > useful for usages like that:
948
983
 
949
- - Improved `req.error` to always turn each recorded error in to an instance of `Error` with own stack trace.
984
+ - Improved `req.error` to always turn each recorded error into an instance of `Error` with its own stack trace.
950
985
  Multiple errors are finally thrown as an array of these errors with `.message = 'MULTIPLE_ERRORS'`
951
986
  and `.details = this` (the latter is for compatibility to former releases).
952
987
 
@@ -1040,7 +1075,7 @@ stay intact until the transaction is committed or rolled back.
1040
1075
  - The `file` option of file-based messaging is now on top level (before it was in `credentials`)
1041
1076
  - Optimized Search: `cds.env.features.optimized_search=true` is now the default behavior.
1042
1077
  - `cds build` no longer generates CF manifest files for Nodejs and HANA db deployer modules.
1043
- - `cds build` no longer supports WebIDE Fullstack compatibility mode. Consequently HANA artifacts and service EDMX files for Fiori modules might no longer be correctly generated.
1078
+ - `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.
1044
1079
  - Remote services: Batched `GET` requests will not fetch CSRF tokens
1045
1080
  - CQN now uses `xpr` correctly instead of brackets in `where`
1046
1081
  - `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.
@@ -1053,19 +1088,19 @@ stay intact until the transaction is committed or rolled back.
1053
1088
  - `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.
1054
1089
  - `cds deploy` reads Cloud Foundry file `config.json` to get org and space information.
1055
1090
  - New REST adapter replaced old (limited) implementation
1056
- - Default behaviour for runtime integrity checks. From now on no integrity checks will be done by default.
1057
- Note that this is a breaking change for appliations that rely on automatic integrity checks by runtime. We recommend to use `cds.env.features.assert_integrity`: `db` to switch on database integrity constraints. The value `app` can be used as fallback to previous behaviour.
1091
+ - Default behavior for runtime integrity checks. From now on no integrity checks will be done by default.
1092
+ 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.
1058
1093
  - `cds build` no longer copies `.env` or `default-env.json` files into the deployment folder.
1059
- - OData `POST`, `PATCH` and `PUT` requests as well as draft-related `draftEdit` and `draftActivate` actions are now followed by an additional `READ` request to the application service. Consequently affected functionality:
1060
- + 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.
1094
+ - 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:
1095
+ + 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.
1061
1096
  + 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.
1062
1097
  + 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.
1063
1098
  + Modification logs are now followed by corresponding access logs.
1064
1099
  + More details can be found in cds v6.0.0 release notes.
1065
1100
  - Message for PreconditionFailedError is now configurable in messages.properties
1066
1101
  - Remove circular references in Kibana logging
1067
- - Error sanitization in production is skipped for custom errors with HTTP code `5xx`. From now on, it's possible for an app developer to return any error message to the client.
1068
- Note that this is a breaking change for appliations that rely on error sanitization for custom errors in production. The behaviour of errors thrown by CAP framework is unchanged.
1102
+ - 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.
1103
+ 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.
1069
1104
 
1070
1105
  ### Fixed
1071
1106
 
@@ -1091,7 +1126,7 @@ In such scenarios, now the HTTP `404 Not Found` status code is returned rather t
1091
1126
  - All entities in `@sap/cds/common` have now proper CDS doc comments
1092
1127
  - `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.
1093
1128
  - Pass options from `cds.parse.expr` to `cdsc.parse.expr`.
1094
- - 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.
1129
+ - 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.
1095
1130
  - Correct URL generation for `Integer64` and `Decimal` for remote services
1096
1131
  - Operation parameters from structured type and annotated with @open are not filtered from the input query
1097
1132
  - 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`.
@@ -1114,7 +1149,7 @@ In such scenarios, now the HTTP `404 Not Found` status code is returned rather t
1114
1149
  - `cds version` now handles array-valued entries for `folders.db`and `folders.srv` gracefully when looking for MTX sidecar
1115
1150
  - OData access of entities named `get` and `set`
1116
1151
  - missing brackets for OR condition in `.where()` when requesting by navigation
1117
- - `cds build` now correctly supports nodejs apps that do not have a service module defined. In these cases the build task's _src_ folder has to be configured as "."
1152
+ - `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 "."
1118
1153
  - `cds build <dir>` is now correctly executed if called by npm script or mta build.
1119
1154
  - `cds deploy` now shows a better error message on INSERT errors (on SQLite).
1120
1155
 
@@ -1161,8 +1196,8 @@ In such scenarios, now the HTTP `404 Not Found` status code is returned rather t
1161
1196
  - Ignored requests in batch requests
1162
1197
  - `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.
1163
1198
  - Multiple errors did not have correct HTTP response status code
1164
- - `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
1165
- - Call hana procedure:
1199
+ - `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
1200
+ - Call SAP HANA procedure:
1166
1201
  + accepted are any symbols in a procedure name if it is delimited with a double quotation (`"`)
1167
1202
  + 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
1168
1203
  - `@odata.context` considers `cds.env.odata.contextAbsoluteUrl` when requesting an OData Service
@@ -1230,7 +1265,7 @@ In such scenarios, now the HTTP `404 Not Found` status code is returned rather t
1230
1265
  - URL encoding for remote services for CQN queries
1231
1266
  - `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.
1232
1267
  - Endless loop in localization handling
1233
- - Ensure service impl while extending entity from the service
1268
+ - Ensure service implementation while extending entity from the service
1234
1269
  - Post-processing of custom draft queries
1235
1270
  - `cds build` no longer omits unused CDS type definitions, leading to Java compiler errors
1236
1271
 
@@ -1239,7 +1274,7 @@ In such scenarios, now the HTTP `404 Not Found` status code is returned rather t
1239
1274
  ### Added
1240
1275
 
1241
1276
  - Enable custom audit logging implementation by subclassing or prepending `cds.AuditLogService`
1242
- - Log authentication/authorization traces, for example, authentication strategy, and access control decisions to facilitate troubleshooting in debug mode.
1277
+ - Log authentication/authorization traces, for example, authentication strategy and access control decisions to facilitate troubleshooting in debug mode.
1243
1278
  - Bound functions and actions calls with odata-v2 from remote service
1244
1279
  - Beta support for procedure calls with table output data (SAP HANA only)
1245
1280
  + 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.
@@ -1512,7 +1547,7 @@ In such scenarios, now the HTTP `404 Not Found` status code is returned rather t
1512
1547
 
1513
1548
  ### Fixed
1514
1549
 
1515
- - Instance-based restriction for activation of draft enabled entities
1550
+ - Instance-based restriction for activation of draft-enabled entities
1516
1551
  - `.columns('*')` on projections of remote services using renamed properties
1517
1552
  - GraphQL filters on nested fields are now applied correctly
1518
1553
  - Performance degradation during the processing of `where exists`