@sap/ux-ui5-tooling 1.20.4 → 1.22.0

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 (289) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/adp-tooling/templates/cf/_gitignore +6 -0
  3. package/dist/adp-tooling/templates/cf/approuter/package.json +13 -0
  4. package/dist/adp-tooling/templates/cf/approuter/xs-app.json +15 -0
  5. package/dist/adp-tooling/templates/cf/i18n/i18n.properties +3 -0
  6. package/dist/adp-tooling/templates/cf/package.json +35 -0
  7. package/dist/adp-tooling/templates/cf/ui5.yaml +5 -0
  8. package/dist/adp-tooling/templates/cf/xs-security.json +7 -0
  9. package/dist/adp-tooling/templates/changes/annotation.xml +18 -0
  10. package/dist/adp-tooling/templates/project/gitignore.tmpl +5 -0
  11. package/dist/adp-tooling/templates/project/package.json +31 -0
  12. package/dist/adp-tooling/templates/project/ui5.yaml +6 -0
  13. package/dist/adp-tooling/templates/project/webapp/i18n/i18n.properties +6 -0
  14. package/dist/adp-tooling/templates/project/webapp/manifest.appdescr_variant +10 -0
  15. package/dist/adp-tooling/templates/rta/common/analytical-custom-column.xml +25 -0
  16. package/dist/adp-tooling/templates/rta/common/custom-action.xml +8 -0
  17. package/dist/adp-tooling/templates/rta/common/grid-tree-custom-column.xml +22 -0
  18. package/dist/adp-tooling/templates/rta/common/header-field.xml +13 -0
  19. package/dist/adp-tooling/templates/rta/common/op-custom-section.xml +20 -0
  20. package/dist/adp-tooling/templates/rta/common/v4-table-action.xml +8 -0
  21. package/dist/adp-tooling/templates/rta/controller.ejs +80 -0
  22. package/dist/adp-tooling/templates/rta/fragment.xml +7 -0
  23. package/dist/adp-tooling/templates/rta/ts-controller.ejs +18 -0
  24. package/dist/adp-tooling/templates/rta/v2/m-table-custom-column-cell.xml +7 -0
  25. package/dist/adp-tooling/templates/rta/v2/m-table-custom-column.xml +18 -0
  26. package/dist/adp-tooling/templates/rta/v4/custom-section.xml +12 -0
  27. package/dist/adp-tooling/templates/rta/v4/mdc-custom-column-config.xml +6 -0
  28. package/dist/adp-tooling/templates/rta/v4/mdc-custom-column.xml +11 -0
  29. package/dist/adp-tooling/templates/typescript/tsconfig.json +19 -0
  30. package/dist/cli/index.js +17761 -11603
  31. package/dist/control-property-editor/app.css +2 -0
  32. package/dist/control-property-editor/app.js +175 -0
  33. package/dist/livereload-js/livereload.js +3795 -0
  34. package/dist/middlewares/fiori-tools-appreload.js +44007 -41669
  35. package/dist/middlewares/fiori-tools-preview.js +66889 -4176
  36. package/dist/middlewares/fiori-tools-proxy.js +38049 -5767
  37. package/dist/middlewares/fiori-tools-servestatic.js +32893 -347
  38. package/dist/preview-middleware/dist/client/adp/add-fragment.js +48 -0
  39. package/dist/preview-middleware/dist/client/adp/add-fragment.ts +51 -0
  40. package/dist/preview-middleware/dist/client/adp/api-handler.js +165 -0
  41. package/dist/preview-middleware/dist/client/adp/api-handler.ts +191 -0
  42. package/dist/preview-middleware/dist/client/adp/command-executor.js +100 -0
  43. package/dist/preview-middleware/dist/client/adp/command-executor.ts +105 -0
  44. package/dist/preview-middleware/dist/client/adp/control-utils.js +46 -0
  45. package/dist/preview-middleware/dist/client/adp/control-utils.ts +48 -0
  46. package/dist/preview-middleware/dist/client/adp/controllers/AddActionFragment.controller.js +198 -0
  47. package/dist/preview-middleware/dist/client/adp/controllers/AddActionFragment.controller.ts +232 -0
  48. package/dist/preview-middleware/dist/client/adp/controllers/AddCustomFragment.controller.js +223 -0
  49. package/dist/preview-middleware/dist/client/adp/controllers/AddCustomFragment.controller.ts +257 -0
  50. package/dist/preview-middleware/dist/client/adp/controllers/AddFragment.controller.js +195 -0
  51. package/dist/preview-middleware/dist/client/adp/controllers/AddFragment.controller.ts +264 -0
  52. package/dist/preview-middleware/dist/client/adp/controllers/AddSubpage.controller.js +146 -0
  53. package/dist/preview-middleware/dist/client/adp/controllers/AddSubpage.controller.ts +209 -0
  54. package/dist/preview-middleware/dist/client/adp/controllers/AddTableColumnFragments.controller.js +232 -0
  55. package/dist/preview-middleware/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +306 -0
  56. package/dist/preview-middleware/dist/client/adp/controllers/BaseDialog.controller.js +187 -0
  57. package/dist/preview-middleware/dist/client/adp/controllers/BaseDialog.controller.ts +254 -0
  58. package/dist/preview-middleware/dist/client/adp/controllers/ControllerExtension.controller.js +330 -0
  59. package/dist/preview-middleware/dist/client/adp/controllers/ControllerExtension.controller.ts +408 -0
  60. package/dist/preview-middleware/dist/client/adp/controllers/ExtensionPoint.controller.js +160 -0
  61. package/dist/preview-middleware/dist/client/adp/controllers/ExtensionPoint.controller.ts +195 -0
  62. package/dist/preview-middleware/dist/client/adp/controllers/FileExistsDialog.controller.js +68 -0
  63. package/dist/preview-middleware/dist/client/adp/controllers/FileExistsDialog.controller.ts +86 -0
  64. package/dist/preview-middleware/dist/client/adp/controllers/types.js +2 -0
  65. package/dist/preview-middleware/dist/client/adp/controllers/types.ts +10 -0
  66. package/dist/preview-middleware/dist/client/adp/dialog-factory.js +151 -0
  67. package/dist/preview-middleware/dist/client/adp/dialog-factory.ts +210 -0
  68. package/dist/preview-middleware/dist/client/adp/extend-controller.js +48 -0
  69. package/dist/preview-middleware/dist/client/adp/extend-controller.ts +49 -0
  70. package/dist/preview-middleware/dist/client/adp/extension-point.js +83 -0
  71. package/dist/preview-middleware/dist/client/adp/extension-point.ts +116 -0
  72. package/dist/preview-middleware/dist/client/adp/init-dialogs.js +142 -0
  73. package/dist/preview-middleware/dist/client/adp/init-dialogs.ts +178 -0
  74. package/dist/preview-middleware/dist/client/adp/init.js +111 -0
  75. package/dist/preview-middleware/dist/client/adp/init.ts +92 -0
  76. package/dist/preview-middleware/dist/client/adp/ovp-window-functions.js +130 -0
  77. package/dist/preview-middleware/dist/client/adp/ovp-window-functions.ts +171 -0
  78. package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +97 -0
  79. package/dist/preview-middleware/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.ts +140 -0
  80. package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.js +74 -0
  81. package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-controller-to-page.ts +92 -0
  82. package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-new-annotation-file.js +171 -0
  83. package/dist/preview-middleware/dist/client/adp/quick-actions/common/add-new-annotation-file.ts +174 -0
  84. package/dist/preview-middleware/dist/client/adp/quick-actions/common/create-page-action.js +56 -0
  85. package/dist/preview-middleware/dist/client/adp/quick-actions/common/create-page-action.ts +56 -0
  86. package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-custom-section.js +41 -0
  87. package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-custom-section.ts +51 -0
  88. package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-header-field.js +69 -0
  89. package/dist/preview-middleware/dist/client/adp/quick-actions/common/op-add-header-field.ts +81 -0
  90. package/dist/preview-middleware/dist/client/adp/quick-actions/common/utils.js +20 -0
  91. package/dist/preview-middleware/dist/client/adp/quick-actions/common/utils.ts +7 -0
  92. package/dist/preview-middleware/dist/client/adp/quick-actions/control-types.js +25 -0
  93. package/dist/preview-middleware/dist/client/adp/quick-actions/control-types.ts +7 -0
  94. package/dist/preview-middleware/dist/client/adp/quick-actions/dialog-enablement-validator.js +26 -0
  95. package/dist/preview-middleware/dist/client/adp/quick-actions/dialog-enablement-validator.ts +18 -0
  96. package/dist/preview-middleware/dist/client/adp/quick-actions/enablement-validator.js +2 -0
  97. package/dist/preview-middleware/dist/client/adp/quick-actions/enablement-validator.ts +19 -0
  98. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +82 -0
  99. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/add-new-subpage.ts +87 -0
  100. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +69 -0
  101. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-actions.ts +71 -0
  102. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +103 -0
  103. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/change-table-columns.ts +105 -0
  104. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-action.js +111 -0
  105. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-action.ts +110 -0
  106. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +108 -0
  107. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.ts +141 -0
  108. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +80 -0
  109. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +93 -0
  110. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +79 -0
  111. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +102 -0
  112. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +71 -0
  113. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.ts +98 -0
  114. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +61 -0
  115. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +77 -0
  116. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +95 -0
  117. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +102 -0
  118. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +86 -0
  119. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.ts +116 -0
  120. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/registry.js +79 -0
  121. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/registry.ts +121 -0
  122. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/utils.js +138 -0
  123. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v2/utils.ts +134 -0
  124. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +140 -0
  125. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/add-new-subpage.ts +181 -0
  126. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +81 -0
  127. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-actions.ts +81 -0
  128. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +90 -0
  129. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/change-table-columns.ts +97 -0
  130. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-page-action.js +81 -0
  131. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-page-action.ts +98 -0
  132. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.js +129 -0
  133. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-action-config-change.ts +149 -0
  134. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.js +142 -0
  135. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/create-table-custom-column-config-change.ts +178 -0
  136. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +83 -0
  137. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/enable-variant-management.ts +96 -0
  138. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +58 -0
  139. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts +70 -0
  140. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +86 -0
  141. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +96 -0
  142. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +55 -0
  143. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts +61 -0
  144. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.js +73 -0
  145. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-add-custom-section.ts +91 -0
  146. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +91 -0
  147. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +88 -0
  148. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/registry.js +62 -0
  149. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/registry.ts +86 -0
  150. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/utils.js +158 -0
  151. package/dist/preview-middleware/dist/client/adp/quick-actions/fe-v4/utils.ts +175 -0
  152. package/dist/preview-middleware/dist/client/adp/quick-actions/load.js +46 -0
  153. package/dist/preview-middleware/dist/client/adp/quick-actions/load.ts +23 -0
  154. package/dist/preview-middleware/dist/client/adp/quick-actions/quick-action-base.js +64 -0
  155. package/dist/preview-middleware/dist/client/adp/quick-actions/quick-action-base.ts +71 -0
  156. package/dist/preview-middleware/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -0
  157. package/dist/preview-middleware/dist/client/adp/quick-actions/simple-quick-action-base.ts +51 -0
  158. package/dist/preview-middleware/dist/client/adp/quick-actions/supported-ui5versions.md +40 -0
  159. package/dist/preview-middleware/dist/client/adp/quick-actions/table-quick-action-base.js +372 -0
  160. package/dist/preview-middleware/dist/client/adp/quick-actions/table-quick-action-base.ts +433 -0
  161. package/dist/preview-middleware/dist/client/adp/sync-views-utils.js +123 -0
  162. package/dist/preview-middleware/dist/client/adp/sync-views-utils.ts +90 -0
  163. package/dist/preview-middleware/dist/client/adp/ui/AddAction.fragment.xml +49 -0
  164. package/dist/preview-middleware/dist/client/adp/ui/AddCustomFragment.fragment.xml +48 -0
  165. package/dist/preview-middleware/dist/client/adp/ui/AddFragment.fragment.xml +83 -0
  166. package/dist/preview-middleware/dist/client/adp/ui/AddSubpage.fragment.xml +73 -0
  167. package/dist/preview-middleware/dist/client/adp/ui/AddTableColumnFragments.fragment.xml +63 -0
  168. package/dist/preview-middleware/dist/client/adp/ui/ControllerExtension.fragment.xml +63 -0
  169. package/dist/preview-middleware/dist/client/adp/ui/ExtensionPoint.fragment.xml +61 -0
  170. package/dist/preview-middleware/dist/client/adp/ui/FileExistsDialog.fragment.xml +43 -0
  171. package/dist/preview-middleware/dist/client/adp/utils.js +199 -0
  172. package/dist/preview-middleware/dist/client/adp/utils.ts +200 -0
  173. package/dist/preview-middleware/dist/client/cpe/additional-change-info/add-xml-additional-info.js +85 -0
  174. package/dist/preview-middleware/dist/client/cpe/additional-change-info/add-xml-additional-info.ts +107 -0
  175. package/dist/preview-middleware/dist/client/cpe/changes/flex-change.js +66 -0
  176. package/dist/preview-middleware/dist/client/cpe/changes/flex-change.ts +66 -0
  177. package/dist/preview-middleware/dist/client/cpe/changes/generic-change.js +321 -0
  178. package/dist/preview-middleware/dist/client/cpe/changes/generic-change.ts +462 -0
  179. package/dist/preview-middleware/dist/client/cpe/changes/index.js +12 -0
  180. package/dist/preview-middleware/dist/client/cpe/changes/index.ts +1 -0
  181. package/dist/preview-middleware/dist/client/cpe/changes/service.js +527 -0
  182. package/dist/preview-middleware/dist/client/cpe/changes/service.ts +595 -0
  183. package/dist/preview-middleware/dist/client/cpe/changes/validator.js +41 -0
  184. package/dist/preview-middleware/dist/client/cpe/changes/validator.ts +35 -0
  185. package/dist/preview-middleware/dist/client/cpe/communication-service.js +44 -0
  186. package/dist/preview-middleware/dist/client/cpe/communication-service.ts +41 -0
  187. package/dist/preview-middleware/dist/client/cpe/connector-service.js +88 -0
  188. package/dist/preview-middleware/dist/client/cpe/connector-service.ts +74 -0
  189. package/dist/preview-middleware/dist/client/cpe/context-menu-service.js +90 -0
  190. package/dist/preview-middleware/dist/client/cpe/context-menu-service.ts +77 -0
  191. package/dist/preview-middleware/dist/client/cpe/control-data.js +366 -0
  192. package/dist/preview-middleware/dist/client/cpe/control-data.ts +400 -0
  193. package/dist/preview-middleware/dist/client/cpe/documentation.js +191 -0
  194. package/dist/preview-middleware/dist/client/cpe/documentation.ts +187 -0
  195. package/dist/preview-middleware/dist/client/cpe/feature-service.js +39 -0
  196. package/dist/preview-middleware/dist/client/cpe/feature-service.ts +25 -0
  197. package/dist/preview-middleware/dist/client/cpe/init.js +92 -0
  198. package/dist/preview-middleware/dist/client/cpe/init.ts +114 -0
  199. package/dist/preview-middleware/dist/client/cpe/logger.js +32 -0
  200. package/dist/preview-middleware/dist/client/cpe/logger.ts +24 -0
  201. package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-checker.js +136 -0
  202. package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-checker.ts +160 -0
  203. package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-status.js +63 -0
  204. package/dist/preview-middleware/dist/client/cpe/odata-health/odata-health-status.ts +52 -0
  205. package/dist/preview-middleware/dist/client/cpe/outline/editable.js +38 -0
  206. package/dist/preview-middleware/dist/client/cpe/outline/editable.ts +30 -0
  207. package/dist/preview-middleware/dist/client/cpe/outline/nodes.js +212 -0
  208. package/dist/preview-middleware/dist/client/cpe/outline/nodes.ts +236 -0
  209. package/dist/preview-middleware/dist/client/cpe/outline/service.js +62 -0
  210. package/dist/preview-middleware/dist/client/cpe/outline/service.ts +66 -0
  211. package/dist/preview-middleware/dist/client/cpe/quick-actions/quick-action-service.js +161 -0
  212. package/dist/preview-middleware/dist/client/cpe/quick-actions/quick-action-service.ts +184 -0
  213. package/dist/preview-middleware/dist/client/cpe/quick-actions/registry.js +145 -0
  214. package/dist/preview-middleware/dist/client/cpe/quick-actions/registry.ts +157 -0
  215. package/dist/preview-middleware/dist/client/cpe/quick-actions/utils.js +94 -0
  216. package/dist/preview-middleware/dist/client/cpe/quick-actions/utils.ts +113 -0
  217. package/dist/preview-middleware/dist/client/cpe/rta-service.js +94 -0
  218. package/dist/preview-middleware/dist/client/cpe/rta-service.ts +86 -0
  219. package/dist/preview-middleware/dist/client/cpe/selection.js +249 -0
  220. package/dist/preview-middleware/dist/client/cpe/selection.ts +267 -0
  221. package/dist/preview-middleware/dist/client/cpe/ui5-utils.js +35 -0
  222. package/dist/preview-middleware/dist/client/cpe/ui5-utils.ts +28 -0
  223. package/dist/preview-middleware/dist/client/cpe/utils.js +113 -0
  224. package/dist/preview-middleware/dist/client/cpe/utils.ts +162 -0
  225. package/dist/preview-middleware/dist/client/flp/WorkspaceConnector.js +97 -0
  226. package/dist/preview-middleware/dist/client/flp/WorkspaceConnector.ts +101 -0
  227. package/dist/preview-middleware/dist/client/flp/common.js +30 -0
  228. package/dist/preview-middleware/dist/client/flp/common.ts +28 -0
  229. package/dist/preview-middleware/dist/client/flp/enableFakeConnector.js +92 -0
  230. package/dist/preview-middleware/dist/client/flp/enableFakeConnector.ts +113 -0
  231. package/dist/preview-middleware/dist/client/flp/homepage/Component.js +16 -0
  232. package/dist/preview-middleware/dist/client/flp/homepage/Component.ts +10 -0
  233. package/dist/preview-middleware/dist/client/flp/homepage/controller/MyHome.controller.js +54 -0
  234. package/dist/preview-middleware/dist/client/flp/homepage/controller/MyHome.controller.ts +41 -0
  235. package/dist/preview-middleware/dist/client/flp/homepage/css/style.css +3 -0
  236. package/dist/preview-middleware/dist/client/flp/homepage/manifest.json +41 -0
  237. package/dist/preview-middleware/dist/client/flp/homepage/view/MyHome.view.xml +18 -0
  238. package/dist/preview-middleware/dist/client/flp/init.js +418 -0
  239. package/dist/preview-middleware/dist/client/flp/init.ts +448 -0
  240. package/dist/preview-middleware/dist/client/flp/initCdm.js +117 -0
  241. package/dist/preview-middleware/dist/client/flp/initCdm.ts +111 -0
  242. package/dist/preview-middleware/dist/client/flp/initConnectors.js +31 -0
  243. package/dist/preview-middleware/dist/client/flp/initConnectors.ts +20 -0
  244. package/dist/preview-middleware/dist/client/flp/initRta.js +180 -0
  245. package/dist/preview-middleware/dist/client/flp/initRta.ts +194 -0
  246. package/dist/preview-middleware/dist/client/i18n.js +56 -0
  247. package/dist/preview-middleware/dist/client/i18n.ts +49 -0
  248. package/dist/preview-middleware/dist/client/manifest.json +8 -0
  249. package/dist/preview-middleware/dist/client/messagebundle.properties +143 -0
  250. package/dist/preview-middleware/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +486 -0
  251. package/dist/preview-middleware/dist/client/utils/additional-change-info.js +69 -0
  252. package/dist/preview-middleware/dist/client/utils/additional-change-info.ts +73 -0
  253. package/dist/preview-middleware/dist/client/utils/application.js +34 -0
  254. package/dist/preview-middleware/dist/client/utils/application.ts +27 -0
  255. package/dist/preview-middleware/dist/client/utils/core.js +144 -0
  256. package/dist/preview-middleware/dist/client/utils/core.ts +145 -0
  257. package/dist/preview-middleware/dist/client/utils/error.js +28 -0
  258. package/dist/preview-middleware/dist/client/utils/error.ts +18 -0
  259. package/dist/preview-middleware/dist/client/utils/fe-v2.js +58 -0
  260. package/dist/preview-middleware/dist/client/utils/fe-v2.ts +61 -0
  261. package/dist/preview-middleware/dist/client/utils/fe-v4.js +168 -0
  262. package/dist/preview-middleware/dist/client/utils/fe-v4.ts +186 -0
  263. package/dist/preview-middleware/dist/client/utils/info-center-message.js +60 -0
  264. package/dist/preview-middleware/dist/client/utils/info-center-message.ts +60 -0
  265. package/dist/preview-middleware/dist/client/utils/version.js +126 -0
  266. package/dist/preview-middleware/dist/client/utils/version.ts +138 -0
  267. package/dist/preview-middleware/templates/flp/cdm.base.json +47 -0
  268. package/dist/preview-middleware/templates/flp/cdm.ejs +72 -0
  269. package/dist/preview-middleware/templates/flp/editor.ejs +28 -0
  270. package/dist/preview-middleware/templates/flp/sandbox.ejs +88 -0
  271. package/dist/preview-middleware/templates/flp/sandbox2.ejs +86 -0
  272. package/dist/preview-middleware/templates/test/qunit.ejs +26 -0
  273. package/dist/preview-middleware/templates/test/qunit.js +29 -0
  274. package/dist/preview-middleware/templates/test/testsuite.qunit.ejs +10 -0
  275. package/dist/preview-middleware/templates/test/testsuite.qunit.js +8 -0
  276. package/dist/tasks/cf-deploy/index.js +3916 -3521
  277. package/dist/tasks/deploy/index.js +17204 -11133
  278. package/package.json +36 -39
  279. package/prebuilds/keyring.darwin-arm64.node +0 -0
  280. package/prebuilds/keyring.darwin-x64.node +0 -0
  281. package/prebuilds/keyring.linux-arm-gnueabihf.node +0 -0
  282. package/prebuilds/keyring.linux-arm64-gnu.node +0 -0
  283. package/prebuilds/keyring.linux-arm64-musl.node +0 -0
  284. package/prebuilds/keyring.linux-ia32-gnu.node +0 -0
  285. package/prebuilds/keyring.linux-x64-gnu.node +0 -0
  286. package/prebuilds/keyring.linux-x64-musl.node +0 -0
  287. package/prebuilds/keyring.win32-arm64-msvc.node +0 -0
  288. package/prebuilds/keyring.win32-ia32-msvc.node +0 -0
  289. package/prebuilds/keyring.win32-x64-msvc.node +0 -0
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/Component", "./core", "sap/ui/rta/command/CommandFactory", "../cpe/utils"], function (Component, ___core, CommandFactory, ___cpe_utils) {
4
+ "use strict";
5
+
6
+ const isA = ___core["isA"];
7
+ const getOverlay = ___cpe_utils["getOverlay"];
8
+ /**
9
+ * Gets app component of a v4 project.
10
+ *
11
+ * @param control - ManagedObject.
12
+ * @returns AppComponent.
13
+ */
14
+ function getV4AppComponent(control) {
15
+ const ownerComponent = Component.getOwnerComponentFor(control);
16
+ if (ownerComponent?.isA('sap.fe.core.TemplateComponent')) {
17
+ if (ownerComponent.getAppComponent) {
18
+ return ownerComponent.getAppComponent();
19
+ } else if (ownerComponent?.oAppComponent) {
20
+ return ownerComponent.oAppComponent;
21
+ }
22
+ }
23
+ return undefined;
24
+ }
25
+
26
+ /**
27
+ * Gets reference id of the app.
28
+ *
29
+ * @param control - ManagedObject.
30
+ * @returns string.
31
+ */
32
+ function getReference(control) {
33
+ const manifest = getV4AppComponent(control)?.getManifest();
34
+ return manifest?.['sap.app']?.id ?? '';
35
+ }
36
+
37
+ /**
38
+ * Determines the page type of v4 app.
39
+ *
40
+ * @param control - ManagedObject.
41
+ * @returns 'ObjectPage' | 'ListReport' | undefined.
42
+ */
43
+ function getV4PageType(control) {
44
+ const component = Component.getOwnerComponentFor(control);
45
+ if (!component?.isA('sap.fe.core.TemplateComponent')) {
46
+ return undefined;
47
+ }
48
+ const view = component.getRootControl();
49
+ const name = view.getViewName();
50
+ if (name === 'sap.fe.templates.ObjectPage.ObjectPage') {
51
+ return 'ObjectPage';
52
+ }
53
+ if (name === 'sap.fe.templates.ListReport.ListReport') {
54
+ return 'ListReport';
55
+ }
56
+ return undefined;
57
+ }
58
+
59
+ /**
60
+ * Get the containing page name of a control.
61
+ *
62
+ * @param control - UI5 control instance.
63
+ * @returns Page name to which the control belongs.
64
+ */
65
+ function getPageName(control) {
66
+ const component = Component.getOwnerComponentFor(control);
67
+ if (!isA('sap.fe.core.TemplateComponent', component)) {
68
+ return undefined;
69
+ }
70
+ const view = component.getRootControl();
71
+ return view.getId().split('::').pop();
72
+ }
73
+ function getConfigMapControlIdMap(page, propertyPathSegments) {
74
+ if (page && !propertyPathSegments.length) {
75
+ return page;
76
+ }
77
+ if (page) {
78
+ return `${page}-${propertyPathSegments.join('/')}`;
79
+ }
80
+ return propertyPathSegments.join('/');
81
+ }
82
+
83
+ /**
84
+ * Get the modified value for a control.
85
+ * @param modifiedControl - The modified control.
86
+ * @param flexSettings - Flex Settings of the control.
87
+ * @param propertyChanges - The change object
88
+ * @param propertyPathExtraSegments - optional path segments which are added to the default modified control manifest path
89
+ *
90
+ * @returns A Promise resolving to an array of FlexCommand objects.
91
+ */
92
+ async function createManifestPropertyChange(modifiedControl, flexSettings, propertyChanges, propertyPathExtraSegments) {
93
+ const overlay = getOverlay(modifiedControl);
94
+ if (!overlay) {
95
+ return undefined;
96
+ }
97
+ const overlayData = overlay.getDesignTimeMetadata().getData();
98
+ const settings = overlayData.manifestSettings(modifiedControl);
99
+ let manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
100
+ if (propertyPathExtraSegments) {
101
+ manifestPropertyPath += '/' + propertyPathExtraSegments.join('/');
102
+ }
103
+ const adjustedChanges = {};
104
+ for (const [key, value] of Object.entries(propertyChanges)) {
105
+ const setting = settings.find(s => s.id === key);
106
+ if (setting) {
107
+ adjustedChanges[setting.path ?? setting.id] = value;
108
+ } else {
109
+ adjustedChanges[key] = value;
110
+ }
111
+ }
112
+ const [manifestPropertyChange] = overlayData.manifestPropertyChange(adjustedChanges, manifestPropertyPath, modifiedControl);
113
+ const modifiedValue = {
114
+ reference: getReference(modifiedControl),
115
+ appComponent: manifestPropertyChange.appComponent,
116
+ changeType: manifestPropertyChange.changeSpecificData.appDescriptorChangeType,
117
+ parameters: manifestPropertyChange.changeSpecificData.content.parameters,
118
+ selector: manifestPropertyChange.selector
119
+ };
120
+ const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
121
+ return command;
122
+ }
123
+
124
+ /**
125
+ * Returns application object page definitions found in manifest
126
+ *
127
+ * @param manifest - manifest object
128
+ * @returns array with page descriptors
129
+ */
130
+ function getV4ApplicationPages(manifest) {
131
+ const result = [];
132
+ const targets = manifest['sap.ui5'].routing?.targets ?? {};
133
+ for (const target of Object.values(targets)) {
134
+ if (target.name === 'sap.fe.templates.ObjectPage') {
135
+ result.push({
136
+ id: target.id,
137
+ entitySet: target.options?.settings?.entitySet,
138
+ contextPath: target.options?.settings?.contextPath
139
+ });
140
+ }
141
+ }
142
+ return result;
143
+ }
144
+ /** * Checks if the given control is inside a table and returns the table instance.
145
+ * For UI5 version greater than 1.144 the table is 'sap.fe.macros.Table' and for lower versions it is 'sap.fe.macros.table.TableAPI'
146
+ * @param control - UI5 control instance.
147
+ * @returns Table instance if the control is inside a table, otherwise undefined.
148
+ */
149
+ function isMacroTable(table) {
150
+ if (table && (isA('sap.fe.macros.Table', table) || isA('sap.fe.macros.table.TableAPI', table))) {
151
+ return true;
152
+ }
153
+ return false;
154
+ }
155
+ var __exports = {
156
+ __esModule: true
157
+ };
158
+ __exports.getV4AppComponent = getV4AppComponent;
159
+ __exports.getReference = getReference;
160
+ __exports.getV4PageType = getV4PageType;
161
+ __exports.getPageName = getPageName;
162
+ __exports.getConfigMapControlIdMap = getConfigMapControlIdMap;
163
+ __exports.createManifestPropertyChange = createManifestPropertyChange;
164
+ __exports.getV4ApplicationPages = getV4ApplicationPages;
165
+ __exports.isMacroTable = isMacroTable;
166
+ return __exports;
167
+ });
168
+ //# sourceMappingURL=fe-v4.js.map
@@ -0,0 +1,186 @@
1
+ import ManagedObject from 'sap/ui/base/ManagedObject';
2
+ import TemplateComponent from 'sap/fe/core/TemplateComponent';
3
+ import Component from 'sap/ui/core/Component';
4
+ import AppComponent from 'sap/fe/core/AppComponent';
5
+ import XMLView from 'sap/ui/core/mvc/XMLView';
6
+ import type { FlexSettings, Manifest } from 'sap/ui/rta/RuntimeAuthoring';
7
+
8
+ import { isA } from './core';
9
+ import CommandFactory from 'sap/ui/rta/command/CommandFactory';
10
+ import { getOverlay } from '../cpe/utils';
11
+ import UI5Element from 'sap/ui/core/Element';
12
+ import FlexCommand from 'sap/ui/rta/command/FlexCommand';
13
+ import TableAPI from 'sap/fe/macros/table/TableAPI';
14
+
15
+ export type MacroTable = TableAPI & {
16
+ metaPath: string;
17
+ contextPath: string;
18
+ };
19
+
20
+ /**
21
+ * Gets app component of a v4 project.
22
+ *
23
+ * @param control - ManagedObject.
24
+ * @returns AppComponent.
25
+ */
26
+ export function getV4AppComponent(control: ManagedObject): AppComponent | undefined {
27
+ const ownerComponent = Component.getOwnerComponentFor(control);
28
+ if (ownerComponent?.isA<TemplateComponent>('sap.fe.core.TemplateComponent')) {
29
+ if (ownerComponent.getAppComponent) {
30
+ return ownerComponent.getAppComponent();
31
+ } else if ((ownerComponent as unknown as { oAppComponent: AppComponent })?.oAppComponent) {
32
+ return (ownerComponent as unknown as { oAppComponent: AppComponent }).oAppComponent;
33
+ }
34
+ }
35
+ return undefined;
36
+ }
37
+
38
+ /**
39
+ * Gets reference id of the app.
40
+ *
41
+ * @param control - ManagedObject.
42
+ * @returns string.
43
+ */
44
+ export function getReference(control: ManagedObject): string {
45
+ const manifest = getV4AppComponent(control)?.getManifest() as Manifest;
46
+ return manifest?.['sap.app']?.id ?? '';
47
+ }
48
+
49
+ /**
50
+ * Determines the page type of v4 app.
51
+ *
52
+ * @param control - ManagedObject.
53
+ * @returns 'ObjectPage' | 'ListReport' | undefined.
54
+ */
55
+ export function getV4PageType(control: ManagedObject): 'ObjectPage' | 'ListReport' | undefined {
56
+ const component = Component.getOwnerComponentFor(control);
57
+ if (!component?.isA<TemplateComponent>('sap.fe.core.TemplateComponent')) {
58
+ return undefined;
59
+ }
60
+ const view = component.getRootControl();
61
+ const name = (view as XMLView).getViewName();
62
+ if (name === 'sap.fe.templates.ObjectPage.ObjectPage') {
63
+ return 'ObjectPage';
64
+ }
65
+ if (name === 'sap.fe.templates.ListReport.ListReport') {
66
+ return 'ListReport';
67
+ }
68
+ return undefined;
69
+ }
70
+
71
+ /**
72
+ * Get the containing page name of a control.
73
+ *
74
+ * @param control - UI5 control instance.
75
+ * @returns Page name to which the control belongs.
76
+ */
77
+ export function getPageName(control: ManagedObject): string | undefined {
78
+ const component = Component.getOwnerComponentFor(control);
79
+ if (!isA<TemplateComponent>('sap.fe.core.TemplateComponent', component)) {
80
+ return undefined;
81
+ }
82
+ const view = component.getRootControl();
83
+ return view.getId().split('::').pop();
84
+ }
85
+
86
+ export function getConfigMapControlIdMap(page: string | undefined, propertyPathSegments: string[]): string {
87
+ if (page && !propertyPathSegments.length) {
88
+ return page;
89
+ }
90
+
91
+ if (page) {
92
+ return `${page}-${propertyPathSegments.join('/')}`;
93
+ }
94
+ return propertyPathSegments.join('/');
95
+ }
96
+
97
+ /**
98
+ * Get the modified value for a control.
99
+ * @param modifiedControl - The modified control.
100
+ * @param flexSettings - Flex Settings of the control.
101
+ * @param propertyChanges - The change object
102
+ * @param propertyPathExtraSegments - optional path segments which are added to the default modified control manifest path
103
+ *
104
+ * @returns A Promise resolving to an array of FlexCommand objects.
105
+ */
106
+ export async function createManifestPropertyChange(
107
+ modifiedControl: UI5Element,
108
+ flexSettings: FlexSettings,
109
+ propertyChanges: Record<string, string | string[] | boolean | number | object | undefined>,
110
+ propertyPathExtraSegments?: string[]
111
+ ): Promise<FlexCommand | undefined> {
112
+ const overlay = getOverlay(modifiedControl);
113
+ if (!overlay) {
114
+ return undefined;
115
+ }
116
+ const overlayData = overlay.getDesignTimeMetadata().getData();
117
+ const settings = overlayData.manifestSettings(modifiedControl);
118
+ let manifestPropertyPath = overlayData.manifestPropertyPath(modifiedControl);
119
+ if (propertyPathExtraSegments) {
120
+ manifestPropertyPath += '/' + propertyPathExtraSegments.join('/');
121
+ }
122
+ const adjustedChanges: Record<string, string | string[] | boolean | number | object | undefined> = {};
123
+ for (const [key, value] of Object.entries(propertyChanges)) {
124
+ const setting = settings.find((s) => s.id === key);
125
+ if (setting) {
126
+ adjustedChanges[setting.path ?? setting.id] = value;
127
+ } else {
128
+ adjustedChanges[key] = value;
129
+ }
130
+ }
131
+ const [manifestPropertyChange] = overlayData.manifestPropertyChange(
132
+ adjustedChanges,
133
+ manifestPropertyPath,
134
+ modifiedControl
135
+ );
136
+
137
+ const modifiedValue = {
138
+ reference: getReference(modifiedControl),
139
+ appComponent: manifestPropertyChange.appComponent,
140
+ changeType: manifestPropertyChange.changeSpecificData.appDescriptorChangeType,
141
+ parameters: manifestPropertyChange.changeSpecificData.content.parameters,
142
+ selector: manifestPropertyChange.selector
143
+ };
144
+
145
+ const command = await CommandFactory.getCommandFor(
146
+ modifiedControl,
147
+ 'appDescriptor',
148
+ modifiedValue,
149
+ null,
150
+ flexSettings
151
+ );
152
+
153
+ return command;
154
+ }
155
+
156
+ /**
157
+ * Returns application object page definitions found in manifest
158
+ *
159
+ * @param manifest - manifest object
160
+ * @returns array with page descriptors
161
+ */
162
+ export function getV4ApplicationPages(manifest: Manifest): { id: string; entitySet?: string; contextPath?: string }[] {
163
+ const result: { id: string; entitySet?: string; contextPath?: string }[] = [];
164
+ const targets = manifest['sap.ui5'].routing?.targets ?? {};
165
+ for (const target of Object.values(targets)) {
166
+ if (target.name === 'sap.fe.templates.ObjectPage') {
167
+ result.push({
168
+ id: target.id,
169
+ entitySet: target.options?.settings?.entitySet,
170
+ contextPath: target.options?.settings?.contextPath
171
+ });
172
+ }
173
+ }
174
+ return result;
175
+ }
176
+ /** * Checks if the given control is inside a table and returns the table instance.
177
+ * For UI5 version greater than 1.144 the table is 'sap.fe.macros.Table' and for lower versions it is 'sap.fe.macros.table.TableAPI'
178
+ * @param control - UI5 control instance.
179
+ * @returns Table instance if the control is inside a table, otherwise undefined.
180
+ */
181
+ export function isMacroTable(table: ManagedObject | null): table is MacroTable {
182
+ if (table && (isA<MacroTable>('sap.fe.macros.Table', table) || isA<MacroTable>('sap.fe.macros.table.TableAPI', table))) {
183
+ return true;
184
+ }
185
+ return false;
186
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../cpe/communication-service", "../i18n"], function (___sap_ux_private_control_property_editor_common, ___cpe_communication_service, ___i18n) {
4
+ "use strict";
5
+
6
+ const showInfoCenterMessage = ___sap_ux_private_control_property_editor_common["showInfoCenterMessage"];
7
+ const CommunicationService = ___cpe_communication_service["CommunicationService"];
8
+ const getTextBundle = ___i18n["getTextBundle"];
9
+ /**
10
+ * Localization key interface for defining message keys and optional parameters.
11
+ */
12
+ /**
13
+ * InfoCenterMessage interface for defining the structure of an Info center message.
14
+ * It includes title, description, optional details, and type.
15
+ */
16
+ /**
17
+ * Shows a localized/plain string message in the Info center.
18
+ *
19
+ * @param {InfoCenterMessage} message - The message object containing title, description,
20
+ * details and type for the message. Each text in the message can be localized or
21
+ * left as a plain string.
22
+ */
23
+ async function sendInfoCenterMessage({
24
+ title,
25
+ description,
26
+ details,
27
+ type
28
+ }) {
29
+ CommunicationService.sendAction(showInfoCenterMessage({
30
+ title: await getTranslation(title),
31
+ description: await getTranslation(description),
32
+ details: await getTranslation(details),
33
+ type
34
+ }));
35
+ }
36
+
37
+ /**
38
+ * Util function which returns translation for a localization key or a plain string.
39
+ * If the value is undefined, it returns undefined.
40
+ *
41
+ * @param {LocalizationKey | string | undefined} value - The localization key, plain string or undefined.
42
+ * @returns {Promise<string>} A promise that resolves to the translated string.
43
+ */
44
+ async function getTranslation(value) {
45
+ if (value === undefined) {
46
+ return undefined;
47
+ }
48
+ if (typeof value === 'string') {
49
+ return value;
50
+ }
51
+ const bundle = await getTextBundle();
52
+ return bundle.getText(value.key, value.params);
53
+ }
54
+ var __exports = {
55
+ __esModule: true
56
+ };
57
+ __exports.sendInfoCenterMessage = sendInfoCenterMessage;
58
+ return __exports;
59
+ });
60
+ //# sourceMappingURL=info-center-message.js.map
@@ -0,0 +1,60 @@
1
+ import { MessageBarType, showInfoCenterMessage } from '@sap-ux-private/control-property-editor-common';
2
+ import { CommunicationService } from '../cpe/communication-service';
3
+ import { getTextBundle } from '../i18n';
4
+
5
+ /**
6
+ * Localization key interface for defining message keys and optional parameters.
7
+ */
8
+ interface LocalizationKey {
9
+ key: string;
10
+ params?: string[];
11
+ }
12
+
13
+ /**
14
+ * InfoCenterMessage interface for defining the structure of an Info center message.
15
+ * It includes title, description, optional details, and type.
16
+ */
17
+ interface InfoCenterMessage {
18
+ title: LocalizationKey | string;
19
+ description: LocalizationKey | string;
20
+ details?: LocalizationKey | string;
21
+ type: MessageBarType;
22
+ }
23
+
24
+ /**
25
+ * Shows a localized/plain string message in the Info center.
26
+ *
27
+ * @param {InfoCenterMessage} message - The message object containing title, description,
28
+ * details and type for the message. Each text in the message can be localized or
29
+ * left as a plain string.
30
+ */
31
+ export async function sendInfoCenterMessage({ title, description, details, type }: InfoCenterMessage): Promise<void> {
32
+ CommunicationService.sendAction(
33
+ showInfoCenterMessage({
34
+ title: (await getTranslation(title))!,
35
+ description: (await getTranslation(description))!,
36
+ details: await getTranslation(details),
37
+ type
38
+ })
39
+ );
40
+ }
41
+
42
+ /**
43
+ * Util function which returns translation for a localization key or a plain string.
44
+ * If the value is undefined, it returns undefined.
45
+ *
46
+ * @param {LocalizationKey | string | undefined} value - The localization key, plain string or undefined.
47
+ * @returns {Promise<string>} A promise that resolves to the translated string.
48
+ */
49
+ async function getTranslation(value: LocalizationKey | string | undefined): Promise<string | undefined> {
50
+ if (value === undefined) {
51
+ return undefined;
52
+ }
53
+
54
+ if (typeof value === 'string') {
55
+ return value;
56
+ }
57
+
58
+ const bundle = await getTextBundle();
59
+ return bundle.getText(value.key, value.params);
60
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/VersionInfo", "sap/base/Log", "./info-center-message", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common"], function (VersionInfo, Log, ___info_center_message, ___sap_ux_private_control_property_editor_common) {
4
+ "use strict";
5
+
6
+ const sendInfoCenterMessage = ___info_center_message["sendInfoCenterMessage"];
7
+ const MessageBarType = ___sap_ux_private_control_property_editor_common["MessageBarType"];
8
+ /**
9
+ * Default minimal supported UI5 version
10
+ */
11
+ const minVersionInfo = {
12
+ major: 1,
13
+ minor: 71
14
+ };
15
+
16
+ /**
17
+ * Check if the given version info is valid.
18
+ *
19
+ * @param versionInfo to check
20
+ * @throws Error if the version info is invalid
21
+ */
22
+ function checkVersionInfo(versionInfo) {
23
+ if (Number.isNaN(versionInfo.major) || Number.isNaN(versionInfo.minor) || Number.isNaN(versionInfo.patch ?? 0)) {
24
+ void sendInfoCenterMessage({
25
+ title: {
26
+ key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE'
27
+ },
28
+ description: {
29
+ key: 'FLP_UI_INVALID_UI5_VERSION_DESCRIPTION'
30
+ },
31
+ type: MessageBarType.error
32
+ });
33
+ throw new Error('Invalid version info');
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Retrieve the UI5 version.
39
+ * If no library is given, the version from 'sap.ui.core' will be retrieved.
40
+ * Note that the patch version of actual SAPUI5 version might differ from the lib that has been used for the version request (e.g. SAPUI5 1.96.38 contains sap.ui.core 1.96.36).
41
+ * For details see the patch info of the respective SAPUI5 version (e.g. https://ui5.sap.com/1.96.38/patchinfo.html).
42
+ *
43
+ * @param library - (optional) specific library name to get the version from, e.g. 'sap.m'
44
+ * @returns Ui5VersionInfo
45
+ */
46
+ async function getUi5Version(library = 'sap.ui.core') {
47
+ const versionInfo = await VersionInfo.load();
48
+ let version = versionInfo?.libraries?.find(lib => lib.name === library)?.version;
49
+ const isCdn = versionInfo?.name === 'SAPUI5 Distribution';
50
+ if (!version) {
51
+ Log.error('Could not get UI5 version of application. Using version: 1.130.9 as fallback.');
52
+ version = '1.130.9';
53
+ await sendInfoCenterMessage({
54
+ title: {
55
+ key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_TITLE'
56
+ },
57
+ description: {
58
+ key: 'FLP_UI_VERSION_RETRIEVAL_FAILURE_DESCRIPTION',
59
+ params: [version]
60
+ },
61
+ type: MessageBarType.error
62
+ });
63
+ }
64
+ const [major, minor, patch] = version.split('.').map(versionPart => Number.parseInt(versionPart, 10));
65
+ const label = version.split(/-(.*)/s)?.[1];
66
+ return {
67
+ major,
68
+ minor,
69
+ patch,
70
+ label,
71
+ isCdn
72
+ };
73
+ }
74
+
75
+ /**
76
+ * Checks if the given version is lower than the required minimal version.
77
+ * Note that the patch version of actual SAPUI5 version might differ from the lib that has been used for the version request (e.g. SAPUI5 1.96.38 contains sap.ui.core 1.96.36).
78
+ * For details see the patch info of the respective SAPUI5 version (e.g. https://ui5.sap.com/1.96.38/patchinfo.html).
79
+ *
80
+ * @param ui5VersionInfo to check
81
+ * @param minUi5VersionInfo to check against (default is 1.71)
82
+ * @throws Error if the version info is invalid
83
+ * @returns boolean
84
+ */
85
+ function isLowerThanMinimalUi5Version(ui5VersionInfo, minUi5VersionInfo = minVersionInfo) {
86
+ checkVersionInfo(ui5VersionInfo);
87
+ checkVersionInfo(minUi5VersionInfo);
88
+ return ui5VersionInfo.major < minUi5VersionInfo.major || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor < minUi5VersionInfo.minor || ui5VersionInfo.major === minUi5VersionInfo.major && ui5VersionInfo.minor === minUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) < (minUi5VersionInfo?.patch ?? 0);
89
+ }
90
+
91
+ /**
92
+ * Checks if the given version is equal to the specified version.
93
+ * Note that the patch version of actual SAPUI5 version might differ from the lib that has been used for the version request (e.g. SAPUI5 1.96.38 contains sap.ui.core 1.96.36).
94
+ * For details see the patch info of the respective SAPUI5 version (e.g. https://ui5.sap.com/1.96.38/patchinfo.html).
95
+ *
96
+ * @param ui5VersionInfo to check
97
+ * @param targetUi5VersionInfo to check against (default is 1.71)
98
+ * @throws Error if the version info is invalid
99
+ * @returns boolean
100
+ */
101
+ function isVersionEqualOrHasNewerPatch(ui5VersionInfo, targetUi5VersionInfo = minVersionInfo) {
102
+ checkVersionInfo(ui5VersionInfo);
103
+ checkVersionInfo(targetUi5VersionInfo);
104
+ return ui5VersionInfo.major === targetUi5VersionInfo.major && ui5VersionInfo.minor === targetUi5VersionInfo.minor && (ui5VersionInfo?.patch ?? 0) >= (targetUi5VersionInfo?.patch ?? 0);
105
+ }
106
+
107
+ /**
108
+ * Returns the fully qualified UI5 version string - major and minor version concatenated.
109
+ *
110
+ * @param {Ui5VersionInfo} ui5VersionInfo - The ui5 version info object containing major and minor version.
111
+ * @returns {string} The fully qualified UI5 version string.
112
+ */
113
+ function getFullyQualifiedUi5Version(ui5VersionInfo) {
114
+ return `${ui5VersionInfo.major}.${ui5VersionInfo.minor}`;
115
+ }
116
+ var __exports = {
117
+ __esModule: true
118
+ };
119
+ __exports.minVersionInfo = minVersionInfo;
120
+ __exports.getUi5Version = getUi5Version;
121
+ __exports.isLowerThanMinimalUi5Version = isLowerThanMinimalUi5Version;
122
+ __exports.isVersionEqualOrHasNewerPatch = isVersionEqualOrHasNewerPatch;
123
+ __exports.getFullyQualifiedUi5Version = getFullyQualifiedUi5Version;
124
+ return __exports;
125
+ });
126
+ //# sourceMappingURL=version.js.map