@sap/cds-compiler 4.0.2 → 4.2.2

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.
Files changed (101) hide show
  1. package/CHANGELOG.md +200 -5
  2. package/bin/cdsc.js +18 -15
  3. package/doc/CHANGELOG_BETA.md +16 -0
  4. package/doc/CHANGELOG_DEPRECATED.md +15 -0
  5. package/lib/api/main.js +33 -13
  6. package/lib/api/options.js +2 -2
  7. package/lib/api/validate.js +25 -25
  8. package/lib/base/location.js +6 -7
  9. package/lib/base/message-registry.js +123 -42
  10. package/lib/base/messages.js +18 -10
  11. package/lib/base/model.js +43 -10
  12. package/lib/checks/defaultValues.js +6 -6
  13. package/lib/checks/elements.js +11 -10
  14. package/lib/checks/foreignKeys.js +0 -5
  15. package/lib/checks/manyNavigations.js +33 -0
  16. package/lib/checks/onConditions.js +22 -14
  17. package/lib/checks/queryNoDbArtifacts.js +132 -73
  18. package/lib/checks/selectItems.js +4 -55
  19. package/lib/checks/sql-snippets.js +15 -4
  20. package/lib/checks/types.js +3 -3
  21. package/lib/checks/utils.js +4 -3
  22. package/lib/checks/validator.js +3 -1
  23. package/lib/compiler/.eslintrc.json +2 -1
  24. package/lib/compiler/assert-consistency.js +71 -40
  25. package/lib/compiler/base.js +7 -2
  26. package/lib/compiler/builtins.js +40 -41
  27. package/lib/compiler/checks.js +415 -367
  28. package/lib/compiler/classes.js +62 -0
  29. package/lib/compiler/cycle-detector.js +9 -9
  30. package/lib/compiler/define.js +124 -90
  31. package/lib/compiler/extend.js +115 -88
  32. package/lib/compiler/finalize-parse-cdl.js +26 -25
  33. package/lib/compiler/generate.js +57 -49
  34. package/lib/compiler/index.js +56 -56
  35. package/lib/compiler/kick-start.js +10 -7
  36. package/lib/compiler/moduleLayers.js +1 -1
  37. package/lib/compiler/populate.js +180 -144
  38. package/lib/compiler/propagator.js +10 -9
  39. package/lib/compiler/resolve.js +321 -246
  40. package/lib/compiler/shared.js +812 -433
  41. package/lib/compiler/tweak-assocs.js +114 -50
  42. package/lib/compiler/utils.js +241 -46
  43. package/lib/edm/.eslintrc.json +40 -1
  44. package/lib/edm/annotations/genericTranslation.js +721 -707
  45. package/lib/edm/annotations/preprocessAnnotations.js +88 -77
  46. package/lib/edm/csn2edm.js +389 -378
  47. package/lib/edm/edm.js +679 -770
  48. package/lib/edm/edmAnnoPreprocessor.js +132 -146
  49. package/lib/edm/edmInboundChecks.js +29 -27
  50. package/lib/edm/edmPreprocessor.js +689 -648
  51. package/lib/edm/edmUtils.js +279 -300
  52. package/lib/gen/Dictionary.json +34 -10
  53. package/lib/gen/language.checksum +1 -1
  54. package/lib/gen/language.interp +1 -1
  55. package/lib/gen/languageParser.js +2857 -2856
  56. package/lib/json/from-csn.js +77 -51
  57. package/lib/json/to-csn.js +15 -15
  58. package/lib/language/antlrParser.js +2 -1
  59. package/lib/language/genericAntlrParser.js +52 -43
  60. package/lib/language/language.g4 +61 -64
  61. package/lib/language/multiLineStringParser.js +2 -0
  62. package/lib/main.d.ts +65 -0
  63. package/lib/model/csnRefs.js +37 -19
  64. package/lib/model/csnUtils.js +51 -18
  65. package/lib/model/revealInternalProperties.js +30 -22
  66. package/lib/modelCompare/compare.js +149 -41
  67. package/lib/modelCompare/utils/filter.js +55 -25
  68. package/lib/optionProcessor.js +21 -9
  69. package/lib/render/manageConstraints.js +20 -17
  70. package/lib/render/toCdl.js +63 -23
  71. package/lib/render/toHdbcds.js +2 -2
  72. package/lib/render/toRename.js +4 -9
  73. package/lib/render/toSql.js +82 -35
  74. package/lib/render/utils/common.js +11 -9
  75. package/lib/render/utils/unique.js +52 -0
  76. package/lib/transform/db/applyTransformations.js +62 -21
  77. package/lib/transform/db/assertUnique.js +7 -8
  78. package/lib/transform/db/associations.js +2 -2
  79. package/lib/transform/db/cdsPersistence.js +9 -9
  80. package/lib/transform/db/constraints.js +47 -17
  81. package/lib/transform/db/expansion.js +138 -68
  82. package/lib/transform/db/flattening.js +98 -30
  83. package/lib/transform/db/rewriteCalculatedElements.js +20 -14
  84. package/lib/transform/db/temporal.js +1 -1
  85. package/lib/transform/db/transformExists.js +8 -7
  86. package/lib/transform/db/views.js +73 -33
  87. package/lib/transform/draft/db.js +11 -9
  88. package/lib/transform/draft/odata.js +1 -1
  89. package/lib/transform/{forOdataNew.js → forOdata.js} +10 -7
  90. package/lib/transform/forRelationalDB.js +148 -136
  91. package/lib/transform/localized.js +92 -54
  92. package/lib/transform/odata/toFinalBaseType.js +3 -3
  93. package/lib/transform/{transformUtilsNew.js → transformUtils.js} +13 -111
  94. package/lib/transform/translateAssocsToJoins.js +14 -28
  95. package/lib/utils/file.js +7 -7
  96. package/lib/utils/moduleResolve.js +210 -121
  97. package/lib/utils/objectUtils.js +1 -1
  98. package/package.json +5 -5
  99. package/share/messages/check-proper-type-of.md +1 -1
  100. package/share/messages/{check-proper-type.md → def-missing-type.md} +3 -5
  101. package/share/messages/message-explanations.json +1 -1
@@ -787,8 +787,7 @@
787
787
  ]
788
788
  },
789
789
  "Common.ValueListRelevantQualifiers": {
790
- "Type": "Collection(Core.SimpleIdentifier)",
791
- "$experimental": true
790
+ "Type": "Collection(Core.SimpleIdentifier)"
792
791
  },
793
792
  "Common.ValueListWithFixedValues": {
794
793
  "Type": "Core.Tag",
@@ -802,8 +801,7 @@
802
801
  "AppliesTo": [
803
802
  "Property",
804
803
  "Parameter"
805
- ],
806
- "$experimental": true
804
+ ]
807
805
  },
808
806
  "Common.ValueListReferences": {
809
807
  "Type": "Collection(Edm.String)",
@@ -1461,6 +1459,10 @@
1461
1459
  "Record"
1462
1460
  ]
1463
1461
  },
1462
+ "HTML5.LinkTarget": {
1463
+ "Type": "HTML5.LinkTargetType",
1464
+ "$experimental": true
1465
+ },
1464
1466
  "JSON.Schema": {
1465
1467
  "Type": "JSON.JSON",
1466
1468
  "AppliesTo": [
@@ -1561,15 +1563,13 @@
1561
1563
  "Type": "Edm.String",
1562
1564
  "AppliesTo": [
1563
1565
  "EntitySet"
1564
- ],
1565
- "$experimental": true
1566
+ ]
1566
1567
  },
1567
1568
  "PersonalData.DataSubjectRoleDescription": {
1568
1569
  "Type": "Edm.String",
1569
1570
  "AppliesTo": [
1570
1571
  "EntitySet"
1571
- ],
1572
- "$experimental": true
1572
+ ]
1573
1573
  },
1574
1574
  "PersonalData.FieldSemantics": {
1575
1575
  "Type": "PersonalData.FieldSemanticsType",
@@ -1834,8 +1834,7 @@
1834
1834
  "Type": "Edm.String",
1835
1835
  "AppliesTo": [
1836
1836
  "Property"
1837
- ],
1838
- "$experimental": true
1837
+ ]
1839
1838
  },
1840
1839
  "UI.TextArrangement": {
1841
1840
  "Type": "UI.TextArrangementType",
@@ -3435,6 +3434,31 @@
3435
3434
  "width": "Edm.String"
3436
3435
  }
3437
3436
  },
3437
+ "HTML5.LinkTargetType": {
3438
+ "$kind": "TypeDefinition",
3439
+ "UnderlyingType": "Edm.String",
3440
+ "$Allowed": {
3441
+ "Values": {
3442
+ "_self": {
3443
+ "Value": "_self",
3444
+ "Type": "String"
3445
+ },
3446
+ "_blank": {
3447
+ "Value": "_blank",
3448
+ "Type": "String"
3449
+ },
3450
+ "_parent": {
3451
+ "Value": "_parent",
3452
+ "Type": "String"
3453
+ },
3454
+ "_top": {
3455
+ "Value": "_top",
3456
+ "Type": "String"
3457
+ }
3458
+ },
3459
+ "Symbols": {}
3460
+ }
3461
+ },
3438
3462
  "JSON.JSON": {
3439
3463
  "$kind": "TypeDefinition",
3440
3464
  "UnderlyingType": "Edm.Stream"
@@ -1 +1 @@
1
- 8c23b0ea94048e8e7a54d2ed4a4e4707
1
+ 0c76b976c907bebf1f1913d063dca4bf