@sap/cds-compiler
Advanced tools
Comparing version 1.49.2 to 1.50.0
@@ -9,2 +9,10 @@ # ChangeLog for cdx compiler and backends | ||
## Version 1.50.0 - 2021-02-25 | ||
### Added | ||
- Introduce annotation `@cds.redirection.target`. | ||
With value `false`, the projection is not considered an implicit redirection target; | ||
with value `true`, is is considered a “preferred” redirection target. | ||
## Version 1.49.2 - 2021-02-16 | ||
@@ -11,0 +19,0 @@ |
@@ -217,6 +217,6 @@ /** @module API */ | ||
* | ||
* @param {CSN.Model} csn A clean input CSN representing the desired "after-image" | ||
* @param {CSN.Model} beforeImage A HANA-transformed CSN representing the "before-image", or null in case no such image | ||
* @param {CSN.Model} csn A clean input CSN representing the desired "after-image" | ||
* @param {hdiOptions} options Options | ||
* @param {CSN.Model} beforeImage A HANA-transformed CSN representing the "before-image", or null in case no such image | ||
* is known, i.e. for the very first migration step | ||
* @param {hdiOptions} [options={}] Options | ||
* @returns {object} - afterImage: The desired after-image in HANA-CSN format | ||
@@ -234,3 +234,28 @@ * - definitions: An array of objects with all artifacts in the after-image. Each object specifies | ||
*/ | ||
function hdiMigration(csn, beforeImage, options = {}) { | ||
function hdiMigration(csn, options, beforeImage) { | ||
/** | ||
* Swap arguments in case of inverted argument order. | ||
* This is for backward compatibility with @sap/cds@4.5.(2…3). | ||
* | ||
* @todo Remove in cds-compiler@2.x | ||
* @param {hdiOptions|CSN.Model} inputOptions Options or CSN image | ||
* @param {CSN.Model|hdiOptions} inputBeforeImage CSN image or options | ||
* @returns {Array} Array where the real options come first | ||
*/ | ||
function backwardCompatible(inputOptions, inputBeforeImage) { | ||
/** | ||
* Check wether the given argument is a CSN | ||
* | ||
* @param {object} arg Argument to verify | ||
* @returns {boolean} True if it is a CSN | ||
*/ | ||
function isBeforeImage(arg) { | ||
return arg === null || [ 'definitions', 'meta', '$version' ].some(key => key in arg); | ||
} | ||
return isBeforeImage(inputBeforeImage) | ||
? [ inputOptions, inputBeforeImage ] | ||
: [ inputBeforeImage, inputOptions ]; | ||
} | ||
[ options, beforeImage ] = backwardCompatible(options, beforeImage); | ||
const internalOptions = prepareOptions.to.hdi(options); | ||
@@ -237,0 +262,0 @@ internalOptions.toSql.csn = true; |
@@ -22,2 +22,3 @@ // | ||
'@cds.autoexposed': never, // in case people set it themselves | ||
'@cds.redirection.target': never, | ||
'@fiori.draft.enabled': onlyViaArtifact, | ||
@@ -24,0 +25,0 @@ '@': withKind, // always except in 'returns' and 'items' |
{ | ||
"name": "@sap/cds-compiler", | ||
"version": "1.49.2", | ||
"version": "1.50.0", | ||
"description": "CDS (Core Data Services) compiler and backends", | ||
"homepage": "https://cap.cloud.sap/", | ||
"author": "SAP SE (https://www.sap.com)", | ||
"license": "See LICENSE file", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"bin": { | ||
@@ -9,0 +9,0 @@ "cdsc": "bin/cdsc.js", |
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
3850076
74125