@sap/cds-compiler 4.9.6 → 5.1.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 (95) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/bin/cds_remove_invalid_whitespace.js +2 -1
  3. package/bin/cdsc.js +49 -19
  4. package/bin/cdshi.js +3 -1
  5. package/doc/CHANGELOG_BETA.md +7 -0
  6. package/lib/api/main.js +16 -19
  7. package/lib/api/options.js +5 -14
  8. package/lib/api/trace.js +0 -1
  9. package/lib/base/builtins.js +1 -0
  10. package/lib/base/location.js +4 -1
  11. package/lib/base/message-registry.js +43 -29
  12. package/lib/base/messages.js +23 -26
  13. package/lib/base/meta.js +10 -0
  14. package/lib/base/model.js +0 -2
  15. package/lib/base/node-helpers.js +0 -1
  16. package/lib/base/optionProcessorHelper.js +11 -0
  17. package/lib/checks/dbFeatureFlags.js +5 -0
  18. package/lib/checks/enricher.js +1 -5
  19. package/lib/checks/structuredAnnoExpressions.js +30 -0
  20. package/lib/checks/validator.js +8 -0
  21. package/lib/compiler/assert-consistency.js +5 -1
  22. package/lib/compiler/base.js +1 -1
  23. package/lib/compiler/builtins.js +18 -2
  24. package/lib/compiler/checks.js +2 -5
  25. package/lib/compiler/define.js +8 -8
  26. package/lib/compiler/extend.js +108 -37
  27. package/lib/compiler/generate.js +1 -1
  28. package/lib/compiler/index.js +27 -10
  29. package/lib/compiler/lsp-api.js +501 -2
  30. package/lib/compiler/populate.js +60 -13
  31. package/lib/compiler/propagator.js +10 -8
  32. package/lib/compiler/resolve.js +117 -94
  33. package/lib/compiler/shared.js +114 -32
  34. package/lib/compiler/tweak-assocs.js +31 -21
  35. package/lib/compiler/utils.js +2 -1
  36. package/lib/compiler/xsn-model.js +4 -0
  37. package/lib/edm/annotations/genericTranslation.js +69 -35
  38. package/lib/edm/csn2edm.js +16 -4
  39. package/lib/edm/edm.js +10 -3
  40. package/lib/edm/edmAnnoPreprocessor.js +1 -2
  41. package/lib/edm/edmPreprocessor.js +8 -10
  42. package/lib/gen/Dictionary.json +66 -2
  43. package/lib/gen/language.checksum +1 -1
  44. package/lib/gen/language.interp +2 -1
  45. package/lib/gen/languageParser.js +4995 -4817
  46. package/lib/json/csnVersion.js +1 -1
  47. package/lib/json/from-csn.js +4 -7
  48. package/lib/json/to-csn.js +25 -12
  49. package/lib/language/antlrParser.js +2 -2
  50. package/lib/language/errorStrategy.js +0 -1
  51. package/lib/language/genericAntlrParser.js +35 -12
  52. package/lib/language/multiLineStringParser.js +3 -2
  53. package/lib/language/textUtils.js +1 -0
  54. package/lib/main.d.ts +28 -9
  55. package/lib/main.js +9 -9
  56. package/lib/model/cloneCsn.js +1 -0
  57. package/lib/model/csnRefs.js +22 -5
  58. package/lib/model/csnUtils.js +0 -14
  59. package/lib/model/revealInternalProperties.js +1 -2
  60. package/lib/modelCompare/compare.js +13 -11
  61. package/lib/optionProcessor.js +30 -9
  62. package/lib/render/manageConstraints.js +1 -1
  63. package/lib/render/toCdl.js +44 -14
  64. package/lib/render/toHdbcds.js +1 -2
  65. package/lib/render/toSql.js +45 -8
  66. package/lib/render/utils/common.js +12 -9
  67. package/lib/render/utils/stringEscapes.js +1 -0
  68. package/lib/transform/db/applyTransformations.js +13 -8
  69. package/lib/transform/db/associations.js +62 -54
  70. package/lib/transform/db/backlinks.js +20 -5
  71. package/lib/transform/db/expansion.js +1 -6
  72. package/lib/transform/db/flattening.js +86 -109
  73. package/lib/transform/db/killAnnotations.js +3 -0
  74. package/lib/transform/db/processSqlServices.js +63 -0
  75. package/lib/transform/db/temporal.js +3 -4
  76. package/lib/transform/db/views.js +0 -1
  77. package/lib/transform/draft/odata.js +56 -3
  78. package/lib/transform/effective/annotations.js +3 -2
  79. package/lib/transform/effective/flattening.js +135 -0
  80. package/lib/transform/effective/main.js +6 -4
  81. package/lib/transform/effective/types.js +13 -9
  82. package/lib/transform/forOdata.js +0 -2
  83. package/lib/transform/forRelationalDB.js +9 -19
  84. package/lib/transform/localized.js +7 -8
  85. package/lib/transform/odata/flattening.js +39 -31
  86. package/lib/transform/odata/typesExposure.js +5 -17
  87. package/lib/transform/transformUtils.js +1 -1
  88. package/lib/transform/translateAssocsToJoins.js +0 -1
  89. package/lib/utils/file.js +87 -8
  90. package/lib/utils/moduleResolve.js +59 -8
  91. package/lib/utils/term.js +3 -2
  92. package/package.json +7 -3
  93. package/share/messages/message-explanations.json +2 -0
  94. package/share/messages/type-unexpected-foreign-keys.md +52 -0
  95. package/share/messages/type-unexpected-on-condition.md +52 -0
@@ -1508,6 +1508,13 @@
1508
1508
  "Type": "HTML5.LinkTargetType",
1509
1509
  "$experimental": true
1510
1510
  },
1511
+ "HTML5.RowSpanForDuplicateValues": {
1512
+ "Type": "Core.Tag",
1513
+ "AppliesTo": [
1514
+ "Record"
1515
+ ],
1516
+ "$experimental": true
1517
+ },
1511
1518
  "JSON.Schema": {
1512
1519
  "Type": "JSON.JSON",
1513
1520
  "AppliesTo": [
@@ -1885,9 +1892,18 @@
1885
1892
  "UI.Placeholder": {
1886
1893
  "Type": "Edm.String",
1887
1894
  "AppliesTo": [
1888
- "Property"
1895
+ "Property",
1896
+ "Parameter"
1889
1897
  ]
1890
1898
  },
1899
+ "UI.InputMask": {
1900
+ "Type": "UI.InputMaskType",
1901
+ "AppliesTo": [
1902
+ "Property",
1903
+ "Parameter"
1904
+ ],
1905
+ "$experimental": true
1906
+ },
1891
1907
  "UI.TextArrangement": {
1892
1908
  "Type": "UI.TextArrangementType",
1893
1909
  "AppliesTo": [
@@ -1925,6 +1941,16 @@
1925
1941
  ],
1926
1942
  "$experimental": true
1927
1943
  },
1944
+ "UI.IsAIOperation": {
1945
+ "Type": "Core.Tag",
1946
+ "AppliesTo": [
1947
+ "Action",
1948
+ "Function",
1949
+ "ActionImport",
1950
+ "FunctionImport"
1951
+ ],
1952
+ "$experimental": true
1953
+ },
1928
1954
  "UI.CreateHidden": {
1929
1955
  "Type": "Core.Tag",
1930
1956
  "AppliesTo": [
@@ -2010,6 +2036,13 @@
2010
2036
  "Parameter"
2011
2037
  ]
2012
2038
  },
2039
+ "UI.Recommendations": {
2040
+ "Type": "Edm.ComplexType",
2041
+ "AppliesTo": [
2042
+ "EntityType"
2043
+ ],
2044
+ "$experimental": true
2045
+ },
2013
2046
  "UI.ExcludeFromNavigationContext": {
2014
2047
  "Type": "Core.Tag",
2015
2048
  "AppliesTo": [
@@ -3226,6 +3259,7 @@
3226
3259
  "Properties": {
3227
3260
  "Property": "Edm.PropertyPath",
3228
3261
  "DynamicProperty": "Edm.AnnotationPath",
3262
+ "Expression": "Edm.PrimitiveType",
3229
3263
  "Descending": "Edm.Boolean"
3230
3264
  }
3231
3265
  },
@@ -3823,7 +3857,8 @@
3823
3857
  "ResultSizeDefault": "Edm.Int32",
3824
3858
  "ResultSizeMaximum": "Edm.Int32",
3825
3859
  "IANATimezoneFormat": "Edm.Boolean",
3826
- "Treeview": "Edm.Boolean"
3860
+ "Treeview": "Edm.Boolean",
3861
+ "TextDirectionLayout": "Edm.Boolean"
3827
3862
  }
3828
3863
  },
3829
3864
  "PersonalData.EntitySemanticsType": {
@@ -4220,6 +4255,7 @@
4220
4255
  "IncludeGrandTotal": "Edm.Boolean",
4221
4256
  "InitialExpansionLevel": "Edm.Int32",
4222
4257
  "Visualizations": "Collection(Edm.AnnotationPath)",
4258
+ "RecursiveHierarchyQualifier": "Aggregation.HierarchyQualifier",
4223
4259
  "RequestAtLeast": "Collection(Edm.PropertyPath)",
4224
4260
  "SelectionFields": "Collection(Edm.PropertyPath)"
4225
4261
  }
@@ -4274,6 +4310,23 @@
4274
4310
  "High": "Edm.PrimitiveType"
4275
4311
  }
4276
4312
  },
4313
+ "UI.InputMaskType": {
4314
+ "$kind": "ComplexType",
4315
+ "Properties": {
4316
+ "Mask": "Edm.String",
4317
+ "PlaceholderSymbol": "Edm.String",
4318
+ "Rules": "Collection(UI.InputMaskRuleType)"
4319
+ },
4320
+ "$experimental": true
4321
+ },
4322
+ "UI.InputMaskRuleType": {
4323
+ "$kind": "ComplexType",
4324
+ "Properties": {
4325
+ "MaskSymbol": "Edm.String",
4326
+ "RegExp": "Edm.String"
4327
+ },
4328
+ "$experimental": true
4329
+ },
4277
4330
  "UI.NoteType": {
4278
4331
  "$kind": "ComplexType",
4279
4332
  "Properties": {
@@ -4452,6 +4505,17 @@
4452
4505
  "ValueListProperty": "Edm.String"
4453
4506
  }
4454
4507
  },
4508
+ "UI.PropertyRecommendationType": {
4509
+ "$kind": "ComplexType",
4510
+ "Abstract": "true",
4511
+ "Properties": {
4512
+ "RecommendedFieldValue": "Edm.PrimitiveType",
4513
+ "RecommendedFieldDescription": "Edm.String",
4514
+ "RecommendedFieldScoreValue": "Edm.Decimal",
4515
+ "RecommendedFieldIsSuggestion": "Edm.Boolean"
4516
+ },
4517
+ "$experimental": true
4518
+ },
4455
4519
  "UI.VisualizationType": {
4456
4520
  "$kind": "EnumType",
4457
4521
  "Members": [
@@ -1 +1 @@
1
- 0c76b255e5fe55c0f8527a4d9f1b563f
1
+ d2eab9ea0d46c406f6078d8a1125152e