@sap/ux-specification 1.71.65 → 1.71.66

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