@sap/ux-specification 1.90.24 → 1.90.27

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 (160) hide show
  1. package/CHANGELOG.md +80 -1
  2. package/dist/documentation/v2/v2-AnalyticalListPage.html +1 -1
  3. package/dist/documentation/v2/v2-ApplicationV2.html +1 -1
  4. package/dist/documentation/v2/v2-ListReport.html +1 -1
  5. package/dist/documentation/v2/v2-ObjectPage.html +1 -1
  6. package/dist/documentation/v2/v2-OverviewPage.html +1 -1
  7. package/dist/documentation/v4/v4-ApplicationV4.html +1 -1
  8. package/dist/documentation/v4/v4-ListReport.html +1 -1
  9. package/dist/documentation/v4/v4-ObjectPage.html +1 -1
  10. package/dist/index-min.js +1 -1
  11. package/dist/schemas/v2/AnalyticalListPageConfig.json +10 -10
  12. package/dist/schemas/v2/ListReportConfig.json +15 -15
  13. package/dist/schemas/v2/ObjectPageConfig.json +204 -20
  14. package/dist/schemas/v4/ListReportConfig.json +33 -3
  15. package/dist/schemas/v4/ObjectPageConfig.json +36 -0
  16. package/dist/scripts/to-json-schema.js +1 -1
  17. package/dist/scripts/to-json-schema.js.map +1 -1
  18. package/dist/specification/v2/index-min.js +1 -1
  19. package/dist/src/apiTypes.d.ts +2 -1
  20. package/dist/src/project.d.ts +1 -0
  21. package/dist/src/project.js +13 -5
  22. package/dist/src/project.js.map +1 -1
  23. package/dist/src/specification/v2/controls/Action.d.ts +6 -4
  24. package/dist/src/specification/v2/controls/ObjectPageHeader.d.ts +3 -2
  25. package/dist/src/specification/v2/controls/ObjectPageSection.d.ts +40 -7
  26. package/dist/src/specification/v2/controls/ObjectPageSection.js.map +1 -1
  27. package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +5 -3
  28. package/dist/src/specification/v2/controls/ObjectPageTable.js.map +1 -1
  29. package/dist/src/specification/v2/controls/Table.d.ts +7 -4
  30. package/dist/src/specification/v2/controls/Table.js.map +1 -1
  31. package/dist/src/specification/v4/controls/ObjectPageSection.d.ts +22 -1
  32. package/dist/src/specification/v4/controls/ObjectPageSection.js.map +1 -1
  33. package/dist/src/specification/v4/controls/Table.d.ts +8 -0
  34. package/dist/src/specification/v4/pages/ListReportConfig.d.ts +6 -1
  35. package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.d.ts +1 -0
  36. package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.js.map +1 -1
  37. package/dist/src/sync/common/decoration/control.d.ts +1 -1
  38. package/dist/src/sync/common/decoration/control.js +27 -22
  39. package/dist/src/sync/common/decoration/control.js.map +1 -1
  40. package/dist/src/sync/common/generate/objectPage.d.ts +5 -4
  41. package/dist/src/sync/common/generate/objectPage.js +67 -66
  42. package/dist/src/sync/common/generate/objectPage.js.map +1 -1
  43. package/dist/src/sync/common/generate/utils.d.ts +54 -13
  44. package/dist/src/sync/common/generate/utils.js +140 -47
  45. package/dist/src/sync/common/generate/utils.js.map +1 -1
  46. package/dist/src/sync/common/import/utils.d.ts +3 -2
  47. package/dist/src/sync/common/import/utils.js +11 -6
  48. package/dist/src/sync/common/import/utils.js.map +1 -1
  49. package/dist/src/sync/common/importProject.js +20 -19
  50. package/dist/src/sync/common/importProject.js.map +1 -1
  51. package/dist/src/sync/common/types.d.ts +105 -26
  52. package/dist/src/sync/common/types.js +101 -22
  53. package/dist/src/sync/common/types.js.map +1 -1
  54. package/dist/src/sync/common/utils.d.ts +17 -12
  55. package/dist/src/sync/common/utils.js +132 -88
  56. package/dist/src/sync/common/utils.js.map +1 -1
  57. package/dist/src/sync/v2/export/controls/Action.d.ts +12 -10
  58. package/dist/src/sync/v2/export/controls/Action.js.map +1 -1
  59. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js +1 -1
  60. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -1
  61. package/dist/src/sync/v2/export/controls/FormAction.d.ts +9 -7
  62. package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -1
  63. package/dist/src/sync/v2/export/controls/Fragment.js +2 -2
  64. package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -1
  65. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +6 -4
  66. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -1
  67. package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts +3 -2
  68. package/dist/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -1
  69. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +6 -4
  70. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -1
  71. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +26 -14
  72. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +57 -5
  73. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -1
  74. package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +5 -3
  75. package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
  76. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +6 -4
  77. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -1
  78. package/dist/src/sync/v2/export/controls/Table.d.ts +6 -3
  79. package/dist/src/sync/v2/export/controls/Table.js +89 -48
  80. package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
  81. package/dist/src/sync/v2/export/controls/TableColumn.d.ts +12 -10
  82. package/dist/src/sync/v2/export/controls/TableColumn.js.map +1 -1
  83. package/dist/src/sync/v2/export/export.d.ts +0 -1
  84. package/dist/src/sync/v2/export/export.js +222 -160
  85. package/dist/src/sync/v2/export/export.js.map +1 -1
  86. package/dist/src/sync/v2/export/exportPage.js +35 -34
  87. package/dist/src/sync/v2/export/exportPage.js.map +1 -1
  88. package/dist/src/sync/v2/export/manifest.d.ts +22 -0
  89. package/dist/src/sync/v2/export/manifest.js +77 -36
  90. package/dist/src/sync/v2/export/manifest.js.map +1 -1
  91. package/dist/src/sync/v2/export/pages/OverviewPage.d.ts +1 -1
  92. package/dist/src/sync/v2/export/pages/OverviewPage.js +18 -16
  93. package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -1
  94. package/dist/src/sync/v2/generate/analyticalListReport.js +10 -10
  95. package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
  96. package/dist/src/sync/v2/generate/listReport.js +1 -1
  97. package/dist/src/sync/v2/generate/listReport.js.map +1 -1
  98. package/dist/src/sync/v2/generate/objectPage.js +57 -43
  99. package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
  100. package/dist/src/sync/v2/generate/utils.d.ts +5 -4
  101. package/dist/src/sync/v2/generate/utils.js +73 -69
  102. package/dist/src/sync/v2/generate/utils.js.map +1 -1
  103. package/dist/src/sync/v2/import/app/appProvider.d.ts +9 -0
  104. package/dist/src/sync/v2/import/app/appProvider.js +36 -13
  105. package/dist/src/sync/v2/import/app/appProvider.js.map +1 -1
  106. package/dist/src/sync/v2/import/app/ovpProvider.js +1 -1
  107. package/dist/src/sync/v2/import/app/ovpProvider.js.map +1 -1
  108. package/dist/src/sync/v2/import/common/index.js +6 -6
  109. package/dist/src/sync/v2/import/common/index.js.map +1 -1
  110. package/dist/src/sync/v2/import/pages/objectPage.js +93 -101
  111. package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
  112. package/dist/src/sync/v2/import/pages/overviewPage.js +1 -1
  113. package/dist/src/sync/v2/import/pages/overviewPage.js.map +1 -1
  114. package/dist/src/sync/v2/import/utils.js +1 -1
  115. package/dist/src/sync/v2/import/utils.js.map +1 -1
  116. package/dist/src/sync/v2/types.d.ts +8 -3
  117. package/dist/src/sync/v2/types.js +6 -2
  118. package/dist/src/sync/v2/types.js.map +1 -1
  119. package/dist/src/sync/v4/application.d.ts +22 -10
  120. package/dist/src/sync/v4/application.js +68 -19
  121. package/dist/src/sync/v4/application.js.map +1 -1
  122. package/dist/src/sync/v4/export/controls/ObjectPageTable.js +6 -18
  123. package/dist/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
  124. package/dist/src/sync/v4/export/controls/Table.d.ts +8 -1
  125. package/dist/src/sync/v4/export/controls/Table.js +110 -86
  126. package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
  127. package/dist/src/sync/v4/export/controls/TableColumn.js +4 -4
  128. package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
  129. package/dist/src/sync/v4/export/export.js +285 -150
  130. package/dist/src/sync/v4/export/export.js.map +1 -1
  131. package/dist/src/sync/v4/export/manifest.js +25 -6
  132. package/dist/src/sync/v4/export/manifest.js.map +1 -1
  133. package/dist/src/sync/v4/export/pages/ListReport.d.ts +1 -0
  134. package/dist/src/sync/v4/export/pages/ListReport.js +7 -0
  135. package/dist/src/sync/v4/export/pages/ListReport.js.map +1 -1
  136. package/dist/src/sync/v4/export/pages/ObjectPage.js +3 -2
  137. package/dist/src/sync/v4/export/pages/ObjectPage.js.map +1 -1
  138. package/dist/src/sync/v4/export/types.d.ts +5 -5
  139. package/dist/src/sync/v4/generate/listReport.js +304 -156
  140. package/dist/src/sync/v4/generate/listReport.js.map +1 -1
  141. package/dist/src/sync/v4/generate/objectPage.d.ts +1 -1
  142. package/dist/src/sync/v4/generate/objectPage.js +286 -148
  143. package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
  144. package/dist/src/sync/v4/import/app/appProvider.js +32 -22
  145. package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
  146. package/dist/src/sync/v4/import/pages/listReport.js +54 -37
  147. package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
  148. package/dist/src/sync/v4/import/pages/objectPage.d.ts +13 -0
  149. package/dist/src/sync/v4/import/pages/objectPage.js +64 -35
  150. package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
  151. package/dist/src/sync/v4/import/utils.d.ts +2 -1
  152. package/dist/src/sync/v4/import/utils.js.map +1 -1
  153. package/dist/src/sync/v4/types.d.ts +2 -0
  154. package/dist/src/sync/v4/utils/StableIdHelper.js +13 -10
  155. package/dist/src/sync/v4/utils/StableIdHelper.js.map +1 -1
  156. package/dist/src/sync/v4/utils/utils.d.ts +7 -7
  157. package/dist/src/sync/v4/utils/utils.js +44 -34
  158. package/dist/src/sync/v4/utils/utils.js.map +1 -1
  159. package/dist/test/unit/export/manifest.test.d.ts +1 -0
  160. package/package.json +3 -3
@@ -4,15 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const types_1 = require("./types");
7
+ const i18next_1 = __importDefault(require("i18next"));
8
+ const deepmerge_1 = __importDefault(require("deepmerge"));
9
+ const v4_1 = require("../../specification/v4");
10
+ const v2_1 = require("../../specification/v2");
11
+ const types_2 = require("./types");
7
12
  const annotation_converter_1 = require("@sap-ux/annotation-converter");
8
13
  const edmx_parser_1 = require("@sap-ux/edmx-parser");
9
14
  const common_1 = require("../../specification/common");
10
15
  const schemaAccess_1 = require("../../specification/schemaAccess");
11
- const i18next_1 = __importDefault(require("i18next"));
12
- const v2_1 = require("../../specification/v2");
13
- const v4_1 = require("../../specification/v4");
14
16
  const extensionLogger_1 = require("../../extensionLogger");
15
- const deepmerge_1 = __importDefault(require("deepmerge"));
16
17
  var TemplateType;
17
18
  (function (TemplateType) {
18
19
  TemplateType["ListReportObjectPageV2"] = "ListReportObjectPageV2";
@@ -182,7 +183,7 @@ function getTitleForDataField(dataField, entityType, dataFieldLabel) {
182
183
  * @param dataFieldAbstract - the given record of the line item annotation
183
184
  * @param entityType - the entity type as part of the AVT ConverterOutput
184
185
  */
185
- function getDatafieldDescription(dataFieldAbstract, entityType) {
186
+ function getDataFieldDescription(dataFieldAbstract, entityType) {
186
187
  let title = '', propertyCommonLabel, dataField;
187
188
  const dataFieldLabel = getLabel(dataFieldAbstract.Label, entityType);
188
189
  switch (dataFieldAbstract.$Type) {
@@ -227,7 +228,16 @@ function getDatafieldDescription(dataFieldAbstract, entityType) {
227
228
  }
228
229
  return title;
229
230
  }
230
- exports.getDatafieldDescription = getDatafieldDescription;
231
+ exports.getDataFieldDescription = getDataFieldDescription;
232
+ /**
233
+ * Prepare string for reference use in schema
234
+ * @param refInput string to be character checked and replaced
235
+ * @returns string with replaced characters
236
+ */
237
+ function prepareRef(refInput) {
238
+ return refInput.replace('#', '::').replace(/\//g, ':2f');
239
+ }
240
+ exports.prepareRef = prepareRef;
231
241
  /**
232
242
  * Return the page type for a given V2 page in manifest
233
243
  * @param name - page component name
@@ -298,8 +308,7 @@ function determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT)
298
308
  * @param navigationParts - parts of the target annotation path
299
309
  */
300
310
  function adjustKey(key, navigationParts, keyForRelatedFacetKeys) {
301
- const uiParts = (navigationParts[1] || navigationParts[0]).split('#');
302
- const uiClass = uiParts[0];
311
+ const uiClass = navigationParts[navigationParts.length - 1].split('#')[0];
303
312
  if (uiClass.includes('.LineItem')) {
304
313
  const pathParts = key.split('::');
305
314
  pathParts[pathParts.length - 1] = `${!keyForRelatedFacetKeys ? '@' : ''}${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`;
@@ -308,6 +317,33 @@ function adjustKey(key, navigationParts, keyForRelatedFacetKeys) {
308
317
  else {
309
318
  key = uiClass.replace('@UI', `${!keyForRelatedFacetKeys ? '@' : ''}com.sap.vocabularies.UI.v1`);
310
319
  }
320
+ return key;
321
+ }
322
+ function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion = common_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
323
+ var _a;
324
+ let stopProcessing = false;
325
+ const navigationParts = propertyValue.split('/');
326
+ const navigation = navigationParts.length > 1;
327
+ if (navigation) {
328
+ entityType = (_a = entityType.resolvePath(propertyValue.substring(0, propertyValue.lastIndexOf('/')))) === null || _a === void 0 ? void 0 : _a.targetType;
329
+ }
330
+ key = adjustKey(key, navigationParts, keyForRelatedFacetKeys);
331
+ const targetAnnotation = determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT);
332
+ if (targetAnnotation) {
333
+ const separator = oDataVersion === common_1.FioriElementsVersion.v2 ? '::' : '#';
334
+ key = getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys).replace('#', separator);
335
+ }
336
+ else {
337
+ stopProcessing = true;
338
+ return { key, entityType, stopProcessing };
339
+ }
340
+ if (navigation) {
341
+ const navSeparator = oDataVersion === common_1.FioriElementsVersion.v2 ? '::' : '/';
342
+ navigationParts.pop();
343
+ const navigationIDs = [...navigationParts].join(navSeparator);
344
+ key = `${navigationIDs}${navSeparator}${key}`;
345
+ }
346
+ return { key, entityType, stopProcessing };
311
347
  }
312
348
  /**
313
349
  * Resolve page section(get key and label->description).
@@ -319,9 +355,8 @@ function adjustKey(key, navigationParts, keyForRelatedFacetKeys) {
319
355
  * @returns {FacetSection} - object comprising the relevant facet information
320
356
  */
321
357
  function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, logger, oDataVersion = common_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
322
- var _a;
323
358
  //Take facet ID as fallback
324
- const facetName = facetDefinition.fullyQualifiedName.substr(facetDefinition.fullyQualifiedName.lastIndexOf('@'));
359
+ const facetName = facetDefinition.fullyQualifiedName.substring(facetDefinition.fullyQualifiedName.lastIndexOf('@'));
325
360
  let key = facetDefinition.ID ? facetDefinition.ID.toString() : facetName;
326
361
  let entityType = sourceEntityType; //default
327
362
  //If reference facet: overwrite with target annotation if present
@@ -334,24 +369,12 @@ function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, log
334
369
  });
335
370
  return;
336
371
  }
337
- const navigationParts = propertyValue.split('/');
338
- const navigation = navigationParts.length > 1 ? navigationParts[0] : '';
339
- if (navigation) {
340
- entityType = (_a = sourceEntityType.resolvePath(navigation)) === null || _a === void 0 ? void 0 : _a.targetType;
341
- }
342
- adjustKey(key, navigationParts, keyForRelatedFacetKeys);
343
- const targetAnnotation = determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT);
344
- if (targetAnnotation) {
345
- const separator = oDataVersion === common_1.FioriElementsVersion.v2 ? '::' : '#';
346
- key = getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys).replace('#', separator);
347
- }
348
- else {
349
- return undefined;
350
- }
351
- if (navigation) {
352
- const navSeparator = oDataVersion === common_1.FioriElementsVersion.v2 ? '::' : '/';
353
- key = `${navigation}${navSeparator}${key}`;
372
+ const { key: newKey, entityType: newEntityType, stopProcessing } = getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion, keyForRelatedFacetKeys);
373
+ if (stopProcessing) {
374
+ return;
354
375
  }
376
+ key = newKey;
377
+ entityType = newEntityType;
355
378
  }
356
379
  key = key.replace(/\//gi, '::');
357
380
  return key
@@ -370,6 +393,9 @@ exports.getSectionFacet = getSectionFacet;
370
393
  * @returns returns section of the manifest based on path, generates an empty object in case it does not exists
371
394
  */
372
395
  exports.getManifestSectionByPathV4 = (manifest, path, targetAnnotation, targetAnnotationEncoded, importScenario = false) => {
396
+ if (!path) {
397
+ return undefined;
398
+ }
373
399
  let manifestSection = manifest;
374
400
  const pathElements = path.split('/');
375
401
  for (let index = 0; index < pathElements.length; index++) {
@@ -474,6 +500,9 @@ function getUIAnnotationTerm(path, alias, entityType) {
474
500
  else if (path.includes("com.sap.vocabularies.UI.v1.DataPoint" /* DataPoint */) || path.includes(alias + '.DataPoint')) {
475
501
  return "com.sap.vocabularies.UI.v1.DataPoint" /* DataPoint */;
476
502
  }
503
+ else if (path.includes("com.sap.vocabularies.UI.v1.PresentationVariant" /* PresentationVariant */) || path.includes(alias + '.PresentationVariant')) {
504
+ return "com.sap.vocabularies.UI.v1.PresentationVariant" /* PresentationVariant */;
505
+ }
477
506
  else {
478
507
  return undefined;
479
508
  }
@@ -516,15 +545,15 @@ function getAnnotationTerm(path, alias, entityType) {
516
545
  * @param {ExtensionLogger} logger - Logger class for logging messages
517
546
  */
518
547
  function evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT, oDataVersion = common_1.FioriElementsVersion.v2, logger) {
519
- var _a, _b, _c, _d, _e, _f, _g;
520
- const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
548
+ var _a, _b, _c, _d, _e, _f, _g, _h;
549
+ const alias = findAlias(types_2.UIVOCABULARY, oDataServiceAVT);
521
550
  let path = section ? section.key : '';
522
551
  const targetEntityType = section.entityType;
523
552
  const annotationTerm = getAnnotationTerm(path, alias, entityType);
524
553
  let annotation, targetAnnotation;
525
554
  switch (annotationTerm) {
526
555
  case "com.sap.vocabularies.UI.v1.Chart" /* Chart */: {
527
- facets[path] = { base: types_1.FacetBase.Chart };
556
+ facets[path] = { base: types_2.FacetBase.Chart };
528
557
  facets[path].target = (_a = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _a === void 0 ? void 0 : _a.$target;
529
558
  facets[path].entityType = targetEntityType;
530
559
  break;
@@ -532,7 +561,7 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
532
561
  case "com.sap.vocabularies.UI.v1.Identification" /* Identification */: {
533
562
  annotation = path.split('.')[path.split('.').length - 1];
534
563
  targetAnnotation = targetEntityType.annotations[alias][annotation];
535
- facets[path] = { base: types_1.FacetBase.Identification };
564
+ facets[path] = { base: types_2.FacetBase.Identification };
536
565
  facets[path].entityType = targetEntityType;
537
566
  facets[path].target = targetAnnotation;
538
567
  break;
@@ -543,42 +572,48 @@ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType,
543
572
  pathParts[pathParts.length - 1] = `@${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`;
544
573
  path = pathParts.join('::');
545
574
  }
546
- facets[path] = { base: types_1.FacetBase.LineItem };
575
+ facets[path] = { base: types_2.FacetBase.LineItem };
547
576
  facets[path].target = (_b = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _b === void 0 ? void 0 : _b.$target;
548
577
  facets[path].entityType = targetEntityType;
549
578
  break;
550
579
  }
551
580
  case "com.sap.vocabularies.UI.v1.FieldGroup" /* FieldGroup */: {
552
- facets[path] = { base: types_1.FacetBase.Form };
581
+ facets[path] = { base: types_2.FacetBase.Form };
553
582
  facets[path].target = (_c = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _c === void 0 ? void 0 : _c.$target;
554
583
  facets[path].entityType = targetEntityType;
555
584
  break;
556
585
  }
557
586
  case "com.sap.vocabularies.UI.v1.DataPoint" /* DataPoint */: {
558
- facets[path] = { base: types_1.FacetBase.DataPoint };
587
+ facets[path] = { base: types_2.FacetBase.DataPoint };
559
588
  facets[path].target = (_d = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _d === void 0 ? void 0 : _d.$target;
560
589
  facets[path].entityType = targetEntityType;
561
590
  facets[path].Label = (_e = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _e === void 0 ? void 0 : _e.$target['Title'];
562
591
  break;
563
592
  }
564
- case "com.sap.vocabularies.Communication.v1.Contact" /* Contact */: {
565
- facets[path] = { base: types_1.FacetBase.Contact };
593
+ case "com.sap.vocabularies.UI.v1.PresentationVariant" /* PresentationVariant */: {
594
+ facets[path] = { base: types_2.FacetBase.PresentationVariant };
566
595
  facets[path].target = (_f = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _f === void 0 ? void 0 : _f.$target;
567
596
  facets[path].entityType = targetEntityType;
568
597
  break;
569
598
  }
570
- case "com.sap.vocabularies.Communication.v1.Address" /* Address */: {
571
- facets[path] = { base: types_1.FacetBase.Address };
599
+ case "com.sap.vocabularies.Communication.v1.Contact" /* Contact */: {
600
+ facets[path] = { base: types_2.FacetBase.Contact };
572
601
  facets[path].target = (_g = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _g === void 0 ? void 0 : _g.$target;
573
602
  facets[path].entityType = targetEntityType;
574
603
  break;
575
604
  }
605
+ case "com.sap.vocabularies.Communication.v1.Address" /* Address */: {
606
+ facets[path] = { base: types_2.FacetBase.Address };
607
+ facets[path].target = (_h = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _h === void 0 ? void 0 : _h.$target;
608
+ facets[path].entityType = targetEntityType;
609
+ break;
610
+ }
576
611
  default: {
577
- facets[path] = { base: types_1.FacetBase.Unknown };
612
+ facets[path] = { base: types_2.FacetBase.Unknown };
578
613
  }
579
614
  }
580
615
  if (facets[path]) {
581
- facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies', types_1.VOCWITHSLASH)}`;
616
+ facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies', types_2.VOCWITHSLASH)}`;
582
617
  if (annotationRecord.Label) {
583
618
  facets[path].Label = annotationRecord.Label;
584
619
  }
@@ -619,7 +654,7 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
619
654
  case "com.sap.vocabularies.UI.v1.CollectionFacet" /* CollectionFacet */: {
620
655
  const annotationPath = `/${entityType.fullyQualifiedName}/${annotationRecord.fullyQualifiedName.split(entityType.fullyQualifiedName)[1]}`;
621
656
  const facet = (facets[section.key] = {
622
- base: types_1.FacetBase.CollectionFacet,
657
+ base: types_2.FacetBase.CollectionFacet,
623
658
  facets: {},
624
659
  ID: section.ID,
625
660
  annotationPath: annotationPath,
@@ -645,7 +680,7 @@ function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = c
645
680
  if (!entityType || !entityType.annotations) {
646
681
  return;
647
682
  }
648
- const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
683
+ const alias = findAlias(types_2.UIVOCABULARY, oDataServiceAVT);
649
684
  const facetAnnotation = alias && entityType.annotations[alias] && entityType.annotations[alias].HeaderFacets;
650
685
  if (facetAnnotation) {
651
686
  const lastDot = entityType.fullyQualifiedName.lastIndexOf('.');
@@ -670,7 +705,7 @@ function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = common_
670
705
  if (!entityType || !entityType.annotations) {
671
706
  return;
672
707
  }
673
- const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
708
+ const alias = findAlias(types_2.UIVOCABULARY, oDataServiceAVT);
674
709
  const facetAnnotation = alias && entityType.annotations[alias] && entityType.annotations[alias].Facets;
675
710
  if (facetAnnotation) {
676
711
  const lastDot = entityType.fullyQualifiedName.lastIndexOf('.');
@@ -711,7 +746,7 @@ function determineV2Template(manifest, logger) {
711
746
  severity: "error" /* Error */,
712
747
  message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
713
748
  location: {
714
- path: types_1.MANIFESTPATH,
749
+ path: types_2.MANIFESTPATH,
715
750
  range: [v4_1.ManifestSection.generic]
716
751
  }
717
752
  });
@@ -735,7 +770,7 @@ function determineV2Template(manifest, logger) {
735
770
  severity: "error" /* Error */,
736
771
  message: i18next_1.default.t('NOTEMPLATE', { section: v4_1.ManifestSection.generic }),
737
772
  location: {
738
- path: types_1.MANIFESTPATH,
773
+ path: types_2.MANIFESTPATH,
739
774
  range: [v4_1.ManifestSection.generic]
740
775
  }
741
776
  });
@@ -760,7 +795,7 @@ function determineV4Template(manifest, logger) {
760
795
  severity: "error" /* Error */,
761
796
  message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
762
797
  location: {
763
- path: types_1.MANIFESTPATH,
798
+ path: types_2.MANIFESTPATH,
764
799
  range: [v4_1.ManifestSection.ui5, 'routing']
765
800
  }
766
801
  });
@@ -775,7 +810,7 @@ function determineV4Template(manifest, logger) {
775
810
  }
776
811
  else if (pageType === common_1.PageTypeV4.ListReport) {
777
812
  const viewPath = (_d = (_c = (_b = (_a = v4Page.options) === null || _a === void 0 ? void 0 : _a.settings) === null || _b === void 0 ? void 0 : _b.views) === null || _c === void 0 ? void 0 : _c.paths) === null || _d === void 0 ? void 0 : _d[0];
778
- if (viewPath && (viewPath[types_1.ALPViewType.Primary] || viewPath[types_1.ALPViewType.Secondary])) {
813
+ if (viewPath && (viewPath[types_2.ALPViewType.Primary] || viewPath[types_2.ALPViewType.Secondary])) {
779
814
  templateType = TemplateType.AnalyticalListPageV4;
780
815
  }
781
816
  else {
@@ -793,7 +828,7 @@ function determineV4Template(manifest, logger) {
793
828
  severity: "error" /* Error */,
794
829
  message: i18next_1.default.t('NOTEMPLATE', { section: v4_1.ManifestSection.ui5 }),
795
830
  location: {
796
- path: types_1.MANIFESTPATH,
831
+ path: types_2.MANIFESTPATH,
797
832
  range: [v4_1.ManifestSection.ui5, 'routing', 'targets']
798
833
  }
799
834
  });
@@ -825,7 +860,7 @@ function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
825
860
  severity: "error" /* Error */,
826
861
  message: i18next_1.default.t('NOFE'),
827
862
  location: {
828
- path: types_1.MANIFESTPATH
863
+ path: types_2.MANIFESTPATH
829
864
  }
830
865
  });
831
866
  }
@@ -841,20 +876,20 @@ exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
841
876
  */
842
877
  function addSectionTitleAndDescription(facet, section, facetKey) {
843
878
  if (facet === null || facet === void 0 ? void 0 : facet.ID) {
844
- section['title'] = types_1.FacetTitlePrefix + facet.ID;
879
+ section.title = types_2.FacetTitlePrefix + facet.ID;
845
880
  }
846
881
  else {
847
- section['title'] = facetKey.replace(/@com.sap/g, 'com.sap');
882
+ section.title = facetKey.replace(/@com.sap/g, 'com.sap');
848
883
  }
849
884
  // Description
850
885
  if (facet === null || facet === void 0 ? void 0 : facet.Label) {
851
- section['description'] = facet.Label;
886
+ section.description = facet.Label;
852
887
  }
853
888
  else if (facet === null || facet === void 0 ? void 0 : facet.ID) {
854
- section['description'] = facet.ID;
889
+ section.description = facet.ID;
855
890
  }
856
891
  else {
857
- section['description'] = facetKey.substr(facetKey.lastIndexOf('.') + 1);
892
+ section.description = facetKey.substr(facetKey.lastIndexOf('.') + 1);
858
893
  }
859
894
  }
860
895
  exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
@@ -868,10 +903,10 @@ function addTargetTitleAndSectionDescription(facet, section, facetKey) {
868
903
  var _a, _b, _c, _d;
869
904
  addSectionTitleAndDescription(facet, section, facetKey);
870
905
  if ((_a = facet === null || facet === void 0 ? void 0 : facet.target) === null || _a === void 0 ? void 0 : _a['Title']) {
871
- section['description'] = (_b = facet === null || facet === void 0 ? void 0 : facet.target) === null || _b === void 0 ? void 0 : _b['Title'];
906
+ section.description = (_b = facet === null || facet === void 0 ? void 0 : facet.target) === null || _b === void 0 ? void 0 : _b['Title'];
872
907
  }
873
908
  else if ((_c = facet === null || facet === void 0 ? void 0 : facet.target) === null || _c === void 0 ? void 0 : _c['Description']) {
874
- section['description'] = (_d = facet === null || facet === void 0 ? void 0 : facet.target) === null || _d === void 0 ? void 0 : _d['Description'];
909
+ section.description = (_d = facet === null || facet === void 0 ? void 0 : facet.target) === null || _d === void 0 ? void 0 : _d['Description'];
875
910
  }
876
911
  }
877
912
  exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
@@ -880,21 +915,28 @@ exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescriptio
880
915
  * @param facet Facet configuration, to be analyzed
881
916
  * @returns the new section object
882
917
  */
883
- function createSectionWithoutProperties(facet, facetKey) {
918
+ function createDefaultSection(appSchema, facet, facetKey) {
884
919
  if (!facet) {
885
920
  return undefined;
886
921
  }
887
- const section = {
888
- type: 'object',
889
- properties: {},
890
- additionalProperties: false,
891
- annotationPath: facet.annotationPath,
892
- isViewNode: true
893
- };
922
+ let section;
923
+ if (appSchema.definitions.ObjectPageSection) {
924
+ //base type in V2, with properties
925
+ section = JSON.parse(JSON.stringify(appSchema.definitions.ObjectPageSection));
926
+ }
927
+ else {
928
+ section = {
929
+ type: 'object',
930
+ properties: {},
931
+ additionalProperties: false
932
+ };
933
+ section[types_1.SchemaTag.isViewNode] = true;
934
+ }
935
+ section[types_1.SchemaTag.annotationPath] = facet.annotationPath;
894
936
  addSectionTitleAndDescription(facet, section, facetKey);
895
937
  return section;
896
938
  }
897
- exports.createSectionWithoutProperties = createSectionWithoutProperties;
939
+ exports.createDefaultSection = createDefaultSection;
898
940
  /**
899
941
  * Retrieve page section data(so far id/key and label/description).
900
942
  * @param {EntityType} entityType The actual entityType
@@ -905,7 +947,7 @@ exports.createSectionWithoutProperties = createSectionWithoutProperties;
905
947
  * @returns {FacetSection[]} - Array of facets or sections
906
948
  */
907
949
  function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion = common_1.FioriElementsVersion.v2, checkUnresolvableFacets = false) {
908
- const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
950
+ const alias = findAlias(types_2.UIVOCABULARY, oDataServiceAVT);
909
951
  let sections = [];
910
952
  if (entityType) {
911
953
  const facetAnnotation = alias && entityType.annotations && entityType.annotations[alias] && entityType.annotations[alias].Facets;
@@ -933,6 +975,9 @@ exports.getObjectPageFacetSection = getObjectPageFacetSection;
933
975
  * @param targetAnnotationEncoded - encoded version of the target annotation, as represented in the manifest
934
976
  */
935
977
  exports.deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
978
+ if (!path) {
979
+ return;
980
+ }
936
981
  let manifestSection = manifest;
937
982
  const pathArray = path.split('/');
938
983
  pathArray.forEach(function (element) {
@@ -981,7 +1026,7 @@ exports.getSchemaFilePath = (schemaType, entitySet) => {
981
1026
  // File name
982
1027
  schemaFile.filename = `App`;
983
1028
  // Full path
984
- schemaFile.path = `./${types_1.DirName.Schemas}/${schemaFile.filename}`;
1029
+ schemaFile.path = `./${types_2.DirName.Schemas}/${schemaFile.filename}`;
985
1030
  break;
986
1031
  }
987
1032
  // List report and object page
@@ -990,7 +1035,7 @@ exports.getSchemaFilePath = (schemaType, entitySet) => {
990
1035
  // File name
991
1036
  schemaFile.filename = entitySet ? `${schemaType}_${entitySet}` : getGenericSchemaFileName(schemaType);
992
1037
  // Full path
993
- schemaFile.path = `../${types_1.DirName.Schemas}/${schemaFile.filename}`;
1038
+ schemaFile.path = `../${types_2.DirName.Schemas}/${schemaFile.filename}`;
994
1039
  break;
995
1040
  }
996
1041
  // Other page configs
@@ -998,7 +1043,7 @@ exports.getSchemaFilePath = (schemaType, entitySet) => {
998
1043
  // File name
999
1044
  schemaFile.filename = getGenericSchemaFileName(schemaType);
1000
1045
  // Full path
1001
- schemaFile.path = `../${types_1.DirName.Schemas}/${schemaFile.filename}`;
1046
+ schemaFile.path = `../${types_2.DirName.Schemas}/${schemaFile.filename}`;
1002
1047
  break;
1003
1048
  }
1004
1049
  }
@@ -1010,11 +1055,10 @@ exports.getSchemaFilePath = (schemaType, entitySet) => {
1010
1055
  * @param appVersion - Fiori Elements version - V2 or V4.
1011
1056
  * @param pageType - Page type.
1012
1057
  * @param entitySet - Entity Set.
1013
- * @param navigationProperty - Navigation property (optional).
1014
1058
  * @param viewId - Custom page's viewId (optional).
1015
1059
  * @returns {string} Generated page id
1016
1060
  */
1017
- function generatePageId(pageType, entitySet, navigationProperty, viewId) {
1061
+ function generatePageId(pageType, entitySet, viewId) {
1018
1062
  if (pageType === common_1.PageType.CustomPage) {
1019
1063
  const names = viewId && viewId.split('.');
1020
1064
  return names && names[names.length - 1] + 'Page';
@@ -1027,6 +1071,18 @@ function generatePageId(pageType, entitySet, navigationProperty, viewId) {
1027
1071
  return parts.join('_');
1028
1072
  }
1029
1073
  exports.generatePageId = generatePageId;
1074
+ function fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray) {
1075
+ const $ref = element.$ref;
1076
+ if ($ref) {
1077
+ const definitionKey = $ref.split(exports.DEFINITION_LINK_PREFIX)[1];
1078
+ if (appSchema.definitions[definitionKey]) {
1079
+ const controlProperty = appSchema.definitions[definitionKey]['controlProperty'];
1080
+ if ($ref.includes(currentConfigObject[controlProperty])) {
1081
+ definitionArray.push(definitionKey);
1082
+ }
1083
+ }
1084
+ }
1085
+ }
1030
1086
  /**
1031
1087
  * Fills an array of next definitions from given references in the JSON schema
1032
1088
  * @param propertyDefinition - Definition of the current property in schema
@@ -1037,21 +1093,13 @@ exports.generatePageId = generatePageId;
1037
1093
  */
1038
1094
  function fillArrayFromPropertyDefinition(propertyDefinition, currentConfigObject, appSchema) {
1039
1095
  const definitionArray = [];
1040
- if (propertyDefinition['$ref']) {
1041
- definitionArray.push(propertyDefinition['$ref'].split(exports.DEFINITION_LINK_PREFIX)[1]);
1096
+ if (propertyDefinition.$ref) {
1097
+ definitionArray.push(propertyDefinition.$ref.split(exports.DEFINITION_LINK_PREFIX)[1]);
1042
1098
  }
1043
- else if (propertyDefinition['anyOf']) {
1099
+ else if (propertyDefinition.anyOf) {
1044
1100
  if (currentConfigObject) {
1045
- propertyDefinition['anyOf'].forEach((element) => {
1046
- if (element.$ref) {
1047
- const definitionKey = element.$ref.split(exports.DEFINITION_LINK_PREFIX)[1];
1048
- if (appSchema['definitions'][definitionKey]) {
1049
- const controlProperty = appSchema['definitions'][definitionKey]['controlProperty'];
1050
- if (element.$ref.includes(currentConfigObject[controlProperty])) {
1051
- definitionArray.push(definitionKey);
1052
- }
1053
- }
1054
- }
1101
+ propertyDefinition.anyOf.forEach((element) => {
1102
+ fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray);
1055
1103
  });
1056
1104
  }
1057
1105
  if (definitionArray.length === 0) {
@@ -1135,10 +1183,6 @@ function getNextTargetDefinition(appSchema, title, currentConfigObject, property
1135
1183
  return nextDefinition;
1136
1184
  }
1137
1185
  exports.getNextTargetDefinition = getNextTargetDefinition;
1138
- function prepareRef(refInput) {
1139
- return refInput.replace('#', '::').replace(/\//g, ':2f');
1140
- }
1141
- exports.prepareRef = prepareRef;
1142
1186
  /**
1143
1187
  * Custom array merge function called by deepmerge's merge function
1144
1188
  *