@alfresco/aca-shared 1.12.0 → 4.0.0-4895233349

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 (321) hide show
  1. package/README.md +7 -6
  2. package/esm2020/alfresco-aca-shared.mjs +5 -0
  3. package/esm2020/lib/adf-extensions/extensions-data-loader.guard.mjs +73 -0
  4. package/esm2020/lib/components/document-base-page/document-base-page.component.mjs +176 -0
  5. package/esm2020/lib/components/document-base-page/document-base-page.service.mjs +26 -0
  6. package/esm2020/lib/components/generic-error/generic-error.component.mjs +41 -0
  7. package/esm2020/lib/components/generic-error/generic-error.module.mjs +44 -0
  8. package/esm2020/lib/components/info-drawer/info-drawer.component.mjs +123 -0
  9. package/esm2020/lib/components/info-drawer/shared-info-drawer.module.mjs +46 -0
  10. package/esm2020/lib/components/locked-by/locked-by.component.mjs +52 -0
  11. package/esm2020/lib/components/locked-by/locked-by.module.mjs +44 -0
  12. package/esm2020/lib/components/open-in-app/open-in-app.component.mjs +58 -0
  13. package/esm2020/lib/components/page-layout/page-layout-content.component.mjs +48 -0
  14. package/esm2020/lib/components/page-layout/page-layout-error.component.mjs +40 -0
  15. package/esm2020/lib/components/page-layout/page-layout-header.component.mjs +40 -0
  16. package/esm2020/lib/components/page-layout/page-layout.component.mjs +57 -0
  17. package/esm2020/lib/components/page-layout/page-layout.module.mjs +47 -0
  18. package/esm2020/lib/components/tool-bar/shared-toolbar.module.mjs +46 -0
  19. package/esm2020/lib/components/tool-bar/toolbar-action/toolbar-action.component.mjs +59 -0
  20. package/esm2020/lib/components/tool-bar/toolbar-button/toolbar-button.component.mjs +69 -0
  21. package/esm2020/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.mjs +82 -0
  22. package/esm2020/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.mjs +68 -0
  23. package/esm2020/lib/directives/contextmenu/contextmenu.directive.mjs +106 -0
  24. package/esm2020/lib/directives/contextmenu/contextmenu.module.mjs +42 -0
  25. package/esm2020/lib/directives/pagination.directive.mjs +54 -0
  26. package/esm2020/lib/directives/shared.directives.module.mjs +41 -0
  27. package/esm2020/lib/models/modal-configuration.mjs +25 -0
  28. package/esm2020/lib/models/types.mjs +25 -0
  29. package/esm2020/lib/models/viewer.rules.mjs +25 -0
  30. package/esm2020/lib/routing/shared.guard.mjs +48 -0
  31. package/esm2020/lib/services/aca-file-auto-download.service.mjs +55 -0
  32. package/esm2020/lib/services/aca-mobile-app-switcher.service.mjs +107 -0
  33. package/esm2020/lib/services/alfresco-office-extension.service.mjs +63 -0
  34. package/esm2020/lib/services/app-hook.service.mjs +87 -0
  35. package/esm2020/lib/services/app.extension.service.mjs +444 -0
  36. package/esm2020/lib/services/app.service.mjs +223 -0
  37. package/esm2020/lib/services/content-api.service.mjs +266 -0
  38. package/esm2020/lib/services/node-permission.service.mjs +89 -0
  39. package/esm2020/lib/services/router.extension.service.mjs +105 -0
  40. package/esm2020/lib/shared.module.mjs +54 -0
  41. package/esm2020/lib/testing/lib-testing-module.mjs +115 -0
  42. package/esm2020/lib/utils/node.utils.mjs +42 -0
  43. package/esm2020/public-api.mjs +62 -0
  44. package/esm2020/rules/alfresco-aca-shared-rules.mjs +5 -0
  45. package/esm2020/rules/app.rules.mjs +526 -0
  46. package/esm2020/rules/navigation.rules.mjs +156 -0
  47. package/esm2020/rules/public-api.mjs +28 -0
  48. package/esm2020/rules/repository.rules.mjs +33 -0
  49. package/esm2020/rules/user.rules.mjs +29 -0
  50. package/esm2020/store/actions/app-action-types.mjs +46 -0
  51. package/esm2020/store/actions/app.actions.mjs +128 -0
  52. package/esm2020/store/actions/context-menu-action-types.mjs +28 -0
  53. package/esm2020/store/actions/contextmenu.actions.mjs +31 -0
  54. package/esm2020/store/actions/library.actions.mjs +63 -0
  55. package/esm2020/store/actions/metadata-aspect.actions.mjs +31 -0
  56. package/esm2020/store/actions/node.actions.mjs +188 -0
  57. package/esm2020/store/actions/router-action-types.mjs +32 -0
  58. package/esm2020/store/actions/router.actions.mjs +54 -0
  59. package/esm2020/store/actions/search.actions.mjs +41 -0
  60. package/esm2020/store/actions/snackbar.actions.mjs +57 -0
  61. package/esm2020/store/actions/template-action-types.mjs +31 -0
  62. package/esm2020/store/actions/template.actions.mjs +47 -0
  63. package/esm2020/store/actions/upload.actions.mjs +49 -0
  64. package/esm2020/store/actions/viewer.actions.mjs +81 -0
  65. package/esm2020/store/alfresco-aca-shared-store.mjs +5 -0
  66. package/esm2020/store/effects/dialog.effects.mjs +44 -0
  67. package/esm2020/store/effects/router.effects.mjs +116 -0
  68. package/esm2020/store/effects/snackbar.effects.mjs +85 -0
  69. package/esm2020/store/models/delete-status.model.mjs +25 -0
  70. package/esm2020/store/models/deleted-node-info.model.mjs +25 -0
  71. package/esm2020/store/models/modal-configuration.mjs +25 -0
  72. package/esm2020/store/models/node-info.model.mjs +25 -0
  73. package/esm2020/store/models/search-option.model.mjs +30 -0
  74. package/esm2020/store/public-api.mjs +49 -0
  75. package/esm2020/store/selectors/app.selectors.mjs +56 -0
  76. package/esm2020/store/states/app.state.mjs +26 -0
  77. package/esm2020/store/store.module.mjs +42 -0
  78. package/fesm2015/alfresco-aca-shared-rules.mjs +775 -0
  79. package/fesm2015/alfresco-aca-shared-rules.mjs.map +1 -0
  80. package/fesm2015/alfresco-aca-shared-store.mjs +1300 -0
  81. package/fesm2015/alfresco-aca-shared-store.mjs.map +1 -0
  82. package/fesm2015/alfresco-aca-shared.mjs +2902 -0
  83. package/fesm2015/alfresco-aca-shared.mjs.map +1 -0
  84. package/fesm2020/alfresco-aca-shared-rules.mjs +771 -0
  85. package/fesm2020/alfresco-aca-shared-rules.mjs.map +1 -0
  86. package/fesm2020/alfresco-aca-shared-store.mjs +1376 -0
  87. package/fesm2020/alfresco-aca-shared-store.mjs.map +1 -0
  88. package/fesm2020/alfresco-aca-shared.mjs +3049 -0
  89. package/fesm2020/alfresco-aca-shared.mjs.map +1 -0
  90. package/{rules/alfresco-aca-shared-rules.d.ts → index.d.ts} +1 -0
  91. package/lib/adf-extensions/extensions-data-loader.guard.d.ts +9 -7
  92. package/lib/components/document-base-page/document-base-page.component.d.ts +76 -0
  93. package/lib/components/document-base-page/document-base-page.service.d.ts +28 -0
  94. package/lib/components/generic-error/generic-error.component.d.ts +3 -24
  95. package/lib/components/generic-error/generic-error.module.d.ts +8 -24
  96. package/lib/components/info-drawer/info-drawer.component.d.ts +11 -6
  97. package/lib/components/info-drawer/shared-info-drawer.module.d.ts +11 -24
  98. package/lib/components/locked-by/locked-by.component.d.ts +5 -30
  99. package/lib/components/locked-by/locked-by.module.d.ts +8 -24
  100. package/lib/components/open-in-app/open-in-app.component.d.ts +16 -0
  101. package/lib/components/page-layout/page-layout-content.component.d.ts +3 -24
  102. package/lib/components/page-layout/page-layout-error.component.d.ts +3 -24
  103. package/lib/components/page-layout/page-layout-header.component.d.ts +3 -24
  104. package/lib/components/page-layout/page-layout.component.d.ts +18 -7
  105. package/lib/components/page-layout/page-layout.module.d.ts +12 -24
  106. package/lib/components/tool-bar/shared-toolbar.module.d.ts +11 -24
  107. package/lib/components/tool-bar/toolbar-action/toolbar-action.component.d.ts +16 -8
  108. package/lib/components/tool-bar/toolbar-button/toolbar-button.component.d.ts +10 -25
  109. package/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.d.ts +25 -12
  110. package/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.d.ts +7 -27
  111. package/lib/directives/contextmenu/contextmenu.directive.d.ts +10 -7
  112. package/lib/directives/contextmenu/contextmenu.module.d.ts +5 -24
  113. package/lib/directives/pagination.directive.d.ts +8 -6
  114. package/lib/directives/shared.directives.module.d.ts +6 -24
  115. package/lib/models/modal-configuration.d.ts +26 -0
  116. package/lib/models/types.d.ts +5 -6
  117. package/lib/models/viewer.rules.d.ts +9 -6
  118. package/lib/routing/shared.guard.d.ts +5 -26
  119. package/lib/services/aca-file-auto-download.service.d.ts +13 -0
  120. package/lib/services/aca-mobile-app-switcher.service.d.ts +48 -0
  121. package/lib/services/alfresco-office-extension.service.d.ts +11 -0
  122. package/lib/services/app-hook.service.d.ts +55 -0
  123. package/lib/services/app.extension.service.d.ts +31 -53
  124. package/lib/services/app.service.d.ts +52 -13
  125. package/lib/services/content-api.service.d.ts +35 -25
  126. package/lib/services/node-permission.service.d.ts +3 -24
  127. package/lib/services/router.extension.service.d.ts +21 -0
  128. package/lib/shared.module.d.ts +16 -7
  129. package/lib/testing/lib-testing-module.d.ts +41 -0
  130. package/lib/utils/node.utils.d.ts +5 -6
  131. package/package.json +61 -21
  132. package/public-api.d.ts +24 -11
  133. package/rules/app.rules.d.ts +128 -36
  134. package/{store/alfresco-aca-shared-store.d.ts → rules/index.d.ts} +1 -0
  135. package/rules/navigation.rules.d.ts +12 -12
  136. package/rules/public-api.d.ts +5 -6
  137. package/rules/repository.rules.d.ts +7 -7
  138. package/rules/user.rules.d.ts +6 -7
  139. package/store/actions/app-action-types.d.ts +44 -0
  140. package/store/actions/app.actions.d.ts +30 -29
  141. package/store/actions/context-menu-action-types.d.ts +26 -0
  142. package/store/actions/contextmenu.actions.d.ts +6 -9
  143. package/store/actions/library.actions.d.ts +8 -7
  144. package/store/actions/metadata-aspect.actions.d.ts +5 -6
  145. package/store/actions/node.actions.d.ts +38 -13
  146. package/store/actions/router-action-types.d.ts +30 -0
  147. package/store/actions/router.actions.d.ts +10 -12
  148. package/store/actions/search.actions.d.ts +11 -19
  149. package/store/actions/snackbar.actions.d.ts +13 -17
  150. package/store/actions/template-action-types.d.ts +29 -0
  151. package/store/actions/template.actions.d.ts +6 -12
  152. package/store/actions/upload.actions.d.ts +8 -7
  153. package/store/actions/viewer.actions.d.ts +27 -7
  154. package/store/effects/dialog.effects.d.ts +9 -7
  155. package/store/effects/router.effects.d.ts +11 -29
  156. package/store/effects/snackbar.effects.d.ts +11 -9
  157. package/store/index.d.ts +5 -0
  158. package/store/models/delete-status.model.d.ts +5 -6
  159. package/store/models/deleted-node-info.model.d.ts +5 -6
  160. package/store/models/modal-configuration.d.ts +26 -0
  161. package/store/models/node-info.model.d.ts +5 -6
  162. package/store/models/search-option.model.d.ts +5 -6
  163. package/store/public-api.d.ts +9 -6
  164. package/store/selectors/app.selectors.d.ts +35 -25
  165. package/store/states/app.state.d.ts +14 -10
  166. package/store/store.module.d.ts +5 -24
  167. package/alfresco-aca-shared.d.ts +0 -11
  168. package/alfresco-aca-shared.metadata.json +0 -1
  169. package/bundles/alfresco-aca-shared-rules.umd.js +0 -895
  170. package/bundles/alfresco-aca-shared-rules.umd.js.map +0 -1
  171. package/bundles/alfresco-aca-shared-rules.umd.min.js +0 -75
  172. package/bundles/alfresco-aca-shared-rules.umd.min.js.map +0 -1
  173. package/bundles/alfresco-aca-shared-store.umd.js +0 -1399
  174. package/bundles/alfresco-aca-shared-store.umd.js.map +0 -1
  175. package/bundles/alfresco-aca-shared-store.umd.min.js +0 -26
  176. package/bundles/alfresco-aca-shared-store.umd.min.js.map +0 -1
  177. package/bundles/alfresco-aca-shared.umd.js +0 -2845
  178. package/bundles/alfresco-aca-shared.umd.js.map +0 -1
  179. package/bundles/alfresco-aca-shared.umd.min.js +0 -27
  180. package/bundles/alfresco-aca-shared.umd.min.js.map +0 -1
  181. package/esm2015/alfresco-aca-shared.js +0 -16
  182. package/esm2015/lib/adf-extensions/extensions-data-loader.guard.js +0 -106
  183. package/esm2015/lib/components/generic-error/generic-error.component.js +0 -52
  184. package/esm2015/lib/components/generic-error/generic-error.module.js +0 -43
  185. package/esm2015/lib/components/info-drawer/info-drawer.component.js +0 -179
  186. package/esm2015/lib/components/info-drawer/shared-info-drawer.module.js +0 -52
  187. package/esm2015/lib/components/locked-by/locked-by.component.js +0 -74
  188. package/esm2015/lib/components/locked-by/locked-by.module.js +0 -42
  189. package/esm2015/lib/components/page-layout/page-layout-content.component.js +0 -53
  190. package/esm2015/lib/components/page-layout/page-layout-error.component.js +0 -43
  191. package/esm2015/lib/components/page-layout/page-layout-header.component.js +0 -41
  192. package/esm2015/lib/components/page-layout/page-layout.component.js +0 -52
  193. package/esm2015/lib/components/page-layout/page-layout.module.js +0 -54
  194. package/esm2015/lib/components/tool-bar/shared-toolbar.module.js +0 -56
  195. package/esm2015/lib/components/tool-bar/toolbar-action/toolbar-action.component.js +0 -81
  196. package/esm2015/lib/components/tool-bar/toolbar-button/toolbar-button.component.js +0 -96
  197. package/esm2015/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.js +0 -69
  198. package/esm2015/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.js +0 -95
  199. package/esm2015/lib/directives/contextmenu/contextmenu.directive.js +0 -156
  200. package/esm2015/lib/directives/contextmenu/contextmenu.module.js +0 -42
  201. package/esm2015/lib/directives/pagination.directive.js +0 -93
  202. package/esm2015/lib/directives/shared.directives.module.js +0 -41
  203. package/esm2015/lib/models/types.js +0 -67
  204. package/esm2015/lib/models/viewer.rules.js +0 -40
  205. package/esm2015/lib/routing/app.routes.strategy.js +0 -207
  206. package/esm2015/lib/routing/shared.guard.js +0 -70
  207. package/esm2015/lib/services/app.extension.service.js +0 -686
  208. package/esm2015/lib/services/app.service.js +0 -95
  209. package/esm2015/lib/services/content-api.service.js +0 -331
  210. package/esm2015/lib/services/node-permission.service.js +0 -133
  211. package/esm2015/lib/shared.module.js +0 -51
  212. package/esm2015/lib/utils/node.utils.js +0 -53
  213. package/esm2015/public-api.js +0 -53
  214. package/esm2015/rules/alfresco-aca-shared-rules.js +0 -9
  215. package/esm2015/rules/app.rules.js +0 -563
  216. package/esm2015/rules/navigation.rules.js +0 -211
  217. package/esm2015/rules/public-api.js +0 -33
  218. package/esm2015/rules/repository.rules.js +0 -38
  219. package/esm2015/rules/user.rules.js +0 -38
  220. package/esm2015/store/actions/app.actions.js +0 -234
  221. package/esm2015/store/actions/contextmenu.actions.js +0 -49
  222. package/esm2015/store/actions/library.actions.js +0 -111
  223. package/esm2015/store/actions/metadata-aspect.actions.js +0 -46
  224. package/esm2015/store/actions/node.actions.js +0 -337
  225. package/esm2015/store/actions/router.actions.js +0 -97
  226. package/esm2015/store/actions/search.actions.js +0 -83
  227. package/esm2015/store/actions/snackbar.actions.js +0 -138
  228. package/esm2015/store/actions/template.actions.js +0 -85
  229. package/esm2015/store/actions/upload.actions.js +0 -81
  230. package/esm2015/store/actions/viewer.actions.js +0 -115
  231. package/esm2015/store/alfresco-aca-shared-store.js +0 -9
  232. package/esm2015/store/effects/dialog.effects.js +0 -72
  233. package/esm2015/store/effects/router.effects.js +0 -192
  234. package/esm2015/store/effects/snackbar.effects.js +0 -144
  235. package/esm2015/store/models/delete-status.model.js +0 -55
  236. package/esm2015/store/models/deleted-node-info.model.js +0 -41
  237. package/esm2015/store/models/node-info.model.js +0 -45
  238. package/esm2015/store/models/search-option.model.js +0 -52
  239. package/esm2015/store/public-api.js +0 -50
  240. package/esm2015/store/selectors/app.selectors.js +0 -82
  241. package/esm2015/store/states/app.state.js +0 -71
  242. package/esm2015/store/store.module.js +0 -43
  243. package/esm5/alfresco-aca-shared.js +0 -16
  244. package/esm5/lib/adf-extensions/extensions-data-loader.guard.js +0 -115
  245. package/esm5/lib/components/generic-error/generic-error.component.js +0 -54
  246. package/esm5/lib/components/generic-error/generic-error.module.js +0 -47
  247. package/esm5/lib/components/info-drawer/info-drawer.component.js +0 -209
  248. package/esm5/lib/components/info-drawer/shared-info-drawer.module.js +0 -56
  249. package/esm5/lib/components/locked-by/locked-by.component.js +0 -80
  250. package/esm5/lib/components/locked-by/locked-by.module.js +0 -46
  251. package/esm5/lib/components/page-layout/page-layout-content.component.js +0 -53
  252. package/esm5/lib/components/page-layout/page-layout-error.component.js +0 -45
  253. package/esm5/lib/components/page-layout/page-layout-header.component.js +0 -45
  254. package/esm5/lib/components/page-layout/page-layout.component.js +0 -54
  255. package/esm5/lib/components/page-layout/page-layout.module.js +0 -58
  256. package/esm5/lib/components/tool-bar/shared-toolbar.module.js +0 -60
  257. package/esm5/lib/components/tool-bar/toolbar-action/toolbar-action.component.js +0 -88
  258. package/esm5/lib/components/tool-bar/toolbar-button/toolbar-button.component.js +0 -103
  259. package/esm5/lib/components/tool-bar/toolbar-menu/toolbar-menu.component.js +0 -80
  260. package/esm5/lib/components/tool-bar/toolbar-menu-item/toolbar-menu-item.component.js +0 -103
  261. package/esm5/lib/directives/contextmenu/contextmenu.directive.js +0 -187
  262. package/esm5/lib/directives/contextmenu/contextmenu.module.js +0 -46
  263. package/esm5/lib/directives/pagination.directive.js +0 -97
  264. package/esm5/lib/directives/shared.directives.module.js +0 -45
  265. package/esm5/lib/models/types.js +0 -67
  266. package/esm5/lib/models/viewer.rules.js +0 -40
  267. package/esm5/lib/routing/app.routes.strategy.js +0 -268
  268. package/esm5/lib/routing/shared.guard.js +0 -77
  269. package/esm5/lib/services/app.extension.service.js +0 -835
  270. package/esm5/lib/services/app.service.js +0 -100
  271. package/esm5/lib/services/content-api.service.js +0 -495
  272. package/esm5/lib/services/node-permission.service.js +0 -161
  273. package/esm5/lib/shared.module.js +0 -58
  274. package/esm5/lib/utils/node.utils.js +0 -53
  275. package/esm5/public-api.js +0 -53
  276. package/esm5/rules/alfresco-aca-shared-rules.js +0 -9
  277. package/esm5/rules/app.rules.js +0 -563
  278. package/esm5/rules/navigation.rules.js +0 -211
  279. package/esm5/rules/public-api.js +0 -33
  280. package/esm5/rules/repository.rules.js +0 -38
  281. package/esm5/rules/user.rules.js +0 -38
  282. package/esm5/store/actions/app.actions.js +0 -232
  283. package/esm5/store/actions/contextmenu.actions.js +0 -48
  284. package/esm5/store/actions/library.actions.js +0 -108
  285. package/esm5/store/actions/metadata-aspect.actions.js +0 -45
  286. package/esm5/store/actions/node.actions.js +0 -322
  287. package/esm5/store/actions/router.actions.js +0 -93
  288. package/esm5/store/actions/search.actions.js +0 -87
  289. package/esm5/store/actions/snackbar.actions.js +0 -130
  290. package/esm5/store/actions/template.actions.js +0 -87
  291. package/esm5/store/actions/upload.actions.js +0 -78
  292. package/esm5/store/actions/viewer.actions.js +0 -109
  293. package/esm5/store/alfresco-aca-shared-store.js +0 -9
  294. package/esm5/store/effects/dialog.effects.js +0 -71
  295. package/esm5/store/effects/router.effects.js +0 -207
  296. package/esm5/store/effects/snackbar.effects.js +0 -154
  297. package/esm5/store/models/delete-status.model.js +0 -55
  298. package/esm5/store/models/deleted-node-info.model.js +0 -41
  299. package/esm5/store/models/node-info.model.js +0 -45
  300. package/esm5/store/models/search-option.model.js +0 -52
  301. package/esm5/store/public-api.js +0 -50
  302. package/esm5/store/selectors/app.selectors.js +0 -82
  303. package/esm5/store/states/app.state.js +0 -71
  304. package/esm5/store/store.module.js +0 -47
  305. package/fesm2015/alfresco-aca-shared-rules.js +0 -827
  306. package/fesm2015/alfresco-aca-shared-rules.js.map +0 -1
  307. package/fesm2015/alfresco-aca-shared-store.js +0 -1354
  308. package/fesm2015/alfresco-aca-shared-store.js.map +0 -1
  309. package/fesm2015/alfresco-aca-shared.js +0 -2096
  310. package/fesm2015/alfresco-aca-shared.js.map +0 -1
  311. package/fesm5/alfresco-aca-shared-rules.js +0 -827
  312. package/fesm5/alfresco-aca-shared-rules.js.map +0 -1
  313. package/fesm5/alfresco-aca-shared-store.js +0 -1278
  314. package/fesm5/alfresco-aca-shared-store.js.map +0 -1
  315. package/fesm5/alfresco-aca-shared.js +0 -2637
  316. package/fesm5/alfresco-aca-shared.js.map +0 -1
  317. package/lib/routing/app.routes.strategy.d.ts +0 -40
  318. package/rules/alfresco-aca-shared-rules.metadata.json +0 -1
  319. package/rules/package.json +0 -13
  320. package/store/alfresco-aca-shared-store.metadata.json +0 -1
  321. package/store/package.json +0 -13
@@ -0,0 +1,771 @@
1
+ /*!
2
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
3
+ *
4
+ * Alfresco Example Content Application
5
+ *
6
+ * This file is part of the Alfresco Example Content Application.
7
+ * If the software was purchased under a paid Alfresco license, the terms of
8
+ * the paid license agreement will prevail. Otherwise, the software is
9
+ * provided under the following open source license terms:
10
+ *
11
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU Lesser General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU Lesser General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU Lesser General Public License
22
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ /**
25
+ * Checks if a Preview route is activated.
26
+ * JSON ref: `app.navigation.isPreview`
27
+ */
28
+ function isPreview(context) {
29
+ const { url } = context.navigation;
30
+ return url && (url.includes('/preview/') || url.includes('viewer:view') || url.includes('/view/'));
31
+ }
32
+ /**
33
+ * Checks if a **Favorites** route is activated.
34
+ * JSON ref: `app.navigation.isFavorites`
35
+ */
36
+ function isFavorites(context) {
37
+ const { url } = context.navigation;
38
+ return url && url.startsWith('/favorites') && !isPreview(context);
39
+ }
40
+ /**
41
+ * Checks if the activated route is not **Favorites**.
42
+ * JSON ref: `app.navigation.isNotFavorites`
43
+ */
44
+ const isNotFavorites = (context) => !isFavorites(context);
45
+ /**
46
+ * Checks if a **Shared Files** route is activated.
47
+ * JSON ref: `app.navigation.isSharedFiles`
48
+ */
49
+ function isSharedFiles(context) {
50
+ const { url } = context.navigation;
51
+ return url && url.startsWith('/shared') && !isPreview(context);
52
+ }
53
+ /**
54
+ * Checks if the activated route is not **Shared Files**.
55
+ * JSON ref: `app.navigation.isNotSharedFiles`
56
+ */
57
+ const isNotSharedFiles = (context) => !isSharedFiles(context);
58
+ /**
59
+ * Checks if a **Trashcan** route is activated.
60
+ * JSON ref: `app.navigation.isTrashcan`
61
+ */
62
+ function isTrashcan(context) {
63
+ const { url } = context.navigation;
64
+ return url && url.startsWith('/trashcan');
65
+ }
66
+ /**
67
+ * Checks if the activated route is not **Trashcan**.
68
+ * JSON ref: `app.navigation.isNotTrashcan`
69
+ */
70
+ const isNotTrashcan = (context) => !isTrashcan(context);
71
+ /**
72
+ * Checks if a **Personal Files** route is activated.
73
+ * JSON ref: `app.navigation.isPersonalFiles`
74
+ */
75
+ function isPersonalFiles(context) {
76
+ const { url } = context.navigation;
77
+ return url && url.startsWith('/personal-files');
78
+ }
79
+ /**
80
+ * Checks if a **Library Files** route is activated.
81
+ * JSON ref: `app.navigation.isLibraryFiles`
82
+ */
83
+ function isLibraryFiles(context) {
84
+ const { url } = context.navigation;
85
+ return url && url.startsWith('/libraries');
86
+ }
87
+ /**
88
+ * Checks if a **Library Files** or **Library Search Result** route is activated.
89
+ * JSON ref: `app.navigation.isLibraryFiles`
90
+ */
91
+ function isLibraries(context) {
92
+ const { url } = context.navigation;
93
+ return url && (url.endsWith('/libraries') || url.startsWith('/search-libraries'));
94
+ }
95
+ function isLibraryContent(context) {
96
+ const { url } = context.navigation;
97
+ return url && (url.endsWith('/libraries') || url.includes('/libraries/') || url.startsWith('/search-libraries'));
98
+ }
99
+ /**
100
+ * Checks if the activated route is neither **Libraries** nor **Library Search Results**.
101
+ * JSON ref: `app.navigation.isNotLibraries`
102
+ */
103
+ const isNotLibraries = (context) => !isLibraries(context);
104
+ /**
105
+ * Checks if a **Recent Files** route is activated.
106
+ * JSON ref: `app.navigation.isRecentFiles`
107
+ */
108
+ function isRecentFiles(context) {
109
+ const { url } = context.navigation;
110
+ return url && url.startsWith('/recent-files');
111
+ }
112
+ /**
113
+ * Checks if the activated route is not **Recent Files**.
114
+ * JSON ref: `app.navigation.isNotRecentFiles`
115
+ */
116
+ const isNotRecentFiles = (context) => !isRecentFiles(context);
117
+ /**
118
+ * Checks if a **Search Results** route is activated.
119
+ * JSON ref: `app.navigation.isSearchResults`
120
+ */
121
+ function isSearchResults(context
122
+ // ...args: RuleParameter[]
123
+ ) {
124
+ const { url } = context.navigation;
125
+ return url && url.startsWith('/search');
126
+ }
127
+ /**
128
+ * Checks if the activated route is not **Search Results**.
129
+ * JSON ref: `app.navigation.isNotSearchResults`
130
+ */
131
+ const isNotSearchResults = (context) => !isSearchResults(context);
132
+ /**
133
+ * Checks if a **Shared Preview** route is activated.
134
+ * JSON ref: `app.navigation.isSharedPreview`
135
+ */
136
+ function isSharedPreview(context) {
137
+ const { url } = context.navigation;
138
+ return url && (url.startsWith('/shared/preview/') || (url.startsWith('/shared') && url.includes('viewer:view')));
139
+ }
140
+ /**
141
+ * Checks if a **Favorites Preview** route is activated.
142
+ * JSON ref: `app.navigation.isFavoritesPreview`
143
+ */
144
+ function isFavoritesPreview(context) {
145
+ const { url } = context.navigation;
146
+ return url && (url.startsWith('/favorites/preview/') || (url.startsWith('/favorites') && url.includes('viewer:view')));
147
+ }
148
+ /**
149
+ * Checks if a **Shared File Preview** route is activated.
150
+ * JSON ref: `app.navigation.isFavoritesPreview`
151
+ */
152
+ function isSharedFileViewer(context) {
153
+ const { url } = context.navigation;
154
+ return url && url.startsWith('/preview/s/');
155
+ }
156
+
157
+ /*!
158
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
159
+ *
160
+ * Alfresco Example Content Application
161
+ *
162
+ * This file is part of the Alfresco Example Content Application.
163
+ * If the software was purchased under a paid Alfresco license, the terms of
164
+ * the paid license agreement will prevail. Otherwise, the software is
165
+ * provided under the following open source license terms:
166
+ *
167
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
168
+ * it under the terms of the GNU Lesser General Public License as published by
169
+ * the Free Software Foundation, either version 3 of the License, or
170
+ * (at your option) any later version.
171
+ *
172
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
173
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
174
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
175
+ * GNU Lesser General Public License for more details.
176
+ *
177
+ * You should have received a copy of the GNU Lesser General Public License
178
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
179
+ */
180
+ /**
181
+ * Checks if the quick share repository option is enabled or not.
182
+ * JSON ref: `repository.isQuickShareEnabled`
183
+ */
184
+ const hasQuickShareEnabled = (context) => context.repository.status.isQuickShareEnabled;
185
+ function isMajorVersionAvailable(context, versionNumber) {
186
+ const majorVersion = context.repository.version?.major ? parseInt(context.repository.version.major, 10) : 0;
187
+ return majorVersion >= parseInt(versionNumber, 10);
188
+ }
189
+
190
+ /*!
191
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
192
+ *
193
+ * Alfresco Example Content Application
194
+ *
195
+ * This file is part of the Alfresco Example Content Application.
196
+ * If the software was purchased under a paid Alfresco license, the terms of
197
+ * the paid license agreement will prevail. Otherwise, the software is
198
+ * provided under the following open source license terms:
199
+ *
200
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
201
+ * it under the terms of the GNU Lesser General Public License as published by
202
+ * the Free Software Foundation, either version 3 of the License, or
203
+ * (at your option) any later version.
204
+ *
205
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
206
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
207
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
208
+ * GNU Lesser General Public License for more details.
209
+ *
210
+ * You should have received a copy of the GNU Lesser General Public License
211
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
212
+ */
213
+ /**
214
+ * Checks if user is admin.
215
+ * JSON ref: `user.isAdmin`
216
+ */
217
+ const isAdmin = (context) => context.profile.isAdmin;
218
+
219
+ /*!
220
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
221
+ *
222
+ * Alfresco Example Content Application
223
+ *
224
+ * This file is part of the Alfresco Example Content Application.
225
+ * If the software was purchased under a paid Alfresco license, the terms of
226
+ * the paid license agreement will prevail. Otherwise, the software is
227
+ * provided under the following open source license terms:
228
+ *
229
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
230
+ * it under the terms of the GNU Lesser General Public License as published by
231
+ * the Free Software Foundation, either version 3 of the License, or
232
+ * (at your option) any later version.
233
+ *
234
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
235
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
236
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
237
+ * GNU Lesser General Public License for more details.
238
+ *
239
+ * You should have received a copy of the GNU Lesser General Public License
240
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
241
+ */
242
+ /* cspell:disable */
243
+ const supportedExtensions = {
244
+ doc: 'ms-word',
245
+ docx: 'ms-word',
246
+ docm: 'ms-word',
247
+ dot: 'ms-word',
248
+ dotx: 'ms-word',
249
+ dotm: 'ms-word',
250
+ rtf: 'ms-word',
251
+ xls: 'ms-excel',
252
+ xlsx: 'ms-excel',
253
+ xlsb: 'ms-excel',
254
+ xlsm: 'ms-excel',
255
+ xlt: 'ms-excel',
256
+ xltx: 'ms-excel',
257
+ xltm: 'ms-excel',
258
+ xlam: 'ms-excel',
259
+ ppt: 'ms-powerpoint',
260
+ pptx: 'ms-powerpoint',
261
+ pot: 'ms-powerpoint',
262
+ potx: 'ms-powerpoint',
263
+ potm: 'ms-powerpoint',
264
+ pptm: 'ms-powerpoint',
265
+ pps: 'ms-powerpoint',
266
+ ppsx: 'ms-powerpoint',
267
+ ppam: 'ms-powerpoint',
268
+ ppsm: 'ms-powerpoint',
269
+ sldx: 'ms-powerpoint',
270
+ sldm: 'ms-powerpoint',
271
+ vsd: 'ms-visio',
272
+ vss: 'ms-visio',
273
+ vst: 'ms-visio',
274
+ vsdx: 'ms-visio',
275
+ vsdm: 'ms-visio',
276
+ vssx: 'ms-visio',
277
+ vssm: 'ms-visio',
278
+ vstx: 'ms-visio',
279
+ vstm: 'ms-visio'
280
+ };
281
+ /* cspell:enable */
282
+ function getFileExtension(fileName) {
283
+ if (fileName) {
284
+ const match = fileName.match(/\.([^\./\?\#]+)($|\?|\#)/);
285
+ return match ? match[1] : null;
286
+ }
287
+ return null;
288
+ }
289
+ /**
290
+ * Checks if the content plugin is enabled.
291
+ * JSON ref: `app.isContentServiceEnabled`
292
+ */
293
+ const isContentServiceEnabled = () => localStorage && localStorage.getItem('contentService') !== 'false';
294
+ /**
295
+ * Checks if Search is supported for active view
296
+ * JSON ref: `app.isSearchSupported`
297
+ */
298
+ const isSearchSupported = (context) => [isNotSearchResults(context) /* , !hasSelection(context)*/].every(Boolean);
299
+ /**
300
+ * Checks if upload action is supported for the given context
301
+ * JSON ref: `app.isUploadSupported`
302
+ *
303
+ * @param content Rule execution context
304
+ */
305
+ const isUploadSupported = (context) => [isContentServiceEnabled(), isPersonalFiles(context) || isLibraryContent(context), canUpload(context)].every(Boolean);
306
+ /**
307
+ * Checks if user can copy selected node.
308
+ * JSON ref: `app.canCopyNode`
309
+ *
310
+ * @param context Rule execution context
311
+ */
312
+ const canCopyNode = (context) => [hasSelection(context), isNotTrashcan(context), isNotLibraries(context)].every(Boolean);
313
+ /**
314
+ * Checks if user can mark selected nodes as **Favorite**.
315
+ * JSON ref: `app.selection.canAddFavorite`
316
+ */
317
+ function canAddFavorite(context) {
318
+ if (!context.selection.isEmpty) {
319
+ if (isFavorites(context) || isLibraries(context) || isTrashcan(context)) {
320
+ return false;
321
+ }
322
+ return context.selection.nodes.some((node) => !node.entry.isFavorite);
323
+ }
324
+ return false;
325
+ }
326
+ /**
327
+ * Checks if user can un-mark selected nodes as **Favorite**.
328
+ * JSON ref: `app.selection.canRemoveFavorite`
329
+ */
330
+ function canRemoveFavorite(context) {
331
+ if (!context.selection.isEmpty && !isTrashcan(context)) {
332
+ if (isFavorites(context)) {
333
+ return true;
334
+ }
335
+ return context.selection.nodes.every((node) => node.entry.isFavorite);
336
+ }
337
+ return false;
338
+ }
339
+ /**
340
+ * Checks if user can share selected file.
341
+ * JSON ref: `app.selection.file.canShare`
342
+ */
343
+ const canShareFile = (context) => [context.selection.file, isNotTrashcan(context), hasQuickShareEnabled(context), !isShared(context)].every(Boolean);
344
+ /**
345
+ * Checks if user can perform "Join" or "Cancel Join Request" on a library.
346
+ * JSON ref: `canToggleJoinLibrary`
347
+ */
348
+ const canToggleJoinLibrary = (context) => [hasLibrarySelected(context), !isPrivateLibrary(context), hasNoLibraryRole(context)].every(Boolean) ||
349
+ [hasLibrarySelected(context), isPrivateLibrary(context), hasNoLibraryRole(context), isAdmin(context)].every(Boolean);
350
+ /**
351
+ * Checks if user can edit the selected folder.
352
+ * JSON ref: `canEditFolder`
353
+ *
354
+ * @param context Rule execution context
355
+ */
356
+ const canEditFolder = (context) => [canUpdateSelectedFolder(context), isNotTrashcan(context)].every(Boolean);
357
+ /**
358
+ * Checks if the selected file is already shared.
359
+ * JSON ref: `app.selection.file.isShared`
360
+ */
361
+ function isShared(context) {
362
+ if (isSharedFiles(context) && context.selection.file) {
363
+ return true;
364
+ }
365
+ if (isNotTrashcan(context) && !context.selection.isEmpty && context.selection.file) {
366
+ return !!(context.selection.file.entry && context.selection.file.entry.properties && context.selection.file.entry.properties['qshare:sharedId']);
367
+ }
368
+ return false;
369
+ }
370
+ /**
371
+ * Checks if user can delete selected nodes.
372
+ * JSON ref: `app.selection.canDelete`
373
+ */
374
+ function canDeleteSelection(context) {
375
+ if (isNotTrashcan(context) &&
376
+ isNotLibraries(context) &&
377
+ isNotSearchResults(context) &&
378
+ !context.selection.isEmpty) {
379
+ if (hasLockedFiles(context)) {
380
+ return false;
381
+ }
382
+ // temp workaround for Favorites api
383
+ if (isFavorites(context)) {
384
+ return true;
385
+ }
386
+ if (isPreview(context)) {
387
+ return context.permissions.check(context.selection.nodes, ['delete']);
388
+ }
389
+ // workaround for Shared Files
390
+ if (isSharedFiles(context)) {
391
+ return context.permissions.check(context.selection.nodes, ['delete'], {
392
+ target: 'allowableOperationsOnTarget'
393
+ });
394
+ }
395
+ return context.permissions.check(context.selection.nodes, ['delete']);
396
+ }
397
+ return false;
398
+ }
399
+ /**
400
+ * Checks if user can un-share selected nodes.
401
+ * JSON ref: `app.selection.canUnshare`
402
+ */
403
+ function canUnshareNodes(context) {
404
+ if (!context.selection.isEmpty) {
405
+ return context.permissions.check(context.selection.nodes, ['delete'], {
406
+ target: 'allowableOperationsOnTarget'
407
+ });
408
+ }
409
+ return false;
410
+ }
411
+ /**
412
+ * Checks if user selected anything.
413
+ * JSON ref: `app.selection.notEmpty`
414
+ */
415
+ const hasSelection = (context) => !context.selection.isEmpty;
416
+ /**
417
+ * Checks if user can create a new folder with current path.
418
+ * JSON ref: `app.navigation.folder.canCreate`
419
+ */
420
+ function canCreateFolder(context) {
421
+ if (isContentServiceEnabled() && (isPersonalFiles(context) || isLibraryContent(context))) {
422
+ const { currentFolder } = context.navigation;
423
+ if (currentFolder) {
424
+ return context.permissions.check(currentFolder, ['create']);
425
+ }
426
+ }
427
+ return false;
428
+ }
429
+ /**
430
+ * Checks if user can create a Library
431
+ * JSON ref: `app.canCreateLibrary`
432
+ *
433
+ * @param context Rule execution context
434
+ */
435
+ const canCreateLibrary = (context) => [isContentServiceEnabled(), isLibraries(context)].every(Boolean);
436
+ /**
437
+ * Checks if user can upload content to current folder.
438
+ * JSON ref: `app.navigation.folder.canUpload`
439
+ */
440
+ function canUpload(context) {
441
+ if (isContentServiceEnabled() && (isPersonalFiles(context) || isLibraryContent(context))) {
442
+ const { currentFolder } = context.navigation;
443
+ if (currentFolder) {
444
+ return context.permissions.check(currentFolder, ['create']);
445
+ }
446
+ }
447
+ return false;
448
+ }
449
+ /**
450
+ * Checks if user can download selected nodes (either files or folders).
451
+ * JSON ref: `app.selection.canDownload`
452
+ */
453
+ function canDownloadSelection(context) {
454
+ if (!context.selection.isEmpty && isNotTrashcan(context)) {
455
+ return context.selection.nodes.every((node) => node.entry && (node.entry.isFile || node.entry.isFolder || !!node.entry.nodeId));
456
+ }
457
+ return false;
458
+ }
459
+ /**
460
+ * Checks if user has selected a folder.
461
+ * JSON ref: `app.selection.folder`
462
+ */
463
+ const hasFolderSelected = (context) => !!context.selection.folder;
464
+ /**
465
+ * Checks if user has selected a library (site).
466
+ * JSON ref: `app.selection.library`
467
+ */
468
+ const hasLibrarySelected = (context) => !!context.selection.library;
469
+ /**
470
+ * Checks if user has selected a **private** library (site)
471
+ * JSON ref: `app.selection.isPrivateLibrary`
472
+ */
473
+ function isPrivateLibrary(context) {
474
+ const library = context.selection.library;
475
+ return library ? !!(library.entry && library.entry.visibility && library.entry.visibility === 'PRIVATE') : false;
476
+ }
477
+ /**
478
+ * Checks if the selected library has a **role** property defined.
479
+ * JSON ref: `app.selection.hasLibraryRole`
480
+ */
481
+ function hasLibraryRole(context) {
482
+ const library = context.selection.library;
483
+ return library ? !!(library.entry && library.entry.role) : false;
484
+ }
485
+ /**
486
+ * Checks if the selected library has no **role** property defined.
487
+ * JSON ref: `app.selection.hasNoLibraryRole`
488
+ */
489
+ const hasNoLibraryRole = (context) => !hasLibraryRole(context);
490
+ /**
491
+ * Checks if user has selected a file.
492
+ * JSON ref: `app.selection.file`
493
+ */
494
+ const hasFileSelected = (context) => !!(context && context.selection && context.selection.file);
495
+ /**
496
+ * Checks if user can update the first selected node.
497
+ * JSON ref: `app.selection.first.canUpdate`
498
+ */
499
+ function canUpdateSelectedNode(context) {
500
+ if (context.selection && !context.selection.isEmpty) {
501
+ const node = context.selection.first;
502
+ if (node?.entry.isFile && hasLockedFiles(context)) {
503
+ return false;
504
+ }
505
+ return context.permissions.check(node, ['update']);
506
+ }
507
+ return false;
508
+ }
509
+ function isMultiselection(context) {
510
+ let isMultiNodeSelected = false;
511
+ if (context.selection && !context.selection.isEmpty) {
512
+ isMultiNodeSelected = context.selection.count > 1;
513
+ }
514
+ return isMultiNodeSelected;
515
+ }
516
+ /**
517
+ * Checks if user can update the first selected folder.
518
+ * JSON ref: `app.selection.folder.canUpdate`
519
+ */
520
+ function canUpdateSelectedFolder(context) {
521
+ const { folder } = context.selection;
522
+ if (folder) {
523
+ return (
524
+ // workaround for Favorites Api
525
+ isFavorites(context) || context.permissions.check(folder.entry, ['update']));
526
+ }
527
+ return false;
528
+ }
529
+ /**
530
+ * Checks if user has selected a **locked** file node.
531
+ * JSON ref: `app.selection.file.isLocked`
532
+ */
533
+ function hasLockedFiles(context) {
534
+ if (context && context.selection && context.selection.nodes) {
535
+ return context.selection.nodes.some((node) => {
536
+ if (!node.entry.isFile) {
537
+ return false;
538
+ }
539
+ return node.entry.isLocked || (node.entry.properties && node.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK');
540
+ });
541
+ }
542
+ return false;
543
+ }
544
+ /**
545
+ * Checks if the selected file has **write** or **read-only** locks specified.
546
+ * JSON ref: `app.selection.file.isLocked`
547
+ */
548
+ const isWriteLocked = (context) => !!(context &&
549
+ context.selection &&
550
+ context.selection.file &&
551
+ context.selection.file.entry &&
552
+ context.selection.file.entry.properties &&
553
+ (context.selection.file.entry.properties['cm:lockType'] === 'WRITE_LOCK' ||
554
+ context.selection.file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK'));
555
+ /**
556
+ * Checks if the selected file has **write** or **read-only** locks specified,
557
+ * and that current user is the owner of the lock.
558
+ * JSON ref: `app.selection.file.isLockOwner`
559
+ */
560
+ const isUserWriteLockOwner = (context) => isWriteLocked(context) &&
561
+ context.selection.file?.entry.properties['cm:lockOwner'] &&
562
+ context.selection.file?.entry.properties['cm:lockOwner'].id === context.profile.id;
563
+ /**
564
+ * Checks if user can lock selected file.
565
+ * JSON ref: `app.selection.file.canLock`
566
+ */
567
+ const canLockFile = (context) => !isWriteLocked(context) && canUpdateSelectedNode(context);
568
+ /**
569
+ * Checks if user can unlock selected file.
570
+ * JSON ref: `app.selection.file.canUnlock`
571
+ */
572
+ function canUnlockFile(context) {
573
+ const { file } = context.selection;
574
+ return isWriteLocked(context) && (context.permissions.check(file?.entry, ['delete']) || isUserWriteLockOwner(context));
575
+ }
576
+ /**
577
+ * Checks if user can upload a new version of the file.
578
+ * JSON ref: `app.selection.file.canUploadVersion`
579
+ */
580
+ function canUploadVersion(context) {
581
+ if (isFavorites(context) || isSharedFiles(context)) {
582
+ return hasFileSelected(context);
583
+ }
584
+ return [
585
+ hasFileSelected(context),
586
+ isNotTrashcan(context),
587
+ isWriteLocked(context) ? isUserWriteLockOwner(context) : canUpdateSelectedNode(context)
588
+ ].every(Boolean);
589
+ }
590
+ /**
591
+ * Checks if user has trashcan item selected.
592
+ * JSON ref: `isTrashcanItemSelected`
593
+ *
594
+ * @param context Rule execution context
595
+ */
596
+ const isTrashcanItemSelected = (context) => [isTrashcan(context), hasSelection(context)].every(Boolean);
597
+ /**
598
+ * Checks if user can view the file.
599
+ * JSON ref: `canViewFile`
600
+ *
601
+ * @param context Rule execution context
602
+ */
603
+ const canViewFile = (context) => [hasFileSelected(context), isNotTrashcan(context)].every(Boolean);
604
+ /**
605
+ * Checks if user can **Leave** selected library.
606
+ * JSON ref: `canLeaveLibrary`
607
+ *
608
+ * @param context Rule execution context
609
+ */
610
+ const canLeaveLibrary = (context) => [hasLibrarySelected(context), hasLibraryRole(context)].every(Boolean);
611
+ /**
612
+ * Checks if user can toggle shared link mode.
613
+ * JSON ref: `canToggleSharedLink`
614
+ *
615
+ * @param context Rule execution context
616
+ */
617
+ const canToggleSharedLink = (context) => [hasFileSelected(context), [canShareFile(context), isShared(context)].some(Boolean)].every(Boolean);
618
+ /**
619
+ * Checks if user can show **Info Drawer** for the selected node.
620
+ * JSON ref: `canShowInfoDrawer`
621
+ *
622
+ * @param context Rule execution context
623
+ */
624
+ const canShowInfoDrawer = (context) => [hasSelection(context), isNotLibraries(context), isNotTrashcan(context)].every(Boolean);
625
+ /**
626
+ * Checks if user can manage file versions for the selected node.
627
+ * JSON ref: `canManageFileVersions`
628
+ *
629
+ * @param context Rule execution context
630
+ */
631
+ const canManageFileVersions = (context) => [hasFileSelected(context), isNotTrashcan(context), !hasLockedFiles(context)].every(Boolean);
632
+ /**
633
+ * Checks if user can edit aspects for the selected node.
634
+ * JSON ref: `canEditAspects`
635
+ *
636
+ * @param context Rule execution context
637
+ */
638
+ const canEditAspects = (context) => [
639
+ !isMultiselection(context),
640
+ canUpdateSelectedNode(context),
641
+ !isWriteLocked(context),
642
+ isNotTrashcan(context),
643
+ isMajorVersionAvailable(context, '7')
644
+ ].every(Boolean);
645
+ /**
646
+ * Checks if user can manage permissions for the selected node.
647
+ * JSON ref: `canManagePermissions`
648
+ *
649
+ * @param context Rule execution context
650
+ */
651
+ const canManagePermissions = (context) => [canUpdateSelectedNode(context), isNotTrashcan(context)].every(Boolean);
652
+ /**
653
+ * Checks if user can toggle **Edit Offline** mode for selected node.
654
+ * JSON ref: `canToggleEditOffline`
655
+ *
656
+ * @param context Rule execution context
657
+ */
658
+ const canToggleEditOffline = (context) => [hasFileSelected(context), isNotTrashcan(context), canLockFile(context) || canUnlockFile(context)].every(Boolean);
659
+ /**
660
+ * @deprecated Uses workarounds for for recent files and search api issues.
661
+ * Checks if user can toggle **Favorite** state for a node.
662
+ * @param context Rule execution context
663
+ */
664
+ const canToggleFavorite = (context) => [
665
+ [canAddFavorite(context), canRemoveFavorite(context)].some(Boolean),
666
+ [isRecentFiles(context), isSharedFiles(context), isSearchResults(context), isFavorites(context)].some(Boolean)
667
+ ].every(Boolean);
668
+ /**
669
+ * Checks if application should render logout option.
670
+ * JSON ref: `canShowLogout`
671
+ *
672
+ * @param context Rule execution context
673
+ */
674
+ const canShowLogout = (context) => !context.withCredentials;
675
+ /**
676
+ * Checks if user is library manager
677
+ * JSON ref: `isLibraryManager`
678
+ *
679
+ * @param context Rule execution context
680
+ */
681
+ const isLibraryManager = (context) => hasLibrarySelected(context) && context.selection.library?.entry.role === 'SiteManager';
682
+ /**
683
+ * Checks if the preview button for search results can be showed
684
+ * JSON ref: `canInfoPreview`
685
+ *
686
+ * @param context Rule execution context
687
+ */
688
+ const canInfoPreview = (context) => {
689
+ const isSearchResult = isSearchResults(context);
690
+ const isNotMultiselect = !isMultiselection(context);
691
+ const isFileSelected = !hasFolderSelected(context);
692
+ const isPreview$1 = !isPreview(context);
693
+ return isSearchResult && isNotMultiselect && isFileSelected && isPreview$1;
694
+ };
695
+ const showInfoSelectionButton = (context) => isSearchResults(context) && !isPreview(context);
696
+ /**
697
+ * Checks if the file can be opened with MS Office
698
+ * JSON ref: `aos.canOpenWithOffice`
699
+ *
700
+ * @param context Rule execution context
701
+ */
702
+ function canOpenWithOffice(context) {
703
+ if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/trashcan')) {
704
+ return false;
705
+ }
706
+ if (!context || !context.selection) {
707
+ return false;
708
+ }
709
+ const { file } = context.selection;
710
+ if (!file || !file.entry) {
711
+ return false;
712
+ }
713
+ const extension = getFileExtension(file.entry.name);
714
+ if (!extension || !supportedExtensions[extension]) {
715
+ return false;
716
+ }
717
+ if (!file.entry.properties) {
718
+ return false;
719
+ }
720
+ if (file.entry.isLocked) {
721
+ return false;
722
+ }
723
+ if (file.entry.properties['cm:lockType'] === 'WRITE_LOCK' || file.entry.properties['cm:lockType'] === 'READ_ONLY_LOCK') {
724
+ return false;
725
+ }
726
+ const lockOwner = file.entry.properties['cm:lockOwner'];
727
+ if (lockOwner && lockOwner.id !== context.profile.id) {
728
+ return false;
729
+ }
730
+ // workaround for Shared files
731
+ if (context.navigation && context.navigation.url && context.navigation.url.startsWith('/shared')) {
732
+ // eslint-disable-next-line no-prototype-builtins
733
+ if (file.entry.hasOwnProperty('allowableOperationsOnTarget')) {
734
+ return context.permissions.check(file, ['update'], {
735
+ target: 'allowableOperationsOnTarget'
736
+ });
737
+ }
738
+ }
739
+ return context.permissions.check(file, ['update']);
740
+ }
741
+
742
+ /*!
743
+ * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
744
+ *
745
+ * Alfresco Example Content Application
746
+ *
747
+ * This file is part of the Alfresco Example Content Application.
748
+ * If the software was purchased under a paid Alfresco license, the terms of
749
+ * the paid license agreement will prevail. Otherwise, the software is
750
+ * provided under the following open source license terms:
751
+ *
752
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
753
+ * it under the terms of the GNU Lesser General Public License as published by
754
+ * the Free Software Foundation, either version 3 of the License, or
755
+ * (at your option) any later version.
756
+ *
757
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
758
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
759
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
760
+ * GNU Lesser General Public License for more details.
761
+ *
762
+ * You should have received a copy of the GNU Lesser General Public License
763
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
764
+ */
765
+
766
+ /**
767
+ * Generated bundle index. Do not edit.
768
+ */
769
+
770
+ export { canAddFavorite, canCopyNode, canCreateFolder, canCreateLibrary, canDeleteSelection, canDownloadSelection, canEditAspects, canEditFolder, canInfoPreview, canLeaveLibrary, canLockFile, canManageFileVersions, canManagePermissions, canOpenWithOffice, canRemoveFavorite, canShareFile, canShowInfoDrawer, canShowLogout, canToggleEditOffline, canToggleFavorite, canToggleJoinLibrary, canToggleSharedLink, canUnlockFile, canUnshareNodes, canUpdateSelectedFolder, canUpdateSelectedNode, canUpload, canUploadVersion, canViewFile, getFileExtension, hasFileSelected, hasFolderSelected, hasLibraryRole, hasLibrarySelected, hasLockedFiles, hasNoLibraryRole, hasQuickShareEnabled, hasSelection, isAdmin, isContentServiceEnabled, isFavorites, isFavoritesPreview, isLibraries, isLibraryContent, isLibraryFiles, isLibraryManager, isMajorVersionAvailable, isMultiselection, isNotFavorites, isNotLibraries, isNotRecentFiles, isNotSearchResults, isNotSharedFiles, isNotTrashcan, isPersonalFiles, isPreview, isPrivateLibrary, isRecentFiles, isSearchResults, isSearchSupported, isShared, isSharedFileViewer, isSharedFiles, isSharedPreview, isTrashcan, isTrashcanItemSelected, isUploadSupported, isUserWriteLockOwner, isWriteLocked, showInfoSelectionButton, supportedExtensions };
771
+ //# sourceMappingURL=alfresco-aca-shared-rules.mjs.map