@sap/cds-compiler 6.6.2 → 6.7.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 (52) hide show
  1. package/CHANGELOG.md +37 -1
  2. package/bin/cdsc.js +2 -0
  3. package/bin/cdsse.js +1 -1
  4. package/lib/base/message-registry.js +13 -7
  5. package/lib/base/model.js +0 -72
  6. package/lib/checks/elements.js +1 -1
  7. package/lib/checks/featureFlags.js +2 -2
  8. package/lib/checks/manyExpand.js +28 -0
  9. package/lib/checks/validator.js +2 -0
  10. package/lib/compiler/assert-consistency.js +3 -4
  11. package/lib/compiler/base.js +8 -0
  12. package/lib/compiler/builtins.js +8 -9
  13. package/lib/compiler/checks.js +27 -6
  14. package/lib/compiler/cycle-detector.js +4 -4
  15. package/lib/compiler/define.js +65 -83
  16. package/lib/compiler/extend.js +357 -325
  17. package/lib/compiler/finalize-parse-cdl.js +3 -4
  18. package/lib/compiler/generate.js +205 -203
  19. package/lib/compiler/kick-start.js +34 -49
  20. package/lib/compiler/populate.js +95 -28
  21. package/lib/compiler/propagator.js +3 -5
  22. package/lib/compiler/resolve.js +17 -13
  23. package/lib/compiler/shared.js +52 -20
  24. package/lib/compiler/tweak-assocs.js +2 -4
  25. package/lib/compiler/utils.js +84 -31
  26. package/lib/edm/edmAnnoPreprocessor.js +2 -2
  27. package/lib/gen/BaseParser.js +924 -1055
  28. package/lib/gen/CdlGrammar.checksum +1 -1
  29. package/lib/gen/CdlParser.js +5 -2
  30. package/lib/json/from-csn.js +25 -16
  31. package/lib/main.d.ts +13 -0
  32. package/lib/model/revealInternalProperties.js +18 -0
  33. package/lib/parsers/AstBuildingParser.js +22 -5
  34. package/lib/render/toHdbcds.js +2 -2
  35. package/lib/render/toSql.js +1 -1
  36. package/lib/render/utils/sql.js +2 -2
  37. package/lib/render/utils/standardDatabaseFunctions.js +2 -2
  38. package/lib/transform/db/constraints.js +3 -4
  39. package/lib/transform/db/expansion.js +2 -44
  40. package/lib/transform/db/killAnnotations.js +1 -1
  41. package/lib/transform/db/processSqlServices.js +10 -11
  42. package/lib/transform/effective/main.js +2 -1
  43. package/lib/transform/featureFlags.js +6 -1
  44. package/lib/transform/forOdata.js +7 -124
  45. package/lib/transform/forRelationalDB.js +2 -1
  46. package/lib/transform/odata/fioriTreeViews.js +173 -0
  47. package/lib/transform/odata/flattening.js +2 -2
  48. package/lib/transform/translateAssocsToJoins.js +7 -4
  49. package/package.json +1 -1
  50. package/share/messages/message-explanations.json +0 -2
  51. package/share/messages/type-unexpected-foreign-keys.md +0 -52
  52. package/share/messages/type-unexpected-on-condition.md +0 -52
@@ -14,7 +14,7 @@
14
14
  'use strict';
15
15
 
16
16
  const { CompilerAssertion } = require('../base/error');
17
- const { forEachGeneric } = require('../base/model');
17
+ const { forEachGeneric } = require('./utils');
18
18
 
19
19
 
20
20
  // Used for resolving types in parseCdl mode.
@@ -27,7 +27,6 @@ function finalizeParseCdl( model ) {
27
27
  const {
28
28
  resolveUncheckedPath,
29
29
  resolveTypeArgumentsUnchecked,
30
- initMembers,
31
30
  } = model.$functions;
32
31
 
33
32
  resolveTypesAndExtensionsForParseCdl();
@@ -41,8 +40,6 @@ function finalizeParseCdl( model ) {
41
40
  for (const name in late) {
42
41
  for (const ext of late[name]._extensions) {
43
42
  ext.name.id = resolveUncheckedPath( ext.name, '_uncheckedExtension', ext );
44
- // Initialize members and define annotations in sub-elements.
45
- initMembers( ext );
46
43
  extensions.push( ext );
47
44
  }
48
45
  }
@@ -66,6 +63,8 @@ function finalizeParseCdl( model ) {
66
63
  * @param {XSN.Artifact} main
67
64
  */
68
65
  function resolveTypesForParseCdl( artifact, main ) {
66
+ // TODO: use `artifact` as "user" for resolveUncheckPath (now that the _block
67
+ // links of expand/inlines etc are correctly set)
69
68
  if (!artifact || typeof artifact !== 'object')
70
69
  return;
71
70