@sap/cds-compiler 6.6.0 → 6.7.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +34 -1
  2. package/bin/cdsc.js +2 -0
  3. package/bin/cdsse.js +1 -1
  4. package/lib/base/message-registry.js +6 -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/compiler/assert-consistency.js +3 -4
  9. package/lib/compiler/base.js +8 -0
  10. package/lib/compiler/builtins.js +8 -9
  11. package/lib/compiler/checks.js +27 -6
  12. package/lib/compiler/cycle-detector.js +4 -4
  13. package/lib/compiler/define.js +65 -83
  14. package/lib/compiler/extend.js +357 -325
  15. package/lib/compiler/finalize-parse-cdl.js +3 -4
  16. package/lib/compiler/generate.js +205 -203
  17. package/lib/compiler/kick-start.js +34 -49
  18. package/lib/compiler/populate.js +95 -28
  19. package/lib/compiler/propagator.js +3 -5
  20. package/lib/compiler/resolve.js +17 -13
  21. package/lib/compiler/shared.js +47 -19
  22. package/lib/compiler/tweak-assocs.js +2 -4
  23. package/lib/compiler/utils.js +84 -31
  24. package/lib/gen/BaseParser.js +924 -1055
  25. package/lib/gen/CdlGrammar.checksum +1 -1
  26. package/lib/gen/CdlParser.js +5 -2
  27. package/lib/json/from-csn.js +25 -16
  28. package/lib/main.d.ts +13 -0
  29. package/lib/model/revealInternalProperties.js +18 -0
  30. package/lib/parsers/AstBuildingParser.js +22 -5
  31. package/lib/render/toHdbcds.js +2 -2
  32. package/lib/render/utils/sql.js +2 -2
  33. package/lib/render/utils/standardDatabaseFunctions.js +2 -2
  34. package/lib/transform/db/constraints.js +3 -4
  35. package/lib/transform/db/killAnnotations.js +1 -1
  36. package/lib/transform/db/processSqlServices.js +10 -11
  37. package/lib/transform/effective/associations.js +1 -1
  38. package/lib/transform/forOdata.js +7 -124
  39. package/lib/transform/odata/fioriTreeViews.js +173 -0
  40. package/lib/transform/odata/flattening.js +2 -2
  41. package/lib/transform/translateAssocsToJoins.js +7 -4
  42. package/package.json +1 -1
  43. package/share/messages/message-explanations.json +0 -2
  44. package/share/messages/type-unexpected-foreign-keys.md +0 -52
  45. 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