Socket
Socket
Sign inDemoInstall

@sap/cds-compiler

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sap/cds-compiler - npm Package Compare versions

Comparing version 3.9.6 to 3.9.8

lib/checks/manyNavigations.js

9

CHANGELOG.md

@@ -10,3 +10,12 @@ # ChangeLog for cds compiler and backends

## Version 3.9.8 - 2023-08-03
### Fixed
- to.edm(x):
+ Don't expand `@mandatory` if element has an annotation with prefix `@Common.FieldControl.`.
+ Fix a bug when referencing nested many structures, especially referring to a managed association via
`$self` comparison.
- to.sql/hdi/hdbcds: Detect navigation into arrayed structures and raise helpful errors instead of running into internal errors.
## Version 3.9.6 - 2023-07-27

@@ -13,0 +22,0 @@

4

lib/base/message-registry.js

@@ -119,2 +119,3 @@ // Central registry for messages.

'ref-autoexposed': { severity: 'Error', configurableFor: 'deprecated' },
'ref-unexpected-many-navigation': { severity: 'Error' },
// Published! Used in @sap/cds-lsp; if renamed, add to oldMessageIds and contact colleagues

@@ -525,2 +526,5 @@ 'ref-undefined-art': { severity: 'Error' },

},
'ref-unexpected-many-navigation': {
std: 'Unexpected navigation into arrayed structure',
},
'ref-unexpected-scope': {

@@ -527,0 +531,0 @@ std: 'Unexpected parameter reference',

3

lib/checks/validator.js

@@ -14,2 +14,3 @@ 'use strict';

const validateCdsPersistenceAnnotation = require('./cdsPersistence');
const navigationIntoMany = require('./manyNavigations');
const checkUsedTypesForAnonymousAspectComposition = require('./managedInType');

@@ -75,3 +76,3 @@ const validateHasPersistedElements = require('./hasPersistedElements');

const forRelationalDBCsnValidators = [ nonexpandableStructuredInExpression ];
const forRelationalDBCsnValidators = [ nonexpandableStructuredInExpression, navigationIntoMany ];
/**

@@ -78,0 +79,0 @@ * @type {Array<(query: CSN.Query, path: CSN.Path) => void>}

@@ -1121,3 +1121,3 @@ 'use strict'

// $abspath[0] is main entity
this._edmAttributes.Partner = partner.$abspath.slice(1).join(options.pathDelimiter);
this._edmAttributes.Partner = partner.$abspath.slice(1).join('/');
}

@@ -1124,0 +1124,0 @@

@@ -767,10 +767,10 @@ 'use strict';

// This is a poor mans path resolver for $self partner paths only
function resolveOriginAssoc(csn, env, path) {
for(const segment of path) {
let elements = (env.items && env.items.elements || env.elements);
if(elements)
env = env.elements[segment];
let type = (env.items && env.items.type || env.type);
if(type && !isBuiltinType(type) && !(env.items && env.items.elements || env.elements))
env = csn.definitions[env.type];
function resolveOriginAssoc( csn, env, path ) {
for (const segment of path) {
const elements = (env?.items?.elements || env?.elements);
if (elements)
env = elements[segment];
const type = (env?.items?.type || env?.type);
if (type && !isBuiltinType(type) && !(env?.items?.elements || env?.elements))
env = csn.definitions[type];
}

@@ -777,0 +777,0 @@ return env;

@@ -55,3 +55,3 @@ 'use strict';

* @param {object | Array} _parent the thing that has _prop
* @param {string|number} _prop the name of the current property
* @param {string|number} _prop the name of the current property or index
* @param {object} node The value of node[_prop]

@@ -58,0 +58,0 @@ */

@@ -369,5 +369,7 @@ 'use strict';

}
// Only on element level: translate @mandatory
// Only on element level: translate @mandatory
if (node['@mandatory'] &&
node.kind === undefined && node['@Common.FieldControl'] === undefined) {
node.kind === undefined &&
!Object.entries(node).some(([k,v]) => k === '@Common.FieldControl' || k.startsWith('@Common.FieldControl.') && v != null)) {
setAnnotation(node, '@Common.FieldControl', { '#': 'Mandatory' });

@@ -374,0 +376,0 @@ }

{
"name": "@sap/cds-compiler",
"version": "3.9.6",
"version": "3.9.8",
"description": "CDS (Core Data Services) compiler and backends",

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

Sorry, the diff of this file is too big to display

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