@sap/cds 6.0.4 → 6.1.2
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 +180 -18
- package/apis/cds.d.ts +11 -7
- package/apis/log.d.ts +124 -0
- package/apis/ql.d.ts +72 -15
- package/apis/services.d.ts +13 -2
- package/bin/build/buildTaskHandler.js +5 -2
- package/bin/build/constants.js +4 -1
- package/bin/build/provider/buildTaskHandlerEdmx.js +11 -39
- package/bin/build/provider/buildTaskHandlerFeatureToggles.js +14 -34
- package/bin/build/provider/buildTaskHandlerInternal.js +56 -4
- package/bin/build/provider/buildTaskProviderInternal.js +22 -14
- package/bin/build/provider/hana/index.js +12 -9
- package/bin/build/provider/java/index.js +18 -8
- package/bin/build/provider/mtx/index.js +7 -4
- package/bin/build/provider/mtx/resourcesTarBuilder.js +60 -35
- package/bin/build/provider/mtx-extension/index.js +57 -0
- package/bin/build/provider/mtx-sidecar/index.js +46 -18
- package/bin/build/provider/nodejs/index.js +34 -13
- package/bin/deploy/to-hana/cfUtil.js +7 -2
- package/bin/deploy/to-hana/hana.js +20 -25
- package/bin/deploy/to-hana/hdiDeployUtil.js +13 -2
- package/bin/serve.js +7 -4
- package/lib/compile/{index.js → cds-compile.js} +0 -0
- package/lib/compile/extend.js +15 -5
- package/lib/compile/minify.js +1 -15
- package/lib/compile/parse.js +1 -1
- package/lib/compile/resolve.js +2 -2
- package/lib/compile/to/srvinfo.js +6 -4
- package/lib/{deploy.js → dbs/cds-deploy.js} +9 -8
- package/lib/env/{index.js → cds-env.js} +1 -17
- package/lib/env/{requires.js → cds-requires.js} +24 -3
- package/lib/env/defaults.js +7 -1
- package/lib/env/schemas/cds-package.json +11 -0
- package/lib/env/schemas/cds-rc.json +614 -0
- package/lib/index.js +19 -16
- package/lib/log/{errors.js → cds-error.js} +1 -1
- package/lib/log/{index.js → cds-log.js} +0 -0
- package/lib/log/format/kibana.js +19 -1
- package/lib/ql/Query.js +9 -3
- package/lib/ql/SELECT.js +2 -2
- package/lib/ql/UPDATE.js +2 -2
- package/lib/ql/{index.js → cds-ql.js} +4 -10
- package/lib/req/context.js +49 -17
- package/lib/req/locale.js +5 -1
- package/lib/{serve → srv}/adapters.js +23 -19
- package/lib/{connect → srv}/bindings.js +0 -0
- package/lib/{connect/index.js → srv/cds-connect.js} +1 -1
- package/lib/{serve/index.js → srv/cds-serve.js} +0 -0
- package/lib/{serve → srv}/factory.js +1 -1
- package/lib/{serve/Service-api.js → srv/srv-api.js} +22 -6
- package/lib/{serve/Service-dispatch.js → srv/srv-dispatch.js} +13 -8
- package/lib/{serve/Service-handlers.js → srv/srv-handlers.js} +10 -0
- package/lib/{serve/Service-methods.js → srv/srv-methods.js} +10 -8
- package/lib/srv/srv-models.js +207 -0
- package/lib/{serve/Transaction.js → srv/srv-tx.js} +57 -40
- package/lib/utils/{tests.js → cds-test.js} +2 -2
- package/lib/utils/cds-utils.js +146 -0
- package/lib/utils/index.js +2 -145
- package/lib/utils/jest.js +43 -0
- package/lib/utils/resources/index.js +15 -25
- package/lib/utils/resources/tar.js +18 -41
- package/libx/_runtime/auth/index.js +14 -11
- package/libx/_runtime/cds-services/adapter/odata-v4/OData.js +7 -19
- package/libx/_runtime/cds-services/adapter/odata-v4/ODataRequest.js +1 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/action.js +1 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/create.js +1 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/delete.js +1 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/error.js +2 -2
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/metadata.js +6 -19
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/read.js +3 -5
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/request.js +1 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/update.js +1 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-commons/utils/PrimitiveValueDecoder.js +0 -2
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/deserializer/DeserializerFactory.js +3 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/to.js +38 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/utils/readAfterWrite.js +1 -3
- package/libx/_runtime/cds-services/services/utils/differ.js +4 -0
- package/libx/_runtime/cds-services/util/errors.js +1 -29
- package/libx/_runtime/common/i18n/messages.properties +2 -1
- package/libx/_runtime/common/perf/index.js +10 -15
- package/libx/_runtime/common/utils/binary.js +3 -4
- package/libx/_runtime/common/utils/cqn2cqn4sql.js +0 -1
- package/libx/_runtime/common/utils/entityFromCqn.js +8 -5
- package/libx/_runtime/common/utils/keys.js +14 -6
- package/libx/_runtime/common/utils/resolveView.js +1 -1
- package/libx/_runtime/common/utils/template.js +1 -1
- package/libx/_runtime/db/Service.js +2 -14
- package/libx/_runtime/db/expand/expandCQNToJoin.js +28 -25
- package/libx/_runtime/db/expand/rawToExpanded.js +7 -6
- package/libx/_runtime/db/generic/input.js +8 -1
- package/libx/_runtime/db/sql-builder/InsertBuilder.js +1 -1
- package/libx/_runtime/db/sql-builder/SelectBuilder.js +37 -18
- package/libx/_runtime/extensibility/activate.js +47 -47
- package/libx/_runtime/extensibility/add.js +22 -13
- package/libx/_runtime/extensibility/addExtension.js +17 -13
- package/libx/_runtime/extensibility/defaults.js +25 -30
- package/libx/_runtime/extensibility/handler/transformREAD.js +20 -18
- package/libx/_runtime/extensibility/linter/allowlist_checker.js +373 -0
- package/libx/_runtime/extensibility/linter/annotations_checker.js +113 -0
- package/libx/_runtime/extensibility/linter/checker_base.js +20 -0
- package/libx/_runtime/extensibility/linter/namespace_checker.js +180 -0
- package/libx/_runtime/extensibility/linter.js +32 -0
- package/libx/_runtime/extensibility/push.js +77 -20
- package/libx/_runtime/extensibility/service.js +29 -12
- package/libx/_runtime/extensibility/token.js +57 -0
- package/libx/_runtime/extensibility/utils.js +8 -6
- package/libx/_runtime/extensibility/validation.js +6 -9
- package/libx/_runtime/fiori/generic/new.js +0 -11
- package/libx/_runtime/fiori/utils/where.js +1 -1
- package/libx/_runtime/hana/Service.js +0 -1
- package/libx/_runtime/hana/conversion.js +12 -1
- package/libx/_runtime/hana/customBuilder/CustomFunctionBuilder.js +4 -3
- package/libx/_runtime/hana/customBuilder/CustomSelectBuilder.js +5 -0
- package/libx/_runtime/hana/pool.js +6 -10
- package/libx/_runtime/hana/search2Contains.js +0 -5
- package/libx/_runtime/hana/search2cqn4sql.js +1 -0
- package/libx/_runtime/messaging/common-utils/authorizedRequest.js +1 -1
- package/libx/_runtime/messaging/enterprise-messaging-utils/EMManagement.js +1 -2
- package/libx/_runtime/messaging/outbox/utils.js +1 -1
- package/libx/_runtime/messaging/service.js +11 -6
- package/libx/_runtime/remote/utils/data.js +5 -0
- package/libx/_runtime/sqlite/Service.js +7 -6
- package/libx/_runtime/sqlite/execute.js +41 -28
- package/libx/odata/afterburner.js +79 -2
- package/libx/odata/cqn2odata.js +15 -9
- package/libx/odata/grammar.pegjs +157 -76
- package/libx/odata/index.js +9 -3
- package/libx/odata/parser.js +1 -1
- package/libx/odata/utils.js +39 -5
- package/libx/rest/RestAdapter.js +3 -7
- package/libx/rest/middleware/delete.js +4 -5
- package/libx/rest/middleware/parse.js +3 -2
- package/package.json +3 -3
- package/server.js +1 -1
- package/srv/extensibility-service.cds +6 -3
- package/srv/model-provider.cds +3 -1
- package/srv/model-provider.js +86 -106
- package/srv/mtx.js +7 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/Dispatcher.js +0 -240
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { isfile, fs, path } = require('../utils')
|
|
1
|
+
const { isfile, fs, path } = require('../utils/cds-utils')
|
|
2
2
|
const DEFAULTS = require('./defaults'), defaults = require.resolve ('./defaults')
|
|
3
3
|
const compat = require('./compat')
|
|
4
4
|
const presets = require('./presets')
|
|
@@ -130,22 +130,6 @@ class Config {
|
|
|
130
130
|
return option.split('.').reduce ((p,n)=> p && p[n], this)
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
/**
|
|
134
|
-
* This is `this.requires` plus additional entries for all cds.required.<name>.service
|
|
135
|
-
* @returns {import('./requires')}
|
|
136
|
-
*/
|
|
137
|
-
get required_services_or_defs() {
|
|
138
|
-
const dict = Object.create (this.requires)
|
|
139
|
-
for (let [name,e] of Object.entries (this.requires)) if (e.service) {
|
|
140
|
-
if (e.service in dict && !e.override && e.service !== name) {
|
|
141
|
-
console.error (`Datasource name '${e.service}' conflicts with 'service' definition referred to in 'cds.requires.${name}':`, e)
|
|
142
|
-
throw new Error (`Datasource name '${e.service}' conflicts with service definition`)
|
|
143
|
-
}
|
|
144
|
-
else dict[e.service] = { ...e, name }
|
|
145
|
-
}
|
|
146
|
-
return super.required_services_or_defs = dict
|
|
147
|
-
}
|
|
148
|
-
|
|
149
133
|
get profiles() {
|
|
150
134
|
return super.profiles = Array.from (this._profiles)
|
|
151
135
|
}
|
|
@@ -11,6 +11,23 @@ exports = module.exports = {
|
|
|
11
11
|
'[production]': { kind: 'jwt-auth' }
|
|
12
12
|
},
|
|
13
13
|
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* This is the implementation for `cds.requires` which is `cds.env.requires`
|
|
17
|
+
* plus additional entries for all cds.required.<name>.service
|
|
18
|
+
* @returns {import('./cds-requires')}
|
|
19
|
+
*/
|
|
20
|
+
_resolved() {
|
|
21
|
+
const dict = Object.create (this)
|
|
22
|
+
for (let [name,e] of Object.entries (this)) if (e.service) {
|
|
23
|
+
if (e.service in dict && !e.override && e.service !== name) {
|
|
24
|
+
console.error (`Datasource name '${e.service}' conflicts with 'service' definition referred to in 'cds.requires.${name}':`, e) // eslint-disable-line no-console
|
|
25
|
+
throw new Error (`Datasource name '${e.service}' conflicts with service definition`)
|
|
26
|
+
}
|
|
27
|
+
else dict[e.service] = { ...e, name }
|
|
28
|
+
}
|
|
29
|
+
return dict
|
|
30
|
+
}
|
|
14
31
|
}
|
|
15
32
|
|
|
16
33
|
|
|
@@ -85,6 +102,10 @@ const _databases = {
|
|
|
85
102
|
'[development]': { kind: 'sqlite', credentials: { url: ':memory:' } },
|
|
86
103
|
'[production]': { kind: 'hana' },
|
|
87
104
|
},
|
|
105
|
+
"sql-mt": {
|
|
106
|
+
'[development]': { kind: 'sqlite' },
|
|
107
|
+
'[production]': { kind: 'hana-mt' },
|
|
108
|
+
},
|
|
88
109
|
"sqlite": _compat_to_use({
|
|
89
110
|
credentials: { url: 'sqlite.db' },
|
|
90
111
|
impl: `${_runtime}/sqlite/Service.js`,
|
|
@@ -208,11 +229,11 @@ const _mtx_services = {
|
|
|
208
229
|
model: "@sap/cds/srv/extensions",
|
|
209
230
|
},
|
|
210
231
|
"extensibility": {
|
|
211
|
-
model: [ "@sap/cds/srv/mtx", "@sap/cds/srv/extensions" ]
|
|
232
|
+
model: [ "@sap/cds/srv/mtx", "@sap/cds/srv/extensions" ],
|
|
233
|
+
tenantCheckInterval: 10000
|
|
212
234
|
},
|
|
213
235
|
"cds.xt.ExtensibilityService": {
|
|
214
|
-
model: "@sap/cds/srv/extensibility-service"
|
|
215
|
-
tenantCheckInterval: 10000
|
|
236
|
+
model: "@sap/cds/srv/extensibility-service"
|
|
216
237
|
},
|
|
217
238
|
"uiflex": "extensibility", // REVISIT: temporary for compatibility with cds-mtxs tests -> eliminate "uiflex" later
|
|
218
239
|
|
package/lib/env/defaults.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
const path = require('path')
|
|
1
2
|
const [,major,minor] = /v(\d+)\.(\d+)/.exec(process.version)
|
|
2
3
|
const production = process.env.NODE_ENV === 'production'
|
|
3
4
|
|
|
4
5
|
module.exports = {
|
|
5
6
|
|
|
6
|
-
requires: require('./requires'),
|
|
7
|
+
requires: require('./cds-requires'),
|
|
8
|
+
|
|
9
|
+
schemas: {
|
|
10
|
+
'cds-rc.json': path.join(__dirname, 'schemas/cds-rc.json'),
|
|
11
|
+
'cds-package.json': path.join(__dirname, 'schemas/cds-package.json'),
|
|
12
|
+
},
|
|
7
13
|
|
|
8
14
|
features: {
|
|
9
15
|
folders: 'fts/*', // where to find feature toggles -> switch on by default when released
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "JSON schema for CDS configuration in package.json",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"description": "This is a JSON schema representation of the CDS project configuration inside a project root level package.json",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"cds": {
|
|
8
|
+
"$ref": "cdsJsonSchema://schemas/cds-rc.json"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|