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 1.13.2 to 1.13.3

7

CHANGELOG.md

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

## Version 1.13.3 - 2023-12-05
### Fixed
- `PUT /-/cds/saas-provisioning/tenant` can now be used for upgrade purposes with shared deployment directories in non-extensible apps.
- `POST /-/cds/saas-provisioning/upgrade` correctly determines the deployment directory in non-extensible apps if just one tenant is passed in the request body.
## Version 1.13.2 - 2023-12-01

@@ -11,0 +18,0 @@

11

lib/migration/migration.js

@@ -10,2 +10,3 @@ const path = require('path')

const linter = require('../../srv/extensibility/linter')
const { t0_ } = require('../utils')

@@ -301,11 +302,3 @@ // REVISIT: Exported private functions

module.exports.addMetadata = async function addMetadata(tenant, metadata) {
const t0 = getT0()
// TODO Upsert ?
try {
await cds.tx({ tenant: t0 }, tx =>
tx.run(INSERT.into('cds.xt.Tenants', { ID: tenant, metadata: JSON.stringify(metadata) }))
)
} catch (e) {
if (e.message !== 'ENTITY_ALREADY_EXISTS') throw e
}
await t0_(UPSERT.into('cds.xt.Tenants', { ID: tenant, metadata: JSON.stringify(metadata) }))
}

@@ -312,0 +305,0 @@

{
"name": "@sap/cds-mtxs",
"version": "1.13.2",
"version": "1.13.3",
"description": "SAP Cloud Application Programming Model - Multitenancy library",

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

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

const all = tenantIds.includes('*')
const sharedGenDir = (all || tenantIds.length > 1) && !isExtensible
const sharedGenDir = !isExtensible
if (sharedGenDir) options.skipResources ??= sharedGenDir

@@ -129,4 +129,4 @@ const tenants = all ? await this._getTenants() : tenantIds

const { resources4, csvs4 } = require('../plugins/hana')
await resources4()
await csvs4()
await resources4('base')
await csvs4('base')
}

@@ -133,0 +133,0 @@ const { isSync } = parseHeaders(cds.context.http?.req.headers)

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

const { 'cds.xt.ModelProviderService': mp } = cds.services
const out = await fs.mkdirp ('gen',tenant ?? 'base')
const out = await fs.mkdirp ('gen',tenant)
try {

@@ -153,10 +153,6 @@ const rscs = await mp.getResources(true)

function _genDir4(tenant) {
return path.join('gen',tenant ?? 'base','src','gen')
}
async function csvs4(tenant) {
const csvs = await _readExtCsvs(tenant)
if (!csvs) return
const out = await fs.mkdirp (_genDir4(tenant),'data'), gen = []
const out = await fs.mkdirp ('gen',tenant,'src','gen','data'), gen = []
for (const [filename,csv] of Object.entries(csvs)) {

@@ -187,3 +183,3 @@ // store files in src/gen/data

async function build (csn, tenant, updateCsvs) {
const out = await fs.mkdirp(_genDir4(tenant)), gen = []
const out = await fs.mkdirp('gen',tenant,'src','gen'), gen = []
const options = { messages: [], sql_mapping: cds.env.sql.names, assertIntegrity:false }

@@ -212,3 +208,3 @@ const { definitions: hanaArtifacts } = cds.compiler.to.hdi.migration(csn, options);

const toHdbtabledata = cds.compile.to.hdbtabledata ?? require(path.join(cds.home, 'bin/build/provider/hana/2tabledata')) // cds@6 compatibility
const tdata = await toHdbtabledata(csn, { dirs: [path.join(_genDir4(tenant), 'data')] })
const tdata = await toHdbtabledata(csn, { dirs: [path.join(out, 'data')] })

@@ -231,3 +227,3 @@ for (const [data, { file, csvFolder }] of tdata) {

const out = await fs.mkdirp ('gen',isExtensible || tenant === t0 ? tenant : 'base')
const out = await fs.mkdirp ('gen', skipResources ? 'base' : tenant)

@@ -269,3 +265,3 @@ DEBUG?.('preparing HANA deployment artifacts')

LOG.info('finished HANA deployment artifact preparation')
LOG.info('finished HANA deployment artifact preparation at ' + out)
try {

@@ -272,0 +268,0 @@ // 3. hdi-deploy final build content

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