Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sap/cds-mtxs

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/cds-mtxs - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

13

CHANGELOG.md

@@ -9,2 +9,15 @@ # Change Log

## Version 2.0.4 - 2024-07-31
### Added
- `cds.requires['cds.xt.SaasProvisioningService'].alwaysUpgradeModel = false` will omit a model upgrade for SaaS registry updates.
### Fixed
- Better error message when Service Manager credentials cannot be resolved.
- `/-/cds/saas-provisioning/upgrade` will ignore tenants that do not exist in Service Manager any more and print out a warning.
- `cds.requires.html5-repo: true` will correctly set the subscription dependency out of the box.
- Scope check for `cds.xt.JobService.enqueue()´ is now more restrictive.
## Version 2.0.3 - 2024-07-19

@@ -11,0 +24,0 @@

4

env.js

@@ -77,2 +77,6 @@ const path = require('path')

},
"html5-repo": {
vcap: { label: "html5-apps-repo", plan: "app-runtime" },
subscriptionDependency: { uaa: 'xsappname' }
},

@@ -79,0 +83,0 @@ ////////////////////////////////////////////////////////////////////////

2

package.json
{
"name": "@sap/cds-mtxs",
"version": "2.0.3",
"version": "2.0.4",
"description": "SAP Cloud Application Programming Model - Multitenancy library",

@@ -5,0 +5,0 @@ "homepage": "https://cap.cloud.sap/",

@@ -25,5 +25,12 @@ const cds = require('@sap/cds/lib')

let tenantToDbUrl
if (cds.requires.db.kind === 'hana') {
if (cds.requires.db.kind === 'hana') { // REVISIT: HANA-specific, should be in HANA plugin
const hana = require('../plugins/hana/srv-mgr')
tenantToDbUrl = (await hana.getAll(tenants.length > 0 ? tenants : '*')).reduce((res, t) => {
const smTenants = (await hana.getAll(tenants.length > 0 ? tenants : '*')).filter(Boolean)
if (tenants.length !== smTenants.length) {
const smSet = new Set(smTenants.map(t => t.tenant_id ?? t.labels.tenant_id[0]))
const inconsistent = tenants.filter(t => !smSet.has(t))
if (inconsistent.length === 1) LOG.warn(`Warning: Tenant ${inconsistent[0]} does not exist in Service Manager any more and is therefore ignored. Make sure to unsubscribe the tenant.`)
else LOG.warn(`Warning: Tenants ${inconsistent.join(', ')} do not exist in Service Manager any more and is therefore ignored. Make sure to unsubscribe the tenants.`)
}
tenantToDbUrl = smTenants.reduce((res, t) => {
const id = t.tenant_id ?? t.labels.tenant_id[0]

@@ -30,0 +37,0 @@ if (!t.credentials) throw new Error('Credentials for tenant ' + id + ' are not available.')

@@ -20,2 +20,3 @@ const cds = require('@sap/cds/lib')

async _create(context) {
if (context.data.eventType === 'UPDATE' && cds.requires['cds.xt.SaasProvisioningService']?.alwaysUpgradeModel === false) return
return super._create(context, context.data)

@@ -22,0 +23,0 @@ }

@@ -8,3 +8,4 @@ const cds = require('@sap/cds/lib')

const { 'cds.xt.JobsService': js } = cds.services
return js.enqueue('extend', [new Set([tenant])], [csvs])
const tx = js.tx({ tenant: tenant ?? cds.context.tenant, user: new cds.User.Privileged() })
return tx.enqueue('extend', [new Set([tenant])], [csvs])
} else {

@@ -11,0 +12,0 @@ const { 'cds.xt.DeploymentService': ds } = cds.services

@@ -54,2 +54,3 @@ const { inspect } = require('util')

})
super.init()
}

@@ -56,0 +57,0 @@

@@ -302,2 +302,4 @@ const crypto = require('crypto')

}
return super.init()
}

@@ -304,0 +306,0 @@ }

@@ -20,3 +20,3 @@ const cds = require('@sap/cds/lib'), {db} = cds.env.requires

if (db?.kind === 'hana') {
if (!db.credentials?.sm_url) cds.error('No HANA credentials found. Make sure the application is bound to a BTP Service Manager instance.')
if (!db.credentials?.sm_url) cds.error('No Service Manager credentials found. Make sure the application is bound to a BTP Service Manager instance.')

@@ -23,0 +23,0 @@ const hana = require('./hana/srv-mgr')

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc