@c8y/ngx-components 1022.13.0 → 1022.16.2

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 (390) hide show
  1. package/alarms/alarms.helper.d.ts.map +1 -1
  2. package/auth-configuration/sso-configuration/templates/template.component.d.ts +1 -1
  3. package/core/asset-property/asset-property.model.d.ts +2 -0
  4. package/core/asset-property/asset-property.model.d.ts.map +1 -1
  5. package/core/authentication/authentication.module.d.ts.map +1 -1
  6. package/core/dashboard/widget-auto-refresh-context/auto-refresh-control.component.d.ts.map +1 -1
  7. package/core/drop-area/drop-area.component.d.ts +2 -0
  8. package/core/drop-area/drop-area.component.d.ts.map +1 -1
  9. package/core/dynamic-forms/file/file.type.component.d.ts.map +1 -1
  10. package/core/modal/modal.module.d.ts.map +1 -1
  11. package/core/plugins/plugins.module.d.ts.map +1 -1
  12. package/core/plugins/plugins.service.d.ts +1 -2
  13. package/core/plugins/plugins.service.d.ts.map +1 -1
  14. package/core/select/select.component.d.ts.map +1 -1
  15. package/device-list/devices.breadcrumb-factory.d.ts +1 -0
  16. package/device-list/devices.breadcrumb-factory.d.ts.map +1 -1
  17. package/device-parameters/device-parameter-details.component.d.ts +22 -0
  18. package/device-parameters/device-parameter-details.component.d.ts.map +1 -0
  19. package/device-parameters/device-parameter-value.component.d.ts +12 -0
  20. package/device-parameters/device-parameter-value.component.d.ts.map +1 -0
  21. package/device-parameters/device-parameters-list.component.d.ts +2 -1
  22. package/device-parameters/device-parameters-list.component.d.ts.map +1 -1
  23. package/device-parameters/index.d.ts +5 -0
  24. package/device-parameters/index.d.ts.map +1 -1
  25. package/device-parameters/parameter-type-cell-renderer.components.d.ts +8 -0
  26. package/device-parameters/parameter-type-cell-renderer.components.d.ts.map +1 -0
  27. package/device-profile/add-device-profile.component.d.ts +1 -1
  28. package/device-profile/add-device-profile.component.d.ts.map +1 -1
  29. package/device-profile/device-profile-list.component.d.ts +1 -1
  30. package/device-profile/device-profile-list.component.d.ts.map +1 -1
  31. package/device-profile/device-profile.component.d.ts +1 -1
  32. package/device-profile/device-profile.component.d.ts.map +1 -1
  33. package/device-profile/device-profile.module.d.ts +17 -17
  34. package/device-profile/device-profile.module.d.ts.map +1 -1
  35. package/device-profile/device-tab-profile/device-profile-item-list.component.d.ts +1 -1
  36. package/device-profile/device-tab-profile/device-profile-item-list.component.d.ts.map +1 -1
  37. package/device-profile/device-tab-profile/device-tab-profile-detail.component.d.ts +1 -1
  38. package/device-profile/device-tab-profile/device-tab-profile-detail.component.d.ts.map +1 -1
  39. package/device-profile/device-tab-profile/device-tab-profile.component.d.ts +1 -1
  40. package/device-profile/device-tab-profile/device-tab-profile.component.d.ts.map +1 -1
  41. package/device-profile/select-configuration-modal.component.d.ts +1 -1
  42. package/device-profile/select-configuration-modal.component.d.ts.map +1 -1
  43. package/device-provisioned-certificates/device-tab-provisioned-certificates.component.d.ts +4 -2
  44. package/device-provisioned-certificates/device-tab-provisioned-certificates.component.d.ts.map +1 -1
  45. package/device-shell/command-templates/command-templates.component.d.ts +1 -1
  46. package/device-shell/command-templates/command-templates.component.d.ts.map +1 -1
  47. package/device-shell/command-templates/command-templates.directive.d.ts +1 -1
  48. package/device-shell/command-templates/command-templates.directive.d.ts.map +1 -1
  49. package/device-shell/command-templates/command-templates.module.d.ts +1 -1
  50. package/device-shell/shell/shell.component.d.ts +1 -1
  51. package/device-shell/shell/shell.component.d.ts.map +1 -1
  52. package/device-shell/shell/shell.module.d.ts +7 -7
  53. package/diagnostics/diagnostics.component.d.ts +1 -1
  54. package/diagnostics/diagnostics.component.d.ts.map +1 -1
  55. package/diagnostics/diagnostics.module.d.ts +8 -8
  56. package/diagnostics/diagnostics.module.d.ts.map +1 -1
  57. package/events/c8y-ngx-components-events.d.ts.map +1 -0
  58. package/events/events-timeline/c8y-ngx-components-events-events-timeline.d.ts.map +1 -0
  59. package/events/events-timeline/events-timeline.component.d.ts +19 -0
  60. package/events/events-timeline/events-timeline.component.d.ts.map +1 -0
  61. package/events/events-timeline/index.d.ts +2 -0
  62. package/events/events-timeline/index.d.ts.map +1 -0
  63. package/events/events.model.d.ts +6 -0
  64. package/events/events.model.d.ts.map +1 -0
  65. package/events/events.service.d.ts +10 -0
  66. package/events/events.service.d.ts.map +1 -0
  67. package/events/index.d.ts +3 -0
  68. package/events/index.d.ts.map +1 -0
  69. package/fesm2022/c8y-ngx-components-alarms.mjs +2 -1
  70. package/fesm2022/c8y-ngx-components-alarms.mjs.map +1 -1
  71. package/fesm2022/c8y-ngx-components-auth-configuration.mjs +2 -2
  72. package/fesm2022/c8y-ngx-components-auth-configuration.mjs.map +1 -1
  73. package/fesm2022/c8y-ngx-components-device-list.mjs +10 -3
  74. package/fesm2022/c8y-ngx-components-device-list.mjs.map +1 -1
  75. package/fesm2022/c8y-ngx-components-device-parameters.mjs +110 -13
  76. package/fesm2022/c8y-ngx-components-device-parameters.mjs.map +1 -1
  77. package/fesm2022/c8y-ngx-components-device-profile.mjs +126 -49
  78. package/fesm2022/c8y-ngx-components-device-profile.mjs.map +1 -1
  79. package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs +44 -12
  80. package/fesm2022/c8y-ngx-components-device-provisioned-certificates.mjs.map +1 -1
  81. package/fesm2022/c8y-ngx-components-device-shell.mjs +31 -22
  82. package/fesm2022/c8y-ngx-components-device-shell.mjs.map +1 -1
  83. package/fesm2022/c8y-ngx-components-diagnostics.mjs +36 -19
  84. package/fesm2022/c8y-ngx-components-diagnostics.mjs.map +1 -1
  85. package/fesm2022/c8y-ngx-components-events-events-timeline.mjs +45 -0
  86. package/fesm2022/c8y-ngx-components-events-events-timeline.mjs.map +1 -0
  87. package/fesm2022/c8y-ngx-components-events.mjs +44 -0
  88. package/fesm2022/c8y-ngx-components-events.mjs.map +1 -0
  89. package/fesm2022/c8y-ngx-components-operations-bulk-operation-from-single.mjs +8 -14
  90. package/fesm2022/c8y-ngx-components-operations-bulk-operation-from-single.mjs.map +1 -1
  91. package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs +49 -49
  92. package/fesm2022/c8y-ngx-components-operations-bulk-operation-list-item.mjs.map +1 -1
  93. package/fesm2022/c8y-ngx-components-operations-bulk-operation-scheduler.mjs +27 -14
  94. package/fesm2022/c8y-ngx-components-operations-bulk-operation-scheduler.mjs.map +1 -1
  95. package/fesm2022/c8y-ngx-components-operations-bulk-operation-stepper.mjs +27 -33
  96. package/fesm2022/c8y-ngx-components-operations-bulk-operation-stepper.mjs.map +1 -1
  97. package/fesm2022/c8y-ngx-components-operations-bulk-operations-list.mjs +51 -39
  98. package/fesm2022/c8y-ngx-components-operations-bulk-operations-list.mjs.map +1 -1
  99. package/fesm2022/c8y-ngx-components-operations-bulk-operations-stepper-container.mjs +10 -8
  100. package/fesm2022/c8y-ngx-components-operations-bulk-operations-stepper-container.mjs.map +1 -1
  101. package/fesm2022/c8y-ngx-components-operations-create-bulk-operation-details.mjs +16 -11
  102. package/fesm2022/c8y-ngx-components-operations-create-bulk-operation-details.mjs.map +1 -1
  103. package/fesm2022/c8y-ngx-components-operations-device-selector.mjs +8 -11
  104. package/fesm2022/c8y-ngx-components-operations-device-selector.mjs.map +1 -1
  105. package/fesm2022/c8y-ngx-components-operations-operation-details.mjs +25 -21
  106. package/fesm2022/c8y-ngx-components-operations-operation-details.mjs.map +1 -1
  107. package/fesm2022/c8y-ngx-components-operations-operation-summary.mjs +7 -9
  108. package/fesm2022/c8y-ngx-components-operations-operation-summary.mjs.map +1 -1
  109. package/fesm2022/c8y-ngx-components-operations-operations-list-item-details.mjs +31 -31
  110. package/fesm2022/c8y-ngx-components-operations-operations-list-item-details.mjs.map +1 -1
  111. package/fesm2022/c8y-ngx-components-operations-operations-list.mjs +3 -3
  112. package/fesm2022/c8y-ngx-components-operations-operations-list.mjs.map +1 -1
  113. package/fesm2022/c8y-ngx-components-operations-operations-timeline.mjs +33 -13
  114. package/fesm2022/c8y-ngx-components-operations-operations-timeline.mjs.map +1 -1
  115. package/fesm2022/c8y-ngx-components-operations-status-filter.mjs +19 -13
  116. package/fesm2022/c8y-ngx-components-operations-status-filter.mjs.map +1 -1
  117. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-configuration.mjs +40 -36
  118. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-configuration.mjs.map +1 -1
  119. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs +60 -41
  120. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-device-profile.mjs.map +1 -1
  121. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-firmware.mjs +122 -109
  122. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-firmware.mjs.map +1 -1
  123. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs +66 -41
  124. package/fesm2022/c8y-ngx-components-operations-stepper-bulk-type-software.mjs.map +1 -1
  125. package/fesm2022/c8y-ngx-components-operations-stepper-frames.mjs +11 -16
  126. package/fesm2022/c8y-ngx-components-operations-stepper-frames.mjs.map +1 -1
  127. package/fesm2022/c8y-ngx-components-protocol-opcua.mjs +212 -83
  128. package/fesm2022/c8y-ngx-components-protocol-opcua.mjs.map +1 -1
  129. package/fesm2022/c8y-ngx-components-repository-configuration.mjs +113 -54
  130. package/fesm2022/c8y-ngx-components-repository-configuration.mjs.map +1 -1
  131. package/fesm2022/c8y-ngx-components-repository-firmware.mjs +130 -62
  132. package/fesm2022/c8y-ngx-components-repository-firmware.mjs.map +1 -1
  133. package/fesm2022/c8y-ngx-components-repository-shared.mjs +37 -28
  134. package/fesm2022/c8y-ngx-components-repository-shared.mjs.map +1 -1
  135. package/fesm2022/c8y-ngx-components-repository-software.mjs +156 -83
  136. package/fesm2022/c8y-ngx-components-repository-software.mjs.map +1 -1
  137. package/fesm2022/c8y-ngx-components-services.mjs +32 -19
  138. package/fesm2022/c8y-ngx-components-services.mjs.map +1 -1
  139. package/fesm2022/c8y-ngx-components-trusted-certificates.mjs +66 -29
  140. package/fesm2022/c8y-ngx-components-trusted-certificates.mjs.map +1 -1
  141. package/fesm2022/c8y-ngx-components-upgrade-upgraded-services.mjs +16 -3
  142. package/fesm2022/c8y-ngx-components-upgrade-upgraded-services.mjs.map +1 -1
  143. package/fesm2022/c8y-ngx-components-upgrade.mjs +1 -14
  144. package/fesm2022/c8y-ngx-components-upgrade.mjs.map +1 -1
  145. package/fesm2022/c8y-ngx-components-user-roles.mjs +8 -3
  146. package/fesm2022/c8y-ngx-components-user-roles.mjs.map +1 -1
  147. package/fesm2022/c8y-ngx-components.mjs +864 -859
  148. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  149. package/locales/de.po +34 -17
  150. package/locales/es.po +20 -2
  151. package/locales/fr.po +20 -2
  152. package/locales/ja_JP.po +22 -4
  153. package/locales/ko.po +20 -2
  154. package/locales/locales.pot +19 -1
  155. package/locales/nl.po +20 -2
  156. package/locales/pl.po +20 -2
  157. package/locales/pt_BR.po +20 -2
  158. package/locales/zh_CN.po +21 -3
  159. package/locales/zh_TW.po +20 -2
  160. package/operations/bulk-operation-from-single/bulk-operation-from-single.component.d.ts +1 -1
  161. package/operations/bulk-operation-from-single/bulk-operation-from-single.component.d.ts.map +1 -1
  162. package/operations/bulk-operation-from-single/bulk-operation-from-single.module.d.ts +3 -5
  163. package/operations/bulk-operation-from-single/bulk-operation-from-single.module.d.ts.map +1 -1
  164. package/operations/bulk-operation-list-item/bulk-operation-list-item.component.d.ts +1 -1
  165. package/operations/bulk-operation-list-item/bulk-operation-list-item.component.d.ts.map +1 -1
  166. package/operations/bulk-operation-list-item/bulk-operation-list-item.module.d.ts +1 -7
  167. package/operations/bulk-operation-list-item/bulk-operation-list-item.module.d.ts.map +1 -1
  168. package/operations/bulk-operation-list-item/bulk-operation-wrapper.component.d.ts +1 -1
  169. package/operations/bulk-operation-list-item/bulk-operation-wrapper.component.d.ts.map +1 -1
  170. package/operations/bulk-operation-list-item/modal-body-host.directive.d.ts +1 -1
  171. package/operations/bulk-operation-list-item/modal-body-host.directive.d.ts.map +1 -1
  172. package/operations/bulk-operation-list-item/modals/bulk-operations-reschedule-modal.component.d.ts +1 -1
  173. package/operations/bulk-operation-list-item/modals/bulk-operations-reschedule-modal.component.d.ts.map +1 -1
  174. package/operations/bulk-operation-scheduler/bulk-operation-scheduler.module.d.ts +6 -6
  175. package/operations/bulk-operation-scheduler/operation-scheduler.component.d.ts +1 -1
  176. package/operations/bulk-operation-scheduler/operation-scheduler.component.d.ts.map +1 -1
  177. package/operations/bulk-operation-stepper/base-stepper.component.d.ts +1 -1
  178. package/operations/bulk-operation-stepper/bulk-operation-stepper.component.d.ts +1 -1
  179. package/operations/bulk-operation-stepper/bulk-operation-stepper.component.d.ts.map +1 -1
  180. package/operations/bulk-operation-stepper/bulk-operation-stepper.module.d.ts +1 -5
  181. package/operations/bulk-operation-stepper/bulk-operation-stepper.module.d.ts.map +1 -1
  182. package/operations/bulk-operation-stepper/custom-step.directive.d.ts +1 -1
  183. package/operations/bulk-operation-stepper/custom-step.directive.d.ts.map +1 -1
  184. package/operations/bulk-operations-list/bulk-operations-list.component.d.ts +1 -1
  185. package/operations/bulk-operations-list/bulk-operations-list.component.d.ts.map +1 -1
  186. package/operations/bulk-operations-list/bulk-operations-list.module.d.ts +4 -10
  187. package/operations/bulk-operations-list/bulk-operations-list.module.d.ts.map +1 -1
  188. package/operations/bulk-operations-list/modals/bulk-operations-modal.component.d.ts +1 -1
  189. package/operations/bulk-operations-list/modals/bulk-operations-modal.component.d.ts.map +1 -1
  190. package/operations/bulk-operations-stepper-container/bulk-operations-stepper-container.component.d.ts +1 -1
  191. package/operations/bulk-operations-stepper-container/bulk-operations-stepper-container.component.d.ts.map +1 -1
  192. package/operations/bulk-operations-stepper-container/bulk-operations-stepper-container.module.d.ts +3 -4
  193. package/operations/bulk-operations-stepper-container/bulk-operations-stepper-container.module.d.ts.map +1 -1
  194. package/operations/create-bulk-operation-details/create-bulk-operation-details.component.d.ts +1 -1
  195. package/operations/create-bulk-operation-details/create-bulk-operation-details.component.d.ts.map +1 -1
  196. package/operations/create-bulk-operation-details/create-bulk-operation-details.module.d.ts +1 -4
  197. package/operations/create-bulk-operation-details/create-bulk-operation-details.module.d.ts.map +1 -1
  198. package/operations/device-selector/device-selector.component.d.ts +1 -1
  199. package/operations/device-selector/device-selector.component.d.ts.map +1 -1
  200. package/operations/device-selector/device-selector.module.d.ts +1 -3
  201. package/operations/device-selector/device-selector.module.d.ts.map +1 -1
  202. package/operations/operation-details/operation-details-modal.component.d.ts +1 -1
  203. package/operations/operation-details/operation-details-modal.component.d.ts.map +1 -1
  204. package/operations/operation-details/operation-details.component.d.ts +1 -1
  205. package/operations/operation-details/operation-details.component.d.ts.map +1 -1
  206. package/operations/operation-details/operation-details.module.d.ts +1 -7
  207. package/operations/operation-details/operation-details.module.d.ts.map +1 -1
  208. package/operations/operation-details/operation-details.service.d.ts.map +1 -1
  209. package/operations/operation-summary/operation-summary.component.d.ts +1 -1
  210. package/operations/operation-summary/operation-summary.component.d.ts.map +1 -1
  211. package/operations/operation-summary/operation-summary.module.d.ts +1 -2
  212. package/operations/operation-summary/operation-summary.module.d.ts.map +1 -1
  213. package/operations/operations-list/operations-list-item.component.d.ts.map +1 -1
  214. package/operations/operations-list/operations-list.component.d.ts.map +1 -1
  215. package/operations/operations-list/operations-list.service.d.ts +1 -1
  216. package/operations/operations-list/operations-list.service.d.ts.map +1 -1
  217. package/operations/operations-list-item-details/operation-details-tabs.component.d.ts +1 -1
  218. package/operations/operations-list-item-details/operation-details-tabs.component.d.ts.map +1 -1
  219. package/operations/operations-list-item-details/operation-details.component.d.ts +1 -1
  220. package/operations/operations-list-item-details/operation-details.component.d.ts.map +1 -1
  221. package/operations/operations-list-item-details/operations-list-item-details.module.d.ts +1 -6
  222. package/operations/operations-list-item-details/operations-list-item-details.module.d.ts.map +1 -1
  223. package/operations/operations-timeline/operations-timeline.component.d.ts +5 -5
  224. package/operations/operations-timeline/operations-timeline.component.d.ts.map +1 -1
  225. package/operations/operations-timeline/operations-timeline.module.d.ts +4 -6
  226. package/operations/operations-timeline/operations-timeline.module.d.ts.map +1 -1
  227. package/operations/status-filter/status-filter.component.d.ts +1 -1
  228. package/operations/status-filter/status-filter.component.d.ts.map +1 -1
  229. package/operations/status-filter/status-filter.module.d.ts +1 -4
  230. package/operations/status-filter/status-filter.module.d.ts.map +1 -1
  231. package/operations/stepper-bulk-type-configuration/stepper-bulk-type-configuration.component.d.ts +1 -1
  232. package/operations/stepper-bulk-type-configuration/stepper-bulk-type-configuration.component.d.ts.map +1 -1
  233. package/operations/stepper-bulk-type-configuration/stepper-bulk-type-configuration.module.d.ts +1 -6
  234. package/operations/stepper-bulk-type-configuration/stepper-bulk-type-configuration.module.d.ts.map +1 -1
  235. package/operations/stepper-bulk-type-device-profile/confirm-device-profile-selection-step.component.d.ts +1 -1
  236. package/operations/stepper-bulk-type-device-profile/confirm-device-profile-selection-step.component.d.ts.map +1 -1
  237. package/operations/stepper-bulk-type-device-profile/select-device-profile-step.component.d.ts +1 -1
  238. package/operations/stepper-bulk-type-device-profile/select-device-profile-step.component.d.ts.map +1 -1
  239. package/operations/stepper-bulk-type-device-profile/stepper-bulk-type-device-profile.component.d.ts +1 -1
  240. package/operations/stepper-bulk-type-device-profile/stepper-bulk-type-device-profile.component.d.ts.map +1 -1
  241. package/operations/stepper-bulk-type-device-profile/stepper-bulk-type-device-profile.module.d.ts +1 -6
  242. package/operations/stepper-bulk-type-device-profile/stepper-bulk-type-device-profile.module.d.ts.map +1 -1
  243. package/operations/stepper-bulk-type-firmware/select-firmware.component.d.ts +1 -1
  244. package/operations/stepper-bulk-type-firmware/select-firmware.component.d.ts.map +1 -1
  245. package/operations/stepper-bulk-type-firmware/stepper-bulk-type-firmware.component.d.ts +1 -1
  246. package/operations/stepper-bulk-type-firmware/stepper-bulk-type-firmware.component.d.ts.map +1 -1
  247. package/operations/stepper-bulk-type-firmware/stepper-bulk-type-firmware.module.d.ts +1 -6
  248. package/operations/stepper-bulk-type-firmware/stepper-bulk-type-firmware.module.d.ts.map +1 -1
  249. package/operations/stepper-bulk-type-firmware/version-or-patch.component.d.ts +1 -1
  250. package/operations/stepper-bulk-type-firmware/version-or-patch.component.d.ts.map +1 -1
  251. package/operations/stepper-bulk-type-software/confirm-software-selection-step.component.d.ts +1 -1
  252. package/operations/stepper-bulk-type-software/confirm-software-selection-step.component.d.ts.map +1 -1
  253. package/operations/stepper-bulk-type-software/select-software-step.component.d.ts +1 -1
  254. package/operations/stepper-bulk-type-software/select-software-step.component.d.ts.map +1 -1
  255. package/operations/stepper-bulk-type-software/stepper-bulk-type-software.component.d.ts +1 -1
  256. package/operations/stepper-bulk-type-software/stepper-bulk-type-software.component.d.ts.map +1 -1
  257. package/operations/stepper-bulk-type-software/stepper-bulk-type-software.module.d.ts +1 -6
  258. package/operations/stepper-bulk-type-software/stepper-bulk-type-software.module.d.ts.map +1 -1
  259. package/operations/stepper-frames/preview-block.directive.d.ts +1 -1
  260. package/operations/stepper-frames/preview-block.directive.d.ts.map +1 -1
  261. package/operations/stepper-frames/preview-selection-frame.component.d.ts +1 -1
  262. package/operations/stepper-frames/preview-selection-frame.component.d.ts.map +1 -1
  263. package/operations/stepper-frames/select-step-frame.component.d.ts +1 -1
  264. package/operations/stepper-frames/select-step-frame.component.d.ts.map +1 -1
  265. package/operations/stepper-frames/stepper-frames.modules.d.ts +1 -2
  266. package/operations/stepper-frames/stepper-frames.modules.d.ts.map +1 -1
  267. package/package.json +1 -1
  268. package/protocol-opcua/opcua-address-space-detail.component.d.ts +1 -1
  269. package/protocol-opcua/opcua-address-space-detail.component.d.ts.map +1 -1
  270. package/protocol-opcua/opcua-address-space-tree.component.d.ts +1 -1
  271. package/protocol-opcua/opcua-address-space-tree.component.d.ts.map +1 -1
  272. package/protocol-opcua/opcua-address-space.component.d.ts +1 -1
  273. package/protocol-opcua/opcua-address-space.component.d.ts.map +1 -1
  274. package/protocol-opcua/opcua-auto-apply-settings.component.d.ts +1 -1
  275. package/protocol-opcua/opcua-auto-apply-settings.component.d.ts.map +1 -1
  276. package/protocol-opcua/opcua-device-protocol-browse-path-validation.directive.d.ts +1 -1
  277. package/protocol-opcua/opcua-device-protocol-browse-path-validation.directive.d.ts.map +1 -1
  278. package/protocol-opcua/opcua-device-protocol-data-reporting.component.d.ts +1 -1
  279. package/protocol-opcua/opcua-device-protocol-data-reporting.component.d.ts.map +1 -1
  280. package/protocol-opcua/opcua-device-protocol-description.component.d.ts +1 -1
  281. package/protocol-opcua/opcua-device-protocol-description.component.d.ts.map +1 -1
  282. package/protocol-opcua/opcua-device-protocol-detail.component.d.ts +1 -1
  283. package/protocol-opcua/opcua-device-protocol-detail.component.d.ts.map +1 -1
  284. package/protocol-opcua/opcua-device-protocol-mapping.component.d.ts +1 -1
  285. package/protocol-opcua/opcua-device-protocol-mapping.component.d.ts.map +1 -1
  286. package/protocol-opcua/opcua-device-protocol-object-mapping-status-icon.component.d.ts +1 -1
  287. package/protocol-opcua/opcua-device-protocol-object-mapping-status-icon.component.d.ts.map +1 -1
  288. package/protocol-opcua/opcua-protocol.module.d.ts +26 -26
  289. package/protocol-opcua/opcua-protocol.module.d.ts.map +1 -1
  290. package/protocol-opcua/opcua-server-config.component.d.ts +1 -1
  291. package/protocol-opcua/opcua-server-config.component.d.ts.map +1 -1
  292. package/protocol-opcua/opcua-server-list.component.d.ts +1 -1
  293. package/protocol-opcua/opcua-server-list.component.d.ts.map +1 -1
  294. package/protocol-opcua/opcua-servers.component.d.ts +1 -1
  295. package/protocol-opcua/opcua-servers.component.d.ts.map +1 -1
  296. package/repository/configuration/device-tab/configuration-filter.pipe.d.ts +1 -1
  297. package/repository/configuration/device-tab/configuration-filter.pipe.d.ts.map +1 -1
  298. package/repository/configuration/device-tab/configuration-preview.component.d.ts +1 -1
  299. package/repository/configuration/device-tab/configuration-preview.component.d.ts.map +1 -1
  300. package/repository/configuration/device-tab/configuration-repository-device-tab.module.d.ts +11 -13
  301. package/repository/configuration/device-tab/configuration-repository-device-tab.module.d.ts.map +1 -1
  302. package/repository/configuration/device-tab/device-configuration-list.component.d.ts +1 -1
  303. package/repository/configuration/device-tab/device-configuration-list.component.d.ts.map +1 -1
  304. package/repository/configuration/device-tab/device-configuration.component.d.ts +1 -1
  305. package/repository/configuration/device-tab/device-configuration.component.d.ts.map +1 -1
  306. package/repository/configuration/device-tab/save-to-repository.component.d.ts +1 -1
  307. package/repository/configuration/device-tab/save-to-repository.component.d.ts.map +1 -1
  308. package/repository/configuration/device-tab/source-code-preview.component.d.ts +1 -1
  309. package/repository/configuration/device-tab/source-code-preview.component.d.ts.map +1 -1
  310. package/repository/configuration/device-tab/text-based-configuration.component.d.ts +1 -1
  311. package/repository/configuration/device-tab/text-based-configuration.component.d.ts.map +1 -1
  312. package/repository/configuration/list/configuration-detail.component.d.ts +1 -1
  313. package/repository/configuration/list/configuration-detail.component.d.ts.map +1 -1
  314. package/repository/configuration/list/configuration-list.component.d.ts +1 -1
  315. package/repository/configuration/list/configuration-list.component.d.ts.map +1 -1
  316. package/repository/configuration/list/configuration-repository-list.module.d.ts +4 -7
  317. package/repository/configuration/list/configuration-repository-list.module.d.ts.map +1 -1
  318. package/repository/firmware/device-tab/firmware-device-tab.component.d.ts +1 -1
  319. package/repository/firmware/device-tab/firmware-device-tab.component.d.ts.map +1 -1
  320. package/repository/firmware/device-tab/firmware-repository-device-tab.module.d.ts +4 -6
  321. package/repository/firmware/device-tab/firmware-repository-device-tab.module.d.ts.map +1 -1
  322. package/repository/firmware/list/add-firmware-modal.component.d.ts +1 -1
  323. package/repository/firmware/list/add-firmware-modal.component.d.ts.map +1 -1
  324. package/repository/firmware/list/add-firmware-patch-modal.component.d.ts +1 -1
  325. package/repository/firmware/list/add-firmware-patch-modal.component.d.ts.map +1 -1
  326. package/repository/firmware/list/firmware-details.component.d.ts +1 -1
  327. package/repository/firmware/list/firmware-details.component.d.ts.map +1 -1
  328. package/repository/firmware/list/firmware-list.component.d.ts +1 -1
  329. package/repository/firmware/list/firmware-list.component.d.ts.map +1 -1
  330. package/repository/firmware/list/firmware-repository-list.module.d.ts +6 -11
  331. package/repository/firmware/list/firmware-repository-list.module.d.ts.map +1 -1
  332. package/repository/shared/file-download/file-download.component.d.ts +1 -1
  333. package/repository/shared/file-download/file-download.component.d.ts.map +1 -1
  334. package/repository/shared/select-modal/repository-select-modal.component.d.ts +1 -1
  335. package/repository/shared/select-modal/repository-select-modal.component.d.ts.map +1 -1
  336. package/repository/shared/shared-repository.module.d.ts +1 -4
  337. package/repository/shared/shared-repository.module.d.ts.map +1 -1
  338. package/repository/shared/software-type/software-type.component.d.ts +1 -1
  339. package/repository/shared/software-type/software-type.component.d.ts.map +1 -1
  340. package/repository/software/device-tab/device-software-changes.component.d.ts +1 -1
  341. package/repository/software/device-tab/device-software-changes.component.d.ts.map +1 -1
  342. package/repository/software/device-tab/device-software-list.component.d.ts +1 -1
  343. package/repository/software/device-tab/device-software-list.component.d.ts.map +1 -1
  344. package/repository/software/device-tab/installed-software.component.d.ts +1 -1
  345. package/repository/software/device-tab/installed-software.component.d.ts.map +1 -1
  346. package/repository/software/device-tab/software-device-tab.component.d.ts +1 -1
  347. package/repository/software/device-tab/software-device-tab.component.d.ts.map +1 -1
  348. package/repository/software/device-tab/software-repository-device-tab.module.d.ts +7 -11
  349. package/repository/software/device-tab/software-repository-device-tab.module.d.ts.map +1 -1
  350. package/repository/software/list/add-software-modal.component.d.ts +1 -1
  351. package/repository/software/list/add-software-modal.component.d.ts.map +1 -1
  352. package/repository/software/list/software-details.component.d.ts +1 -1
  353. package/repository/software/list/software-details.component.d.ts.map +1 -1
  354. package/repository/software/list/software-list.component.d.ts +1 -1
  355. package/repository/software/list/software-list.component.d.ts.map +1 -1
  356. package/repository/software/list/software-repository-list.module.d.ts +5 -11
  357. package/repository/software/list/software-repository-list.module.d.ts.map +1 -1
  358. package/services/services-device-tab/columns/last-updated-date.cell-renderer.component.d.ts +1 -1
  359. package/services/services-device-tab/columns/last-updated-date.cell-renderer.component.d.ts.map +1 -1
  360. package/services/services-device-tab/columns/name.cell-renderer.component.d.ts +1 -1
  361. package/services/services-device-tab/columns/name.cell-renderer.component.d.ts.map +1 -1
  362. package/services/services-device-tab/columns/status.cell-renderer.component.d.ts +1 -1
  363. package/services/services-device-tab/columns/status.cell-renderer.component.d.ts.map +1 -1
  364. package/services/services-device-tab/services-device-tab.component.d.ts +1 -1
  365. package/services/services-device-tab/services-device-tab.component.d.ts.map +1 -1
  366. package/services/services-device-tab/services-device-tab.module.d.ts +1 -4
  367. package/services/services-device-tab/services-device-tab.module.d.ts.map +1 -1
  368. package/trusted-certificates/crl/crl-settings.component.d.ts +5 -1
  369. package/trusted-certificates/crl/crl-settings.component.d.ts.map +1 -1
  370. package/trusted-certificates/factories/tabs.factory.d.ts +3 -2
  371. package/trusted-certificates/factories/tabs.factory.d.ts.map +1 -1
  372. package/trusted-certificates/factories/trusted-certificates-navigation.factory.d.ts +2 -0
  373. package/trusted-certificates/factories/trusted-certificates-navigation.factory.d.ts.map +1 -1
  374. package/trusted-certificates/list/trusted-certificate-list.component.d.ts +5 -1
  375. package/trusted-certificates/list/trusted-certificate-list.component.d.ts.map +1 -1
  376. package/trusted-certificates/trusted-certificates.guard.d.ts +11 -0
  377. package/trusted-certificates/trusted-certificates.guard.d.ts.map +1 -0
  378. package/upgrade/index.d.ts +0 -1
  379. package/upgrade/index.d.ts.map +1 -1
  380. package/upgrade/upgrade.module.d.ts.map +1 -1
  381. package/upgrade/upgraded-services/index.d.ts +1 -0
  382. package/upgrade/upgraded-services/index.d.ts.map +1 -1
  383. package/upgrade/upgraded-services/smart-rules.service.d.ts.map +1 -0
  384. package/upgrade/upgraded-services/upgraded-services.module.d.ts.map +1 -1
  385. package/user-roles/inventory-role-selector/inventory-role-selector.component.d.ts +2 -1
  386. package/user-roles/inventory-role-selector/inventory-role-selector.component.d.ts.map +1 -1
  387. package/user-roles/roles-asset-tree/roles-asset-tree.component.d.ts +2 -1
  388. package/user-roles/roles-asset-tree/roles-asset-tree.component.d.ts.map +1 -1
  389. package/upgrade/smart-rules.service.d.ts.map +0 -1
  390. /package/upgrade/{smart-rules.service.d.ts → upgraded-services/smart-rules.service.d.ts} +0 -0
@@ -15122,102 +15122,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
15122
15122
  args: ['document:keydown.enter', ['$event']]
15123
15123
  }] } });
15124
15124
 
15125
- /**
15126
- * Service to show a modal.
15127
- */
15128
- class ModalService {
15129
- constructor(modalService, gainsightService) {
15130
- this.modalService = modalService;
15131
- this.gainsightService = gainsightService;
15132
- }
15133
- /**
15134
- * Shows a quick confirm message modal.
15135
- * @param title The title of that modal.
15136
- * @param body The text body to display.
15137
- * @param status The status.
15138
- * @param labels The labels to use. Default: { ok: 'Confirm', cancel: 'Cancel'}
15139
- * @param confirmOptions Selection options to display as checkbox list.
15140
- * @param productExperienceEvent Additional data to attach to custom product experience events.
15141
- */
15142
- async confirm(title, body, status = Status.INFO, labels = {}, confirmOptions = {}, productExperienceEvent = { eventName: 'confirmModal' }) {
15143
- const modalLabels = {
15144
- ok: labels.ok || gettext$1('Confirm'),
15145
- cancel: labels.cancel || gettext$1('Cancel')
15146
- };
15147
- const modalRef = this.modalService.show(ConfirmModalComponent, {
15148
- initialState: { title, body, labels: modalLabels, status, confirmOptions },
15149
- ariaDescribedby: 'modal-body',
15150
- ariaLabelledBy: 'modal-title',
15151
- ignoreBackdropClick: true
15152
- });
15153
- if (productExperienceEvent) {
15154
- productExperienceEvent.data = { ...productExperienceEvent.data, title };
15155
- }
15156
- this.triggerEvent(modalRef.content.result, modalLabels, productExperienceEvent);
15157
- return await modalRef.content.result;
15158
- }
15159
- /**
15160
- * Shows a quick acknowledge message modal.
15161
- * @param title The title of that modal.
15162
- * @param body The text body to display.
15163
- * @param status The status.
15164
- * @param acknowledgeLabel The label to use.
15165
- * @param productExperienceEvent Additional data to attach to custom product experience events.
15166
- */
15167
- async acknowledge(title, body, status = Status.INFO, acknowledgeLabel = gettext$1('Confirm'), productExperienceEvent = { eventName: 'confirmModal' }) {
15168
- const labels = { ok: acknowledgeLabel, cancel: null };
15169
- const modalRef = this.modalService.show(ConfirmModalComponent, {
15170
- initialState: { title, body, labels, status },
15171
- ariaDescribedby: 'modal-body',
15172
- ariaLabelledBy: 'modal-title',
15173
- ignoreBackdropClick: true
15174
- });
15175
- if (productExperienceEvent) {
15176
- productExperienceEvent.data = { ...productExperienceEvent.data, title };
15177
- }
15178
- this.triggerEvent(modalRef.content.result, labels, productExperienceEvent);
15179
- return await modalRef.content.result;
15180
- }
15181
- /**
15182
- * Shows a quick logout confirmation modal.
15183
- * @param body The text body to display. Default: 'You will be logged out to apply your changes. Do you want to proceed?'
15184
- * @param status The status.
15185
- * @param labels The labels to use. Default: { ok: 'Confirm and log out', cancel: 'Cancel' }
15186
- */
15187
- async confirmLogout(body, status = Status.WARNING, labels = {}) {
15188
- const modalLabels = {
15189
- ok: labels.ok || gettext$1('Confirm and log out'),
15190
- cancel: labels.cancel || gettext$1('Cancel')
15191
- };
15192
- const modalBody = body || gettext$1('You must log out to apply your changes. Do you want to proceed?');
15193
- return await this.confirm(gettext$1('Logout required'), modalBody, status, modalLabels);
15194
- }
15195
- triggerEvent(result, labels, productExperienceEvent) {
15196
- const data = { ...productExperienceEvent.data, url: window.location.href };
15197
- result
15198
- .then(() => {
15199
- this.gainsightService.triggerEvent(productExperienceEvent.eventName, {
15200
- ...data,
15201
- result: labels.ok
15202
- });
15203
- })
15204
- .catch(() => {
15205
- this.gainsightService.triggerEvent(productExperienceEvent.eventName, {
15206
- ...data,
15207
- result: labels.cancel
15208
- });
15209
- });
15210
- }
15211
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalService, deps: [{ token: i1$7.BsModalService }, { token: GainsightService }], target: i0.ɵɵFactoryTarget.Injectable }); }
15212
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalService, providedIn: 'root' }); }
15213
- }
15214
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalService, decorators: [{
15215
- type: Injectable,
15216
- args: [{
15217
- providedIn: 'root'
15218
- }]
15219
- }], ctorParameters: () => [{ type: i1$7.BsModalService }, { type: GainsightService }] });
15220
-
15221
15125
  /**
15222
15126
  * The angular module definition for modal.
15223
15127
  * @exports ConfirmModalComponent
@@ -15229,7 +15133,7 @@ class ModalModule {
15229
15133
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: ModalModule, imports: [i1$7.ModalModule, CommonModule, i1$9.PopoverModule, ConfirmModalComponent,
15230
15134
  ModalComponent,
15231
15135
  PopoverConfirmComponent], exports: [ConfirmModalComponent, ModalComponent, PopoverConfirmComponent] }); }
15232
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalModule, providers: [ModalService], imports: [ModalModule$1.forRoot(),
15136
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalModule, imports: [ModalModule$1.forRoot(),
15233
15137
  CommonModule,
15234
15138
  PopoverModule.forRoot(),
15235
15139
  PopoverConfirmComponent] }); }
@@ -15245,8 +15149,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
15245
15149
  ModalComponent,
15246
15150
  PopoverConfirmComponent
15247
15151
  ],
15248
- exports: [ConfirmModalComponent, ModalComponent, PopoverConfirmComponent],
15249
- providers: [ModalService]
15152
+ exports: [ConfirmModalComponent, ModalComponent, PopoverConfirmComponent]
15250
15153
  }]
15251
15154
  }] });
15252
15155
 
@@ -19203,6 +19106,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
19203
19106
  }]
19204
19107
  }] });
19205
19108
 
19109
+ /**
19110
+ * Service to show a modal.
19111
+ */
19112
+ class ModalService {
19113
+ constructor(modalService, gainsightService) {
19114
+ this.modalService = modalService;
19115
+ this.gainsightService = gainsightService;
19116
+ }
19117
+ /**
19118
+ * Shows a quick confirm message modal.
19119
+ * @param title The title of that modal.
19120
+ * @param body The text body to display.
19121
+ * @param status The status.
19122
+ * @param labels The labels to use. Default: { ok: 'Confirm', cancel: 'Cancel'}
19123
+ * @param confirmOptions Selection options to display as checkbox list.
19124
+ * @param productExperienceEvent Additional data to attach to custom product experience events.
19125
+ */
19126
+ async confirm(title, body, status = Status.INFO, labels = {}, confirmOptions = {}, productExperienceEvent = { eventName: 'confirmModal' }) {
19127
+ const modalLabels = {
19128
+ ok: labels.ok || gettext$1('Confirm'),
19129
+ cancel: labels.cancel || gettext$1('Cancel')
19130
+ };
19131
+ const modalRef = this.modalService.show(ConfirmModalComponent, {
19132
+ initialState: { title, body, labels: modalLabels, status, confirmOptions },
19133
+ ariaDescribedby: 'modal-body',
19134
+ ariaLabelledBy: 'modal-title',
19135
+ ignoreBackdropClick: true
19136
+ });
19137
+ if (productExperienceEvent) {
19138
+ productExperienceEvent.data = { ...productExperienceEvent.data, title };
19139
+ }
19140
+ this.triggerEvent(modalRef.content.result, modalLabels, productExperienceEvent);
19141
+ return await modalRef.content.result;
19142
+ }
19143
+ /**
19144
+ * Shows a quick acknowledge message modal.
19145
+ * @param title The title of that modal.
19146
+ * @param body The text body to display.
19147
+ * @param status The status.
19148
+ * @param acknowledgeLabel The label to use.
19149
+ * @param productExperienceEvent Additional data to attach to custom product experience events.
19150
+ */
19151
+ async acknowledge(title, body, status = Status.INFO, acknowledgeLabel = gettext$1('Confirm'), productExperienceEvent = { eventName: 'confirmModal' }) {
19152
+ const labels = { ok: acknowledgeLabel, cancel: null };
19153
+ const modalRef = this.modalService.show(ConfirmModalComponent, {
19154
+ initialState: { title, body, labels, status },
19155
+ ariaDescribedby: 'modal-body',
19156
+ ariaLabelledBy: 'modal-title',
19157
+ ignoreBackdropClick: true
19158
+ });
19159
+ if (productExperienceEvent) {
19160
+ productExperienceEvent.data = { ...productExperienceEvent.data, title };
19161
+ }
19162
+ this.triggerEvent(modalRef.content.result, labels, productExperienceEvent);
19163
+ return await modalRef.content.result;
19164
+ }
19165
+ /**
19166
+ * Shows a quick logout confirmation modal.
19167
+ * @param body The text body to display. Default: 'You will be logged out to apply your changes. Do you want to proceed?'
19168
+ * @param status The status.
19169
+ * @param labels The labels to use. Default: { ok: 'Confirm and log out', cancel: 'Cancel' }
19170
+ */
19171
+ async confirmLogout(body, status = Status.WARNING, labels = {}) {
19172
+ const modalLabels = {
19173
+ ok: labels.ok || gettext$1('Confirm and log out'),
19174
+ cancel: labels.cancel || gettext$1('Cancel')
19175
+ };
19176
+ const modalBody = body || gettext$1('You must log out to apply your changes. Do you want to proceed?');
19177
+ return await this.confirm(gettext$1('Logout required'), modalBody, status, modalLabels);
19178
+ }
19179
+ triggerEvent(result, labels, productExperienceEvent) {
19180
+ const data = { ...productExperienceEvent.data, url: window.location.href };
19181
+ result
19182
+ .then(() => {
19183
+ this.gainsightService.triggerEvent(productExperienceEvent.eventName, {
19184
+ ...data,
19185
+ result: labels.ok
19186
+ });
19187
+ })
19188
+ .catch(() => {
19189
+ this.gainsightService.triggerEvent(productExperienceEvent.eventName, {
19190
+ ...data,
19191
+ result: labels.cancel
19192
+ });
19193
+ });
19194
+ }
19195
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalService, deps: [{ token: i1$7.BsModalService }, { token: GainsightService }], target: i0.ɵɵFactoryTarget.Injectable }); }
19196
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalService, providedIn: 'root' }); }
19197
+ }
19198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ModalService, decorators: [{
19199
+ type: Injectable,
19200
+ args: [{
19201
+ providedIn: 'root'
19202
+ }]
19203
+ }], ctorParameters: () => [{ type: i1$7.BsModalService }, { type: GainsightService }] });
19204
+
19206
19205
  class ThemeSwitcherService {
19207
19206
  constructor(options) {
19208
19207
  this.options = options;
@@ -19594,10 +19593,11 @@ class PasswordService {
19594
19593
  return this.DEFAULT_PASSWORD_MIN_LENGTH;
19595
19594
  }
19596
19595
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordService, deps: [{ token: i1$7.BsModalService }], target: i0.ɵɵFactoryTarget.Injectable }); }
19597
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordService }); }
19596
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordService, providedIn: 'root' }); }
19598
19597
  }
19599
19598
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordService, decorators: [{
19600
- type: Injectable
19599
+ type: Injectable,
19600
+ args: [{ providedIn: 'root' }]
19601
19601
  }], ctorParameters: () => [{ type: i1$7.BsModalService }] });
19602
19602
 
19603
19603
  class TotpSetupComponent {
@@ -20424,63 +20424,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
20424
20424
  args: [{ selector: 'c8y-user-menu-outlet', standalone: true, imports: [NgIf, NgFor, OutletDirective, UserMenuItemComponent, C8yTranslatePipe, AsyncPipe], template: "<ng-container *ngIf=\"items$ | async as items\">\n <div\n class=\"p-t-8 p-b-8\"\n *ngIf=\"items.length\"\n >\n <ul class=\"list-unstyled m-b-0\">\n <ng-container *ngFor=\"let item of items\">\n <ng-container *ngIf=\"item.template\">\n <ng-container *c8yOutlet=\"item.template\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"!item.template\">\n <li>\n <button\n class=\"c8y-right-drawer__link\"\n [attr.aria-label]=\"item.label | translate\"\n [attr.tabindex]=\"(open$ | async) ? '0' : '-1'\"\n type=\"button\"\n (click)=\"item.click()\"\n [attr.href]=\"item.link\"\n [attr.target]=\"item.target\"\n >\n {{ item.label | translate }}\n </button>\n </li>\n </ng-container>\n </ng-container>\n </ul>\n </div>\n</ng-container>\n\n<!-- the default items -->\n<c8y-user-menu-item\n [icon]=\"'user-menu-male'\"\n *ngIf=\"(ui.currentUser | async) && (ui.currentUser | async).id !== 'NO_LOGIN'\"\n [label]=\"'User settings' | translate\"\n [priority]=\"20\"\n [dataCy]=\"'user-menu-user-settings-button'\"\n (click)=\"editUser()\"\n></c8y-user-menu-item>\n<c8y-user-menu-item\n [icon]=\"'sign-out'\"\n *ngIf=\"(ui.currentUser | async) && (ui.currentUser | async).id !== 'NO_LOGIN'\"\n [label]=\"'Logout' | translate\"\n [dataCy]=\"'user-menu-logout-button'\"\n (click)=\"logout()\"\n></c8y-user-menu-item>\n" }]
20425
20425
  }], ctorParameters: () => [{ type: AppStateService }, { type: i1$7.BsModalService }, { type: SimplifiedAuthService }, { type: UserMenuService }, { type: HeaderService }] });
20426
20426
 
20427
- class PasswordStrengthCheckerService {
20428
- constructor() {
20429
- this.GREEN = {
20430
- colorName: 'green',
20431
- color: 'rgb(0, 128, 0)',
20432
- description: gettext$1('strong'),
20433
- passwordStrength: PasswordStrength.GREEN
20434
- };
20435
- this.YELLOW = {
20436
- colorName: 'yellow',
20437
- color: 'rgb(255, 204, 51)',
20438
- description: gettext$1('medium'),
20439
- passwordStrength: PasswordStrength.YELLOW
20440
- };
20441
- this.RED = {
20442
- colorName: 'red',
20443
- color: 'rgb(170, 0, 51)',
20444
- description: gettext$1('weak'),
20445
- passwordStrength: PasswordStrength.RED
20446
- };
20447
- }
20448
- hasLowerCase(password) {
20449
- return password.search(/[a-z]/) !== -1;
20450
- }
20451
- hasUpperCase(password) {
20452
- return password.search(/[A-Z]/) !== -1;
20453
- }
20454
- hasNumbers(password) {
20455
- return password.search(/[0-9]/) !== -1;
20456
- }
20457
- hasSpecialChars(password) {
20458
- return password.search(/[^0-9a-zA-Z]+/) !== -1;
20459
- }
20460
- getStrengthColor(password) {
20461
- const passwordStrength = filter$2([
20462
- this.hasLowerCase(password),
20463
- this.hasUpperCase(password),
20464
- this.hasNumbers(password),
20465
- this.hasSpecialChars(password)
20466
- ]).length;
20467
- if (passwordStrength > 3) {
20468
- return this.GREEN;
20469
- }
20470
- else if (passwordStrength >= 3) {
20471
- return this.YELLOW;
20472
- }
20473
- else {
20474
- return this.RED;
20475
- }
20476
- }
20477
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordStrengthCheckerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
20478
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordStrengthCheckerService }); }
20479
- }
20480
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordStrengthCheckerService, decorators: [{
20481
- type: Injectable
20482
- }] });
20483
-
20484
20427
  /**
20485
20428
  * @deprecated: [MTM-56403] Password strength indicator removed from UI in favor of the enhanced password strength check list.
20486
20429
  */
@@ -20541,7 +20484,7 @@ class AuthenticationModule {
20541
20484
  CurrentPasswordModalComponent,
20542
20485
  TotpSetupComponent,
20543
20486
  PasswordInputComponent] }); }
20544
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthenticationModule, providers: [PasswordStrengthCheckerService, PasswordService], imports: [FormsModule,
20487
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AuthenticationModule, imports: [FormsModule,
20545
20488
  TooltipModule,
20546
20489
  CommonModule,
20547
20490
  ModalModule,
@@ -20581,8 +20524,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
20581
20524
  CurrentPasswordModalComponent,
20582
20525
  TotpSetupComponent,
20583
20526
  PasswordInputComponent
20584
- ],
20585
- providers: [PasswordStrengthCheckerService, PasswordService]
20527
+ ]
20586
20528
  }]
20587
20529
  }] });
20588
20530
 
@@ -20827,769 +20769,770 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
20827
20769
  }]
20828
20770
  }] });
20829
20771
 
20830
- var ApplicationPluginStatus;
20831
- (function (ApplicationPluginStatus) {
20832
- ApplicationPluginStatus["ORPHANED"] = "ORPHANED";
20833
- ApplicationPluginStatus["LATEST"] = "LATEST";
20834
- ApplicationPluginStatus["OUTDATED"] = "OUTDATED";
20835
- ApplicationPluginStatus["REVOKED"] = "REVOKED";
20836
- ApplicationPluginStatus["AUTO"] = "AUTO";
20837
- })(ApplicationPluginStatus || (ApplicationPluginStatus = {}));
20838
- var PackageType;
20839
- (function (PackageType) {
20840
- /**
20841
- * A package coming from the official Cumulocity github enterprise.
20842
- */
20843
- PackageType["OFFICIAL"] = "OFFICIAL";
20844
- /**
20845
- * A package coming from any connected partner repository.
20846
- */
20847
- PackageType["COMMUNITY"] = "COMMUNITY";
20848
- /**
20849
- * A package where the origin is unknown (e.g. uploaded to management with an unknown label)
20850
- */
20851
- PackageType["UNKNOWN"] = "UNKNOWN";
20852
- /**
20853
- * A custom package e.g. uploaded to the tenant by a user
20854
- */
20855
- PackageType["CUSTOM"] = "CUSTOM";
20856
- /**
20857
- * A package that was archived by the user
20858
- */
20859
- PackageType["ARCHIVED"] = "ARCHIVED";
20860
- })(PackageType || (PackageType = {}));
20772
+ class PluginsModule {
20773
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
20774
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: PluginsModule }); }
20775
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsModule }); }
20776
+ }
20777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsModule, decorators: [{
20778
+ type: NgModule,
20779
+ args: [{
20780
+ providers: []
20781
+ }]
20782
+ }] });
20861
20783
 
20862
- class PluginsService {
20863
- static convertInstalledRemotesToIds(remotes) {
20864
- if (!remotes) {
20784
+ /**
20785
+ * An extension HOOK can use either a pure value:
20786
+ * ```typescript
20787
+ * { provide: HOOK_X, useValue: { ...hookValue }, multi: true }
20788
+ * ```
20789
+ *
20790
+ * Or an array to directly register multiple:
20791
+ * ```typescript
20792
+ * { provide: HOOK_X, useValue: [{ ...hookValues }], multi: true }
20793
+ * ```
20794
+ *
20795
+ * Or an ExtensionFactory which allows to define a get() function. This function
20796
+ * gets called on each navigation with the current route and can return values
20797
+ * async (observable or promise).
20798
+ * ```typescript
20799
+ * { provide: HOOK_X, useFactory: { get: (route) => doSomethingAsync(route) }, multi: true }
20800
+ * ```
20801
+ * @deprecated Consider using the `hookVersion` function instead.
20802
+ */
20803
+ const HOOK_VERSION = new InjectionToken('HOOK_VERSION');
20804
+ const VERSION_MODULE_CONFIG = new InjectionToken('VERSION_MODULE_CONFIG');
20805
+ /**
20806
+ * You can either provide a single `Version` as parameter:
20807
+ * ```typescript
20808
+ * hookVersion(...)
20809
+ * ```
20810
+ *
20811
+ * Or an array to directly register multiple:
20812
+ * ```typescript
20813
+ * hookVersion([...])
20814
+ * ```
20815
+ *
20816
+ * Or you provide an Service that implements `ExtensionFactory<Version>`
20817
+ * ```typescript
20818
+ * export class MyVersionFactory implements ExtensionFactory<Version> {...}
20819
+ * ...
20820
+ * hookVersion(MyVersionFactory)
20821
+ * ```
20822
+ * A typed alternative to `HOOK_VERSION`.
20823
+ * @param versions The `Version`'s or `ExtensionFactory` to be provided.
20824
+ * @returns An `Provider` to be provided in your module.
20825
+ */
20826
+ function hookVersion(versions, options) {
20827
+ return hookGeneric(versions, HOOK_VERSION, options);
20828
+ }
20829
+
20830
+ /**
20831
+ * Will provide the backend versions of the tenant.
20832
+ * The system option 'system' -> 'version' is used for this.
20833
+ */
20834
+ class BackendVersionFactory {
20835
+ constructor(config, appState) {
20836
+ this.config = config;
20837
+ this.appState = appState;
20838
+ this.backendVersion$ = of([]);
20839
+ if (this.config?.disableBackendVersionFactory) {
20865
20840
  return;
20866
20841
  }
20867
- const importContextPaths = Object.keys(remotes);
20868
- const plugins = [];
20869
- importContextPaths.forEach(contextPath => {
20870
- const moduleNames = remotes[contextPath] || [];
20871
- plugins.push(...moduleNames.map(module => PluginsService.createPluginId(contextPath, module, '', true)));
20872
- });
20873
- return plugins;
20874
- }
20875
- static createPluginId(contextPath, plugin, version, useLatest = false) {
20876
- const moduleName = typeof plugin === 'string' ? plugin : plugin.module;
20877
- if (useLatest) {
20878
- return `${contextPath}/${moduleName}`;
20879
- }
20880
- return `${contextPath}@${version}/${moduleName}`;
20842
+ this.backendVersion$ = this.appState.state$.pipe(map(state => state?.versions?.backend), filter(backendVersion => !!backendVersion), distinctUntilChanged(), map(backendVersion => this.buildBackendVersion(backendVersion)), shareReplay(1));
20881
20843
  }
20882
- constructor(applicationService, appStateService, client) {
20883
- this.applicationService = applicationService;
20884
- this.appStateService = appStateService;
20885
- this.client = client;
20844
+ get() {
20845
+ return this.backendVersion$;
20886
20846
  }
20887
- /**
20888
- * Fetches a list of available packages.
20889
- * @param params Additional query parameters.
20890
- * @returns Returns a list of packages.
20891
- */
20892
- async listPackages(params = {}) {
20893
- const apps = await this.listApplicationsByCurrentTenant(params);
20894
- const webApps = apps.filter(app => this.isPackage(app));
20895
- const uniqueWebApps = this.removeDuplicates(webApps, 'contextPath');
20896
- return uniqueWebApps.sort((a, b) => a.name.localeCompare(b.name));
20847
+ buildBackendVersion(backendVersion) {
20848
+ return {
20849
+ label: gettext$1('Backend'),
20850
+ version: backendVersion,
20851
+ priority: 20,
20852
+ type: 'SYSTEM',
20853
+ hidden: true
20854
+ };
20897
20855
  }
20898
- /**
20899
- * Checks if an application is a package.
20900
- * @param application Application managed object.
20901
- * @returns Returns true if the application is a package.
20902
- */
20903
- isPackage(application) {
20904
- return application.manifest?.isPackage === true;
20856
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BackendVersionFactory, deps: [{ token: VERSION_MODULE_CONFIG, optional: true }, { token: AppStateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
20857
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BackendVersionFactory, providedIn: 'root' }); }
20858
+ }
20859
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BackendVersionFactory, decorators: [{
20860
+ type: Injectable,
20861
+ args: [{
20862
+ providedIn: 'root'
20863
+ }]
20864
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
20865
+ type: Optional
20866
+ }, {
20867
+ type: Inject,
20868
+ args: [VERSION_MODULE_CONFIG]
20869
+ }] }, { type: AppStateService }] });
20870
+
20871
+ class VersionService extends ExtensionPointForPlugins {
20872
+ constructor(rootInjector, pluginService) {
20873
+ super(rootInjector, pluginService);
20874
+ this.items$ = this.setupItemsObservable();
20875
+ this.nonHiddenItems$ = this.items$.pipe(map(versions => versions.filter(version => !version.hidden)));
20905
20876
  }
20906
- /**
20907
- * Updates the remotes field in the application configuration by adding new plugins.
20908
- * Important: if the remotes object is not set on the configuration object,
20909
- * remotes will not be added. Make sure that this object exists in the application configuration.
20910
- * @param application Application managed object.
20911
- * @param plugins List of remotes to be added.
20912
- * @returns Returns updated application remotes.
20913
- */
20914
- async addRemotes(application, plugins) {
20915
- const pluginsArray = Array.isArray(plugins) ? plugins : [plugins];
20916
- const manifestRemotes = application.manifest?.remotes || {};
20917
- const appConfig = application?.config;
20918
- const appConfigRemotes = appConfig?.remotes || manifestRemotes;
20919
- const appConfigExcludedRemotes = appConfig?.excludedRemotes || {};
20920
- // only normal and self optional scoped plugins should be added to remotes
20921
- // self scoped plugins will be automatically added
20922
- const allPluginsExceptSelfScoped = this.getAllPluginsExceptSelfScoped(pluginsArray, application.contextPath);
20923
- const newRemotes = this.addPluginToRemotesConfig(appConfigRemotes, allPluginsExceptSelfScoped);
20924
- // should be unproblematic to remove all categories of plugins from excluded remotes
20925
- const newExcludedRemotes = this.removePluginsFromRemotesConfig(appConfigExcludedRemotes, plugins);
20926
- return await this.updateRemotesInAppConfig(application, newRemotes, newExcludedRemotes);
20877
+ get state() {
20878
+ return this.state$.value;
20927
20879
  }
20928
- /**
20929
- * Updates the remotes field in the application configuration by removing plugins.
20930
- * @param application Application managed object.
20931
- * @param plugins List of remotes to be removed.
20932
- * @returns Returns updated application remotes.
20933
- */
20934
- async removeRemotes(application, plugins) {
20935
- const pluginsArray = Array.isArray(plugins) ? plugins : [plugins];
20936
- const manifestRemotes = application.manifest?.remotes || {};
20937
- const appConfig = application?.config;
20938
- const appConfigRemotes = appConfig?.remotes || manifestRemotes;
20939
- const appConfigExcludedRemotes = appConfig?.excludedRemotes || {};
20940
- // app plugins need to be removed from remotes
20941
- const newRemotes = this.removePluginsFromRemotesConfig(appConfigRemotes, plugins);
20942
- // self scoped plugins need to be added to excluded remotes
20943
- // as they would be otherwise automatically added to remotes
20944
- const selfScopedPlugins = this.getSelfScopedPlugins(pluginsArray, application.contextPath);
20945
- const newExcludedRemotes = this.addPluginToRemotesConfig(appConfigExcludedRemotes, selfScopedPlugins);
20946
- return await this.updateRemotesInAppConfig(application, newRemotes, newExcludedRemotes);
20880
+ add(version) {
20881
+ this.state.add(version);
20882
+ this.emitNewState();
20947
20883
  }
20948
- /**
20949
- * Updates the remotes field in the application configuration.
20950
- * @param application Application managed object.
20951
- * @param plugins List of remotes to be added.
20952
- * @returns Returns updated application remotes.
20953
- */
20954
- async updateRemotesInAppConfig(application, plugins, excludedRemotes) {
20955
- const updatedAppWithConfig = await this.applicationService.updateApplicationConfig(application, {
20956
- remotes: plugins,
20957
- excludedRemotes: excludedRemotes || {}
20958
- });
20959
- return updatedAppWithConfig?.config || { remotes: {} };
20884
+ remove(version) {
20885
+ this.state.delete(version);
20886
+ this.emitNewState();
20960
20887
  }
20961
- /**
20962
- * Fetches the application manifest.
20963
- * @param application Application managed object.
20964
- * @returns Returns the application manifest.
20965
- */
20966
- async getCumulocityJsonFile(application) {
20967
- const c8yJson = await this.applicationService.getAppManifest(application);
20968
- if (!c8yJson.remotes) {
20969
- c8yJson.remotes = {};
20970
- }
20971
- return c8yJson;
20888
+ cleanUpVersions(versions) {
20889
+ return versions.map(version => pick(version, 'label', 'version', 'type', 'custom'));
20972
20890
  }
20973
- /**
20974
- * Sets the initial state of remotes in the configuration (when it's missing), based on the list of remotes being in the application manifest.
20975
- * @param application Application managed object.
20976
- * @returns Returns a list of remotes that has been assigned to the configuration object.
20977
- */
20978
- async setInitialRemotes(application) {
20979
- try {
20980
- const manifest = await this.getCumulocityJsonFile(application);
20981
- const manifestRemotes = manifest.remotes;
20982
- return await this.updateRemotesInAppConfig(application, manifestRemotes || {}, {});
20983
- }
20984
- catch (er) {
20985
- return undefined;
20986
- }
20891
+ setupItemsObservable() {
20892
+ return fromTriggerOnce(undefined, this.refresh$, [
20893
+ getInjectedHooks(HOOK_VERSION, this.injectors),
20894
+ () => this.factories,
20895
+ stateToFactory(this.state$)
20896
+ ]).pipe(distinctUntilChanged(), map(versions => sortByPriority(versions)), shareReplay(1));
20987
20897
  }
20988
- async resetRemotes(application) {
20989
- return await this.applicationService.updateApplicationConfig(application, {
20990
- remotes: undefined,
20991
- excludedRemotes: undefined
20992
- });
20898
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionService, deps: [{ token: i0.Injector }, { token: PluginsResolveService }], target: i0.ɵɵFactoryTarget.Injectable }); }
20899
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionService, providedIn: 'root' }); }
20900
+ }
20901
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionService, decorators: [{
20902
+ type: Injectable,
20903
+ args: [{
20904
+ providedIn: 'root'
20905
+ }]
20906
+ }], ctorParameters: () => [{ type: i0.Injector }, { type: PluginsResolveService }] });
20907
+
20908
+ class PlatformDetailsService {
20909
+ constructor(version, appState, apps) {
20910
+ this.version = version;
20911
+ this.appState = appState;
20912
+ this.apps = apps;
20993
20913
  }
20994
- sortVersions(source, order) {
20995
- const sourceCopy = cloneDeep(source);
20996
- if (source.list && source.path) {
20997
- const path = sourceCopy.path.join('.');
20998
- return sourceCopy.list.sort((a, b) => compare(coerce(get(a, path)), coerce(get(b, path))) * (order === 'asc' ? 1 : -1));
20999
- }
21000
- else {
21001
- return sourceCopy.sort((a, b) => compare(coerce(a), coerce(b)) * (order === 'asc' ? 1 : -1));
21002
- }
20914
+ async getPlatformDetailsObject() {
20915
+ const currentUser = this.appState.currentUser.value;
20916
+ const userId = currentUser?.id;
20917
+ const userPermissions = this.getUserPermissions(currentUser);
20918
+ const [hookedVersions, microserviceVersions] = await Promise.all([
20919
+ this.getVersions(),
20920
+ this.getMicroserviceVersions(userId)
20921
+ ]);
20922
+ const versions = [...hookedVersions, ...microserviceVersions];
20923
+ const groupedVersions = groupBy(versions, 'type');
20924
+ const tenantId = this.appState.currentTenant.value?.name;
20925
+ // useful as `domainName` might be pointing to a custom domain
20926
+ // self link should still allow to identify the actual environment of the tenant
20927
+ const tenantSelfLink = this.appState.currentTenant.value?.self;
20928
+ const tenantDomainName = this.appState.currentTenant.value?.domainName;
20929
+ const applicationKey = this.appState.currentApplication.value?.key;
20930
+ const applicationId = this.appState.currentApplication.value?.id;
20931
+ const time = new Date().toISOString();
20932
+ const url = document.URL;
20933
+ const obj = {
20934
+ time,
20935
+ tenantId,
20936
+ tenantSelfLink,
20937
+ tenantDomainName,
20938
+ url,
20939
+ userId,
20940
+ userPermissions,
20941
+ applicationId,
20942
+ applicationKey,
20943
+ versions: groupedVersions
20944
+ };
20945
+ return obj;
21003
20946
  }
21004
- /**
21005
- * Extracts a list of exported plugins from the application object.
21006
- * @param application Application managed object.
21007
- * @param useLatest Set this to true, to not bind the plugin to any version.
21008
- * @returns Returns a list of exported plugins.
21009
- */
21010
- getMFExports(application, excludedScopes = [
21011
- PluginsExportScopes.SELF,
21012
- PluginsExportScopes.SELF_OPTIONAL,
21013
- PluginsExportScopes.GLOBAL
21014
- ], useLatest = false) {
21015
- const manifest = application.manifest;
21016
- if (!manifest || !manifest.exports) {
21017
- return [];
21018
- }
21019
- return this.extendPluginsDetails(application, {
21020
- version: manifest.version,
21021
- binaryId: undefined
21022
- }, useLatest).filter(plugin => !excludedScopes.includes(plugin.scope));
20947
+ async getVersions() {
20948
+ const versions = await this.version.items$
20949
+ .pipe(take(1), map(versions => this.version.cleanUpVersions(versions)))
20950
+ .toPromise();
20951
+ return versions;
21023
20952
  }
21024
- /**
21025
- * Extracts a list of exports from each available package.
21026
- * @param allVersions If set to true, all and not only latest versions are included.
21027
- * @param excludedScopes Defines which scopes should not be loaded.
21028
- * @returns Returns a list of all exported plugins.
21029
- */
21030
- async getAllMFExports(allVersions = false, excludedScopes = [
21031
- PluginsExportScopes.SELF,
21032
- PluginsExportScopes.SELF_OPTIONAL,
21033
- PluginsExportScopes.GLOBAL
21034
- ]) {
21035
- const plugins = new Array();
21036
- const packages = await this.listPackages();
21037
- for (const pkg of packages) {
21038
- if (!pkg?.manifest?.exports) {
21039
- continue;
21040
- }
21041
- if (allVersions && Array.isArray(pkg.applicationVersions)) {
21042
- pkg.applicationVersions.forEach(version => {
21043
- plugins.push(...this.extendPluginsDetails(pkg, version));
21044
- });
21045
- }
21046
- else {
21047
- plugins.push(...this.extendPluginsDetails(pkg, {
21048
- version: pkg.manifest.version,
21049
- binaryId: undefined
21050
- }));
21051
- }
20953
+ async getMicroserviceVersions(userId) {
20954
+ try {
20955
+ const { data: apps } = await this.apps.listByUser(userId, {
20956
+ pageSize: 2000,
20957
+ dropOverwrittenApps: true,
20958
+ noPaging: true
20959
+ });
20960
+ return apps
20961
+ .filter(app => !!app.manifest?.version && app.type === ApplicationType.MICROSERVICE)
20962
+ .map(app => {
20963
+ return {
20964
+ label: app.name,
20965
+ version: app.manifest.version,
20966
+ type: app.type,
20967
+ custom: {
20968
+ owner: app.owner?.tenant?.id,
20969
+ provider: app.manifest?.provider
20970
+ }
20971
+ };
20972
+ });
21052
20973
  }
21053
- return plugins.filter(plugin => !excludedScopes.includes(plugin.scope));
21054
- }
21055
- /**
21056
- * Extracts a list of remotes from the application object.
21057
- * @param application Application managed object.
21058
- * @returns Returns list of remotes.
21059
- */
21060
- getMFRemotes(application) {
21061
- const manifest = application.manifest || {};
21062
- const config = application?.config;
21063
- let remotes = config?.remotes || manifest.remotes || {};
21064
- const manifestExports = manifest.exports || manifest.manifest?.exports || [];
21065
- const selfRemotes = manifestExports
21066
- .filter(plugin => plugin.scope === PluginsExportScopes.SELF)
21067
- .map(plugin => plugin.module || plugin.name);
21068
- if (selfRemotes.length) {
21069
- remotes = mergeRemotes([{ [application.contextPath]: selfRemotes }, remotes]);
20974
+ catch (e) {
20975
+ console.warn(e);
20976
+ return [];
21070
20977
  }
21071
- remotes = removeRemotes(remotes, config?.excludedRemotes);
21072
- return remotes;
21073
20978
  }
21074
- /**
21075
- * Determines the type of a package.
21076
- * A package is OFFICIAL if it comes from management tenant and has a label attached called OFFICIAL.
21077
- * A package is COMMUNITY if it has a label called COMMUNITY.
21078
- * A package is CUSTOM if it does not have any label attached.
21079
- * A package is UNKNOWN if it has a label attached but it does not match COMMUNITY or OFFICIAL.
21080
- *
21081
- * Labels can be used to identify the status of a package. Community packages always need
21082
- * a license validation. The label will be shown on the application card to tell a user
21083
- * whether they are looking into an official or community package.
21084
- *
21085
- * @param packageApplication The package application object to check.
21086
- * @returns The package type.
21087
- */
21088
- getPackageType(packageApplication) {
21089
- const label = packageApplication.label || packageApplication.manifest?.label;
21090
- if (label === PackageType.ARCHIVED) {
21091
- return PackageType.ARCHIVED;
21092
- }
21093
- if (!label) {
21094
- return PackageType.CUSTOM;
21095
- }
21096
- if (label === PackageType.OFFICIAL && this.isOwnedByManagement(packageApplication)) {
21097
- return PackageType.OFFICIAL;
21098
- }
21099
- if (label === PackageType.COMMUNITY) {
21100
- return PackageType.COMMUNITY;
20979
+ getUserPermissions(user) {
20980
+ if (!user) {
20981
+ return null;
21101
20982
  }
21102
- return PackageType.UNKNOWN;
20983
+ const userPermissions = this.getDirectPermissionsOfUser(user);
20984
+ const groupPermissions = this.getPermissionsOfAssignedGroups(user);
20985
+ return { user: userPermissions, groups: groupPermissions };
21103
20986
  }
21104
- /**
21105
- * Verifies if an application is owned by management tenant.
21106
- *
21107
- * @param app The application to verify.
21108
- * @returns True if owned by management tenant.
21109
- */
21110
- isOwnedByManagement(app) {
21111
- const appOwner = get(app, 'owner.tenant.id');
21112
- return appOwner === 'management';
20987
+ getDirectPermissionsOfUser(user) {
20988
+ const userChangedType = user;
20989
+ const userRoleReferences = userChangedType.roles?.references || [];
20990
+ return userRoleReferences.map(ref => ref.role.id);
21113
20991
  }
21114
- pluginsFromManifest(manifest) {
21115
- const plugins = manifest.exports;
21116
- const extendedPlugins = plugins
21117
- .filter(p => p.scope === PluginsExportScopes.SELF)
21118
- .map(p => ({
21119
- ...p,
21120
- id: PluginsService.createPluginId(manifest.contextPath, p, manifest.version),
21121
- contextPath: manifest.contextPath,
21122
- version: manifest.version,
21123
- versioningMatrix: manifest.versioningMatrix,
21124
- license: manifest.license,
21125
- type: PackageType.CUSTOM
21126
- }));
21127
- return extendedPlugins;
20992
+ getPermissionsOfAssignedGroups(user) {
20993
+ const groups = user.groups?.references || [];
20994
+ return groups.map(ref => {
20995
+ const roleReferences = ref.group?.roles?.references || [];
20996
+ const permissions = roleReferences.map(ref => ref.role.id);
20997
+ return {
20998
+ id: ref.group.id,
20999
+ name: ref.group.name,
21000
+ permissions
21001
+ };
21002
+ });
21128
21003
  }
21129
- async getReadmeFileContent(baseUrl) {
21130
- return this.getFileContent(baseUrl, 'readme');
21004
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PlatformDetailsService, deps: [{ token: VersionService }, { token: AppStateService }, { token: i1.ApplicationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
21005
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PlatformDetailsService, providedIn: 'root' }); }
21006
+ }
21007
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PlatformDetailsService, decorators: [{
21008
+ type: Injectable,
21009
+ args: [{ providedIn: 'root' }]
21010
+ }], ctorParameters: () => [{ type: VersionService }, { type: AppStateService }, { type: i1.ApplicationService }] });
21011
+
21012
+ class VersionListComponent {
21013
+ constructor(version, appState, clipboardService, modalService, platformDetails, headerService) {
21014
+ this.version = version;
21015
+ this.appState = appState;
21016
+ this.clipboardService = clipboardService;
21017
+ this.modalService = modalService;
21018
+ this.platformDetails = platformDetails;
21019
+ this.headerService = headerService;
21020
+ this.versionsToDirectlyDisplay$ = this.version.nonHiddenItems$;
21021
+ this.currentTenantId$ = this.appState.currentTenant.pipe(map(tenant => tenant?.name), filter(tenantId => !!tenantId), distinctUntilChanged());
21022
+ this.open$ = this.headerService.rightDrawerOpen$;
21131
21023
  }
21132
- async getChangelogFileContent(baseUrl) {
21133
- return this.getFileContent(baseUrl, 'changelog');
21024
+ async downloadPlatformDetails() {
21025
+ const obj = await this.platformDetails.getPlatformDetailsObject();
21026
+ const json = JSON.stringify(obj, undefined, 2);
21027
+ const blob = new Blob([json]);
21028
+ saveAs$1(blob, 'platform-details.json');
21134
21029
  }
21135
- async getFileContent(baseUrl, fileType) {
21136
- const file = await this.getFile(baseUrl, fileType);
21137
- if (file.status === 200) {
21138
- return await file.text();
21139
- }
21140
- return '';
21030
+ copyIt(text) {
21031
+ this.clipboardService.writeText(text);
21141
21032
  }
21142
- async getFile(baseUrl, fileType) {
21143
- const options = {
21144
- method: 'GET',
21145
- headers: { 'Content-Type': 'text/markdown' }
21033
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionListComponent, deps: [{ token: VersionService }, { token: AppStateService }, { token: ClipboardService }, { token: i1$7.BsModalService }, { token: PlatformDetailsService }, { token: HeaderService }], target: i0.ɵɵFactoryTarget.Component }); }
21034
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: VersionListComponent, isStandalone: true, selector: "c8y-version-list", ngImport: i0, template: "<div class=\"separator-top p-t-8 p-b-8\">\n <div class=\"c8y-right-drawer__item sticky-top\">\n <i c8yIcon=\"c8y-c8y-c\"></i>\n <span class=\"text-bold\">{{ 'Platform info' | translate }}</span>\n </div>\n\n <ul class=\"list-unstyled\">\n <li\n class=\"c8y-right-drawer__item\"\n *ngIf=\"currentTenantId$ | async as tenantId\"\n >\n <span\n class=\"flex-grow text-muted m-0 text-12 text-truncate\"\n translate\n >\n Tenant ID\n </span>\n <button\n class=\"m-l-auto flex-no-shrink btn-clean p-0 btn-link\"\n title=\"{{ 'Copy tenant ID to the clipboard' | translate }}\"\n [attr.tabindex]=\"(open$ | async) ? '0' : '-1'\"\n type=\"button\"\n (click)=\"$event.stopPropagation(); copyIt(tenantId)\"\n >\n {{ tenantId }}\n <i\n class=\"text-14 m-0\"\n [c8yIcon]=\"'clipboard'\"\n ></i>\n </button>\n </li>\n <li\n class=\"c8y-right-drawer__item\"\n *ngFor=\"let versionEntry of versionsToDirectlyDisplay$ | async\"\n >\n <span\n class=\"flex-no-shrink text-muted text-12 text-truncate m-r-8\"\n [title]=\"versionEntry.label | translate\"\n >\n {{ versionEntry.label | translate }}\n </span>\n <span\n class=\"flex-grow text-right text-truncate\"\n [title]=\"versionEntry.version | translate\"\n >\n {{ versionEntry.version }}\n </span>\n </li>\n <li class=\"c8y-right-drawer__item\">\n <button\n class=\"btn btn-default btn-sm\"\n [attr.tabindex]=\"(open$ | async) ? '0' : '-1'\"\n title=\"{{ 'Download platform details' | translate }}\"\n (click)=\"downloadPlatformDetails()\"\n >\n <i c8yIcon=\"download\" class=\"m-t-0 m-b-0 text-14\"></i>\n <span translate>Download platform details</span>\n </button>\n </li>\n </ul>\n</div>\n", dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
21035
+ }
21036
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionListComponent, decorators: [{
21037
+ type: Component,
21038
+ args: [{ selector: 'c8y-version-list', standalone: true, imports: [IconDirective, NgIf, C8yTranslateDirective, NgFor, C8yTranslatePipe, AsyncPipe], template: "<div class=\"separator-top p-t-8 p-b-8\">\n <div class=\"c8y-right-drawer__item sticky-top\">\n <i c8yIcon=\"c8y-c8y-c\"></i>\n <span class=\"text-bold\">{{ 'Platform info' | translate }}</span>\n </div>\n\n <ul class=\"list-unstyled\">\n <li\n class=\"c8y-right-drawer__item\"\n *ngIf=\"currentTenantId$ | async as tenantId\"\n >\n <span\n class=\"flex-grow text-muted m-0 text-12 text-truncate\"\n translate\n >\n Tenant ID\n </span>\n <button\n class=\"m-l-auto flex-no-shrink btn-clean p-0 btn-link\"\n title=\"{{ 'Copy tenant ID to the clipboard' | translate }}\"\n [attr.tabindex]=\"(open$ | async) ? '0' : '-1'\"\n type=\"button\"\n (click)=\"$event.stopPropagation(); copyIt(tenantId)\"\n >\n {{ tenantId }}\n <i\n class=\"text-14 m-0\"\n [c8yIcon]=\"'clipboard'\"\n ></i>\n </button>\n </li>\n <li\n class=\"c8y-right-drawer__item\"\n *ngFor=\"let versionEntry of versionsToDirectlyDisplay$ | async\"\n >\n <span\n class=\"flex-no-shrink text-muted text-12 text-truncate m-r-8\"\n [title]=\"versionEntry.label | translate\"\n >\n {{ versionEntry.label | translate }}\n </span>\n <span\n class=\"flex-grow text-right text-truncate\"\n [title]=\"versionEntry.version | translate\"\n >\n {{ versionEntry.version }}\n </span>\n </li>\n <li class=\"c8y-right-drawer__item\">\n <button\n class=\"btn btn-default btn-sm\"\n [attr.tabindex]=\"(open$ | async) ? '0' : '-1'\"\n title=\"{{ 'Download platform details' | translate }}\"\n (click)=\"downloadPlatformDetails()\"\n >\n <i c8yIcon=\"download\" class=\"m-t-0 m-b-0 text-14\"></i>\n <span translate>Download platform details</span>\n </button>\n </li>\n </ul>\n</div>\n" }]
21039
+ }], ctorParameters: () => [{ type: VersionService }, { type: AppStateService }, { type: ClipboardService }, { type: i1$7.BsModalService }, { type: PlatformDetailsService }, { type: HeaderService }] });
21040
+
21041
+ class VersionDrawerFactory {
21042
+ constructor(options) {
21043
+ this.options = options;
21044
+ this.drawerItem = {
21045
+ component: VersionListComponent,
21046
+ position: 'right',
21047
+ priority: 80,
21048
+ id: 'platformInformation'
21146
21049
  };
21147
- const uppercaseFilename = fileType === 'readme' ? 'README.md' : 'CHANGELOG.md';
21148
- let result = await this.client.fetch(`${baseUrl}${uppercaseFilename}`, options);
21149
- if (result && result.status === 404) {
21150
- result = await this.client.fetch(`${baseUrl}${uppercaseFilename.toLowerCase()}`, options);
21151
- }
21152
- return result;
21153
- }
21154
- isSelfScopedPlugin(plugin, contextPath) {
21155
- return (plugin.scope === PluginsExportScopes.SELF &&
21156
- (!contextPath || plugin.contextPath === contextPath));
21157
- }
21158
- getSelfScopedPlugins(plugins, contextPath) {
21159
- return plugins.filter(plugin => this.isSelfScopedPlugin(plugin, contextPath));
21160
21050
  }
21161
- getAllPluginsExceptSelfScoped(plugins, contextPath) {
21162
- return plugins.filter(plugin => !this.isSelfScopedPlugin(plugin, contextPath));
21163
- }
21164
- removeDuplicates(apps, key) {
21165
- const uniqueList = [];
21166
- const groupedAppsByKey = groupBy(apps, key);
21167
- const groupedApps = Object.keys(groupedAppsByKey).map(key => groupedAppsByKey[key]);
21168
- for (const appsGroup of groupedApps) {
21169
- if (appsGroup.length < 2) {
21170
- uniqueList.push(...appsGroup);
21171
- }
21172
- else {
21173
- const appFromCurrentTenant = appsGroup.find(app => this.isFromCurrentTenant(app));
21174
- if (appFromCurrentTenant) {
21175
- uniqueList.push(appFromCurrentTenant);
21176
- continue;
21177
- }
21178
- const appNotOwnedByManagement = appsGroup.find(app => !this.isOwnedByManagement(app));
21179
- uniqueList.push(appNotOwnedByManagement);
21051
+ get() {
21052
+ return this.shouldShowPlatformInformation$().pipe(distinctUntilChanged(), map(shouldShowPlatformInformation => {
21053
+ if (shouldShowPlatformInformation) {
21054
+ return this.drawerItem;
21180
21055
  }
21181
- }
21182
- return uniqueList;
21056
+ return [];
21057
+ }));
21183
21058
  }
21184
- isFromCurrentTenant(app) {
21185
- return app.owner.tenant.id === this.appStateService.currentTenant.value.name;
21059
+ shouldShowPlatformInformation$() {
21060
+ return combineLatest([
21061
+ this.options.get$('hidePowered'),
21062
+ this.options.get$('hidePlatformInformation')
21063
+ ]).pipe(map(([hidePowered, hidePlatformInformation]) => {
21064
+ if (hidePlatformInformation === undefined) {
21065
+ return !hidePowered;
21066
+ }
21067
+ return !hidePlatformInformation;
21068
+ }));
21186
21069
  }
21070
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionDrawerFactory, deps: [{ token: OptionsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
21071
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionDrawerFactory }); }
21072
+ }
21073
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionDrawerFactory, decorators: [{
21074
+ type: Injectable
21075
+ }], ctorParameters: () => [{ type: OptionsService }] });
21076
+
21077
+ var ApplicationPluginStatus;
21078
+ (function (ApplicationPluginStatus) {
21079
+ ApplicationPluginStatus["ORPHANED"] = "ORPHANED";
21080
+ ApplicationPluginStatus["LATEST"] = "LATEST";
21081
+ ApplicationPluginStatus["OUTDATED"] = "OUTDATED";
21082
+ ApplicationPluginStatus["REVOKED"] = "REVOKED";
21083
+ ApplicationPluginStatus["AUTO"] = "AUTO";
21084
+ })(ApplicationPluginStatus || (ApplicationPluginStatus = {}));
21085
+ var PackageType;
21086
+ (function (PackageType) {
21187
21087
  /**
21188
- * Modifies the list of plugins to have additional information such as id.
21189
- * @ignore
21088
+ * A package coming from the official Cumulocity github enterprise.
21190
21089
  */
21191
- extendPluginsDetails(application, version, useLatest = false) {
21192
- const plugins = application.manifest.exports;
21193
- const extendedPlugins = plugins.map(p => ({
21194
- ...p,
21195
- id: PluginsService.createPluginId(application.contextPath, p, version.version, useLatest),
21196
- idLatest: PluginsService.createPluginId(application.contextPath, p, version.version, true),
21197
- contextPath: application.contextPath,
21198
- version: version.version,
21199
- versioningMatrix: application.manifest.versioningMatrix,
21200
- tags: useLatest ? ['latest'] : version.tags || [],
21201
- license: application.manifest.license,
21202
- type: this.getPackageType(application),
21203
- originApp: application
21204
- }));
21205
- return extendedPlugins;
21206
- }
21207
- async listApplicationsByCurrentTenant(params = {}) {
21208
- const filter = Object.assign({
21209
- type: 'HOSTED',
21210
- pageSize: 2000,
21211
- withTotalPages: true
21212
- }, params);
21213
- const sharedFilter = Object.assign({
21214
- availability: ApplicationAvailability.SHARED,
21215
- type: 'HOSTED',
21216
- pageSize: 2000,
21217
- withTotalPages: true
21218
- }, params);
21219
- const tenantName = this.appStateService.currentTenant.value.name;
21220
- const [resultAppsOwnedByTenant, resultSharedApps] = await Promise.all([
21221
- this.applicationService.listByTenant(tenantName, filter),
21222
- this.applicationService.list(sharedFilter)
21223
- ]);
21224
- const { data: appsOwnedByTenant } = resultAppsOwnedByTenant;
21225
- const { data: sharedApps } = resultSharedApps;
21226
- const webApps = [...appsOwnedByTenant, ...sharedApps];
21227
- return uniqBy(webApps, (app) => app.id);
21228
- }
21229
- addPluginToRemotesConfig(remotesConfig, plugins) {
21230
- if (!plugins) {
21090
+ PackageType["OFFICIAL"] = "OFFICIAL";
21091
+ /**
21092
+ * A package coming from any connected partner repository.
21093
+ */
21094
+ PackageType["COMMUNITY"] = "COMMUNITY";
21095
+ /**
21096
+ * A package where the origin is unknown (e.g. uploaded to management with an unknown label)
21097
+ */
21098
+ PackageType["UNKNOWN"] = "UNKNOWN";
21099
+ /**
21100
+ * A custom package e.g. uploaded to the tenant by a user
21101
+ */
21102
+ PackageType["CUSTOM"] = "CUSTOM";
21103
+ /**
21104
+ * A package that was archived by the user
21105
+ */
21106
+ PackageType["ARCHIVED"] = "ARCHIVED";
21107
+ })(PackageType || (PackageType = {}));
21108
+
21109
+ class PluginsService {
21110
+ static convertInstalledRemotesToIds(remotes) {
21111
+ if (!remotes) {
21231
21112
  return;
21232
21113
  }
21233
- const remotesCopy = cloneDeep(remotesConfig);
21234
- const temp = Array.isArray(plugins) ? plugins : [plugins];
21235
- temp.forEach(plugin => {
21236
- const { contextPath, moduleName } = this.parsePluginId(plugin.id);
21237
- if (!contextPath || !moduleName) {
21238
- return;
21239
- }
21240
- remotesCopy[contextPath]?.length >= 0
21241
- ? remotesCopy[contextPath].push(moduleName)
21242
- : (remotesCopy[contextPath] = []).push(moduleName);
21243
- remotesCopy[contextPath] = [...new Set(remotesCopy[contextPath])];
21114
+ const importContextPaths = Object.keys(remotes);
21115
+ const plugins = [];
21116
+ importContextPaths.forEach(contextPath => {
21117
+ const moduleNames = remotes[contextPath] || [];
21118
+ plugins.push(...moduleNames.map(module => PluginsService.createPluginId(contextPath, module, '', true)));
21244
21119
  });
21245
- return remotesCopy;
21120
+ return plugins;
21246
21121
  }
21247
- removePluginsFromRemotesConfig(remotesConfig, plugins) {
21248
- const remotesCopy = cloneDeep(remotesConfig);
21249
- const temp = Array.isArray(plugins) ? plugins : [plugins];
21250
- temp.forEach(plugin => {
21251
- const { rawContextPath, moduleName } = this.parsePluginId(plugin.id);
21252
- if (!rawContextPath || !moduleName) {
21253
- return;
21254
- }
21255
- // Find all keys in remotesConfig that match the plugin context (regardless of version)
21256
- Object.keys(remotesCopy).forEach(key => {
21257
- if (key === rawContextPath || key.startsWith(`${rawContextPath}@`)) {
21258
- remotesCopy[key] = remotesCopy[key].filter(p => p !== moduleName);
21259
- remotesCopy[key] = [...new Set(remotesCopy[key])];
21260
- if (remotesCopy[key].length === 0) {
21261
- delete remotesCopy[key];
21262
- }
21263
- }
21264
- });
21265
- });
21266
- return remotesCopy;
21122
+ static createPluginId(contextPath, plugin, version, useLatest = false) {
21123
+ const moduleName = typeof plugin === 'string' ? plugin : plugin.module;
21124
+ if (useLatest) {
21125
+ return `${contextPath}/${moduleName}`;
21126
+ }
21127
+ return `${contextPath}@${version}/${moduleName}`;
21128
+ }
21129
+ constructor(applicationService, appStateService, client) {
21130
+ this.applicationService = applicationService;
21131
+ this.appStateService = appStateService;
21132
+ this.client = client;
21267
21133
  }
21268
21134
  /**
21269
- * Parses id of the plugin and returns object with context path, raw context path (without version) and module name.
21270
- * For example:
21271
- * ```ts
21272
- * const id = 'widget-plugin@1021.0.1/WidgetPluginModule'
21273
- * const parsed = parsePluginId(id); // { contextPath: 'widget-plugin@1021.0.1', moduleName: 'WidgetPluginModule', rawContextPath: 'widget-plugin' }
21274
- * @param id Plugin id in the format of `<contextPath>@<version>/<moduleName>`
21275
- * @returns Object with context path, module name and raw context path (without version).
21135
+ * Fetches a list of available packages.
21136
+ * @param params Additional query parameters.
21137
+ * @returns Returns a list of packages.
21276
21138
  */
21277
- parsePluginId(id) {
21278
- const [contextPath, moduleName] = id.split('/');
21279
- const [rawContextPath] = contextPath.split('@');
21280
- return { rawContextPath, contextPath, moduleName };
21139
+ async listPackages(params = {}) {
21140
+ const apps = await this.listApplicationsByCurrentTenant(params);
21141
+ const webApps = apps.filter(app => this.isPackage(app));
21142
+ const uniqueWebApps = this.removeDuplicates(webApps, 'contextPath');
21143
+ return uniqueWebApps.sort((a, b) => a.name.localeCompare(b.name));
21281
21144
  }
21282
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsService, deps: [{ token: i1.ApplicationService }, { token: AppStateService }, { token: i1.FetchClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
21283
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsService }); }
21284
- }
21285
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsService, decorators: [{
21286
- type: Injectable
21287
- }], ctorParameters: () => [{ type: i1.ApplicationService }, { type: AppStateService }, { type: i1.FetchClient }] });
21288
-
21289
- class PluginsModule {
21290
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
21291
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: PluginsModule }); }
21292
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsModule, providers: [PluginsService] }); }
21293
- }
21294
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsModule, decorators: [{
21295
- type: NgModule,
21296
- args: [{
21297
- providers: [PluginsService]
21298
- }]
21299
- }] });
21300
-
21301
- /**
21302
- * An extension HOOK can use either a pure value:
21303
- * ```typescript
21304
- * { provide: HOOK_X, useValue: { ...hookValue }, multi: true }
21305
- * ```
21306
- *
21307
- * Or an array to directly register multiple:
21308
- * ```typescript
21309
- * { provide: HOOK_X, useValue: [{ ...hookValues }], multi: true }
21310
- * ```
21311
- *
21312
- * Or an ExtensionFactory which allows to define a get() function. This function
21313
- * gets called on each navigation with the current route and can return values
21314
- * async (observable or promise).
21315
- * ```typescript
21316
- * { provide: HOOK_X, useFactory: { get: (route) => doSomethingAsync(route) }, multi: true }
21317
- * ```
21318
- * @deprecated Consider using the `hookVersion` function instead.
21319
- */
21320
- const HOOK_VERSION = new InjectionToken('HOOK_VERSION');
21321
- const VERSION_MODULE_CONFIG = new InjectionToken('VERSION_MODULE_CONFIG');
21322
- /**
21323
- * You can either provide a single `Version` as parameter:
21324
- * ```typescript
21325
- * hookVersion(...)
21326
- * ```
21327
- *
21328
- * Or an array to directly register multiple:
21329
- * ```typescript
21330
- * hookVersion([...])
21331
- * ```
21332
- *
21333
- * Or you provide an Service that implements `ExtensionFactory<Version>`
21334
- * ```typescript
21335
- * export class MyVersionFactory implements ExtensionFactory<Version> {...}
21336
- * ...
21337
- * hookVersion(MyVersionFactory)
21338
- * ```
21339
- * A typed alternative to `HOOK_VERSION`.
21340
- * @param versions The `Version`'s or `ExtensionFactory` to be provided.
21341
- * @returns An `Provider` to be provided in your module.
21342
- */
21343
- function hookVersion(versions, options) {
21344
- return hookGeneric(versions, HOOK_VERSION, options);
21345
- }
21346
-
21347
- /**
21348
- * Will provide the backend versions of the tenant.
21349
- * The system option 'system' -> 'version' is used for this.
21350
- */
21351
- class BackendVersionFactory {
21352
- constructor(config, appState) {
21353
- this.config = config;
21354
- this.appState = appState;
21355
- this.backendVersion$ = of([]);
21356
- if (this.config?.disableBackendVersionFactory) {
21357
- return;
21358
- }
21359
- this.backendVersion$ = this.appState.state$.pipe(map(state => state?.versions?.backend), filter(backendVersion => !!backendVersion), distinctUntilChanged(), map(backendVersion => this.buildBackendVersion(backendVersion)), shareReplay(1));
21360
- }
21361
- get() {
21362
- return this.backendVersion$;
21145
+ /**
21146
+ * Checks if an application is a package.
21147
+ * @param application Application managed object.
21148
+ * @returns Returns true if the application is a package.
21149
+ */
21150
+ isPackage(application) {
21151
+ return application.manifest?.isPackage === true;
21363
21152
  }
21364
- buildBackendVersion(backendVersion) {
21365
- return {
21366
- label: gettext$1('Backend'),
21367
- version: backendVersion,
21368
- priority: 20,
21369
- type: 'SYSTEM',
21370
- hidden: true
21371
- };
21153
+ /**
21154
+ * Updates the remotes field in the application configuration by adding new plugins.
21155
+ * Important: if the remotes object is not set on the configuration object,
21156
+ * remotes will not be added. Make sure that this object exists in the application configuration.
21157
+ * @param application Application managed object.
21158
+ * @param plugins List of remotes to be added.
21159
+ * @returns Returns updated application remotes.
21160
+ */
21161
+ async addRemotes(application, plugins) {
21162
+ const pluginsArray = Array.isArray(plugins) ? plugins : [plugins];
21163
+ const manifestRemotes = application.manifest?.remotes || {};
21164
+ const appConfig = application?.config;
21165
+ const appConfigRemotes = appConfig?.remotes || manifestRemotes;
21166
+ const appConfigExcludedRemotes = appConfig?.excludedRemotes || {};
21167
+ // only normal and self optional scoped plugins should be added to remotes
21168
+ // self scoped plugins will be automatically added
21169
+ const allPluginsExceptSelfScoped = this.getAllPluginsExceptSelfScoped(pluginsArray, application.contextPath);
21170
+ const newRemotes = this.addPluginToRemotesConfig(appConfigRemotes, allPluginsExceptSelfScoped);
21171
+ // should be unproblematic to remove all categories of plugins from excluded remotes
21172
+ const newExcludedRemotes = this.removePluginsFromRemotesConfig(appConfigExcludedRemotes, plugins);
21173
+ return await this.updateRemotesInAppConfig(application, newRemotes, newExcludedRemotes);
21372
21174
  }
21373
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BackendVersionFactory, deps: [{ token: VERSION_MODULE_CONFIG, optional: true }, { token: AppStateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
21374
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BackendVersionFactory, providedIn: 'root' }); }
21375
- }
21376
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BackendVersionFactory, decorators: [{
21377
- type: Injectable,
21378
- args: [{
21379
- providedIn: 'root'
21380
- }]
21381
- }], ctorParameters: () => [{ type: undefined, decorators: [{
21382
- type: Optional
21383
- }, {
21384
- type: Inject,
21385
- args: [VERSION_MODULE_CONFIG]
21386
- }] }, { type: AppStateService }] });
21387
-
21388
- class VersionService extends ExtensionPointForPlugins {
21389
- constructor(rootInjector, pluginService) {
21390
- super(rootInjector, pluginService);
21391
- this.items$ = this.setupItemsObservable();
21392
- this.nonHiddenItems$ = this.items$.pipe(map(versions => versions.filter(version => !version.hidden)));
21175
+ /**
21176
+ * Updates the remotes field in the application configuration by removing plugins.
21177
+ * @param application Application managed object.
21178
+ * @param plugins List of remotes to be removed.
21179
+ * @returns Returns updated application remotes.
21180
+ */
21181
+ async removeRemotes(application, plugins) {
21182
+ const pluginsArray = Array.isArray(plugins) ? plugins : [plugins];
21183
+ const manifestRemotes = application.manifest?.remotes || {};
21184
+ const appConfig = application?.config;
21185
+ const appConfigRemotes = appConfig?.remotes || manifestRemotes;
21186
+ const appConfigExcludedRemotes = appConfig?.excludedRemotes || {};
21187
+ // app plugins need to be removed from remotes
21188
+ const newRemotes = this.removePluginsFromRemotesConfig(appConfigRemotes, plugins);
21189
+ // self scoped plugins need to be added to excluded remotes
21190
+ // as they would be otherwise automatically added to remotes
21191
+ const selfScopedPlugins = this.getSelfScopedPlugins(pluginsArray, application.contextPath);
21192
+ const newExcludedRemotes = this.addPluginToRemotesConfig(appConfigExcludedRemotes, selfScopedPlugins);
21193
+ return await this.updateRemotesInAppConfig(application, newRemotes, newExcludedRemotes);
21393
21194
  }
21394
- get state() {
21395
- return this.state$.value;
21195
+ /**
21196
+ * Updates the remotes field in the application configuration.
21197
+ * @param application Application managed object.
21198
+ * @param plugins List of remotes to be added.
21199
+ * @returns Returns updated application remotes.
21200
+ */
21201
+ async updateRemotesInAppConfig(application, plugins, excludedRemotes) {
21202
+ const updatedAppWithConfig = await this.applicationService.updateApplicationConfig(application, {
21203
+ remotes: plugins,
21204
+ excludedRemotes: excludedRemotes || {}
21205
+ });
21206
+ return updatedAppWithConfig?.config || { remotes: {} };
21396
21207
  }
21397
- add(version) {
21398
- this.state.add(version);
21399
- this.emitNewState();
21208
+ /**
21209
+ * Fetches the application manifest.
21210
+ * @param application Application managed object.
21211
+ * @returns Returns the application manifest.
21212
+ */
21213
+ async getCumulocityJsonFile(application) {
21214
+ const c8yJson = await this.applicationService.getAppManifest(application);
21215
+ if (!c8yJson.remotes) {
21216
+ c8yJson.remotes = {};
21217
+ }
21218
+ return c8yJson;
21400
21219
  }
21401
- remove(version) {
21402
- this.state.delete(version);
21403
- this.emitNewState();
21220
+ /**
21221
+ * Sets the initial state of remotes in the configuration (when it's missing), based on the list of remotes being in the application manifest.
21222
+ * @param application Application managed object.
21223
+ * @returns Returns a list of remotes that has been assigned to the configuration object.
21224
+ */
21225
+ async setInitialRemotes(application) {
21226
+ try {
21227
+ const manifest = await this.getCumulocityJsonFile(application);
21228
+ const manifestRemotes = manifest.remotes;
21229
+ return await this.updateRemotesInAppConfig(application, manifestRemotes || {}, {});
21230
+ }
21231
+ catch (er) {
21232
+ return undefined;
21233
+ }
21404
21234
  }
21405
- cleanUpVersions(versions) {
21406
- return versions.map(version => pick(version, 'label', 'version', 'type', 'custom'));
21235
+ async resetRemotes(application) {
21236
+ return await this.applicationService.updateApplicationConfig(application, {
21237
+ remotes: undefined,
21238
+ excludedRemotes: undefined
21239
+ });
21407
21240
  }
21408
- setupItemsObservable() {
21409
- return fromTriggerOnce(undefined, this.refresh$, [
21410
- getInjectedHooks(HOOK_VERSION, this.injectors),
21411
- () => this.factories,
21412
- stateToFactory(this.state$)
21413
- ]).pipe(distinctUntilChanged(), map(versions => sortByPriority(versions)), shareReplay(1));
21241
+ sortVersions(source, order) {
21242
+ const sourceCopy = cloneDeep(source);
21243
+ if (source.list && source.path) {
21244
+ const path = sourceCopy.path.join('.');
21245
+ return sourceCopy.list.sort((a, b) => compare(coerce(get(a, path)), coerce(get(b, path))) * (order === 'asc' ? 1 : -1));
21246
+ }
21247
+ else {
21248
+ return sourceCopy.sort((a, b) => compare(coerce(a), coerce(b)) * (order === 'asc' ? 1 : -1));
21249
+ }
21414
21250
  }
21415
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionService, deps: [{ token: i0.Injector }, { token: PluginsResolveService }], target: i0.ɵɵFactoryTarget.Injectable }); }
21416
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionService, providedIn: 'root' }); }
21417
- }
21418
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionService, decorators: [{
21419
- type: Injectable,
21420
- args: [{
21421
- providedIn: 'root'
21422
- }]
21423
- }], ctorParameters: () => [{ type: i0.Injector }, { type: PluginsResolveService }] });
21424
-
21425
- class PlatformDetailsService {
21426
- constructor(version, appState, apps) {
21427
- this.version = version;
21428
- this.appState = appState;
21429
- this.apps = apps;
21251
+ /**
21252
+ * Extracts a list of exported plugins from the application object.
21253
+ * @param application Application managed object.
21254
+ * @param useLatest Set this to true, to not bind the plugin to any version.
21255
+ * @returns Returns a list of exported plugins.
21256
+ */
21257
+ getMFExports(application, excludedScopes = [
21258
+ PluginsExportScopes.SELF,
21259
+ PluginsExportScopes.SELF_OPTIONAL,
21260
+ PluginsExportScopes.GLOBAL
21261
+ ], useLatest = false) {
21262
+ const manifest = application.manifest;
21263
+ if (!manifest || !manifest.exports) {
21264
+ return [];
21265
+ }
21266
+ return this.extendPluginsDetails(application, {
21267
+ version: manifest.version,
21268
+ binaryId: undefined
21269
+ }, useLatest).filter(plugin => !excludedScopes.includes(plugin.scope));
21430
21270
  }
21431
- async getPlatformDetailsObject() {
21432
- const currentUser = this.appState.currentUser.value;
21433
- const userId = currentUser?.id;
21434
- const userPermissions = this.getUserPermissions(currentUser);
21435
- const [hookedVersions, microserviceVersions] = await Promise.all([
21436
- this.getVersions(),
21437
- this.getMicroserviceVersions(userId)
21438
- ]);
21439
- const versions = [...hookedVersions, ...microserviceVersions];
21440
- const groupedVersions = groupBy(versions, 'type');
21441
- const tenantId = this.appState.currentTenant.value?.name;
21442
- // useful as `domainName` might be pointing to a custom domain
21443
- // self link should still allow to identify the actual environment of the tenant
21444
- const tenantSelfLink = this.appState.currentTenant.value?.self;
21445
- const tenantDomainName = this.appState.currentTenant.value?.domainName;
21446
- const applicationKey = this.appState.currentApplication.value?.key;
21447
- const applicationId = this.appState.currentApplication.value?.id;
21448
- const time = new Date().toISOString();
21449
- const url = document.URL;
21450
- const obj = {
21451
- time,
21452
- tenantId,
21453
- tenantSelfLink,
21454
- tenantDomainName,
21455
- url,
21456
- userId,
21457
- userPermissions,
21458
- applicationId,
21459
- applicationKey,
21460
- versions: groupedVersions
21461
- };
21462
- return obj;
21271
+ /**
21272
+ * Extracts a list of exports from each available package.
21273
+ * @param allVersions If set to true, all and not only latest versions are included.
21274
+ * @param excludedScopes Defines which scopes should not be loaded.
21275
+ * @returns Returns a list of all exported plugins.
21276
+ */
21277
+ async getAllMFExports(allVersions = false, excludedScopes = [
21278
+ PluginsExportScopes.SELF,
21279
+ PluginsExportScopes.SELF_OPTIONAL,
21280
+ PluginsExportScopes.GLOBAL
21281
+ ]) {
21282
+ const plugins = new Array();
21283
+ const packages = await this.listPackages();
21284
+ for (const pkg of packages) {
21285
+ if (!pkg?.manifest?.exports) {
21286
+ continue;
21287
+ }
21288
+ if (allVersions && Array.isArray(pkg.applicationVersions)) {
21289
+ pkg.applicationVersions.forEach(version => {
21290
+ plugins.push(...this.extendPluginsDetails(pkg, version));
21291
+ });
21292
+ }
21293
+ else {
21294
+ plugins.push(...this.extendPluginsDetails(pkg, {
21295
+ version: pkg.manifest.version,
21296
+ binaryId: undefined
21297
+ }));
21298
+ }
21299
+ }
21300
+ return plugins.filter(plugin => !excludedScopes.includes(plugin.scope));
21463
21301
  }
21464
- async getVersions() {
21465
- const versions = await this.version.items$
21466
- .pipe(take(1), map(versions => this.version.cleanUpVersions(versions)))
21467
- .toPromise();
21468
- return versions;
21302
+ /**
21303
+ * Extracts a list of remotes from the application object.
21304
+ * @param application Application managed object.
21305
+ * @returns Returns list of remotes.
21306
+ */
21307
+ getMFRemotes(application) {
21308
+ const manifest = application.manifest || {};
21309
+ const config = application?.config;
21310
+ let remotes = config?.remotes || manifest.remotes || {};
21311
+ const manifestExports = manifest.exports || manifest.manifest?.exports || [];
21312
+ const selfRemotes = manifestExports
21313
+ .filter(plugin => plugin.scope === PluginsExportScopes.SELF)
21314
+ .map(plugin => plugin.module || plugin.name);
21315
+ if (selfRemotes.length) {
21316
+ remotes = mergeRemotes([{ [application.contextPath]: selfRemotes }, remotes]);
21317
+ }
21318
+ remotes = removeRemotes(remotes, config?.excludedRemotes);
21319
+ return remotes;
21469
21320
  }
21470
- async getMicroserviceVersions(userId) {
21471
- try {
21472
- const { data: apps } = await this.apps.listByUser(userId, {
21473
- pageSize: 2000,
21474
- dropOverwrittenApps: true,
21475
- noPaging: true
21476
- });
21477
- return apps
21478
- .filter(app => !!app.manifest?.version && app.type === ApplicationType.MICROSERVICE)
21479
- .map(app => {
21480
- return {
21481
- label: app.name,
21482
- version: app.manifest.version,
21483
- type: app.type,
21484
- custom: {
21485
- owner: app.owner?.tenant?.id,
21486
- provider: app.manifest?.provider
21487
- }
21488
- };
21489
- });
21321
+ /**
21322
+ * Determines the type of a package.
21323
+ * A package is OFFICIAL if it comes from management tenant and has a label attached called OFFICIAL.
21324
+ * A package is COMMUNITY if it has a label called COMMUNITY.
21325
+ * A package is CUSTOM if it does not have any label attached.
21326
+ * A package is UNKNOWN if it has a label attached but it does not match COMMUNITY or OFFICIAL.
21327
+ *
21328
+ * Labels can be used to identify the status of a package. Community packages always need
21329
+ * a license validation. The label will be shown on the application card to tell a user
21330
+ * whether they are looking into an official or community package.
21331
+ *
21332
+ * @param packageApplication The package application object to check.
21333
+ * @returns The package type.
21334
+ */
21335
+ getPackageType(packageApplication) {
21336
+ const label = packageApplication.label || packageApplication.manifest?.label;
21337
+ if (label === PackageType.ARCHIVED) {
21338
+ return PackageType.ARCHIVED;
21490
21339
  }
21491
- catch (e) {
21492
- console.warn(e);
21493
- return [];
21340
+ if (!label) {
21341
+ return PackageType.CUSTOM;
21494
21342
  }
21495
- }
21496
- getUserPermissions(user) {
21497
- if (!user) {
21498
- return null;
21343
+ if (label === PackageType.OFFICIAL && this.isOwnedByManagement(packageApplication)) {
21344
+ return PackageType.OFFICIAL;
21499
21345
  }
21500
- const userPermissions = this.getDirectPermissionsOfUser(user);
21501
- const groupPermissions = this.getPermissionsOfAssignedGroups(user);
21502
- return { user: userPermissions, groups: groupPermissions };
21503
- }
21504
- getDirectPermissionsOfUser(user) {
21505
- const userChangedType = user;
21506
- const userRoleReferences = userChangedType.roles?.references || [];
21507
- return userRoleReferences.map(ref => ref.role.id);
21346
+ if (label === PackageType.COMMUNITY) {
21347
+ return PackageType.COMMUNITY;
21348
+ }
21349
+ return PackageType.UNKNOWN;
21508
21350
  }
21509
- getPermissionsOfAssignedGroups(user) {
21510
- const groups = user.groups?.references || [];
21511
- return groups.map(ref => {
21512
- const roleReferences = ref.group?.roles?.references || [];
21513
- const permissions = roleReferences.map(ref => ref.role.id);
21514
- return {
21515
- id: ref.group.id,
21516
- name: ref.group.name,
21517
- permissions
21518
- };
21519
- });
21351
+ /**
21352
+ * Verifies if an application is owned by management tenant.
21353
+ *
21354
+ * @param app The application to verify.
21355
+ * @returns True if owned by management tenant.
21356
+ */
21357
+ isOwnedByManagement(app) {
21358
+ const appOwner = get(app, 'owner.tenant.id');
21359
+ return appOwner === 'management';
21520
21360
  }
21521
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PlatformDetailsService, deps: [{ token: VersionService }, { token: AppStateService }, { token: i1.ApplicationService }], target: i0.ɵɵFactoryTarget.Injectable }); }
21522
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PlatformDetailsService, providedIn: 'root' }); }
21523
- }
21524
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PlatformDetailsService, decorators: [{
21525
- type: Injectable,
21526
- args: [{ providedIn: 'root' }]
21527
- }], ctorParameters: () => [{ type: VersionService }, { type: AppStateService }, { type: i1.ApplicationService }] });
21528
-
21529
- class VersionListComponent {
21530
- constructor(version, appState, clipboardService, modalService, platformDetails, headerService) {
21531
- this.version = version;
21532
- this.appState = appState;
21533
- this.clipboardService = clipboardService;
21534
- this.modalService = modalService;
21535
- this.platformDetails = platformDetails;
21536
- this.headerService = headerService;
21537
- this.versionsToDirectlyDisplay$ = this.version.nonHiddenItems$;
21538
- this.currentTenantId$ = this.appState.currentTenant.pipe(map(tenant => tenant?.name), filter(tenantId => !!tenantId), distinctUntilChanged());
21539
- this.open$ = this.headerService.rightDrawerOpen$;
21361
+ pluginsFromManifest(manifest) {
21362
+ const plugins = manifest.exports;
21363
+ const extendedPlugins = plugins
21364
+ .filter(p => p.scope === PluginsExportScopes.SELF)
21365
+ .map(p => ({
21366
+ ...p,
21367
+ id: PluginsService.createPluginId(manifest.contextPath, p, manifest.version),
21368
+ contextPath: manifest.contextPath,
21369
+ version: manifest.version,
21370
+ versioningMatrix: manifest.versioningMatrix,
21371
+ license: manifest.license,
21372
+ type: PackageType.CUSTOM
21373
+ }));
21374
+ return extendedPlugins;
21540
21375
  }
21541
- async downloadPlatformDetails() {
21542
- const obj = await this.platformDetails.getPlatformDetailsObject();
21543
- const json = JSON.stringify(obj, undefined, 2);
21544
- const blob = new Blob([json]);
21545
- saveAs$1(blob, 'platform-details.json');
21376
+ async getReadmeFileContent(baseUrl) {
21377
+ return this.getFileContent(baseUrl, 'readme');
21546
21378
  }
21547
- copyIt(text) {
21548
- this.clipboardService.writeText(text);
21379
+ async getChangelogFileContent(baseUrl) {
21380
+ return this.getFileContent(baseUrl, 'changelog');
21549
21381
  }
21550
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionListComponent, deps: [{ token: VersionService }, { token: AppStateService }, { token: ClipboardService }, { token: i1$7.BsModalService }, { token: PlatformDetailsService }, { token: HeaderService }], target: i0.ɵɵFactoryTarget.Component }); }
21551
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: VersionListComponent, isStandalone: true, selector: "c8y-version-list", ngImport: i0, template: "<div class=\"separator-top p-t-8 p-b-8\">\n <div class=\"c8y-right-drawer__item sticky-top\">\n <i c8yIcon=\"c8y-c8y-c\"></i>\n <span class=\"text-bold\">{{ 'Platform info' | translate }}</span>\n </div>\n\n <ul class=\"list-unstyled\">\n <li\n class=\"c8y-right-drawer__item\"\n *ngIf=\"currentTenantId$ | async as tenantId\"\n >\n <span\n class=\"flex-grow text-muted m-0 text-12 text-truncate\"\n translate\n >\n Tenant ID\n </span>\n <button\n class=\"m-l-auto flex-no-shrink btn-clean p-0 btn-link\"\n title=\"{{ 'Copy tenant ID to the clipboard' | translate }}\"\n [attr.tabindex]=\"(open$ | async) ? '0' : '-1'\"\n type=\"button\"\n (click)=\"$event.stopPropagation(); copyIt(tenantId)\"\n >\n {{ tenantId }}\n <i\n class=\"text-14 m-0\"\n [c8yIcon]=\"'clipboard'\"\n ></i>\n </button>\n </li>\n <li\n class=\"c8y-right-drawer__item\"\n *ngFor=\"let versionEntry of versionsToDirectlyDisplay$ | async\"\n >\n <span\n class=\"flex-no-shrink text-muted text-12 text-truncate m-r-8\"\n [title]=\"versionEntry.label | translate\"\n >\n {{ versionEntry.label | translate }}\n </span>\n <span\n class=\"flex-grow text-right text-truncate\"\n [title]=\"versionEntry.version | translate\"\n >\n {{ versionEntry.version }}\n </span>\n </li>\n <li class=\"c8y-right-drawer__item\">\n <button\n class=\"btn btn-default btn-sm\"\n [attr.tabindex]=\"(open$ | async) ? '0' : '-1'\"\n title=\"{{ 'Download platform details' | translate }}\"\n (click)=\"downloadPlatformDetails()\"\n >\n <i c8yIcon=\"download\" class=\"m-t-0 m-b-0 text-14\"></i>\n <span translate>Download platform details</span>\n </button>\n </li>\n </ul>\n</div>\n", dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }] }); }
21552
- }
21553
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionListComponent, decorators: [{
21554
- type: Component,
21555
- args: [{ selector: 'c8y-version-list', standalone: true, imports: [IconDirective, NgIf, C8yTranslateDirective, NgFor, C8yTranslatePipe, AsyncPipe], template: "<div class=\"separator-top p-t-8 p-b-8\">\n <div class=\"c8y-right-drawer__item sticky-top\">\n <i c8yIcon=\"c8y-c8y-c\"></i>\n <span class=\"text-bold\">{{ 'Platform info' | translate }}</span>\n </div>\n\n <ul class=\"list-unstyled\">\n <li\n class=\"c8y-right-drawer__item\"\n *ngIf=\"currentTenantId$ | async as tenantId\"\n >\n <span\n class=\"flex-grow text-muted m-0 text-12 text-truncate\"\n translate\n >\n Tenant ID\n </span>\n <button\n class=\"m-l-auto flex-no-shrink btn-clean p-0 btn-link\"\n title=\"{{ 'Copy tenant ID to the clipboard' | translate }}\"\n [attr.tabindex]=\"(open$ | async) ? '0' : '-1'\"\n type=\"button\"\n (click)=\"$event.stopPropagation(); copyIt(tenantId)\"\n >\n {{ tenantId }}\n <i\n class=\"text-14 m-0\"\n [c8yIcon]=\"'clipboard'\"\n ></i>\n </button>\n </li>\n <li\n class=\"c8y-right-drawer__item\"\n *ngFor=\"let versionEntry of versionsToDirectlyDisplay$ | async\"\n >\n <span\n class=\"flex-no-shrink text-muted text-12 text-truncate m-r-8\"\n [title]=\"versionEntry.label | translate\"\n >\n {{ versionEntry.label | translate }}\n </span>\n <span\n class=\"flex-grow text-right text-truncate\"\n [title]=\"versionEntry.version | translate\"\n >\n {{ versionEntry.version }}\n </span>\n </li>\n <li class=\"c8y-right-drawer__item\">\n <button\n class=\"btn btn-default btn-sm\"\n [attr.tabindex]=\"(open$ | async) ? '0' : '-1'\"\n title=\"{{ 'Download platform details' | translate }}\"\n (click)=\"downloadPlatformDetails()\"\n >\n <i c8yIcon=\"download\" class=\"m-t-0 m-b-0 text-14\"></i>\n <span translate>Download platform details</span>\n </button>\n </li>\n </ul>\n</div>\n" }]
21556
- }], ctorParameters: () => [{ type: VersionService }, { type: AppStateService }, { type: ClipboardService }, { type: i1$7.BsModalService }, { type: PlatformDetailsService }, { type: HeaderService }] });
21557
-
21558
- class VersionDrawerFactory {
21559
- constructor(options) {
21560
- this.options = options;
21561
- this.drawerItem = {
21562
- component: VersionListComponent,
21563
- position: 'right',
21564
- priority: 80,
21565
- id: 'platformInformation'
21382
+ async getFileContent(baseUrl, fileType) {
21383
+ const file = await this.getFile(baseUrl, fileType);
21384
+ if (file.status === 200) {
21385
+ return await file.text();
21386
+ }
21387
+ return '';
21388
+ }
21389
+ async getFile(baseUrl, fileType) {
21390
+ const options = {
21391
+ method: 'GET',
21392
+ headers: { 'Content-Type': 'text/markdown' }
21566
21393
  };
21394
+ const uppercaseFilename = fileType === 'readme' ? 'README.md' : 'CHANGELOG.md';
21395
+ let result = await this.client.fetch(`${baseUrl}${uppercaseFilename}`, options);
21396
+ if (result && result.status === 404) {
21397
+ result = await this.client.fetch(`${baseUrl}${uppercaseFilename.toLowerCase()}`, options);
21398
+ }
21399
+ return result;
21567
21400
  }
21568
- get() {
21569
- return this.shouldShowPlatformInformation$().pipe(distinctUntilChanged(), map(shouldShowPlatformInformation => {
21570
- if (shouldShowPlatformInformation) {
21571
- return this.drawerItem;
21401
+ isSelfScopedPlugin(plugin, contextPath) {
21402
+ return (plugin.scope === PluginsExportScopes.SELF &&
21403
+ (!contextPath || plugin.contextPath === contextPath));
21404
+ }
21405
+ getSelfScopedPlugins(plugins, contextPath) {
21406
+ return plugins.filter(plugin => this.isSelfScopedPlugin(plugin, contextPath));
21407
+ }
21408
+ getAllPluginsExceptSelfScoped(plugins, contextPath) {
21409
+ return plugins.filter(plugin => !this.isSelfScopedPlugin(plugin, contextPath));
21410
+ }
21411
+ removeDuplicates(apps, key) {
21412
+ const uniqueList = [];
21413
+ const groupedAppsByKey = groupBy(apps, key);
21414
+ const groupedApps = Object.keys(groupedAppsByKey).map(key => groupedAppsByKey[key]);
21415
+ for (const appsGroup of groupedApps) {
21416
+ if (appsGroup.length < 2) {
21417
+ uniqueList.push(...appsGroup);
21572
21418
  }
21573
- return [];
21419
+ else {
21420
+ const appFromCurrentTenant = appsGroup.find(app => this.isFromCurrentTenant(app));
21421
+ if (appFromCurrentTenant) {
21422
+ uniqueList.push(appFromCurrentTenant);
21423
+ continue;
21424
+ }
21425
+ const appNotOwnedByManagement = appsGroup.find(app => !this.isOwnedByManagement(app));
21426
+ uniqueList.push(appNotOwnedByManagement);
21427
+ }
21428
+ }
21429
+ return uniqueList;
21430
+ }
21431
+ isFromCurrentTenant(app) {
21432
+ return app.owner.tenant.id === this.appStateService.currentTenant.value.name;
21433
+ }
21434
+ /**
21435
+ * Modifies the list of plugins to have additional information such as id.
21436
+ * @ignore
21437
+ */
21438
+ extendPluginsDetails(application, version, useLatest = false) {
21439
+ const plugins = application.manifest.exports;
21440
+ const extendedPlugins = plugins.map(p => ({
21441
+ ...p,
21442
+ id: PluginsService.createPluginId(application.contextPath, p, version.version, useLatest),
21443
+ idLatest: PluginsService.createPluginId(application.contextPath, p, version.version, true),
21444
+ contextPath: application.contextPath,
21445
+ version: version.version,
21446
+ versioningMatrix: application.manifest.versioningMatrix,
21447
+ tags: useLatest ? ['latest'] : version.tags || [],
21448
+ license: application.manifest.license,
21449
+ type: this.getPackageType(application),
21450
+ originApp: application
21574
21451
  }));
21452
+ return extendedPlugins;
21575
21453
  }
21576
- shouldShowPlatformInformation$() {
21577
- return combineLatest([
21578
- this.options.get$('hidePowered'),
21579
- this.options.get$('hidePlatformInformation')
21580
- ]).pipe(map(([hidePowered, hidePlatformInformation]) => {
21581
- if (hidePlatformInformation === undefined) {
21582
- return !hidePowered;
21454
+ async listApplicationsByCurrentTenant(params = {}) {
21455
+ const filter = Object.assign({
21456
+ type: 'HOSTED',
21457
+ pageSize: 2000,
21458
+ withTotalPages: true
21459
+ }, params);
21460
+ const sharedFilter = Object.assign({
21461
+ availability: ApplicationAvailability.SHARED,
21462
+ type: 'HOSTED',
21463
+ pageSize: 2000,
21464
+ withTotalPages: true
21465
+ }, params);
21466
+ const tenantName = this.appStateService.currentTenant.value.name;
21467
+ const [resultAppsOwnedByTenant, resultSharedApps] = await Promise.all([
21468
+ this.applicationService.listByTenant(tenantName, filter),
21469
+ this.applicationService.list(sharedFilter)
21470
+ ]);
21471
+ const { data: appsOwnedByTenant } = resultAppsOwnedByTenant;
21472
+ const { data: sharedApps } = resultSharedApps;
21473
+ const webApps = [...appsOwnedByTenant, ...sharedApps];
21474
+ return uniqBy(webApps, (app) => app.id);
21475
+ }
21476
+ addPluginToRemotesConfig(remotesConfig, plugins) {
21477
+ if (!plugins) {
21478
+ return;
21479
+ }
21480
+ const remotesCopy = cloneDeep(remotesConfig);
21481
+ const temp = Array.isArray(plugins) ? plugins : [plugins];
21482
+ temp.forEach(plugin => {
21483
+ const { contextPath, moduleName } = this.parsePluginId(plugin.id);
21484
+ if (!contextPath || !moduleName) {
21485
+ return;
21583
21486
  }
21584
- return !hidePlatformInformation;
21585
- }));
21487
+ remotesCopy[contextPath]?.length >= 0
21488
+ ? remotesCopy[contextPath].push(moduleName)
21489
+ : (remotesCopy[contextPath] = []).push(moduleName);
21490
+ remotesCopy[contextPath] = [...new Set(remotesCopy[contextPath])];
21491
+ });
21492
+ return remotesCopy;
21586
21493
  }
21587
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionDrawerFactory, deps: [{ token: OptionsService }], target: i0.ɵɵFactoryTarget.Injectable }); }
21588
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionDrawerFactory }); }
21494
+ removePluginsFromRemotesConfig(remotesConfig, plugins) {
21495
+ const remotesCopy = cloneDeep(remotesConfig);
21496
+ const temp = Array.isArray(plugins) ? plugins : [plugins];
21497
+ temp.forEach(plugin => {
21498
+ const { rawContextPath, moduleName } = this.parsePluginId(plugin.id);
21499
+ if (!rawContextPath || !moduleName) {
21500
+ return;
21501
+ }
21502
+ // Find all keys in remotesConfig that match the plugin context (regardless of version)
21503
+ Object.keys(remotesCopy).forEach(key => {
21504
+ if (key === rawContextPath || key.startsWith(`${rawContextPath}@`)) {
21505
+ remotesCopy[key] = remotesCopy[key].filter(p => p !== moduleName);
21506
+ remotesCopy[key] = [...new Set(remotesCopy[key])];
21507
+ if (remotesCopy[key].length === 0) {
21508
+ delete remotesCopy[key];
21509
+ }
21510
+ }
21511
+ });
21512
+ });
21513
+ return remotesCopy;
21514
+ }
21515
+ /**
21516
+ * Parses id of the plugin and returns object with context path, raw context path (without version) and module name.
21517
+ * For example:
21518
+ * ```ts
21519
+ * const id = 'widget-plugin@1021.0.1/WidgetPluginModule'
21520
+ * const parsed = parsePluginId(id); // { contextPath: 'widget-plugin@1021.0.1', moduleName: 'WidgetPluginModule', rawContextPath: 'widget-plugin' }
21521
+ * @param id Plugin id in the format of `<contextPath>@<version>/<moduleName>`
21522
+ * @returns Object with context path, module name and raw context path (without version).
21523
+ */
21524
+ parsePluginId(id) {
21525
+ const [contextPath, moduleName] = id.split('/');
21526
+ const [rawContextPath] = contextPath.split('@');
21527
+ return { rawContextPath, contextPath, moduleName };
21528
+ }
21529
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsService, deps: [{ token: i1.ApplicationService }, { token: AppStateService }, { token: i1.FetchClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
21530
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsService, providedIn: 'root' }); }
21589
21531
  }
21590
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: VersionDrawerFactory, decorators: [{
21591
- type: Injectable
21592
- }], ctorParameters: () => [{ type: OptionsService }] });
21532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PluginsService, decorators: [{
21533
+ type: Injectable,
21534
+ args: [{ providedIn: 'root' }]
21535
+ }], ctorParameters: () => [{ type: i1.ApplicationService }, { type: AppStateService }, { type: i1.FetchClient }] });
21593
21536
 
21594
21537
  /**
21595
21538
  * Will provide the version of plugins installed to the current application.
@@ -22557,6 +22500,64 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
22557
22500
  args: [{}]
22558
22501
  }] });
22559
22502
 
22503
+ class PasswordStrengthCheckerService {
22504
+ constructor() {
22505
+ this.GREEN = {
22506
+ colorName: 'green',
22507
+ color: 'rgb(0, 128, 0)',
22508
+ description: gettext$1('strong'),
22509
+ passwordStrength: PasswordStrength.GREEN
22510
+ };
22511
+ this.YELLOW = {
22512
+ colorName: 'yellow',
22513
+ color: 'rgb(255, 204, 51)',
22514
+ description: gettext$1('medium'),
22515
+ passwordStrength: PasswordStrength.YELLOW
22516
+ };
22517
+ this.RED = {
22518
+ colorName: 'red',
22519
+ color: 'rgb(170, 0, 51)',
22520
+ description: gettext$1('weak'),
22521
+ passwordStrength: PasswordStrength.RED
22522
+ };
22523
+ }
22524
+ hasLowerCase(password) {
22525
+ return password.search(/[a-z]/) !== -1;
22526
+ }
22527
+ hasUpperCase(password) {
22528
+ return password.search(/[A-Z]/) !== -1;
22529
+ }
22530
+ hasNumbers(password) {
22531
+ return password.search(/[0-9]/) !== -1;
22532
+ }
22533
+ hasSpecialChars(password) {
22534
+ return password.search(/[^0-9a-zA-Z]+/) !== -1;
22535
+ }
22536
+ getStrengthColor(password) {
22537
+ const passwordStrength = filter$2([
22538
+ this.hasLowerCase(password),
22539
+ this.hasUpperCase(password),
22540
+ this.hasNumbers(password),
22541
+ this.hasSpecialChars(password)
22542
+ ]).length;
22543
+ if (passwordStrength > 3) {
22544
+ return this.GREEN;
22545
+ }
22546
+ else if (passwordStrength >= 3) {
22547
+ return this.YELLOW;
22548
+ }
22549
+ else {
22550
+ return this.RED;
22551
+ }
22552
+ }
22553
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordStrengthCheckerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
22554
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordStrengthCheckerService, providedIn: 'root' }); }
22555
+ }
22556
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordStrengthCheckerService, decorators: [{
22557
+ type: Injectable,
22558
+ args: [{ providedIn: 'root' }]
22559
+ }] });
22560
+
22560
22561
  /**
22561
22562
  * A drop-zone which is a file selector allowing users to select file(s) from their file system, either natively or by drag and drop.
22562
22563
  *
@@ -22594,6 +22595,7 @@ class DropAreaComponent {
22594
22595
  this.maxAllowedFiles = Infinity;
22595
22596
  this.isOver = false;
22596
22597
  this.errors = false;
22598
+ this.disabled = false;
22597
22599
  this.onChange = _ => undefined;
22598
22600
  this.onTouched = () => undefined;
22599
22601
  }
@@ -22700,6 +22702,9 @@ class DropAreaComponent {
22700
22702
  registerOnTouched(fn) {
22701
22703
  this.onTouched = fn;
22702
22704
  }
22705
+ setDisabledState(isDisabled) {
22706
+ this.disabled = isDisabled;
22707
+ }
22703
22708
  async onFilesSelected(files) {
22704
22709
  this.onTouched();
22705
22710
  const hasValidNameLength = this.filesService.checkMaxLength(files);
@@ -22839,11 +22844,11 @@ class DropAreaComponent {
22839
22844
  resolve(reader.result);
22840
22845
  }
22841
22846
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropAreaComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: FilesService }, { token: i1$1.TranslateService }, { token: BytesPipe }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
22842
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DropAreaComponent, isStandalone: true, selector: "c8y-drop-area", inputs: { formControl: "formControl", title: "title", message: "message", icon: "icon", loadingMessage: "loadingMessage", forceHideList: "forceHideList", alwaysShow: "alwaysShow", clickToOpen: "clickToOpen", loading: "loading", progress: "progress", maxAllowedFiles: "maxAllowedFiles", files: "files", maxFileSizeInMegaBytes: "maxFileSizeInMegaBytes", accept: "accept" }, outputs: { dropped: "dropped" }, host: { listeners: { "keyup": "onkeyup($event)" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: DropAreaComponent, multi: true }], viewQueries: [{ propertyName: "area", first: true, predicate: ["area"], descendants: true, static: true }, { propertyName: "zone", first: true, predicate: ["zone"], descendants: true }, { propertyName: "picker", first: true, predicate: ["picker"], descendants: true }], ngImport: i0, template: "<div\n class=\"drop-zone\"\n [style.pointerEvents]=\"loading ? 'none' : 'auto'\"\n [style.display]=\"isOver || alwaysShow || loading ? 'block' : 'none'\"\n tabindex=\"0\"\n *ngIf=\"!shouldShowFilesList()\"\n [ngClass]=\"{ 'has-errors': errors, disabled: formControl?.disabled }\"\n #zone\n (dragleave)=\"stopDragging()\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"onOver()\"\n (click)=\"showPicker($event)\"\n>\n <div\n class=\"file-placeholder\"\n data-cy=\"c8y-file-placeholder--drop-zone\"\n [ngClass]=\"{ 'drag-over': isOver }\"\n >\n <div\n class=\"d-flex d-col p-4 flex-center\"\n *ngIf=\"loading\"\n >\n <div\n class=\"progress progress-striped active m-0\"\n style=\"min-width: 50%\"\n *ngIf=\"progress !== -1\"\n >\n <div\n class=\"progress-bar\"\n [style.width]=\"progress + '%'\"\n [attr.aria-label]=\"progress + '%'\"\n aria-valuenow=\"0\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n role=\"progressbar\"\n ></div>\n </div>\n <div\n class=\"spinner-snake\"\n *ngIf=\"progress === -1\"\n ></div>\n <p\n class=\"m-t-auto m-b-auto m-r-8\"\n *ngIf=\"!hasDropAreaSmallClass\"\n >\n {{ loadingMessage | translate }}\n </p>\n </div>\n <div\n class=\"hint-placeholder pointer\"\n *ngIf=\"!loading\"\n data-cy=\"drop-zone--hint-placeholder\"\n >\n <i class=\"dlt-c8y-icon-{{ icon }}\"></i>\n <p *ngIf=\"!errors\" class=\"text-truncate\" title=\"{{ message | translate }}\">\n <b>{{ message | translate }}</b>\n <br />\n <span\n *ngIf=\"alwaysShow && clickToOpen\"\n translate\n ></span>\n </p>\n <div\n class=\"has-errors\"\n *ngIf=\"errors\"\n >\n <p class=\"form-control-feedback-message\">\n {{ errorMessage | translate }}\n </p>\n </div>\n </div>\n </div>\n</div>\n\n<div\n class=\"drop-zone\"\n [style.display]=\"isOver || alwaysShow || loading ? 'block' : 'none'\"\n tabindex=\"0\"\n *ngIf=\"shouldShowFilesList()\"\n>\n <div\n class=\"p-absolute p-4 fit-w fit-h d-flex d-col j-c-center a-i-center\"\n *ngIf=\"loading\"\n >\n <div\n class=\"progress progress-striped active m-0\"\n style=\"min-width: 80%\"\n *ngIf=\"progress !== -1\"\n >\n <div\n class=\"progress-bar\"\n [style.width]=\"progress + '%'\"\n [attr.aria-label]=\"progress + '%'\"\n aria-valuenow=\"0\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n role=\"progressbar\"\n ></div>\n </div>\n <div *ngIf=\"progress === -1\">\n <c8y-loading></c8y-loading>\n </div>\n <p\n class=\"m-b-8\"\n *ngIf=\"!hasDropAreaSmallClass\"\n >\n <strong>\n {{ loadingMessage | translate }}\n </strong>\n </p>\n </div>\n <div\n class=\"file-placeholder p-4\"\n *ngIf=\"!loading\"\n >\n <div class=\"d-flex p-4 a-i-center\">\n <i\n class=\"icon-20 m-r-8\"\n c8yIcon=\"file-o\"\n ></i>\n <span\n class=\"text-truncate\"\n title=\"{{ filesNameString }}\"\n >\n {{ filesNameString }}\n </span>\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto\"\n title=\"{{ 'Remove' | translate }}\"\n [attr.aria-label]=\"'Remove' | translate\"\n type=\"button\"\n >\n <i\n c8yIcon=\"minus-circle\"\n (click)=\"onDelete()\"\n ></i>\n </button>\n </div>\n </div>\n</div>\n<label\n class=\"sr-only\"\n for=\"file\"\n>\n {{ 'Select file' | translate }}\n</label>\n<input\n class=\"hidden\"\n id=\"file\"\n type=\"file\"\n #picker\n *ngIf=\"clickToOpen\"\n (change)=\"onPick($event)\"\n (click)=\"picker.focus()\"\n (blur)=\"onTouched()\"\n [accept]=\"acceptedExts\"\n [multiple]=\"maxAllowedFiles > 1\"\n [disabled]=\"formControl?.disabled\"\n/>\n<div\n #area\n [hidden]=\"isOver || loading\"\n (dragover)=\"toggle()\"\n>\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i1$a.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$a.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
22847
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DropAreaComponent, isStandalone: true, selector: "c8y-drop-area", inputs: { formControl: "formControl", title: "title", message: "message", icon: "icon", loadingMessage: "loadingMessage", forceHideList: "forceHideList", alwaysShow: "alwaysShow", clickToOpen: "clickToOpen", loading: "loading", progress: "progress", maxAllowedFiles: "maxAllowedFiles", files: "files", maxFileSizeInMegaBytes: "maxFileSizeInMegaBytes", accept: "accept" }, outputs: { dropped: "dropped" }, host: { listeners: { "keyup": "onkeyup($event)" } }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: DropAreaComponent, multi: true }], viewQueries: [{ propertyName: "area", first: true, predicate: ["area"], descendants: true, static: true }, { propertyName: "zone", first: true, predicate: ["zone"], descendants: true }, { propertyName: "picker", first: true, predicate: ["picker"], descendants: true }], ngImport: i0, template: "<div\n class=\"drop-zone\"\n [style.pointerEvents]=\"loading ? 'none' : 'auto'\"\n [style.display]=\"isOver || alwaysShow || loading ? 'block' : 'none'\"\n tabindex=\"0\"\n *ngIf=\"!shouldShowFilesList()\"\n [ngClass]=\"{ 'has-errors': errors, disabled: formControl?.disabled || disabled }\"\n #zone\n (dragleave)=\"stopDragging()\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"onOver()\"\n (click)=\"showPicker($event)\"\n>\n <div\n class=\"file-placeholder\"\n data-cy=\"c8y-file-placeholder--drop-zone\"\n [ngClass]=\"{ 'drag-over': isOver }\"\n >\n <div\n class=\"d-flex d-col p-4 flex-center\"\n *ngIf=\"loading\"\n >\n <div\n class=\"progress progress-striped active m-0\"\n style=\"min-width: 50%\"\n *ngIf=\"progress !== -1\"\n >\n <div\n class=\"progress-bar\"\n [style.width]=\"progress + '%'\"\n [attr.aria-label]=\"progress + '%'\"\n aria-valuenow=\"0\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n role=\"progressbar\"\n ></div>\n </div>\n <div\n class=\"spinner-snake\"\n *ngIf=\"progress === -1\"\n ></div>\n <p\n class=\"m-t-auto m-b-auto m-r-8\"\n *ngIf=\"!hasDropAreaSmallClass\"\n >\n {{ loadingMessage | translate }}\n </p>\n </div>\n <div\n class=\"hint-placeholder pointer\"\n *ngIf=\"!loading\"\n data-cy=\"drop-zone--hint-placeholder\"\n >\n <i class=\"dlt-c8y-icon-{{ icon }}\"></i>\n <p\n class=\"text-truncate\"\n title=\"{{ message | translate }}\"\n *ngIf=\"!errors\"\n >\n <b>{{ message | translate }}</b>\n <br />\n <span\n *ngIf=\"alwaysShow && clickToOpen\"\n translate\n ></span>\n </p>\n <div\n class=\"has-errors\"\n *ngIf=\"errors\"\n >\n <p class=\"form-control-feedback-message\">\n {{ errorMessage | translate }}\n </p>\n </div>\n </div>\n </div>\n</div>\n\n<div\n class=\"drop-zone\"\n [style.display]=\"isOver || alwaysShow || loading ? 'block' : 'none'\"\n tabindex=\"0\"\n *ngIf=\"shouldShowFilesList()\"\n>\n <div\n class=\"p-absolute p-4 fit-w fit-h d-flex d-col j-c-center a-i-center\"\n *ngIf=\"loading\"\n >\n <div\n class=\"progress progress-striped active m-0\"\n style=\"min-width: 80%\"\n *ngIf=\"progress !== -1\"\n >\n <div\n class=\"progress-bar\"\n [style.width]=\"progress + '%'\"\n [attr.aria-label]=\"progress + '%'\"\n aria-valuenow=\"0\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n role=\"progressbar\"\n ></div>\n </div>\n <div *ngIf=\"progress === -1\">\n <c8y-loading></c8y-loading>\n </div>\n <p\n class=\"m-b-8\"\n *ngIf=\"!hasDropAreaSmallClass\"\n >\n <strong>\n {{ loadingMessage | translate }}\n </strong>\n </p>\n </div>\n <div\n class=\"file-placeholder p-4\"\n *ngIf=\"!loading\"\n >\n <div class=\"d-flex p-4 a-i-center\">\n <i\n class=\"icon-20 m-r-8\"\n c8yIcon=\"file-o\"\n ></i>\n <span\n class=\"text-truncate\"\n title=\"{{ filesNameString }}\"\n >\n {{ filesNameString }}\n </span>\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto\"\n title=\"{{ 'Remove' | translate }}\"\n [attr.aria-label]=\"'Remove' | translate\"\n type=\"button\"\n >\n <i\n c8yIcon=\"minus-circle\"\n (click)=\"onDelete()\"\n ></i>\n </button>\n </div>\n </div>\n</div>\n<label\n class=\"sr-only\"\n for=\"file\"\n>\n {{ 'Select file' | translate }}\n</label>\n<input\n class=\"hidden\"\n id=\"file\"\n type=\"file\"\n #picker\n *ngIf=\"clickToOpen\"\n (change)=\"onPick($event)\"\n (click)=\"picker.focus()\"\n (blur)=\"onTouched()\"\n [accept]=\"acceptedExts\"\n [multiple]=\"maxAllowedFiles > 1\"\n [disabled]=\"formControl?.disabled || disabled\"\n/>\n<div\n #area\n [hidden]=\"isOver || loading\"\n (dragover)=\"toggle()\"\n>\n <ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i1$a.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$a.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
22843
22848
  }
22844
22849
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropAreaComponent, decorators: [{
22845
22850
  type: Component,
22846
- args: [{ selector: 'c8y-drop-area', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: DropAreaComponent, multi: true }], standalone: true, imports: [CommonModule, C8yTranslatePipe, NgIf, NgClass, IconDirective], template: "<div\n class=\"drop-zone\"\n [style.pointerEvents]=\"loading ? 'none' : 'auto'\"\n [style.display]=\"isOver || alwaysShow || loading ? 'block' : 'none'\"\n tabindex=\"0\"\n *ngIf=\"!shouldShowFilesList()\"\n [ngClass]=\"{ 'has-errors': errors, disabled: formControl?.disabled }\"\n #zone\n (dragleave)=\"stopDragging()\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"onOver()\"\n (click)=\"showPicker($event)\"\n>\n <div\n class=\"file-placeholder\"\n data-cy=\"c8y-file-placeholder--drop-zone\"\n [ngClass]=\"{ 'drag-over': isOver }\"\n >\n <div\n class=\"d-flex d-col p-4 flex-center\"\n *ngIf=\"loading\"\n >\n <div\n class=\"progress progress-striped active m-0\"\n style=\"min-width: 50%\"\n *ngIf=\"progress !== -1\"\n >\n <div\n class=\"progress-bar\"\n [style.width]=\"progress + '%'\"\n [attr.aria-label]=\"progress + '%'\"\n aria-valuenow=\"0\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n role=\"progressbar\"\n ></div>\n </div>\n <div\n class=\"spinner-snake\"\n *ngIf=\"progress === -1\"\n ></div>\n <p\n class=\"m-t-auto m-b-auto m-r-8\"\n *ngIf=\"!hasDropAreaSmallClass\"\n >\n {{ loadingMessage | translate }}\n </p>\n </div>\n <div\n class=\"hint-placeholder pointer\"\n *ngIf=\"!loading\"\n data-cy=\"drop-zone--hint-placeholder\"\n >\n <i class=\"dlt-c8y-icon-{{ icon }}\"></i>\n <p *ngIf=\"!errors\" class=\"text-truncate\" title=\"{{ message | translate }}\">\n <b>{{ message | translate }}</b>\n <br />\n <span\n *ngIf=\"alwaysShow && clickToOpen\"\n translate\n ></span>\n </p>\n <div\n class=\"has-errors\"\n *ngIf=\"errors\"\n >\n <p class=\"form-control-feedback-message\">\n {{ errorMessage | translate }}\n </p>\n </div>\n </div>\n </div>\n</div>\n\n<div\n class=\"drop-zone\"\n [style.display]=\"isOver || alwaysShow || loading ? 'block' : 'none'\"\n tabindex=\"0\"\n *ngIf=\"shouldShowFilesList()\"\n>\n <div\n class=\"p-absolute p-4 fit-w fit-h d-flex d-col j-c-center a-i-center\"\n *ngIf=\"loading\"\n >\n <div\n class=\"progress progress-striped active m-0\"\n style=\"min-width: 80%\"\n *ngIf=\"progress !== -1\"\n >\n <div\n class=\"progress-bar\"\n [style.width]=\"progress + '%'\"\n [attr.aria-label]=\"progress + '%'\"\n aria-valuenow=\"0\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n role=\"progressbar\"\n ></div>\n </div>\n <div *ngIf=\"progress === -1\">\n <c8y-loading></c8y-loading>\n </div>\n <p\n class=\"m-b-8\"\n *ngIf=\"!hasDropAreaSmallClass\"\n >\n <strong>\n {{ loadingMessage | translate }}\n </strong>\n </p>\n </div>\n <div\n class=\"file-placeholder p-4\"\n *ngIf=\"!loading\"\n >\n <div class=\"d-flex p-4 a-i-center\">\n <i\n class=\"icon-20 m-r-8\"\n c8yIcon=\"file-o\"\n ></i>\n <span\n class=\"text-truncate\"\n title=\"{{ filesNameString }}\"\n >\n {{ filesNameString }}\n </span>\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto\"\n title=\"{{ 'Remove' | translate }}\"\n [attr.aria-label]=\"'Remove' | translate\"\n type=\"button\"\n >\n <i\n c8yIcon=\"minus-circle\"\n (click)=\"onDelete()\"\n ></i>\n </button>\n </div>\n </div>\n</div>\n<label\n class=\"sr-only\"\n for=\"file\"\n>\n {{ 'Select file' | translate }}\n</label>\n<input\n class=\"hidden\"\n id=\"file\"\n type=\"file\"\n #picker\n *ngIf=\"clickToOpen\"\n (change)=\"onPick($event)\"\n (click)=\"picker.focus()\"\n (blur)=\"onTouched()\"\n [accept]=\"acceptedExts\"\n [multiple]=\"maxAllowedFiles > 1\"\n [disabled]=\"formControl?.disabled\"\n/>\n<div\n #area\n [hidden]=\"isOver || loading\"\n (dragover)=\"toggle()\"\n>\n <ng-content></ng-content>\n</div>\n" }]
22851
+ args: [{ selector: 'c8y-drop-area', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: DropAreaComponent, multi: true }], standalone: true, imports: [CommonModule, C8yTranslatePipe, NgIf, NgClass, IconDirective], template: "<div\n class=\"drop-zone\"\n [style.pointerEvents]=\"loading ? 'none' : 'auto'\"\n [style.display]=\"isOver || alwaysShow || loading ? 'block' : 'none'\"\n tabindex=\"0\"\n *ngIf=\"!shouldShowFilesList()\"\n [ngClass]=\"{ 'has-errors': errors, disabled: formControl?.disabled || disabled }\"\n #zone\n (dragleave)=\"stopDragging()\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"onOver()\"\n (click)=\"showPicker($event)\"\n>\n <div\n class=\"file-placeholder\"\n data-cy=\"c8y-file-placeholder--drop-zone\"\n [ngClass]=\"{ 'drag-over': isOver }\"\n >\n <div\n class=\"d-flex d-col p-4 flex-center\"\n *ngIf=\"loading\"\n >\n <div\n class=\"progress progress-striped active m-0\"\n style=\"min-width: 50%\"\n *ngIf=\"progress !== -1\"\n >\n <div\n class=\"progress-bar\"\n [style.width]=\"progress + '%'\"\n [attr.aria-label]=\"progress + '%'\"\n aria-valuenow=\"0\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n role=\"progressbar\"\n ></div>\n </div>\n <div\n class=\"spinner-snake\"\n *ngIf=\"progress === -1\"\n ></div>\n <p\n class=\"m-t-auto m-b-auto m-r-8\"\n *ngIf=\"!hasDropAreaSmallClass\"\n >\n {{ loadingMessage | translate }}\n </p>\n </div>\n <div\n class=\"hint-placeholder pointer\"\n *ngIf=\"!loading\"\n data-cy=\"drop-zone--hint-placeholder\"\n >\n <i class=\"dlt-c8y-icon-{{ icon }}\"></i>\n <p\n class=\"text-truncate\"\n title=\"{{ message | translate }}\"\n *ngIf=\"!errors\"\n >\n <b>{{ message | translate }}</b>\n <br />\n <span\n *ngIf=\"alwaysShow && clickToOpen\"\n translate\n ></span>\n </p>\n <div\n class=\"has-errors\"\n *ngIf=\"errors\"\n >\n <p class=\"form-control-feedback-message\">\n {{ errorMessage | translate }}\n </p>\n </div>\n </div>\n </div>\n</div>\n\n<div\n class=\"drop-zone\"\n [style.display]=\"isOver || alwaysShow || loading ? 'block' : 'none'\"\n tabindex=\"0\"\n *ngIf=\"shouldShowFilesList()\"\n>\n <div\n class=\"p-absolute p-4 fit-w fit-h d-flex d-col j-c-center a-i-center\"\n *ngIf=\"loading\"\n >\n <div\n class=\"progress progress-striped active m-0\"\n style=\"min-width: 80%\"\n *ngIf=\"progress !== -1\"\n >\n <div\n class=\"progress-bar\"\n [style.width]=\"progress + '%'\"\n [attr.aria-label]=\"progress + '%'\"\n aria-valuenow=\"0\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n role=\"progressbar\"\n ></div>\n </div>\n <div *ngIf=\"progress === -1\">\n <c8y-loading></c8y-loading>\n </div>\n <p\n class=\"m-b-8\"\n *ngIf=\"!hasDropAreaSmallClass\"\n >\n <strong>\n {{ loadingMessage | translate }}\n </strong>\n </p>\n </div>\n <div\n class=\"file-placeholder p-4\"\n *ngIf=\"!loading\"\n >\n <div class=\"d-flex p-4 a-i-center\">\n <i\n class=\"icon-20 m-r-8\"\n c8yIcon=\"file-o\"\n ></i>\n <span\n class=\"text-truncate\"\n title=\"{{ filesNameString }}\"\n >\n {{ filesNameString }}\n </span>\n <button\n class=\"btn btn-dot btn-dot--danger showOnHover m-l-auto\"\n title=\"{{ 'Remove' | translate }}\"\n [attr.aria-label]=\"'Remove' | translate\"\n type=\"button\"\n >\n <i\n c8yIcon=\"minus-circle\"\n (click)=\"onDelete()\"\n ></i>\n </button>\n </div>\n </div>\n</div>\n<label\n class=\"sr-only\"\n for=\"file\"\n>\n {{ 'Select file' | translate }}\n</label>\n<input\n class=\"hidden\"\n id=\"file\"\n type=\"file\"\n #picker\n *ngIf=\"clickToOpen\"\n (change)=\"onPick($event)\"\n (click)=\"picker.focus()\"\n (blur)=\"onTouched()\"\n [accept]=\"acceptedExts\"\n [multiple]=\"maxAllowedFiles > 1\"\n [disabled]=\"formControl?.disabled || disabled\"\n/>\n<div\n #area\n [hidden]=\"isOver || loading\"\n (dragover)=\"toggle()\"\n>\n <ng-content></ng-content>\n</div>\n" }]
22847
22852
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: FilesService }, { type: i1$1.TranslateService }, { type: BytesPipe }, { type: i0.ElementRef }], propDecorators: { formControl: [{
22848
22853
  type: Input
22849
22854
  }], title: [{