@sap/ux-specification 1.90.5 → 1.90.9

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 (228) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/dist/index-min.js +1 -1
  3. package/dist/schemas/v2/AnalyticalListPageConfig.json +460 -53
  4. package/dist/schemas/v2/ListReportConfig.json +358 -104
  5. package/dist/schemas/v2/ObjectPageConfig.json +293 -92
  6. package/dist/schemas/v2/OverviewPageConfig.json +126 -46
  7. package/dist/schemas/v4/AnalyticalListPageConfig.json +110 -36
  8. package/dist/schemas/v4/ApplicationV4.json +0 -6
  9. package/dist/schemas/v4/ListReportConfig.json +110 -36
  10. package/dist/schemas/v4/ObjectPageConfig.json +349 -68
  11. package/dist/scripts/extractDocu.d.ts +1 -0
  12. package/dist/scripts/extractDocu.js +311 -0
  13. package/dist/scripts/extractDocu.js.map +1 -0
  14. package/dist/scripts/spec.d.ts +1 -0
  15. package/dist/scripts/spec.js +114 -0
  16. package/dist/scripts/spec.js.map +1 -0
  17. package/dist/scripts/to-json-schema.d.ts +10 -0
  18. package/dist/scripts/to-json-schema.js +121 -0
  19. package/dist/scripts/to-json-schema.js.map +1 -0
  20. package/dist/specification/v2/index-min.js +1 -1
  21. package/dist/specification/v4/index-min.js +1 -1
  22. package/dist/src/api.js +3 -5
  23. package/dist/src/api.js.map +1 -1
  24. package/dist/src/apiTypes.d.ts +2 -1
  25. package/dist/src/extensionLogger.js +6 -0
  26. package/dist/src/extensionLogger.js.map +1 -1
  27. package/dist/src/specification/common/types.d.ts +4 -0
  28. package/dist/src/specification/common/types.js +5 -0
  29. package/dist/src/specification/common/types.js.map +1 -1
  30. package/dist/src/specification/common/webapp/manifest/Manifest.d.ts +7 -0
  31. package/dist/src/specification/common/webapp/manifest/Manifest.js +8 -0
  32. package/dist/src/specification/common/webapp/manifest/Manifest.js.map +1 -1
  33. package/dist/src/specification/v2/controls/Card.d.ts +8 -2
  34. package/dist/src/specification/v2/controls/Card.js +2 -0
  35. package/dist/src/specification/v2/controls/Card.js.map +1 -1
  36. package/dist/src/specification/v2/controls/FilterBar.d.ts +20 -0
  37. package/dist/src/specification/v2/controls/FilterBar.js +51 -0
  38. package/dist/src/specification/v2/controls/FilterBar.js.map +1 -1
  39. package/dist/src/specification/v2/controls/ObjectPageTable.d.ts +12 -3
  40. package/dist/src/specification/v2/controls/ObjectPageTable.js.map +1 -1
  41. package/dist/src/specification/v2/controls/ObjectPageToolBar.d.ts +19 -0
  42. package/dist/src/specification/v2/controls/ObjectPageToolBar.js +3 -0
  43. package/dist/src/specification/v2/controls/ObjectPageToolBar.js.map +1 -0
  44. package/dist/src/specification/v2/controls/Table.d.ts +53 -5
  45. package/dist/src/specification/v2/controls/Table.js.map +1 -1
  46. package/dist/src/specification/v2/controls/ToolBar.d.ts +19 -0
  47. package/dist/src/specification/v2/controls/ToolBar.js +3 -0
  48. package/dist/src/specification/v2/controls/ToolBar.js.map +1 -0
  49. package/dist/src/specification/v2/controls/index.d.ts +2 -0
  50. package/dist/src/specification/v2/controls/index.js.map +1 -1
  51. package/dist/src/specification/v2/pages/AnalyticalListPageConfig.d.ts +2 -2
  52. package/dist/src/specification/v2/webapp/manifest/sapUi5.d.ts +2 -1
  53. package/dist/src/specification/v2/webapp/manifest/sapUi5.js +1 -0
  54. package/dist/src/specification/v2/webapp/manifest/sapUi5.js.map +1 -1
  55. package/dist/src/specification/v4/controls/FilterBar.d.ts +1 -1
  56. package/dist/src/specification/v4/controls/ObjectPageHeader.d.ts +2 -0
  57. package/dist/src/specification/v4/controls/ObjectPageHeaderSection.d.ts +58 -0
  58. package/dist/src/specification/v4/controls/ObjectPageHeaderSection.js +7 -0
  59. package/dist/src/specification/v4/controls/ObjectPageHeaderSection.js.map +1 -0
  60. package/dist/src/specification/v4/controls/ObjectPageSection.d.ts +27 -3
  61. package/dist/src/specification/v4/controls/ObjectPageSection.js.map +1 -1
  62. package/dist/src/specification/v4/controls/ObjectPageTable.d.ts +71 -2
  63. package/dist/src/specification/v4/controls/ObjectPageToolBar.d.ts +25 -0
  64. package/dist/src/specification/v4/controls/ObjectPageToolBar.js +3 -0
  65. package/dist/src/specification/v4/controls/ObjectPageToolBar.js.map +1 -0
  66. package/dist/src/specification/v4/controls/Table.d.ts +7 -1
  67. package/dist/src/specification/v4/controls/Table.js +1 -1
  68. package/dist/src/specification/v4/controls/Table.js.map +1 -1
  69. package/dist/src/specification/v4/controls/ToolBar.d.ts +28 -0
  70. package/dist/src/specification/v4/controls/ToolBar.js +8 -0
  71. package/dist/src/specification/v4/controls/ToolBar.js.map +1 -0
  72. package/dist/src/specification/v4/controls/index.d.ts +3 -0
  73. package/dist/src/specification/v4/controls/index.js +2 -0
  74. package/dist/src/specification/v4/controls/index.js.map +1 -1
  75. package/dist/src/specification/v4/page.d.ts +0 -2
  76. package/dist/src/specification/v4/webapp/manifest/ManifestSettings.d.ts +34 -2
  77. package/dist/src/specification/v4/webapp/manifest/ManifestSettings.js.map +1 -1
  78. package/dist/src/specification/v4/webapp/manifest/sapUi5.d.ts +6 -1
  79. package/dist/src/specification/v4/webapp/manifest/sapUi5.js.map +1 -1
  80. package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.d.ts +1 -0
  81. package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.js +1 -0
  82. package/dist/src/specification/v4/webapp/manifest/sapUiPageV4.js.map +1 -1
  83. package/dist/src/sync/common/appProvider.d.ts +3 -1
  84. package/dist/src/sync/common/appProvider.js +2 -1
  85. package/dist/src/sync/common/appProvider.js.map +1 -1
  86. package/dist/src/sync/common/decoration/control.js +7 -4
  87. package/dist/src/sync/common/decoration/control.js.map +1 -1
  88. package/dist/src/sync/common/decoration/factory.d.ts +1 -1
  89. package/dist/src/sync/common/decoration/factory.js.map +1 -1
  90. package/dist/src/sync/common/flexUtils.d.ts +3 -2
  91. package/dist/src/sync/common/flexUtils.js +4 -1
  92. package/dist/src/sync/common/flexUtils.js.map +1 -1
  93. package/dist/src/sync/common/i18n.json +2 -1
  94. package/dist/src/sync/common/importProject.js +6 -6
  95. package/dist/src/sync/common/importProject.js.map +1 -1
  96. package/dist/src/sync/common/types.d.ts +22 -5
  97. package/dist/src/sync/common/types.js +20 -4
  98. package/dist/src/sync/common/types.js.map +1 -1
  99. package/dist/src/sync/common/utils.d.ts +72 -20
  100. package/dist/src/sync/common/utils.js +233 -97
  101. package/dist/src/sync/common/utils.js.map +1 -1
  102. package/dist/src/sync/v2/application.js +7 -6
  103. package/dist/src/sync/v2/application.js.map +1 -1
  104. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts +1 -0
  105. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js +5 -5
  106. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -1
  107. package/dist/src/sync/v2/export/controls/Card.d.ts +2 -1
  108. package/dist/src/sync/v2/export/controls/Card.js +7 -0
  109. package/dist/src/sync/v2/export/controls/Card.js.map +1 -1
  110. package/dist/src/sync/v2/export/controls/FilterBar.d.ts +3 -0
  111. package/dist/src/sync/v2/export/controls/FilterBar.js +36 -0
  112. package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -1
  113. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js +2 -1
  114. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js.map +1 -1
  115. package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +1 -0
  116. package/dist/src/sync/v2/export/controls/ObjectPageTable.js +12 -0
  117. package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -1
  118. package/dist/src/sync/v2/export/controls/Table.d.ts +11 -2
  119. package/dist/src/sync/v2/export/controls/Table.js +38 -5
  120. package/dist/src/sync/v2/export/controls/Table.js.map +1 -1
  121. package/dist/src/sync/v2/export/export.d.ts +2 -2
  122. package/dist/src/sync/v2/export/export.js +15 -13
  123. package/dist/src/sync/v2/export/export.js.map +1 -1
  124. package/dist/src/sync/v2/export/pages/AnalyticalListPage.js +1 -1
  125. package/dist/src/sync/v2/generate/analyticalListReport.d.ts +3 -1
  126. package/dist/src/sync/v2/generate/analyticalListReport.js +59 -16
  127. package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -1
  128. package/dist/src/sync/v2/generate/generate.d.ts +5 -2
  129. package/dist/src/sync/v2/generate/generate.js +7 -4
  130. package/dist/src/sync/v2/generate/generate.js.map +1 -1
  131. package/dist/src/sync/v2/generate/listReport.d.ts +5 -2
  132. package/dist/src/sync/v2/generate/listReport.js +63 -30
  133. package/dist/src/sync/v2/generate/listReport.js.map +1 -1
  134. package/dist/src/sync/v2/generate/objectPage.js +75 -56
  135. package/dist/src/sync/v2/generate/objectPage.js.map +1 -1
  136. package/dist/src/sync/v2/generate/utils.d.ts +19 -2
  137. package/dist/src/sync/v2/generate/utils.js +134 -57
  138. package/dist/src/sync/v2/generate/utils.js.map +1 -1
  139. package/dist/src/sync/v2/import/app/appProvider.d.ts +3 -2
  140. package/dist/src/sync/v2/import/app/appProvider.js +10 -9
  141. package/dist/src/sync/v2/import/app/appProvider.js.map +1 -1
  142. package/dist/src/sync/v2/import/app/ovpProvider.js +6 -6
  143. package/dist/src/sync/v2/import/app/ovpProvider.js.map +1 -1
  144. package/dist/src/sync/v2/import/common/index.d.ts +1 -0
  145. package/dist/src/sync/v2/import/common/index.js +11 -7
  146. package/dist/src/sync/v2/import/common/index.js.map +1 -1
  147. package/dist/src/sync/v2/import/pages/analyticalListPage.d.ts +1 -1
  148. package/dist/src/sync/v2/import/pages/analyticalListPage.js +15 -14
  149. package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -1
  150. package/dist/src/sync/v2/import/pages/listReport.d.ts +1 -1
  151. package/dist/src/sync/v2/import/pages/listReport.js +15 -15
  152. package/dist/src/sync/v2/import/pages/listReport.js.map +1 -1
  153. package/dist/src/sync/v2/import/pages/objectPage.js +12 -11
  154. package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -1
  155. package/dist/src/sync/v2/import/pages/overviewPage.js +5 -3
  156. package/dist/src/sync/v2/import/pages/overviewPage.js.map +1 -1
  157. package/dist/src/sync/v2/import/utils.d.ts +0 -12
  158. package/dist/src/sync/v2/import/utils.js +0 -35
  159. package/dist/src/sync/v2/import/utils.js.map +1 -1
  160. package/dist/src/sync/v4/application.d.ts +3 -0
  161. package/dist/src/sync/v4/application.js +9 -0
  162. package/dist/src/sync/v4/application.js.map +1 -1
  163. package/dist/src/sync/v4/export/controls/ObjectPageHeader.d.ts +2 -1
  164. package/dist/src/sync/v4/export/controls/ObjectPageHeader.js.map +1 -1
  165. package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.d.ts +21 -0
  166. package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js +65 -0
  167. package/dist/src/sync/v4/export/controls/ObjectPageHeaderSection.js.map +1 -0
  168. package/dist/src/sync/v4/export/controls/ObjectPageTable.d.ts +18 -4
  169. package/dist/src/sync/v4/export/controls/ObjectPageTable.js +96 -0
  170. package/dist/src/sync/v4/export/controls/ObjectPageTable.js.map +1 -1
  171. package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.d.ts +6 -2
  172. package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js +17 -0
  173. package/dist/src/sync/v4/export/controls/ObjectPageTableColumn.js.map +1 -1
  174. package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.d.ts +4 -0
  175. package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.js +21 -0
  176. package/dist/src/sync/v4/export/controls/ObjectPageToolBarAction.js.map +1 -0
  177. package/dist/src/sync/v4/export/controls/Table.d.ts +25 -1
  178. package/dist/src/sync/v4/export/controls/Table.js +169 -0
  179. package/dist/src/sync/v4/export/controls/Table.js.map +1 -1
  180. package/dist/src/sync/v4/export/controls/TableColumn.d.ts +5 -1
  181. package/dist/src/sync/v4/export/controls/TableColumn.js +17 -0
  182. package/dist/src/sync/v4/export/controls/TableColumn.js.map +1 -1
  183. package/dist/src/sync/v4/export/controls/ToolBar.d.ts +4 -0
  184. package/dist/src/sync/v4/export/controls/ToolBar.js +6 -0
  185. package/dist/src/sync/v4/export/controls/ToolBar.js.map +1 -0
  186. package/dist/src/sync/v4/export/controls/ToolBarAction.d.ts +4 -0
  187. package/dist/src/sync/v4/export/controls/ToolBarAction.js +21 -0
  188. package/dist/src/sync/v4/export/controls/ToolBarAction.js.map +1 -0
  189. package/dist/src/sync/v4/export/controls/index.d.ts +4 -0
  190. package/dist/src/sync/v4/export/controls/index.js +4 -0
  191. package/dist/src/sync/v4/export/controls/index.js.map +1 -1
  192. package/dist/src/sync/v4/export/export.d.ts +2 -1
  193. package/dist/src/sync/v4/export/export.js +60 -50
  194. package/dist/src/sync/v4/export/export.js.map +1 -1
  195. package/dist/src/sync/v4/export/factory.js +3 -1
  196. package/dist/src/sync/v4/export/factory.js.map +1 -1
  197. package/dist/src/sync/v4/export/manifest.js +28 -7
  198. package/dist/src/sync/v4/export/manifest.js.map +1 -1
  199. package/dist/src/sync/v4/export/pages/AnalyticalListPage.js +2 -2
  200. package/dist/src/sync/v4/export/pages/AnalyticalListPage.js.map +1 -1
  201. package/dist/src/sync/v4/export/pages/ListReport.js +1 -4
  202. package/dist/src/sync/v4/export/pages/ListReport.js.map +1 -1
  203. package/dist/src/sync/v4/generate/listReport.d.ts +1 -0
  204. package/dist/src/sync/v4/generate/listReport.js +7 -2
  205. package/dist/src/sync/v4/generate/listReport.js.map +1 -1
  206. package/dist/src/sync/v4/generate/objectPage.js +167 -69
  207. package/dist/src/sync/v4/generate/objectPage.js.map +1 -1
  208. package/dist/src/sync/v4/import/app/appProvider.d.ts +2 -1
  209. package/dist/src/sync/v4/import/app/appProvider.js +25 -11
  210. package/dist/src/sync/v4/import/app/appProvider.js.map +1 -1
  211. package/dist/src/sync/v4/import/fragment.js +4 -3
  212. package/dist/src/sync/v4/import/fragment.js.map +1 -1
  213. package/dist/src/sync/v4/import/pages/analyticalListPage.js +7 -6
  214. package/dist/src/sync/v4/import/pages/analyticalListPage.js.map +1 -1
  215. package/dist/src/sync/v4/import/pages/listReport.d.ts +2 -2
  216. package/dist/src/sync/v4/import/pages/listReport.js +32 -19
  217. package/dist/src/sync/v4/import/pages/listReport.js.map +1 -1
  218. package/dist/src/sync/v4/import/pages/objectPage.d.ts +3 -1
  219. package/dist/src/sync/v4/import/pages/objectPage.js +74 -21
  220. package/dist/src/sync/v4/import/pages/objectPage.js.map +1 -1
  221. package/dist/src/sync/v4/utils/StableIdHelper.js +12 -1
  222. package/dist/src/sync/v4/utils/StableIdHelper.js.map +1 -1
  223. package/dist/src/sync/v4/utils/utils.d.ts +13 -2
  224. package/dist/src/sync/v4/utils/utils.js +49 -29
  225. package/dist/src/sync/v4/utils/utils.js.map +1 -1
  226. package/dist/test/test-utils/utils.d.ts +0 -1
  227. package/dist/test/unit/import/importAppV4.test.d.ts +1 -0
  228. package/package.json +9 -9
@@ -15,6 +15,17 @@ var FileName;
15
15
  FileName["App"] = "app.json";
16
16
  })(FileName = exports.FileName || (exports.FileName = {}));
17
17
  exports.FacetTitlePrefix = 'Facet ID: ';
18
+ var SectionType;
19
+ (function (SectionType) {
20
+ SectionType["Section"] = "Section";
21
+ SectionType["HeaderSection"] = "HeaderSection";
22
+ })(SectionType = exports.SectionType || (exports.SectionType = {}));
23
+ var ArtifactType;
24
+ (function (ArtifactType) {
25
+ ArtifactType["Manifest"] = "Manifest";
26
+ ArtifactType["FlexChange"] = "FlexChange";
27
+ ArtifactType["Annotation"] = "Annotation";
28
+ })(ArtifactType = exports.ArtifactType || (exports.ArtifactType = {}));
18
29
  var ControlType;
19
30
  (function (ControlType) {
20
31
  ControlType["Table"] = "sap.m.Table";
@@ -35,14 +46,17 @@ var ControlType;
35
46
  })(ControlType = exports.ControlType || (exports.ControlType = {}));
36
47
  var FacetBase;
37
48
  (function (FacetBase) {
38
- FacetBase["LineItemFacet"] = "LineItemFacet";
49
+ FacetBase["LineItem"] = "LineItem";
39
50
  FacetBase["CollectionFacet"] = "CollectionFacet";
40
- FacetBase["ChartFacet"] = "ChartFacet";
41
- FacetBase["FormFacet"] = "FormFacet";
51
+ FacetBase["Chart"] = "Chart";
52
+ FacetBase["Form"] = "Form";
42
53
  FacetBase["Identification"] = "Identification";
54
+ FacetBase["DataPoint"] = "DataPoint";
55
+ FacetBase["Address"] = "Address";
56
+ FacetBase["Contact"] = "Contact";
43
57
  FacetBase["Unknown"] = "";
44
58
  })(FacetBase = exports.FacetBase || (exports.FacetBase = {}));
45
- exports.BindingPropertyRegexAsString = "^{[A-Za-z0-9{}&$@#!? _|,<>'()[\\]\\/:=.]+}$";
59
+ exports.BindingPropertyRegexAsString = "^{[A-Za-z0-9{}&$!@#? _|,<>'()[\\]\\/:=.]+}$";
46
60
  var ViewTemplateType;
47
61
  (function (ViewTemplateType) {
48
62
  ViewTemplateType["ResponsiveTableColumnsExtension"] = "ResponsiveTableColumnsExtension";
@@ -51,4 +65,6 @@ var ViewTemplateType;
51
65
  ViewTemplateType["GridTableColumnsExtension"] = "GridTableColumnsExtension";
52
66
  ViewTemplateType["ResponsiveTableCellsExtension"] = "ResponsiveTableCellsExtension";
53
67
  })(ViewTemplateType = exports.ViewTemplateType || (exports.ViewTemplateType = {}));
68
+ exports.METADATAPATH = 'webapp/localService/metadata.xml';
69
+ exports.MANIFESTPATH = 'webapp/manifest.json';
54
70
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/sync/common/types.ts"],"names":[],"mappings":";;AAGA,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,wCAAqB,CAAA;AACzB,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B;AACD,IAAY,OAGX;AAHD,WAAY,OAAO;IACf,+BAAoB,CAAA;IACpB,0BAAe,CAAA;AACnB,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB;AACD,IAAY,QAEX;AAFD,WAAY,QAAQ;IAChB,4BAAgB,CAAA;AACpB,CAAC,EAFW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAEnB;AACY,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAQ7C,IAAY,WAgBX;AAhBD,WAAY,WAAW;IACnB,oCAAqB,CAAA;IACrB,2CAA4B,CAAA;IAC5B,+DAAgD,CAAA;IAChD,2EAA4D,CAAA;IAC5D,+DAAgD,CAAA;IAChD,sCAAuB,CAAA;IACvB,4DAA6C,CAAA;IAC7C,sCAAuB,CAAA;IACvB,qFAAsE,CAAA;IACtE,kEAAmD,CAAA;IACnD,6DAA8C,CAAA;IAC9C,6DAA8C,CAAA;IAC9C,gDAAiC,CAAA;IACjC,0CAA2B,CAAA;IAC3B,gDAAiC,CAAA;AACrC,CAAC,EAhBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAgBtB;AAyHD,IAAY,SAOX;AAPD,WAAY,SAAS;IACjB,4CAA+B,CAAA;IAC/B,gDAAmC,CAAA;IACnC,sCAAyB,CAAA;IACzB,oCAAuB,CAAA;IACvB,8CAAiC,CAAA;IACjC,yBAAY,CAAA;AAChB,CAAC,EAPW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAOpB;AA8CY,QAAA,4BAA4B,GAAG,6CAA6C,CAAC;AAE1F,IAAY,gBAMX;AAND,WAAY,gBAAgB;IACxB,uFAAmE,CAAA;IACnE,uFAAmE,CAAA;IACnE,2EAAuD,CAAA;IACvD,2EAAuD,CAAA;IACvD,mFAA+D,CAAA;AACnE,CAAC,EANW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAM3B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/sync/common/types.ts"],"names":[],"mappings":";;AAGA,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,wCAAqB,CAAA;AACzB,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B;AACD,IAAY,OAGX;AAHD,WAAY,OAAO;IACf,+BAAoB,CAAA;IACpB,0BAAe,CAAA;AACnB,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB;AACD,IAAY,QAEX;AAFD,WAAY,QAAQ;IAChB,4BAAgB,CAAA;AACpB,CAAC,EAFW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAEnB;AACY,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAQ7C,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,kCAAmB,CAAA;IACnB,8CAA+B,CAAA;AACnC,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AAED,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,qCAAqB,CAAA;IACrB,yCAAyB,CAAA;IACzB,yCAAyB,CAAA;AAC7B,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAED,IAAY,WAgBX;AAhBD,WAAY,WAAW;IACnB,oCAAqB,CAAA;IACrB,2CAA4B,CAAA;IAC5B,+DAAgD,CAAA;IAChD,2EAA4D,CAAA;IAC5D,+DAAgD,CAAA;IAChD,sCAAuB,CAAA;IACvB,4DAA6C,CAAA;IAC7C,sCAAuB,CAAA;IACvB,qFAAsE,CAAA;IACtE,kEAAmD,CAAA;IACnD,6DAA8C,CAAA;IAC9C,6DAA8C,CAAA;IAC9C,gDAAiC,CAAA;IACjC,0CAA2B,CAAA;IAC3B,gDAAiC,CAAA;AACrC,CAAC,EAhBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAgBtB;AA4HD,IAAY,SAUX;AAVD,WAAY,SAAS;IACjB,kCAAqB,CAAA;IACrB,gDAAmC,CAAA;IACnC,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,8CAAiC,CAAA;IACjC,oCAAuB,CAAA;IACvB,gCAAmB,CAAA;IACnB,gCAAmB,CAAA;IACnB,yBAAY,CAAA;AAChB,CAAC,EAVW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAUpB;AAgDY,QAAA,4BAA4B,GAAG,6CAA6C,CAAC;AAE1F,IAAY,gBAMX;AAND,WAAY,gBAAgB;IACxB,uFAAmE,CAAA;IACnE,uFAAmE,CAAA;IACnE,2EAAuD,CAAA;IACvD,2EAAuD,CAAA;IACvD,mFAA+D,CAAA;AACnE,CAAC,EANW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAM3B;AAEY,QAAA,YAAY,GAAG,kCAAkC,CAAC;AAClD,QAAA,YAAY,GAAG,sBAAsB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { FacetConfigs, FileData, FacetConfig, FacetSection, SchemaFilePath } from './types';
2
- import { AnnotationTerm, CollectionFacet, ConverterOutput, DataFieldAbstractTypes, EntityType, ReferenceFacet, ReferenceURLFacet } from '@sap-ux/vocabularies-types';
2
+ import { AnnotationTerm, CollectionFacet, ConverterOutput, LineItem, DataFieldAbstractTypes, EntityType, PropertyAnnotations, PropertyPath, ReferenceFacet, ReferenceURLFacet } from '@sap-ux/vocabularies-types';
3
3
  import { FioriElementsVersion, Manifest, PageType, PageTypeV4 } from '../../specification/common';
4
4
  import { SchemaType } from '../../specification/schemaAccess';
5
5
  import { ExtensionLogger } from '../../apiTypes';
@@ -13,7 +13,14 @@ export declare enum TemplateType {
13
13
  AnalyticalListPageV4 = "AnalyticalListPageV4"
14
14
  }
15
15
  export declare const DEFINITION_LINK_PREFIX = "#/definitions/";
16
- export declare function readFile(path: string): Promise<string>;
16
+ /**
17
+ * Function returns annotation path for schema based on received params.
18
+ * @param entityTypeName - Entity type name.
19
+ * @param term - Annotation term.
20
+ * @param qualifier - Annotation qualifier.
21
+ * @returns Annotation path based on received params
22
+ */
23
+ export declare const createAnnotationPath: (entityTypeName: string, term: string, qualifier?: string) => string;
17
24
  /**
18
25
  * Parses, merges, and converts a list of annotation files with aid of tools from annotation-vocabularies-tools
19
26
  * @param annotationFiles - The list of all annotation files, in JSON format
@@ -21,12 +28,33 @@ export declare function readFile(path: string): Promise<string>;
21
28
  */
22
29
  export declare function parseAndMergeAndConvert(annotationFiles: FileData[], logger: ExtensionLogger): ConverterOutput;
23
30
  export declare const getAnnotationPropertyValue: (annotationProperty: any) => string;
31
+ /**
32
+ * Checks for Common.Label and overwrites the label from it if present
33
+ * @param {PropertyAnnotations} annotations - property annotations
34
+ * @param {EntityType} entityType - entity type
35
+ * @param {string} label - label, to be actualized
36
+ */
37
+ export declare function evaluateCommonLabel(annotations: PropertyAnnotations, entityType: EntityType, label: string): string;
38
+ /**
39
+ * Determines the label for a property path
40
+ * @param {PropertyPath} propertyPath - property path
41
+ * @param {EntityType} entityType - entity type
42
+ * @returns label, derived from Common.Label or from property value
43
+ */
44
+ export declare function getLabelForPropertyPath(propertyPath: PropertyPath, entityType: EntityType): string;
45
+ /**
46
+ * Determines the label for a LineItem record
47
+ * @param {DataFieldAbstractType} field - Line item record
48
+ * @param {EntityType} entityType - entity type
49
+ * @returns label, derived from Common.Label or from property value
50
+ */
51
+ export declare function getLabelForDataField(field: DataFieldAbstractTypes, entityType: EntityType): string;
24
52
  /**
25
53
  * Determines the description of a data field, e.g. for the column header
26
- * @param dataField - the given record of the line item annotation
54
+ * @param dataFieldAbstract - the given record of the line item annotation
27
55
  * @param entityType - the entity type as part of the AVT ConverterOutput
28
56
  */
29
- export declare function getDatafieldDescription(dataField: DataFieldAbstractTypes, entityType: EntityType): string;
57
+ export declare function getDatafieldDescription(dataFieldAbstract: DataFieldAbstractTypes, entityType: EntityType): string;
30
58
  /**
31
59
  * Return the page type for a given V2 page in manifest
32
60
  * @param name - page component name
@@ -37,24 +65,41 @@ export declare function getPageTypeV2(name: string): PageType;
37
65
  * @param name - page component name
38
66
  */
39
67
  export declare function getPageTypeV4(name: string): PageTypeV4;
68
+ /**
69
+ * Finds the alias for a given namespace in the references' section of the converted service metadata
70
+ * @param {string} namespace - complete namespace, e.g. 'com.sap.vocabularies.UI.v1'
71
+ * @param {ConverterOutput} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
72
+ * @returns alias for the given namespace
73
+ */
74
+ export declare function findAlias(namespace: string, oDataServiceAVT: ConverterOutput): string;
40
75
  /**
41
76
  * Resolve page section(get key and label->description).
42
77
  * @param facetDefinition - the actual annotation record
43
78
  * @param keyForRelatedFacetKeys - construct key for 'keyForRelatedFacetKeys' property(used to define custom sections) - we should not add '@' symbol there.
44
79
  * @param {FioriElementsVersion} oDataVersion - OData version
80
+ * @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
45
81
  * @param {ExtensionLogger} logger - Logger class for logging messages
46
82
  * @returns {FacetSection} - object comprising the relevant facet information
47
83
  */
48
- export declare function getSectionFacet(facetDefinition: AnnotationTerm<CollectionFacet> | AnnotationTerm<ReferenceFacet> | AnnotationTerm<ReferenceURLFacet>, keyForRelatedFacetKeys: boolean, oDataVersion: FioriElementsVersion, sourceEntityType: EntityType, alias: string, logger?: ExtensionLogger): FacetSection | undefined;
49
- export declare const getManifestSectionByPathV4: (exportResultManifest: object, path: string, targetAnnotation?: string, targetAnnotationEncoded?: string) => object;
84
+ export declare function getSectionFacet(facetDefinition: AnnotationTerm<CollectionFacet> | AnnotationTerm<ReferenceFacet> | AnnotationTerm<ReferenceURLFacet>, keyForRelatedFacetKeys: boolean, oDataVersion: FioriElementsVersion, sourceEntityType: EntityType, oDataServiceAVT: ConverterOutput, logger?: ExtensionLogger): FacetSection | undefined;
50
85
  /**
51
86
  * Finds the alias for a given namespace in the references' section of the converted service metadata
52
- * @param {string} namespace - complete namespace, e.g. 'com.sap.vocabularies.UI.v1'
53
- * @param {ConverterOutput} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
54
- * @returns alias for the given namespace
87
+ * @param {object} exportResultManifest - manifest that is being modified during export
88
+ * @param {string} path - path of the property in the manifest
89
+ * @param {string} targetAnnotation
90
+ * @param {string} targetAnnotationEncoded
91
+ * @returns returns section of the manifest based on path, generates an empty object in case it does not exists
55
92
  */
56
- export declare function findAlias(namespace: string, oDataServiceAVT: ConverterOutput): string;
93
+ export declare const getManifestSectionByPathV4: (exportResultManifest: object, path: string, targetAnnotation?: string, targetAnnotationEncoded?: string) => object;
57
94
  export declare function getSchemaKeyOfLineItemRecord(lineItemRecord: DataFieldAbstractTypes): string;
95
+ /**
96
+ * Retrieve header facet configurations that can be used to generate ObjectPage schemas
97
+ * @param {QualifiedName} entityTypeName - the name of the actual entity type
98
+ * @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
99
+ * @param {FioriElementsVersion} oDataVersion - OData version
100
+ * @param {ExtensionLogger} logger - Logger class for logging messages
101
+ */
102
+ export declare function getObjectPageHeaderFacets(entityType: EntityType, oDataServiceAVT: ConverterOutput, oDataVersion?: FioriElementsVersion, logger?: ExtensionLogger): FacetConfigs;
58
103
  /**
59
104
  * Retrieve facet configurations that can be used to generate ObjectPage schemas
60
105
  * @param {QualifiedName} entityTypeName - the name of the actual entity type
@@ -81,9 +126,10 @@ export declare function createSectionWithoutProperties(facet?: FacetConfig): obj
81
126
  * @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
82
127
  * @param {ExtensionLogger} logger - Logger class for logging messages
83
128
  * @param {FioriElementsVersion} oDataVersion - OData version
129
+ * @param {boolean} [checkUnresolvableFacets=false] - Check and avoid facets and sections without ID and Target.
84
130
  * @returns {FacetSection[]} - Array of facets or sections
85
131
  */
86
- export declare function getObjectPageFacetSection(entityType: EntityType, oDataServiceAVT: ConverterOutput, logger?: ExtensionLogger, oDataVersion?: FioriElementsVersion): FacetSection[];
132
+ export declare function getObjectPageFacetSection(entityType: EntityType, oDataServiceAVT: ConverterOutput, logger?: ExtensionLogger, oDataVersion?: FioriElementsVersion, checkUnresolvableFacets?: boolean): FacetSection[];
87
133
  /**
88
134
  * Cleans empty sub-structures from the export result for manifest
89
135
  * @param manifest - manifest.json part of the export result
@@ -121,14 +167,28 @@ export declare type NextDefinition = {
121
167
  * @param currentConfigObject - current part of the configuration that gets traversed
122
168
  * @param propertyDefinition - definition of a given property in the app schema
123
169
  * @param key - actual key
170
+ * @param factory - factory for creating metadata instances
171
+ * @param pageType - page type
124
172
  */
125
- export declare function getNextTargetDefinition(appSchema: object, title: string, currentConfigObject: object, propertyDefinition: object, key: string, factory: MetadataInstanceInterface, pageType: PageType): NextDefinition;
173
+ export declare function getNextTargetDefinition(appSchema: object, title: string, currentConfigObject: object, propertyDefinition: object, key: string, factory: MetadataInstanceInterface, pageType: PageType | PageTypeV4): NextDefinition;
126
174
  /**
127
175
  * Add schema definitions for fields of createWithParameterDialog
128
176
  * @param {object} appSchema - Application-specific schema, to be enhanced
129
177
  * @param {EntityType} entityType - Given entity type for which entries shall get generated.
130
178
  */
131
179
  export declare function addFieldsType(appSchema: object, entityType: EntityType): void;
180
+ /**
181
+ * Functions used both by V2 and V4 to add the common definitions for a line item to the app schema
182
+ * @param appSchema - the app specific schema that shall get enhanced
183
+ * @param lineItemAnnotation - the UI.LineItem annotation, comprising all records
184
+ * @param entityType - the entity type as part of the AVT ConverterOutput
185
+ * @param lineItemId - line item ID, as comprise in stable ID
186
+ * @returns the actions definition plus the annotation path to the given line item
187
+ */
188
+ export declare function addCommonLineItemDefinitions(appSchema: object, lineItemAnnotation: AnnotationTerm<LineItem>, entityType: EntityType, lineItemId: string): {
189
+ actions: object;
190
+ lineItemPath: string;
191
+ };
132
192
  /**
133
193
  * Method adds definition for 'RelatedFacetKeys' as enum with describtion and adds references to 'RelatedFacetKeys' for custom section definitions.
134
194
  * @param {object} schema App specific schema that potentially gets enhanced
@@ -147,11 +207,3 @@ export declare function addDefinitionForRelatedFacetKeys(schema: object, section
147
207
  * @returns
148
208
  */
149
209
  export declare const arrayCombineMerge: (target: any, source: any, options: any) => any;
150
- /**
151
- * Function returns annotation path for schema based on received params.
152
- * @param entityTypeName - Entity type name.
153
- * @param term - Annotation term.
154
- * @param qualifier - Annotation qualifier.
155
- * @returns Annotation path based on received params
156
- */
157
- export declare const createAnnotationPath: (entityTypeName: string, term: string, qualifier?: string) => string;
@@ -1,11 +1,4 @@
1
1
  "use strict";
2
- var __importStar = (this && this.__importStar) || function (mod) {
3
- if (mod && mod.__esModule) return mod;
4
- var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
7
- return result;
8
- };
9
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
11
4
  };
@@ -15,8 +8,8 @@ const annotation_converter_1 = require("@sap-ux/annotation-converter");
15
8
  const edmx_parser_1 = require("@sap-ux/edmx-parser");
16
9
  const common_1 = require("../../specification/common");
17
10
  const schemaAccess_1 = require("../../specification/schemaAccess");
18
- const fs = __importStar(require("fs"));
19
11
  const i18next_1 = __importDefault(require("i18next"));
12
+ const v4_1 = require("../../specification/v4");
20
13
  const extensionLogger_1 = require("../../extensionLogger");
21
14
  const deepmerge_1 = __importDefault(require("deepmerge"));
22
15
  var TemplateType;
@@ -29,19 +22,20 @@ var TemplateType;
29
22
  TemplateType["AnalyticalListPageV4"] = "AnalyticalListPageV4";
30
23
  })(TemplateType = exports.TemplateType || (exports.TemplateType = {}));
31
24
  exports.DEFINITION_LINK_PREFIX = '#/definitions/';
32
- async function readFile(path) {
33
- return new Promise((resolve, reject) => {
34
- fs.readFile(path, { encoding: 'utf8' }, (err, data) => {
35
- if (err) {
36
- reject(err);
37
- }
38
- else {
39
- resolve(data);
40
- }
41
- });
42
- });
43
- }
44
- exports.readFile = readFile;
25
+ /**
26
+ * Function returns annotation path for schema based on received params.
27
+ * @param entityTypeName - Entity type name.
28
+ * @param term - Annotation term.
29
+ * @param qualifier - Annotation qualifier.
30
+ * @returns Annotation path based on received params
31
+ */
32
+ exports.createAnnotationPath = (entityTypeName, term, qualifier) => {
33
+ let annotationPath = `/${entityTypeName}/@${term}`;
34
+ if (qualifier) {
35
+ annotationPath += `#${qualifier}`;
36
+ }
37
+ return annotationPath;
38
+ };
45
39
  /**
46
40
  * Parses, merges, and converts a list of annotation files with aid of tools from annotation-vocabularies-tools
47
41
  * @param annotationFiles - The list of all annotation files, in JSON format
@@ -55,9 +49,6 @@ function parseAndMergeAndConvert(annotationFiles, logger) {
55
49
  parseResult.push(edmx_parser_1.parseEDMX(annotationData.fileContent, annotationData.dataSourceUri));
56
50
  });
57
51
  }
58
- if (parseResult.length === 0) {
59
- return;
60
- }
61
52
  const converterOutput = annotation_converter_1.convertTypes(edmx_parser_1.merge(parseResult));
62
53
  if (logger && converterOutput.diagnostics) {
63
54
  for (let index = 0; index < converterOutput.diagnostics.length; index++) {
@@ -80,11 +71,51 @@ function parseAndMergeAndConvert(annotationFiles, logger) {
80
71
  exports.parseAndMergeAndConvert = parseAndMergeAndConvert;
81
72
  exports.getAnnotationPropertyValue = (annotationProperty) => (annotationProperty === null || annotationProperty === void 0 ? void 0 : annotationProperty.value) || (annotationProperty === null || annotationProperty === void 0 ? void 0 : annotationProperty.path);
82
73
  /**
83
- * Common function determining the label for a LineItem record
74
+ * Checks for Common.Label and overwrites the label from it if present
75
+ * @param {PropertyAnnotations} annotations - property annotations
76
+ * @param {EntityType} entityType - entity type
77
+ * @param {string} label - label, to be actualized
78
+ */
79
+ function evaluateCommonLabel(annotations, entityType, label) {
80
+ var _a, _b, _c, _d;
81
+ if ((_a = annotations === null || annotations === void 0 ? void 0 : annotations.Common) === null || _a === void 0 ? void 0 : _a.Label) {
82
+ if (typeof annotations.Common.Label === 'string') {
83
+ label = annotations.Common.Label;
84
+ }
85
+ else if (annotations.Common.Label['type'] === 'Path') {
86
+ const targetProperty = entityType.resolvePath(annotations.Common.Label['path']);
87
+ label = targetProperty.value
88
+ ? targetProperty.value
89
+ : typeof ((_b = targetProperty.Common) === null || _b === void 0 ? void 0 : _b.Label) === 'string'
90
+ ? targetProperty.annotations.Common.Label
91
+ : label;
92
+ }
93
+ else if (typeof ((_d = (_c = annotations.Common) === null || _c === void 0 ? void 0 : _c.Label) === null || _d === void 0 ? void 0 : _d.toString()) === 'string') {
94
+ label = annotations.Common.Label.toString();
95
+ }
96
+ }
97
+ return label;
98
+ }
99
+ exports.evaluateCommonLabel = evaluateCommonLabel;
100
+ /**
101
+ * Determines the label for a property path
102
+ * @param {PropertyPath} propertyPath - property path
103
+ * @param {EntityType} entityType - entity type
104
+ * @returns label, derived from Common.Label or from property value
105
+ */
106
+ function getLabelForPropertyPath(propertyPath, entityType) {
107
+ let label = propertyPath.value;
108
+ label = evaluateCommonLabel(propertyPath.$target.annotations, entityType, label);
109
+ return label;
110
+ }
111
+ exports.getLabelForPropertyPath = getLabelForPropertyPath;
112
+ /**
113
+ * Determines the label for a LineItem record
84
114
  * @param {DataFieldAbstractType} field - Line item record
85
- * @param {EntityType} entityType - Entity type
115
+ * @param {EntityType} entityType - entity type
116
+ * @returns label, derived from Common.Label or from property value
86
117
  */
87
- function getCommonLabel(field, entityType) {
118
+ function getLabelForDataField(field, entityType) {
88
119
  var _a, _b;
89
120
  let label, property;
90
121
  if (field['Value']) {
@@ -102,10 +133,11 @@ function getCommonLabel(field, entityType) {
102
133
  property = field['Target'].$target.Value.$target;
103
134
  }
104
135
  if ((_b = (_a = property === null || property === void 0 ? void 0 : property.annotations) === null || _a === void 0 ? void 0 : _a.Common) === null || _b === void 0 ? void 0 : _b.Label) {
105
- label = property.annotations.Common.Label.toString();
136
+ label = evaluateCommonLabel(property.annotations, entityType, label);
106
137
  }
107
138
  return label;
108
139
  }
140
+ exports.getLabelForDataField = getLabelForDataField;
109
141
  /**
110
142
  * Function to resolve the dataField label
111
143
  * @param dataFieldLabel - Given dataField label; might be of type string, or an object in case of a path reference
@@ -125,7 +157,8 @@ function getLabel(dataFieldLabel, entityType) {
125
157
  else {
126
158
  const singleProperty = property[0];
127
159
  if ((_b = (_a = singleProperty === null || singleProperty === void 0 ? void 0 : singleProperty.annotations) === null || _a === void 0 ? void 0 : _a.Common) === null || _b === void 0 ? void 0 : _b.Label) {
128
- return singleProperty.annotations.Common.Label.toString();
160
+ const label = dataFieldLabel;
161
+ return evaluateCommonLabel(singleProperty.annotations, entityType, label);
129
162
  }
130
163
  }
131
164
  }
@@ -135,15 +168,16 @@ function getLabel(dataFieldLabel, entityType) {
135
168
  }
136
169
  /**
137
170
  * Determines the description of a data field, e.g. for the column header
138
- * @param dataField - the given record of the line item annotation
171
+ * @param dataFieldAbstract - the given record of the line item annotation
139
172
  * @param entityType - the entity type as part of the AVT ConverterOutput
140
173
  */
141
- function getDatafieldDescription(dataField, entityType) {
142
- let title = '', propertyCommonLabel;
143
- const dataFieldLabel = getLabel(dataField.Label, entityType);
144
- switch (dataField.$Type) {
174
+ function getDatafieldDescription(dataFieldAbstract, entityType) {
175
+ let title = '', propertyCommonLabel, dataField;
176
+ const dataFieldLabel = getLabel(dataFieldAbstract.Label, entityType);
177
+ switch (dataFieldAbstract.$Type) {
145
178
  case "com.sap.vocabularies.UI.v1.DataField" /* DataField */:
146
- propertyCommonLabel = getCommonLabel(dataField, entityType);
179
+ dataField = dataFieldAbstract;
180
+ propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
147
181
  title =
148
182
  dataFieldLabel ||
149
183
  propertyCommonLabel ||
@@ -152,31 +186,36 @@ function getDatafieldDescription(dataField, entityType) {
152
186
  : dataField.Value.value || dataField.Value.path);
153
187
  break;
154
188
  case "com.sap.vocabularies.UI.v1.DataFieldWithUrl" /* DataFieldWithUrl */:
155
- propertyCommonLabel = getCommonLabel(dataField, entityType);
189
+ dataField = dataFieldAbstract;
190
+ propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
156
191
  title =
157
192
  dataFieldLabel ||
158
193
  propertyCommonLabel ||
159
194
  (typeof dataField.Value === 'string' ? dataField.Value : dataField.Value.path);
160
195
  break;
161
196
  case "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* DataFieldForAnnotation */:
162
- propertyCommonLabel = getCommonLabel(dataField, entityType);
197
+ dataField = dataFieldAbstract;
198
+ propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
163
199
  title = dataFieldLabel || propertyCommonLabel || dataField.Target.$target.Title || dataField.Target.value;
164
200
  break;
165
201
  case "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */:
166
202
  case "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* DataFieldForIntentBasedNavigation */:
203
+ dataField = dataFieldAbstract;
167
204
  if (dataFieldLabel) {
168
205
  title = typeof dataFieldLabel === 'string' ? dataFieldLabel : dataField.Action;
169
206
  }
170
207
  else {
171
- title = dataField.Action;
208
+ title = dataFieldAbstract.Action;
172
209
  }
173
210
  break;
174
211
  case "com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation" /* DataFieldWithIntentBasedNavigation */:
175
- propertyCommonLabel = getCommonLabel(dataField, entityType);
212
+ dataField = dataFieldAbstract;
213
+ propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
176
214
  title = propertyCommonLabel || dataField.Value.path;
177
215
  break;
178
216
  case "com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath" /* DataFieldWithNavigationPath */:
179
- propertyCommonLabel = getCommonLabel(dataField, entityType);
217
+ dataField = dataFieldAbstract;
218
+ propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
180
219
  title =
181
220
  dataFieldLabel ||
182
221
  propertyCommonLabel ||
@@ -213,15 +252,40 @@ exports.getPageTypeV4 = getPageTypeV4;
213
252
  function getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys = false) {
214
253
  return `${!keyForRelatedFacetKeys ? '@' : ''}${targetAnnotation.qualifier ? targetAnnotation.term + '#' + targetAnnotation.qualifier : targetAnnotation.term}`;
215
254
  }
255
+ /**
256
+ * Finds the alias for a given namespace in the references' section of the converted service metadata
257
+ * @param {string} namespace - complete namespace, e.g. 'com.sap.vocabularies.UI.v1'
258
+ * @param {ConverterOutput} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
259
+ * @returns alias for the given namespace
260
+ */
261
+ function findAlias(namespace, oDataServiceAVT) {
262
+ let aliasReference = oDataServiceAVT.references.find((reference) => {
263
+ return reference.namespace === namespace;
264
+ });
265
+ if (!aliasReference) {
266
+ aliasReference = oDataServiceAVT.references.find((reference) => {
267
+ return reference.alias === namespace;
268
+ });
269
+ }
270
+ if (!aliasReference) {
271
+ aliasReference = oDataServiceAVT.references.find((reference) => {
272
+ return (reference.alias.toUpperCase() ===
273
+ namespace.split('SAP__')[namespace.split('SAP__').length - 1].toUpperCase());
274
+ });
275
+ }
276
+ return aliasReference === null || aliasReference === void 0 ? void 0 : aliasReference.alias;
277
+ }
278
+ exports.findAlias = findAlias;
216
279
  /**
217
280
  * Resolve page section(get key and label->description).
218
281
  * @param facetDefinition - the actual annotation record
219
282
  * @param keyForRelatedFacetKeys - construct key for 'keyForRelatedFacetKeys' property(used to define custom sections) - we should not add '@' symbol there.
220
283
  * @param {FioriElementsVersion} oDataVersion - OData version
284
+ * @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
221
285
  * @param {ExtensionLogger} logger - Logger class for logging messages
222
286
  * @returns {FacetSection} - object comprising the relevant facet information
223
287
  */
224
- function getSectionFacet(facetDefinition, keyForRelatedFacetKeys = false, oDataVersion = common_1.FioriElementsVersion.v2, sourceEntityType, alias, logger) {
288
+ function getSectionFacet(facetDefinition, keyForRelatedFacetKeys = false, oDataVersion = common_1.FioriElementsVersion.v2, sourceEntityType, oDataServiceAVT, logger) {
225
289
  var _a, _b;
226
290
  let entityType = sourceEntityType; //default
227
291
  const facetName = facetDefinition.fullyQualifiedName.substr(facetDefinition.fullyQualifiedName.lastIndexOf('@'));
@@ -254,7 +318,9 @@ function getSectionFacet(facetDefinition, keyForRelatedFacetKeys = false, oDataV
254
318
  else {
255
319
  key = uiClass.replace('@UI', `${!keyForRelatedFacetKeys ? '@' : ''}com.sap.vocabularies.UI.v1`);
256
320
  }
257
- const annotation = propertyValue.split('.')[propertyValue.split('.').length - 1];
321
+ const lastNavigationPart = navigationParts[navigationParts.length - 1];
322
+ const annotation = lastNavigationPart.substring(lastNavigationPart.lastIndexOf('.') + 1, lastNavigationPart.length);
323
+ const alias = findAlias(lastNavigationPart.substring(0, lastNavigationPart.lastIndexOf('.')).replace('@', ''), oDataServiceAVT);
258
324
  const targetAnnotation = (_b = entityType === null || entityType === void 0 ? void 0 : entityType.annotations[alias]) === null || _b === void 0 ? void 0 : _b[annotation];
259
325
  if (targetAnnotation) {
260
326
  key = getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys).replace('#', separator);
@@ -271,6 +337,14 @@ function getSectionFacet(facetDefinition, keyForRelatedFacetKeys = false, oDataV
271
337
  ? Object.assign(Object.assign(Object.assign({ key }, (facetDefinition.Label && { label: facetDefinition.Label.toString() })), (facetDefinition.ID && { ID: facetDefinition.ID.toString() })), { entityType }) : undefined;
272
338
  }
273
339
  exports.getSectionFacet = getSectionFacet;
340
+ /**
341
+ * Finds the alias for a given namespace in the references' section of the converted service metadata
342
+ * @param {object} exportResultManifest - manifest that is being modified during export
343
+ * @param {string} path - path of the property in the manifest
344
+ * @param {string} targetAnnotation
345
+ * @param {string} targetAnnotationEncoded
346
+ * @returns returns section of the manifest based on path, generates an empty object in case it does not exists
347
+ */
274
348
  exports.getManifestSectionByPathV4 = (exportResultManifest, path, targetAnnotation, targetAnnotationEncoded) => {
275
349
  let exportResultSection = exportResultManifest;
276
350
  path.split('/').forEach(function (element) {
@@ -284,19 +358,6 @@ exports.getManifestSectionByPathV4 = (exportResultManifest, path, targetAnnotati
284
358
  });
285
359
  return exportResultSection;
286
360
  };
287
- /**
288
- * Finds the alias for a given namespace in the references' section of the converted service metadata
289
- * @param {string} namespace - complete namespace, e.g. 'com.sap.vocabularies.UI.v1'
290
- * @param {ConverterOutput} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
291
- * @returns alias for the given namespace
292
- */
293
- function findAlias(namespace, oDataServiceAVT) {
294
- const aliasReference = oDataServiceAVT.references.find((reference) => {
295
- return reference.namespace === namespace;
296
- });
297
- return aliasReference && aliasReference.alias;
298
- }
299
- exports.findAlias = findAlias;
300
361
  function getSchemaKeyOfLineItemRecord(lineItemRecord) {
301
362
  let schemaKey, target, value;
302
363
  switch (lineItemRecord.$Type) {
@@ -365,9 +426,9 @@ exports.getSchemaKeyOfLineItemRecord = getSchemaKeyOfLineItemRecord;
365
426
  * @param {ExtensionLogger} logger - Logger class for logging messages
366
427
  */
367
428
  function evaluateTargetAnnotation(annotationRecord, facets, entityType, oDataServiceAVT, oDataVersion = common_1.FioriElementsVersion.v2, logger) {
368
- var _a, _b;
429
+ var _a, _b, _c, _d, _e;
369
430
  const alias = findAlias('com.sap.vocabularies.UI.v1', oDataServiceAVT);
370
- const section = getSectionFacet(annotationRecord, false, oDataVersion, entityType, alias, logger);
431
+ const section = getSectionFacet(annotationRecord, false, oDataVersion, entityType, oDataServiceAVT, logger);
371
432
  if (!section) {
372
433
  return;
373
434
  }
@@ -376,7 +437,7 @@ function evaluateTargetAnnotation(annotationRecord, facets, entityType, oDataSer
376
437
  let version, annotation, targetAnnotation;
377
438
  let scope = alias;
378
439
  if (path.includes('com.sap.vocabularies.UI.v1.Chart') || path.includes(alias + '.Chart')) {
379
- facets[path] = { base: types_1.FacetBase.ChartFacet };
440
+ facets[path] = { base: types_1.FacetBase.Chart };
380
441
  facets[path]['entityType'] = targetEntityType;
381
442
  }
382
443
  else if (path.includes('com.sap.vocabularies.UI.v1.Identification') || path.includes(alias + '.Identification')) {
@@ -384,7 +445,7 @@ function evaluateTargetAnnotation(annotationRecord, facets, entityType, oDataSer
384
445
  targetAnnotation = targetEntityType.annotations[scope][annotation];
385
446
  facets[path] = { base: types_1.FacetBase.Identification };
386
447
  facets[path]['entityType'] = targetEntityType;
387
- facets[path]['form'] = targetAnnotation;
448
+ facets[path]['target'] = targetAnnotation;
388
449
  }
389
450
  else if (path.includes('com.sap.vocabularies.UI.v1.LineItem') || path.includes(alias + '.LineItem')) {
390
451
  if (entityType) {
@@ -397,14 +458,29 @@ function evaluateTargetAnnotation(annotationRecord, facets, entityType, oDataSer
397
458
  pathParts[pathParts.length - 1] = '@com.sap.vocabularies.UI.v1.LineItem';
398
459
  path = pathParts.join('::');
399
460
  }
400
- facets[path] = { base: types_1.FacetBase.LineItemFacet };
461
+ facets[path] = { base: types_1.FacetBase.LineItem };
401
462
  facets[path]['lineItem'] = (_a = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _a === void 0 ? void 0 : _a.$target;
402
463
  facets[path]['entityType'] = targetEntityType;
403
464
  }
404
465
  }
405
466
  else if (path.includes('com.sap.vocabularies.UI.v1.FieldGroup') || path.includes(alias + '.FieldGroup')) {
406
- facets[path] = { base: types_1.FacetBase.FormFacet };
407
- facets[path]['form'] = (_b = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _b === void 0 ? void 0 : _b.$target;
467
+ facets[path] = { base: types_1.FacetBase.Form };
468
+ facets[path]['target'] = (_b = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _b === void 0 ? void 0 : _b.$target;
469
+ facets[path]['entityType'] = targetEntityType;
470
+ }
471
+ else if (path.includes('com.sap.vocabularies.UI.v1.DataPoint') || path.includes(alias + '.DataPoint')) {
472
+ facets[path] = { base: types_1.FacetBase.DataPoint };
473
+ facets[path].target = (_c = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _c === void 0 ? void 0 : _c.$target;
474
+ facets[path]['entityType'] = targetEntityType;
475
+ }
476
+ else if (path.includes('com.sap.vocabularies.Communication.v1.Contact') || path.includes(alias + '.Contact')) {
477
+ facets[path] = { base: types_1.FacetBase.Contact };
478
+ facets[path].target = (_d = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _d === void 0 ? void 0 : _d.$target;
479
+ facets[path]['entityType'] = targetEntityType;
480
+ }
481
+ else if (path.includes('com.sap.vocabularies.Communication.v1.Address') || path.includes(alias + '.Address')) {
482
+ facets[path] = { base: types_1.FacetBase.Address };
483
+ facets[path].target = (_e = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _e === void 0 ? void 0 : _e.$target;
408
484
  facets[path]['entityType'] = targetEntityType;
409
485
  }
410
486
  else {
@@ -419,6 +495,12 @@ function evaluateTargetAnnotation(annotationRecord, facets, entityType, oDataSer
419
495
  if (annotationRecord.ID) {
420
496
  facets[path]['ID'] = annotationRecord.ID;
421
497
  }
498
+ else if (oDataVersion === common_1.FioriElementsVersion.v4) {
499
+ extensionLogger_1.log(logger, {
500
+ severity: "error" /* Error */,
501
+ message: i18next_1.default.t('NOID4SECTION', { facet: annotationRecord.fullyQualifiedName })
502
+ });
503
+ }
422
504
  if (section && section.entityType) {
423
505
  facets[path].entityType = section.entityType;
424
506
  }
@@ -435,14 +517,14 @@ function evaluateTargetAnnotation(annotationRecord, facets, entityType, oDataSer
435
517
  * @param {ExtensionLogger} logger - Logger class for logging messages
436
518
  */
437
519
  function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion = common_1.FioriElementsVersion.v2, logger) {
520
+ var _a;
438
521
  switch (annotationRecord.$Type) {
439
522
  case "com.sap.vocabularies.UI.v1.ReferenceFacet" /* ReferenceFacet */: {
440
523
  evaluateTargetAnnotation(annotationRecord, facets, entityType, oDataServiceAVT, oDataVersion, logger);
441
524
  break;
442
525
  }
443
526
  case "com.sap.vocabularies.UI.v1.CollectionFacet" /* CollectionFacet */: {
444
- const alias = findAlias('com.sap.vocabularies.UI.v1', oDataServiceAVT);
445
- const section = getSectionFacet(annotationRecord, false, oDataVersion, entityType, alias, logger);
527
+ const section = getSectionFacet(annotationRecord, false, oDataVersion, entityType, oDataServiceAVT, logger);
446
528
  if (section) {
447
529
  const annotationPath = `/${entityType.fullyQualifiedName}/${annotationRecord.fullyQualifiedName.split(entityType.fullyQualifiedName)[1]}`;
448
530
  const facet = (facets[section.key] = {
@@ -452,7 +534,7 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
452
534
  annotationPath: annotationPath,
453
535
  Label: section.label
454
536
  });
455
- annotationRecord.Facets.forEach((collectionItem) => {
537
+ (_a = annotationRecord.Facets) === null || _a === void 0 ? void 0 : _a.forEach((collectionItem) => {
456
538
  addFacetToConfig(collectionItem, oDataServiceAVT, serviceName, entityType, facet.facets, oDataVersion, logger);
457
539
  });
458
540
  }
@@ -460,6 +542,31 @@ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entity
460
542
  }
461
543
  }
462
544
  }
545
+ /**
546
+ * Retrieve header facet configurations that can be used to generate ObjectPage schemas
547
+ * @param {QualifiedName} entityTypeName - the name of the actual entity type
548
+ * @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
549
+ * @param {FioriElementsVersion} oDataVersion - OData version
550
+ * @param {ExtensionLogger} logger - Logger class for logging messages
551
+ */
552
+ function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = common_1.FioriElementsVersion.v2, logger) {
553
+ const facets = {};
554
+ if (!entityType || !entityType.annotations) {
555
+ return;
556
+ }
557
+ const alias = findAlias('com.sap.vocabularies.UI.v1', oDataServiceAVT);
558
+ const facetAnnotation = alias && entityType.annotations[alias] && entityType.annotations[alias].HeaderFacets;
559
+ if (facetAnnotation) {
560
+ const lastDot = entityType.fullyQualifiedName.lastIndexOf('.');
561
+ const serviceName = entityType.fullyQualifiedName.substr(0, lastDot);
562
+ // Add facets to configuration
563
+ facetAnnotation.forEach((item) => {
564
+ addFacetToConfig(item, oDataServiceAVT, serviceName, entityType, facets, oDataVersion, logger);
565
+ });
566
+ }
567
+ return facets;
568
+ }
569
+ exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
463
570
  /**
464
571
  * Retrieve facet configurations that can be used to generate ObjectPage schemas
465
572
  * @param {QualifiedName} entityTypeName - the name of the actual entity type
@@ -490,7 +597,7 @@ exports.getObjectPageFacets = getObjectPageFacets;
490
597
  * @param manifest - the manifest.json file
491
598
  */
492
599
  function getVersionFromManifest(manifest) {
493
- if (manifest['sap.ui.generic.app'] || manifest['sap.ovp']) {
600
+ if (manifest[v4_1.ManifestSection.generic] || manifest[v4_1.ManifestSection.ovp]) {
494
601
  return common_1.FioriElementsVersion.v2;
495
602
  }
496
603
  else {
@@ -500,19 +607,19 @@ function getVersionFromManifest(manifest) {
500
607
  exports.getVersionFromManifest = getVersionFromManifest;
501
608
  function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
502
609
  let templateType;
503
- if (manifest['sap.ovp']) {
610
+ if (manifest[v4_1.ManifestSection.ovp]) {
504
611
  templateType = TemplateType.OverviewPageV2;
505
612
  }
506
613
  else if (fioriElementsVersion === common_1.FioriElementsVersion.v2) {
507
- if (manifest['sap.ui.generic.app']) {
508
- const v2Pages = manifest['sap.ui.generic.app'].pages;
614
+ if (manifest[v4_1.ManifestSection.generic]) {
615
+ const v2Pages = manifest[v4_1.ManifestSection.generic].pages;
509
616
  if (!v2Pages) {
510
617
  extensionLogger_1.log(logger, {
511
618
  severity: "error" /* Error */,
512
619
  message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
513
620
  location: {
514
- path: 'webapp/manifest.json',
515
- range: ['sap.ui.generic.app']
621
+ path: types_1.MANIFESTPATH,
622
+ range: [v4_1.ManifestSection.generic]
516
623
  }
517
624
  });
518
625
  return;
@@ -533,24 +640,25 @@ function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
533
640
  if (!templateType) {
534
641
  extensionLogger_1.log(logger, {
535
642
  severity: "error" /* Error */,
536
- message: i18next_1.default.t('NOTEMPLATE', { section: 'sap.ui.generic.app' }),
643
+ message: i18next_1.default.t('NOTEMPLATE', { section: v4_1.ManifestSection.generic }),
537
644
  location: {
538
- path: 'webapp/manifest.json',
539
- range: ['sap.ui.generic.app']
645
+ path: types_1.MANIFESTPATH,
646
+ range: [v4_1.ManifestSection.generic]
540
647
  }
541
648
  });
542
649
  }
543
650
  }
544
651
  }
545
652
  else if (fioriElementsVersion === common_1.FioriElementsVersion.v4) {
546
- const v4Pages = manifest['sap.ui5'].routing && manifest['sap.ui5'].routing.targets;
653
+ const v4Pages = manifest[v4_1.ManifestSection.ui5].routing &&
654
+ manifest[v4_1.ManifestSection.ui5].routing.targets;
547
655
  if (!v4Pages) {
548
656
  extensionLogger_1.log(logger, {
549
657
  severity: "error" /* Error */,
550
658
  message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
551
659
  location: {
552
- path: 'webapp/manifest.json',
553
- range: ['sap.ui5', 'routing']
660
+ path: types_1.MANIFESTPATH,
661
+ range: [v4_1.ManifestSection.ui5, 'routing']
554
662
  }
555
663
  });
556
664
  return;
@@ -573,10 +681,10 @@ function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
573
681
  if (!templateType) {
574
682
  extensionLogger_1.log(logger, {
575
683
  severity: "error" /* Error */,
576
- message: i18next_1.default.t('NOTEMPLATE', { section: 'sap.ui5' }),
684
+ message: i18next_1.default.t('NOTEMPLATE', { section: v4_1.ManifestSection.ui5 }),
577
685
  location: {
578
- path: 'webapp/manifest.json',
579
- range: ['sap.ui5', 'routing', 'targets']
686
+ path: types_1.MANIFESTPATH,
687
+ range: [v4_1.ManifestSection.ui5, 'routing', 'targets']
580
688
  }
581
689
  });
582
690
  }
@@ -587,7 +695,7 @@ function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
587
695
  severity: "error" /* Error */,
588
696
  message: i18next_1.default.t('NOFE'),
589
697
  location: {
590
- path: 'webapp/manifest.json'
698
+ path: types_1.MANIFESTPATH
591
699
  }
592
700
  });
593
701
  }
@@ -623,9 +731,10 @@ exports.createSectionWithoutProperties = createSectionWithoutProperties;
623
731
  * @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
624
732
  * @param {ExtensionLogger} logger - Logger class for logging messages
625
733
  * @param {FioriElementsVersion} oDataVersion - OData version
734
+ * @param {boolean} [checkUnresolvableFacets=false] - Check and avoid facets and sections without ID and Target.
626
735
  * @returns {FacetSection[]} - Array of facets or sections
627
736
  */
628
- function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion = common_1.FioriElementsVersion.v2) {
737
+ function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion = common_1.FioriElementsVersion.v2, checkUnresolvableFacets = false) {
629
738
  const alias = findAlias('com.sap.vocabularies.UI.v1', oDataServiceAVT);
630
739
  if (entityType) {
631
740
  const facetAnnotation = alias && entityType.annotations && entityType.annotations[alias] && entityType.annotations[alias].Facets;
@@ -633,7 +742,10 @@ function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVer
633
742
  return [];
634
743
  }
635
744
  return facetAnnotation.reduce(function (result, item) {
636
- const section = getSectionFacet(item, true, oDataVersion, entityType, alias, logger);
745
+ if (checkUnresolvableFacets && !item['ID'] && !('Target' in item && item['Target'])) {
746
+ return result;
747
+ }
748
+ const section = getSectionFacet(item, true, oDataVersion, entityType, oDataServiceAVT, logger);
637
749
  if (section) {
638
750
  result.push(section);
639
751
  }
@@ -750,6 +862,8 @@ exports.generatePageId = generatePageId;
750
862
  * @param currentConfigObject - current part of the configuration that gets traversed
751
863
  * @param propertyDefinition - definition of a given property in the app schema
752
864
  * @param key - actual key
865
+ * @param factory - factory for creating metadata instances
866
+ * @param pageType - page type
753
867
  */
754
868
  function getNextTargetDefinition(appSchema, title, currentConfigObject, propertyDefinition, key, factory, pageType) {
755
869
  let nextDefinition = {
@@ -846,6 +960,42 @@ function addFieldsType(appSchema, entityType) {
846
960
  };
847
961
  }
848
962
  exports.addFieldsType = addFieldsType;
963
+ /**
964
+ * Functions used both by V2 and V4 to add the common definitions for a line item to the app schema
965
+ * @param appSchema - the app specific schema that shall get enhanced
966
+ * @param lineItemAnnotation - the UI.LineItem annotation, comprising all records
967
+ * @param entityType - the entity type as part of the AVT ConverterOutput
968
+ * @param lineItemId - line item ID, as comprise in stable ID
969
+ * @returns the actions definition plus the annotation path to the given line item
970
+ */
971
+ function addCommonLineItemDefinitions(appSchema, lineItemAnnotation, entityType, lineItemId) {
972
+ let lineItemPath;
973
+ appSchema['definitions'][lineItemId] = {
974
+ type: 'object',
975
+ properties: {},
976
+ additionalProperties: false,
977
+ isViewNode: true,
978
+ description: 'Columns'
979
+ };
980
+ //Copy toolbar
981
+ const toolBar = lineItemId === 'LineItems' ? 'ToolBar' : 'ObjectPageToolBar';
982
+ const schemaIdForToolBar = `${toolBar}<${lineItemId}>`;
983
+ appSchema['definitions'][schemaIdForToolBar] = JSON.parse(JSON.stringify(appSchema['definitions'][`${toolBar}`]));
984
+ appSchema['definitions'][schemaIdForToolBar].properties.actions.$ref =
985
+ exports.DEFINITION_LINK_PREFIX + 'Actions<' + lineItemId + '>';
986
+ const schemaIdForActions = `Actions<${lineItemId}>`;
987
+ const actionId = lineItemId === 'LineItems' ? 'Actions' : 'ObjectPageToolBarActions';
988
+ const actions = (appSchema['definitions'][schemaIdForActions] = JSON.parse(JSON.stringify(appSchema['definitions'][actionId])));
989
+ actions.properties = {};
990
+ actions.additionalProperties = false;
991
+ //Determine annotation path
992
+ if (lineItemAnnotation) {
993
+ lineItemPath = exports.createAnnotationPath(entityType.fullyQualifiedName, lineItemAnnotation.term, lineItemAnnotation.qualifier);
994
+ appSchema['definitions'][lineItemId].annotationPath = appSchema['definitions'][schemaIdForToolBar].annotationPath = lineItemPath;
995
+ }
996
+ return { actions, lineItemPath };
997
+ }
998
+ exports.addCommonLineItemDefinitions = addCommonLineItemDefinitions;
849
999
  /**
850
1000
  * Method adds definition for 'RelatedFacetKeys' as enum with describtion and adds references to 'RelatedFacetKeys' for custom section definitions.
851
1001
  * @param {object} schema App specific schema that potentially gets enhanced
@@ -908,18 +1058,4 @@ exports.arrayCombineMerge = (target, source, options) => {
908
1058
  });
909
1059
  return destination;
910
1060
  };
911
- /**
912
- * Function returns annotation path for schema based on received params.
913
- * @param entityTypeName - Entity type name.
914
- * @param term - Annotation term.
915
- * @param qualifier - Annotation qualifier.
916
- * @returns Annotation path based on received params
917
- */
918
- exports.createAnnotationPath = (entityTypeName, term, qualifier) => {
919
- let annotationPath = `/${entityTypeName}/@${term}`;
920
- if (qualifier) {
921
- annotationPath += `#${qualifier}`;
922
- }
923
- return annotationPath;
924
- };
925
1061
  //# sourceMappingURL=utils.js.map