@sap/ux-specification 1.71.66 → 1.71.67

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 (474) hide show
  1. package/dist/documentation/runDocu-min.js +5 -9623
  2. package/dist/documentation/runDocu-min.js.map +1 -1
  3. package/dist/documentation/v2/v2-AnalyticalListPage.html +1 -1
  4. package/dist/documentation/v2/v2-ApplicationV2.html +1 -1
  5. package/dist/documentation/v2/v2-ListReport.html +1 -1
  6. package/dist/documentation/v2/v2-ObjectPage.html +1 -1
  7. package/dist/documentation/v2/v2-OverviewPage.html +1 -1
  8. package/dist/index-min.js +83 -24668
  9. package/dist/index-min.js.map +3 -3
  10. package/dist/schemas/v2/ListReportConfig.json +83 -83
  11. package/dist/scripts/extractDocu.d.ts +2 -0
  12. package/dist/scripts/extractDocu.d.ts.map +1 -0
  13. package/dist/scripts/extractDocu.js +494 -0
  14. package/dist/scripts/extractDocu.js.map +1 -0
  15. package/dist/scripts/runDocu.d.ts +2 -0
  16. package/dist/scripts/runDocu.d.ts.map +1 -0
  17. package/dist/scripts/runDocu.js +579 -0
  18. package/dist/scripts/runDocu.js.map +1 -0
  19. package/dist/scripts/spec.d.ts +2 -0
  20. package/dist/scripts/spec.d.ts.map +1 -0
  21. package/dist/scripts/spec.js +114 -0
  22. package/dist/scripts/spec.js.map +1 -0
  23. package/dist/scripts/to-json-schema.d.ts +11 -0
  24. package/dist/scripts/to-json-schema.d.ts.map +1 -0
  25. package/dist/scripts/to-json-schema.js +120 -0
  26. package/dist/scripts/to-json-schema.js.map +1 -0
  27. package/dist/{types → src}/api.d.ts +1 -1
  28. package/dist/{types → src}/api.d.ts.map +1 -1
  29. package/dist/src/api.js +122 -0
  30. package/dist/src/api.js.map +1 -0
  31. package/dist/{types → src}/apiTypes.d.ts +9 -12
  32. package/dist/src/apiTypes.d.ts.map +1 -0
  33. package/dist/src/apiTypes.js +3 -0
  34. package/dist/src/apiTypes.js.map +1 -0
  35. package/dist/{types → src}/extensionLogger.d.ts +0 -0
  36. package/dist/{types → src}/extensionLogger.d.ts.map +0 -0
  37. package/dist/src/extensionLogger.js +34 -0
  38. package/dist/src/extensionLogger.js.map +1 -0
  39. package/dist/{types → src}/i18n/i18n.d.ts +0 -0
  40. package/dist/{types → src}/i18n/i18n.d.ts.map +0 -0
  41. package/dist/src/i18n/i18n.js +25 -0
  42. package/dist/src/i18n/i18n.js.map +1 -0
  43. package/dist/{types → src}/index.d.ts +2 -2
  44. package/dist/src/index.d.ts.map +1 -0
  45. package/dist/src/index.js +12 -0
  46. package/dist/src/index.js.map +1 -0
  47. package/dist/{types → src}/project.d.ts +2 -1
  48. package/dist/src/project.d.ts.map +1 -0
  49. package/dist/src/project.js +149 -0
  50. package/dist/src/project.js.map +1 -0
  51. package/dist/{types → src}/specification/schemaAccess.d.ts +2 -11
  52. package/dist/src/specification/schemaAccess.d.ts.map +1 -0
  53. package/dist/src/specification/schemaAccess.js +60 -0
  54. package/dist/src/specification/schemaAccess.js.map +1 -0
  55. package/dist/{types → src}/sync/common/appProvider.d.ts +4 -5
  56. package/dist/src/sync/common/appProvider.d.ts.map +1 -0
  57. package/dist/src/sync/common/appProvider.js +59 -0
  58. package/dist/src/sync/common/appProvider.js.map +1 -0
  59. package/dist/{types → src}/sync/common/decoration/control.d.ts +0 -0
  60. package/dist/{types → src}/sync/common/decoration/control.d.ts.map +0 -0
  61. package/dist/src/sync/common/decoration/control.js +211 -0
  62. package/dist/src/sync/common/decoration/control.js.map +1 -0
  63. package/dist/{types → src}/sync/common/decoration/decorators.d.ts +0 -0
  64. package/dist/{types → src}/sync/common/decoration/decorators.d.ts.map +0 -0
  65. package/dist/src/sync/common/decoration/decorators.js +45 -0
  66. package/dist/src/sync/common/decoration/decorators.js.map +1 -0
  67. package/dist/{types → src}/sync/common/decoration/factory.d.ts +1 -1
  68. package/dist/{types → src}/sync/common/decoration/factory.d.ts.map +1 -1
  69. package/dist/src/sync/common/decoration/factory.js +48 -0
  70. package/dist/src/sync/common/decoration/factory.js.map +1 -0
  71. package/dist/{types → src}/sync/common/decoration/flex.d.ts +1 -3
  72. package/dist/{types → src}/sync/common/decoration/flex.d.ts.map +1 -1
  73. package/dist/src/sync/common/decoration/flex.js +8 -0
  74. package/dist/src/sync/common/decoration/flex.js.map +1 -0
  75. package/dist/{types → src}/sync/common/decoration/index.d.ts +0 -0
  76. package/dist/{types → src}/sync/common/decoration/index.d.ts.map +0 -0
  77. package/dist/src/sync/common/decoration/index.js +9 -0
  78. package/dist/src/sync/common/decoration/index.js.map +1 -0
  79. package/dist/{types → src}/sync/common/flexUtils.d.ts +2 -3
  80. package/dist/src/sync/common/flexUtils.d.ts.map +1 -0
  81. package/dist/src/sync/common/flexUtils.js +94 -0
  82. package/dist/src/sync/common/flexUtils.js.map +1 -0
  83. package/dist/{types → src}/sync/common/generate/index.d.ts +0 -0
  84. package/dist/{types → src}/sync/common/generate/index.d.ts.map +0 -0
  85. package/dist/src/sync/common/generate/index.js +8 -0
  86. package/dist/src/sync/common/generate/index.js.map +1 -0
  87. package/dist/{types → src}/sync/common/generate/objectPage.d.ts +1 -2
  88. package/dist/src/sync/common/generate/objectPage.d.ts.map +1 -0
  89. package/dist/src/sync/common/generate/objectPage.js +355 -0
  90. package/dist/src/sync/common/generate/objectPage.js.map +1 -0
  91. package/dist/{types → src}/sync/common/generate/utils.d.ts +2 -1
  92. package/dist/src/sync/common/generate/utils.d.ts.map +1 -0
  93. package/dist/src/sync/common/generate/utils.js +382 -0
  94. package/dist/src/sync/common/generate/utils.js.map +1 -0
  95. package/dist/src/sync/common/i18n.json +21 -0
  96. package/dist/{types → src}/sync/common/import/utils.d.ts +0 -0
  97. package/dist/{types → src}/sync/common/import/utils.d.ts.map +0 -0
  98. package/dist/src/sync/common/import/utils.js +92 -0
  99. package/dist/src/sync/common/import/utils.js.map +1 -0
  100. package/dist/{types → src}/sync/common/importProject.d.ts +0 -0
  101. package/dist/{types → src}/sync/common/importProject.d.ts.map +1 -1
  102. package/dist/src/sync/common/importProject.js +254 -0
  103. package/dist/src/sync/common/importProject.js.map +1 -0
  104. package/dist/{types → src}/sync/common/index.d.ts +0 -0
  105. package/dist/{types → src}/sync/common/index.d.ts.map +0 -0
  106. package/dist/src/sync/common/index.js +15 -0
  107. package/dist/src/sync/common/index.js.map +1 -0
  108. package/dist/{types → src}/sync/common/types.d.ts +5 -55
  109. package/dist/src/sync/common/types.d.ts.map +1 -0
  110. package/dist/src/sync/common/types.js +165 -0
  111. package/dist/src/sync/common/types.js.map +1 -0
  112. package/dist/{types → src}/sync/common/utils.d.ts +7 -8
  113. package/dist/src/sync/common/utils.d.ts.map +1 -0
  114. package/dist/src/sync/common/utils.js +1066 -0
  115. package/dist/src/sync/common/utils.js.map +1 -0
  116. package/dist/{types → src}/sync/i18n.d.ts +0 -0
  117. package/dist/{types → src}/sync/i18n.d.ts.map +0 -0
  118. package/dist/src/sync/i18n.js +15 -0
  119. package/dist/src/sync/i18n.js.map +1 -0
  120. package/dist/{types → src}/sync/v2/application.d.ts +6 -6
  121. package/dist/src/sync/v2/application.d.ts.map +1 -0
  122. package/dist/src/sync/v2/application.js +154 -0
  123. package/dist/src/sync/v2/application.js.map +1 -0
  124. package/dist/src/sync/v2/export/controls/Action.d.ts +29 -0
  125. package/dist/src/sync/v2/export/controls/Action.d.ts.map +1 -0
  126. package/dist/src/sync/v2/export/controls/Action.js +127 -0
  127. package/dist/src/sync/v2/export/controls/Action.js.map +1 -0
  128. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts +9 -0
  129. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.d.ts.map +1 -0
  130. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js +62 -0
  131. package/dist/src/sync/v2/export/controls/AnalyticalListPageChart.js.map +1 -0
  132. package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.d.ts +10 -0
  133. package/dist/{types → src}/sync/v2/export/controls/AnalyticalListPageKPI.d.ts.map +1 -1
  134. package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js +56 -0
  135. package/dist/src/sync/v2/export/controls/AnalyticalListPageKPI.js.map +1 -0
  136. package/dist/{types → src}/sync/v2/export/controls/Card.d.ts +30 -30
  137. package/dist/src/sync/v2/export/controls/Card.d.ts.map +1 -0
  138. package/dist/src/sync/v2/export/controls/Card.js +655 -0
  139. package/dist/src/sync/v2/export/controls/Card.js.map +1 -0
  140. package/dist/src/sync/v2/export/controls/Field.d.ts +5 -0
  141. package/dist/src/sync/v2/export/controls/Field.d.ts.map +1 -0
  142. package/dist/src/sync/v2/export/controls/Field.js +41 -0
  143. package/dist/src/sync/v2/export/controls/Field.js.map +1 -0
  144. package/dist/{types → src}/sync/v2/export/controls/FilterBar.d.ts +3 -3
  145. package/dist/src/sync/v2/export/controls/FilterBar.d.ts.map +1 -0
  146. package/dist/src/sync/v2/export/controls/FilterBar.js +107 -0
  147. package/dist/src/sync/v2/export/controls/FilterBar.js.map +1 -0
  148. package/dist/src/sync/v2/export/controls/FormAction.d.ts +16 -0
  149. package/dist/src/sync/v2/export/controls/FormAction.d.ts.map +1 -0
  150. package/dist/src/sync/v2/export/controls/FormAction.js +128 -0
  151. package/dist/src/sync/v2/export/controls/FormAction.js.map +1 -0
  152. package/dist/{types → src}/sync/v2/export/controls/Fragment.d.ts +5 -5
  153. package/dist/src/sync/v2/export/controls/Fragment.d.ts.map +1 -0
  154. package/dist/src/sync/v2/export/controls/Fragment.js +580 -0
  155. package/dist/src/sync/v2/export/controls/Fragment.js.map +1 -0
  156. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.d.ts +18 -0
  157. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.d.ts.map +1 -0
  158. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js +110 -0
  159. package/dist/src/sync/v2/export/controls/ObjectPageCustomSection.js.map +1 -0
  160. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts +9 -0
  161. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.d.ts.map +1 -0
  162. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js +62 -0
  163. package/dist/src/sync/v2/export/controls/ObjectPageFooterAction.js.map +1 -0
  164. package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts +9 -0
  165. package/dist/src/sync/v2/export/controls/ObjectPageHeader.d.ts.map +1 -0
  166. package/dist/src/sync/v2/export/controls/ObjectPageHeader.js +61 -0
  167. package/dist/src/sync/v2/export/controls/ObjectPageHeader.js.map +1 -0
  168. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +9 -0
  169. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.d.ts.map +1 -0
  170. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js +62 -0
  171. package/dist/src/sync/v2/export/controls/ObjectPageHeaderAction.js.map +1 -0
  172. package/dist/src/sync/v2/export/controls/ObjectPageLayout.d.ts +8 -0
  173. package/dist/src/sync/v2/export/controls/ObjectPageLayout.d.ts.map +1 -0
  174. package/dist/src/sync/v2/export/controls/ObjectPageLayout.js +59 -0
  175. package/dist/src/sync/v2/export/controls/ObjectPageLayout.js.map +1 -0
  176. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +45 -0
  177. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.d.ts.map +1 -0
  178. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js +194 -0
  179. package/dist/src/sync/v2/export/controls/ObjectPageSectionsV2.js.map +1 -0
  180. package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts +41 -0
  181. package/dist/src/sync/v2/export/controls/ObjectPageTable.d.ts.map +1 -0
  182. package/dist/src/sync/v2/export/controls/ObjectPageTable.js +278 -0
  183. package/dist/src/sync/v2/export/controls/ObjectPageTable.js.map +1 -0
  184. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +9 -0
  185. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.d.ts.map +1 -0
  186. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js +61 -0
  187. package/dist/src/sync/v2/export/controls/ObjectPageToolBarAction.js.map +1 -0
  188. package/dist/{types → src}/sync/v2/export/controls/Table.d.ts +22 -23
  189. package/dist/src/sync/v2/export/controls/Table.d.ts.map +1 -0
  190. package/dist/src/sync/v2/export/controls/Table.js +593 -0
  191. package/dist/src/sync/v2/export/controls/Table.js.map +1 -0
  192. package/dist/src/sync/v2/export/controls/TableColumn.d.ts +38 -0
  193. package/dist/src/sync/v2/export/controls/TableColumn.d.ts.map +1 -0
  194. package/dist/src/sync/v2/export/controls/TableColumn.js +166 -0
  195. package/dist/src/sync/v2/export/controls/TableColumn.js.map +1 -0
  196. package/dist/src/sync/v2/export/controls/ToolBar.d.ts +5 -0
  197. package/dist/src/sync/v2/export/controls/ToolBar.d.ts.map +1 -0
  198. package/dist/src/sync/v2/export/controls/ToolBar.js +6 -0
  199. package/dist/src/sync/v2/export/controls/ToolBar.js.map +1 -0
  200. package/dist/{types → src}/sync/v2/export/controls/index.d.ts +0 -0
  201. package/dist/{types → src}/sync/v2/export/controls/index.d.ts.map +0 -0
  202. package/dist/src/sync/v2/export/controls/index.js +25 -0
  203. package/dist/src/sync/v2/export/controls/index.js.map +1 -0
  204. package/dist/{types → src}/sync/v2/export/export.d.ts +1 -1
  205. package/dist/{types → src}/sync/v2/export/export.d.ts.map +1 -1
  206. package/dist/src/sync/v2/export/export.js +681 -0
  207. package/dist/src/sync/v2/export/export.js.map +1 -0
  208. package/dist/{types → src}/sync/v2/export/exportPage.d.ts +2 -1
  209. package/dist/src/sync/v2/export/exportPage.d.ts.map +1 -0
  210. package/dist/src/sync/v2/export/exportPage.js +304 -0
  211. package/dist/src/sync/v2/export/exportPage.js.map +1 -0
  212. package/dist/{types → src}/sync/v2/export/factory.d.ts +0 -0
  213. package/dist/{types → src}/sync/v2/export/factory.d.ts.map +1 -1
  214. package/dist/src/sync/v2/export/factory.js +55 -0
  215. package/dist/src/sync/v2/export/factory.js.map +1 -0
  216. package/dist/{types → src}/sync/v2/export/manifest.d.ts +2 -2
  217. package/dist/src/sync/v2/export/manifest.d.ts.map +1 -0
  218. package/dist/src/sync/v2/export/manifest.js +168 -0
  219. package/dist/src/sync/v2/export/manifest.js.map +1 -0
  220. package/dist/src/sync/v2/export/pages/AnalyticalListPage.d.ts +13 -0
  221. package/dist/src/sync/v2/export/pages/AnalyticalListPage.d.ts.map +1 -0
  222. package/dist/src/sync/v2/export/pages/AnalyticalListPage.js +42 -0
  223. package/dist/src/sync/v2/export/pages/AnalyticalListPage.js.map +1 -0
  224. package/dist/src/sync/v2/export/pages/ListReport.d.ts +11 -0
  225. package/dist/src/sync/v2/export/pages/ListReport.d.ts.map +1 -0
  226. package/dist/src/sync/v2/export/pages/ListReport.js +39 -0
  227. package/dist/src/sync/v2/export/pages/ListReport.js.map +1 -0
  228. package/dist/src/sync/v2/export/pages/ObjectPage.d.ts +15 -0
  229. package/dist/src/sync/v2/export/pages/ObjectPage.d.ts.map +1 -0
  230. package/dist/src/sync/v2/export/pages/ObjectPage.js +74 -0
  231. package/dist/src/sync/v2/export/pages/ObjectPage.js.map +1 -0
  232. package/dist/{types → src}/sync/v2/export/pages/OverviewPage.d.ts +3 -3
  233. package/dist/src/sync/v2/export/pages/OverviewPage.d.ts.map +1 -0
  234. package/dist/src/sync/v2/export/pages/OverviewPage.js +118 -0
  235. package/dist/src/sync/v2/export/pages/OverviewPage.js.map +1 -0
  236. package/dist/{types → src}/sync/v2/export/pages/index.d.ts +0 -0
  237. package/dist/{types → src}/sync/v2/export/pages/index.d.ts.map +0 -0
  238. package/dist/src/sync/v2/export/pages/index.js +10 -0
  239. package/dist/src/sync/v2/export/pages/index.js.map +1 -0
  240. package/dist/{types → src}/sync/v2/export/view-controller-generator.d.ts +4 -4
  241. package/dist/src/sync/v2/export/view-controller-generator.d.ts.map +1 -0
  242. package/dist/src/sync/v2/export/view-controller-generator.js +141 -0
  243. package/dist/src/sync/v2/export/view-controller-generator.js.map +1 -0
  244. package/dist/{types → src}/sync/v2/generate/analyticalListReport.d.ts +1 -1
  245. package/dist/src/sync/v2/generate/analyticalListReport.d.ts.map +1 -0
  246. package/dist/src/sync/v2/generate/analyticalListReport.js +84 -0
  247. package/dist/src/sync/v2/generate/analyticalListReport.js.map +1 -0
  248. package/dist/{types → src}/sync/v2/generate/generate.d.ts +1 -1
  249. package/dist/src/sync/v2/generate/generate.d.ts.map +1 -0
  250. package/dist/src/sync/v2/generate/generate.js +99 -0
  251. package/dist/src/sync/v2/generate/generate.js.map +1 -0
  252. package/dist/{types → src}/sync/v2/generate/index.d.ts +0 -0
  253. package/dist/{types → src}/sync/v2/generate/index.d.ts.map +0 -0
  254. package/dist/src/sync/v2/generate/index.js +14 -0
  255. package/dist/src/sync/v2/generate/index.js.map +1 -0
  256. package/dist/{types → src}/sync/v2/generate/listReport.d.ts +1 -1
  257. package/dist/src/sync/v2/generate/listReport.d.ts.map +1 -0
  258. package/dist/src/sync/v2/generate/listReport.js +116 -0
  259. package/dist/src/sync/v2/generate/listReport.js.map +1 -0
  260. package/dist/{types → src}/sync/v2/generate/objectPage.d.ts +1 -1
  261. package/dist/src/sync/v2/generate/objectPage.d.ts.map +1 -0
  262. package/dist/src/sync/v2/generate/objectPage.js +537 -0
  263. package/dist/src/sync/v2/generate/objectPage.js.map +1 -0
  264. package/dist/{types → src}/sync/v2/generate/overviewPage.d.ts +1 -1
  265. package/dist/{types → src}/sync/v2/generate/overviewPage.d.ts.map +1 -1
  266. package/dist/src/sync/v2/generate/overviewPage.js +70 -0
  267. package/dist/src/sync/v2/generate/overviewPage.js.map +1 -0
  268. package/dist/{types → src}/sync/v2/generate/utils.d.ts +3 -4
  269. package/dist/src/sync/v2/generate/utils.d.ts.map +1 -0
  270. package/dist/src/sync/v2/generate/utils.js +527 -0
  271. package/dist/src/sync/v2/generate/utils.js.map +1 -0
  272. package/dist/{types → src}/sync/v2/import/app/appProvider.d.ts +4 -4
  273. package/dist/src/sync/v2/import/app/appProvider.d.ts.map +1 -0
  274. package/dist/src/sync/v2/import/app/appProvider.js +136 -0
  275. package/dist/src/sync/v2/import/app/appProvider.js.map +1 -0
  276. package/dist/{types → src}/sync/v2/import/app/ovpProvider.d.ts +1 -1
  277. package/dist/src/sync/v2/import/app/ovpProvider.d.ts.map +1 -0
  278. package/dist/src/sync/v2/import/app/ovpProvider.js +32 -0
  279. package/dist/src/sync/v2/import/app/ovpProvider.js.map +1 -0
  280. package/dist/{types → src}/sync/v2/import/common/index.d.ts +6 -9
  281. package/dist/src/sync/v2/import/common/index.d.ts.map +1 -0
  282. package/dist/src/sync/v2/import/common/index.js +393 -0
  283. package/dist/src/sync/v2/import/common/index.js.map +1 -0
  284. package/dist/{types → src}/sync/v2/import/controls/table.d.ts +2 -2
  285. package/dist/src/sync/v2/import/controls/table.d.ts.map +1 -0
  286. package/dist/src/sync/v2/import/controls/table.js +33 -0
  287. package/dist/src/sync/v2/import/controls/table.js.map +1 -0
  288. package/dist/{types → src}/sync/v2/import/getPageType.d.ts +0 -0
  289. package/dist/{types → src}/sync/v2/import/getPageType.d.ts.map +0 -0
  290. package/dist/src/sync/v2/import/getPageType.js +1 -0
  291. package/dist/src/sync/v2/import/getPageType.js.map +1 -0
  292. package/dist/{types → src}/sync/v2/import/index.d.ts +0 -0
  293. package/dist/{types → src}/sync/v2/import/index.d.ts.map +0 -0
  294. package/dist/src/sync/v2/import/index.js +11 -0
  295. package/dist/src/sync/v2/import/index.js.map +1 -0
  296. package/dist/{types → src}/sync/v2/import/pages/analyticalListPage.d.ts +2 -2
  297. package/dist/src/sync/v2/import/pages/analyticalListPage.d.ts.map +1 -0
  298. package/dist/src/sync/v2/import/pages/analyticalListPage.js +119 -0
  299. package/dist/src/sync/v2/import/pages/analyticalListPage.js.map +1 -0
  300. package/dist/{types → src}/sync/v2/import/pages/listReport.d.ts +2 -2
  301. package/dist/src/sync/v2/import/pages/listReport.d.ts.map +1 -0
  302. package/dist/src/sync/v2/import/pages/listReport.js +143 -0
  303. package/dist/src/sync/v2/import/pages/listReport.js.map +1 -0
  304. package/dist/{types → src}/sync/v2/import/pages/objectPage.d.ts +3 -2
  305. package/dist/src/sync/v2/import/pages/objectPage.d.ts.map +1 -0
  306. package/dist/src/sync/v2/import/pages/objectPage.js +744 -0
  307. package/dist/src/sync/v2/import/pages/objectPage.js.map +1 -0
  308. package/dist/{types → src}/sync/v2/import/pages/overviewPage.d.ts +2 -3
  309. package/dist/src/sync/v2/import/pages/overviewPage.d.ts.map +1 -0
  310. package/dist/src/sync/v2/import/pages/overviewPage.js +104 -0
  311. package/dist/src/sync/v2/import/pages/overviewPage.js.map +1 -0
  312. package/dist/{types → src}/sync/v2/import/utils.d.ts +5 -5
  313. package/dist/src/sync/v2/import/utils.d.ts.map +1 -0
  314. package/dist/src/sync/v2/import/utils.js +171 -0
  315. package/dist/src/sync/v2/import/utils.js.map +1 -0
  316. package/dist/{types → src}/sync/v2/types.d.ts +5 -6
  317. package/dist/src/sync/v2/types.d.ts.map +1 -0
  318. package/dist/src/sync/v2/types.js +36 -0
  319. package/dist/src/sync/v2/types.js.map +1 -0
  320. package/dist/{types → src}/sync/v4/utils/StableIdHelper.d.ts +0 -0
  321. package/dist/{types → src}/sync/v4/utils/StableIdHelper.d.ts.map +0 -0
  322. package/dist/src/sync/v4/utils/StableIdHelper.js +156 -0
  323. package/dist/src/sync/v4/utils/StableIdHelper.js.map +1 -0
  324. package/package.json +9 -9
  325. package/CHANGELOG.md +0 -1079
  326. package/dist/types/apiTypes.d.ts.map +0 -1
  327. package/dist/types/index.d.ts.map +0 -1
  328. package/dist/types/project.d.ts.map +0 -1
  329. package/dist/types/specification/common/Application.d.ts +0 -16
  330. package/dist/types/specification/common/Application.d.ts.map +0 -1
  331. package/dist/types/specification/common/index.d.ts +0 -6
  332. package/dist/types/specification/common/index.d.ts.map +0 -1
  333. package/dist/types/specification/common/page.d.ts +0 -42
  334. package/dist/types/specification/common/page.d.ts.map +0 -1
  335. package/dist/types/specification/common/types.d.ts +0 -21
  336. package/dist/types/specification/common/types.d.ts.map +0 -1
  337. package/dist/types/specification/common/webapp/manifest/Manifest.d.ts +0 -49
  338. package/dist/types/specification/common/webapp/manifest/Manifest.d.ts.map +0 -1
  339. package/dist/types/specification/common/webapp/manifest/index.d.ts +0 -4
  340. package/dist/types/specification/common/webapp/manifest/index.d.ts.map +0 -1
  341. package/dist/types/specification/common/webapp/manifest/sapOvp.d.ts +0 -376
  342. package/dist/types/specification/common/webapp/manifest/sapOvp.d.ts.map +0 -1
  343. package/dist/types/specification/common/webapp/manifest/sapUi5.d.ts +0 -34
  344. package/dist/types/specification/common/webapp/manifest/sapUi5.d.ts.map +0 -1
  345. package/dist/types/specification/schemaAccess.d.ts.map +0 -1
  346. package/dist/types/specification/v2/ApplicationV2.d.ts +0 -31
  347. package/dist/types/specification/v2/ApplicationV2.d.ts.map +0 -1
  348. package/dist/types/specification/v2/controls/Action.d.ts +0 -83
  349. package/dist/types/specification/v2/controls/Action.d.ts.map +0 -1
  350. package/dist/types/specification/v2/controls/AnalyticalListPageChart.d.ts +0 -55
  351. package/dist/types/specification/v2/controls/AnalyticalListPageChart.d.ts.map +0 -1
  352. package/dist/types/specification/v2/controls/AnalyticalListPageKPI.d.ts +0 -31
  353. package/dist/types/specification/v2/controls/AnalyticalListPageKPI.d.ts.map +0 -1
  354. package/dist/types/specification/v2/controls/Card.d.ts +0 -626
  355. package/dist/types/specification/v2/controls/Card.d.ts.map +0 -1
  356. package/dist/types/specification/v2/controls/Facets.d.ts +0 -18
  357. package/dist/types/specification/v2/controls/Facets.d.ts.map +0 -1
  358. package/dist/types/specification/v2/controls/Field.d.ts +0 -11
  359. package/dist/types/specification/v2/controls/Field.d.ts.map +0 -1
  360. package/dist/types/specification/v2/controls/FilterBar.d.ts +0 -81
  361. package/dist/types/specification/v2/controls/FilterBar.d.ts.map +0 -1
  362. package/dist/types/specification/v2/controls/Footer.d.ts +0 -21
  363. package/dist/types/specification/v2/controls/Footer.d.ts.map +0 -1
  364. package/dist/types/specification/v2/controls/ObjectPageChart.d.ts +0 -17
  365. package/dist/types/specification/v2/controls/ObjectPageChart.d.ts.map +0 -1
  366. package/dist/types/specification/v2/controls/ObjectPageForm.d.ts +0 -16
  367. package/dist/types/specification/v2/controls/ObjectPageForm.d.ts.map +0 -1
  368. package/dist/types/specification/v2/controls/ObjectPageHeader.d.ts +0 -35
  369. package/dist/types/specification/v2/controls/ObjectPageHeader.d.ts.map +0 -1
  370. package/dist/types/specification/v2/controls/ObjectPageLayout.d.ts +0 -23
  371. package/dist/types/specification/v2/controls/ObjectPageLayout.d.ts.map +0 -1
  372. package/dist/types/specification/v2/controls/ObjectPageSection.d.ts +0 -121
  373. package/dist/types/specification/v2/controls/ObjectPageSection.d.ts.map +0 -1
  374. package/dist/types/specification/v2/controls/ObjectPageTable.d.ts +0 -131
  375. package/dist/types/specification/v2/controls/ObjectPageTable.d.ts.map +0 -1
  376. package/dist/types/specification/v2/controls/ObjectPageToolBar.d.ts +0 -16
  377. package/dist/types/specification/v2/controls/ObjectPageToolBar.d.ts.map +0 -1
  378. package/dist/types/specification/v2/controls/Table.d.ts +0 -402
  379. package/dist/types/specification/v2/controls/Table.d.ts.map +0 -1
  380. package/dist/types/specification/v2/controls/ToolBar.d.ts +0 -9
  381. package/dist/types/specification/v2/controls/ToolBar.d.ts.map +0 -1
  382. package/dist/types/specification/v2/controls/index.d.ts +0 -18
  383. package/dist/types/specification/v2/controls/index.d.ts.map +0 -1
  384. package/dist/types/specification/v2/index.d.ts +0 -6
  385. package/dist/types/specification/v2/index.d.ts.map +0 -1
  386. package/dist/types/specification/v2/page.d.ts +0 -8
  387. package/dist/types/specification/v2/page.d.ts.map +0 -1
  388. package/dist/types/specification/v2/pages/AnalyticalListPageConfig.d.ts +0 -22
  389. package/dist/types/specification/v2/pages/AnalyticalListPageConfig.d.ts.map +0 -1
  390. package/dist/types/specification/v2/pages/ListReportConfig.d.ts +0 -13
  391. package/dist/types/specification/v2/pages/ListReportConfig.d.ts.map +0 -1
  392. package/dist/types/specification/v2/pages/ObjectPageConfig.d.ts +0 -25
  393. package/dist/types/specification/v2/pages/ObjectPageConfig.d.ts.map +0 -1
  394. package/dist/types/specification/v2/pages/OverviewPageConfig.d.ts +0 -83
  395. package/dist/types/specification/v2/pages/OverviewPageConfig.d.ts.map +0 -1
  396. package/dist/types/specification/v2/pages/index.d.ts +0 -5
  397. package/dist/types/specification/v2/pages/index.d.ts.map +0 -1
  398. package/dist/types/specification/v2/webapp/index.d.ts +0 -2
  399. package/dist/types/specification/v2/webapp/index.d.ts.map +0 -1
  400. package/dist/types/specification/v2/webapp/manifest/index.d.ts +0 -3
  401. package/dist/types/specification/v2/webapp/manifest/index.d.ts.map +0 -1
  402. package/dist/types/specification/v2/webapp/manifest/sapUi.d.ts +0 -11
  403. package/dist/types/specification/v2/webapp/manifest/sapUi.d.ts.map +0 -1
  404. package/dist/types/specification/v2/webapp/manifest/sapUi5.d.ts +0 -99
  405. package/dist/types/specification/v2/webapp/manifest/sapUi5.d.ts.map +0 -1
  406. package/dist/types/specification/v2/webapp/manifest/sapUiPageV2.d.ts +0 -32
  407. package/dist/types/specification/v2/webapp/manifest/sapUiPageV2.d.ts.map +0 -1
  408. package/dist/types/sync/common/appProvider.d.ts.map +0 -1
  409. package/dist/types/sync/common/flexUtils.d.ts.map +0 -1
  410. package/dist/types/sync/common/generate/objectPage.d.ts.map +0 -1
  411. package/dist/types/sync/common/generate/utils.d.ts.map +0 -1
  412. package/dist/types/sync/common/types.d.ts.map +0 -1
  413. package/dist/types/sync/common/utils.d.ts.map +0 -1
  414. package/dist/types/sync/v2/application.d.ts.map +0 -1
  415. package/dist/types/sync/v2/export/controls/Action.d.ts +0 -29
  416. package/dist/types/sync/v2/export/controls/Action.d.ts.map +0 -1
  417. package/dist/types/sync/v2/export/controls/AnalyticalListPageChart.d.ts +0 -9
  418. package/dist/types/sync/v2/export/controls/AnalyticalListPageChart.d.ts.map +0 -1
  419. package/dist/types/sync/v2/export/controls/AnalyticalListPageKPI.d.ts +0 -10
  420. package/dist/types/sync/v2/export/controls/Card.d.ts.map +0 -1
  421. package/dist/types/sync/v2/export/controls/Field.d.ts +0 -5
  422. package/dist/types/sync/v2/export/controls/Field.d.ts.map +0 -1
  423. package/dist/types/sync/v2/export/controls/FilterBar.d.ts.map +0 -1
  424. package/dist/types/sync/v2/export/controls/FormAction.d.ts +0 -16
  425. package/dist/types/sync/v2/export/controls/FormAction.d.ts.map +0 -1
  426. package/dist/types/sync/v2/export/controls/Fragment.d.ts.map +0 -1
  427. package/dist/types/sync/v2/export/controls/ObjectPageCustomSection.d.ts +0 -20
  428. package/dist/types/sync/v2/export/controls/ObjectPageCustomSection.d.ts.map +0 -1
  429. package/dist/types/sync/v2/export/controls/ObjectPageFooterAction.d.ts +0 -9
  430. package/dist/types/sync/v2/export/controls/ObjectPageFooterAction.d.ts.map +0 -1
  431. package/dist/types/sync/v2/export/controls/ObjectPageHeader.d.ts +0 -9
  432. package/dist/types/sync/v2/export/controls/ObjectPageHeader.d.ts.map +0 -1
  433. package/dist/types/sync/v2/export/controls/ObjectPageHeaderAction.d.ts +0 -9
  434. package/dist/types/sync/v2/export/controls/ObjectPageHeaderAction.d.ts.map +0 -1
  435. package/dist/types/sync/v2/export/controls/ObjectPageLayout.d.ts +0 -8
  436. package/dist/types/sync/v2/export/controls/ObjectPageLayout.d.ts.map +0 -1
  437. package/dist/types/sync/v2/export/controls/ObjectPageSectionsV2.d.ts +0 -45
  438. package/dist/types/sync/v2/export/controls/ObjectPageSectionsV2.d.ts.map +0 -1
  439. package/dist/types/sync/v2/export/controls/ObjectPageTable.d.ts +0 -43
  440. package/dist/types/sync/v2/export/controls/ObjectPageTable.d.ts.map +0 -1
  441. package/dist/types/sync/v2/export/controls/ObjectPageToolBarAction.d.ts +0 -9
  442. package/dist/types/sync/v2/export/controls/ObjectPageToolBarAction.d.ts.map +0 -1
  443. package/dist/types/sync/v2/export/controls/Table.d.ts.map +0 -1
  444. package/dist/types/sync/v2/export/controls/TableColumn.d.ts +0 -39
  445. package/dist/types/sync/v2/export/controls/TableColumn.d.ts.map +0 -1
  446. package/dist/types/sync/v2/export/controls/ToolBar.d.ts +0 -5
  447. package/dist/types/sync/v2/export/controls/ToolBar.d.ts.map +0 -1
  448. package/dist/types/sync/v2/export/exportPage.d.ts.map +0 -1
  449. package/dist/types/sync/v2/export/manifest.d.ts.map +0 -1
  450. package/dist/types/sync/v2/export/pages/AnalyticalListPage.d.ts +0 -15
  451. package/dist/types/sync/v2/export/pages/AnalyticalListPage.d.ts.map +0 -1
  452. package/dist/types/sync/v2/export/pages/ListReport.d.ts +0 -11
  453. package/dist/types/sync/v2/export/pages/ListReport.d.ts.map +0 -1
  454. package/dist/types/sync/v2/export/pages/ObjectPage.d.ts +0 -16
  455. package/dist/types/sync/v2/export/pages/ObjectPage.d.ts.map +0 -1
  456. package/dist/types/sync/v2/export/pages/OverviewPage.d.ts.map +0 -1
  457. package/dist/types/sync/v2/export/view-controller-generator.d.ts.map +0 -1
  458. package/dist/types/sync/v2/generate/analyticalListReport.d.ts.map +0 -1
  459. package/dist/types/sync/v2/generate/generate.d.ts.map +0 -1
  460. package/dist/types/sync/v2/generate/listReport.d.ts.map +0 -1
  461. package/dist/types/sync/v2/generate/objectPage.d.ts.map +0 -1
  462. package/dist/types/sync/v2/generate/utils.d.ts.map +0 -1
  463. package/dist/types/sync/v2/import/app/appProvider.d.ts.map +0 -1
  464. package/dist/types/sync/v2/import/app/ovpProvider.d.ts.map +0 -1
  465. package/dist/types/sync/v2/import/common/index.d.ts.map +0 -1
  466. package/dist/types/sync/v2/import/controls/table.d.ts.map +0 -1
  467. package/dist/types/sync/v2/import/pages/analyticalListPage.d.ts.map +0 -1
  468. package/dist/types/sync/v2/import/pages/listReport.d.ts.map +0 -1
  469. package/dist/types/sync/v2/import/pages/objectPage.d.ts.map +0 -1
  470. package/dist/types/sync/v2/import/pages/overviewPage.d.ts.map +0 -1
  471. package/dist/types/sync/v2/import/utils.d.ts.map +0 -1
  472. package/dist/types/sync/v2/types.d.ts.map +0 -1
  473. package/dist/types/v2.d.ts +0 -3
  474. package/dist/types/v2.d.ts.map +0 -1
@@ -0,0 +1,1066 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const ux_specification_types_1 = require("@sap/ux-specification-types");
7
+ const i18next_1 = __importDefault(require("i18next"));
8
+ const deepmerge_1 = __importDefault(require("deepmerge"));
9
+ const types_1 = require("./types");
10
+ const annotation_converter_1 = require("@sap-ux/annotation-converter");
11
+ const edmx_parser_1 = require("@sap-ux/edmx-parser");
12
+ const extensionLogger_1 = require("../../extensionLogger");
13
+ var TemplateType;
14
+ (function (TemplateType) {
15
+ TemplateType["ListReportObjectPageV2"] = "ListReportObjectPageV2";
16
+ TemplateType["ListReportObjectPageV4"] = "ListReportObjectPageV4";
17
+ TemplateType["OverviewPageV2"] = "OverviewPageV2";
18
+ TemplateType["AnalyticalListPageV2"] = "AnalyticalListPageV2";
19
+ })(TemplateType = exports.TemplateType || (exports.TemplateType = {}));
20
+ exports.DEFINITION_LINK_PREFIX = '#/definitions/';
21
+ function prepareRef(refInput) {
22
+ return refInput.replace('#', '::').replace(/\//g, ':2f');
23
+ }
24
+ exports.prepareRef = prepareRef;
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
+ };
39
+ /**
40
+ * Parses, merges, and converts a list of annotation files with aid of tools from annotation-vocabularies-tools
41
+ * @param annotationFiles - The list of all annotation files, in JSON format
42
+ * @returns the complete service information
43
+ */
44
+ function parseAndMergeAndConvert(annotationFiles, logger) {
45
+ const parseResult = [];
46
+ let converterOutput;
47
+ try {
48
+ if (annotationFiles) {
49
+ annotationFiles.forEach(function (annotationData) {
50
+ parseResult.push(edmx_parser_1.parse(annotationData.fileContent, annotationData.dataSourceUri));
51
+ });
52
+ }
53
+ if (parseResult.length > 0) {
54
+ converterOutput = annotation_converter_1.convert(edmx_parser_1.merge(...parseResult));
55
+ }
56
+ if (logger && (converterOutput === null || converterOutput === void 0 ? void 0 : converterOutput.diagnostics)) {
57
+ for (const converterMessage of converterOutput.diagnostics) {
58
+ extensionLogger_1.log(logger, {
59
+ severity: "error" /* Error */,
60
+ message: converterMessage.message
61
+ });
62
+ }
63
+ }
64
+ }
65
+ catch (error) {
66
+ extensionLogger_1.log(logger, {
67
+ severity: "error" /* Error */,
68
+ message: i18next_1.default.t('ANNOERR')
69
+ }, ...error);
70
+ }
71
+ return converterOutput;
72
+ }
73
+ exports.parseAndMergeAndConvert = parseAndMergeAndConvert;
74
+ exports.getAnnotationPropertyValue = (annotationProperty) => (annotationProperty === null || annotationProperty === void 0 ? void 0 : annotationProperty.value) || (annotationProperty === null || annotationProperty === void 0 ? void 0 : annotationProperty.path);
75
+ /**
76
+ * Checks for Common.Label and overwrites the label from it if present
77
+ * @param {PropertyAnnotations} annotations - property annotations
78
+ * @param {EntityType} entityType - entity type
79
+ * @param {string} label - label, to be actualized
80
+ */
81
+ function evaluateCommonLabel(annotations, entityType, label) {
82
+ var _a, _b, _c, _d;
83
+ if ((_a = annotations === null || annotations === void 0 ? void 0 : annotations.Common) === null || _a === void 0 ? void 0 : _a.Label) {
84
+ if (typeof annotations.Common.Label === 'string') {
85
+ label = annotations.Common.Label;
86
+ }
87
+ else if (annotations.Common.Label['type'] === 'Path') {
88
+ const targetProperty = entityType.resolvePath(annotations.Common.Label['path']);
89
+ if (targetProperty.value) {
90
+ label = targetProperty.value;
91
+ }
92
+ else if (typeof ((_b = targetProperty.Common) === null || _b === void 0 ? void 0 : _b.Label) === 'string') {
93
+ label = targetProperty.annotations.Common.Label;
94
+ }
95
+ }
96
+ else if (typeof ((_d = (_c = annotations.Common) === null || _c === void 0 ? void 0 : _c.Label) === null || _d === void 0 ? void 0 : _d.toString()) === 'string') {
97
+ label = annotations.Common.Label.toString();
98
+ }
99
+ }
100
+ return label;
101
+ }
102
+ exports.evaluateCommonLabel = evaluateCommonLabel;
103
+ /**
104
+ * Determines the label for a property path
105
+ * @param {PropertyPath} propertyPath - property path
106
+ * @param {EntityType} entityType - entity type
107
+ * @returns label, derived from Common.Label or from property value
108
+ */
109
+ function getLabelForPropertyPath(propertyPath, entityType) {
110
+ let label = propertyPath.value;
111
+ if (propertyPath.$target) {
112
+ label = evaluateCommonLabel(propertyPath.$target.annotations, entityType, label);
113
+ }
114
+ return label;
115
+ }
116
+ exports.getLabelForPropertyPath = getLabelForPropertyPath;
117
+ /**
118
+ * Determines the label for a LineItem record
119
+ * @param {DataFieldAbstractType} field - Line item record
120
+ * @param {EntityType} entityType - entity type
121
+ * @returns label, derived from Common.Label or from property value
122
+ */
123
+ function getLabelForDataField(field, entityType) {
124
+ var _a, _b;
125
+ let label, property;
126
+ if (field['Value']) {
127
+ if (typeof field['Value'] === 'string') {
128
+ property = entityType.entityProperties.find((ep) => ep.name === field['Value']);
129
+ }
130
+ else {
131
+ property = entityType.resolvePath(field['Value'].path);
132
+ if (!property) {
133
+ property = field['Value'].$target;
134
+ }
135
+ }
136
+ }
137
+ else if (field['Target'] && field['Target'].$target && field['Target'].$target.Value) {
138
+ property = field['Target'].$target.Value.$target;
139
+ }
140
+ 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) {
141
+ label = evaluateCommonLabel(property.annotations, entityType, label);
142
+ }
143
+ return label;
144
+ }
145
+ exports.getLabelForDataField = getLabelForDataField;
146
+ /**
147
+ * Function to resolve the dataField label
148
+ * @param dataFieldLabel - Given dataField label; might be of type string, or an object in case of a path reference
149
+ * @param entityType - the entity type as part of the AVT ConvertedMetadata
150
+ * @returns undefined or the right string value
151
+ */
152
+ function getLabel(dataFieldLabel, entityType) {
153
+ var _a, _b;
154
+ if (typeof dataFieldLabel === 'string') {
155
+ return dataFieldLabel;
156
+ }
157
+ else if (typeof dataFieldLabel === 'object' && dataFieldLabel.path) {
158
+ const property = entityType.resolvePath(dataFieldLabel.path);
159
+ if (!property || property.length === 0) {
160
+ return undefined;
161
+ }
162
+ else {
163
+ const singleProperty = property[0];
164
+ 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) {
165
+ const label = dataFieldLabel;
166
+ return evaluateCommonLabel(singleProperty.annotations, entityType, label);
167
+ }
168
+ }
169
+ }
170
+ else {
171
+ return undefined;
172
+ }
173
+ }
174
+ function getTitleForDataField(dataField, entityType, dataFieldLabel) {
175
+ const propertyCommonLabel = getLabelForDataField(dataField, entityType);
176
+ return (dataFieldLabel ||
177
+ propertyCommonLabel ||
178
+ (dataField.Value.$target ? dataField.Value.$target.name : dataField.Value.value || dataField.Value.path));
179
+ }
180
+ /**
181
+ * Determines the description of a data field, e.g. for the column header
182
+ * @param dataFieldAbstract - the given record of the line item annotation
183
+ * @param entityType - the entity type as part of the AVT ConvertedMetadata
184
+ */
185
+ function getDatafieldDescription(dataFieldAbstract, entityType) {
186
+ let title = '', propertyCommonLabel, dataField;
187
+ const dataFieldLabel = getLabel(dataFieldAbstract.Label, entityType);
188
+ switch (dataFieldAbstract.$Type) {
189
+ case "com.sap.vocabularies.UI.v1.DataField" /* DataField */:
190
+ dataField = dataFieldAbstract;
191
+ title = getTitleForDataField(dataField, entityType, dataFieldLabel);
192
+ break;
193
+ case "com.sap.vocabularies.UI.v1.DataFieldWithUrl" /* DataFieldWithUrl */:
194
+ dataField = dataFieldAbstract;
195
+ propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
196
+ title =
197
+ dataFieldLabel ||
198
+ propertyCommonLabel ||
199
+ (typeof dataField.Value === 'string' ? dataField.Value : dataField.Value.path);
200
+ break;
201
+ case "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* DataFieldForAnnotation */:
202
+ dataField = dataFieldAbstract;
203
+ propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
204
+ title = dataFieldLabel || propertyCommonLabel || dataField.Target.$target.Title || dataField.Target.value;
205
+ break;
206
+ case "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */:
207
+ case "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* DataFieldForIntentBasedNavigation */:
208
+ dataField = dataFieldAbstract;
209
+ if (dataFieldLabel) {
210
+ title = typeof dataFieldLabel === 'string' ? dataFieldLabel : dataField.Action;
211
+ }
212
+ else {
213
+ title = dataFieldAbstract.Action;
214
+ }
215
+ break;
216
+ case "com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation" /* DataFieldWithIntentBasedNavigation */:
217
+ dataField = dataFieldAbstract;
218
+ propertyCommonLabel = getLabelForDataField(dataFieldAbstract, entityType);
219
+ title = propertyCommonLabel || dataField.Value.path;
220
+ break;
221
+ case "com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath" /* DataFieldWithNavigationPath */:
222
+ dataField = dataFieldAbstract;
223
+ title = getTitleForDataField(dataField, entityType, dataFieldLabel);
224
+ break;
225
+ default:
226
+ break;
227
+ }
228
+ return title;
229
+ }
230
+ exports.getDatafieldDescription = getDatafieldDescription;
231
+ /**
232
+ * Return the page type for a given V2 page in manifest
233
+ * @param name - page component name
234
+ */
235
+ function getPageTypeV2(name) {
236
+ if (name) {
237
+ const templatePart = `${ux_specification_types_1.v2.FE_TEMPLATE_V2}.`;
238
+ return name.split(templatePart)[1];
239
+ }
240
+ }
241
+ exports.getPageTypeV2 = getPageTypeV2;
242
+ function getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys = false) {
243
+ const termWithQualifier = `${targetAnnotation.term}#${targetAnnotation.qualifier}`;
244
+ return `${!keyForRelatedFacetKeys ? '@' : ''}${targetAnnotation.qualifier ? termWithQualifier : targetAnnotation.term}`;
245
+ }
246
+ /**
247
+ * Finds the alias for a given namespace in the references' section of the converted service metadata
248
+ * @param {string} namespace - complete namespace, e.g. 'com.sap.vocabularies.UI.v1'
249
+ * @param {ConvertedMetadata} oDataServiceAVT - combined service metadata, as returned by annotation vocabularies tools
250
+ * @returns alias for the given namespace
251
+ */
252
+ function findAlias(namespace, oDataServiceAVT) {
253
+ let aliasReference = oDataServiceAVT === null || oDataServiceAVT === void 0 ? void 0 : oDataServiceAVT.references.find((reference) => {
254
+ return reference.namespace === namespace;
255
+ });
256
+ if (!aliasReference) {
257
+ aliasReference = oDataServiceAVT.references.find((reference) => {
258
+ return reference.alias === namespace;
259
+ });
260
+ }
261
+ if (!aliasReference) {
262
+ aliasReference = oDataServiceAVT.references.find((reference) => {
263
+ return (reference.alias.toUpperCase() ===
264
+ namespace.split('SAP__')[namespace.split('SAP__').length - 1].toUpperCase());
265
+ });
266
+ }
267
+ return aliasReference === null || aliasReference === void 0 ? void 0 : aliasReference.alias;
268
+ }
269
+ exports.findAlias = findAlias;
270
+ /**
271
+ * Determines the target annotation
272
+ * @param navigationParts - parts of the target annotation path
273
+ * @param entityType - entity type
274
+ * @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
275
+ * @returns the target annotation
276
+ */
277
+ function determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT) {
278
+ var _a;
279
+ const lastNavigationPart = navigationParts[navigationParts.length - 1];
280
+ const annotation = lastNavigationPart.substring(lastNavigationPart.lastIndexOf('.') + 1, lastNavigationPart.length);
281
+ const alias = findAlias(lastNavigationPart.substring(0, lastNavigationPart.lastIndexOf('.')).replace('@', ''), oDataServiceAVT);
282
+ return (_a = entityType === null || entityType === void 0 ? void 0 : entityType.annotations[alias]) === null || _a === void 0 ? void 0 : _a[annotation];
283
+ }
284
+ /**
285
+ * Adjust key by considering navigation
286
+ * @param key - given key
287
+ * @param keyForRelatedFacetKeys - construct key for 'keyForRelatedFacetKeys' property(used to define custom sections) - we should not add '@' symbol there.
288
+ * @param navigationParts - parts of the target annotation path
289
+ */
290
+ function adjustKey(key, navigationParts, keyForRelatedFacetKeys) {
291
+ const uiClass = navigationParts[navigationParts.length - 1].split('#')[0];
292
+ if (uiClass.includes('.LineItem')) {
293
+ const pathParts = key.split('::');
294
+ pathParts[pathParts.length - 1] = `${!keyForRelatedFacetKeys ? '@' : ''}${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`;
295
+ key = pathParts.join('::');
296
+ }
297
+ else {
298
+ key = uiClass.replace('@UI', `${!keyForRelatedFacetKeys ? '@' : ''}com.sap.vocabularies.UI.v1`);
299
+ }
300
+ return key;
301
+ }
302
+ function getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
303
+ var _a;
304
+ let stopProcessing = false;
305
+ const navigationParts = propertyValue.split('/');
306
+ const navigation = navigationParts.length > 1;
307
+ if (navigation) {
308
+ entityType = (_a = entityType.resolvePath(propertyValue.substring(0, propertyValue.lastIndexOf('/')))) === null || _a === void 0 ? void 0 : _a.targetType;
309
+ }
310
+ key = adjustKey(key, navigationParts, keyForRelatedFacetKeys);
311
+ const targetAnnotation = determineTargetAnnotation(navigationParts, entityType, oDataServiceAVT);
312
+ if (targetAnnotation) {
313
+ const separator = oDataVersion === ux_specification_types_1.FioriElementsVersion.v2 ? '::' : '#';
314
+ key = getTargetAnnotationName(targetAnnotation, keyForRelatedFacetKeys).replace('#', separator);
315
+ }
316
+ else {
317
+ stopProcessing = true;
318
+ return { key, entityType, stopProcessing };
319
+ }
320
+ if (navigation) {
321
+ const navSeparator = oDataVersion === ux_specification_types_1.FioriElementsVersion.v2 ? '::' : '/';
322
+ navigationParts.pop();
323
+ const navigationIDs = [...navigationParts].join(navSeparator);
324
+ key = `${navigationIDs}${navSeparator}${key}`;
325
+ }
326
+ return { key, entityType, stopProcessing };
327
+ }
328
+ /**
329
+ * Resolve page section(get key and label->description).
330
+ * @param facetDefinition - the actual annotation record
331
+ * @param keyForRelatedFacetKeys - construct key for 'keyForRelatedFacetKeys' property(used to define custom sections) - we should not add '@' symbol there.
332
+ * @param {FioriElementsVersion} oDataVersion - OData version
333
+ * @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
334
+ * @param {ExtensionLogger} logger - Logger class for logging messages
335
+ * @returns {FacetSection} - object comprising the relevant facet information
336
+ */
337
+ function getSectionFacet(facetDefinition, sourceEntityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, keyForRelatedFacetKeys = false) {
338
+ //Take facet ID as fallback
339
+ const facetName = facetDefinition.fullyQualifiedName.substring(facetDefinition.fullyQualifiedName.lastIndexOf('@'));
340
+ let key = facetDefinition.ID ? facetDefinition.ID.toString() : facetName;
341
+ let entityType = sourceEntityType; //default
342
+ //If reference facet: overwrite with target annotation if present
343
+ if (facetDefinition.$Type !== "com.sap.vocabularies.UI.v1.CollectionFacet" /* CollectionFacet */ && 'Target' in facetDefinition) {
344
+ const propertyValue = exports.getAnnotationPropertyValue(facetDefinition.Target);
345
+ if (!propertyValue) {
346
+ extensionLogger_1.log(logger, {
347
+ severity: "error" /* Error */,
348
+ message: i18next_1.default.t('NOTARGET', { target: facetDefinition.Target })
349
+ });
350
+ return;
351
+ }
352
+ const { key: newKey, entityType: newEntityType, stopProcessing } = getKeyAndEntityTypeOfReferenceFacet(oDataServiceAVT, key, entityType, propertyValue, oDataVersion, keyForRelatedFacetKeys);
353
+ if (stopProcessing) {
354
+ return;
355
+ }
356
+ key = newKey;
357
+ entityType = newEntityType;
358
+ }
359
+ key = key.replace(/\//gi, '::');
360
+ return key
361
+ ? Object.assign(Object.assign(Object.assign({ key }, (facetDefinition.Label && { label: facetDefinition.Label.toString() })), (facetDefinition.ID && { ID: facetDefinition.ID.toString() })), { entityType }) : undefined;
362
+ }
363
+ exports.getSectionFacet = getSectionFacet;
364
+ /**
365
+ * Finds the alias for a given namespace in the references' section of the converted service metadata.
366
+ * An empty object is created if the path element does not exist yet.
367
+ * Exception: if an empty array is the next element of the 'path' definition, an empty array is created instead of an empty object.
368
+ * @param {object} manifest - manifest that is being modified during export
369
+ * @param {string} path - path of the property in the manifest
370
+ * @param {string} targetAnnotation - target annotation (optional)
371
+ * @param {string} targetAnnotationEncoded - target annotation in its encoded form, as used in manifest settings
372
+ * @param {boolean} importScenario - indicates if the function is called for the import, else it is the export
373
+ * @returns returns section of the manifest based on path, generates an empty object in case it does not exists
374
+ */
375
+ exports.getManifestSectionByPathV4 = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
376
+ if (!path) {
377
+ return undefined;
378
+ }
379
+ let manifestSection = manifest;
380
+ const pathElements = path.split('/');
381
+ for (let index = 0; index < pathElements.length; index++) {
382
+ const element = pathElements[index];
383
+ if (element === '[]') {
384
+ continue;
385
+ }
386
+ const decodedElement = targetAnnotationEncoded && targetAnnotationEncoded === element
387
+ ? targetAnnotation
388
+ : element.replace('??', '/');
389
+ //?? can be used in path functions to encode /
390
+ if (!manifestSection[decodedElement]) {
391
+ if (pathElements[index + 1] === '[]') {
392
+ manifestSection[decodedElement] = [];
393
+ }
394
+ else {
395
+ manifestSection[decodedElement] = {};
396
+ }
397
+ }
398
+ manifestSection = manifestSection[decodedElement];
399
+ }
400
+ return manifestSection;
401
+ };
402
+ function getSchemaKeyOfLineItemRecord(lineItemRecord) {
403
+ let schemaKey, target, value;
404
+ switch (lineItemRecord.$Type) {
405
+ case "com.sap.vocabularies.UI.v1.DataField" /* DataField */:
406
+ schemaKey = exports.getAnnotationPropertyValue(lineItemRecord.Value);
407
+ break;
408
+ case "com.sap.vocabularies.UI.v1.DataFieldWithUrl" /* DataFieldWithUrl */:
409
+ schemaKey =
410
+ typeof lineItemRecord.Value === 'string'
411
+ ? lineItemRecord.Value
412
+ : exports.getAnnotationPropertyValue(lineItemRecord.Value);
413
+ break;
414
+ case "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" /* DataFieldForAnnotation */:
415
+ target = lineItemRecord.Target.value;
416
+ if (target) {
417
+ schemaKey =
418
+ 'DataFieldForAnnotation:::sTarget::' +
419
+ target
420
+ .replace('@UI', '@com.sap.vocabularies.UI.v1')
421
+ .replace('@Communication', '@com.sap.vocabularies.Communication.v1')
422
+ .replace('@Contact', '@com.sap.vocabularies.Contact.v1');
423
+ }
424
+ break;
425
+ case "com.sap.vocabularies.UI.v1.DataFieldForAction" /* DataFieldForAction */:
426
+ if (lineItemRecord.Inline) {
427
+ schemaKey = `DataFieldForAction:::sAction::${prepareRef(lineItemRecord.Action)}`;
428
+ }
429
+ break;
430
+ case "com.sap.vocabularies.UI.v1.DataFieldWithIntentBasedNavigation" /* DataFieldWithIntentBasedNavigation */:
431
+ value = exports.getAnnotationPropertyValue(lineItemRecord.Value);
432
+ schemaKey = `DataFieldWithIntentBasedNavigation:::sProperty::${value}:::sSemanticObject::${lineItemRecord.SemanticObject}:::sAction::${lineItemRecord.Action}`;
433
+ break;
434
+ case "com.sap.vocabularies.UI.v1.DataFieldForIntentBasedNavigation" /* DataFieldForIntentBasedNavigation */:
435
+ if (lineItemRecord.Inline) {
436
+ schemaKey = `DataFieldForIntentBasedNavigation:::sSemanticObject::${lineItemRecord.SemanticObject}:::sAction::${prepareRef(lineItemRecord.Action)}`;
437
+ }
438
+ break;
439
+ case "com.sap.vocabularies.UI.v1.DataFieldWithNavigationPath" /* DataFieldWithNavigationPath */:
440
+ value = exports.getAnnotationPropertyValue(lineItemRecord.Value);
441
+ target = exports.getAnnotationPropertyValue(lineItemRecord.Target);
442
+ schemaKey = 'DataFieldWithNavigationPath:::sProperty::' + value + ':::sTarget::' + target;
443
+ break;
444
+ default:
445
+ break;
446
+ }
447
+ return schemaKey;
448
+ }
449
+ exports.getSchemaKeyOfLineItemRecord = getSchemaKeyOfLineItemRecord;
450
+ /**
451
+ * Evaluates the target annotation of a reference facet and actualizes the facets for the config
452
+ * @param {AnnotationTerm} annotationRecord - the actual annotation record
453
+ * @param {FacetConfigs} facets - list of facets in config format, to be updated
454
+ * @param {string} serviceName - name of the service of the app
455
+ * @param {string} entityName - the entity (type) name
456
+ * @param {ConverterOutput} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
457
+ */
458
+ /**
459
+ * Evaluates the target annotation of a reference facet and actualizes the facets for the config
460
+ * @param {AnnotationTerm} annotationRecord - the actual annotation record
461
+ * @param {FacetConfigs} facets - list of facets in config format, to be updated
462
+ * @param {EntityType} entityType - the entity type
463
+ * @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
464
+ * @param {FioriElementsVersion} oDataVersion - OData version
465
+ * @param {ExtensionLogger} logger - Logger class for logging messages
466
+ */
467
+ function evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
468
+ var _a, _b, _c, _d, _e, _f;
469
+ const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
470
+ let path = section ? section.key : '';
471
+ const targetEntityType = section.entityType;
472
+ let annotation, targetAnnotation;
473
+ if (path.includes("com.sap.vocabularies.UI.v1.Chart" /* Chart */) || path.includes(alias + '.Chart')) {
474
+ facets[path] = { base: types_1.FacetBase.Chart };
475
+ facets[path].entityType = targetEntityType;
476
+ }
477
+ else if (path.includes("com.sap.vocabularies.UI.v1.Identification" /* Identification */) || path.includes(alias + '.Identification')) {
478
+ annotation = path.split('.')[path.split('.').length - 1];
479
+ targetAnnotation = targetEntityType.annotations[alias][annotation];
480
+ facets[path] = { base: types_1.FacetBase.Identification };
481
+ facets[path].entityType = targetEntityType;
482
+ facets[path].target = targetAnnotation;
483
+ }
484
+ else if (entityType && (path.includes("com.sap.vocabularies.UI.v1.LineItem" /* LineItem */) || path.includes(alias + '.LineItem'))) {
485
+ if (!path.includes("com.sap.vocabularies.UI.v1.LineItem" /* LineItem */) && path.includes('.LineItem')) {
486
+ const pathParts = path.split('::');
487
+ pathParts[pathParts.length - 1] = `@${"com.sap.vocabularies.UI.v1.LineItem" /* LineItem */}`;
488
+ path = pathParts.join('::');
489
+ }
490
+ facets[path] = { base: types_1.FacetBase.LineItem };
491
+ facets[path].target = (_a = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _a === void 0 ? void 0 : _a.$target;
492
+ facets[path].entityType = targetEntityType;
493
+ }
494
+ else if (path.includes("com.sap.vocabularies.UI.v1.FieldGroup" /* FieldGroup */) || path.includes(alias + '.FieldGroup')) {
495
+ facets[path] = { base: types_1.FacetBase.Form };
496
+ facets[path].target = (_b = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _b === void 0 ? void 0 : _b.$target;
497
+ facets[path].entityType = targetEntityType;
498
+ }
499
+ else if (path.includes("com.sap.vocabularies.UI.v1.DataPoint" /* DataPoint */) || path.includes(alias + '.DataPoint')) {
500
+ facets[path] = { base: types_1.FacetBase.DataPoint };
501
+ facets[path].target = (_c = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _c === void 0 ? void 0 : _c.$target;
502
+ facets[path].entityType = targetEntityType;
503
+ facets[path].Label = (_d = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _d === void 0 ? void 0 : _d.$target['Title'];
504
+ }
505
+ else if (path.includes('com.sap.vocabularies.Communication.v1.Contact') || path.includes(alias + '.Contact')) {
506
+ facets[path] = { base: types_1.FacetBase.Contact };
507
+ facets[path].target = (_e = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _e === void 0 ? void 0 : _e.$target;
508
+ facets[path].entityType = targetEntityType;
509
+ }
510
+ else if (path.includes('com.sap.vocabularies.Communication.v1.Address') || path.includes(alias + '.Address')) {
511
+ facets[path] = { base: types_1.FacetBase.Address };
512
+ facets[path].target = (_f = annotationRecord === null || annotationRecord === void 0 ? void 0 : annotationRecord.Target) === null || _f === void 0 ? void 0 : _f.$target;
513
+ facets[path].entityType = targetEntityType;
514
+ }
515
+ else {
516
+ facets[path] = { base: types_1.FacetBase.Unknown };
517
+ }
518
+ if (facets[path]) {
519
+ facets[path].annotationPath = `/${annotationRecord.fullyQualifiedName.replace('@com.sap.vocabularies', types_1.VOCWITHSLASH)}`;
520
+ if (annotationRecord.Label) {
521
+ facets[path].Label = annotationRecord.Label;
522
+ }
523
+ // Add Facet ID
524
+ if (annotationRecord.ID) {
525
+ facets[path]['ID'] = annotationRecord.ID;
526
+ }
527
+ else if (oDataVersion === ux_specification_types_1.FioriElementsVersion.v4) {
528
+ extensionLogger_1.log(logger, {
529
+ severity: "error" /* Error */,
530
+ message: i18next_1.default.t('NOID4SECTION', { facet: annotationRecord.fullyQualifiedName })
531
+ });
532
+ }
533
+ if (section && section.entityType) {
534
+ facets[path].entityType = section.entityType;
535
+ }
536
+ }
537
+ }
538
+ /**
539
+ * Adds the information from facets to the config
540
+ * @param {AnnotationTerm} annotationRecord - the actual annotation record
541
+ * @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
542
+ * @param {string} serviceName - name of the service of the app
543
+ * @param {string} entityName - the entity (type) name
544
+ * @param {FacetConfigs} facets - list of facets in config format, to be updated
545
+ * @param {FioriElementsVersion} oDataVersion - OData version
546
+ * @param {ExtensionLogger} logger - Logger class for logging messages
547
+ */
548
+ function addFacetToConfig(annotationRecord, oDataServiceAVT, serviceName, entityType, facets, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
549
+ var _a;
550
+ const section = getSectionFacet(annotationRecord, entityType, oDataServiceAVT, logger, oDataVersion, false);
551
+ if (section) {
552
+ switch (annotationRecord.$Type) {
553
+ case "com.sap.vocabularies.UI.v1.ReferenceFacet" /* ReferenceFacet */: {
554
+ evaluateTargetAnnotation(section, annotationRecord, facets, entityType, oDataServiceAVT, oDataVersion, logger);
555
+ break;
556
+ }
557
+ case "com.sap.vocabularies.UI.v1.CollectionFacet" /* CollectionFacet */: {
558
+ const annotationPath = `/${entityType.fullyQualifiedName}/${annotationRecord.fullyQualifiedName.split(entityType.fullyQualifiedName)[1]}`;
559
+ const facet = (facets[section.key] = {
560
+ base: types_1.FacetBase.CollectionFacet,
561
+ facets: {},
562
+ ID: section.ID,
563
+ annotationPath: annotationPath,
564
+ Label: section.label
565
+ });
566
+ (_a = annotationRecord.Facets) === null || _a === void 0 ? void 0 : _a.forEach((collectionItem) => {
567
+ addFacetToConfig(collectionItem, oDataServiceAVT, serviceName, entityType, facet.facets, oDataVersion, logger);
568
+ });
569
+ break;
570
+ }
571
+ }
572
+ }
573
+ }
574
+ /**
575
+ * Retrieve header facet configurations that can be used to generate ObjectPage schemas
576
+ * @param {QualifiedName} entityTypeName - the name of the actual entity type
577
+ * @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
578
+ * @param {FioriElementsVersion} oDataVersion - OData version
579
+ * @param {ExtensionLogger} logger - Logger class for logging messages
580
+ */
581
+ function getObjectPageHeaderFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
582
+ const facets = {};
583
+ if (!entityType || !entityType.annotations) {
584
+ return;
585
+ }
586
+ const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
587
+ const facetAnnotation = alias && entityType.annotations[alias] && entityType.annotations[alias].HeaderFacets;
588
+ if (facetAnnotation) {
589
+ const lastDot = entityType.fullyQualifiedName.lastIndexOf('.');
590
+ const serviceName = entityType.fullyQualifiedName.substring(0, lastDot);
591
+ // Add facets to configuration
592
+ facetAnnotation.forEach((item) => {
593
+ addFacetToConfig(item, oDataServiceAVT, serviceName, entityType, facets, oDataVersion, logger);
594
+ });
595
+ }
596
+ return facets;
597
+ }
598
+ exports.getObjectPageHeaderFacets = getObjectPageHeaderFacets;
599
+ /**
600
+ * Retrieve facet configurations that can be used to generate ObjectPage schemas
601
+ * @param {QualifiedName} entityTypeName - the name of the actual entity type
602
+ * @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
603
+ * @param {FioriElementsVersion} oDataVersion - OData version
604
+ * @param {ExtensionLogger} logger - Logger class for logging messages
605
+ */
606
+ function getObjectPageFacets(entityType, oDataServiceAVT, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, logger) {
607
+ const facets = {};
608
+ if (!entityType || !entityType.annotations) {
609
+ return;
610
+ }
611
+ const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
612
+ const facetAnnotation = alias && entityType.annotations[alias] && entityType.annotations[alias].Facets;
613
+ if (facetAnnotation) {
614
+ const lastDot = entityType.fullyQualifiedName.lastIndexOf('.');
615
+ const serviceName = entityType.fullyQualifiedName.substring(0, lastDot);
616
+ // Add facets to configuration
617
+ facetAnnotation.forEach((item) => {
618
+ addFacetToConfig(item, oDataServiceAVT, serviceName, entityType, facets, oDataVersion, logger);
619
+ });
620
+ }
621
+ return facets;
622
+ }
623
+ exports.getObjectPageFacets = getObjectPageFacets;
624
+ /**
625
+ * Returns the version of Fiori elements (v2/v4) from a given manifest
626
+ * @param manifest - the manifest.json file
627
+ */
628
+ function getVersionFromManifest(manifest) {
629
+ if (manifest[ux_specification_types_1.ManifestSection.generic] || manifest[ux_specification_types_1.ManifestSection.ovp]) {
630
+ return ux_specification_types_1.FioriElementsVersion.v2;
631
+ }
632
+ else {
633
+ return ux_specification_types_1.FioriElementsVersion.v4;
634
+ }
635
+ }
636
+ exports.getVersionFromManifest = getVersionFromManifest;
637
+ /**
638
+ * Determines the template type of a V2 app
639
+ * @param manifest - the manifest.json file
640
+ * @param {ExtensionLogger} logger - Logger class for logging messages
641
+ * @returns {TemplateType} the template type
642
+ */
643
+ function determineV2Template(manifest, logger) {
644
+ let templateType;
645
+ if (manifest[ux_specification_types_1.ManifestSection.generic]) {
646
+ const v2Pages = manifest[ux_specification_types_1.ManifestSection.generic].pages;
647
+ if (!v2Pages) {
648
+ extensionLogger_1.log(logger, {
649
+ severity: "error" /* Error */,
650
+ message: i18next_1.default.t('NOPAGES', { appId: manifest['sap.app']['id'] }),
651
+ location: {
652
+ path: types_1.MANIFESTPATH,
653
+ range: [ux_specification_types_1.ManifestSection.generic]
654
+ }
655
+ });
656
+ return;
657
+ }
658
+ for (const pageKey in v2Pages) {
659
+ const v2Page = v2Pages[pageKey];
660
+ if (getPageTypeV2(v2Page.component.name) === ux_specification_types_1.PageType.AnalyticalListPage) {
661
+ templateType = TemplateType.AnalyticalListPageV2;
662
+ break;
663
+ }
664
+ else if (getPageTypeV2(v2Page.component.name) === ux_specification_types_1.PageType.ListReport) {
665
+ templateType = TemplateType.ListReportObjectPageV2;
666
+ break;
667
+ }
668
+ }
669
+ }
670
+ else {
671
+ if (!templateType) {
672
+ extensionLogger_1.log(logger, {
673
+ severity: "error" /* Error */,
674
+ message: i18next_1.default.t('NOTEMPLATE', { section: ux_specification_types_1.ManifestSection.generic }),
675
+ location: {
676
+ path: types_1.MANIFESTPATH,
677
+ range: [ux_specification_types_1.ManifestSection.generic]
678
+ }
679
+ });
680
+ }
681
+ }
682
+ return templateType;
683
+ }
684
+ exports.determineV2Template = determineV2Template;
685
+ /**
686
+ * Determines the template type, based on the given manifest entries of the app
687
+ * @param manifest - the manifest.json file
688
+ * @param {FioriElementsVersion} fioriElementsVersion - OData or FE version
689
+ * @param {ExtensionLogger} logger - Logger class for logging messages
690
+ * @returns {TemplateType} the template type
691
+ */
692
+ function getTemplateTypeFromManifest(manifest, fioriElementsVersion, logger) {
693
+ let templateType;
694
+ if (manifest[ux_specification_types_1.ManifestSection.ovp]) {
695
+ templateType = TemplateType.OverviewPageV2;
696
+ }
697
+ else if (fioriElementsVersion === ux_specification_types_1.FioriElementsVersion.v2) {
698
+ templateType = determineV2Template(manifest, logger);
699
+ }
700
+ return templateType;
701
+ }
702
+ exports.getTemplateTypeFromManifest = getTemplateTypeFromManifest;
703
+ /**
704
+ * Adds title and description to a section or header section in an app schema
705
+ * @param facet - intermediate facet structure comprising annotation information
706
+ * @param section - section in the app schema
707
+ * @param facetKey - key of the facet
708
+ */
709
+ function addSectionTitleAndDescription(facet, section, facetKey) {
710
+ if (facet === null || facet === void 0 ? void 0 : facet.ID) {
711
+ section.title = types_1.FacetTitlePrefix + facet.ID;
712
+ }
713
+ else {
714
+ section.title = facetKey.replace(/@com.sap/g, 'com.sap');
715
+ }
716
+ // Description
717
+ if (facet === null || facet === void 0 ? void 0 : facet.Label) {
718
+ section.description = facet.Label;
719
+ }
720
+ else if (facet === null || facet === void 0 ? void 0 : facet.ID) {
721
+ section.description = facet.ID;
722
+ }
723
+ else {
724
+ section.description = facetKey.substring(facetKey.lastIndexOf('.') + 1);
725
+ }
726
+ }
727
+ exports.addSectionTitleAndDescription = addSectionTitleAndDescription;
728
+ /**
729
+ * Adds target title or description to a section or header section in an app schema
730
+ * @param facet - intermediate facet structure comprising annotation information
731
+ * @param section - section in the app schema
732
+ * @param facetKey - key of the facet
733
+ */
734
+ function addTargetTitleAndSectionDescription(facet, section, facetKey) {
735
+ var _a;
736
+ addSectionTitleAndDescription(facet, section, facetKey);
737
+ if (facet === null || facet === void 0 ? void 0 : facet.Label) {
738
+ section.description = facet === null || facet === void 0 ? void 0 : facet.Label;
739
+ }
740
+ else if (facet === null || facet === void 0 ? void 0 : facet['Title']) {
741
+ section.description = facet['Title'];
742
+ }
743
+ else if ((_a = facet === null || facet === void 0 ? void 0 : facet.target) === null || _a === void 0 ? void 0 : _a['Title']) {
744
+ section.description = facet.target['Title'];
745
+ }
746
+ }
747
+ exports.addTargetTitleAndSectionDescription = addTargetTitleAndSectionDescription;
748
+ /**
749
+ * Creates a default object for a new section or subsection, and adds the ID as title if present.
750
+ * @param facet Facet configuration, to be analyzed
751
+ * @returns the new section object
752
+ */
753
+ function createDefaultSection(appSchema, facet, facetKey) {
754
+ if (!facet) {
755
+ return undefined;
756
+ }
757
+ let section;
758
+ if (appSchema.definitions.ObjectPageSection) {
759
+ //base type in V2, with properties
760
+ section = JSON.parse(JSON.stringify(appSchema.definitions.ObjectPageSection));
761
+ }
762
+ else {
763
+ section = {
764
+ type: 'object',
765
+ properties: {},
766
+ additionalProperties: false
767
+ };
768
+ section[types_1.SchemaTag.isViewNode] = true;
769
+ }
770
+ section[types_1.SchemaTag.annotationPath] = facet.annotationPath;
771
+ addSectionTitleAndDescription(facet, section, facetKey);
772
+ return section;
773
+ }
774
+ exports.createDefaultSection = createDefaultSection;
775
+ /**
776
+ * Retrieve page section data(so far id/key and label/description).
777
+ * @param {EntityType} entityType The actual entityType
778
+ * @param {ConvertedMetadata} oDataServiceAVT - complete service information, as returned by annotation vocabularies tool
779
+ * @param {ExtensionLogger} logger - Logger class for logging messages
780
+ * @param {FioriElementsVersion} oDataVersion - OData version
781
+ * @param {boolean} [checkUnresolvableFacets=false] - Check and avoid facets and sections without ID and Target.
782
+ * @returns {FacetSection[]} - Array of facets or sections
783
+ */
784
+ function getObjectPageFacetSection(entityType, oDataServiceAVT, logger, oDataVersion = ux_specification_types_1.FioriElementsVersion.v2, checkUnresolvableFacets = false) {
785
+ const alias = findAlias(types_1.UIVOCABULARY, oDataServiceAVT);
786
+ let sections = [];
787
+ if (entityType) {
788
+ const facetAnnotation = alias && entityType.annotations && entityType.annotations[alias] && entityType.annotations[alias].Facets;
789
+ if (facetAnnotation) {
790
+ sections = facetAnnotation.reduce(function (result, item) {
791
+ if (checkUnresolvableFacets && !item['ID'] && !('Target' in item && item['Target'])) {
792
+ return result;
793
+ }
794
+ const section = getSectionFacet(item, entityType, oDataServiceAVT, logger, oDataVersion, true);
795
+ if (section) {
796
+ result.push(section);
797
+ }
798
+ return result;
799
+ }, sections);
800
+ }
801
+ return sections;
802
+ }
803
+ }
804
+ exports.getObjectPageFacetSection = getObjectPageFacetSection;
805
+ /**
806
+ * Cleans empty sub-structures from the export result for manifest
807
+ * @param manifest - manifest.json part of the export result
808
+ * @param path - path in the manifest
809
+ * @param targetAnnotation - target annotation (optional, in case of sections, subsections)
810
+ * @param targetAnnotationEncoded - encoded version of the target annotation, as represented in the manifest
811
+ */
812
+ exports.deleteEmptyStructure = (manifest, path, targetAnnotation, targetAnnotationEncoded) => {
813
+ if (!path) {
814
+ return;
815
+ }
816
+ let manifestSection = manifest;
817
+ const pathArray = path.split('/');
818
+ pathArray.forEach(function (element) {
819
+ const decodedElement = targetAnnotationEncoded && targetAnnotationEncoded === element
820
+ ? targetAnnotation
821
+ : element.replace('??', '/');
822
+ if (!manifestSection[decodedElement]) {
823
+ return;
824
+ }
825
+ if (Object.keys(manifestSection[decodedElement]).length === 0) {
826
+ if (Array.isArray(manifestSection)) {
827
+ manifestSection.splice(Number(decodedElement), 1);
828
+ }
829
+ else {
830
+ delete manifestSection[decodedElement];
831
+ }
832
+ pathArray.pop();
833
+ exports.deleteEmptyStructure(manifest, pathArray.join('/'), targetAnnotation, targetAnnotationEncoded);
834
+ return;
835
+ }
836
+ manifestSection = manifestSection && manifestSection[decodedElement];
837
+ });
838
+ };
839
+ /**
840
+ * Method which returns generic schema file name.
841
+ * @param {SchemaType | PageType} schemaType Schema type or Page type.
842
+ * @return {string} File name of generic schema.
843
+ */
844
+ const getGenericSchemaFileName = (schemaType) => {
845
+ return `${schemaType}`;
846
+ };
847
+ /**
848
+ * Method which returns schema file name and path depending on passed schema or page type.
849
+ * @param {SchemaType | PageType} schemaType Schema type or Page type.
850
+ * @param {string} [entitySet] Entity set string.
851
+ * @return {SchemaFilePath} File path info.
852
+ */
853
+ exports.getSchemaFilePath = (schemaType, entitySet) => {
854
+ const schemaFile = {
855
+ filename: '',
856
+ path: ''
857
+ };
858
+ switch (schemaType) {
859
+ // Application schema
860
+ case ux_specification_types_1.SchemaType.Application: {
861
+ // File name
862
+ schemaFile.filename = `App`;
863
+ // Full path
864
+ schemaFile.path = `./${types_1.DirName.Schemas}/${schemaFile.filename}`;
865
+ break;
866
+ }
867
+ // List report and object page
868
+ case ux_specification_types_1.SchemaType.ListReport:
869
+ case ux_specification_types_1.SchemaType.ObjectPage: {
870
+ // File name
871
+ schemaFile.filename = entitySet ? `${schemaType}_${entitySet}` : getGenericSchemaFileName(schemaType);
872
+ // Full path
873
+ schemaFile.path = `../${types_1.DirName.Schemas}/${schemaFile.filename}`;
874
+ break;
875
+ }
876
+ // Other page configs
877
+ default: {
878
+ // File name
879
+ schemaFile.filename = getGenericSchemaFileName(schemaType);
880
+ // Full path
881
+ schemaFile.path = `../${types_1.DirName.Schemas}/${schemaFile.filename}`;
882
+ break;
883
+ }
884
+ }
885
+ schemaFile.path += '.json';
886
+ return schemaFile;
887
+ };
888
+ /**
889
+ * Method which generates id of page according to passed parameters.
890
+ * @param appVersion - Fiori Elements version - V2 or V4.
891
+ * @param pageType - Page type.
892
+ * @param entitySet - Entity Set.
893
+ * @param viewId - Custom page's viewId (optional).
894
+ * @returns {string} Generated page id
895
+ */
896
+ function generatePageId(pageType, entitySet, viewId) {
897
+ if (pageType === ux_specification_types_1.PageType.CustomPage) {
898
+ const names = viewId && viewId.split('.');
899
+ return names && names[names.length - 1] + 'Page';
900
+ }
901
+ const parts = [];
902
+ parts.push(pageType);
903
+ if (entitySet) {
904
+ parts.push(entitySet);
905
+ }
906
+ return parts.join('_');
907
+ }
908
+ exports.generatePageId = generatePageId;
909
+ function fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray) {
910
+ const $ref = element.$ref;
911
+ if ($ref) {
912
+ const definitionKey = $ref.split(exports.DEFINITION_LINK_PREFIX)[1];
913
+ if (appSchema.definitions[definitionKey]) {
914
+ const controlProperty = appSchema.definitions[definitionKey]['controlProperty'];
915
+ if ($ref.includes(currentConfigObject[controlProperty])) {
916
+ definitionArray.push(definitionKey);
917
+ }
918
+ }
919
+ }
920
+ }
921
+ /**
922
+ * Fills an array of next definitions from given references in the JSON schema
923
+ * @param propertyDefinition - Definition of the current property in schema
924
+ * @param currentConfigObject - Current object in the config JSON. Evaluated to get the right value of a cntrolling property,
925
+ * for making the right choice in case of multiple options (anyOf)
926
+ * @param appSchema - app-spcific JSON schema
927
+ * @returns an array of definitions to proceed with
928
+ */
929
+ function fillArrayFromPropertyDefinition(propertyDefinition, currentConfigObject, appSchema) {
930
+ const definitionArray = [];
931
+ if (propertyDefinition.$ref) {
932
+ definitionArray.push(propertyDefinition.$ref.split(exports.DEFINITION_LINK_PREFIX)[1]);
933
+ }
934
+ else if (propertyDefinition.anyOf) {
935
+ if (currentConfigObject) {
936
+ propertyDefinition.anyOf.forEach((element) => {
937
+ fillArrayFromAnyOfReference(element, appSchema, currentConfigObject, definitionArray);
938
+ });
939
+ }
940
+ if (definitionArray.length === 0) {
941
+ return undefined;
942
+ }
943
+ }
944
+ return definitionArray;
945
+ }
946
+ /**
947
+ * Determines the next definition to be handled, based on the definition array.
948
+ * It also creates the Metadata instance for the next definition, to subsequently access metadata like the syncRule
949
+ * @param definitionArray - Array of definitions, as determined by fillArrayFromNextDefinition
950
+ * @param appSchema - app-specific JSON schema
951
+ * @param title - default title
952
+ * @param currentConfigObject - Current object in the config JSON.
953
+ * @param key - actual key
954
+ * @param {MetadataInstanceInterface} factory - factory for creating metadata instances
955
+ * @param pageType - page type
956
+ * @param propertyDefinition - Definition of the current property in schema
957
+ * @returns {NextDefinition} - Next target definition to process
958
+ */
959
+ function determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition) {
960
+ var _a, _b, _c, _d;
961
+ let nextDefinition = {
962
+ configObject: undefined,
963
+ targetDefinition: {},
964
+ title: ''
965
+ };
966
+ if (definitionArray.length) {
967
+ const lastDefinition = definitionArray[definitionArray.length - 1];
968
+ nextDefinition.targetDefinition = appSchema['definitions'][lastDefinition];
969
+ if (((_a = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _a === void 0 ? void 0 : _a['$ref']) || ((_b = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _b === void 0 ? void 0 : _b['type']) === 'array') {
970
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
971
+ nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, nextDefinition.targetDefinition, key, factory, pageType);
972
+ return nextDefinition;
973
+ }
974
+ if (definitionArray.length > 1) {
975
+ definitionArray.forEach((element) => {
976
+ if (element !== '') {
977
+ nextDefinition.targetDefinition['properties'] = Object.assign(Object.assign({}, nextDefinition.targetDefinition['properties']), appSchema['definitions'][element]['properties']);
978
+ }
979
+ });
980
+ }
981
+ nextDefinition.title = ((_c = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _c === void 0 ? void 0 : _c['title']) ? nextDefinition.targetDefinition['title']
982
+ : title;
983
+ const factoryKey = lastDefinition === null || lastDefinition === void 0 ? void 0 : lastDefinition.split('<')[0];
984
+ const targetObject = currentConfigObject ? currentConfigObject : {};
985
+ nextDefinition.configObject = factory.createInstance(pageType, factoryKey, targetObject, (_d = nextDefinition === null || nextDefinition === void 0 ? void 0 : nextDefinition.targetDefinition) === null || _d === void 0 ? void 0 : _d['controlProperty']);
986
+ }
987
+ else {
988
+ //e.g. sections ==> loop over all properties = subsections or other
989
+ nextDefinition.targetDefinition = propertyDefinition;
990
+ nextDefinition.title = nextDefinition.targetDefinition['title']
991
+ ? nextDefinition.targetDefinition['title']
992
+ : key;
993
+ nextDefinition.configObject = currentConfigObject;
994
+ }
995
+ return nextDefinition;
996
+ }
997
+ /**
998
+ * Recursive function to determine the next config part, next definition in the app schema and the title
999
+ * @param appSchema - app-spcific JSON schema
1000
+ * @param title - default title
1001
+ * @param currentConfigObject - current part of the configuration that gets traversed
1002
+ * @param propertyDefinition - definition of a given property in the app schema
1003
+ * @param key - actual key
1004
+ * @param {MetadataInstanceInterface} factory - factory for creating metadata instances
1005
+ * @param pageType - page type
1006
+ */
1007
+ function getNextTargetDefinition(appSchema, title, currentConfigObject, propertyDefinition, key, factory, pageType) {
1008
+ let nextDefinition;
1009
+ if (propertyDefinition['type'] === 'array') {
1010
+ nextDefinition = getNextTargetDefinition(appSchema, title, currentConfigObject, propertyDefinition['items'], key, factory, pageType);
1011
+ return nextDefinition;
1012
+ }
1013
+ const definitionArray = fillArrayFromPropertyDefinition(propertyDefinition, currentConfigObject, appSchema);
1014
+ if (!definitionArray) {
1015
+ return undefined;
1016
+ }
1017
+ nextDefinition = determineNextDefinitionFromDefinitionArray(definitionArray, appSchema, title, currentConfigObject, key, factory, pageType, propertyDefinition);
1018
+ return nextDefinition;
1019
+ }
1020
+ exports.getNextTargetDefinition = getNextTargetDefinition;
1021
+ /**
1022
+ * Custom array merge function called by deepmerge's merge function
1023
+ *
1024
+ * @param {*} target Target array
1025
+ * @param {*} source Source array
1026
+ * @param {*} options options object provided by deepmerge's merge function
1027
+ * @returns
1028
+ */
1029
+ exports.arrayCombineMerge = (target, source, options) => {
1030
+ const destination = target.slice();
1031
+ source.forEach((item, index) => {
1032
+ if (typeof destination[index] === 'undefined') {
1033
+ destination[index] = options.cloneUnlessOtherwiseSpecified(item, options);
1034
+ }
1035
+ else if (options.isMergeableObject(item)) {
1036
+ destination[index] = deepmerge_1.default(target[index], item, options);
1037
+ }
1038
+ else if (target.indexOf(item) === -1) {
1039
+ destination.push(item);
1040
+ }
1041
+ });
1042
+ return destination;
1043
+ };
1044
+ /**
1045
+ * Converts an enum into a CSV
1046
+ * @param {object} manifestSection - manifestSection where the key exists
1047
+ * @param {object} configPart - Property as mentioned in config file
1048
+ * @param {string} key - Property to be exported to manifest
1049
+ */
1050
+ function convertEnumToCSV(manifestSection, configPart, key) {
1051
+ manifestSection[key] = JSON.parse(JSON.stringify(configPart[key]));
1052
+ // convert enum array to joined string
1053
+ const field = configPart[key];
1054
+ manifestSection[key] = field.join();
1055
+ }
1056
+ exports.convertEnumToCSV = convertEnumToCSV;
1057
+ /**
1058
+ * Converts an action ID from the internal format (schema, config) to the stable ID representation
1059
+ * @param actionId - the (unique) internal format of the action ID
1060
+ * @returns the converted action ID
1061
+ */
1062
+ function convertActionKeyToStableId(actionId) {
1063
+ return (actionId.indexOf('??') > -1 ? actionId.split('??')[1] : actionId).replace(/@/g, '::');
1064
+ }
1065
+ exports.convertActionKeyToStableId = convertActionKeyToStableId;
1066
+ //# sourceMappingURL=utils.js.map