@sap/cds-compiler 6.9.2 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +86 -2
- package/bin/cdsc.js +4 -33
- package/doc/IncompatibleChanges_v7.md +639 -0
- package/lib/api/main.js +4 -56
- package/lib/api/options.js +6 -15
- package/lib/api/validate.js +1 -0
- package/lib/base/builtins.js +1 -2
- package/lib/base/csnRefs.js +2 -6
- package/lib/base/message-registry.js +82 -76
- package/lib/base/messages.js +23 -4
- package/lib/base/optionProcessor.js +2 -72
- package/lib/base/specialOptions.js +20 -17
- package/lib/checks/defaultValues.js +1 -39
- package/lib/checks/hasPersistedElements.js +19 -3
- package/lib/checks/parameters.js +0 -34
- package/lib/checks/selectItems.js +2 -38
- package/lib/checks/typeParameters.js +162 -0
- package/lib/checks/validator.js +5 -8
- package/lib/compiler/assert-consistency.js +19 -5
- package/lib/compiler/checks.js +47 -43
- package/lib/compiler/define.js +6 -6
- package/lib/compiler/extend.js +102 -111
- package/lib/compiler/generate.js +4 -8
- package/lib/compiler/populate.js +4 -7
- package/lib/compiler/propagator.js +9 -9
- package/lib/compiler/resolve.js +205 -7
- package/lib/compiler/shared.js +76 -82
- package/lib/compiler/tweak-assocs.js +102 -22
- package/lib/compiler/utils.js +57 -12
- package/lib/compiler/xpr-rewrite.js +2 -15
- package/lib/edm/annotations/edmJson.js +14 -10
- package/lib/edm/annotations/genericTranslation.js +3 -1
- package/lib/edm/annotations/preprocessAnnotations.js +9 -26
- package/lib/edm/csn2edm.js +27 -20
- package/lib/edm/edmUtils.js +25 -0
- package/lib/gen/CdlGrammar.checksum +1 -1
- package/lib/gen/CdlParser.js +2237 -2241
- package/lib/gen/Dictionary.json +17 -2
- package/lib/json/from-csn.js +67 -52
- package/lib/json/to-csn.js +28 -25
- package/lib/language/textUtils.js +0 -13
- package/lib/main.d.ts +34 -59
- package/lib/main.js +1 -1
- package/lib/model/csnUtils.js +9 -8
- package/lib/parsers/AstBuildingParser.js +45 -55
- package/lib/parsers/Lexer.js +2 -0
- package/lib/parsers/identifiers.js +0 -9
- package/lib/render/toCdl.js +41 -40
- package/lib/render/toSql.js +8 -1
- package/lib/render/utils/common.js +1 -1
- package/lib/render/utils/sql.js +2 -3
- package/lib/tool-lib/enrichCsn.js +1 -2
- package/lib/transform/db/applyTransformations.js +7 -5
- package/lib/transform/db/assertUnique.js +8 -51
- package/lib/transform/db/associations.js +1 -1
- package/lib/transform/db/cdsPersistence.js +1 -15
- package/lib/transform/db/expansion.js +9 -12
- package/lib/transform/db/flattening.js +1 -1
- package/lib/transform/db/groupByOrderBy.js +0 -16
- package/lib/transform/db/views.js +57 -161
- package/lib/transform/draft/db.js +2 -2
- package/lib/transform/forOdata.js +25 -14
- package/lib/transform/forRelationalDB.js +93 -301
- package/lib/transform/localized.js +33 -102
- package/lib/transform/odata/flattening.js +11 -2
- package/lib/transform/transformUtils.js +25 -3
- package/lib/transform/universalCsn/universalCsnEnricher.js +1 -2
- package/package.json +2 -2
- package/lib/render/toHdbcds.js +0 -1810
package/lib/edm/edmUtils.js
CHANGED
|
@@ -639,6 +639,30 @@ function isODataSimpleIdentifier( identifier ) {
|
|
|
639
639
|
return identifier && identifier.match(regex);
|
|
640
640
|
}
|
|
641
641
|
|
|
642
|
+
/**
|
|
643
|
+
* An OData V2 simple identifier is a Unicode character sequence with the following restrictions:
|
|
644
|
+
* - The first character MUST be any character in the Unicode category “Letter (L)” or “Letter number (Nl)”
|
|
645
|
+
* (underscore is NOT allowed as the first character, unlike V4)
|
|
646
|
+
* - The remaining characters MUST be any character in the Unicode category:
|
|
647
|
+
* “Letter (L)”,
|
|
648
|
+
* “Letter number (Nl)”,
|
|
649
|
+
* “Decimal number (Nd)”,
|
|
650
|
+
* “Non-spacing mark (Mn)”,
|
|
651
|
+
* “Combining spacing mark (Mc)”,
|
|
652
|
+
* “Connector punctuation (Pc)” (includes underscore U+005F),
|
|
653
|
+
* “Other, format (Cf)”
|
|
654
|
+
* - Maximum length is 480 characters
|
|
655
|
+
* source: CSDL 2.0 XML schema (TSimpleIdentifier pattern)
|
|
656
|
+
* https://learn.microsoft.com/en-us/openspecs/windows_protocols/mc-csdl/59d51c80-0cb7-4d18-80cb-ee2c3a4dcdf3
|
|
657
|
+
*
|
|
658
|
+
* @param {string} identifier
|
|
659
|
+
*/
|
|
660
|
+
function isODataV2SimpleIdentifier( identifier ) {
|
|
661
|
+
// this regular expression reflects the specification from above
|
|
662
|
+
const regex = /^[\p{Letter}\p{Nl}][\p{Letter}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,479}$/gu;
|
|
663
|
+
return identifier && identifier.match(regex);
|
|
664
|
+
}
|
|
665
|
+
|
|
642
666
|
/**
|
|
643
667
|
* Escape the given string for attribute values. We follow the spec as
|
|
644
668
|
* described in §2.3 <https://www.w3.org/TR/xml/#NT-AttValue>:
|
|
@@ -916,6 +940,7 @@ module.exports = {
|
|
|
916
940
|
mapCdsToEdmType,
|
|
917
941
|
addTypeFacets,
|
|
918
942
|
isODataSimpleIdentifier,
|
|
943
|
+
isODataV2SimpleIdentifier,
|
|
919
944
|
escapeStringForAttributeValue,
|
|
920
945
|
escapeStringForText,
|
|
921
946
|
getSchemaPrefix,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
230b7681d344570b9cdb67a5c9bb0f86
|