@sap/cds 9.0.4 → 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 +25 -0
- 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/req/request.js +1 -1
- package/lib/req/validate.js +1 -2
- 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 +22 -8
- 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 +5 -2
- package/package.json +1 -1
package/libx/queue/index.js
CHANGED
|
@@ -49,6 +49,8 @@ const _safeJSONParse = string => {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
const _targetName = (name, opts) => (opts.targetPrefix ? opts.targetPrefix + name : name)
|
|
53
|
+
|
|
52
54
|
// Note: This function can also run for each tenant on startup
|
|
53
55
|
//
|
|
54
56
|
// tx1: Fetch messages which are not in process and are not locked (SELECT FOR UPDATE)
|
|
@@ -95,7 +97,7 @@ const processTasks = (service, tenant, _opts = {}) => {
|
|
|
95
97
|
}
|
|
96
98
|
|
|
97
99
|
const tasksQuery = SELECT.from(tasksEntity)
|
|
98
|
-
.where({ target: name })
|
|
100
|
+
.where({ target: _targetName(name, opts) })
|
|
99
101
|
.orderBy(opts.parallel ? ['status', 'timestamp', 'ID'] : ['timestamp', 'status', 'ID'])
|
|
100
102
|
.limit(opts.chunkSize)
|
|
101
103
|
.forUpdate()
|
|
@@ -294,6 +296,7 @@ const processTasks = (service, tenant, _opts = {}) => {
|
|
|
294
296
|
const _newMsgFrom = msg => {
|
|
295
297
|
const _fromSend = msg instanceof cds.Request
|
|
296
298
|
const newMsg = { ...msg }
|
|
299
|
+
if (msg.entity) newMsg.entity = msg.entity // needed for proper `h.for(msg)` handling
|
|
297
300
|
newMsg._fromSend = _fromSend
|
|
298
301
|
if (!newMsg.queue) return newMsg
|
|
299
302
|
if (!newMsg.queue.after && !newMsg.queue.every) return newMsg
|
|
@@ -428,7 +431,7 @@ const _createTask = (name, msg, context, taskOpts) => {
|
|
|
428
431
|
}
|
|
429
432
|
const taskMsg = {
|
|
430
433
|
ID: cds.utils.uuid(),
|
|
431
|
-
target: name,
|
|
434
|
+
target: _targetName(name, taskOpts),
|
|
432
435
|
timestamp: _get100NanosecondTimestampISOString(msg.queue?.after), // needs to be different for each emit
|
|
433
436
|
msg: JSON.stringify(_msg)
|
|
434
437
|
}
|