@sap/cds 6.1.3 → 6.2.1
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 +77 -8
- package/apis/cds.d.ts +18 -6
- package/apis/connect.d.ts +1 -1
- package/apis/cqn.d.ts +1 -1
- package/apis/log.d.ts +23 -5
- package/apis/ql.d.ts +128 -61
- package/apis/services.d.ts +11 -0
- package/apis/test.d.ts +61 -0
- package/apis/utils.d.ts +15 -0
- package/app/fiori/preview.js +1 -0
- package/bin/build/buildTaskEngine.js +70 -22
- package/bin/build/buildTaskFactory.js +18 -11
- package/bin/build/buildTaskHandler.js +1 -1
- package/bin/build/buildTaskProviderFactory.js +3 -13
- package/bin/build/constants.js +0 -1
- package/bin/build/index.js +14 -6
- package/bin/build/provider/buildTaskHandlerEdmx.js +2 -3
- package/bin/build/provider/buildTaskHandlerFeatureToggles.js +2 -2
- package/bin/build/provider/buildTaskHandlerInternal.js +3 -6
- package/bin/build/provider/buildTaskProviderInternal.js +51 -39
- package/bin/build/provider/fiori/index.js +3 -3
- package/bin/build/provider/hana/2migration.js +1 -1
- package/bin/build/provider/hana/index.js +34 -27
- package/bin/build/provider/java/index.js +6 -7
- package/bin/build/provider/mtx/index.js +20 -18
- package/bin/build/provider/mtx/resourcesTarBuilder.js +8 -11
- package/bin/build/provider/mtx-sidecar/index.js +13 -17
- package/bin/build/provider/nodejs/index.js +8 -7
- package/bin/build/util.js +22 -4
- package/bin/cds.js +8 -4
- package/bin/deploy/to-hana/cfUtil.js +53 -18
- package/bin/mtx/in-cds.js +1 -0
- package/bin/serve.js +37 -30
- package/lib/auth/basic-auth.js +33 -0
- package/lib/auth/dummy-auth.js +7 -0
- package/lib/auth/ias-auth.js +2 -0
- package/lib/auth/index.js +31 -0
- package/lib/auth/jwt-auth.js +3 -0
- package/lib/auth/mocked-users.js +72 -0
- package/lib/auth/passport-basic.js +12 -0
- package/lib/auth/passport-digest.js +14 -0
- package/lib/auth/xsuaa-auth.js +3 -0
- package/lib/compile/cds-compile.js +3 -3
- package/lib/compile/to/cdl.js +5 -1
- package/lib/compile/to/edm.js +8 -0
- package/lib/compile/to/gql.js +1 -0
- package/lib/compile/to/json.js +30 -5
- package/lib/compile/to/sql.js +3 -1
- package/lib/core/index.js +5 -1
- package/lib/dbs/cds-deploy.js +36 -6
- package/lib/env/cds-env.js +15 -5
- package/lib/env/cds-requires.js +51 -58
- package/lib/env/defaults.js +1 -0
- package/lib/env/schemas/cds-package.json +4 -0
- package/lib/env/schemas/cds-rc.json +63 -77
- package/lib/i18n/localize.js +16 -5
- package/lib/index.js +9 -4
- package/lib/log/cds-error.js +4 -6
- package/lib/log/cds-log.js +89 -53
- package/lib/log/service/index.js +1 -0
- package/lib/ql/CREATE.js +2 -5
- package/lib/ql/DELETE.js +1 -1
- package/lib/ql/DROP.js +1 -3
- package/lib/ql/INSERT.js +3 -3
- package/lib/ql/Query.js +10 -23
- package/lib/ql/SELECT.js +1 -2
- package/lib/ql/UPDATE.js +2 -2
- package/lib/ql/Whereable.js +7 -15
- package/lib/ql/cds-ql.js +9 -3
- package/lib/req/cds-context.js +11 -3
- package/lib/req/context.js +29 -23
- package/lib/req/locale.js +9 -5
- package/lib/req/request.js +1 -0
- package/lib/req/user.js +2 -1
- package/lib/srv/cds-connect.js +1 -1
- package/lib/srv/cds-serve.js +21 -14
- package/lib/srv/middlewares/cds-context.js +29 -0
- package/lib/srv/middlewares/ctx-model.js +24 -0
- package/lib/srv/middlewares/errors.js +9 -0
- package/lib/srv/middlewares/index.js +22 -0
- package/lib/srv/middlewares/sap-statistics.js +13 -0
- package/lib/srv/middlewares/trace.js +102 -0
- package/lib/srv/protocols/_legacy.js +42 -0
- package/lib/srv/protocols/graphql.js +39 -0
- package/lib/srv/protocols/hcql.js +37 -0
- package/lib/srv/protocols/index.js +86 -0
- package/lib/srv/protocols/odata-v2-proxy.js +3767 -0
- package/lib/srv/protocols/odata-v2.js +26 -0
- package/lib/srv/protocols/odata-v4.js +16 -0
- package/lib/srv/protocols/rest.js +13 -0
- package/lib/srv/srv-api.js +5 -0
- package/lib/srv/srv-models.js +4 -6
- package/lib/utils/axios.js +3 -2
- package/lib/utils/cds-test.js +27 -21
- package/lib/utils/cds-utils.js +19 -20
- package/lib/utils/tar.js +175 -0
- package/libx/_runtime/audit/generic/personal/utils.js +18 -7
- package/libx/_runtime/audit/utils/v2.js +1 -0
- package/libx/_runtime/auth/index.js +4 -0
- package/libx/_runtime/auth/strategies/ias-auth.js +76 -0
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/error.js +8 -3
- package/libx/_runtime/cds-services/adapter/odata-v4/handlers/request.js +15 -4
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/expandToCQN.js +1 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/orderByToCQN.js +1 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/odata-to-cqn/utils.js +1 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-commons/uri/ResourcePathParser.js +9 -0
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-commons/uri/UriInfo.js +5 -1
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-commons/uri/UriParser.js +12 -0
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/utils/BufferedWriter.js +6 -2
- package/libx/_runtime/cds-services/adapter/odata-v4/okra/odata-server/validator/RequestValidator.js +47 -7
- package/libx/_runtime/cds-services/adapter/odata-v4/to.js +1 -1
- package/libx/_runtime/cds-services/util/assert.js +4 -0
- package/libx/_runtime/common/aspects/relation.js +1 -1
- package/libx/_runtime/common/composition/data.js +61 -15
- package/libx/_runtime/common/composition/delete.js +0 -1
- package/libx/_runtime/common/composition/insert.js +0 -1
- package/libx/_runtime/common/composition/tree.js +4 -10
- package/libx/_runtime/common/composition/update.js +44 -21
- package/libx/_runtime/common/generic/auth/capabilities.js +8 -10
- package/libx/_runtime/common/generic/crud.js +1 -2
- package/libx/_runtime/common/generic/etag.js +4 -4
- package/libx/_runtime/common/generic/input.js +4 -4
- package/libx/_runtime/common/generic/paging.js +3 -3
- package/libx/_runtime/common/generic/put.js +3 -3
- package/libx/_runtime/common/generic/sorting.js +4 -4
- package/libx/_runtime/common/generic/temporal.js +3 -3
- package/libx/_runtime/common/i18n/messages.properties +0 -7
- package/libx/_runtime/common/utils/cqn2cqn4sql.js +11 -6
- package/libx/_runtime/common/utils/csn.js +0 -28
- package/libx/_runtime/common/utils/draft.js +8 -1
- package/libx/_runtime/common/utils/path.js +7 -1
- package/libx/_runtime/common/utils/resolveView.js +2 -3
- package/libx/_runtime/db/data-conversion/post-processing.js +3 -44
- package/libx/_runtime/db/generic/input.js +3 -3
- package/libx/_runtime/db/sql-builder/dataTypes.js +4 -0
- package/libx/_runtime/fiori/generic/activate.js +2 -2
- package/libx/_runtime/fiori/generic/before.js +40 -72
- package/libx/_runtime/fiori/generic/cancel.js +2 -2
- package/libx/_runtime/fiori/generic/delete.js +2 -2
- package/libx/_runtime/fiori/generic/edit.js +2 -2
- package/libx/_runtime/fiori/generic/new.js +2 -2
- package/libx/_runtime/fiori/generic/patch.js +49 -37
- package/libx/_runtime/fiori/generic/prepare.js +2 -2
- package/libx/_runtime/fiori/generic/read.js +27 -37
- package/libx/_runtime/fiori/utils/where.js +4 -2
- package/libx/_runtime/hana/Service.js +1 -3
- package/libx/_runtime/hana/conversion.js +3 -0
- package/libx/_runtime/hana/driver.js +33 -3
- package/libx/_runtime/hana/dynatrace.js +1 -0
- package/libx/_runtime/hana/search2Contains.js +12 -1
- package/libx/_runtime/hana/search2cqn4sql.js +10 -27
- package/libx/_runtime/hana/streaming.js +1 -0
- package/libx/_runtime/messaging/AMQPWebhookMessaging.js +4 -2
- package/libx/_runtime/messaging/common-utils/AMQPClient.js +1 -0
- package/libx/_runtime/messaging/enterprise-messaging-utils/getTenantInfo.js +5 -2
- package/libx/_runtime/messaging/enterprise-messaging-utils/registerEndpoints.js +2 -0
- package/libx/_runtime/messaging/enterprise-messaging.js +62 -3
- package/libx/_runtime/messaging/outbox/utils.js +1 -1
- package/libx/_runtime/messaging/redis-messaging.js +1 -0
- package/libx/_runtime/remote/Service.js +2 -2
- package/libx/_runtime/remote/utils/client.js +8 -3
- package/libx/_runtime/remote/utils/data.js +7 -2
- package/libx/_runtime/sqlite/Service.js +18 -7
- package/libx/_runtime/sqlite/conversion.js +3 -0
- package/libx/_runtime/sqlite/convertAssocToOneManaged.js +3 -3
- package/libx/_runtime/sqlite/localized.js +8 -8
- package/libx/odata/afterburner.js +39 -7
- package/libx/odata/cqn2odata.js +6 -3
- package/libx/odata/grammar.pegjs +66 -18
- package/libx/odata/index.js +3 -2
- package/libx/odata/parser.js +1 -1
- package/libx/odata/utils.js +2 -0
- package/libx/rest/RestAdapter.js +62 -43
- package/libx/rest/middleware/parse.js +2 -1
- package/libx/rest/middleware/update.js +1 -1
- package/package.json +2 -2
- package/server.js +5 -4
- package/srv/mtx.cds +1 -1
- package/srv/mtx.js +4 -33
- package/lib/srv/adapters.js +0 -85
- package/lib/utils/resources/index.js +0 -48
- package/lib/utils/resources/tar.js +0 -49
- package/lib/utils/resources/utils.js +0 -11
- package/libx/_runtime/extensibility/activate.js +0 -69
- package/libx/_runtime/extensibility/add.js +0 -50
- package/libx/_runtime/extensibility/addExtension.js +0 -72
- package/libx/_runtime/extensibility/defaults.js +0 -34
- package/libx/_runtime/extensibility/handler/transformREAD.js +0 -121
- package/libx/_runtime/extensibility/handler/transformRESULT.js +0 -51
- package/libx/_runtime/extensibility/handler/transformWRITE.js +0 -64
- package/libx/_runtime/extensibility/linter/allowlist_checker.js +0 -373
- package/libx/_runtime/extensibility/linter/annotations_checker.js +0 -113
- package/libx/_runtime/extensibility/linter/checker_base.js +0 -20
- package/libx/_runtime/extensibility/linter/namespace_checker.js +0 -180
- package/libx/_runtime/extensibility/linter.js +0 -32
- package/libx/_runtime/extensibility/push.js +0 -118
- package/libx/_runtime/extensibility/service.js +0 -38
- package/libx/_runtime/extensibility/token.js +0 -57
- package/libx/_runtime/extensibility/utils.js +0 -131
- package/libx/_runtime/extensibility/validation.js +0 -50
- package/libx/_runtime/extensibility/views.js +0 -12
- package/srv/extensibility-service.cds +0 -60
- package/srv/extensibility-service.js +0 -1
- package/srv/extensions.cds +0 -8
- package/srv/model-provider.cds +0 -61
- package/srv/model-provider.js +0 -143
package/srv/model-provider.cds
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
context cds.xt { // IMPORTANT: we don't use namespaces to avoid issues with cds.db default namespace
|
|
2
|
-
|
|
3
|
-
@open type CSN {};
|
|
4
|
-
type TAR : LargeBinary;
|
|
5
|
-
type XML : LargeString;
|
|
6
|
-
type Locale : String;
|
|
7
|
-
type TenantID : String;
|
|
8
|
-
type CSNConsumer : String enum { nodejs; java; };
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Used by CAP runtimes to retrieve tenant-specific variants of
|
|
13
|
-
* deployed models used to serve requests.
|
|
14
|
-
*/
|
|
15
|
-
@protocol: 'rest'
|
|
16
|
-
@requires: [ 'internal-user' ] //> we check that ourselves programmatically in production only
|
|
17
|
-
service ModelProviderService @(path:'/-/cds/model-provider', impl:'@sap/cds/srv/model-provider.js') {
|
|
18
|
-
|
|
19
|
-
action getCsn(
|
|
20
|
-
tenant : TenantID,
|
|
21
|
-
toggles : array of String,
|
|
22
|
-
for : CSNConsumer @cds.java.name: 'runtime',
|
|
23
|
-
flavor : String enum { parsed ; xtended ; inferred },
|
|
24
|
-
base : Boolean,
|
|
25
|
-
) returns CSN;
|
|
26
|
-
|
|
27
|
-
action getExtCsn(
|
|
28
|
-
tenant : TenantID,
|
|
29
|
-
toggles : array of String,
|
|
30
|
-
for : CSNConsumer @cds.java.name: 'runtime',
|
|
31
|
-
) returns CSN;
|
|
32
|
-
|
|
33
|
-
action getEdmx(
|
|
34
|
-
tenant : TenantID,
|
|
35
|
-
toggles : array of String,
|
|
36
|
-
service : String,
|
|
37
|
-
locale : Locale,
|
|
38
|
-
flavor : String enum { v2; v4; w4; x4 },
|
|
39
|
-
for : CSNConsumer @cds.java.name: 'runtime',
|
|
40
|
-
) returns XML;
|
|
41
|
-
|
|
42
|
-
action isExtended(
|
|
43
|
-
tenant : TenantID,
|
|
44
|
-
) returns Boolean;
|
|
45
|
-
|
|
46
|
-
action getExtensions(
|
|
47
|
-
tenant : TenantID,
|
|
48
|
-
) returns CSN;
|
|
49
|
-
|
|
50
|
-
action getResources () returns TAR;
|
|
51
|
-
action getExtResources() returns TAR;
|
|
52
|
-
|
|
53
|
-
// -------------------------------
|
|
54
|
-
// Later, possibly:
|
|
55
|
-
// function GET csn(...)
|
|
56
|
-
// function GET edmx(...)
|
|
57
|
-
// function GET extended(...)
|
|
58
|
-
// function GET resources(...)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
}
|
package/srv/model-provider.js
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
const { packTarArchive, unpackTarArchive } = require('../lib/utils/resources')
|
|
2
|
-
const { collectFiles } = require('../libx/_runtime/extensibility/utils')
|
|
3
|
-
const fs = require('fs').promises
|
|
4
|
-
const os = require('os')
|
|
5
|
-
const path = require('path')
|
|
6
|
-
|
|
7
|
-
const cds = require('../lib')
|
|
8
|
-
const conf = cds.requires['cds.xt.ModelProviderService'] || cds.requires.kinds['cds.xt.ModelProviderService']
|
|
9
|
-
const main = conf.root ? new class { //> we're running in sidecar -> use env of main app
|
|
10
|
-
get env() { return super.env = cds.env.for ('cds', this.root) }
|
|
11
|
-
get root() { return super.root = path.resolve (cds.root, conf.root) }
|
|
12
|
-
get requires() { return super.requires = this.env.requires }
|
|
13
|
-
cache = {} //> for cds.resolve()
|
|
14
|
-
} : { //> not in sidecar
|
|
15
|
-
requires: cds.requires,
|
|
16
|
-
root: cds.root,
|
|
17
|
-
env: cds.env,
|
|
18
|
-
}
|
|
19
|
-
const fts = main.env.features.folders
|
|
20
|
-
const DEBUG = cds.debug('mtx')
|
|
21
|
-
if (DEBUG) cds.once('served', ()=> DEBUG ('model provider options:', conf))
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
module.exports = class ModelProviderService extends cds.ApplicationService {
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Overload `.on` to decorate handlers to set `cds.context.tenant` based on incoming arg `tenant`.
|
|
28
|
-
*/
|
|
29
|
-
on (event, handler) {
|
|
30
|
-
return super.on(event, (req) => {
|
|
31
|
-
if (req.data.tenant) cds.context = { tenant: req.data.tenant }
|
|
32
|
-
// REVISIT: might not be correct when called via ExtensibilityService.add(...)
|
|
33
|
-
//> const tenant = req.tenant || (req.user.is('internal-user') && req.data.tenant)
|
|
34
|
-
return handler(req)
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
init() {
|
|
39
|
-
|
|
40
|
-
// REVISIT: We should do the enforcement only in production
|
|
41
|
-
// let requires = this.definition['@requires_']
|
|
42
|
-
// if (requires && process.env.NODE_ENV === 'production') this.before ('*', req => {
|
|
43
|
-
// if (!cds.context?.http) return //> not called from external
|
|
44
|
-
// if (req.user._is_anonymous) return req.reject({ code:401 })
|
|
45
|
-
// if (!requires.some(r => req.user.is(r))) return req.reject({ code:403 })
|
|
46
|
-
// })
|
|
47
|
-
|
|
48
|
-
this._in_sidecar = (conf.kind === 'in-sidecar') // REVISIT: eliminate this 'private API' if possible
|
|
49
|
-
|
|
50
|
-
this.on('getCsn', req => _getCsn(req))
|
|
51
|
-
this.on('getExtCsn', req => {
|
|
52
|
-
if (!main.requires.extensibility) return req.reject(400, 'Missing extensibility parameter')
|
|
53
|
-
return _getCsn (req, true)
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
this.on('getEdmx', async req => {
|
|
57
|
-
const { res } = req._; if (res) res.set('Content-Type', 'application/xml')
|
|
58
|
-
const { service, locale, flavor } = req.data
|
|
59
|
-
delete req.data.flavor // we need to delete the OData 'flavor' argument, as getCsn has a different CSN `flavor` argument
|
|
60
|
-
const csn = await _getCsn(req)
|
|
61
|
-
const edmx = cds.compile.to.edmx(csn, { service, flavor })
|
|
62
|
-
return cds.localize(csn, locale, edmx)
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
this.on('getResources', async req => {
|
|
66
|
-
if (req._.res) req._.res.set('content-type', 'application/octet-stream; charset=binary')
|
|
67
|
-
// REVISIT: Works only w/o encoding parameter. Default encoding is 'utf8'.
|
|
68
|
-
// try { return await cds.utils.read('resources.tgz') }
|
|
69
|
-
// root is defined in cds.requires, in case of the sidecar scenario it is set to "_main"
|
|
70
|
-
try { return await fs.readFile (path.resolve (main.root, 'resources.tgz')) }
|
|
71
|
-
catch(e) { if (e.code !== 'ENOENT') throw e }
|
|
72
|
-
const files = Object.keys(await cds.deploy.resources(['*', cds.env.features.folders]))
|
|
73
|
-
if (!files.length) return req.reject(404)
|
|
74
|
-
if (req._.res) req._.res.set('content-type', 'application/octet-stream; charset=binary')
|
|
75
|
-
return packTarArchive (files, cds.root)
|
|
76
|
-
})
|
|
77
|
-
|
|
78
|
-
this.on('getExtResources', async req => {
|
|
79
|
-
if (!main.requires.extensibility) return req.reject(400, 'Missing extensibility parameter')
|
|
80
|
-
const rs = await SELECT('sources').from('cds.xt.Extensions')
|
|
81
|
-
if (!rs.length) return req.reject(404, 'Missing extensions')
|
|
82
|
-
if (rs.every(row => row.sources === null)) return req.reject(404, 'Extension resources not found')
|
|
83
|
-
if (req._.res) req._.res.set('content-type', 'application/octet-stream; charset=binary')
|
|
84
|
-
const tmp = await fs.realpath(os.tmpdir())
|
|
85
|
-
const dir = await fs.mkdtemp(tmp + path.sep + 'tar-') // REVISIT: hase to be exactly this folder -> weird
|
|
86
|
-
try {
|
|
87
|
-
await Promise.all (rs.map (row => unpackTarArchive (Buffer.from(row.sources), dir, false))) // REVISIT: use pipe instead
|
|
88
|
-
return await packTarArchive (collectFiles (dir, ['.csv', '.properties']), dir) // REVISIT: better tar APIs -> collectFiles should not be required
|
|
89
|
-
} finally {
|
|
90
|
-
await fs.rm (dir, { recursive: true, force: true }).catch(()=>{})
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
this.on('isExtended', async req => {
|
|
95
|
-
if (!main.requires.extensibility) return false
|
|
96
|
-
if (!req.data.tenant && main.requires.multitenancy) return false
|
|
97
|
-
const one = await SELECT.one(1).from('cds.xt.Extensions')
|
|
98
|
-
return !!one
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
this.on('getExtensions', async req => {
|
|
102
|
-
if (!main.requires.extensibility) return req.reject(400, 'Missing extensibility parameter')
|
|
103
|
-
return await _getExtensions4(req.data.tenant) || req.reject(404, 'Missing extensions')
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
/** Implementation for getCsn */
|
|
107
|
-
async function _getCsn (req, checkExt) {
|
|
108
|
-
const { tenant, toggles, base, flavor, for:javaornode } = req.data
|
|
109
|
-
const extensions = !base && await _getExtensions4 (req.data.tenant)
|
|
110
|
-
if (!extensions && checkExt) req.reject(404, 'Missing extensions')
|
|
111
|
-
|
|
112
|
-
const features = (!toggles || !main.requires.toggles) ? [] : toggles === '*' || toggles.includes('*') ? [fts] : toggles.map (f => fts.replace('*',f))
|
|
113
|
-
const models = cds.resolve (['*',...features], main); if (!models) return
|
|
114
|
-
|
|
115
|
-
DEBUG && DEBUG ('loading models for', { tenant, toggles } ,'from', models.map (cds.utils.local))
|
|
116
|
-
let csn = await cds.load (models, { flavor, silent:true })
|
|
117
|
-
if (csn.meta?.flavor === 'inferred') csn = cds.minify (csn)
|
|
118
|
-
if (extensions) csn = cds.extend (csn) .with (extensions)
|
|
119
|
-
if (javaornode) csn = cds.compile.for[javaornode] (csn)
|
|
120
|
-
|
|
121
|
-
// Dirty hack for cds.localize in Node sidecar setup
|
|
122
|
-
Object.defineProperty (csn,'$sources',{ value:csn.$sources, enumerable:true })
|
|
123
|
-
return csn
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** Implementation for getExtensions */
|
|
127
|
-
async function _getExtensions4 (tenant) {
|
|
128
|
-
if (!main.requires.extensibility || !tenant && main.requires.multitenancy) return
|
|
129
|
-
const exts = await SELECT('csn').from('cds.xt.Extensions'); if (!exts.length) return
|
|
130
|
-
const merged = { extensions: [], definitions: {} }
|
|
131
|
-
for (let each of exts) {
|
|
132
|
-
let {definitions,extensions} = JSON.parse(each.csn)
|
|
133
|
-
if (definitions) Object.assign (merged.definitions, definitions)
|
|
134
|
-
if (extensions) merged.extensions.push (...extensions)
|
|
135
|
-
}
|
|
136
|
-
return merged
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
get isExtensible () { return false } // REVISIT: Do we want to keep this?
|
|
142
|
-
}
|
|
143
|
-
module.exports.prototype._add_stub_methods = true
|