@sap/cds-compiler 3.5.4 → 3.6.0

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 (83) hide show
  1. package/CHANGELOG.md +56 -2
  2. package/bin/cdsc.js +14 -6
  3. package/doc/CHANGELOG_ARCHIVE.md +10 -10
  4. package/doc/CHANGELOG_DEPRECATED.md +2 -2
  5. package/lib/api/main.js +32 -55
  6. package/lib/api/validate.js +5 -0
  7. package/lib/base/message-registry.js +104 -32
  8. package/lib/base/messages.js +277 -212
  9. package/lib/base/optionProcessorHelper.js +9 -2
  10. package/lib/base/shuffle.js +50 -0
  11. package/lib/checks/actionsFunctions.js +37 -20
  12. package/lib/checks/foreignKeys.js +13 -6
  13. package/lib/checks/nonexpandableStructured.js +1 -2
  14. package/lib/checks/onConditions.js +21 -19
  15. package/lib/checks/parameters.js +1 -1
  16. package/lib/checks/queryNoDbArtifacts.js +2 -0
  17. package/lib/checks/types.js +16 -22
  18. package/lib/compiler/assert-consistency.js +31 -28
  19. package/lib/compiler/builtins.js +20 -4
  20. package/lib/compiler/checks.js +72 -63
  21. package/lib/compiler/define.js +396 -314
  22. package/lib/compiler/extend.js +55 -49
  23. package/lib/compiler/index.js +5 -0
  24. package/lib/compiler/populate.js +28 -11
  25. package/lib/compiler/propagator.js +2 -1
  26. package/lib/compiler/resolve.js +28 -13
  27. package/lib/compiler/shared.js +15 -10
  28. package/lib/compiler/utils.js +7 -7
  29. package/lib/edm/annotations/genericTranslation.js +51 -46
  30. package/lib/edm/annotations/preprocessAnnotations.js +37 -40
  31. package/lib/edm/csn2edm.js +69 -21
  32. package/lib/edm/edm.js +2 -2
  33. package/lib/edm/edmInboundChecks.js +6 -8
  34. package/lib/edm/edmPreprocessor.js +88 -80
  35. package/lib/edm/edmUtils.js +6 -15
  36. package/lib/gen/Dictionary.json +81 -13
  37. package/lib/gen/language.checksum +1 -1
  38. package/lib/gen/language.interp +2 -1
  39. package/lib/gen/languageParser.js +4680 -4484
  40. package/lib/inspect/inspectModelStatistics.js +2 -1
  41. package/lib/inspect/inspectPropagation.js +2 -1
  42. package/lib/json/from-csn.js +131 -78
  43. package/lib/json/to-csn.js +39 -23
  44. package/lib/language/antlrParser.js +0 -3
  45. package/lib/language/docCommentParser.js +7 -3
  46. package/lib/language/errorStrategy.js +3 -2
  47. package/lib/language/genericAntlrParser.js +96 -41
  48. package/lib/language/language.g4 +112 -128
  49. package/lib/language/multiLineStringParser.js +2 -1
  50. package/lib/main.d.ts +115 -2
  51. package/lib/main.js +16 -3
  52. package/lib/model/csnRefs.js +3 -3
  53. package/lib/model/csnUtils.js +109 -179
  54. package/lib/model/enrichCsn.js +13 -8
  55. package/lib/model/revealInternalProperties.js +4 -3
  56. package/lib/optionProcessor.js +19 -3
  57. package/lib/render/manageConstraints.js +11 -15
  58. package/lib/render/toCdl.js +144 -47
  59. package/lib/render/toHdbcds.js +22 -22
  60. package/lib/render/toRename.js +3 -4
  61. package/lib/render/toSql.js +29 -20
  62. package/lib/render/utils/delta.js +3 -1
  63. package/lib/render/utils/sql.js +2 -14
  64. package/lib/transform/db/associations.js +6 -6
  65. package/lib/transform/db/cdsPersistence.js +3 -3
  66. package/lib/transform/db/constraints.js +4 -6
  67. package/lib/transform/db/expansion.js +4 -4
  68. package/lib/transform/db/flattening.js +12 -15
  69. package/lib/transform/db/temporal.js +4 -3
  70. package/lib/transform/db/transformExists.js +2 -1
  71. package/lib/transform/draft/db.js +7 -7
  72. package/lib/transform/forOdataNew.js +15 -4
  73. package/lib/transform/forRelationalDB.js +53 -39
  74. package/lib/transform/odata/toFinalBaseType.js +106 -82
  75. package/lib/transform/odata/typesExposure.js +26 -17
  76. package/lib/transform/odata/utils.js +1 -1
  77. package/lib/transform/parseExpr.js +1 -1
  78. package/lib/transform/transformUtilsNew.js +33 -10
  79. package/lib/transform/translateAssocsToJoins.js +8 -7
  80. package/lib/transform/universalCsn/coreComputed.js +7 -5
  81. package/lib/transform/universalCsn/universalCsnEnricher.js +12 -4
  82. package/lib/utils/timetrace.js +2 -2
  83. package/package.json +1 -2
@@ -779,7 +779,7 @@
779
779
  ]
780
780
  },
781
781
  "Common.ValueListRelevantQualifiers": {
782
- "Type": "Collection(Common.SimpleIdentifier)",
782
+ "Type": "Collection(Core.SimpleIdentifier)",
783
783
  "$experimental": true
784
784
  },
785
785
  "Common.ValueListWithFixedValues": {
@@ -956,7 +956,7 @@
956
956
  ]
957
957
  },
958
958
  "Common.DraftActivationVia": {
959
- "Type": "Collection(Common.SimpleIdentifier)",
959
+ "Type": "Collection(Core.SimpleIdentifier)",
960
960
  "AppliesTo": [
961
961
  "EntitySet"
962
962
  ]
@@ -1499,8 +1499,22 @@
1499
1499
  ],
1500
1500
  "$experimental": true
1501
1501
  },
1502
+ "ODM.oid": {
1503
+ "Type": "Edm.PropertyPath",
1504
+ "AppliesTo": [
1505
+ "EntityType"
1506
+ ],
1507
+ "$experimental": true
1508
+ },
1509
+ "ODM.entityName": {
1510
+ "Type": "Edm.String",
1511
+ "AppliesTo": [
1512
+ "EntityType"
1513
+ ],
1514
+ "$experimental": true
1515
+ },
1502
1516
  "Offline.ClientOnly": {
1503
- "Type": "Core.Tag",
1517
+ "Type": "Offline.ClientOnlyType",
1504
1518
  "AppliesTo": [
1505
1519
  "EntityType",
1506
1520
  "EntitySet",
@@ -1860,6 +1874,15 @@
1860
1874
  "NavigationProperty"
1861
1875
  ]
1862
1876
  },
1877
+ "UI.AdaptationHidden": {
1878
+ "Type": "Core.Tag",
1879
+ "AppliesTo": [
1880
+ "Property",
1881
+ "EntitySet",
1882
+ "EntityType"
1883
+ ],
1884
+ "$experimental": true
1885
+ },
1863
1886
  "UI.DataFieldDefault": {
1864
1887
  "Type": "UI.DataFieldAbstract",
1865
1888
  "AppliesTo": [
@@ -2057,8 +2080,8 @@
2057
2080
  "$kind": "ComplexType",
2058
2081
  "Properties": {
2059
2082
  "Property": "Edm.PropertyPath",
2060
- "SupportedAggregationMethods": "Collection(Edm.String)",
2061
- "RecommendedAggregationMethod": "Edm.String"
2083
+ "SupportedAggregationMethods": "Collection(Aggregation.AggregationMethod)",
2084
+ "RecommendedAggregationMethod": "Aggregation.AggregationMethod"
2062
2085
  }
2063
2086
  },
2064
2087
  "Aggregation.RecursiveHierarchyType": {
@@ -2112,6 +2135,35 @@
2112
2135
  "$deprecated": true,
2113
2136
  "$deprecationText": "Deprecated since [`NavigationPropertyAggregationCapabilities`](#NavigationPropertyAggregationCapabilities) is also deprecated"
2114
2137
  },
2138
+ "Aggregation.AggregationMethod": {
2139
+ "$kind": "TypeDefinition",
2140
+ "UnderlyingType": "Edm.String",
2141
+ "$Allowed": {
2142
+ "Values": {
2143
+ "sum": {
2144
+ "Value": "sum",
2145
+ "Type": "String"
2146
+ },
2147
+ "min": {
2148
+ "Value": "min",
2149
+ "Type": "String"
2150
+ },
2151
+ "max": {
2152
+ "Value": "max",
2153
+ "Type": "String"
2154
+ },
2155
+ "average": {
2156
+ "Value": "average",
2157
+ "Type": "String"
2158
+ },
2159
+ "countdistinct": {
2160
+ "Value": "countdistinct",
2161
+ "Type": "String"
2162
+ }
2163
+ },
2164
+ "Symbols": {}
2165
+ }
2166
+ },
2115
2167
  "Aggregation.RollupType": {
2116
2168
  "$kind": "EnumType",
2117
2169
  "Members": [
@@ -2123,8 +2175,8 @@
2123
2175
  "Analytics.AggregatedPropertyType": {
2124
2176
  "$kind": "ComplexType",
2125
2177
  "Properties": {
2126
- "Name": "Common.SimpleIdentifier",
2127
- "AggregationMethod": "Edm.String",
2178
+ "Name": "Core.SimpleIdentifier",
2179
+ "AggregationMethod": "Aggregation.AggregationMethod",
2128
2180
  "AggregatableProperty": "Edm.PropertyPath"
2129
2181
  }
2130
2182
  },
@@ -2753,8 +2805,8 @@
2753
2805
  "DistinctValuesSupported": "Edm.Boolean",
2754
2806
  "SearchSupported": "Edm.Boolean",
2755
2807
  "FetchValues": "Common.FetchValuesType",
2756
- "PresentationVariantQualifier": "Common.SimpleIdentifier",
2757
- "SelectionVariantQualifier": "Common.SimpleIdentifier",
2808
+ "PresentationVariantQualifier": "Core.SimpleIdentifier",
2809
+ "SelectionVariantQualifier": "Core.SimpleIdentifier",
2758
2810
  "Parameters": "Collection(Common.ValueListParameter)"
2759
2811
  }
2760
2812
  },
@@ -2765,8 +2817,8 @@
2765
2817
  "CollectionPath": "Edm.String",
2766
2818
  "DistinctValuesSupported": "Edm.Boolean",
2767
2819
  "FetchValues": "Common.FetchValuesType",
2768
- "PresentationVariantQualifier": "Common.SimpleIdentifier",
2769
- "SelectionVariantQualifier": "Common.SimpleIdentifier",
2820
+ "PresentationVariantQualifier": "Core.SimpleIdentifier",
2821
+ "SelectionVariantQualifier": "Core.SimpleIdentifier",
2770
2822
  "Parameters": "Collection(Common.ValueListParameter)"
2771
2823
  }
2772
2824
  },
@@ -2924,7 +2976,9 @@
2924
2976
  },
2925
2977
  "Common.SimpleIdentifier": {
2926
2978
  "$kind": "TypeDefinition",
2927
- "UnderlyingType": "Edm.String"
2979
+ "UnderlyingType": "Edm.String",
2980
+ "$deprecated": true,
2981
+ "$deprecationText": "Use type [Core.SimpleIdentifier](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#SimpleIdentifier) instead"
2928
2982
  },
2929
2983
  "Common.QualifiedName": {
2930
2984
  "$kind": "TypeDefinition",
@@ -3374,6 +3428,19 @@
3374
3428
  "Symbols": {}
3375
3429
  }
3376
3430
  },
3431
+ "Offline.ClientOnlyType": {
3432
+ "$kind": "ComplexType",
3433
+ "Properties": {},
3434
+ "$experimental": true
3435
+ },
3436
+ "Offline.LocalDraft": {
3437
+ "$kind": "ComplexType",
3438
+ "BaseType": "Offline.ClientOnlyType",
3439
+ "Properties": {
3440
+ "ActiveEntitySet": "Core.SimpleIdentifier"
3441
+ },
3442
+ "$experimental": true
3443
+ },
3377
3444
  "PDF.FeaturesType": {
3378
3445
  "$kind": "ComplexType",
3379
3446
  "Properties": {
@@ -3387,6 +3454,7 @@
3387
3454
  "Margin": "Edm.Boolean",
3388
3455
  "Border": "Edm.Boolean",
3389
3456
  "FitToPage": "Edm.Boolean",
3457
+ "Padding": "Edm.Boolean",
3390
3458
  "ResultSizeDefault": "Edm.Int32",
3391
3459
  "ResultSizeMaximum": "Edm.Int32"
3392
3460
  }
@@ -3456,7 +3524,7 @@
3456
3524
  "AdditionalNewActions": "Collection(Common.QualifiedName)",
3457
3525
  "EditAction": "Common.QualifiedName",
3458
3526
  "SaveAction": "Common.QualifiedName",
3459
- "DiscardAction": "Common.SimpleIdentifier"
3527
+ "DiscardAction": "Core.SimpleIdentifier"
3460
3528
  }
3461
3529
  },
3462
3530
  "UI.HeaderInfoType": {
@@ -1 +1 @@
1
- bdbb2e738b68d13dc2f0f03c0caf5fc0
1
+ 7c3a66be27eceea68bf48c9f4eba8164