@sap/cds-compiler 4.3.0 → 4.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 (81) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/lib/api/main.js +14 -24
  3. package/lib/api/options.js +1 -0
  4. package/lib/api/trace.js +38 -0
  5. package/lib/base/location.js +46 -1
  6. package/lib/base/message-registry.js +68 -16
  7. package/lib/base/messages.js +8 -3
  8. package/lib/checks/.eslintrc.json +1 -0
  9. package/lib/checks/actionsFunctions.js +1 -1
  10. package/lib/checks/annotationsOData.js +2 -2
  11. package/lib/checks/selectItems.js +4 -1
  12. package/lib/compiler/assert-consistency.js +3 -2
  13. package/lib/compiler/base.js +1 -1
  14. package/lib/compiler/builtins.js +25 -1
  15. package/lib/compiler/checks.js +6 -5
  16. package/lib/compiler/define.js +12 -10
  17. package/lib/compiler/extend.js +22 -22
  18. package/lib/compiler/finalize-parse-cdl.js +1 -1
  19. package/lib/compiler/generate.js +70 -53
  20. package/lib/compiler/kick-start.js +9 -5
  21. package/lib/compiler/populate.js +31 -22
  22. package/lib/compiler/propagator.js +6 -2
  23. package/lib/compiler/resolve.js +52 -17
  24. package/lib/compiler/shared.js +74 -38
  25. package/lib/compiler/tweak-assocs.js +64 -23
  26. package/lib/compiler/utils.js +40 -23
  27. package/lib/edm/.eslintrc.json +2 -0
  28. package/lib/edm/EdmPrimitiveTypeDefinitions.js +252 -0
  29. package/lib/edm/annotations/edmJson.js +994 -0
  30. package/lib/edm/annotations/genericTranslation.js +75 -421
  31. package/lib/edm/annotations/vocabularyDefinitions.js +160 -0
  32. package/lib/edm/csn2edm.js +12 -5
  33. package/lib/edm/edm.js +14 -73
  34. package/lib/edm/edmPreprocessor.js +6 -0
  35. package/lib/gen/Dictionary.json +187 -16
  36. package/lib/gen/language.checksum +1 -1
  37. package/lib/gen/language.interp +1 -1
  38. package/lib/gen/languageLexer.interp +1 -1
  39. package/lib/gen/languageLexer.js +1129 -671
  40. package/lib/gen/languageParser.js +4285 -4283
  41. package/lib/json/from-csn.js +13 -18
  42. package/lib/json/to-csn.js +11 -6
  43. package/lib/language/antlrParser.js +0 -1
  44. package/lib/language/docCommentParser.js +1 -1
  45. package/lib/language/errorStrategy.js +95 -30
  46. package/lib/language/genericAntlrParser.js +21 -1
  47. package/lib/main.js +13 -3
  48. package/lib/model/csnRefs.js +42 -8
  49. package/lib/model/csnUtils.js +14 -2
  50. package/lib/model/enrichCsn.js +33 -5
  51. package/lib/model/revealInternalProperties.js +5 -0
  52. package/lib/modelCompare/compare.js +76 -14
  53. package/lib/modelCompare/utils/filter.js +19 -12
  54. package/lib/optionProcessor.js +2 -0
  55. package/lib/render/.eslintrc.json +1 -1
  56. package/lib/render/manageConstraints.js +1 -0
  57. package/lib/render/toHdbcds.js +3 -0
  58. package/lib/render/toRename.js +3 -1
  59. package/lib/render/toSql.js +46 -92
  60. package/lib/render/utils/common.js +76 -0
  61. package/lib/render/utils/delta.js +17 -3
  62. package/lib/sql-identifier.js +1 -1
  63. package/lib/transform/db/.eslintrc.json +1 -0
  64. package/lib/transform/db/applyTransformations.js +30 -4
  65. package/lib/transform/db/associations.js +22 -10
  66. package/lib/transform/db/backlinks.js +6 -2
  67. package/lib/transform/db/expansion.js +2 -2
  68. package/lib/transform/db/transformExists.js +13 -39
  69. package/lib/transform/draft/db.js +14 -3
  70. package/lib/transform/draft/odata.js +5 -18
  71. package/lib/transform/effective/associations.js +46 -15
  72. package/lib/transform/effective/main.js +7 -2
  73. package/lib/transform/effective/misc.js +43 -24
  74. package/lib/transform/effective/queries.js +20 -22
  75. package/lib/transform/effective/types.js +6 -2
  76. package/lib/transform/forOdata.js +5 -2
  77. package/lib/transform/localized.js +1 -1
  78. package/lib/transform/parseExpr.js +73 -21
  79. package/lib/transform/translateAssocsToJoins.js +24 -16
  80. package/lib/utils/term.js +2 -2
  81. package/package.json +2 -1
@@ -0,0 +1,160 @@
1
+ 'use strict';
2
+
3
+ /*
4
+ OASIS: https://github.com/oasis-tcs/odata-vocabularies/tree/master/vocabularies
5
+ Aggregation (published)
6
+ Authorization (published)
7
+ Capabilities (published)
8
+ Core (published)
9
+ JSON (published)
10
+ Measures (published)
11
+ Repeatability (published)
12
+ Temporal (published)
13
+ Validation (published)
14
+
15
+ SAP: https://github.com/SAP/odata-vocabularies/tree/master/vocabularies
16
+ Analytics (published)
17
+ CodeList (published)
18
+ Common (published)
19
+ Communication (published)
20
+ DataIntegration (published)
21
+ Graph (published, experimental)
22
+ Hierarchy (published, experimental)
23
+ HTML5 (published, experimental)
24
+ ODM (published, experimental)
25
+ Offline (experimental)
26
+ PDF (published)
27
+ PersonalData (published)
28
+ Session (published)
29
+ UI (published)
30
+ */
31
+
32
+ const vocabularyDefinitions = {
33
+ Aggregation: {
34
+ ref: { Uri: 'https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Aggregation.V1.xml' },
35
+ inc: { Alias: 'Aggregation', Namespace: 'Org.OData.Aggregation.V1' },
36
+ int: { filename: 'Aggregation.xml' },
37
+ },
38
+ Analytics: {
39
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/Analytics.xml' },
40
+ inc: { Alias: 'Analytics', Namespace: 'com.sap.vocabularies.Analytics.v1' },
41
+ int: { filename: 'Analytics.xml' },
42
+ },
43
+ Authorization: {
44
+ ref: { Uri: 'https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Authorization.V1.xml' },
45
+ inc: { Alias: 'Authorization', Namespace: 'Org.OData.Authorization.V1' },
46
+ int: { filename: 'Authorization.xml' },
47
+ },
48
+ Capabilities: {
49
+ ref: { Uri: 'https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Capabilities.V1.xml' },
50
+ inc: { Alias: 'Capabilities', Namespace: 'Org.OData.Capabilities.V1' },
51
+ int: { filename: 'Capabilities.xml' },
52
+ },
53
+ CodeList: {
54
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/CodeList.xml' },
55
+ inc: { Alias: 'CodeList', Namespace: 'com.sap.vocabularies.CodeList.v1' },
56
+ int: { filename: 'CodeList.xml' },
57
+ },
58
+ Common: {
59
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/Common.xml' },
60
+ inc: { Alias: 'Common', Namespace: 'com.sap.vocabularies.Common.v1' },
61
+ int: { filename: 'Common.xml' },
62
+ },
63
+ Communication: {
64
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/Communication.xml' },
65
+ inc: { Alias: 'Communication', Namespace: 'com.sap.vocabularies.Communication.v1' },
66
+ int: { filename: 'Communication.xml' },
67
+ },
68
+ Core: {
69
+ ref: { Uri: 'https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml' },
70
+ inc: { Alias: 'Core', Namespace: 'Org.OData.Core.V1' },
71
+ int: { filename: 'Core.xml' },
72
+ },
73
+ DataIntegration: {
74
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/DataIntegration.xml' },
75
+ inc: { Alias: 'DataIntegration', Namespace: 'com.sap.vocabularies.DataIntegration.v1' },
76
+ int: { filename: 'DataIntegration.xml' },
77
+ },
78
+ Graph: {
79
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/Graph.xml' },
80
+ inc: { Alias: 'Graph', Namespace: 'com.sap.vocabularies.Graph.v1' },
81
+ int: { filename: 'Graph.xml' },
82
+ },
83
+ Hierarchy: {
84
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/Hierarchy.xml' },
85
+ inc: { Alias: 'Hierarchy', Namespace: 'com.sap.vocabularies.Hierarchy.v1' },
86
+ int: { filename: 'Hierarchy.xml' },
87
+ },
88
+ HTML5: {
89
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/HTML5.xml' },
90
+ inc: { Alias: 'HTML5', Namespace: 'com.sap.vocabularies.HTML5.v1' },
91
+ int: { filename: 'HTML5.xml' },
92
+ },
93
+ JSON: {
94
+ ref: { Uri: 'https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.JSON.V1.xml' },
95
+ inc: { Alias: 'JSON', Namespace: 'Org.OData.JSON.V1' },
96
+ int: { filename: 'JSON.xml' },
97
+ },
98
+ Measures: {
99
+ ref: { Uri: 'https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Measures.V1.xml' },
100
+ inc: { Alias: 'Measures', Namespace: 'Org.OData.Measures.V1' },
101
+ int: { filename: 'Measures.xml' },
102
+ },
103
+ ODM: {
104
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/ODM.xml' },
105
+ inc: { Alias: 'ODM', Namespace: 'com.sap.vocabularies.ODM.v1' },
106
+ int: { filename: 'ODM.xml' },
107
+ },
108
+ Offline: {
109
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/Offline.xml' },
110
+ inc: { Alias: 'Offline', Namespace: 'com.sap.vocabularies.Offline.v1' },
111
+ int: { filename: 'Offline.xml' },
112
+ },
113
+ PDF: {
114
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/PDF.xml' },
115
+ inc: { Alias: 'PDF', Namespace: 'com.sap.vocabularies.PDF.v1' },
116
+ int: { filename: 'PDF.xml' },
117
+ },
118
+ PersonalData: {
119
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/PersonalData.xml' },
120
+ inc: { Alias: 'PersonalData', Namespace: 'com.sap.vocabularies.PersonalData.v1' },
121
+ int: { filename: 'PersonalData.xml' },
122
+ },
123
+ Repeatability: {
124
+ ref: { Uri: 'https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Repeatability.V1.xml' },
125
+ inc: { Alias: 'Repeatability', Namespace: 'Org.OData.Repeatability.V1' },
126
+ int: { filename: 'Repeatability.xml' },
127
+ },
128
+ Session: {
129
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/Session.xml' },
130
+ inc: { Alias: 'Session', Namespace: 'com.sap.vocabularies.Session.v1' },
131
+ int: { filename: 'Session.xml' },
132
+ },
133
+ UI: {
134
+ ref: { Uri: 'https://sap.github.io/odata-vocabularies/vocabularies/UI.xml' },
135
+ inc: { Alias: 'UI', Namespace: 'com.sap.vocabularies.UI.v1' },
136
+ int: { filename: 'UI.xml' },
137
+ },
138
+ Validation: {
139
+ ref: { Uri: 'https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Validation.V1.xml' },
140
+ inc: { Alias: 'Validation', Namespace: 'Org.OData.Validation.V1' },
141
+ int: { filename: 'Validation.xml' },
142
+ },
143
+ /* unvalidated vocabularies below here:
144
+ A vocabulary is unvalidated if it doesn't have an int.filename property as this indicates that
145
+ the vocabulary is added to the validation dictionary
146
+ Example:
147
+ 'Org.Snafu.V1': {
148
+ 'ref': { Uri: 'https://snafu.org/snafu.xml' },
149
+ 'inc': { Alias: 'Snafu', Namespace: 'Org.Snafu.V1' },
150
+ },
151
+ */
152
+ };
153
+
154
+ /* create inverted voc definitions list to allow addressing full qualified vocabularies
155
+ Object.entries(vocabularyDefinitions).forEach(([n, v]) => {
156
+ if(!vocabularyDefinitions[v.inc.Namespace])
157
+ vocabularyDefinitions[v.inc.Namespace] = vocabularyDefinitions[n];
158
+ });
159
+ */
160
+ module.exports = { vocabularyDefinitions };
@@ -10,12 +10,17 @@ const edmUtils = require('./edmUtils.js');
10
10
  const { initializeModel } = require('./edmPreprocessor.js');
11
11
  const translate = require('./annotations/genericTranslation.js');
12
12
  const { setProp, isBetaEnabled } = require('../base/model');
13
- const { cloneCsnNonDict, isEdmPropertyRendered, isBuiltinType } = require('../model/csnUtils');
13
+ const {
14
+ cloneCsnNonDict, isEdmPropertyRendered, isBuiltinType, getUtils,
15
+ } = require('../model/csnUtils');
14
16
  const { checkCSNVersion } = require('../json/csnVersion');
15
17
  const { makeMessageFunction } = require('../base/messages');
16
18
  const {
17
- EdmTypeFacetMap, EdmTypeFacetNames, EdmPrimitiveTypeMap, getEdm,
18
- } = require('./edm.js');
19
+ EdmTypeFacetMap,
20
+ EdmTypeFacetNames,
21
+ EdmPrimitiveTypeMap,
22
+ } = require('./EdmPrimitiveTypeDefinitions.js');
23
+ const { getEdm } = require('./edm.js');
19
24
 
20
25
  /*
21
26
  OData V2 spec 06/01/2017 PDF version is available from here:
@@ -749,7 +754,7 @@ function csn2edmAll( _csn, _options, serviceNames = undefined ) {
749
754
  const rt = actionCsn.returns && ((actionCsn.returns.items && actionCsn.returns.items.type) || actionCsn.returns.type);
750
755
  if (rt) { // add EntitySet attribute only if return type is a non abstract entity
751
756
  const definition = schemaCsn.definitions[rt];
752
- if (definition && definition.kind === 'entity' && !definition.abstract)
757
+ if (definition && definition.kind === 'entity' && !definition.abstract && !edmUtils.isSingleton(definition))
753
758
  actionImport.setEdmAttribute('EntitySet', edmUtils.getBaseName(rt));
754
759
  }
755
760
  EntityContainer.register(actionImport);
@@ -1046,6 +1051,8 @@ function csn2edmAll( _csn, _options, serviceNames = undefined ) {
1046
1051
 
1047
1052
  // generate the Edm.Annotations tree and append it to the corresponding schema
1048
1053
  function addAnnotations2XServiceRefs( ) {
1054
+ const { getFinalTypeInfo } = getUtils(csn);
1055
+ options.getFinalTypeInfo = getFinalTypeInfo;
1049
1056
  const { annos, usedVocabularies, xrefs } = translate.csn2annotationEdm(reqDefs, csn.vocabularies, serviceCsn.name, Edm, options, messageFunctions, mergedVocabularies);
1050
1057
  // distribute edm:Annotations into the schemas
1051
1058
  // Distribute each anno into Schema
@@ -1114,7 +1121,7 @@ function csn2edmAll( _csn, _options, serviceNames = undefined ) {
1114
1121
  if (!Number.isNaN(precision) && !Number.isNaN(scale) && scale > precision) {
1115
1122
  message('odata-spec-violation-type', pLoc,
1116
1123
  {
1117
- type: edmType, number: scale, rawvalue: precision, ersion: (p.v4 ? '4.0' : '2.0'), '#': 'scale',
1124
+ type: edmType, number: scale, rawvalue: precision, '#': 'scale',
1118
1125
  });
1119
1126
  }
1120
1127
  }
package/lib/edm/edm.js CHANGED
@@ -3,74 +3,11 @@
3
3
  const edmUtils = require('./edmUtils.js');
4
4
  const { isBuiltinType } = require('../model/csnUtils.js');
5
5
  const { forEach } = require('../utils/objectUtils');
6
-
7
- // facet definitions, optional could either be true or array of edm types
8
- // remove indicates wether or not the canonic facet shall be removed when applying @odata.Type
9
- const EdmTypeFacetMap = {
10
- MaxLength: {
11
- v2: true, v4: true, remove: true, optional: true,
12
- },
13
- Precision: {
14
- v2: true, v4: true, remove: true, optional: true,
15
- },
16
- Scale: {
17
- v2: true, v4: true, remove: true, optional: true, extra: 'sap:variable-scale',
18
- },
19
- SRID: { v4: true, remove: true, optional: true },
20
- // 'FixedLength': { v2: true },
21
- // 'Collation': { v2: true },
22
- // 'Unicode': { v2: true, v4: true },
23
- };
24
- const EdmTypeFacetNames = Object.keys(EdmTypeFacetMap);
25
-
26
- // Merged primitive type map with descriptions taken from V4 spec and filled up with V2 spec
27
- const EdmPrimitiveTypeMap = {
28
- 'Edm.Binary': {
29
- v2: true, v4: true, MaxLength: true, FixedLength: true, desc: 'Binary data',
30
- },
31
- 'Edm.Boolean': { v2: true, v4: true, desc: 'Binary-valued logic' },
32
- 'Edm.Byte': { v2: true, v4: true, desc: 'Unsigned 8-bit integer' },
33
- 'Edm.Date': { v4: true, desc: 'Date without a time-zone offset' },
34
- 'Edm.DateTime': { v2: true, Precision: true, desc: 'Date and time with values ranging from 12:00:00 midnight, January 1, 1753 A.D. through 11:59:59 P.M, December 31, 9999 A.D.' },
35
- 'Edm.DateTimeOffset': {
36
- v2: true, v4: true, Precision: true, desc: 'Date and time with a time-zone offset, no leap seconds',
37
- },
38
- 'Edm.Decimal': {
39
- v2: true, v4: true, Precision: true, Scale: true, desc: 'Numeric values with decimal representation',
40
- },
41
- 'Edm.Double': { v2: true, v4: true, desc: 'IEEE 754 binary64 floating-point number (15-17 decimal digits)' },
42
- 'Edm.Duration': { v4: true, Precision: true, desc: 'Signed duration in days, hours, minutes, and (sub)seconds' },
43
- 'Edm.Guid': { v2: true, v4: true, desc: '16-byte (128-bit) unique identifier' },
44
- 'Edm.Int16': { v2: true, v4: true, desc: 'Signed 16-bit integer' },
45
- 'Edm.Int32': { v2: true, v4: true, desc: 'Signed 32-bit integer' },
46
- 'Edm.Int64': { v2: true, v4: true, desc: 'Signed 64-bit integer' },
47
- 'Edm.SByte': { v2: true, v4: true, desc: 'Signed 8-bit integer' },
48
- 'Edm.Single': { v2: true, v4: true, desc: 'IEEE 754 binary32 floating-point number (6-9 decimal digits)' },
49
- 'Edm.Stream': { v4: true, MaxLength: true, desc: 'Binary data stream' },
50
- 'Edm.String': {
51
- v2: true, v4: true, MaxLength: true, FixedLength: true, Collation: true, Unicode: true, desc: 'Sequence of characters',
52
- },
53
- 'Edm.Time': { v2: true, Precision: true, desc: 'time of day with values ranging from 0:00:00.x to 23:59:59.y, where x and y depend upon the precision' },
54
- 'Edm.TimeOfDay': { v4: true, Precision: true, desc: 'Clock time 00:00-23:59:59.999999999999' },
55
- 'Edm.Geography': { v4: true, SRID: true, desc: 'Abstract base type for all Geography types' },
56
- 'Edm.GeographyPoint': { v4: true, SRID: true, desc: 'A point in a round-earth coordinate system' },
57
- 'Edm.GeographyLineString': { v4: true, SRID: true, desc: 'Line string in a round-earth coordinate system' },
58
- 'Edm.GeographyPolygon': { v4: true, SRID: true, desc: 'Polygon in a round-earth coordinate system' },
59
- 'Edm.GeographyMultiPoint': { v4: true, SRID: true, desc: 'Collection of points in a round-earth coordinate system' },
60
- 'Edm.GeographyMultiLineString': { v4: true, SRID: true, desc: 'Collection of line strings in a round-earth coordinate system' },
61
- 'Edm.GeographyMultiPolygon': { v4: true, SRID: true, desc: 'Collection of polygons in a round-earth coordinate system' },
62
- 'Edm.GeographyCollection': { v4: true, SRID: true, desc: 'Collection of arbitrary Geography values' },
63
- 'Edm.Geometry': { v4: true, SRID: true, desc: 'Abstract base type for all Geometry types' },
64
- 'Edm.GeometryPoint': { v4: true, SRID: true, desc: 'Point in a flat-earth coordinate system' },
65
- 'Edm.GeometryLineString': { v4: true, SRID: true, desc: 'Line string in a flat-earth coordinate system' },
66
- 'Edm.GeometryPolygon': { v4: true, SRID: true, descr: 'Polygon in a flat-earth coordinate system' },
67
- 'Edm.GeometryMultiPoint': { v4: true, SRID: true, desc: 'Collection of points in a flat-earth coordinate system' },
68
- 'Edm.GeometryMultiLineString': { v4: true, SRID: true, desc: 'Collection of line strings in a flat-earth coordinate system' },
69
- 'Edm.GeometryMultiPolygon': { v4: true, SRID: true, desc: 'Collection of polygons in a flat-earth coordinate system' },
70
- 'Edm.GeometryCollection': { v4: true, SRID: true, desc: 'Collection of arbitrary Geometry values' },
71
- 'Edm.PrimitiveType': { v4: true, desc: 'Abstract meta type' },
72
- // 'Edm.Untyped': { v4: true, desc: 'Abstract void type' },
73
- };
6
+ const {
7
+ EdmTypeFacetMap,
8
+ EdmTypeFacetNames,
9
+ EdmPrimitiveTypeMap,
10
+ } = require('./EdmPrimitiveTypeDefinitions.js');
74
11
 
75
12
  function getEdm( options, messageFunctions ) {
76
13
  const { error } = messageFunctions || { error: () => true, warning: () => true };
@@ -1444,10 +1381,14 @@ function getEdm( options, messageFunctions ) {
1444
1381
  }
1445
1382
  class Cast extends AnnotationBase {
1446
1383
  toXMLattributes() {
1447
- // TODO: Why json?
1448
- if (this._jsonOnlyAttributes.Collection)
1449
- return ` Type="Collection(${this._edmAttributes.Type})"`;
1450
- return ` Type="${this._edmAttributes.Type}"`;
1384
+ if (this._jsonOnlyAttributes.Collection) {
1385
+ const ot = this._edmAttributes.Type;
1386
+ this._edmAttributes.Type = `Collection(${ot})`;
1387
+ const str = super.toXMLattributes();
1388
+ this._edmAttributes.Type = ot;
1389
+ return str;
1390
+ }
1391
+ return super.toXMLattributes();
1451
1392
  }
1452
1393
  toJSON() {
1453
1394
  const json = this.mergeJSONAnnotations();
@@ -1627,5 +1568,5 @@ function getEdm( options, messageFunctions ) {
1627
1568
  } // instance function
1628
1569
 
1629
1570
  module.exports = {
1630
- EdmTypeFacetMap, EdmTypeFacetNames, EdmPrimitiveTypeMap, getEdm,
1571
+ getEdm,
1631
1572
  };
@@ -168,6 +168,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
168
168
  initEdmNavPropBindingTargets,
169
169
  pullupCapabilitiesAnnotations,
170
170
  annotateOptionalActFuncParams,
171
+ openService,
171
172
  ]);
172
173
  }
173
174
 
@@ -2133,6 +2134,11 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
2133
2134
  }
2134
2135
  }
2135
2136
 
2137
+ function openService( def ) {
2138
+ if (options.odataOpenType && !def.$isParamEntity && !def.$proxy)
2139
+ edmUtils.assignAnnotation(def, '@open', true);
2140
+ }
2141
+
2136
2142
  // ////////////////////////////////////////////////////////////////////
2137
2143
  //
2138
2144
  // Helper section starts here
@@ -58,14 +58,18 @@
58
58
  "Aggregation.RecursiveHierarchy": {
59
59
  "Type": "Aggregation.RecursiveHierarchyType",
60
60
  "AppliesTo": [
61
- "EntityType",
62
- "ComplexType"
61
+ "EntityType"
62
+ ]
63
+ },
64
+ "Aggregation.UpPath": {
65
+ "Type": "Collection(Edm.String)",
66
+ "AppliesTo": [
67
+ "EntityType"
63
68
  ]
64
69
  },
65
70
  "Aggregation.AvailableOnAggregates": {
66
71
  "Type": "Aggregation.AvailableOnAggregatesType",
67
72
  "AppliesTo": [
68
- "Action",
69
73
  "Function"
70
74
  ]
71
75
  },
@@ -1399,6 +1403,13 @@
1399
1403
  "Core.GeometryFeature": {
1400
1404
  "Type": "Core.GeometryFeatureType"
1401
1405
  },
1406
+ "Core.AnyStructure": {
1407
+ "Type": "Core.Tag",
1408
+ "AppliesTo": [
1409
+ "EntityType",
1410
+ "ComplexType"
1411
+ ]
1412
+ },
1402
1413
  "DataIntegration.Extractable": {
1403
1414
  "Type": "Edm.Boolean",
1404
1415
  "AppliesTo": [
@@ -1454,6 +1465,27 @@
1454
1465
  ],
1455
1466
  "$experimental": true
1456
1467
  },
1468
+ "Hierarchy.RecursiveHierarchyActions": {
1469
+ "Type": "Hierarchy.RecursiveHierarchyActionsType",
1470
+ "AppliesTo": [
1471
+ "EntityType"
1472
+ ],
1473
+ "$experimental": true
1474
+ },
1475
+ "Hierarchy.MatchCount": {
1476
+ "Type": "Edm.Int64",
1477
+ "AppliesTo": [
1478
+ "Collection"
1479
+ ],
1480
+ "$experimental": true
1481
+ },
1482
+ "Hierarchy.RecursiveHierarchySupported": {
1483
+ "Type": "Core.Tag",
1484
+ "AppliesTo": [
1485
+ "Collection"
1486
+ ],
1487
+ "$experimental": true
1488
+ },
1457
1489
  "HTML5.CssDefaults": {
1458
1490
  "Type": "HTML5.CssDefaultsType",
1459
1491
  "AppliesTo": [
@@ -1537,6 +1569,13 @@
1537
1569
  "EntityType"
1538
1570
  ]
1539
1571
  },
1572
+ "ODM.oidReference": {
1573
+ "Type": "ODM.oidReferenceType",
1574
+ "AppliesTo": [
1575
+ "Property"
1576
+ ],
1577
+ "$experimental": true
1578
+ },
1540
1579
  "Offline.ClientOnly": {
1541
1580
  "Type": "Offline.ClientOnlyType",
1542
1581
  "AppliesTo": [
@@ -2087,9 +2126,10 @@
2087
2126
  "Aggregation.ApplySupportedBase": {
2088
2127
  "$kind": "ComplexType",
2089
2128
  "Properties": {
2090
- "Transformations": "Collection(Edm.String)",
2129
+ "Transformations": "Collection(Aggregation.Transformation)",
2091
2130
  "CustomAggregationMethods": "Collection(Edm.String)",
2092
- "Rollup": "Aggregation.RollupType"
2131
+ "Rollup": "Aggregation.RollupType",
2132
+ "From": "Edm.Boolean"
2093
2133
  }
2094
2134
  },
2095
2135
  "Aggregation.ApplySupportedType": {
@@ -2097,11 +2137,12 @@
2097
2137
  "BaseType": "Aggregation.ApplySupportedBase",
2098
2138
  "Properties": {
2099
2139
  "PropertyRestrictions": "Edm.Boolean",
2100
- "GroupableProperties": "Collection(Edm.PropertyPath)",
2140
+ "GroupableProperties": "Collection(Edm.AnyPropertyPath)",
2101
2141
  "AggregatableProperties": "Collection(Aggregation.AggregatablePropertyType)",
2102
- "Transformations": "Collection(Edm.String)",
2142
+ "Transformations": "Collection(Aggregation.Transformation)",
2103
2143
  "CustomAggregationMethods": "Collection(Edm.String)",
2104
- "Rollup": "Aggregation.RollupType"
2144
+ "Rollup": "Aggregation.RollupType",
2145
+ "From": "Edm.Boolean"
2105
2146
  }
2106
2147
  },
2107
2148
  "Aggregation.AggregatablePropertyType": {
@@ -2116,9 +2157,7 @@
2116
2157
  "$kind": "ComplexType",
2117
2158
  "Properties": {
2118
2159
  "NodeProperty": "Edm.PropertyPath",
2119
- "ParentNavigationProperty": "Edm.NavigationPropertyPath",
2120
- "DistanceFromRootProperty": "Edm.PropertyPath",
2121
- "IsLeafProperty": "Edm.PropertyPath"
2160
+ "ParentNavigationProperty": "Edm.NavigationPropertyPath"
2122
2161
  }
2123
2162
  },
2124
2163
  "Aggregation.AvailableOnAggregatesType": {
@@ -2163,6 +2202,107 @@
2163
2202
  "$deprecated": true,
2164
2203
  "$deprecationText": "Deprecated since [`NavigationPropertyAggregationCapabilities`](#NavigationPropertyAggregationCapabilities) is also deprecated"
2165
2204
  },
2205
+ "Aggregation.Transformation": {
2206
+ "$kind": "TypeDefinition",
2207
+ "UnderlyingType": "Edm.String",
2208
+ "$Allowed": {
2209
+ "Values": {
2210
+ "aggregate": {
2211
+ "Value": "aggregate",
2212
+ "Type": "String"
2213
+ },
2214
+ "groupby": {
2215
+ "Value": "groupby",
2216
+ "Type": "String"
2217
+ },
2218
+ "concat": {
2219
+ "Value": "concat",
2220
+ "Type": "String"
2221
+ },
2222
+ "identity": {
2223
+ "Value": "identity",
2224
+ "Type": "String"
2225
+ },
2226
+ "filter": {
2227
+ "Value": "filter",
2228
+ "Type": "String"
2229
+ },
2230
+ "search": {
2231
+ "Value": "search",
2232
+ "Type": "String"
2233
+ },
2234
+ "nest": {
2235
+ "Value": "nest",
2236
+ "Type": "String"
2237
+ },
2238
+ "addnested": {
2239
+ "Value": "addnested",
2240
+ "Type": "String"
2241
+ },
2242
+ "join": {
2243
+ "Value": "join",
2244
+ "Type": "String"
2245
+ },
2246
+ "outerjoin": {
2247
+ "Value": "outerjoin",
2248
+ "Type": "String"
2249
+ },
2250
+ "compute": {
2251
+ "Value": "compute",
2252
+ "Type": "String"
2253
+ },
2254
+ "bottomcount": {
2255
+ "Value": "bottomcount",
2256
+ "Type": "String"
2257
+ },
2258
+ "bottomsum": {
2259
+ "Value": "bottomsum",
2260
+ "Type": "String"
2261
+ },
2262
+ "bottompercent": {
2263
+ "Value": "bottompercent",
2264
+ "Type": "String"
2265
+ },
2266
+ "topcount": {
2267
+ "Value": "topcount",
2268
+ "Type": "String"
2269
+ },
2270
+ "topsum": {
2271
+ "Value": "topsum",
2272
+ "Type": "String"
2273
+ },
2274
+ "toppercent": {
2275
+ "Value": "toppercent",
2276
+ "Type": "String"
2277
+ },
2278
+ "orderby": {
2279
+ "Value": "orderby",
2280
+ "Type": "String"
2281
+ },
2282
+ "top": {
2283
+ "Value": "top",
2284
+ "Type": "String"
2285
+ },
2286
+ "skip": {
2287
+ "Value": "skip",
2288
+ "Type": "String"
2289
+ },
2290
+ "ancestors": {
2291
+ "Value": "ancestors",
2292
+ "Type": "String"
2293
+ },
2294
+ "descendants": {
2295
+ "Value": "descendants",
2296
+ "Type": "String"
2297
+ },
2298
+ "traverse": {
2299
+ "Value": "traverse",
2300
+ "Type": "String"
2301
+ }
2302
+ },
2303
+ "Symbols": {}
2304
+ }
2305
+ },
2166
2306
  "Aggregation.AggregationMethod": {
2167
2307
  "$kind": "TypeDefinition",
2168
2308
  "UnderlyingType": "Edm.String",
@@ -2192,6 +2332,10 @@
2192
2332
  "Symbols": {}
2193
2333
  }
2194
2334
  },
2335
+ "Aggregation.HierarchyQualifier": {
2336
+ "$kind": "TypeDefinition",
2337
+ "UnderlyingType": "Edm.String"
2338
+ },
2195
2339
  "Aggregation.RollupType": {
2196
2340
  "$kind": "EnumType",
2197
2341
  "Members": [
@@ -3422,11 +3566,32 @@
3422
3566
  "Hierarchy.RecursiveHierarchyType": {
3423
3567
  "$kind": "ComplexType",
3424
3568
  "Properties": {
3425
- "ExternalKeyProperty": "Edm.PropertyPath",
3426
- "DescendantCountProperty": "Edm.PropertyPath",
3427
- "DrillStateProperty": "Edm.PropertyPath",
3428
- "SiblingRankProperty": "Edm.PropertyPath",
3429
- "PreorderRankProperty": "Edm.PropertyPath"
3569
+ "ExternalKey": "Edm.String",
3570
+ "NodeType": "Edm.String",
3571
+ "ChildCount": "Edm.Int64",
3572
+ "DescendantCount": "Edm.Int64",
3573
+ "LimitedDescendantCount": "Edm.Int64",
3574
+ "DrillState": "Edm.String",
3575
+ "DistanceFromRoot": "Edm.Int64",
3576
+ "LimitedRank": "Edm.Int64",
3577
+ "SiblingRank": "Edm.Int64",
3578
+ "Matched": "Edm.Boolean",
3579
+ "MatchedDescendantCount": "Edm.Int64"
3580
+ },
3581
+ "$experimental": true
3582
+ },
3583
+ "Hierarchy.RecursiveHierarchyActionsType": {
3584
+ "$kind": "ComplexType",
3585
+ "Properties": {
3586
+ "ChangeNextSiblingAction": "Common.QualifiedName",
3587
+ "CopyAction": "Common.QualifiedName"
3588
+ }
3589
+ },
3590
+ "Hierarchy.TopLevelsExpandType": {
3591
+ "$kind": "ComplexType",
3592
+ "Properties": {
3593
+ "NodeID": "Edm.String",
3594
+ "Levels": "Edm.Int64"
3430
3595
  },
3431
3596
  "$experimental": true
3432
3597
  },
@@ -3486,6 +3651,12 @@
3486
3651
  "Symbols": {}
3487
3652
  }
3488
3653
  },
3654
+ "ODM.oidReferenceType": {
3655
+ "$kind": "ComplexType",
3656
+ "Properties": {
3657
+ "entityName": "Edm.String"
3658
+ }
3659
+ },
3489
3660
  "Offline.ClientOnlyType": {
3490
3661
  "$kind": "ComplexType",
3491
3662
  "Properties": {},
@@ -1 +1 @@
1
- 462a4274cec75ca772064210a7421aec
1
+ 582fa96ad61075beb0b9f9f8c46f11f3