@sap/ux-specification 1.71.66 → 1.71.70

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