@sap/cds 9.0.3 → 9.1.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.
- package/CHANGELOG.md +36 -0
- package/bin/serve.js +11 -9
- package/lib/compile/for/lean_drafts.js +29 -7
- package/lib/dbs/cds-deploy.js +5 -3
- package/lib/env/cds-requires.js +1 -1
- package/lib/env/defaults.js +0 -11
- package/lib/env/schemas/cds-rc.js +214 -6
- package/lib/i18n/locale.js +2 -1
- package/lib/req/request.js +1 -1
- package/lib/req/validate.js +1 -2
- package/lib/srv/cds-connect.js +1 -1
- package/lib/srv/middlewares/auth/xssec.js +1 -1
- package/lib/utils/inflect.js +2 -2
- package/lib/utils/tar.js +60 -23
- package/libx/_runtime/common/generic/crud.js +1 -3
- package/libx/_runtime/common/generic/input.js +2 -2
- package/libx/_runtime/common/generic/temporal.js +0 -6
- package/libx/_runtime/fiori/lean-draft.js +487 -141
- package/libx/_runtime/remote/utils/client.js +1 -0
- package/libx/odata/ODataAdapter.js +47 -43
- package/libx/odata/middleware/batch.js +0 -1
- package/libx/odata/middleware/error.js +7 -0
- package/libx/odata/middleware/operation.js +15 -21
- package/libx/odata/parse/afterburner.js +23 -10
- package/libx/odata/parse/cqn2odata.js +2 -2
- package/libx/odata/parse/grammar.peggy +182 -133
- package/libx/odata/parse/parser.js +1 -1
- package/libx/odata/utils/index.js +0 -35
- package/libx/odata/utils/metadata.js +34 -1
- package/libx/odata/utils/odataBind.js +2 -1
- package/libx/odata/utils/result.js +22 -20
- package/libx/queue/index.js +6 -2
- package/package.json +1 -1
package/libx/queue/index.js
CHANGED
|
@@ -36,6 +36,7 @@ const _isProviderTenant = tenant =>
|
|
|
36
36
|
cds.requires.multitenancy.t0 === tenant
|
|
37
37
|
|
|
38
38
|
const _hasPersistentQueue = tenant => {
|
|
39
|
+
if (!cds.db) return false // no persistence configured
|
|
39
40
|
if (cds.requires.multitenancy && tenant && _isProviderTenant(tenant)) return false // no persistence for provider account
|
|
40
41
|
return true
|
|
41
42
|
}
|
|
@@ -48,6 +49,8 @@ const _safeJSONParse = string => {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
const _targetName = (name, opts) => (opts.targetPrefix ? opts.targetPrefix + name : name)
|
|
53
|
+
|
|
51
54
|
// Note: This function can also run for each tenant on startup
|
|
52
55
|
//
|
|
53
56
|
// tx1: Fetch messages which are not in process and are not locked (SELECT FOR UPDATE)
|
|
@@ -94,7 +97,7 @@ const processTasks = (service, tenant, _opts = {}) => {
|
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
const tasksQuery = SELECT.from(tasksEntity)
|
|
97
|
-
.where({ target: name })
|
|
100
|
+
.where({ target: _targetName(name, opts) })
|
|
98
101
|
.orderBy(opts.parallel ? ['status', 'timestamp', 'ID'] : ['timestamp', 'status', 'ID'])
|
|
99
102
|
.limit(opts.chunkSize)
|
|
100
103
|
.forUpdate()
|
|
@@ -293,6 +296,7 @@ const processTasks = (service, tenant, _opts = {}) => {
|
|
|
293
296
|
const _newMsgFrom = msg => {
|
|
294
297
|
const _fromSend = msg instanceof cds.Request
|
|
295
298
|
const newMsg = { ...msg }
|
|
299
|
+
if (msg.entity) newMsg.entity = msg.entity // needed for proper `h.for(msg)` handling
|
|
296
300
|
newMsg._fromSend = _fromSend
|
|
297
301
|
if (!newMsg.queue) return newMsg
|
|
298
302
|
if (!newMsg.queue.after && !newMsg.queue.every) return newMsg
|
|
@@ -427,7 +431,7 @@ const _createTask = (name, msg, context, taskOpts) => {
|
|
|
427
431
|
}
|
|
428
432
|
const taskMsg = {
|
|
429
433
|
ID: cds.utils.uuid(),
|
|
430
|
-
target: name,
|
|
434
|
+
target: _targetName(name, taskOpts),
|
|
431
435
|
timestamp: _get100NanosecondTimestampISOString(msg.queue?.after), // needs to be different for each emit
|
|
432
436
|
msg: JSON.stringify(_msg)
|
|
433
437
|
}
|