@sap/cds-mtx
Advanced tools
Comparing version 2.6.3 to 2.6.4
@@ -9,2 +9,9 @@ # Change Log | ||
## Version 2.6.4 - 2022-11-17 | ||
### Fixed | ||
- Full tenant metadata is stored again when running the subscription from CAP java | ||
- APIs can now be run without express app | ||
- Improved filter for technical tenants when getting all tenant ids | ||
## Version 2.6.3 - 2022-10-18 | ||
@@ -11,0 +18,0 @@ |
@@ -104,9 +104,13 @@ const path = require('path'); | ||
function _in(service, app) { | ||
return app ? service.in(app) : service; | ||
} | ||
// temporary fix for payload limit problem | ||
app.use('/mtx/*', express.json({ limit: '500mb' })); | ||
if (app) app.use('/mtx/*', express.json({ limit: '500mb' })); | ||
if (cds.env.mtx && cds.env.mtx.api && cds.env.mtx.api.provisioning) { | ||
Index.logger.debug('Provisioning API configured'); | ||
await (Index.provisioning(serveOptions)).in(app); | ||
await (Index.internalProvisioning(serveOptions)).in(app); | ||
await _in(Index.provisioning(serveOptions), app) | ||
await _in(Index.internalProvisioning(serveOptions), app); | ||
} | ||
@@ -116,3 +120,3 @@ | ||
Index.logger.debug('Metadata API configured'); | ||
await (Index.metadata(serveOptions)).in(app); | ||
await _in(Index.metadata(serveOptions), app); | ||
} | ||
@@ -122,3 +126,3 @@ | ||
Index.logger.debug('Model API configured'); | ||
await (Index.model(serveOptions)).in(app); | ||
await _in(Index.model(serveOptions), app); | ||
} | ||
@@ -128,3 +132,3 @@ | ||
Index.logger.debug('Model Provider API configured'); | ||
await (Index.modelprovider(serveOptions)).in(app); | ||
await _in(Index.modelprovider(serveOptions), app); | ||
} | ||
@@ -134,3 +138,3 @@ | ||
Index.logger.debug('Diagnosis API configured'); | ||
await (Index.diagnose(serveOptions)).in(app); | ||
await _in(Index.diagnose(serveOptions), app); | ||
} | ||
@@ -167,3 +171,3 @@ | ||
app.get('/mtx/v1/oauth/token', getJwtToken); | ||
if (app) app.get('/mtx/v1/oauth/token', getJwtToken); | ||
}, | ||
@@ -170,0 +174,0 @@ |
@@ -170,9 +170,15 @@ const cds = require('@sap/cds'); | ||
static _tenantFilter(tenantId) { | ||
const t0 = (cds.env.requires.multitenancy && cds.env.requires.multitenancy.t0) || 't0' | ||
return tenantId | ||
&& !META_TENANT_REGEX.test(tenantId) | ||
&& !MT_LIB_TENANT_REGEX.test(tenantId) | ||
&& tenantId.toLowerCase() !== GLOBAL_DATA_META_TENANT.toLowerCase() | ||
&& tenantId !== t0 | ||
} | ||
static async getAllWithMetadata() { | ||
const tenantsArray = (await GlobalConnections.applicationDataPersistence.getAllTenants()) | ||
.filter(({tenant_id}) => | ||
!META_TENANT_REGEX.test(tenant_id) && | ||
!MT_LIB_TENANT_REGEX.test(tenant_id) && | ||
tenant_id.toLowerCase() !== GLOBAL_DATA_META_TENANT.toLowerCase() | ||
); | ||
.filter(({tenant_id}) => this._tenantFilter(tenant_id)); | ||
const tenantToDbDescriminator = tenantsArray.reduce((result, current) => { | ||
@@ -207,8 +213,3 @@ result[current.tenant_id] = `${current.credentials.host}:${current.credentials.port}`; | ||
.map(tenant => tenant.tenant_id) | ||
.filter(tenantId => | ||
tenantId && | ||
!META_TENANT_REGEX.test(tenantId) && | ||
!MT_LIB_TENANT_REGEX.test(tenantId) && | ||
tenantId.toLowerCase() !== GLOBAL_DATA_META_TENANT.toLowerCase() | ||
); | ||
.filter(this._tenantFilter); | ||
} | ||
@@ -215,0 +216,0 @@ |
{ | ||
"name": "@sap/cds-mtx", | ||
"version": "2.6.3", | ||
"version": "2.6.4", | ||
"homepage": "https://cap.cloud.sap/", | ||
@@ -5,0 +5,0 @@ "author": "SAP SE (https://www.sap.com)", |
Sorry, the diff of this file is not supported yet
318540
5900