@sap/cds-dk 8.3.0 → 8.4.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 (44) hide show
  1. package/CHANGELOG.md +40 -13
  2. package/bin/build.js +1 -1
  3. package/bin/cds.js +12 -0
  4. package/bin/compile/index.js +6 -1
  5. package/bin/env.js +3 -2
  6. package/bin/init.js +8 -4
  7. package/bin/repl.js +3 -3
  8. package/lib/build/util.js +32 -20
  9. package/lib/deploy/to-hana/hana.js +2 -21
  10. package/lib/env/schemas/cds-rc.js +174 -2
  11. package/lib/import/asyncapi/parserContext.js +4 -30
  12. package/lib/import/odata/v2parser.js +3 -2
  13. package/lib/import/openapi/importOpenAPI.js +616 -569
  14. package/lib/import/openapi/utilities.js +7 -2
  15. package/lib/init/constants.js +2 -1
  16. package/lib/init/index.js +4 -0
  17. package/lib/init/projectReader.js +1 -2
  18. package/lib/init/registries/mta.js +8 -1
  19. package/lib/init/template/approuter/files/package.json +1 -1
  20. package/lib/init/template/cf-manifest/files/manifest.yml.hbs +3 -1
  21. package/lib/init/template/enterprise-messaging-shared/index.js +1 -1
  22. package/lib/init/template/file-based-messaging/index.js +1 -1
  23. package/lib/init/template/hana/files/package.json.hbs +2 -0
  24. package/lib/init/template/hana/index.js +1 -1
  25. package/lib/init/template/handler/index.js +1 -1
  26. package/lib/init/template/html5-repo/files/app-package.json.hbs +2 -2
  27. package/lib/init/template/html5-repo/files/ui5-deploy.yaml.hbs +2 -2
  28. package/lib/init/template/local-messaging/index.js +1 -1
  29. package/lib/init/template/nodejs/files/.vscode/extensions.json +0 -5
  30. package/lib/init/template/nodejs/files/.vscode/settings.json +1 -1
  31. package/lib/init/template/nodejs/files/.vscode/tasks.json +0 -2
  32. package/lib/init/template/nodejs/files/package.json.hbs +1 -1
  33. package/lib/init/template/postgres/index.js +1 -1
  34. package/lib/init/template/redis-messaging/index.js +1 -1
  35. package/lib/init/template/side-by-side-extensibility/files/mta.yaml.hbs +40 -0
  36. package/lib/init/template/side-by-side-extensibility/files/package.json.hbs +17 -0
  37. package/lib/init/template/side-by-side-extensibility/index.js +34 -0
  38. package/lib/init/template/typescript/files/package.json +2 -2
  39. package/lib/init/template/xsuaa/index.js +1 -1
  40. package/lib/util/fs.js +1 -1
  41. package/lib/util/jsonc.js +1 -1
  42. package/lib/util/jsonc.pegjs +6 -2
  43. package/npm-shrinkwrap.json +55 -143
  44. package/package.json +1 -1
@@ -1650,8 +1650,9 @@ function _generateEDMXJSON2CSN(jsonObj, ignorePersistenceSkip, parserContext) {
1650
1650
  }
1651
1651
 
1652
1652
  // Construct CSN entity based on EDMX entity
1653
- let entityJson = jsonObj["edmx:Edmx"]["edmx:DataServices"].Schema.EntityType;
1654
- if (!Array.isArray(entityJson)) entityJson = [entityJson];
1653
+ let entityJson = jsonObj["edmx:Edmx"]["edmx:DataServices"].Schema.EntityType;
1654
+ // if entityJson exists(ignoring the case of no entity) and is not an array, convert it to an array to handle the case of single entity
1655
+ if (entityJson && !Array.isArray(entityJson)) entityJson = [entityJson];
1655
1656
  const definitions = [];
1656
1657
 
1657
1658
  if (parserContext.mockServerUc) {