@sap/cds-compiler 4.8.0 → 4.9.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 (92) hide show
  1. package/CHANGELOG.md +29 -4
  2. package/bin/cds_remove_invalid_whitespace.js +135 -0
  3. package/bin/cds_update_annotations.js +180 -0
  4. package/bin/cds_update_identifiers.js +3 -4
  5. package/bin/cdsc.js +14 -1
  6. package/doc/CHANGELOG_BETA.md +19 -0
  7. package/lib/api/main.js +59 -24
  8. package/lib/api/options.js +12 -1
  9. package/lib/api/validate.js +1 -5
  10. package/lib/base/builtins.js +27 -0
  11. package/lib/base/message-registry.js +32 -19
  12. package/lib/base/messages.js +50 -19
  13. package/lib/base/model.js +4 -5
  14. package/lib/checks/actionsFunctions.js +2 -2
  15. package/lib/checks/annotationsOData.js +3 -0
  16. package/lib/checks/defaultValues.js +5 -2
  17. package/lib/checks/queryNoDbArtifacts.js +3 -2
  18. package/lib/checks/validator.js +2 -34
  19. package/lib/compiler/assert-consistency.js +8 -2
  20. package/lib/compiler/checks.js +44 -18
  21. package/lib/compiler/define.js +34 -22
  22. package/lib/compiler/extend.js +33 -10
  23. package/lib/compiler/index.js +0 -1
  24. package/lib/compiler/lsp-api.js +5 -0
  25. package/lib/compiler/propagator.js +21 -18
  26. package/lib/compiler/resolve.js +44 -28
  27. package/lib/compiler/shared.js +60 -20
  28. package/lib/compiler/tweak-assocs.js +13 -88
  29. package/lib/compiler/xpr-rewrite.js +689 -0
  30. package/lib/edm/annotations/genericTranslation.js +80 -60
  31. package/lib/edm/edm.js +4 -4
  32. package/lib/edm/edmInboundChecks.js +33 -0
  33. package/lib/edm/edmPreprocessor.js +9 -6
  34. package/lib/gen/Dictionary.json +129 -14
  35. package/lib/gen/language.checksum +1 -1
  36. package/lib/gen/language.interp +1 -1
  37. package/lib/gen/languageParser.js +1523 -1518
  38. package/lib/json/from-csn.js +13 -4
  39. package/lib/json/to-csn.js +10 -11
  40. package/lib/language/genericAntlrParser.js +14 -6
  41. package/lib/main.d.ts +67 -14
  42. package/lib/main.js +1 -0
  43. package/lib/model/cloneCsn.js +6 -3
  44. package/lib/model/csnRefs.js +12 -7
  45. package/lib/model/csnUtils.js +13 -7
  46. package/lib/model/enrichCsn.js +3 -1
  47. package/lib/model/revealInternalProperties.js +2 -1
  48. package/lib/model/sortViews.js +14 -6
  49. package/lib/modelCompare/compare.js +33 -34
  50. package/lib/optionProcessor.js +27 -2
  51. package/lib/render/DuplicateChecker.js +6 -6
  52. package/lib/render/manageConstraints.js +1 -0
  53. package/lib/render/toCdl.js +3 -1
  54. package/lib/transform/db/applyTransformations.js +33 -0
  55. package/lib/transform/db/constraints.js +1 -1
  56. package/lib/transform/db/expansion.js +8 -3
  57. package/lib/transform/db/groupByOrderBy.js +2 -2
  58. package/lib/transform/db/temporal.js +6 -3
  59. package/lib/transform/db/transformExists.js +2 -2
  60. package/lib/transform/effective/annotations.js +194 -0
  61. package/lib/transform/effective/main.js +6 -8
  62. package/lib/transform/effective/misc.js +31 -10
  63. package/lib/transform/forOdata.js +23 -7
  64. package/lib/transform/forRelationalDB.js +1 -1
  65. package/lib/transform/localized.js +7 -6
  66. package/lib/transform/odata/flattening.js +189 -106
  67. package/lib/transform/odata/toFinalBaseType.js +1 -1
  68. package/lib/transform/odata/typesExposure.js +15 -12
  69. package/lib/transform/parseExpr.js +4 -4
  70. package/lib/transform/transformUtils.js +40 -37
  71. package/lib/transform/translateAssocsToJoins.js +47 -47
  72. package/lib/transform/universalCsn/universalCsnEnricher.js +12 -16
  73. package/package.json +1 -1
  74. package/share/messages/anno-missing-rewrite.md +45 -0
  75. package/share/messages/message-explanations.json +1 -0
  76. package/bin/.eslintrc.json +0 -17
  77. package/lib/api/.eslintrc.json +0 -37
  78. package/lib/checks/.eslintrc.json +0 -31
  79. package/lib/compiler/.eslintrc.json +0 -8
  80. package/lib/edm/.eslintrc.json +0 -46
  81. package/lib/inspect/.eslintrc.json +0 -4
  82. package/lib/json/.eslintrc.json +0 -4
  83. package/lib/language/.eslintrc.json +0 -4
  84. package/lib/model/.eslintrc.json +0 -13
  85. package/lib/modelCompare/utils/.eslintrc.json +0 -22
  86. package/lib/render/.eslintrc.json +0 -22
  87. package/lib/transform/.eslintrc.json +0 -13
  88. package/lib/transform/db/.eslintrc.json +0 -41
  89. package/lib/transform/draft/.eslintrc.json +0 -4
  90. package/lib/transform/effective/.eslintrc.json +0 -4
  91. package/lib/transform/universalCsn/.eslintrc.json +0 -37
  92. package/lib/utils/.eslintrc.json +0 -7
@@ -102,7 +102,9 @@ function csn2annotationEdm( reqDefs, reqDefsUtils, csnVocabularies, serviceName,
102
102
  // qualified with #$parameters or if its applicable to an EntitySet or Singleton
103
103
  const scopeCheck = {
104
104
  ref: (elemref, prop, xpr, path) => {
105
- if (scopeCheck.scope === 'param' && (!elemref.param || (xpr[0].id || xpr[0]) === '$self')) {
105
+ if (scopeCheck.scope === 'param' &&
106
+ (!elemref.param ||
107
+ (xpr[0].id || xpr[0]) === '$self' && !def.elements.$self)) {
106
108
  error('odata-anno-xpr-ref', path, { anno: scopeCheck.anno, elemref, '#': 'notaparam' });
107
109
  // don't try to resolve those paths later on
108
110
  delete elemref[prop];
@@ -111,9 +113,13 @@ function csn2annotationEdm( reqDefs, reqDefsUtils, csnVocabularies, serviceName,
111
113
  error('odata-anno-xpr-ref', path, { anno: scopeCheck.anno, elemref, '#': 'notaneelement' });
112
114
  delete elemref[prop];
113
115
  }
114
- if (scopeCheck.scope === 'param' && elemref.param)
116
+ if (scopeCheck.scope === 'param' && elemref.param) {
115
117
  // make sure that path is resolvable as element path later on
116
118
  delete elemref.param;
119
+ const head = xpr[0].id || xpr[0];
120
+ if (head[0] === '$')
121
+ xpr.unshift('$self');
122
+ }
117
123
  },
118
124
  };
119
125
  const checkDict = (dict, scope) => {
@@ -156,7 +162,8 @@ function csn2annotationEdm( reqDefs, reqDefsUtils, csnVocabularies, serviceName,
156
162
  const steps = prefix.replace(`@${ns}.`, '').split('.');
157
163
  const paramAnnoParts = steps[0].split('#$parameters');
158
164
  const dictTerm = getDictTerm(`${ns}.${paramAnnoParts[0]}`, options);
159
- if (paramAnnoParts.length > 1 || [ 'Singleton', 'EntitySet' ].some(y => dictTerm?.AppliesTo?.includes(y))) {
165
+ if (paramAnnoParts.length > 1 ||
166
+ [ 'Singleton', 'EntitySet' ].some(y => dictTerm?.AppliesTo?.includes(y))) {
160
167
  steps[0] = `@${ns}.${paramAnnoParts.join('')}`;
161
168
  let newAnno = steps.join('.');
162
169
  if (innerAnnotation)
@@ -185,12 +192,14 @@ function csn2annotationEdm( reqDefs, reqDefsUtils, csnVocabularies, serviceName,
185
192
  There is one exception (Schema), see below
186
193
 
187
194
  carrier = service
188
- the target is the EntityContainer, unless the annotation has an "AppliesTo" where only Schema is given, but not EntityContainer
189
- then the <Annotation ...> is directly put into <Schema ...> without an enclosing <Annotations ...>
195
+ the target is the EntityContainer, unless the annotation has an "AppliesTo"
196
+ where only Schema is given, but not EntityContainer then the <Annotation ...>
197
+ is directly put into <Schema ...> without an enclosing <Annotations ...>
190
198
 
191
199
  carrier = entity (incl. view/projection)
192
- the target is the corresponding EntityType, unless the annotation has an "AppliesTo" where only EntitySet is given, but not EntityType
193
- then the target is the corresponding EntitySet
200
+ the target is the corresponding EntityType, unless the annotation has an
201
+ "AppliesTo" where only EntitySet is given, but not EntityType then the target
202
+ is the corresponding EntitySet
194
203
 
195
204
  carrier = structured type
196
205
  the target is the corresponding ComplexType
@@ -217,7 +226,8 @@ function csn2annotationEdm( reqDefs, reqDefsUtils, csnVocabularies, serviceName,
217
226
  if (def.$elementsAnnoProxies) {
218
227
  Object.entries(def.$elementsAnnoProxies).forEach(([ elemPath, element ]) => {
219
228
  const edmTargetName = `${defName}/${elemPath}`;
220
- handleAnnotations(edmTargetName, element, element.$path, [ ...location, '$elementsAnnoProxies', elemPath ]);
229
+ handleAnnotations(edmTargetName, element, element.$path,
230
+ [ ...location, '$elementsAnnoProxies', elemPath ]);
221
231
  });
222
232
  }
223
233
  // element bound annotations
@@ -278,24 +288,28 @@ function csn2annotationEdm( reqDefs, reqDefsUtils, csnVocabularies, serviceName,
278
288
  if (cAction.$paramsAnnoProxies) {
279
289
  Object.entries(cAction.$paramsAnnoProxies).forEach(([ paramPath, param ]) => {
280
290
  const edmTargetName = `${actionName}/${paramPath}`;
281
- handleAnnotations(edmTargetName, param, param.$path, [ ...location, '$paramsAnnoProxies', paramPath ]);
291
+ handleAnnotations(edmTargetName, param, param.$path,
292
+ [ ...location, '$paramsAnnoProxies', paramPath ]);
282
293
  });
283
294
  }
284
295
  Object.entries(cAction.params).forEach(([ n, p ]) => {
285
296
  const edmTargetName = `${actionName}/${n}`;
286
- handleAnnotations(edmTargetName, p, [ ...location, 'params', n ]);
297
+ handleAnnotations(edmTargetName, p,
298
+ [ ...location, 'params', n ]);
287
299
  });
288
300
  }
289
301
  if (cAction.returns) {
290
302
  if (cAction.$returnsAnnoProxies) {
291
303
  Object.entries(cAction.$returnsAnnoProxies).forEach(([ returnsPath, returns ]) => {
292
304
  const edmTargetName = `${actionName}/${returnsPath}`;
293
- handleAnnotations(edmTargetName, returns, returns.$path, [ ...location, '$returnsAnnoProxies', returnsPath ]);
305
+ handleAnnotations(edmTargetName, returns, returns.$path,
306
+ [ ...location, '$returnsAnnoProxies', returnsPath ]);
294
307
  });
295
308
  }
296
309
  const edmTargetName = `${actionName}/$ReturnType`;
297
310
  setProp(cAction.returns, '$appliesToReturnType', true);
298
- handleAnnotations(edmTargetName, cAction.returns, [ ...location, 'returns' ]);
311
+ handleAnnotations(edmTargetName, cAction.returns,
312
+ [ ...location, 'returns' ]);
299
313
  delete cAction.returns.$appliesToReturnType;
300
314
  }
301
315
 
@@ -304,12 +318,19 @@ function csn2annotationEdm( reqDefs, reqDefsUtils, csnVocabularies, serviceName,
304
318
  const params = [];
305
319
  if (entityNameIfBound) {
306
320
  // If this is an action and has an explicit binding parameter add it here
307
- if (cAction.$bindingParam && cAction.kind === 'action')
308
- params.push(cAction.$bindingParam.items ? `Collection(${entityNameIfBound})` : entityNameIfBound);
309
-
321
+ if (cAction.$bindingParam && cAction.kind === 'action') {
322
+ params.push(
323
+ cAction.$bindingParam.items
324
+ ? `Collection(${entityNameIfBound})`
325
+ : entityNameIfBound
326
+ );
327
+ }
310
328
  // If action/function has no explicit binding parameter add it here
311
- else if (!cAction.$bindingParam)
312
- params.push(cAction['@cds.odata.bindingparameter.collection'] ? `Collection(${entityNameIfBound})` : entityNameIfBound);
329
+ else if (!cAction.$bindingParam) {
330
+ params.push(cAction['@cds.odata.bindingparameter.collection']
331
+ ? `Collection(${entityNameIfBound})`
332
+ : entityNameIfBound);
333
+ }
313
334
  }
314
335
  // In case this is a function the explicit binding parameter is part of
315
336
  // the functions params dictionary. Only for functions all parameters must
@@ -369,50 +390,49 @@ function csn2annotationEdm( reqDefs, reqDefsUtils, csnVocabularies, serviceName,
369
390
  if (knownAnnos.length === 0)
370
391
  return;
371
392
  }
372
- if (isBetaEnabled(options, 'odataAnnotationExpressions')) {
373
- knownAnnos.forEach((knownAnno) => {
374
- if (knownAnno.search(/\.\$edmJson\./g) < 0) {
375
- if (isBetaEnabled(options, 'odataPathsInAnnotationExpressions')) {
376
- transformExpression(carrier, knownAnno, {
377
- ref: (elemref, prop, xpr, csnPath) => {
378
- const { links, scope } = reqDefsUtils.inspectRef(csnPath);
379
- let i = scope === '$self' ? 1 : 0;
380
- const getProp = propName => (links[i].art ? (links[i].art[propName] || reqDefsUtils.effectiveType(links[i].art)[propName]) : undefined);
381
- if (scope === '$magic')
382
- return;
383
- let stop = false;
384
- for (; i < links.length && !stop; i++) {
385
- const cardinality = getProp('cardinality');
386
- if ((cardinality && cardinality.max !== 1) || getProp('items')) {
387
- error('odata-anno-xpr-ref', location, {
388
- count: i + 1, elemref, anno: knownAnno, '#': 'tomany',
389
- });
390
- stop = true;
391
- }
392
- if (!isEdmPropertyRendered(links[i].art, csnPath)) {
393
- error('odata-anno-xpr-ref', location, {
394
- count: i + 1, elemref, anno: knownAnno, '#': 'notrendered',
395
- });
396
- stop = true;
397
- }
398
- if (links[i].art?._target?.$proxy && i < links.length - 1) {
399
- const proxy = links[i].art?._target;
400
- const eltName = links[i + 1].art?.name;
401
- if (!proxy.elements[eltName]) {
402
- error('odata-anno-xpr-ref', location, {
403
- count: i + 2, elemref, anno: knownAnno, '#': 'notrendered',
404
- });
405
- stop = true;
406
- }
407
- }
393
+
394
+ knownAnnos.forEach((knownAnno) => {
395
+ if (knownAnno.search(/\.\$edmJson\./g) < 0) {
396
+ transformExpression(carrier, knownAnno, {
397
+ ref: (elemref, prop, xpr, csnPath) => {
398
+ if (options.isV2() && elemref.$bparam) {
399
+ error('odata-anno-xpr-ref', location, {
400
+ elemref, anno: knownAnno, version: '2.0', '#': 'bparam_v2',
401
+ });
402
+ return;
403
+ }
404
+ const { links, scope } = reqDefsUtils.inspectRef(csnPath);
405
+ let i = scope === '$self' ? 1 : 0;
406
+ if (scope === '$magic') {
407
+ error('odata-anno-xpr-ref', location, {
408
+ elemref, anno: knownAnno, '#': 'magic',
409
+ });
410
+ return;
411
+ }
412
+ let stop = false;
413
+ for (; i < links.length && !stop; i++) {
414
+ if (!isEdmPropertyRendered(links[i].art, csnPath)) {
415
+ error('odata-anno-xpr-ref', location, {
416
+ count: i + 1, elemref, anno: knownAnno, '#': 'notrendered',
417
+ });
418
+ stop = true;
419
+ }
420
+ if (links[i].art?._target?.$proxy && i < links.length - 1) {
421
+ const proxy = links[i].art?._target;
422
+ const eltName = links[i + 1].art?.name;
423
+ if (!proxy.elements[eltName]) {
424
+ error('odata-anno-xpr-ref', location, {
425
+ count: i + 2, elemref, anno: knownAnno, '#': 'notrendered',
426
+ });
427
+ stop = true;
408
428
  }
409
- },
410
- }, csnPathResolutionLocation);
411
- }
412
- xpr2edmJson(carrier, knownAnno, location, options, messageFunctions);
413
- }
414
- });
415
- }
429
+ }
430
+ }
431
+ },
432
+ }, csnPathResolutionLocation);
433
+ xpr2edmJson(carrier, knownAnno, location, options, messageFunctions);
434
+ }
435
+ });
416
436
 
417
437
  const prefixTree = createPrefixTree();
418
438
 
package/lib/edm/edm.js CHANGED
@@ -19,11 +19,11 @@ function getEdm( options, messageFunctions ) {
19
19
  */
20
20
  constructor(version, attributes = Object.create(null), csn = undefined) {
21
21
  if (!attributes || typeof attributes !== 'object')
22
- error(null, 'Please debug me: attributes must be a dictionary');
22
+ error(null, 'Debug me: attributes must be a dictionary');
23
23
  if (!Array.isArray(version))
24
- error(null, `Please debug me: v is either undefined or not an array: ${version}`);
24
+ error(null, `Debug me: v is either undefined or not an array: ${version}`);
25
25
  if (version.filter(v => v).length !== 1)
26
- error(null, 'Please debug me: exactly one version must be set');
26
+ error(null, 'Debug me: exactly one version must be set');
27
27
 
28
28
  // Common attributes of JSON and XML.
29
29
  // Note: Can't assign attributes directly, due to the input object being modified.
@@ -1108,7 +1108,7 @@ function getEdm( options, messageFunctions ) {
1108
1108
  json.$OnDelete = c._edmAttributes.Action;
1109
1109
  break;
1110
1110
  default:
1111
- error(null, `Please debug me: Unhandled NavProp child: ${c.kind}`);
1111
+ error(null, `Debug me: Unhandled NavProp child: ${c.kind}`);
1112
1112
  }
1113
1113
  });
1114
1114
  // TODO Annotations
@@ -3,6 +3,7 @@
3
3
  const { setProp, isBetaEnabled } = require('../base/model');
4
4
  const {
5
5
  forEachDefinition, forEachMemberRecursively, getUtils,
6
+ transformExpression, findAnnotationExpression,
6
7
  } = require('../model/csnUtils');
7
8
  const { isBuiltinType } = require('../base/builtins');
8
9
  const { assignAnnotation } = require('./edmUtils.js');
@@ -55,8 +56,10 @@ function inboundQualificationChecks( csn, options, messageFunctions,
55
56
  Object.entries(def.actions).forEach(([ n, action ]) => {
56
57
  const aLoc = location.concat('actions', n);
57
58
  checkIfItemsOfItems(action, undefined, undefined, aLoc);
59
+ markBindingParamPaths(action, aLoc);
58
60
  forEachMemberRecursively(action, checkIfItemsOfItems, aLoc);
59
61
  checkIfItemsOfItems(action.returns, undefined, undefined, aLoc.concat('returns'));
62
+ markBindingParamPaths(action, aLoc);
60
63
  });
61
64
  }
62
65
 
@@ -124,6 +127,36 @@ function inboundQualificationChecks( csn, options, messageFunctions,
124
127
  message('chained-array-of', path);
125
128
  }
126
129
  }
130
+
131
+ // we need to know if the first path step is the bindind param
132
+ // for the rejection of V2 paths where the BP is ignored
133
+ function markBindingParamPaths( action, loc ) {
134
+ const special$self = !csn?.definitions?.$self && '$self';
135
+ if (action.params) {
136
+ const params = Object.entries(action.params);
137
+ const firstParam = params[0][1];
138
+ const type = firstParam?.items?.type || firstParam?.type;
139
+ if (type === special$self) {
140
+ const bindingParamName = params[0][0];
141
+ const markBindingParam = {
142
+ ref: (parent, prop, xpr) => {
143
+ if ((xpr[0].id || xpr[0]) === bindingParamName)
144
+ parent.$bparam = true;
145
+ },
146
+ };
147
+ let exprAnnos = Object.keys(action).filter(pn => findAnnotationExpression(action, pn));
148
+ exprAnnos.forEach((pn) => {
149
+ transformExpression(action, pn, markBindingParam, loc);
150
+ });
151
+ forEachMemberRecursively(action, (member, _memberName, _prop, path, _parent) => {
152
+ exprAnnos = Object.keys(member).filter(pn => findAnnotationExpression(member, pn));
153
+ exprAnnos.forEach((pn) => {
154
+ transformExpression(member, pn, markBindingParam, path);
155
+ });
156
+ }, loc);
157
+ }
158
+ }
159
+ }
127
160
  }
128
161
 
129
162
  function checkNestedContextsAndServices() {
@@ -127,7 +127,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
127
127
  const mySchemaName = whatsMySchemaName(defName);
128
128
  if (mySchemaName)
129
129
  setProp(def, '$mySchemaName', mySchemaName);
130
- if (isMyServiceRequested(defName) && def.kind !== 'aspect')
130
+ if (isMyServiceRequested(defName) && def.kind !== 'aspect' && def.kind !== 'event')
131
131
  reqDefs.definitions[defName] = def;
132
132
  },
133
133
  linkAssociationTarget,
@@ -1641,7 +1641,10 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
1641
1641
  if (art.type && !isBuiltinType(art.type))
1642
1642
  art = art._type || csnUtils.getCsnDef(art.type);
1643
1643
  }
1644
- keyPaths.push(...produceKeyRefPaths(art, prefix + options.pathDelimiter + k.ref.join(options.pathDelimiter), path));
1644
+ if (art === eltCsn)
1645
+ error('odata-key-recursive', path, { name: prefix });
1646
+ else
1647
+ keyPaths.push(...produceKeyRefPaths(art, prefix + options.pathDelimiter + k.ref.join(options.pathDelimiter), path));
1645
1648
  });
1646
1649
  }
1647
1650
  else {
@@ -2176,7 +2179,6 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
2176
2179
  let isSubTreeSpan = true;
2177
2180
 
2178
2181
  let rootPrefix = absPath.slice(1, absPath.length - 1);
2179
- const isExprAnno = (obj, pn) => isBetaEnabled(options, 'odataPathsInAnnotationExpressions') && findAnnotationExpression(obj, pn);
2180
2182
 
2181
2183
  const subTreeSpan = {
2182
2184
  ref: (parent, _prop, xpr) => {
@@ -2228,7 +2230,7 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
2228
2230
  if (absPath.length > 2) {
2229
2231
  const [ xprANames, nxprANames ] = Object.keys(carrier).reduce((acc, pn) => {
2230
2232
  if (pn[0] === '@')
2231
- acc[isExprAnno(carrier, pn) ? 0 : 1].push(pn);
2233
+ acc[findAnnotationExpression(carrier, pn) ? 0 : 1].push(pn);
2232
2234
  return acc;
2233
2235
  }, [ [], [] ]);
2234
2236
 
@@ -2244,8 +2246,10 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
2244
2246
  if (scope === 'actions' && def[scope][carrier.$path[3]]) {
2245
2247
  def = def[scope][carrier.$path[3]];
2246
2248
  scope = carrier.$path[4];
2247
- if (scope === 'params')
2249
+ if (scope === 'params') {
2248
2250
  rootPrefix = absPath.slice(2, absPath.length - 1);
2251
+ eltPath = absPath.slice(2).join('/');
2252
+ }
2249
2253
  if (scope === 'returns') {
2250
2254
  absPath[2] = '$ReturnType';
2251
2255
  rootPrefix = absPath.slice(3, absPath.length - 1);
@@ -2263,7 +2267,6 @@ function initializeModel( csn, _options, messageFunctions, requestedServiceNames
2263
2267
  else {
2264
2268
  absolutize.scope = scope;
2265
2269
  transformExpression(carrier, xprAName, absolutize);
2266
-
2267
2270
  if (!def[proxyDict])
2268
2271
  setProp(def, proxyDict, Object.create(null));
2269
2272
  let proxyCarrier = def[proxyDict][eltPath];
@@ -213,7 +213,6 @@
213
213
  "Type": "Capabilities.CountRestrictionsType",
214
214
  "AppliesTo": [
215
215
  "EntitySet",
216
- "Singleton",
217
216
  "Collection"
218
217
  ]
219
218
  },
@@ -417,6 +416,12 @@
417
416
  "Property"
418
417
  ]
419
418
  },
419
+ "Capabilities.DefaultCapabilities": {
420
+ "Type": "Capabilities.DefaultCapabilitiesType",
421
+ "AppliesTo": [
422
+ "EntityContainer"
423
+ ]
424
+ },
420
425
  "CodeList.CurrencyCodes": {
421
426
  "Type": "CodeList.CodeListSource",
422
427
  "AppliesTo": [
@@ -2553,20 +2558,34 @@
2553
2558
  "DocumentationUrl": "Edm.String"
2554
2559
  }
2555
2560
  },
2561
+ "Capabilities.ChangeTrackingBase": {
2562
+ "$kind": "ComplexType",
2563
+ "Properties": {
2564
+ "Supported": "Edm.Boolean"
2565
+ }
2566
+ },
2556
2567
  "Capabilities.ChangeTrackingType": {
2557
2568
  "$kind": "ComplexType",
2569
+ "BaseType": "Capabilities.ChangeTrackingBase",
2558
2570
  "Properties": {
2559
- "Supported": "Edm.Boolean",
2560
2571
  "FilterableProperties": "Collection(Edm.PropertyPath)",
2561
- "ExpandableProperties": "Collection(Edm.NavigationPropertyPath)"
2572
+ "ExpandableProperties": "Collection(Edm.NavigationPropertyPath)",
2573
+ "Supported": "Edm.Boolean"
2574
+ }
2575
+ },
2576
+ "Capabilities.CountRestrictionsBase": {
2577
+ "$kind": "ComplexType",
2578
+ "Properties": {
2579
+ "Countable": "Edm.Boolean"
2562
2580
  }
2563
2581
  },
2564
2582
  "Capabilities.CountRestrictionsType": {
2565
2583
  "$kind": "ComplexType",
2584
+ "BaseType": "Capabilities.CountRestrictionsBase",
2566
2585
  "Properties": {
2567
- "Countable": "Edm.Boolean",
2568
2586
  "NonCountableProperties": "Collection(Edm.PropertyPath)",
2569
- "NonCountableNavigationProperties": "Collection(Edm.NavigationPropertyPath)"
2587
+ "NonCountableNavigationProperties": "Collection(Edm.NavigationPropertyPath)",
2588
+ "Countable": "Edm.Boolean"
2570
2589
  }
2571
2590
  },
2572
2591
  "Capabilities.NavigationRestrictionsType": {
@@ -2625,14 +2644,23 @@
2625
2644
  "SupportedFormats": "Collection(Edm.String)"
2626
2645
  }
2627
2646
  },
2628
- "Capabilities.FilterRestrictionsType": {
2647
+ "Capabilities.FilterRestrictionsBase": {
2629
2648
  "$kind": "ComplexType",
2630
2649
  "Properties": {
2631
2650
  "Filterable": "Edm.Boolean",
2632
2651
  "RequiresFilter": "Edm.Boolean",
2652
+ "MaxLevels": "Edm.Int32"
2653
+ }
2654
+ },
2655
+ "Capabilities.FilterRestrictionsType": {
2656
+ "$kind": "ComplexType",
2657
+ "BaseType": "Capabilities.FilterRestrictionsBase",
2658
+ "Properties": {
2633
2659
  "RequiredProperties": "Collection(Edm.PropertyPath)",
2634
2660
  "NonFilterableProperties": "Collection(Edm.PropertyPath)",
2635
2661
  "FilterExpressionRestrictions": "Collection(Capabilities.FilterExpressionRestrictionType)",
2662
+ "Filterable": "Edm.Boolean",
2663
+ "RequiresFilter": "Edm.Boolean",
2636
2664
  "MaxLevels": "Edm.Int32"
2637
2665
  }
2638
2666
  },
@@ -2643,22 +2671,38 @@
2643
2671
  "AllowedExpressions": "Capabilities.FilterExpressionType"
2644
2672
  }
2645
2673
  },
2674
+ "Capabilities.SortRestrictionsBase": {
2675
+ "$kind": "ComplexType",
2676
+ "Properties": {
2677
+ "Sortable": "Edm.Boolean"
2678
+ }
2679
+ },
2646
2680
  "Capabilities.SortRestrictionsType": {
2647
2681
  "$kind": "ComplexType",
2682
+ "BaseType": "Capabilities.SortRestrictionsBase",
2648
2683
  "Properties": {
2649
- "Sortable": "Edm.Boolean",
2650
2684
  "AscendingOnlyProperties": "Collection(Edm.PropertyPath)",
2651
2685
  "DescendingOnlyProperties": "Collection(Edm.PropertyPath)",
2652
- "NonSortableProperties": "Collection(Edm.PropertyPath)"
2686
+ "NonSortableProperties": "Collection(Edm.PropertyPath)",
2687
+ "Sortable": "Edm.Boolean"
2653
2688
  }
2654
2689
  },
2655
- "Capabilities.ExpandRestrictionsType": {
2690
+ "Capabilities.ExpandRestrictionsBase": {
2656
2691
  "$kind": "ComplexType",
2657
2692
  "Properties": {
2658
2693
  "Expandable": "Edm.Boolean",
2659
2694
  "StreamsExpandable": "Edm.Boolean",
2695
+ "MaxLevels": "Edm.Int32"
2696
+ }
2697
+ },
2698
+ "Capabilities.ExpandRestrictionsType": {
2699
+ "$kind": "ComplexType",
2700
+ "BaseType": "Capabilities.ExpandRestrictionsBase",
2701
+ "Properties": {
2660
2702
  "NonExpandableProperties": "Collection(Edm.NavigationPropertyPath)",
2661
2703
  "NonExpandableStreamProperties": "Collection(Edm.PropertyPath)",
2704
+ "Expandable": "Edm.Boolean",
2705
+ "StreamsExpandable": "Edm.Boolean",
2662
2706
  "MaxLevels": "Edm.Int32"
2663
2707
  }
2664
2708
  },
@@ -2669,16 +2713,31 @@
2669
2713
  "UnsupportedExpressions": "Capabilities.SearchExpressions"
2670
2714
  }
2671
2715
  },
2672
- "Capabilities.InsertRestrictionsType": {
2716
+ "Capabilities.InsertRestrictionsBase": {
2673
2717
  "$kind": "ComplexType",
2674
2718
  "Properties": {
2675
2719
  "Insertable": "Edm.Boolean",
2720
+ "MaxLevels": "Edm.Int32",
2721
+ "TypecastSegmentSupported": "Edm.Boolean",
2722
+ "QueryOptions": "Capabilities.ModificationQueryOptionsType",
2723
+ "CustomHeaders": "Collection(Capabilities.CustomParameter)",
2724
+ "CustomQueryOptions": "Collection(Capabilities.CustomParameter)",
2725
+ "Description": "Edm.String",
2726
+ "LongDescription": "Edm.String",
2727
+ "ErrorResponses": "Collection(Capabilities.HttpResponse)"
2728
+ }
2729
+ },
2730
+ "Capabilities.InsertRestrictionsType": {
2731
+ "$kind": "ComplexType",
2732
+ "BaseType": "Capabilities.InsertRestrictionsBase",
2733
+ "Properties": {
2676
2734
  "NonInsertableProperties": "Collection(Edm.PropertyPath)",
2677
2735
  "NonInsertableNavigationProperties": "Collection(Edm.NavigationPropertyPath)",
2678
2736
  "RequiredProperties": "Collection(Edm.PropertyPath)",
2737
+ "Permissions": "Collection(Capabilities.PermissionType)",
2738
+ "Insertable": "Edm.Boolean",
2679
2739
  "MaxLevels": "Edm.Int32",
2680
2740
  "TypecastSegmentSupported": "Edm.Boolean",
2681
- "Permissions": "Collection(Capabilities.PermissionType)",
2682
2741
  "QueryOptions": "Capabilities.ModificationQueryOptionsType",
2683
2742
  "CustomHeaders": "Collection(Capabilities.CustomParameter)",
2684
2743
  "CustomQueryOptions": "Collection(Capabilities.CustomParameter)",
@@ -2708,7 +2767,7 @@
2708
2767
  "ContentIDSupported": "Edm.Boolean"
2709
2768
  }
2710
2769
  },
2711
- "Capabilities.UpdateRestrictionsType": {
2770
+ "Capabilities.UpdateRestrictionsBase": {
2712
2771
  "$kind": "ComplexType",
2713
2772
  "Properties": {
2714
2773
  "Updatable": "Edm.Boolean",
@@ -2717,9 +2776,29 @@
2717
2776
  "UpdateMethod": "Capabilities.HttpMethod",
2718
2777
  "FilterSegmentSupported": "Edm.Boolean",
2719
2778
  "TypecastSegmentSupported": "Edm.Boolean",
2779
+ "MaxLevels": "Edm.Int32",
2780
+ "Permissions": "Collection(Capabilities.PermissionType)",
2781
+ "QueryOptions": "Capabilities.ModificationQueryOptionsType",
2782
+ "CustomHeaders": "Collection(Capabilities.CustomParameter)",
2783
+ "CustomQueryOptions": "Collection(Capabilities.CustomParameter)",
2784
+ "Description": "Edm.String",
2785
+ "LongDescription": "Edm.String",
2786
+ "ErrorResponses": "Collection(Capabilities.HttpResponse)"
2787
+ }
2788
+ },
2789
+ "Capabilities.UpdateRestrictionsType": {
2790
+ "$kind": "ComplexType",
2791
+ "BaseType": "Capabilities.UpdateRestrictionsBase",
2792
+ "Properties": {
2720
2793
  "NonUpdatableProperties": "Collection(Edm.PropertyPath)",
2721
2794
  "NonUpdatableNavigationProperties": "Collection(Edm.NavigationPropertyPath)",
2722
2795
  "RequiredProperties": "Collection(Edm.PropertyPath)",
2796
+ "Updatable": "Edm.Boolean",
2797
+ "Upsertable": "Edm.Boolean",
2798
+ "DeltaUpdateSupported": "Edm.Boolean",
2799
+ "UpdateMethod": "Capabilities.HttpMethod",
2800
+ "FilterSegmentSupported": "Edm.Boolean",
2801
+ "TypecastSegmentSupported": "Edm.Boolean",
2723
2802
  "MaxLevels": "Edm.Int32",
2724
2803
  "Permissions": "Collection(Capabilities.PermissionType)",
2725
2804
  "QueryOptions": "Capabilities.ModificationQueryOptionsType",
@@ -2737,11 +2816,27 @@
2737
2816
  "ContentIDSupported": "Edm.Boolean"
2738
2817
  }
2739
2818
  },
2740
- "Capabilities.DeleteRestrictionsType": {
2819
+ "Capabilities.DeleteRestrictionsBase": {
2741
2820
  "$kind": "ComplexType",
2742
2821
  "Properties": {
2743
2822
  "Deletable": "Edm.Boolean",
2823
+ "MaxLevels": "Edm.Int32",
2824
+ "FilterSegmentSupported": "Edm.Boolean",
2825
+ "TypecastSegmentSupported": "Edm.Boolean",
2826
+ "Permissions": "Collection(Capabilities.PermissionType)",
2827
+ "CustomHeaders": "Collection(Capabilities.CustomParameter)",
2828
+ "CustomQueryOptions": "Collection(Capabilities.CustomParameter)",
2829
+ "Description": "Edm.String",
2830
+ "LongDescription": "Edm.String",
2831
+ "ErrorResponses": "Collection(Capabilities.HttpResponse)"
2832
+ }
2833
+ },
2834
+ "Capabilities.DeleteRestrictionsType": {
2835
+ "$kind": "ComplexType",
2836
+ "BaseType": "Capabilities.DeleteRestrictionsBase",
2837
+ "Properties": {
2744
2838
  "NonDeletableNavigationProperties": "Collection(Edm.NavigationPropertyPath)",
2839
+ "Deletable": "Edm.Boolean",
2745
2840
  "MaxLevels": "Edm.Int32",
2746
2841
  "FilterSegmentSupported": "Edm.Boolean",
2747
2842
  "TypecastSegmentSupported": "Edm.Boolean",
@@ -2841,6 +2936,27 @@
2841
2936
  "ExampleValues": "Collection(Core.PrimitiveExampleValue)"
2842
2937
  }
2843
2938
  },
2939
+ "Capabilities.DefaultCapabilitiesType": {
2940
+ "$kind": "ComplexType",
2941
+ "Properties": {
2942
+ "ChangeTracking": "Capabilities.ChangeTrackingBase",
2943
+ "CountRestrictions": "Capabilities.CountRestrictionsBase",
2944
+ "IndexableByKey": "Core.Tag",
2945
+ "TopSupported": "Core.Tag",
2946
+ "SkipSupported": "Core.Tag",
2947
+ "ComputeSupported": "Core.Tag",
2948
+ "SelectSupport": "Capabilities.SelectSupportType",
2949
+ "FilterRestrictions": "Capabilities.FilterRestrictionsBase",
2950
+ "SortRestrictions": "Capabilities.SortRestrictionsBase",
2951
+ "ExpandRestrictions": "Capabilities.ExpandRestrictionsBase",
2952
+ "SearchRestrictions": "Capabilities.SearchRestrictionsType",
2953
+ "InsertRestrictions": "Capabilities.InsertRestrictionsBase",
2954
+ "UpdateRestrictions": "Capabilities.UpdateRestrictionsBase",
2955
+ "DeleteRestrictions": "Capabilities.DeleteRestrictionsBase",
2956
+ "OperationRestrictions": "Capabilities.OperationRestrictionsType",
2957
+ "ReadRestrictions": "Capabilities.ReadRestrictionsType"
2958
+ }
2959
+ },
2844
2960
  "Capabilities.HttpResponse": {
2845
2961
  "$kind": "ComplexType",
2846
2962
  "Properties": {
@@ -3102,7 +3218,6 @@
3102
3218
  "TargetEntities": "Collection(Edm.NavigationPropertyPath)",
3103
3219
  "EffectTypes": "Common.EffectType",
3104
3220
  "TriggerAction": "Common.QualifiedName",
3105
- "TriggeredIndicator": "Edm.Boolean",
3106
3221
  "Discretionary": "Edm.Boolean"
3107
3222
  }
3108
3223
  },
@@ -1 +1 @@
1
- 94c7898bd2c786378430965b9e240ce0
1
+ 0c76b255e5fe55c0f8527a4d9f1b563f