@sap/cds-compiler
Advanced tools
Comparing version 1.50.0 to 1.50.2
@@ -9,2 +9,17 @@ # ChangeLog for cdx compiler and backends | ||
## Version 1.50.2 - 2021-03-19 | ||
### Fixed | ||
- Correct calculation of dependent autoexposed entity name | ||
(fixing a potential regression with v1.50.0) | ||
- to.hdi.migration: Correctly handle "temporal" and other cases when rendering expressions | ||
- to.edm(x): | ||
+ Improve non-enum value handling on Oasis enum term definitions by raising a warning and rendering | ||
the value with appropriate scalar EDM type. | ||
+ Render annotion qualifier in JSON format. | ||
- Update OData vocabularies | ||
'Aggregation', 'Analytics', 'Capabilities', 'CodeList', 'Common', 'Communication', | ||
'Core', 'Graph', 'HTML5', 'ODM', 'PersonalData', 'Session', 'UI' | ||
## Version 1.50.0 - 2021-02-25 | ||
@@ -11,0 +26,0 @@ |
@@ -889,2 +889,7 @@ 'use strict'; | ||
if(isEnumType(dTypeName)) { | ||
const type = getDictType(dTypeName); | ||
message(warning, context, `found non-enum value "${val}", expected ${type.Members.map(m=>`"#${m}"`).join(', ')} for ${dTypeName}`); | ||
} | ||
let typeName = 'String'; | ||
@@ -967,3 +972,3 @@ | ||
typeName = 'Int'; | ||
if(dTypeName == undefined || dTypeName === 'Edm.PrimitiveType') | ||
if(dTypeName == undefined || dTypeName === 'Edm.PrimitiveType' || !dTypeName.startsWith('Edm.')) | ||
dTypeName = 'Edm.Int64'; | ||
@@ -973,3 +978,3 @@ } | ||
typeName = 'Float'; | ||
if(dTypeName == undefined || dTypeName === 'Edm.PrimitiveType') | ||
if(dTypeName == undefined || dTypeName === 'Edm.PrimitiveType'|| !dTypeName.startsWith('Edm.')) | ||
dTypeName = 'Edm.Double'; | ||
@@ -976,0 +981,0 @@ } |
@@ -479,4 +479,2 @@ 'use strict'; | ||
functionImport.setXml( {'m:HttpMethod': 'POST'}); | ||
else | ||
throw Error('Please debug me: Neither function nor action'); | ||
@@ -483,0 +481,0 @@ if(entityCsn != undefined) |
@@ -1114,3 +1114,3 @@ // @ts-nocheck | ||
if(expr.length === 0) | ||
throw Error('Please debug me: neither child nor constant expression found on annotation'); | ||
throw Error('Please debug me: neither child nor constant expression found on annotation: ' + JSON.stringify(this._jsonOnlyAttributes, null, 2)); | ||
return addExpressions(expr, this._jsonOnlyAttributes); | ||
@@ -1172,3 +1172,6 @@ | ||
{ | ||
this._children.forEach(a => json['@' + a.Term] = a.toJSON()) | ||
this._children.forEach(a => { | ||
const name = '@' + a.Term + (a.Qualifier ? '#' + a.Qualifier : ''); | ||
json[name] = a.toJSON() | ||
}) | ||
} | ||
@@ -1175,0 +1178,0 @@ } |
@@ -162,3 +162,3 @@ // For testing: reveal non-enumerable properties in CSN, display result of csnRefs | ||
if (!isMember && node.$location) { | ||
const value = locationString( node.$location ); | ||
const value = locationString( node.$location, true ); | ||
reveal( node, '$location', value ); | ||
@@ -165,0 +165,0 @@ loc = value + '-'; |
@@ -839,3 +839,3 @@ | ||
if(leaf && env._artifact.elements[leaf] && env._artifact.elements[leaf].virtual) { | ||
const renderVirtual = options.forHana && isBetaEnabled(options, 'dontRenderVirtualElements') ? !!options.forHana.renderVirtualElements : true; | ||
const renderVirtual = options.toSql && isBetaEnabled(options, 'dontRenderVirtualElements') ? !!options.toSql.renderVirtualElements : true; | ||
if(renderVirtual) | ||
@@ -1132,3 +1132,3 @@ // render a virtual column 'null as <alias>' | ||
else if (typeof x === 'object' && x !== null) { | ||
if (options.forHana && nestedExpr && x.cast && x.cast.type) | ||
if (nestedExpr && x.cast && x.cast.type) | ||
return renderExplicitTypeCast(renderExprObject()); | ||
@@ -1188,3 +1188,3 @@ return renderExprObject(); | ||
else if (x.ref) { | ||
if (options.forHana && !x.param && !x.global) { | ||
if (!x.param && !x.global) { | ||
if(x.ref[0] === '$user') { | ||
@@ -1199,3 +1199,3 @@ // FIXME: this is all not enough: we might need an explicit select item alias | ||
} else { | ||
if(options.forHana.dialect === 'sqlite'){ | ||
if(options.toSql.dialect === 'sqlite'){ | ||
signal(warning`The "$user" variable is not supported by SQLite. Use the "toSql.user" option to set a value for "$user.id"`); | ||
@@ -1209,3 +1209,3 @@ return `'$user.id'`; | ||
else if (x.ref[1] === 'locale') { | ||
return options.forHana.dialect === 'sqlite' | ||
return options.toSql.dialect === 'sqlite' | ||
? options.toSql.user && options.toSql.user.locale | ||
@@ -1218,6 +1218,6 @@ ? `'${options.toSql.user && options.toSql.user.locale}'` : `'en'` | ||
// return current_time for all $at | ||
if(options.forHana.dialect === 'sqlite') { | ||
if(options.toSql.dialect === 'sqlite') { | ||
return 'current_timestamp'; | ||
} | ||
else if(options.forHana.dialect === 'hana') { | ||
else if(options.toSql.dialect === 'hana') { | ||
if(x.ref[1] === 'from') { | ||
@@ -1224,0 +1224,0 @@ return "SESSION_CONTEXT('VALID-FROM')"; |
{ | ||
"name": "@sap/cds-compiler", | ||
"version": "1.50.0", | ||
"version": "1.50.2", | ||
"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
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3853098
74199