@anzusystems/common-admin 2.0.0-rc.5 → 2.0.0-rc.6

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 (679) hide show
  1. package/dist/AnzuSystemsCommonAdmin.d.ts +42 -32
  2. package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
  3. package/dist/common-admin.css +1 -1
  4. package/dist/common-admin.js +282 -282
  5. package/dist/domains/anzuUser/api/anzuUserApi.d.ts +9 -12
  6. package/dist/domains/anzuUser/api/anzuUserApi.js.map +1 -1
  7. package/dist/domains/anzuUser/components/AAnzuUserDatatable.js.map +1 -1
  8. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue.d.ts +38 -44
  9. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  10. package/dist/domains/anzuUser/components/AAnzuUserFilter.js.map +1 -1
  11. package/dist/domains/anzuUser/components/AAnzuUserFilter.vue.d.ts +12 -13
  12. package/dist/domains/anzuUser/components/AAnzuUserFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/domains/anzuUser/components/AAnzuUserForm.js.map +1 -1
  14. package/dist/domains/anzuUser/components/AAnzuUserForm.vue.d.ts +18 -20
  15. package/dist/domains/anzuUser/components/AAnzuUserForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  16. package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.js.map +1 -1
  17. package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  18. package/dist/domains/anzuUser/components/AUserBulkActionDialog.js.map +1 -1
  19. package/dist/domains/anzuUser/components/AUserBulkActionDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  20. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.js.map +1 -1
  21. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue.d.ts +2 -3
  22. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.js.map +1 -1
  24. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue.d.ts +9 -15
  25. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  26. package/dist/domains/anzuUser/components/AUserEnabledSwitch.js.map +1 -1
  27. package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue.d.ts +8 -7
  28. package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  29. package/dist/domains/anzuUser/components/AUserManageButton.js.map +1 -1
  30. package/dist/domains/anzuUser/components/AUserManageButton.vue.d.ts +0 -1
  31. package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  32. package/dist/domains/anzuUser/components/AUserMetadataForm.js.map +1 -1
  33. package/dist/domains/anzuUser/components/AUserMetadataForm.vue.d.ts +8 -9
  34. package/dist/domains/anzuUser/components/AUserMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.js.map +1 -1
  36. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  37. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.js.map +1 -1
  38. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue.d.ts +1 -2
  39. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/domains/anzuUser/components/AUserSystemOverview.js.map +1 -1
  41. package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  42. package/dist/domains/anzuUser/components/AUserSystemPanel.js.map +1 -1
  43. package/dist/domains/anzuUser/components/AUserSystemPanel.vue.d.ts +2 -2
  44. package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/domains/anzuUser/components/AUserSystemStatusChip.js.map +1 -1
  46. package/dist/domains/anzuUser/components/AUserSystemStatusChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  47. package/dist/domains/anzuUser/components/AUserTabsShell.js.map +1 -1
  48. package/dist/domains/anzuUser/components/AUserTabsShell.vue.d.ts +17 -22
  49. package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  50. package/dist/domains/anzuUser/composables/anzuUserActions.d.ts +5 -9
  51. package/dist/domains/anzuUser/composables/anzuUserActions.js.map +1 -1
  52. package/dist/domains/anzuUser/composables/anzuUserValidations.d.ts +4 -6
  53. package/dist/domains/anzuUser/composables/anzuUserValidations.js.map +1 -1
  54. package/dist/domains/anzuUser/composables/cachedAnzuUsers.d.ts +3 -3
  55. package/dist/domains/anzuUser/composables/cachedAnzuUsers.js.map +1 -1
  56. package/dist/domains/anzuUser/composables/userCrossSystemSearch.d.ts +2 -4
  57. package/dist/domains/anzuUser/composables/userCrossSystemSearch.js.map +1 -1
  58. package/dist/domains/anzuUser/composables/userCrossSystemWrites.d.ts +5 -11
  59. package/dist/domains/anzuUser/composables/userCrossSystemWrites.js.map +1 -1
  60. package/dist/domains/anzuUser/composables/userSystemDescriptor.d.ts +33 -57
  61. package/dist/domains/anzuUser/composables/userSystemDescriptor.js.map +1 -1
  62. package/dist/domains/anzuUser/composables/userSystemProbe.d.ts +7 -27
  63. package/dist/domains/anzuUser/composables/userSystemProbe.js.map +1 -1
  64. package/dist/domains/anzuUser/filter/anzuUserFilter.d.ts +6 -16
  65. package/dist/domains/anzuUser/filter/anzuUserFilter.js.map +1 -1
  66. package/dist/domains/anzuUser/store/anzuUserStore.d.ts +1 -5
  67. package/dist/domains/anzuUser/store/anzuUserStore.js.map +1 -1
  68. package/dist/domains/anzuUser/store/userCrossSystemStore.d.ts +3 -14
  69. package/dist/domains/anzuUser/store/userCrossSystemStore.js.map +1 -1
  70. package/dist/domains/anzuUser/utils/userMetadataDiff.d.ts +7 -19
  71. package/dist/domains/anzuUser/utils/userMetadataDiff.js.map +1 -1
  72. package/dist/domains/anzuUser/utils/userSystemState.d.ts +12 -30
  73. package/dist/domains/anzuUser/utils/userSystemState.js.map +1 -1
  74. package/dist/domains/anzuUser/utils/userTabs.d.ts +1 -3
  75. package/dist/domains/anzuUser/utils/userTabs.js.map +1 -1
  76. package/dist/domains/api/composables/defineApiClient.d.ts +4 -8
  77. package/dist/domains/api/composables/defineApiClient.js.map +1 -1
  78. package/dist/domains/api/composables/request.d.ts +18 -48
  79. package/dist/domains/api/composables/request.js.map +1 -1
  80. package/dist/domains/api/composables/useApiFetchByIds.d.ts +7 -21
  81. package/dist/domains/api/composables/useApiFetchByIds.js.map +1 -1
  82. package/dist/domains/api/composables/useApiFetchItems.d.ts +18 -57
  83. package/dist/domains/api/composables/useApiFetchItems.js.map +1 -1
  84. package/dist/domains/api/composables/useApiFetchList.d.ts +7 -23
  85. package/dist/domains/api/composables/useApiFetchList.js.map +1 -1
  86. package/dist/domains/api/composables/useApiFetchListBatch.d.ts +5 -22
  87. package/dist/domains/api/composables/useApiFetchListBatch.js.map +1 -1
  88. package/dist/domains/api/composables/useApiQueryBuilder.js.map +1 -1
  89. package/dist/domains/api/composables/useApiRequest.d.ts +16 -39
  90. package/dist/domains/api/composables/useApiRequest.js.map +1 -1
  91. package/dist/domains/api/utils/apiErrors.d.ts +28 -55
  92. package/dist/domains/api/utils/apiErrors.js.map +1 -1
  93. package/dist/domains/api/utils/listBody.d.ts +22 -43
  94. package/dist/domains/api/utils/listBody.js.map +1 -1
  95. package/dist/domains/auth/components/Acl.js.map +1 -1
  96. package/dist/domains/auth/components/Acl.vue_vue_type_script_setup_true_lang.js.map +1 -1
  97. package/dist/domains/auth/composables/aclAllowed.d.ts +2 -3
  98. package/dist/domains/auth/composables/aclAllowed.js.map +1 -1
  99. package/dist/domains/auth/composables/defineAuth.js.map +1 -1
  100. package/dist/domains/auth/composables/refreshSession.d.ts +10 -13
  101. package/dist/domains/auth/composables/refreshSession.js.map +1 -1
  102. package/dist/domains/cached/components/ACachedChip.js.map +1 -1
  103. package/dist/domains/cached/components/ACachedChip.vue.d.ts +13 -11
  104. package/dist/domains/cached/components/ACachedChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/domains/cached/components/ACachedUserChip.js +1 -1
  106. package/dist/domains/cached/components/ACachedUserChip.js.map +1 -1
  107. package/dist/domains/cached/components/ACachedUserChip.vue.d.ts +3 -3
  108. package/dist/domains/cached/components/ACachedUserChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  109. package/dist/domains/cached/composables/createUserAndTimeTrackingFields.d.ts +9 -9
  110. package/dist/domains/cached/composables/createUserAndTimeTrackingFields.js.map +1 -1
  111. package/dist/domains/cached/composables/defineCached.d.ts +13 -11
  112. package/dist/domains/cached/composables/defineCached.js.map +1 -1
  113. package/dist/domains/cached/composables/useCachedItem.d.ts +7 -8
  114. package/dist/domains/cached/composables/useCachedItem.js.map +1 -1
  115. package/dist/domains/collab/components/ACollabLockedByUser.js.map +1 -1
  116. package/dist/domains/collab/components/ACollabLockedByUser.vue_vue_type_script_setup_true_lang.js.map +1 -1
  117. package/dist/domains/collab/composables/collabAnyDataChange.js.map +1 -1
  118. package/dist/domains/collab/composables/collabField.d.ts +5 -3
  119. package/dist/domains/collab/composables/collabField.js.map +1 -1
  120. package/dist/domains/collab/composables/collabInit.js +58 -54
  121. package/dist/domains/collab/composables/collabInit.js.map +1 -1
  122. package/dist/domains/collab/composables/collabRecovery.d.ts +49 -0
  123. package/dist/domains/collab/composables/collabRecovery.js +99 -0
  124. package/dist/domains/collab/composables/collabRecovery.js.map +1 -0
  125. package/dist/domains/collab/composables/collabRoom.js +106 -106
  126. package/dist/domains/collab/composables/collabRoom.js.map +1 -1
  127. package/dist/domains/collab/composables/collabState.d.ts +11 -4
  128. package/dist/domains/collab/composables/collabState.js +34 -25
  129. package/dist/domains/collab/composables/collabState.js.map +1 -1
  130. package/dist/domains/collab/composables/commonAdminCollabOptions.d.ts +4 -2
  131. package/dist/domains/collab/types/Collab.d.ts +31 -5
  132. package/dist/domains/collab/types/Collab.js +23 -11
  133. package/dist/domains/collab/types/Collab.js.map +1 -1
  134. package/dist/domains/customDataForm/components/ACustomDataForm.js.map +1 -1
  135. package/dist/domains/customDataForm/components/ACustomDataForm.vue.d.ts +7 -5
  136. package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  137. package/dist/domains/customDataForm/components/ACustomDataFormElement.js.map +1 -1
  138. package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
  139. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.js.map +1 -1
  140. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue.d.ts +5 -3
  141. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  142. package/dist/domains/customDataForm/composables/useCustomDataForm.js.map +1 -1
  143. package/dist/domains/customDataForm/types/CustomDataForm.d.ts +4 -1
  144. package/dist/domains/dam/api/damAssetApi.d.ts +7 -7
  145. package/dist/domains/dam/api/damAssetApi.js.map +1 -1
  146. package/dist/domains/dam/api/damAssetLicenceApi.d.ts +1 -1
  147. package/dist/domains/dam/api/damAssetLicenceApi.js.map +1 -1
  148. package/dist/domains/dam/api/damConstants.js.map +1 -1
  149. package/dist/domains/dam/api/damEndPoints.js.map +1 -1
  150. package/dist/domains/dam/api/damImageApi.js.map +1 -1
  151. package/dist/domains/dam/api/uploadApi.js.map +1 -1
  152. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.js.map +1 -1
  153. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue.d.ts +7 -5
  154. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  155. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.js.map +1 -1
  156. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  157. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.js.map +1 -1
  158. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue.d.ts +1 -1
  159. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  160. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarActionsWrapper.vue.d.ts +5 -3
  161. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.js.map +1 -1
  162. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  163. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.js.map +1 -1
  164. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  165. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.js.map +1 -1
  166. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.vue_vue_type_script_setup_true_lang.js.map +1 -1
  167. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.js.map +1 -1
  168. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue.d.ts +1 -1
  169. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  170. package/dist/domains/dam/assetDetail/components/AssetImage.js.map +1 -1
  171. package/dist/domains/dam/assetDetail/components/AssetImage.vue.d.ts +1 -1
  172. package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  173. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.js.map +1 -1
  174. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue.d.ts +2 -2
  175. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js.map +1 -1
  176. package/dist/domains/dam/assetDetail/components/AssetInfobox.js.map +1 -1
  177. package/dist/domains/dam/assetDetail/components/AssetInfobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  178. package/dist/domains/dam/assetDetail/components/AssetMetadata.js.map +1 -1
  179. package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  180. package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.d.ts +5 -6
  181. package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.js.map +1 -1
  182. package/dist/domains/dam/assetDetail/composables/assetDetailView.d.ts +10 -10
  183. package/dist/domains/dam/assetDetail/composables/assetDetailView.js.map +1 -1
  184. package/dist/domains/dam/assetDetail/store/assetDetailStore.js.map +1 -1
  185. package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.d.ts +4 -3
  186. package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.js.map +1 -1
  187. package/dist/domains/dam/assetSelect/api/damPodcastApi.js.map +1 -1
  188. package/dist/domains/dam/assetSelect/components/AAssetListInner.js.map +1 -1
  189. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue.d.ts +789 -787
  190. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  191. package/dist/domains/dam/assetSelect/components/AAssetSelect.js.map +1 -1
  192. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +395 -393
  193. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  194. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.js.map +1 -1
  195. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue.d.ts +14 -12
  196. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
  197. package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.js.map +1 -1
  198. package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  199. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.js.map +1 -1
  200. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue.d.ts +9 -7
  201. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  202. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.js.map +1 -1
  203. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  204. package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
  205. package/dist/domains/dam/assetSelect/store/assetSelectStore.js.map +1 -1
  206. package/dist/domains/dam/author/api/authorApi.js.map +1 -1
  207. package/dist/domains/dam/author/components/AuthorCreateButton.js.map +1 -1
  208. package/dist/domains/dam/author/components/AuthorCreateButton.vue.d.ts +1 -1
  209. package/dist/domains/dam/author/components/AuthorCreateButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  210. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.js.map +1 -1
  211. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue.d.ts +9 -6
  212. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  213. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.js.map +1 -1
  214. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  215. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js +1 -1
  216. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js.map +1 -1
  217. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue.d.ts +2 -2
  218. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  219. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.js.map +1 -1
  220. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue.d.ts +1 -1
  221. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  222. package/dist/domains/dam/author/composables/cachedAuthors.d.ts +5 -4
  223. package/dist/domains/dam/author/composables/cachedAuthors.js.map +1 -1
  224. package/dist/domains/dam/author/composables/cachedUsers.d.ts +5 -4
  225. package/dist/domains/dam/author/composables/cachedUsers.js.map +1 -1
  226. package/dist/domains/dam/author/composables/damAuthorConfig.d.ts +2 -2
  227. package/dist/domains/dam/author/composables/damAuthorConfig.js.map +1 -1
  228. package/dist/domains/dam/components/DamAdminAssetLink.js.map +1 -1
  229. package/dist/domains/dam/components/DamAdminAssetLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
  230. package/dist/domains/dam/composables/commonAdminCoreDamOptions.d.ts +10 -8
  231. package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
  232. package/dist/domains/dam/composables/damConfigName.d.ts +8 -9
  233. package/dist/domains/dam/composables/damConfigName.js.map +1 -1
  234. package/dist/domains/dam/composables/damNotifications.d.ts +9 -9
  235. package/dist/domains/dam/composables/damNotifications.js.map +1 -1
  236. package/dist/domains/dam/composables/damNotificationsConnection.d.ts +4 -4
  237. package/dist/domains/dam/composables/damNotificationsConnection.js.map +1 -1
  238. package/dist/domains/dam/composables/damNotificationsEventBus.d.ts +2 -2
  239. package/dist/domains/dam/composables/damNotificationsEventBus.js.map +1 -1
  240. package/dist/domains/dam/composables/extSystemIdForCached.d.ts +5 -4
  241. package/dist/domains/dam/composables/extSystemIdForCached.js.map +1 -1
  242. package/dist/domains/dam/config/api/damAssetCustomFormApi.js.map +1 -1
  243. package/dist/domains/dam/config/api/damConfigApi.js.map +1 -1
  244. package/dist/domains/dam/config/composables/damConfigState.d.ts +5 -5
  245. package/dist/domains/dam/config/composables/damConfigState.js.map +1 -1
  246. package/dist/domains/dam/config/store/damConfigStore.d.ts +5 -4
  247. package/dist/domains/dam/config/store/damConfigStore.js.map +1 -1
  248. package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.d.ts +3 -1
  249. package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.js.map +1 -1
  250. package/dist/domains/dam/cropper/components/ACropper.js.map +1 -1
  251. package/dist/domains/dam/cropper/components/ACropper.vue.d.ts +8 -16
  252. package/dist/domains/dam/cropper/components/ACropper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  253. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.js.map +1 -1
  254. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  255. package/dist/domains/dam/cropper/store/imageRoiStore.d.ts +9 -12
  256. package/dist/domains/dam/cropper/store/imageRoiStore.js.map +1 -1
  257. package/dist/domains/dam/cropper/utils/cropperGeometry.d.ts +24 -38
  258. package/dist/domains/dam/cropper/utils/cropperGeometry.js.map +1 -1
  259. package/dist/domains/dam/cropper/utils/cropperJsService.d.ts +3 -7
  260. package/dist/domains/dam/cropper/utils/cropperJsService.js +10 -3
  261. package/dist/domains/dam/cropper/utils/cropperJsService.js.map +1 -1
  262. package/dist/domains/dam/cropper/utils/cropperTypes.d.ts +3 -6
  263. package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.d.ts +5 -5
  264. package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.js.map +1 -1
  265. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.js.map +1 -1
  266. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  267. package/dist/domains/dam/imageWidget/components/AImagePublicInput.js.map +1 -1
  268. package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  269. package/dist/domains/dam/imageWidget/components/AImageWidget.js.map +1 -1
  270. package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  271. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.js.map +1 -1
  272. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
  273. package/dist/domains/dam/imageWidget/components/AImageWidgetSimple.vue.d.ts +43 -41
  274. package/dist/domains/dam/imageWidget/components/AMediaWidgetSimple.vue.d.ts +31 -29
  275. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.js.map +1 -1
  276. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue.d.ts +29 -27
  277. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  278. package/dist/domains/dam/imageWidget/components/ImageMassOperations.js.map +1 -1
  279. package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue.d.ts +1 -1
  280. package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  281. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.js.map +1 -1
  282. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +68 -66
  283. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  284. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.js.map +1 -1
  285. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +402 -400
  286. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  287. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.js.map +1 -1
  288. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +384 -382
  289. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  290. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.js.map +1 -1
  291. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  292. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.js.map +1 -1
  293. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  294. package/dist/domains/dam/imageWidget/components/MediaWidgetSimpleDialog.vue.d.ts +7 -5
  295. package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.js.map +1 -1
  296. package/dist/domains/dam/imageWidget/composables/imageApiCms.js.map +1 -1
  297. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.d.ts +11 -13
  298. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js.map +1 -1
  299. package/dist/domains/dam/imageWidget/composables/useImageMassOperations.js.map +1 -1
  300. package/dist/domains/dam/imageWidget/store/imageMediaWidgetStore.js.map +1 -1
  301. package/dist/domains/dam/imageWidget/store/imageStore.js.map +1 -1
  302. package/dist/domains/dam/imageWidget/utils/damImage.d.ts +5 -6
  303. package/dist/domains/dam/imageWidget/utils/damImage.js.map +1 -1
  304. package/dist/domains/dam/imageWidget/utils/fieldLockTurns.d.ts +1 -2
  305. package/dist/domains/dam/imageWidget/utils/fieldLockTurns.js.map +1 -1
  306. package/dist/domains/dam/imageWidget/utils/imageSaves.d.ts +10 -14
  307. package/dist/domains/dam/imageWidget/utils/imageSaves.js.map +1 -1
  308. package/dist/domains/dam/imageWidget/utils/metadataToImageMap.js.map +1 -1
  309. package/dist/domains/dam/imageWidget/utils/waitLimit.d.ts +4 -6
  310. package/dist/domains/dam/imageWidget/utils/waitLimit.js.map +1 -1
  311. package/dist/domains/dam/keyword/api/keywordApi.js.map +1 -1
  312. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.js.map +1 -1
  313. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue.d.ts +1 -1
  314. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  315. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.js.map +1 -1
  316. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue.d.ts +8 -5
  317. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  318. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js +1 -1
  319. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js.map +1 -1
  320. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue.d.ts +2 -2
  321. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  322. package/dist/domains/dam/keyword/composables/cachedKeywords.d.ts +5 -4
  323. package/dist/domains/dam/keyword/composables/cachedKeywords.js.map +1 -1
  324. package/dist/domains/dam/keyword/composables/damKeywordConfig.d.ts +2 -2
  325. package/dist/domains/dam/keyword/composables/damKeywordConfig.js.map +1 -1
  326. package/dist/domains/dam/types/Asset.d.ts +1 -1
  327. package/dist/domains/dam/types/Asset.js.map +1 -1
  328. package/dist/domains/dam/types/UploadQueue.d.ts +5 -4
  329. package/dist/domains/dam/types/UploadQueue.js.map +1 -1
  330. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.js.map +1 -1
  331. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  332. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.js.map +1 -1
  333. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue.d.ts +2 -2
  334. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  335. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.js.map +1 -1
  336. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  337. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.js.map +1 -1
  338. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  339. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.js.map +1 -1
  340. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue.d.ts +6 -4
  341. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  342. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.js.map +1 -1
  343. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue.d.ts +1 -1
  344. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  345. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.js.map +1 -1
  346. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  347. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.js.map +1 -1
  348. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue.d.ts +6 -6
  349. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  350. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.js.map +1 -1
  351. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue.d.ts +13 -13
  352. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  353. package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.d.ts +13 -13
  354. package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.js.map +1 -1
  355. package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.d.ts +2 -2
  356. package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.js.map +1 -1
  357. package/dist/domains/dam/uploadQueue/composables/uploadMeter.d.ts +12 -12
  358. package/dist/domains/dam/uploadQueue/composables/uploadMeter.js.map +1 -1
  359. package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.d.ts +5 -5
  360. package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.js.map +1 -1
  361. package/dist/domains/dam/uploadQueue/composables/uploadService.d.ts +2 -3
  362. package/dist/domains/dam/uploadQueue/composables/uploadService.js.map +1 -1
  363. package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.d.ts +5 -4
  364. package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.js.map +1 -1
  365. package/dist/domains/dam/uploadQueue/core/uploadQueueCore.d.ts +3 -2
  366. package/dist/domains/dam/uploadQueue/core/uploadQueueCore.js.map +1 -1
  367. package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.d.ts +8 -5
  368. package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.js.map +1 -1
  369. package/dist/domains/dam/uploadQueue/core/uploadQueueFill.d.ts +3 -3
  370. package/dist/domains/dam/uploadQueue/core/uploadQueueFill.js.map +1 -1
  371. package/dist/domains/dam/uploadQueue/presets/queuePresets.d.ts +8 -5
  372. package/dist/domains/dam/uploadQueue/presets/queuePresets.js.map +1 -1
  373. package/dist/domains/dam/uploadQueue/presets/uploadPresets.d.ts +15 -13
  374. package/dist/domains/dam/uploadQueue/presets/uploadPresets.js.map +1 -1
  375. package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.d.ts +7 -7
  376. package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.js.map +1 -1
  377. package/dist/domains/dam/uploadQueue/settlement/uploadPoller.d.ts +4 -4
  378. package/dist/domains/dam/uploadQueue/settlement/uploadPoller.js.map +1 -1
  379. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.d.ts +28 -30
  380. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.js.map +1 -1
  381. package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.d.ts +2 -2
  382. package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.js.map +1 -1
  383. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.d.ts +2 -2
  384. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.js.map +1 -1
  385. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.d.ts +63 -73
  386. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.js.map +1 -1
  387. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.d.ts +8 -9
  388. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.js.map +1 -1
  389. package/dist/domains/dam/user/api/userApi.d.ts +2 -2
  390. package/dist/domains/dam/user/api/userApi.js.map +1 -1
  391. package/dist/domains/dam/user/components/DamDistributionServiceSelect.js.map +1 -1
  392. package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue.d.ts +1 -1
  393. package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  394. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.js.map +1 -1
  395. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue.d.ts +1 -1
  396. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  397. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.js.map +1 -1
  398. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue.d.ts +1 -1
  399. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  400. package/dist/domains/dam/user/composables/damUserSelectActions.d.ts +1 -1
  401. package/dist/domains/dam/user/composables/damUserSelectActions.js.map +1 -1
  402. package/dist/domains/dam/user/types/DamDistributionServiceType.d.ts +2 -2
  403. package/dist/domains/dam/user/types/DamDistributionServiceType.js.map +1 -1
  404. package/dist/domains/dam/user/types/DamExternalProviderAssetType.d.ts +1 -1
  405. package/dist/domains/dam/user/types/DamExternalProviderAssetType.js.map +1 -1
  406. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.js.map +1 -1
  407. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  408. package/dist/domains/filters/bookmarks/store/bookmarksStore.d.ts +3 -3
  409. package/dist/domains/filters/bookmarks/store/bookmarksStore.js.map +1 -1
  410. package/dist/domains/filters/components/AFilterDatetimePicker.js.map +1 -1
  411. package/dist/domains/filters/components/AFilterDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  412. package/dist/domains/filters/components/AFilterInteger.js.map +1 -1
  413. package/dist/domains/filters/components/AFilterInteger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  414. package/dist/domains/filters/components/AFilterString.js.map +1 -1
  415. package/dist/domains/filters/components/AFilterString.vue_vue_type_script_setup_true_lang.js.map +1 -1
  416. package/dist/domains/filters/components/AFilterTimeInterval.js +1 -1
  417. package/dist/domains/filters/components/AFilterTimeInterval.js.map +1 -1
  418. package/dist/domains/filters/components/AFilterTimeInterval.vue.d.ts +5 -3
  419. package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js.map +1 -1
  420. package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.js.map +1 -1
  421. package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  422. package/dist/domains/filters/components/AFilterWrapper.vue.d.ts +17 -15
  423. package/dist/domains/filters/components/AFilterWrapperSidebar.vue.d.ts +5 -3
  424. package/dist/domains/filters/components/FiltersSelected.js.map +1 -1
  425. package/dist/domains/filters/components/FiltersSelected.vue_vue_type_script_setup_true_lang.js.map +1 -1
  426. package/dist/domains/filters/composables/filterFactory.d.ts +16 -26
  427. package/dist/domains/filters/composables/filterFactory.js +38 -31
  428. package/dist/domains/filters/composables/filterFactory.js.map +1 -1
  429. package/dist/domains/filters/datatable/components/ADatatableOrdering.js.map +1 -1
  430. package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js +3 -1
  431. package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js.map +1 -1
  432. package/dist/domains/filters/datatable/components/ADatatablePagination.js.map +1 -1
  433. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js +2 -4
  434. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  435. package/dist/domains/filters/utils/filterInjectionKeys.js.map +1 -1
  436. package/dist/domains/form/components/AFormDatetimePicker.js.map +1 -1
  437. package/dist/domains/form/components/AFormDatetimePicker.vue.d.ts +7 -5
  438. package/dist/domains/form/components/AFormDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  439. package/dist/domains/form/components/AFormFlagDatetimePicker.js.map +1 -1
  440. package/dist/domains/form/components/AFormFlagDatetimePicker.vue.d.ts +7 -5
  441. package/dist/domains/form/components/AFormFlagDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  442. package/dist/domains/form/components/AFormSwitch.vue.d.ts +7 -5
  443. package/dist/domains/form/components/AFormTextField.js.map +1 -1
  444. package/dist/domains/form/components/AFormTextField.vue.d.ts +9 -7
  445. package/dist/domains/form/components/AFormTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  446. package/dist/domains/form/components/AFormTextarea.vue.d.ts +13 -11
  447. package/dist/domains/form/components/AFormValueObjectOptionsSelect.vue.d.ts +7 -5
  448. package/dist/domains/form/components/ASystemEntityScope.vue.d.ts +5 -3
  449. package/dist/domains/job/api/jobApi.js.map +1 -1
  450. package/dist/domains/job/components/AJobDetailCommon.vue.d.ts +5 -3
  451. package/dist/domains/listEditor/components/AListEditor.js.map +1 -1
  452. package/dist/domains/listEditor/components/AListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  453. package/dist/domains/listEditor/components/ANestedSortableListEditor.js.map +1 -1
  454. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue.d.ts +2 -3
  455. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  456. package/dist/domains/listEditor/components/ASortableListEditor.js.map +1 -1
  457. package/dist/domains/listEditor/components/ASortableListEditor.vue.d.ts +2 -3
  458. package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  459. package/dist/domains/listEditor/composables/useListEditorController.d.ts +4 -5
  460. package/dist/domains/listEditor/composables/useListEditorController.js.map +1 -1
  461. package/dist/domains/listEditor/composables/useNestedListEditor.d.ts +3 -4
  462. package/dist/domains/listEditor/composables/useNestedListEditor.js.map +1 -1
  463. package/dist/domains/listEditor/composables/useNestedListEditorController.d.ts +5 -4
  464. package/dist/domains/listEditor/composables/useNestedListEditorController.js.map +1 -1
  465. package/dist/domains/listEditor/composables/useReorderMode.js.map +1 -1
  466. package/dist/domains/listEditor/types/listEditorTypes.d.ts +2 -2
  467. package/dist/domains/listEditor/utils/listEditorLoader.d.ts +5 -5
  468. package/dist/domains/listEditor/utils/listEditorLoader.js.map +1 -1
  469. package/dist/domains/listEditor/utils/resolveCompactText.js.map +1 -1
  470. package/dist/domains/log/api/logApi.d.ts +2 -3
  471. package/dist/domains/log/api/logApi.js.map +1 -1
  472. package/dist/domains/log/components/ALogDatatable.js.map +1 -1
  473. package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  474. package/dist/domains/log/components/ALogDetailView.js.map +1 -1
  475. package/dist/domains/log/components/ALogDetailView.vue.d.ts +1 -1
  476. package/dist/domains/log/components/ALogDetailView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  477. package/dist/domains/log/components/ALogFilter.js.map +1 -1
  478. package/dist/domains/log/components/ALogFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  479. package/dist/domains/log/components/ALogListView.js.map +1 -1
  480. package/dist/domains/log/components/ALogListView.vue.d.ts +1 -1
  481. package/dist/domains/log/components/ALogListView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  482. package/dist/domains/log/composables/logActions.d.ts +4 -5
  483. package/dist/domains/log/composables/logActions.js.map +1 -1
  484. package/dist/domains/log/composables/logType.d.ts +6 -7
  485. package/dist/domains/log/composables/logType.js.map +1 -1
  486. package/dist/domains/log/filter/logFilter.d.ts +8 -11
  487. package/dist/domains/log/filter/logFilter.js.map +1 -1
  488. package/dist/domains/permission/components/APermissionEditor.js.map +1 -1
  489. package/dist/domains/permission/components/APermissionEditor.vue.d.ts +4 -4
  490. package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  491. package/dist/domains/permission/composables/permissionActions.d.ts +3 -6
  492. package/dist/domains/permission/composables/permissionActions.js.map +1 -1
  493. package/dist/domains/permission/config/api/permissionConfigApi.d.ts +2 -2
  494. package/dist/domains/permission/config/api/permissionConfigApi.js.map +1 -1
  495. package/dist/domains/permission/config/composables/permissionConfigActions.d.ts +3 -7
  496. package/dist/domains/permission/config/composables/permissionConfigActions.js.map +1 -1
  497. package/dist/domains/permission/config/store/permissionConfigStore.d.ts +2 -4
  498. package/dist/domains/permission/config/store/permissionConfigStore.js.map +1 -1
  499. package/dist/domains/permission/group/api/permissionGroupApi.d.ts +8 -10
  500. package/dist/domains/permission/group/api/permissionGroupApi.js.map +1 -1
  501. package/dist/domains/permission/group/components/APermissionGroupDatatable.js.map +1 -1
  502. package/dist/domains/permission/group/components/APermissionGroupDatatable.vue.d.ts +12 -10
  503. package/dist/domains/permission/group/components/APermissionGroupDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  504. package/dist/domains/permission/group/components/APermissionGroupDetail.js.map +1 -1
  505. package/dist/domains/permission/group/components/APermissionGroupDetail.vue.d.ts +21 -22
  506. package/dist/domains/permission/group/components/APermissionGroupDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
  507. package/dist/domains/permission/group/components/APermissionGroupManage.js.map +1 -1
  508. package/dist/domains/permission/group/components/APermissionGroupManage.vue.d.ts +21 -22
  509. package/dist/domains/permission/group/components/APermissionGroupManage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  510. package/dist/domains/permission/group/composables/cachedPermissionGroups.js.map +1 -1
  511. package/dist/domains/permission/group/composables/permissionGroupActions.d.ts +6 -8
  512. package/dist/domains/permission/group/composables/permissionGroupActions.js.map +1 -1
  513. package/dist/domains/permission/group/composables/permissionGroupValidations.d.ts +2 -3
  514. package/dist/domains/permission/group/composables/permissionGroupValidations.js.map +1 -1
  515. package/dist/domains/permission/group/filter/permissionGroupFilter.d.ts +2 -3
  516. package/dist/domains/permission/group/filter/permissionGroupFilter.js.map +1 -1
  517. package/dist/domains/permission/group/store/permissionGroupStore.d.ts +3 -6
  518. package/dist/domains/permission/group/store/permissionGroupStore.js.map +1 -1
  519. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.js.map +1 -1
  520. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  521. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.js.map +1 -1
  522. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  523. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.js.map +1 -1
  524. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  525. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.vue.d.ts +5 -3
  526. package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.d.ts +11 -13
  527. package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.js.map +1 -1
  528. package/dist/domains/subjectSelect/components/AFilterWrapperSubjectSelect.vue.d.ts +13 -11
  529. package/dist/domains/subjectSelect/components/ASubjectSelect.js.map +1 -1
  530. package/dist/domains/subjectSelect/components/ASubjectSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  531. package/dist/domains/subjectSelect/composables/useSubjectSelect.js +53 -51
  532. package/dist/domains/subjectSelect/composables/useSubjectSelect.js.map +1 -1
  533. package/dist/domains/system/appShell/components/AActionbar.vue.d.ts +7 -5
  534. package/dist/domains/system/appShell/components/ALayoutSwitch.js.map +1 -1
  535. package/dist/domains/system/appShell/components/ALayoutSwitch.vue.d.ts +7 -5
  536. package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  537. package/dist/domains/system/appShell/composables/teleportSlot.d.ts +0 -1
  538. package/dist/domains/system/appShell/composables/teleportSlot.js.map +1 -1
  539. package/dist/domains/system/components/AAlerts.js.map +1 -1
  540. package/dist/domains/system/components/AAlerts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  541. package/dist/domains/system/composables/alerts.js.map +1 -1
  542. package/dist/domains/system/composables/breadcrumbs.d.ts +3 -3
  543. package/dist/domains/system/composables/breadcrumbs.js.map +1 -1
  544. package/dist/domains/system/composables/languageSettings.js.map +1 -1
  545. package/dist/domains/system/composables/loginStatus.js.map +1 -1
  546. package/dist/domains/system/composables/navigationError.d.ts +6 -8
  547. package/dist/domains/system/composables/navigationError.js.map +1 -1
  548. package/dist/domains/system/composables/pageNavigation.d.ts +9 -10
  549. package/dist/domains/system/composables/pageNavigation.js.map +1 -1
  550. package/dist/domains/system/composables/recordActions.d.ts +14 -22
  551. package/dist/domains/system/composables/recordActions.js.map +1 -1
  552. package/dist/domains/system/composables/recordPage.d.ts +23 -38
  553. package/dist/domains/system/composables/recordPage.js.map +1 -1
  554. package/dist/domains/system/composables/routeHistory.d.ts +4 -5
  555. package/dist/domains/system/composables/routeHistory.js.map +1 -1
  556. package/dist/domains/system/composables/sentry.js.map +1 -1
  557. package/dist/domains/system/composables/useDebugFeatures.d.ts +3 -6
  558. package/dist/domains/system/composables/useDebugFeatures.js.map +1 -1
  559. package/dist/domains/system/store/datatablePageStore.d.ts +8 -1
  560. package/dist/domains/system/store/datatablePageStore.js +10 -3
  561. package/dist/domains/system/store/datatablePageStore.js.map +1 -1
  562. package/dist/domains/system/systemBar/components/ASystemBar.js.map +1 -1
  563. package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  564. package/dist/domains/system/systemBar/utils/appReload.d.ts +5 -5
  565. package/dist/domains/system/systemBar/utils/appReload.js.map +1 -1
  566. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.js.map +1 -1
  567. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue.d.ts +2 -3
  568. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue_vue_type_script_setup_true_lang.js.map +1 -1
  569. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.js.map +1 -1
  570. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  571. package/dist/domains/ui/buttons/components/ABtnSplit.vue.d.ts +9 -7
  572. package/dist/domains/ui/components/AAvatarColorPicker.js.map +1 -1
  573. package/dist/domains/ui/components/AAvatarColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  574. package/dist/domains/ui/components/ACard.js.map +1 -1
  575. package/dist/domains/ui/components/ACard.vue.d.ts +7 -3
  576. package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js +6 -2
  577. package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  578. package/dist/domains/ui/components/ACardLoader.js.map +1 -1
  579. package/dist/domains/ui/components/ACardLoader.vue.d.ts +1 -0
  580. package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js +13 -7
  581. package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  582. package/dist/domains/ui/components/AChipNoLink.vue.d.ts +5 -3
  583. package/dist/domains/ui/components/ACopyText.vue.d.ts +9 -7
  584. package/dist/domains/ui/components/ACreateDialog.js.map +1 -1
  585. package/dist/domains/ui/components/ACreateDialog.vue.d.ts +11 -9
  586. package/dist/domains/ui/components/ACreateDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  587. package/dist/domains/ui/components/ADialogToolbar.vue.d.ts +5 -3
  588. package/dist/domains/ui/components/ARow.vue.d.ts +5 -3
  589. package/dist/domains/ui/components/ATimeTrackingFields.js.map +1 -1
  590. package/dist/domains/ui/components/ATimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  591. package/dist/domains/ui/components/AUserAndTimeTrackingFields.js.map +1 -1
  592. package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue.d.ts +3 -5
  593. package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  594. package/dist/domains/ui/datetime/components/ADatetimePicker.js +1 -1
  595. package/dist/domains/ui/datetime/components/ADatetimePicker.js.map +1 -1
  596. package/dist/domains/ui/datetime/components/ADatetimePicker.vue.d.ts +5 -3
  597. package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  598. package/dist/domains/ui/file/components/AFileDropzone.js.map +1 -1
  599. package/dist/domains/ui/file/components/AFileDropzone.vue.d.ts +1 -1
  600. package/dist/domains/ui/file/components/AFileDropzone.vue_vue_type_script_setup_true_lang.js.map +1 -1
  601. package/dist/domains/ui/file/components/AFileInput.js.map +1 -1
  602. package/dist/domains/ui/file/components/AFileInput.vue.d.ts +9 -7
  603. package/dist/domains/ui/file/components/AFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  604. package/dist/domains/ui/file/components/AFileInputDialog.js.map +1 -1
  605. package/dist/domains/ui/file/components/AFileInputDialog.vue.d.ts +9 -7
  606. package/dist/domains/ui/file/components/AFileInputDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  607. package/dist/domains/ui/file/composables/dropzone.js.map +1 -1
  608. package/dist/domains/ui/file/composables/formatAndSizeCheck.js.map +1 -1
  609. package/dist/domains/ui/view/components/AGenericView.vue.d.ts +7 -5
  610. package/dist/domains/ui/view/components/ALoginView.js +1 -1
  611. package/dist/domains/ui/view/components/ALoginView.js.map +1 -1
  612. package/dist/domains/ui/view/components/ALoginView.vue.d.ts +5 -3
  613. package/dist/domains/ui/view/components/ALoginView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  614. package/dist/domains/ui/view/components/ALogoutView.js.map +1 -1
  615. package/dist/domains/ui/view/components/ALogoutView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  616. package/dist/domains/ui/view/components/ANotFoundView.js.map +1 -1
  617. package/dist/domains/ui/view/components/ANotFoundView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  618. package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.d.ts +6 -7
  619. package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.js.map +1 -1
  620. package/dist/lib.d.ts +2 -2
  621. package/dist/plugins/commonVuetifyConfig.d.ts +3 -3
  622. package/dist/plugins/commonVuetifyConfig.js.map +1 -1
  623. package/dist/plugins/i18n.d.ts +4 -5
  624. package/dist/plugins/i18n.js.map +1 -1
  625. package/dist/plugins/pluginOptions.d.ts +4 -2
  626. package/dist/plugins/pluginOptions.js.map +1 -1
  627. package/dist/plugins/webfontloader.js.map +1 -1
  628. package/dist/shared/error/AnzuApiCancelledError.d.ts +5 -8
  629. package/dist/shared/error/AnzuApiCancelledError.js.map +1 -1
  630. package/dist/shared/error/AnzuError.d.ts +3 -5
  631. package/dist/shared/error/AnzuError.js.map +1 -1
  632. package/dist/shared/error/AuthUnavailableError.d.ts +3 -3
  633. package/dist/shared/error/AuthUnavailableError.js.map +1 -1
  634. package/dist/shared/error/isInCauseChain.d.ts +2 -2
  635. package/dist/shared/error/isInCauseChain.js.map +1 -1
  636. package/dist/shared/types/UserAndTimeTracking.d.ts +5 -5
  637. package/dist/shared/types/Validation.d.ts +4 -5
  638. package/dist/shared/types/common.d.ts +1 -3
  639. package/dist/shared/types/globalComponents.d.ts +5 -6
  640. package/dist/shared/utils/common.js.map +1 -1
  641. package/dist/shared/utils/datetime.d.ts +0 -1
  642. package/dist/shared/utils/datetime.js.map +1 -1
  643. package/dist/shared/utils/datetimePickerValue.d.ts +4 -7
  644. package/dist/shared/utils/datetimePickerValue.js.map +1 -1
  645. package/dist/shared/utils/development.d.ts +3 -3
  646. package/dist/shared/utils/development.js.map +1 -1
  647. package/dist/shared/utils/envConfig.d.ts +4 -4
  648. package/dist/shared/utils/envConfig.js.map +1 -1
  649. package/dist/shared/utils/json.d.ts +1 -1
  650. package/dist/shared/utils/json.js.map +1 -1
  651. package/dist/shared/utils/userAndTimeTracking.d.ts +5 -7
  652. package/dist/shared/utils/userAndTimeTracking.js.map +1 -1
  653. package/dist/shared/validators/vuelidate/common/useValidateHexColor.d.ts +3 -5
  654. package/dist/shared/validators/vuelidate/common/useValidateHexColor.js.map +1 -1
  655. package/dist/testing/appShell.d.ts +11 -11
  656. package/dist/testing/appShell.js.map +1 -1
  657. package/dist/testing/closeButtons.d.ts +9 -11
  658. package/dist/testing/closeButtons.js.map +1 -1
  659. package/dist/testing/declaredDependencies.d.ts +7 -7
  660. package/dist/testing/declaredDependencies.js.map +1 -1
  661. package/dist/testing/generatedRoutes.d.ts +6 -11
  662. package/dist/testing/generatedRoutes.js.map +1 -1
  663. package/dist/testing/routeHistory.d.ts +5 -12
  664. package/dist/testing/routeHistory.js.map +1 -1
  665. package/dist/testing/sortableLists.d.ts +16 -21
  666. package/dist/testing/sortableLists.js.map +1 -1
  667. package/dist/testing/typedRouter.d.ts +0 -1
  668. package/dist/testing/typedRouter.js.map +1 -1
  669. package/package.json +27 -27
  670. package/src/eslint/adminConfig.mjs +19 -27
  671. package/src/eslint/globalComponentNames.mjs +3 -4
  672. package/src/eslint/oxlint.mjs +7 -20
  673. package/src/eslint/plugin.d.mts +2 -4
  674. package/src/eslint/plugin.mjs +18 -34
  675. package/src/eslint/validRouteName.mjs +6 -7
  676. package/src/vite/devWatch.mjs +30 -43
  677. package/src/vite/index.d.mts +5 -5
  678. package/src/vite/sentry.mjs +7 -12
  679. package/src/vite/sourcemaps.mjs +4 -8
@@ -1 +1 @@
1
- {"version":3,"file":"commonAdminCoreDamOptions.js","names":["commonAdminCoreDamOptions","t","commonT","defaultDescriptionValidation","defaultSourceValidation","DEFAULT_END_POINT_ROI","DEFAULT_END_POINT_IMAGE","DEFAULT_END_POINT_AUTHOR","DEFAULT_END_POINT_KEYWORD","resolveRoiUpdateAcl","isUndefined","config","resolveImageRotateAcl","damEndPointsOf","configs","coreDamOptions","configName","useCommonAdminCoreDamOptions","normalizeDamNotificationOptions","webSocketUrl","isString","raw","damNotificationSockets","useCommonAdminCoreDamOptionsGlobal","sockets","notification","name","options","shared","socket"],"sources":["../../../../src/domains/dam/composables/commonAdminCoreDamOptions.ts"],"sourcesContent":["import type { CommonAdminCoreDamConfig, ImageFieldValidationConfig } from '@/AnzuSystemsCommonAdmin'\nimport type { AclValue } from '@/domains/auth/types/Permission'\nimport { coreDamOptions as commonAdminCoreDamOptions } from '@/plugins/pluginOptions'\nimport { SYSTEM_DAM } from '@/domains/dam/api/damConstants'\nimport {\n DAM_END_POINT_ASSET_CUSTOM_FORM,\n DAM_END_POINT_ASSET_LICENCE,\n DAM_END_POINT_CMS_ASSET,\n DAM_END_POINT_CONFIGURATION,\n DAM_END_POINT_PODCAST,\n DAM_END_POINT_PUB_CONFIGURATION,\n DAM_END_POINT_USER,\n} from '@/domains/dam/api/damEndPoints'\nimport { isString, isUndefined } from '@/shared/utils/common'\nimport { commonT } from '@/plugins/i18n'\n\nconst t = commonT\n\nconst defaultDescriptionValidation: ImageFieldValidationConfig = {\n required: false,\n min: 0,\n max: 2000,\n}\nconst defaultSourceValidation: ImageFieldValidationConfig = { required: true, min: 0, max: 255 }\n\nexport { initCommonAdminCoreDamOptions } from '@/plugins/pluginOptions'\n\nconst DEFAULT_END_POINT_ROI = '/adm/v1/roi'\nconst DEFAULT_END_POINT_IMAGE = '/adm/v1/image'\nconst DEFAULT_END_POINT_AUTHOR = '/adm/v1/author'\nconst DEFAULT_END_POINT_KEYWORD = '/adm/v1/keyword'\n\nconst resolveRoiUpdateAcl = (config: CommonAdminCoreDamConfig): AclValue | null => {\n if (!isUndefined(config.roiUpdateAcl)) return config.roiUpdateAcl\n const endPointRoi = config.endPointRoi || DEFAULT_END_POINT_ROI\n\n return endPointRoi === DEFAULT_END_POINT_ROI ? 'dam_regionOfInterest_update' : null\n}\n\nconst resolveImageRotateAcl = (config: CommonAdminCoreDamConfig): AclValue | null => {\n if (!isUndefined(config.imageRotateAcl)) return config.imageRotateAcl\n const endPointImage = config.endPointImage || DEFAULT_END_POINT_IMAGE\n\n return endPointImage === DEFAULT_END_POINT_IMAGE ? 'dam_image_update' : null\n}\n\n/**\n * The addresses with a key of the configuration `configName` beyond its five, each its default where it does not set\n * it. Throws for nothing: without a configured plugin, or without that configuration, all are the defaults, for the\n * loaders of the DAM configuration an application calls at its start (admin-dam's `useDamConfigState(damClient)`).\n */\nexport function damEndPointsOf(configName: string) {\n const configs = commonAdminCoreDamOptions.value?.configs\n const config = configs && Object.hasOwn(configs, configName) ? configs[configName] : undefined\n\n return {\n endPointConfiguration: config?.endPointConfiguration || DAM_END_POINT_CONFIGURATION,\n endPointPubConfiguration: config?.endPointPubConfiguration || DAM_END_POINT_PUB_CONFIGURATION,\n endPointAssetLicence: config?.endPointAssetLicence || DAM_END_POINT_ASSET_LICENCE,\n endPointAssetCustomForm: config?.endPointAssetCustomForm || DAM_END_POINT_ASSET_CUSTOM_FORM,\n endPointUser: config?.endPointUser || DAM_END_POINT_USER,\n endPointPodcast: config?.endPointPodcast || DAM_END_POINT_PODCAST,\n endPointCmsAsset: config?.endPointCmsAsset || DAM_END_POINT_CMS_ASSET,\n }\n}\n\n/** The options of the DAM configuration `configName`. Internal: the name is required, a call cannot fall to `default`. */\nexport function useCommonAdminCoreDamOptions(configName: string) {\n if (\n isUndefined(commonAdminCoreDamOptions.value) ||\n isUndefined(commonAdminCoreDamOptions.value.configs) ||\n // Only what the application has named: `constructor` and the like, which every object has, name no configuration.\n !Object.hasOwn(commonAdminCoreDamOptions.value.configs, configName) ||\n isUndefined(commonAdminCoreDamOptions.value.configs[configName])\n ) {\n throw new Error(\"Composable can't be used without properly configured common admin.\")\n }\n\n return {\n damClient: commonAdminCoreDamOptions.value.configs[configName].damClient,\n endPointImage: commonAdminCoreDamOptions.value.configs[configName].endPointImage || DEFAULT_END_POINT_IMAGE,\n imageRotateAcl: resolveImageRotateAcl(commonAdminCoreDamOptions.value.configs[configName]),\n endPointAsset: commonAdminCoreDamOptions.value.configs[configName].endPointAsset || '/adm/v1/asset',\n endPointRoi: commonAdminCoreDamOptions.value.configs[configName].endPointRoi || DEFAULT_END_POINT_ROI,\n endPointAuthor: commonAdminCoreDamOptions.value.configs[configName].endPointAuthor || DEFAULT_END_POINT_AUTHOR,\n endPointKeyword: commonAdminCoreDamOptions.value.configs[configName].endPointKeyword || DEFAULT_END_POINT_KEYWORD,\n ...damEndPointsOf(configName),\n // The system whose user decides the licences; `false`: every licence.\n currentUser: commonAdminCoreDamOptions.value.configs[configName].currentUser ?? SYSTEM_DAM,\n adminDomain:\n commonAdminCoreDamOptions.value.configs[configName].adminDomain ?? commonAdminCoreDamOptions.value.adminDomain,\n apiTimeout:\n commonAdminCoreDamOptions.value.configs[configName].apiTimeout ?? commonAdminCoreDamOptions.value.apiTimeout,\n roiUpdateAcl: resolveRoiUpdateAcl(commonAdminCoreDamOptions.value.configs[configName]),\n keywordCreateAcl: commonAdminCoreDamOptions.value.configs[configName].keywordCreateAcl,\n authorCreateAcl: commonAdminCoreDamOptions.value.configs[configName].authorCreateAcl,\n mainFileSingleUseEnabled: commonAdminCoreDamOptions.value.configs[configName].mainFileSingleUseEnabled ?? true,\n // As configured: on unless `false`, which those who read it check.\n copyToLicenceEnabled: commonAdminCoreDamOptions.value.configs[configName].copyToLicenceEnabled,\n showSourceEnabled: commonAdminCoreDamOptions.value.configs[configName].showSourceEnabled ?? true,\n showFileInfoEnabled: commonAdminCoreDamOptions.value.configs[configName].showFileInfoEnabled ?? true,\n sourceLabel:\n commonAdminCoreDamOptions.value.configs[configName].sourceLabel || t('common.damImage.image.model.texts.source'),\n editAssetLabel:\n commonAdminCoreDamOptions.value.configs[configName].editAssetLabel || t('common.damImage.image.button.editAsset'),\n addFromDamLabel:\n commonAdminCoreDamOptions.value.configs[configName].addFromDamLabel ||\n t('common.damImage.image.button.addFromDam'),\n replaceFromDamLabel:\n commonAdminCoreDamOptions.value.configs[configName].replaceFromDamLabel ||\n t('common.damImage.image.button.replaceFromDam'),\n descriptionValidation: {\n ...defaultDescriptionValidation,\n ...commonAdminCoreDamOptions.value.configs[configName].descriptionValidation,\n },\n sourceValidation: {\n ...defaultSourceValidation,\n ...commonAdminCoreDamOptions.value.configs[configName].sourceValidation,\n },\n customUploadMetadataToImageMap: commonAdminCoreDamOptions.value.configs[configName].customUploadMetadataToImageMap,\n customAssetSelectMetadataToImageMap:\n commonAdminCoreDamOptions.value.configs[configName].customAssetSelectMetadataToImageMap,\n assetListEnabledFilters: commonAdminCoreDamOptions.value.configs[configName].assetListEnabledFilters, // defaults to undefined = all filters\n simpleAssetSidebarEnabled: commonAdminCoreDamOptions.value.configs[configName].simpleAssetSidebar ?? false,\n }\n}\n\nexport interface DamNotificationOptions {\n enabled: boolean\n webSocketUrl: string\n}\n\n// A deployment template puts the value in quotes, and renders a boolean of its variables as `True`: the text\n// \"true\" switches the service on as well, in any letter case and with whitespace around it. Nothing else does:\n// \"false\" is a text too, and used to count as on.\nexport const normalizeDamNotificationOptions = (\n raw: { enabled?: boolean | string; webSocketUrl?: string } | undefined\n): DamNotificationOptions => {\n const webSocketUrl = isString(raw?.webSocketUrl) ? raw.webSocketUrl.trim() : ''\n const on = raw?.enabled === true || (isString(raw?.enabled) && raw.enabled.trim().toLowerCase() === 'true')\n\n return { enabled: on && webSocketUrl.length > 0, webSocketUrl }\n}\n\n/** One notification socket of the page, and the DAM configurations it is the socket of. */\nexport interface DamNotificationSocketOptions {\n options: DamNotificationOptions\n configNames: string[]\n}\n\n/**\n * The notification sockets of the configurations: one for each distinct service, shared by the configurations that\n * name it. `default`'s first, also while it is off: its own `notification`, else the root one. Another configuration\n * has one only with a `notification` of its own that is on.\n */\nexport function damNotificationSockets(): DamNotificationSocketOptions[] {\n const { notification } = useCommonAdminCoreDamOptionsGlobal()\n const configs = commonAdminCoreDamOptions.value?.configs ?? {}\n const ofDefault = isUndefined(configs.default?.notification)\n ? notification\n : normalizeDamNotificationOptions(configs.default.notification)\n const sockets: DamNotificationSocketOptions[] = [{ options: ofDefault, configNames: ['default'] }]\n for (const [name, config] of Object.entries(configs)) {\n if (name === 'default' || isUndefined(config?.notification)) continue\n const options = normalizeDamNotificationOptions(config.notification)\n if (!options.enabled) continue\n const shared = sockets.find(\n (socket) => socket.options.enabled && socket.options.webSocketUrl === options.webSocketUrl\n )\n if (shared) shared.configNames.push(name)\n else sockets.push({ options, configNames: [name] })\n }\n return sockets\n}\n\nexport function useCommonAdminCoreDamOptionsGlobal() {\n if (isUndefined(commonAdminCoreDamOptions.value) || isUndefined(commonAdminCoreDamOptions.value.configs)) {\n throw new Error(\"Composable can't be used without properly configured common admin.\")\n }\n\n return {\n apiTimeout: commonAdminCoreDamOptions.value.apiTimeout,\n notification: normalizeDamNotificationOptions(commonAdminCoreDamOptions.value.notification),\n adminDom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AM,oEAAoE;CAGtF,OAAO;EACL,YAAYA,EAA0B,MAAM;EAC5C,cAAckB,EAAgClB,EAA0B,MAAM,YAAY;EAC1F,aAAaA,EAA0B,MAAM;CAC/C;AACF"}
1
+ {"version":3,"file":"commonAdminCoreDamOptions.js","names":["commonAdminCoreDamOptions","t","commonT","defaultDescriptionValidation","defaultSourceValidation","DEFAULT_END_POINT_ROI","DEFAULT_END_POINT_IMAGE","DEFAULT_END_POINT_AUTHOR","DEFAULT_END_POINT_KEYWORD","resolveRoiUpdateAcl","isUndefined","config","resolveImageRotateAcl","damEndPointsOf","configs","coreDamOptions","configName","useCommonAdminCoreDamOptions","normalizeDamNotificationOptions","webSocketUrl","isString","raw","damNotificationSockets","useCommonAdminCoreDamOptionsGlobal","sockets","notification","name","options","shared","socket"],"sources":["../../../../src/domains/dam/composables/commonAdminCoreDamOptions.ts"],"sourcesContent":["import type { CommonAdminCoreDamConfig, ImageFieldValidationConfig } from '@/AnzuSystemsCommonAdmin'\nimport type { AclValue } from '@/domains/auth/types/Permission'\nimport { coreDamOptions as commonAdminCoreDamOptions } from '@/plugins/pluginOptions'\nimport { SYSTEM_DAM } from '@/domains/dam/api/damConstants'\nimport {\n DAM_END_POINT_ASSET_CUSTOM_FORM,\n DAM_END_POINT_ASSET_LICENCE,\n DAM_END_POINT_CMS_ASSET,\n DAM_END_POINT_CONFIGURATION,\n DAM_END_POINT_PODCAST,\n DAM_END_POINT_PUB_CONFIGURATION,\n DAM_END_POINT_USER,\n} from '@/domains/dam/api/damEndPoints'\nimport { isString, isUndefined } from '@/shared/utils/common'\nimport { commonT } from '@/plugins/i18n'\n\nconst t = commonT\n\nconst defaultDescriptionValidation: ImageFieldValidationConfig = {\n required: false,\n min: 0,\n max: 2000,\n}\nconst defaultSourceValidation: ImageFieldValidationConfig = { required: true, min: 0, max: 255 }\n\nexport { initCommonAdminCoreDamOptions } from '@/plugins/pluginOptions'\n\nconst DEFAULT_END_POINT_ROI = '/adm/v1/roi'\nconst DEFAULT_END_POINT_IMAGE = '/adm/v1/image'\nconst DEFAULT_END_POINT_AUTHOR = '/adm/v1/author'\nconst DEFAULT_END_POINT_KEYWORD = '/adm/v1/keyword'\n\nconst resolveRoiUpdateAcl = (config: CommonAdminCoreDamConfig): AclValue | null => {\n if (!isUndefined(config.roiUpdateAcl)) return config.roiUpdateAcl\n const endPointRoi = config.endPointRoi || DEFAULT_END_POINT_ROI\n\n return endPointRoi === DEFAULT_END_POINT_ROI ? 'dam_regionOfInterest_update' : null\n}\n\nconst resolveImageRotateAcl = (config: CommonAdminCoreDamConfig): AclValue | null => {\n if (!isUndefined(config.imageRotateAcl)) return config.imageRotateAcl\n const endPointImage = config.endPointImage || DEFAULT_END_POINT_IMAGE\n\n return endPointImage === DEFAULT_END_POINT_IMAGE ? 'dam_image_update' : null\n}\n\n/**\n * Keyed endpoints of configuration `configName`, each falling back to its default.\n * Never throws: without a configured plugin or that configuration, all are defaults.\n * Apps call the config loaders at startup (admin-dam's `useDamConfigState(damClient)`).\n */\nexport function damEndPointsOf(configName: string) {\n const configs = commonAdminCoreDamOptions.value?.configs\n const config = configs && Object.hasOwn(configs, configName) ? configs[configName] : undefined\n\n return {\n endPointConfiguration: config?.endPointConfiguration || DAM_END_POINT_CONFIGURATION,\n endPointPubConfiguration: config?.endPointPubConfiguration || DAM_END_POINT_PUB_CONFIGURATION,\n endPointAssetLicence: config?.endPointAssetLicence || DAM_END_POINT_ASSET_LICENCE,\n endPointAssetCustomForm: config?.endPointAssetCustomForm || DAM_END_POINT_ASSET_CUSTOM_FORM,\n endPointUser: config?.endPointUser || DAM_END_POINT_USER,\n endPointPodcast: config?.endPointPodcast || DAM_END_POINT_PODCAST,\n endPointCmsAsset: config?.endPointCmsAsset || DAM_END_POINT_CMS_ASSET,\n }\n}\n\n/**\n * Options of DAM configuration `configName`. Internal. The name is required so a call cannot fall back to `default`.\n */\nexport function useCommonAdminCoreDamOptions(configName: string) {\n if (\n isUndefined(commonAdminCoreDamOptions.value) ||\n isUndefined(commonAdminCoreDamOptions.value.configs) ||\n // Own keys only. Inherited names like `constructor` are not configurations.\n !Object.hasOwn(commonAdminCoreDamOptions.value.configs, configName) ||\n isUndefined(commonAdminCoreDamOptions.value.configs[configName])\n ) {\n throw new Error(\"Composable can't be used without properly configured common admin.\")\n }\n\n return {\n damClient: commonAdminCoreDamOptions.value.configs[configName].damClient,\n endPointImage: commonAdminCoreDamOptions.value.configs[configName].endPointImage || DEFAULT_END_POINT_IMAGE,\n imageRotateAcl: resolveImageRotateAcl(commonAdminCoreDamOptions.value.configs[configName]),\n endPointAsset: commonAdminCoreDamOptions.value.configs[configName].endPointAsset || '/adm/v1/asset',\n endPointRoi: commonAdminCoreDamOptions.value.configs[configName].endPointRoi || DEFAULT_END_POINT_ROI,\n endPointAuthor: commonAdminCoreDamOptions.value.configs[configName].endPointAuthor || DEFAULT_END_POINT_AUTHOR,\n endPointKeyword: commonAdminCoreDamOptions.value.configs[configName].endPointKeyword || DEFAULT_END_POINT_KEYWORD,\n ...damEndPointsOf(configName),\n // The system whose user decides the licences. `false` means every licence.\n currentUser: commonAdminCoreDamOptions.value.configs[configName].currentUser ?? SYSTEM_DAM,\n adminDomain:\n commonAdminCoreDamOptions.value.configs[configName].adminDomain ?? commonAdminCoreDamOptions.value.adminDomain,\n apiTimeout:\n commonAdminCoreDamOptions.value.configs[configName].apiTimeout ?? commonAdminCoreDamOptions.value.apiTimeout,\n roiUpdateAcl: resolveRoiUpdateAcl(commonAdminCoreDamOptions.value.configs[configName]),\n keywordCreateAcl: commonAdminCoreDamOptions.value.configs[configName].keywordCreateAcl,\n authorCreateAcl: commonAdminCoreDamOptions.value.configs[configName].authorCreateAcl,\n mainFileSingleUseEnabled: commonAdminCoreDamOptions.value.configs[configName].mainFileSingleUseEnabled ?? true,\n // Passed as configured. Readers treat it as on unless `false`.\n copyToLicenceEnabled: commonAdminCoreDamOptions.value.configs[configName].copyToLicenceEnabled,\n showSourceEnabled: commonAdminCoreDamOptions.value.configs[configName].showSourceEnabled ?? true,\n showFileInfoEnabled: commonAdminCoreDamOptions.value.configs[configName].showFileInfoEnabled ?? true,\n sourceLabel:\n commonAdminCoreDamOptions.value.configs[configName].sourceLabel || t('common.damImage.image.model.texts.source'),\n editAssetLabel:\n commonAdminCoreDamOptions.value.configs[configName].editAssetLabel || t('common.damImage.image.button.editAsset'),\n addFromDamLabel:\n commonAdminCoreDamOptions.value.configs[configName].addFromDamLabel ||\n t('common.damImage.image.button.addFromDam'),\n replaceFromDamLabel:\n commonAdminCoreDamOptions.value.configs[configName].replaceFromDamLabel ||\n t('common.damImage.image.button.replaceFromDam'),\n descriptionValidation: {\n ...defaultDescriptionValidation,\n ...commonAdminCoreDamOptions.value.configs[configName].descriptionValidation,\n },\n sourceValidation: {\n ...defaultSourceValidation,\n ...commonAdminCoreDamOptions.value.configs[configName].sourceValidation,\n },\n customUploadMetadataToImageMap: commonAdminCoreDamOptions.value.configs[configName].customUploadMetadataToImageMap,\n customAssetSelectMetadataToImageMap:\n commonAdminCoreDamOptions.value.configs[configName].customAssetSelectMetadataToImageMap,\n // undefined means all filters\n assetListEnabledFilters: commonAdminCoreDamOptions.value.configs[configName].assetListEnabledFilters,\n simpleAssetSidebarEnabled: commonAdminCoreDamOptions.value.configs[configName].simpleAssetSidebar ?? false,\n }\n}\n\nexport interface DamNotificationOptions {\n enabled: boolean\n webSocketUrl: string\n}\n\n// A deployment template quotes the value and renders booleans as `True`.\n// So the string \"true\" also enables it, in any case and with\n// surrounding whitespace. Any other string, including \"false\", is off.\nexport const normalizeDamNotificationOptions = (\n raw: { enabled?: boolean | string; webSocketUrl?: string } | undefined\n): DamNotificationOptions => {\n const webSocketUrl = isString(raw?.webSocketUrl) ? raw.webSocketUrl.trim() : ''\n const on = raw?.enabled === true || (isString(raw?.enabled) && raw.enabled.trim().toLowerCase() === 'true')\n\n return { enabled: on && webSocketUrl.length > 0, webSocketUrl }\n}\n\n/** One notification socket of the page and the DAM configurations that use it. */\nexport interface DamNotificationSocketOptions {\n options: DamNotificationOptions\n configNames: string[]\n}\n\n/**\n * One socket per distinct service, shared by the configurations that name it.\n * `default`'s comes first, even when off: its own `notification`, else the root one.\n * Other configurations get one only with their own enabled `notification`.\n */\nexport function damNotificationSockets(): DamNotificationSocketOptions[] {\n const { notification } = useCommonAdminCoreDamOptionsGlobal()\n const configs = commonAdminCoreDamOptions.value?.configs ?? {}\n const ofDefault = isUndefined(configs.default?.notification)\n ? notification\n : normalizeDamNotificationOptions(configs.default.notification)\n const sockets: DamNotificationSocketOptions[] = [{ options: ofDefault, configNames: ['default'] }]\n for (const [name, config] of Object.entries(configs)) {\n if (name === 'default' || isUndefined(config?.notification)) continue\n const options = normalizeDamNotificationOptions(config.notification)\n if (!options.enabled) continue\n const shared = sockets.find(\n (socket) => socket.options.enabled && socket.options.webSocketUrl === options.webSocketUrl\n )\n if (shared) shared.configNames.push(name)\n else sockets.push({ options, configNames: [name] })\n }\n return sockets\n}\n\nexport function useCommonAdminCoreDamOptionsGlobal() {\n if (isUndefined(commonAdminCoreDamOptions.value) || isUndefined(commonAdminCoreDamOptions.value.configs)) {\n throw new Error(\"Composable can't be used without properly configured common admin.\")\n }\n\n return {\n apiTimeout: commonAdminCoreDamOptions.value.apiTimeout,\n notification: normalizeDamNotificationOptions(commonAdminCoreDamOptions.value.notification),\n adminDomain: commonAdminCoreDamOptions.value.adminDomain,\n }\n}\n"],"mappings":";;;;;AAgBA,IAAMC,IAAIC,GAEJC,IAA2D;CAC/D,UAAU;CACV,KAAK;CACL,KAAK;AACP,GACMC,IAAsD;CAAE,UAAU;CAAM,KAAK;CAAG,KAAK;AAAI,GAIzFC,IAAwB,eACxBC,IAA0B,iBAC1BC,IAA2B,kBAC3BC,IAA4B,mBAE5BC,KAAuB,MACtBC,EAAYC,EAAO,YAAY,KAChBA,EAAO,eAAeN,OAEnBA,IAAwB,gCAAgC,OAHjCM,EAAO,cAMjDC,KAAyB,MACxBF,EAAYC,EAAO,cAAc,KAChBA,EAAO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KAAK,CAAC,CAAC,YAAY,MAAM,WAE5EF,EAAa,SAAS;EAAG;CAAa;AAChE;AAaA,SAAgBG,IAAyD;CACvE,IAAM,EAAE,oBAAiBC,EAAmC,GACtDT,IAAUd,EAA0B,OAAO,WAAW,CAAC,GAIvDwB,IAA0C,CAAC;EAAE,SAHjCd,EAAYI,EAAQ,SAAS,YAAY,IACvDW,IACAP,EAAgCJ,EAAQ,QAAQ,YAAY;EACO,aAAa,CAAC,SAAS;CAAE,CAAC;CACjG,KAAK,IAAM,CAACY,GAAMf,MAAW,OAAO,QAAQG,CAAO,GAAG;EACpD,IAAIY,MAAS,aAAahB,EAAYC,GAAQ,YAAY,GAAG;EAC7D,IAAMgB,IAAUT,EAAgCP,EAAO,YAAY;EACnE,IAAI,CAACgB,EAAQ,SAAS;EACtB,IAAMC,IAASJ,EAAQ,MACpB,MAAWK,EAAO,QAAQ,WAAWA,EAAO,QAAQ,iBAAiBF,EAAQ,YAChF;EACA,AAAIC,IAAQA,EAAO,YAAY,KAAKF,CAAI,IACnCF,EAAQ,KAAK;GAAE;GAAS,aAAa,CAACE,CAAI;EAAE,CAAC;CACpD;CACA,OAAOF;AACT;AAEA,SAAgBD,IAAqC;CACnD,IAAIb,EAAYV,EAA0B,KAAK,KAAKU,EAAYV,EAA0B,MAAM,OAAO,GACrG,MAAU,MAAM,oEAAoE;CAGtF,OAAO;EACL,YAAYA,EAA0B,MAAM;EAC5C,cAAckB,EAAgClB,EAA0B,MAAM,YAAY;EAC1F,aAAaA,EAA0B,MAAM;CAC/C;AACF"}
@@ -1,20 +1,19 @@
1
1
  import { InjectionKey } from 'vue';
2
2
  export declare const DamConfigNameKey: InjectionKey<string>;
3
3
  /**
4
- * The name of the DAM configuration a component works under: its own `configName` when it is given one, else that of
5
- * the nearest component above it that has one, else `default`. Handed on to the components below. Read once, in
6
- * `setup`, as the options of the configuration are.
4
+ * DAM configuration name of a component: its own `configName`, else the nearest ancestor's, else `default`.
5
+ * Provided to child components. Read once in `setup`, like the configuration options.
7
6
  */
8
7
  export declare function useDamConfigName(explicit?: string): string;
9
8
  /**
10
- * The name a public composable works under when its caller names none: in a component's setup the name of the nearest
11
- * ancestor that has one (as `useDamConfigName` inherits it), anywhere else `default`. A component's own `configName`
12
- * is not seen here: it passes it. It hands nothing on.
9
+ * Name a public composable uses when the caller gives none: in
10
+ * component setup the nearest ancestor's, elsewhere `default`.
11
+ * It does not see the component's own `configName` and provides nothing to children.
13
12
  */
14
13
  export declare function inheritedDamConfigName(explicit?: string): string;
15
14
  /**
16
- * Throws for a configuration name the application has not got, once the plugin has set the options. Before that every
17
- * name passes: what asks under it checks it then. `default` always passes: its caches are there from the start, in an
18
- * application without the DAM too.
15
+ * Throws for an unknown configuration name once the plugin has set
16
+ * options. Before that every name passes and is checked on use.
17
+ * `default` always passes: its caches exist from the start, even in apps without DAM.
19
18
  */
20
19
  export declare function checkDamConfigName(configName: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"damConfigName.js","names":["DamConfigNameKey","useDamConfigName","name","explicit","inject","provide","inheritedDamConfigName","hasInjectionContext","checkDamConfigName","configName","isUndefined","coreDamOptions","useCommonAdminCoreDamOptions"],"sources":["../../../../src/domains/dam/composables/damConfigName.ts"],"sourcesContent":["import { hasInjectionContext, inject, type InjectionKey, provide } from 'vue'\nimport { coreDamOptions } from '@/plugins/pluginOptions'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { isUndefined } from '@/shared/utils/common'\n\n// Not exported from `src/lib.ts`: the components an application mounts take the name as their `configName`.\nexport const DamConfigNameKey: InjectionKey<string> = Symbol('anzu:dam-config-name')\n\n/**\n * The name of the DAM configuration a component works under: its own `configName` when it is given one, else that of\n * the nearest component above it that has one, else `default`. Handed on to the components below. Read once, in\n * `setup`, as the options of the configuration are.\n */\nexport function useDamConfigName(explicit?: string): string {\n const name = explicit ?? inject(DamConfigNameKey, undefined) ?? 'default'\n provide(DamConfigNameKey, name)\n\n return name\n}\n\n/**\n * The name a public composable works under when its caller names none: in a component's setup the name of the nearest\n * ancestor that has one (as `useDamConfigName` inherits it), anywhere else `default`. A component's own `configName`\n * is not seen here: it passes it. It hands nothing on.\n */\nexport function inheritedDamConfigName(explicit?: string): string {\n if (explicit !== undefined) return explicit\n\n return (hasInjectionContext() ? inject(DamConfigNameKey, undefined) : undefined) ?? 'default'\n}\n\n/**\n * Throws for a configuration name the application has not got, once the plugin has set the options. Before that every\n * name passes: what asks under it checks it then. `default` always passes: its caches are there from the start, in an\n * application without the DAM too.\n */\nexport function checkDamConfigName(configName: string) {\n if (configName === 'default' || isUndefined(coreDamOptions.value)) return\n useCommonAdminCoreDamOptions(configName)\n}\n"],"mappings":";;;;;AAMA,IAAaA,IAAyC,OAAO,sBAAsB;AAOnF,SAAgBC,EAAiB,GAA2B;CAC1D,IAAMC,IAAOC,KAAYC,EAAOJ,GAAkB,KAAA,CAAS,KAAK;CAGhE,OAFAK,EAAQL,GAAkBE,CAAI,GAEvBA;AACT;AAOA,SAAgBI,EAAuB,GAA2B;CAGhE,OAFIH,MAAa,KAAA,KAETI,EAAoB,IAAIH,EAAOJ,GAAkB,KAAA,CAAS,IAAI,KAAA,MAAc,YAFjDG;AAGrC;AAOA,SAAgBK,EAAmB,GAAoB;CACrD,AAAIC,MAAe,aAAaC,EAAYC,EAAe,KAAK,KAChEC,EAA6BH,CAAU;AACzC"}
1
+ {"version":3,"file":"damConfigName.js","names":["DamConfigNameKey","useDamConfigName","name","explicit","inject","provide","inheritedDamConfigName","hasInjectionContext","checkDamConfigName","configName","isUndefined","coreDamOptions","useCommonAdminCoreDamOptions"],"sources":["../../../../src/domains/dam/composables/damConfigName.ts"],"sourcesContent":["import { hasInjectionContext, inject, type InjectionKey, provide } from 'vue'\nimport { coreDamOptions } from '@/plugins/pluginOptions'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { isUndefined } from '@/shared/utils/common'\n\n// Not exported from `src/lib.ts`. Components an application mounts take the name as `configName`.\nexport const DamConfigNameKey: InjectionKey<string> = Symbol('anzu:dam-config-name')\n\n/**\n * DAM configuration name of a component: its own `configName`, else the nearest ancestor's, else `default`.\n * Provided to child components. Read once in `setup`, like the configuration options.\n */\nexport function useDamConfigName(explicit?: string): string {\n const name = explicit ?? inject(DamConfigNameKey, undefined) ?? 'default'\n provide(DamConfigNameKey, name)\n\n return name\n}\n\n/**\n * Name a public composable uses when the caller gives none: in\n * component setup the nearest ancestor's, elsewhere `default`.\n * It does not see the component's own `configName` and provides nothing to children.\n */\nexport function inheritedDamConfigName(explicit?: string): string {\n if (explicit !== undefined) return explicit\n\n return (hasInjectionContext() ? inject(DamConfigNameKey, undefined) : undefined) ?? 'default'\n}\n\n/**\n * Throws for an unknown configuration name once the plugin has set\n * options. Before that every name passes and is checked on use.\n * `default` always passes: its caches exist from the start, even in apps without DAM.\n */\nexport function checkDamConfigName(configName: string) {\n if (configName === 'default' || isUndefined(coreDamOptions.value)) return\n useCommonAdminCoreDamOptions(configName)\n}\n"],"mappings":";;;;;AAMA,IAAaA,IAAyC,OAAO,sBAAsB;AAMnF,SAAgBC,EAAiB,GAA2B;CAC1D,IAAMC,IAAOC,KAAYC,EAAOJ,GAAkB,KAAA,CAAS,KAAK;CAGhE,OAFAK,EAAQL,GAAkBE,CAAI,GAEvBA;AACT;AAOA,SAAgBI,EAAuB,GAA2B;CAGhE,OAFIH,MAAa,KAAA,KAETI,EAAoB,IAAIH,EAAOJ,GAAkB,KAAA,CAAS,IAAI,KAAA,MAAc,YAFjDG;AAGrC;AAOA,SAAgBK,EAAmB,GAAoB;CACrD,AAAIC,MAAe,aAAaC,EAAYC,EAAe,KAAK,KAChEC,EAA6BH,CAAU;AACzC"}
@@ -1,9 +1,9 @@
1
1
  import { DamNotification } from './damNotificationsEventBus';
2
2
  /**
3
- * The DAM notification sockets of the page: `default`'s, from its `notification` or the root one, and one for each
4
- * other service a configuration names (configurations that name one service share its socket). Memoized by the
5
- * services and the configurations of each, so a reconfigured plugin gets fresh sockets while repeated calls with the
6
- * same config reuse the existing ones. The handle opens, closes and disposes of them all.
3
+ * DAM notification sockets of the page: `default`'s, plus one per other service
4
+ * a configuration names (shared by configurations naming the same service).
5
+ * Memoized by services and their configurations. A reconfigured plugin gets fresh sockets, repeated calls reuse them.
6
+ * The handle opens, closes and disposes of them all.
7
7
  */
8
8
  export declare function initDamNotifications(): {
9
9
  openConnection: () => void;
@@ -13,15 +13,15 @@ export declare function initDamNotifications(): {
13
13
  status: import('vue').ShallowRef<import('@vueuse/core').WebSocketStatus>;
14
14
  };
15
15
  /**
16
- * Tears the sockets down and invalidates the previous handle. Owned by the app bootstrap —
17
- * tying it to a component unmount would kill the shared connection for everyone else.
16
+ * Tears the sockets down and invalidates the previous handle. Owned by app bootstrap.
17
+ * Tying it to a component unmount would kill the shared connection for everyone else.
18
18
  */
19
19
  export declare function destroyDamNotifications(): void;
20
- /** Which sockets a listener of DAM notifications hears. */
20
+ /** Which sockets a DAM notification listener hears. */
21
21
  export interface DamNotificationListenerOptions {
22
- /** The socket of this DAM configuration; `default` where left out. */
22
+ /** Socket of this DAM configuration. Defaults to `default`. */
23
23
  configName?: string;
24
- /** Every socket of the page; `configName` is not read then. */
24
+ /** Every socket of the page. `configName` is ignored then. */
25
25
  all?: boolean;
26
26
  }
27
27
  type DamNotificationCallback = (event: DamNotification, origin: string[]) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"damNotifications.js","names":["t","commonT","damNotificationsInitialized","ref","singleton","singletonScope","singletonKey","createDamSocket","notification","enabled","eventBus","useDamNotificationsEventBus","warningTimer","warnFailed","useAlerts","useWebSocket","message","event","data","configNames","status","setDamNotificationsPushAlive","current","closeConnection","close","error","createDamNotifications","ofDefault","others","sockets","all","disposed","failure","socket","onDispose","initDamNotifications","damNotificationSockets","key","options","destroyDamNotifications","effectScope","handle","forgetSingleton","busListeners","busListenerOf","ofCallback","callback","listener","origin","from","useDamNotifications"],"sources":["../../../../src/domains/dam/composables/damNotifications.ts"],"sourcesContent":["import { useWebSocket } from '@vueuse/core'\nimport { type EffectScope, effectScope, ref, watch } from 'vue'\nimport { commonT } from '@/plugins/i18n'\nimport { type DamNotification, useDamNotificationsEventBus } from '@/domains/dam/composables/damNotificationsEventBus'\nimport {\n damNotificationSockets,\n type DamNotificationSocketOptions,\n} from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { setDamNotificationsPushAlive } from '@/domains/dam/composables/damNotificationsConnection'\nimport { useAlerts } from '@/domains/system/composables/alerts'\n\nconst t = commonT\n\nconst damNotificationsInitialized = ref(false)\n\ntype DamNotificationsHandle = ReturnType<typeof createDamNotifications>\n\nlet singleton: DamNotificationsHandle | undefined = undefined\nlet singletonScope: EffectScope | undefined = undefined\nlet singletonKey: string | undefined = undefined\n\n/** One socket, of the configurations `configNames`: what comes through it is told to come from them. */\nfunction createDamSocket({ options: notification, configNames }: DamNotificationSocketOptions) {\n const enabled = notification.enabled\n\n const eventBus = useDamNotificationsEventBus()\n\n let warningTimer: ReturnType<typeof setTimeout> | undefined = undefined\n\n /** The socket has given up: the user is told, once it has failed. One warning waits at a time, which a close takes. */\n const warnFailed = () => {\n if (!enabled) return\n const { showWarning } = useAlerts()\n if (warningTimer) clearTimeout(warningTimer)\n warningTimer = setTimeout(() => {\n showWarning(t('common.damImage.notificationsNotConnected'))\n }, 3000)\n }\n\n const { open, close, status } = useWebSocket(notification.webSocketUrl, {\n immediate: false,\n autoClose: false,\n // Plain string url — VueUse's `watch(urlRef, open)` would never fire.\n autoConnect: false,\n autoReconnect: {\n retries: 5,\n delay: 5000,\n onFailed: warnFailed,\n },\n onMessage(ws, event) {\n if (!enabled) return\n const message = JSON.parse(event.data as string)\n const data = message.data.length ? JSON.parse(message.data) : undefined\n eventBus.emit({ name: message.eventName, data }, configNames)\n },\n })\n\n // Only an open socket counts: one that still connects, or has given up, brings no notification.\n watch(status, (current) => setDamNotificationsPushAlive(enabled && current === 'OPEN', configNames), {\n immediate: true,\n flush: 'sync',\n })\n\n const closeConnection = () => {\n if (warningTimer) {\n clearTimeout(warningTimer)\n warningTimer = undefined\n }\n close()\n }\n\n const openConnection = () => {\n if (!enabled) return\n // VueUse `open()` closes and re-inits even a live socket.\n if (status.value === 'OPEN' || status.value === 'CONNECTING') return\n try {\n open()\n } catch (error) {\n // An address the browser refuses. `default`'s throws, as the one socket of the page did; that of another\n // configuration fails as a socket that gave up does, and the page goes on.\n if (configNames.includes('default')) throw error\n console.error('damNotifications: the socket could not be opened', error)\n warnFailed()\n }\n }\n\n const dispose = () => {\n closeConnection()\n setDamNotificationsPushAlive(false, configNames)\n }\n\n return { openConnection, closeConnection, dispose, status }\n}\n\n/**\n * The sockets of the page, `default`'s first. The handle acts on them all; its `status` is that of `default`'s\n * socket, as it was of the one socket of the page.\n */\nfunction createDamNotifications(sockets: DamNotificationSocketOptions[], onDispose: () => void = () => {}) {\n const [ofDefault, ...others] = sockets.map(createDamSocket)\n const all = [ofDefault!, ...others]\n\n let disposed = false\n\n const closeConnection = () => all.forEach((socket) => socket.closeConnection())\n\n const openConnection = () => {\n if (disposed) return\n damNotificationsInitialized.value = true\n // The others are opened also when that of `default` throws, which is thrown once they are.\n let failure: { error: unknown } | undefined\n all.forEach((socket) => {\n try {\n socket.openConnection()\n } catch (error) {\n failure ??= { error }\n }\n })\n if (failure) throw failure.error\n }\n\n const dispose = () => {\n disposed = true\n all.forEach((socket) => socket.dispose())\n onDispose()\n }\n\n return {\n openConnection,\n closeConnection,\n dispose,\n damNotificationsInitialized,\n status: ofDefault!.status,\n }\n}\n\n/**\n * The DAM notification sockets of the page: `default`'s, from its `notification` or the root one, and one for each\n * other service a configuration names (configurations that name one service share its socket). Memoized by the\n * services and the configurations of each, so a reconfigured plugin gets fresh sockets while repeated calls with the\n * same config reuse the existing ones. The handle opens, closes and disposes of them all.\n */\nexport function initDamNotifications() {\n const sockets = damNotificationSockets()\n const key = sockets\n .map(({ options, configNames }) => `${configNames.join(',')}=${options.enabled}|${options.webSocketUrl}`)\n .join(';')\n\n if (singleton && singletonKey === key) return singleton\n if (singleton) destroyDamNotifications()\n\n singletonScope = effectScope(true)\n // Disposed directly, the handle is forgotten too: kept, the next call handed back a socket that never opened again.\n const handle: DamNotificationsHandle = singletonScope.run(() =>\n createDamNotifications(sockets, () => {\n if (singleton === handle) forgetSingleton()\n })\n )!\n singleton = handle\n singletonKey = key\n\n return singleton\n}\n\nconst forgetSingleton = () => {\n singletonScope?.stop()\n damNotificationsInitialized.value = false\n singleton = undefined\n singletonScope = undefined\n singletonKey = undefined\n}\n\n/**\n * Tears the sockets down and invalidates the previous handle. Owned by the app bootstrap —\n * tying it to a component unmount would kill the shared connection for everyone else.\n */\nexport function destroyDamNotifications() {\n singleton?.dispose()\n forgetSingleton()\n}\n\n/** Which sockets a listener of DAM notifications hears. */\nexport interface DamNotificationListenerOptions {\n /** The socket of this DAM configuration; `default` where left out. */\n configName?: string\n /** Every socket of the page; `configName` is not read then. */\n all?: boolean\n}\n\ntype DamNotificationCallback = (event: DamNotification, origin: string[]) => void\ntype DamNotificationBusListener = (event: DamNotification, from?: string[]) => void\n\n// One listener of the bus for a callback and the sockets it hears: added twice, it is one listener, heard once, as the\n// callback itself was.\nconst busListeners = new WeakMap<DamNotificationCallback, Map<string, DamNotificationBusListener>>()\nconst busListenerOf = (callback: DamNotificationCallback, options: DamNotificationListenerOptions) => {\n const key = options.all ? 'all' : `of ${options.configName ?? 'default'}`\n let ofCallback = busListeners.get(callback)\n if (!ofCallback) {\n ofCallback = new Map()\n busListeners.set(callback, ofCallback)\n }\n let listener = ofCallback.get(key)\n if (!listener) {\n listener = (event, from) => {\n // An event put on the bus without the socket it came through is taken for one of `default`'s.\n const origin = from ?? ['default']\n if (!options.all && !origin.includes(options.configName ?? 'default')) return\n // A copy for each: the names are those of the socket for every event to come.\n callback(event, [...origin])\n }\n ofCallback.set(key, listener)\n }\n return listener\n}\n\nexport function useDamNotifications() {\n const eventBus = useDamNotificationsEventBus()\n\n /**\n * Hears the socket of `default`, or the one `options` names. The callback gets, beside the event, the names of the\n * configurations of the socket it came through (a copy of its own). One callback added twice for the same sockets is\n * heard once. Returns the `off` handle; outside a component setup the caller must keep and call it.\n */\n const addDamNotificationListener = (\n callback: DamNotificationCallback,\n options: DamNotificationListenerOptions = {}\n ) => {\n return eventBus.on(busListenerOf(callback, options))\n }\n\n return {\n addDamNotificationListener,\n }\n}\n"],"mappings":";;;;;;;;AAWA,IAAMA,IAAIC,GAEJC,IAA8BC,EAAI,EAAK,GAIzCC,IAAgD,KAAA,GAChDC,IAA0C,KAAA,GAC1CC,IAAmC,KAAA;AAGvC,SAASC,EAAgB,EAAE,SAASC,GAAc,kBAA6C;CAC7F,IAAMC,IAAUD,EAAa,SAEvBE,IAAWC,EAA4B,GAEzCC,GAGEC,UAAmB;EACvB,IAAI,CAACJ,GAAS;EACd,IAAM,EAAE,mBAAgBK,EAAU;EAElC,AADIF,KAAc,aAAaA,CAAY,GAC3C,IAAe,iBAAiB;GAC9B,EAAYZ,EAAE,2CAA2C,CAAC;EAC5D,GAAG,GAAI;CACT,GAEM,EAAE,SAAM,UAAO,cAAWe,EAAaP,EAAa,cAAc;EACtE,WAAW;EACX,WAAW;EAEX,aAAa;EACb,eAAe;GACb,SAAS;GACT,OAAO;GACP,UAAUK;EACZ;EACA,UAAU,GAAI,GAAO;GACnB,IAAI,CAACJ,GAAS;GACd,IAAMO,IAAU,KAAK,MAAMC,EAAM,IAAc,GACzCC,IAAOF,EAAQ,KAAK,SAAS,KAAK,MAAMA,EAAQ,IAAI,IAAI,KAAA;GAC9D,EAAS,KAAK;IAAE,MAAMA,EAAQ;IAAW;GAAK,GAAGG,CAAW;EAC9D;CACF,CAAC;CAGD,EAAMC,IAAS,MAAYC,EAA6BZ,KAAWa,MAAY,QAAQH,CAAW,GAAG;EACnG,WAAW;EACX,OAAO;CACT,CAAC;CAED,IAAMI,UAAwB;EAK5B,AAJA,AAEEX,OADA,aAAaA,CAAY,GACV,KAAA,IAEj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,IAAiCpC,EAAe,UACpDqB,EAAuBG,SAAe;EACpC,AAAIzB,MAAcqC,KAAQC,EAAgB;CAC5C,CAAC,CACH;CAIA,OAHA,IAAYD,GACZ,IAAeJ,GAERjC;AACT;AAEA,IAAMsC,UAAwB;CAK5B,AAJArC,GAAgB,KAAK,GACrB,EAA4B,QAAQ,IACpC,IAAY,KAAA,GACZ,IAAiB,KAAA,GACjB,IAAe,KAAA;AACjB;AAMA,SAAgBkC,IAA0B;CAExC,AADAnC,GAAW,QAAQ,GACnBsC,EAAgB;AAClB;AAeA,IAAMC,oBAAe,IAAI,QAA0E,GAC7FC,KAAiB,GAAmC,MAA4C;CACpG,IAAMP,IAAMC,EAAQ,MAAM,QAAQ,MAAMA,EAAQ,cAAc,aAC1DO,IAAaF,EAAa,IAAIG,CAAQ;CAC1C,AAAKD,MACH,oBAAa,IAAI,IAAI,GACrBF,EAAa,IAAIG,GAAUD,CAAU;CAEvC,IAAIE,IAAWF,EAAW,IAAIR,CAAG;CAWjC,OAVKU,MACH,KAAY,GAAO,MAAS;EAE1B,IAAMC,IAASC,KAAQ,CAAC,SAAS;EACjC,CAAKX,EAAQ,OAAQU,EAAO,SAASV,EAAQ,cAAc,SAAS,MAEpEQ,EAAS7B,GAAO,CAAC,GAAG+B,CAAM,CAAC;CAC7B,GACAH,EAAW,IAAIR,GAAKU,CAAQ,IAEvBA;AACT;AAEA,SAAgBG,IAAsB;CACpC,IAAMxC,IAAWC,EAA4B;CAc7C,OAAO,EACL,6BAPA,GACA,IAA0C,CAAC,MAEpCD,EAAS,GAAGkC,EAAcE,GAAUR,CAAO,CAAC,EAKrD;AACF"}
1
+ {"version":3,"file":"damNotifications.js","names":["t","commonT","damNotificationsInitialized","ref","singleton","singletonScope","singletonKey","createDamSocket","notification","enabled","eventBus","useDamNotificationsEventBus","warningTimer","warnFailed","useAlerts","useWebSocket","message","event","data","configNames","status","setDamNotificationsPushAlive","current","closeConnection","close","error","createDamNotifications","ofDefault","others","sockets","all","disposed","failure","socket","onDispose","initDamNotifications","damNotificationSockets","key","options","destroyDamNotifications","effectScope","handle","forgetSingleton","busListeners","busListenerOf","ofCallback","callback","listener","origin","from","useDamNotifications"],"sources":["../../../../src/domains/dam/composables/damNotifications.ts"],"sourcesContent":["import { useWebSocket } from '@vueuse/core'\nimport { type EffectScope, effectScope, ref, watch } from 'vue'\nimport { commonT } from '@/plugins/i18n'\nimport { type DamNotification, useDamNotificationsEventBus } from '@/domains/dam/composables/damNotificationsEventBus'\nimport {\n damNotificationSockets,\n type DamNotificationSocketOptions,\n} from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { setDamNotificationsPushAlive } from '@/domains/dam/composables/damNotificationsConnection'\nimport { useAlerts } from '@/domains/system/composables/alerts'\n\nconst t = commonT\n\nconst damNotificationsInitialized = ref(false)\n\ntype DamNotificationsHandle = ReturnType<typeof createDamNotifications>\n\nlet singleton: DamNotificationsHandle | undefined = undefined\nlet singletonScope: EffectScope | undefined = undefined\nlet singletonKey: string | undefined = undefined\n\n/** One socket for the configurations `configNames`. Its events are tagged with those names. */\nfunction createDamSocket({ options: notification, configNames }: DamNotificationSocketOptions) {\n const enabled = notification.enabled\n\n const eventBus = useDamNotificationsEventBus()\n\n let warningTimer: ReturnType<typeof setTimeout> | undefined = undefined\n\n /** Warns the user once the socket gives up. Only one warning is shown at a time; closing it clears it. */\n const warnFailed = () => {\n if (!enabled) return\n const { showWarning } = useAlerts()\n if (warningTimer) clearTimeout(warningTimer)\n warningTimer = setTimeout(() => {\n showWarning(t('common.damImage.notificationsNotConnected'))\n }, 3000)\n }\n\n const { open, close, status } = useWebSocket(notification.webSocketUrl, {\n immediate: false,\n autoClose: false,\n // Plain string url. VueUse's `watch(urlRef, open)` would never fire.\n autoConnect: false,\n autoReconnect: {\n retries: 5,\n delay: 5000,\n onFailed: warnFailed,\n },\n onMessage(ws, event) {\n if (!enabled) return\n const message = JSON.parse(event.data as string)\n const data = message.data.length ? JSON.parse(message.data) : undefined\n eventBus.emit({ name: message.eventName, data }, configNames)\n },\n })\n\n // Only an open socket counts. A connecting or failed one brings no notifications.\n watch(status, (current) => setDamNotificationsPushAlive(enabled && current === 'OPEN', configNames), {\n immediate: true,\n flush: 'sync',\n })\n\n const closeConnection = () => {\n if (warningTimer) {\n clearTimeout(warningTimer)\n warningTimer = undefined\n }\n close()\n }\n\n const openConnection = () => {\n if (!enabled) return\n // VueUse `open()` closes and re-inits even a live socket.\n if (status.value === 'OPEN' || status.value === 'CONNECTING') return\n try {\n open()\n } catch (error) {\n // The browser refused the address. For `default` this throws. For other\n // configurations it fails like a socket that gave up, and the page continues.\n if (configNames.includes('default')) throw error\n console.error('damNotifications: the socket could not be opened', error)\n warnFailed()\n }\n }\n\n const dispose = () => {\n closeConnection()\n setDamNotificationsPushAlive(false, configNames)\n }\n\n return { openConnection, closeConnection, dispose, status }\n}\n\n/**\n * All sockets of the page, `default`'s first. The handle acts\n * on all of them. Its `status` is that of `default`'s socket.\n */\nfunction createDamNotifications(sockets: DamNotificationSocketOptions[], onDispose: () => void = () => {}) {\n const [ofDefault, ...others] = sockets.map(createDamSocket)\n const all = [ofDefault!, ...others]\n\n let disposed = false\n\n const closeConnection = () => all.forEach((socket) => socket.closeConnection())\n\n const openConnection = () => {\n if (disposed) return\n damNotificationsInitialized.value = true\n // The others open even when `default`'s throws. That error is rethrown after they open.\n let failure: { error: unknown } | undefined\n all.forEach((socket) => {\n try {\n socket.openConnection()\n } catch (error) {\n failure ??= { error }\n }\n })\n if (failure) throw failure.error\n }\n\n const dispose = () => {\n disposed = true\n all.forEach((socket) => socket.dispose())\n onDispose()\n }\n\n return {\n openConnection,\n closeConnection,\n dispose,\n damNotificationsInitialized,\n status: ofDefault!.status,\n }\n}\n\n/**\n * DAM notification sockets of the page: `default`'s, plus one per other service\n * a configuration names (shared by configurations naming the same service).\n * Memoized by services and their configurations. A reconfigured plugin gets fresh sockets, repeated calls reuse them.\n * The handle opens, closes and disposes of them all.\n */\nexport function initDamNotifications() {\n const sockets = damNotificationSockets()\n const key = sockets\n .map(({ options, configNames }) => `${configNames.join(',')}=${options.enabled}|${options.webSocketUrl}`)\n .join(';')\n\n if (singleton && singletonKey === key) return singleton\n if (singleton) destroyDamNotifications()\n\n singletonScope = effectScope(true)\n // Disposing directly also forgets the handle. Otherwise the next call returned a socket that never reopened.\n const handle: DamNotificationsHandle = singletonScope.run(() =>\n createDamNotifications(sockets, () => {\n if (singleton === handle) forgetSingleton()\n })\n )!\n singleton = handle\n singletonKey = key\n\n return singleton\n}\n\nconst forgetSingleton = () => {\n singletonScope?.stop()\n damNotificationsInitialized.value = false\n singleton = undefined\n singletonScope = undefined\n singletonKey = undefined\n}\n\n/**\n * Tears the sockets down and invalidates the previous handle. Owned by app bootstrap.\n * Tying it to a component unmount would kill the shared connection for everyone else.\n */\nexport function destroyDamNotifications() {\n singleton?.dispose()\n forgetSingleton()\n}\n\n/** Which sockets a DAM notification listener hears. */\nexport interface DamNotificationListenerOptions {\n /** Socket of this DAM configuration. Defaults to `default`. */\n configName?: string\n /** Every socket of the page. `configName` is ignored then. */\n all?: boolean\n}\n\ntype DamNotificationCallback = (event: DamNotification, origin: string[]) => void\ntype DamNotificationBusListener = (event: DamNotification, from?: string[]) => void\n\n// One bus listener per callback and socket set. Adding it twice yields one listener, heard once.\nconst busListeners = new WeakMap<DamNotificationCallback, Map<string, DamNotificationBusListener>>()\nconst busListenerOf = (callback: DamNotificationCallback, options: DamNotificationListenerOptions) => {\n const key = options.all ? 'all' : `of ${options.configName ?? 'default'}`\n let ofCallback = busListeners.get(callback)\n if (!ofCallback) {\n ofCallback = new Map()\n busListeners.set(callback, ofCallback)\n }\n let listener = ofCallback.get(key)\n if (!listener) {\n listener = (event, from) => {\n // An event put on the bus without its socket is treated as `default`'s.\n const origin = from ?? ['default']\n if (!options.all && !origin.includes(options.configName ?? 'default')) return\n // A copy per callback. The array is the socket's names, shared by every future event.\n callback(event, [...origin])\n }\n ofCallback.set(key, listener)\n }\n return listener\n}\n\nexport function useDamNotifications() {\n const eventBus = useDamNotificationsEventBus()\n\n /**\n * Hears `default`'s socket, or the one `options` names. The\n * callback also gets a copy of the socket's configuration names.\n * One callback added twice for the same sockets is heard once.\n * Returns the `off` handle. Outside a component setup the caller must keep and call it.\n */\n const addDamNotificationListener = (\n callback: DamNotificationCallback,\n options: DamNotificationListenerOptions = {}\n ) => {\n return eventBus.on(busListenerOf(callback, options))\n }\n\n return {\n addDamNotificationListener,\n }\n}\n"],"mappings":";;;;;;;;AAWA,IAAMA,IAAIC,GAEJC,IAA8BC,EAAI,EAAK,GAIzCC,IAAgD,KAAA,GAChDC,IAA0C,KAAA,GAC1CC,IAAmC,KAAA;AAGvC,SAASC,EAAgB,EAAE,SAASC,GAAc,kBAA6C;CAC7F,IAAMC,IAAUD,EAAa,SAEvBE,IAAWC,EAA4B,GAEzCC,GAGEC,UAAmB;EACvB,IAAI,CAACJ,GAAS;EACd,IAAM,EAAE,mBAAgBK,EAAU;EAElC,AADIF,KAAc,aAAaA,CAAY,GAC3C,IAAe,iBAAiB;GAC9B,EAAYZ,EAAE,2CAA2C,CAAC;EAC5D,GAAG,GAAI;CACT,GAEM,EAAE,SAAM,UAAO,cAAWe,EAAaP,EAAa,cAAc;EACtE,WAAW;EACX,WAAW;EAEX,aAAa;EACb,eAAe;GACb,SAAS;GACT,OAAO;GACP,UAAUK;EACZ;EACA,UAAU,GAAI,GAAO;GACnB,IAAI,CAACJ,GAAS;GACd,IAAMO,IAAU,KAAK,MAAMC,EAAM,IAAc,GACzCC,IAAOF,EAAQ,KAAK,SAAS,KAAK,MAAMA,EAAQ,IAAI,IAAI,KAAA;GAC9D,EAAS,KAAK;IAAE,MAAMA,EAAQ;IAAW;GAAK,GAAGG,CAAW;EAC9D;CACF,CAAC;CAGD,EAAMC,IAAS,MAAYC,EAA6BZ,KAAWa,MAAY,QAAQH,CAAW,GAAG;EACnG,WAAW;EACX,OAAO;CACT,CAAC;CAED,IAAMI,UAAwB;EAK5B,AAJA,AAE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vC,IAAiBC,EAAY,EAAI;CAEjC,IAAMC,IAAiCpC,EAAe,UACpDqB,EAAuBG,SAAe;EACpC,AAAIzB,MAAcqC,KAAQC,EAAgB;CAC5C,CAAC,CACH;CAIA,OAHA,IAAYD,GACZ,IAAeJ,GAERjC;AACT;AAEA,IAAMsC,UAAwB;CAK5B,AAJArC,GAAgB,KAAK,GACrB,EAA4B,QAAQ,IACpC,IAAY,KAAA,GACZ,IAAiB,KAAA,GACjB,IAAe,KAAA;AACjB;AAMA,SAAgBkC,IAA0B;CAExC,AADAnC,GAAW,QAAQ,GACnBsC,EAAgB;AAClB;AAcA,IAAMC,oBAAe,IAAI,QAA0E,GAC7FC,KAAiB,GAAmC,MAA4C;CACpG,IAAMP,IAAMC,EAAQ,MAAM,QAAQ,MAAMA,EAAQ,cAAc,aAC1DO,IAAaF,EAAa,IAAIG,CAAQ;CAC1C,AAAKD,MACH,oBAAa,IAAI,IAAI,GACrBF,EAAa,IAAIG,GAAUD,CAAU;CAEvC,IAAIE,IAAWF,EAAW,IAAIR,CAAG;CAWjC,OAVKU,MACH,KAAY,GAAO,MAAS;EAE1B,IAAMC,IAASC,KAAQ,CAAC,SAAS;EACjC,CAAKX,EAAQ,OAAQU,EAAO,SAASV,EAAQ,cAAc,SAAS,MAEpEQ,EAAS7B,GAAO,CAAC,GAAG+B,CAAM,CAAC;CAC7B,GACAH,EAAW,IAAIR,GAAKU,CAAQ,IAEvBA;AACT;AAEA,SAAgBG,IAAsB;CACpC,IAAMxC,IAAWC,EAA4B;CAe7C,OAAO,EACL,6BAPA,GACA,IAA0C,CAAC,MAEpCD,EAAS,GAAGkC,EAAcE,GAAUR,CAAO,CAAC,EAKrD;AACF"}
@@ -1,9 +1,9 @@
1
- /** Only `damNotifications.ts` calls this: the socket of the configurations `configNames` is open, or not. */
1
+ /** Only `damNotifications.ts` calls this. Sets whether the socket of `configNames` is open. */
2
2
  export declare const setDamNotificationsPushAlive: (alive: boolean, configNames: string[]) => void;
3
3
  /**
4
- * The notification socket of the DAM configuration `configName`: `isPushAlive()` while it is open, `false` for a
5
- * configuration without one. Left out, `default`'s, whatever component calls it (the name is not inherited).
6
- * `onChange` is called whenever any socket of the page opens or closes.
4
+ * Notification socket state of `configName`: `isPushAlive()` while open, `false` without a socket.
5
+ * Defaults to `default` regardless of the calling component. The name is not inherited.
6
+ * `onChange` fires whenever any socket of the page opens or closes.
7
7
  */
8
8
  export declare function useDamNotificationsConnection(configName?: string): {
9
9
  isPushAlive: () => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"damNotificationsConnection.js","names":["pushAlive","shallowRef","setDamNotificationsPushAlive","configNames","name","alive","next","useDamNotificationsConnection","configName","scope","effectScope","watch","callback"],"sources":["../../../../src/domains/dam/composables/damNotificationsConnection.ts"],"sourcesContent":["import { effectScope, shallowRef, watch } from 'vue'\n\n// Whether the notification socket of a DAM configuration is open, for the upload queues: with it alive they poll\n// only as a backup. A module of its own, with no options and no socket in it: a store reads the state without loading\n// either.\n\n// By the name of the configuration; one without a socket is not in it. A `Map`: a name such as `constructor` is no\n// property every object has.\nconst pushAlive = shallowRef(new Map<string, boolean>())\n\n/** Only `damNotifications.ts` calls this: the socket of the configurations `configNames` is open, or not. */\nexport const setDamNotificationsPushAlive = (alive: boolean, configNames: string[]) => {\n if (configNames.every((name) => (pushAlive.value.get(name) ?? false) === alive)) return\n const next = new Map(pushAlive.value)\n configNames.forEach((name) => next.set(name, alive))\n pushAlive.value = next\n}\n\n/**\n * The notification socket of the DAM configuration `configName`: `isPushAlive()` while it is open, `false` for a\n * configuration without one. Left out, `default`'s, whatever component calls it (the name is not inherited).\n * `onChange` is called whenever any socket of the page opens or closes.\n */\nexport function useDamNotificationsConnection(configName = 'default') {\n return {\n isPushAlive: () => pushAlive.value.get(configName) ?? false,\n onChange: (callback: () => void) => {\n // Detached: the caller subscribes with its first row, inside whatever scope is active then (a component\n // that adds a file), and listens for as long as it has rows.\n const scope = effectScope(true)\n scope.run(() => watch(pushAlive, () => callback(), { flush: 'sync' }))\n\n return () => scope.stop()\n },\n }\n}\n"],"mappings":";;AAQA,IAAMA,IAAYC,kBAAW,IAAI,IAAqB,CAAC,GAG1CC,KAAgC,GAAgB,MAA0B;CACrF,IAAIC,EAAY,OAAO,OAAUH,EAAU,MAAM,IAAII,CAAI,KAAK,QAAWC,CAAK,GAAG;CACjF,IAAMC,IAAO,IAAI,IAAIN,EAAU,KAAK;CAEpC,AADAG,EAAY,SAAS,MAASG,EAAK,IAAIF,GAAMC,CAAK,CAAC,GACnD,EAAU,QAAQC;AACpB;AAOA,SAAgBC,EAA8B,IAAa,WAAW;CACpE,OAAO;EACL,mBAAmBP,EAAU,MAAM,IAAIQ,CAAU,KAAK;EACtD,WAAW,MAAyB;GAGlC,IAAMC,IAAQC,EAAY,EAAI;GAG9B,OAFAD,EAAM,UAAUE,EAAMX,SAAiBY,EAAS,GAAG,EAAE,OAAO,OAAO,CAAC,CAAC,SAExDH,EAAM,KAAK;EAC1B;CACF;AACF"}
1
+ {"version":3,"file":"damNotificationsConnection.js","names":["pushAlive","shallowRef","setDamNotificationsPushAlive","configNames","name","alive","next","useDamNotificationsConnection","configName","scope","effectScope","watch","callback"],"sources":["../../../../src/domains/dam/composables/damNotificationsConnection.ts"],"sourcesContent":["import { effectScope, shallowRef, watch } from 'vue'\n\n// Whether a DAM configuration's notification socket is open. While it is, upload queues poll only as a backup.\n// Separate module with no options and no socket, so a store can read the state without loading either.\n\n// Keyed by configuration name. Configurations without a socket are absent.\n// A `Map`, so names like `constructor` do not hit object properties.\nconst pushAlive = shallowRef(new Map<string, boolean>())\n\n/** Only `damNotifications.ts` calls this. Sets whether the socket of `configNames` is open. */\nexport const setDamNotificationsPushAlive = (alive: boolean, configNames: string[]) => {\n if (configNames.every((name) => (pushAlive.value.get(name) ?? false) === alive)) return\n const next = new Map(pushAlive.value)\n configNames.forEach((name) => next.set(name, alive))\n pushAlive.value = next\n}\n\n/**\n * Notification socket state of `configName`: `isPushAlive()` while open, `false` without a socket.\n * Defaults to `default` regardless of the calling component. The name is not inherited.\n * `onChange` fires whenever any socket of the page opens or closes.\n */\nexport function useDamNotificationsConnection(configName = 'default') {\n return {\n isPushAlive: () => pushAlive.value.get(configName) ?? false,\n onChange: (callback: () => void) => {\n // Detached: the caller subscribes with its first row, inside whatever scope is\n // active (e.g. a component adding a file), and listens as long as it has rows.\n const scope = effectScope(true)\n scope.run(() => watch(pushAlive, () => callback(), { flush: 'sync' }))\n\n return () => scope.stop()\n },\n }\n}\n"],"mappings":";;AAOA,IAAMA,IAAYC,kBAAW,IAAI,IAAqB,CAAC,GAG1CC,KAAgC,GAAgB,MAA0B;CACrF,IAAIC,EAAY,OAAO,OAAUH,EAAU,MAAM,IAAII,CAAI,KAAK,QAAWC,CAAK,GAAG;CACjF,IAAMC,IAAO,IAAI,IAAIN,EAAU,KAAK;CAEpC,AADAG,EAAY,SAAS,MAASG,EAAK,IAAIF,GAAMC,CAAK,CAAC,GACnD,EAAU,QAAQC;AACpB;AAOA,SAAgBC,EAA8B,IAAa,WAAW;CACpE,OAAO;EACL,mBAAmBP,EAAU,MAAM,IAAIQ,CAAU,KAAK;EACtD,WAAW,MAAyB;GAGlC,IAAMC,IAAQC,EAAY,EAAI;GAG9B,OAFAD,EAAM,UAAUE,EAAMX,SAAiBY,EAAS,GAAG,EAAE,OAAO,OAAO,CAAC,CAAC,SAExDH,EAAM,KAAK;EAC1B;CACF;AACF"}
@@ -5,8 +5,8 @@ import { DamAssetTypeType, DamDistributionServiceName } from '../types/Asset';
5
5
  import { DamDistributionStatusType } from '../types/DamConfig';
6
6
  export declare const damNotificationsEventBusKey: EventBusKey<DamNotification>;
7
7
  /**
8
- * The notifications of every socket of the page. The payload of an event is the names of the DAM configurations of the
9
- * socket it came through; an event without it is taken for one of `default`'s.
8
+ * Notifications of every socket of the page. The payload is the configuration
9
+ * names of the source socket. Without it, the event counts as `default`'s.
10
10
  */
11
11
  export declare function useDamNotificationsEventBus(): import('@vueuse/core').UseEventBusReturn<DamNotification, string[]>;
12
12
  export declare const DamNotificationName: {
@@ -1 +1 @@
1
- {"version":3,"file":"damNotificationsEventBus.js","names":["damNotificationsEventBusKey","useDamNotificationsEventBus","useEventBus","DamNotificationName"],"sources":["../../../../src/domains/dam/composables/damNotificationsEventBus.ts"],"sourcesContent":["import { type EventBusKey, useEventBus } from '@vueuse/core'\nimport type { DocId } from '@/shared/types/common'\nimport type { AssetFileFailReasonType, AssetFileProcessStatusType } from '@/domains/dam/types/AssetFile'\nimport type { DamAssetTypeType, DamDistributionServiceName } from '@/domains/dam/types/Asset'\nimport type { DamDistributionStatusType } from '@/domains/dam/types/DamConfig'\n\nexport const damNotificationsEventBusKey: EventBusKey<DamNotification> = Symbol('anzu:damNotificationsEventBusKey')\n\n/**\n * The notifications of every socket of the page. The payload of an event is the names of the DAM configurations of the\n * socket it came through; an event without it is taken for one of `default`'s.\n */\nexport function useDamNotificationsEventBus() {\n return useEventBus<DamNotification, string[]>(damNotificationsEventBusKey)\n}\n\nexport const DamNotificationName = {\n AssetFileProcessed: 'asset_file_processed',\n AssetFileFailed: 'asset_file_failed',\n AssetFileDuplicate: 'asset_file_duplicate',\n AssetFileUploaded: 'asset_file_uploaded',\n AssetFileDeleted: 'asset_file_deleted',\n AssetMetadataProcessed: 'asset_metadata_processed',\n AssetDeleted: 'asset_deleted',\n DistributionDistributing: 'distribution_distributing',\n DistributionRemoteProcessing: 'distribution_remote_processing',\n DistributionDistributed: 'distribution_distributed',\n DistributionFailed: 'distribution_failed',\n DistributionAuthorized: 'distribution_authorized',\n UserUpdated: 'user_updated',\n AssetFileCopied: 'asset_file_copied',\n} as const\n\nexport type DamNotificationNameType = (typeof DamNotificationName)[keyof typeof DamNotificationName]\n\ntype DamNotificationEvent<T extends DamNotificationNameType, P> = {\n name: T\n data: P\n}\n\ninterface DamNotificationAssetFileData {\n id: DocId\n asset: DocId\n}\n\ninterface DamNotificationAssetFileStatusData {\n id: DocId\n asset: DocId\n status: AssetFileProcessStatusType\n failReason: AssetFileFailReasonType\n assetType: DamAssetTypeType\n originAssetFile: DocId\n}\n\ninterface DamNotificationDistributionData {\n id: DocId\n asset: DocId\n assetFile: DocId\n status: DamDistributionStatusType\n}\n\ninterface DamNotificationAssetData {\n asset: DocId\n}\n\ntype DamNotificationAssetFileProcessed = DamNotificationEvent<\n typeof DamNotificationName.AssetFileProcessed,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetFileFailed = DamNotificationEvent<\n typeof DamNotificationName.AssetFileFailed,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetFileDuplicate = DamNotificationEvent<\n typeof DamNotificationName.AssetFileDuplicate,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetFileUploaded = DamNotificationEvent<\n typeof DamNotificationName.AssetFileUploaded,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetFileDeleted = DamNotificationEvent<\n typeof DamNotificationName.AssetFileDeleted,\n DamNotificationAssetFileData\n>\n\ntype DamNotificationAssetMetadataProcessed = DamNotificationEvent<\n typeof DamNotificationName.AssetMetadataProcessed,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetDeleted = DamNotificationEvent<\n typeof DamNotificationName.AssetDeleted,\n DamNotificationAssetData\n>\n\ntype DamNotificationDistributionDistributing = DamNotificationEvent<\n typeof DamNotificationName.DistributionDistributing,\n DamNotificationDistributionData\n>\n\ntype DamNotificationDistributionRemoteProcessing = DamNotificationEvent<\n typeof DamNotificationName.DistributionRemoteProcessing,\n DamNotificationDistributionData\n>\n\ntype DamNotificationDistributionDistributed = DamNotificationEvent<\n typeof DamNotificationName.DistributionDistributed,\n DamNotificationDistributionData\n>\n\ntype DamNotificationDistributionFailed = DamNotificationEvent<\n typeof DamNotificationName.DistributionFailed,\n DamNotificationDistributionData\n>\n\ntype DamNotificationDistributionAuthorized = DamNotificationEvent<\n typeof DamNotificationName.DistributionAuthorized,\n {\n distributionService: DamDistributionServiceName\n success: boolean\n }\n>\n\ntype DamNotificationUserUpdated = DamNotificationEvent<typeof DamNotificationName.UserUpdated, undefined>\n\ntype DamNotificationAssetFileCopied = DamNotificationEvent<\n typeof DamNotificationName.AssetFileCopied,\n DamNotificationAssetFileStatusData\n>\n\nexport type DamNotification =\n | DamNotificationAssetFileProcessed\n | DamNotificationAssetFileFailed\n | DamNotificationAssetFileDuplicate\n | DamNotificationAssetFileUploaded\n | DamNotificationAssetFileDeleted\n | DamNotificationAssetMetadataProcessed\n | DamNotificationAssetDeleted\n | DamNotificationDistributionDistributing\n | DamNotificationDistributionRemoteProcessing\n | DamNotificationDistributionDistributed\n | DamNotificationDistributionFailed\n | DamNotificationDistributionAuthorized\n | DamNotificationUserUpdated\n | DamNotificationAssetFileCopied\n"],"mappings":";;AAMA,IAAaA,IAA4D,OAAO,kCAAkC;AAMlH,SAAgBC,IAA8B;CAC5C,OAAOC,EAAuCF,CAA2B;AAC3E;AAEA,IAAaG,IAAsB;CACjC,oBAAoB;CACpB,iBAAiB;CACjB,oBAAoB;CACpB,mBAAmB;CACnB,kBAAkB;CAClB,wBAAwB;CACxB,cAAc;CACd,0BAA0B;CAC1B,8BAA8B;CAC9B,yBAAyB;CACzB,oBAAoB;CACpB,wBAAwB;CACxB,aAAa;CACb,iBAAiB;AACnB"}
1
+ {"version":3,"file":"damNotificationsEventBus.js","names":["damNotificationsEventBusKey","useDamNotificationsEventBus","useEventBus","DamNotificationName"],"sources":["../../../../src/domains/dam/composables/damNotificationsEventBus.ts"],"sourcesContent":["import { type EventBusKey, useEventBus } from '@vueuse/core'\nimport type { DocId } from '@/shared/types/common'\nimport type { AssetFileFailReasonType, AssetFileProcessStatusType } from '@/domains/dam/types/AssetFile'\nimport type { DamAssetTypeType, DamDistributionServiceName } from '@/domains/dam/types/Asset'\nimport type { DamDistributionStatusType } from '@/domains/dam/types/DamConfig'\n\nexport const damNotificationsEventBusKey: EventBusKey<DamNotification> = Symbol('anzu:damNotificationsEventBusKey')\n\n/**\n * Notifications of every socket of the page. The payload is the configuration\n * names of the source socket. Without it, the event counts as `default`'s.\n */\nexport function useDamNotificationsEventBus() {\n return useEventBus<DamNotification, string[]>(damNotificationsEventBusKey)\n}\n\nexport const DamNotificationName = {\n AssetFileProcessed: 'asset_file_processed',\n AssetFileFailed: 'asset_file_failed',\n AssetFileDuplicate: 'asset_file_duplicate',\n AssetFileUploaded: 'asset_file_uploaded',\n AssetFileDeleted: 'asset_file_deleted',\n AssetMetadataProcessed: 'asset_metadata_processed',\n AssetDeleted: 'asset_deleted',\n DistributionDistributing: 'distribution_distributing',\n DistributionRemoteProcessing: 'distribution_remote_processing',\n DistributionDistributed: 'distribution_distributed',\n DistributionFailed: 'distribution_failed',\n DistributionAuthorized: 'distribution_authorized',\n UserUpdated: 'user_updated',\n AssetFileCopied: 'asset_file_copied',\n} as const\n\nexport type DamNotificationNameType = (typeof DamNotificationName)[keyof typeof DamNotificationName]\n\ntype DamNotificationEvent<T extends DamNotificationNameType, P> = {\n name: T\n data: P\n}\n\ninterface DamNotificationAssetFileData {\n id: DocId\n asset: DocId\n}\n\ninterface DamNotificationAssetFileStatusData {\n id: DocId\n asset: DocId\n status: AssetFileProcessStatusType\n failReason: AssetFileFailReasonType\n assetType: DamAssetTypeType\n originAssetFile: DocId\n}\n\ninterface DamNotificationDistributionData {\n id: DocId\n asset: DocId\n assetFile: DocId\n status: DamDistributionStatusType\n}\n\ninterface DamNotificationAssetData {\n asset: DocId\n}\n\ntype DamNotificationAssetFileProcessed = DamNotificationEvent<\n typeof DamNotificationName.AssetFileProcessed,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetFileFailed = DamNotificationEvent<\n typeof DamNotificationName.AssetFileFailed,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetFileDuplicate = DamNotificationEvent<\n typeof DamNotificationName.AssetFileDuplicate,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetFileUploaded = DamNotificationEvent<\n typeof DamNotificationName.AssetFileUploaded,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetFileDeleted = DamNotificationEvent<\n typeof DamNotificationName.AssetFileDeleted,\n DamNotificationAssetFileData\n>\n\ntype DamNotificationAssetMetadataProcessed = DamNotificationEvent<\n typeof DamNotificationName.AssetMetadataProcessed,\n DamNotificationAssetFileStatusData\n>\n\ntype DamNotificationAssetDeleted = DamNotificationEvent<\n typeof DamNotificationName.AssetDeleted,\n DamNotificationAssetData\n>\n\ntype DamNotificationDistributionDistributing = DamNotificationEvent<\n typeof DamNotificationName.DistributionDistributing,\n DamNotificationDistributionData\n>\n\ntype DamNotificationDistributionRemoteProcessing = DamNotificationEvent<\n typeof DamNotificationName.DistributionRemoteProcessing,\n DamNotificationDistributionData\n>\n\ntype DamNotificationDistributionDistributed = DamNotificationEvent<\n typeof DamNotificationName.DistributionDistributed,\n DamNotificationDistributionData\n>\n\ntype DamNotificationDistributionFailed = DamNotificationEvent<\n typeof DamNotificationName.DistributionFailed,\n DamNotificationDistributionData\n>\n\ntype DamNotificationDistributionAuthorized = DamNotificationEvent<\n typeof DamNotificationName.DistributionAuthorized,\n {\n distributionService: DamDistributionServiceName\n success: boolean\n }\n>\n\ntype DamNotificationUserUpdated = DamNotificationEvent<typeof DamNotificationName.UserUpdated, undefined>\n\ntype DamNotificationAssetFileCopied = DamNotificationEvent<\n typeof DamNotificationName.AssetFileCopied,\n DamNotificationAssetFileStatusData\n>\n\nexport type DamNotification =\n | DamNotificationAssetFileProcessed\n | DamNotificationAssetFileFailed\n | DamNotificationAssetFileDuplicate\n | DamNotificationAssetFileUploaded\n | DamNotificationAssetFileDeleted\n | DamNotificationAssetMetadataProcessed\n | DamNotificationAssetDeleted\n | DamNotificationDistributionDistributing\n | DamNotificationDistributionRemoteProcessing\n | DamNotificationDistributionDistributed\n | DamNotificationDistributionFailed\n | DamNotificationDistributionAuthorized\n | DamNotificationUserUpdated\n | DamNotificationAssetFileCopied\n"],"mappings":";;AAMA,IAAaA,IAA4D,OAAO,kCAAkC;AAMlH,SAAgBC,IAA8B;CAC5C,OAAOC,EAAuCF,CAA2B;AAC3E;AAEA,IAAaG,IAAsB;CACjC,oBAAoB;CACpB,iBAAiB;CACjB,oBAAoB;CACpB,mBAAmB;CACnB,kBAAkB;CAClB,wBAAwB;CACxB,cAAc;CACd,0BAA0B;CAC1B,8BAA8B;CAC9B,yBAAyB;CACzB,oBAAoB;CACpB,wBAAwB;CACxB,aAAa;CACb,iBAAiB;AACnB"}
@@ -1,9 +1,10 @@
1
1
  import { Ref } from 'vue';
2
2
  /**
3
- * The ext system the caches of the names of authors and keywords of the DAM configuration `configName` ask under,
4
- * written by the image widgets and the asset select of that configuration; an application that shows names of it
5
- * outside them writes it itself. A name left out is the inherited one while a component sets up, renders or runs a
6
- * lifecycle hook (not after an `await` there), else `default`.
3
+ * Ext system the author and keyword name caches of `configName` use.
4
+ * The image widgets and asset select of that configuration set it.
5
+ * An app showing those names elsewhere sets it itself.
6
+ * Without a name, uses the inherited one during component setup,
7
+ * render or a lifecycle hook (not after an `await`), else `default`.
7
8
  */
8
9
  export declare function useExtSystemIdForCached(configName?: string): {
9
10
  cachedExtSystemId: Ref<number, number>;
@@ -1 +1 @@
1
- {"version":3,"file":"extSystemIdForCached.js","names":["cachedExtSystemIds","ref","useExtSystemIdForCached","name","inheritedDamConfigName","configName","cachedExtSystemId"],"sources":["../../../../src/domains/dam/composables/extSystemIdForCached.ts"],"sourcesContent":["import { type Ref, ref } from 'vue'\nimport type { IntegerId } from '@/shared/types/common'\nimport { inheritedDamConfigName } from '@/domains/dam/composables/damConfigName'\n\n// The ext system the caches of names of each DAM configuration ask under: the last one written for that name, as the\n// widgets and the asset select write it. Two names never share one.\nconst cachedExtSystemIds = new Map<string, Ref<IntegerId>>([['default', ref<IntegerId>(0)]])\n\n/**\n * The ext system the caches of the names of authors and keywords of the DAM configuration `configName` ask under,\n * written by the image widgets and the asset select of that configuration; an application that shows names of it\n * outside them writes it itself. A name left out is the inherited one while a component sets up, renders or runs a\n * lifecycle hook (not after an `await` there), else `default`.\n */\nexport function useExtSystemIdForCached(configName?: string) {\n const name = inheritedDamConfigName(configName)\n let cachedExtSystemId = cachedExtSystemIds.get(name)\n if (!cachedExtSystemId) {\n cachedExtSystemId = ref<IntegerId>(0)\n cachedExtSystemIds.set(name, cachedExtSystemId)\n }\n\n return {\n cachedExtSystemId,\n }\n}\n"],"mappings":";;;AAMA,IAAMA,oBAAqB,IAAI,IAA4B,CAAC,CAAC,WAAWC,EAAe,CAAC,CAAC,CAAC,CAAC;AAQ3F,SAAgBC,EAAwB,GAAqB;CAC3D,IAAMC,IAAOC,EAAuBC,CAAU,GAC1CC,IAAoBN,EAAmB,IAAIG,CAAI;CAMnD,OALKG,MACH,IAAoBL,EAAe,CAAC,GACpCD,EAAmB,IAAIG,GAAMG,CAAiB,IAGzC,EACL,qBACF;AACF"}
1
+ {"version":3,"file":"extSystemIdForCached.js","names":["cachedExtSystemIds","ref","useExtSystemIdForCached","name","inheritedDamConfigName","configName","cachedExtSystemId"],"sources":["../../../../src/domains/dam/composables/extSystemIdForCached.ts"],"sourcesContent":["import { type Ref, ref } from 'vue'\nimport type { IntegerId } from '@/shared/types/common'\nimport { inheritedDamConfigName } from '@/domains/dam/composables/damConfigName'\n\n// Ext system the name caches of each DAM configuration use. The\n// widgets and the asset select set it. Names never share one.\nconst cachedExtSystemIds = new Map<string, Ref<IntegerId>>([['default', ref<IntegerId>(0)]])\n\n/**\n * Ext system the author and keyword name caches of `configName` use.\n * The image widgets and asset select of that configuration set it.\n * An app showing those names elsewhere sets it itself.\n * Without a name, uses the inherited one during component setup,\n * render or a lifecycle hook (not after an `await`), else `default`.\n */\nexport function useExtSystemIdForCached(configName?: string) {\n const name = inheritedDamConfigName(configName)\n let cachedExtSystemId = cachedExtSystemIds.get(name)\n if (!cachedExtSystemId) {\n cachedExtSystemId = ref<IntegerId>(0)\n cachedExtSystemIds.set(name, cachedExtSystemId)\n }\n\n return {\n cachedExtSystemId,\n }\n}\n"],"mappings":";;;AAMA,IAAMA,oBAAqB,IAAI,IAA4B,CAAC,CAAC,WAAWC,EAAe,CAAC,CAAC,CAAC,CAAC;AAS3F,SAAgBC,EAAwB,GAAqB;CAC3D,IAAMC,IAAOC,EAAuBC,CAAU,GAC1CC,IAAoBN,EAAmB,IAAIG,CAAI;CAMnD,OALKG,MACH,IAAoBL,EAAe,CAAC,GACpCD,EAAmB,IAAIG,GAAMG,CAAiB,IAGzC,EACL,qBACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"damAssetCustomFormApi.js","names":["ENTITY","fetchAssetCustomFormElements","DAM_END_POINT_ASSET_CUSTOM_FORM","useApiFetchItems","damClient","SYSTEM_CORE_DAM","endPoint","execute","fetchDistributionCustomFormElements"],"sources":["../../../../../src/domains/dam/config/api/damAssetCustomFormApi.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport type { DamAssetTypeType, DamDistributionServiceName } from '@/domains/dam/types/Asset'\nimport type { CustomDataFormElement } from '@/domains/customDataForm/types/CustomDataForm'\n\nimport { SYSTEM_CORE_DAM } from '@/domains/dam/api/damConstants'\nimport { useApiFetchItems } from '@/domains/api/composables/useApiFetchItems'\nimport { DAM_END_POINT_ASSET_CUSTOM_FORM } from '@/domains/dam/api/damEndPoints'\n\nconst ENTITY = 'assetCustomForm'\n\n// `endPoint`: the address of the custom forms the caller goes by; the default one where it gives none.\n\n// todo limit set to 100 for now, add load for pagination?\nexport const fetchAssetCustomFormElements = (\n damClient: () => AxiosInstance,\n extSystem: IntegerId,\n assetType: DamAssetTypeType,\n endPoint: string = DAM_END_POINT_ASSET_CUSTOM_FORM\n) => {\n const { execute } = useApiFetchItems<CustomDataFormElement>({\n client: damClient,\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + '/ext-system/:extSystem/type/:assetType/element?order[position]=asc&limit=100',\n })\n\n return execute({ urlParams: { extSystem, assetType } })\n}\n\n// todo limit set to 100 for now, add load for pagination?\nexport const fetchDistributionCustomFormElements = (\n damClient: () => AxiosInstance,\n distributionService: DamDistributionServiceName,\n endPoint: string = DAM_END_POINT_ASSET_CUSTOM_FORM\n) => {\n const { execute } = useApiFetchItems<CustomDataFormElement>({\n client: damClient,\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + '/distribution-service/:distributionService/element?order[position]=asc&limit=100',\n })\n\n return execute({ urlParams: { distributionService } })\n}\n"],"mappings":";;;;AASA,IAAMA,IAAS,mBAKFC,KACX,GACA,GACA,GACA,IAAmBC,MAChB;CACH,IAAM,EAAE,eAAYC,EAAwC;EAC1D,QAAQC;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM,IAAW;CAC1B,CAAC;CAED,OAAOC,EAAQ,EAAE,WAAW;EAAE;EAAW;CAAU,EAAE,CAAC;AACxD,GAGaC,KACX,GACA,GACA,IAAmBN,MAChB;CACH,IAAM,EAAE,eAAYC,EAAwC;EAC1D,QAAQC;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM,IAAW;CAC1B,CAAC;CAED,OAAOC,EAAQ,EAAE,WAAW,EAAE,uBAAoB,EAAE,CAAC;AACvD"}
1
+ {"version":3,"file":"damAssetCustomFormApi.js","names":["ENTITY","fetchAssetCustomFormElements","DAM_END_POINT_ASSET_CUSTOM_FORM","useApiFetchItems","damClient","SYSTEM_CORE_DAM","endPoint","execute","fetchDistributionCustomFormElements"],"sources":["../../../../../src/domains/dam/config/api/damAssetCustomFormApi.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport type { DamAssetTypeType, DamDistributionServiceName } from '@/domains/dam/types/Asset'\nimport type { CustomDataFormElement } from '@/domains/customDataForm/types/CustomDataForm'\n\nimport { SYSTEM_CORE_DAM } from '@/domains/dam/api/damConstants'\nimport { useApiFetchItems } from '@/domains/api/composables/useApiFetchItems'\nimport { DAM_END_POINT_ASSET_CUSTOM_FORM } from '@/domains/dam/api/damEndPoints'\n\nconst ENTITY = 'assetCustomForm'\n\n// `endPoint`: custom forms address. Defaults when not given.\n\n// todo limit set to 100 for now, add load for pagination?\nexport const fetchAssetCustomFormElements = (\n damClient: () => AxiosInstance,\n extSystem: IntegerId,\n assetType: DamAssetTypeType,\n endPoint: string = DAM_END_POINT_ASSET_CUSTOM_FORM\n) => {\n const { execute } = useApiFetchItems<CustomDataFormElement>({\n client: damClient,\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + '/ext-system/:extSystem/type/:assetType/element?order[position]=asc&limit=100',\n })\n\n return execute({ urlParams: { extSystem, assetType } })\n}\n\n// todo limit set to 100 for now, add load for pagination?\nexport const fetchDistributionCustomFormElements = (\n damClient: () => AxiosInstance,\n distributionService: DamDistributionServiceName,\n endPoint: string = DAM_END_POINT_ASSET_CUSTOM_FORM\n) => {\n const { execute } = useApiFetchItems<CustomDataFormElement>({\n client: damClient,\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + '/distribution-service/:distributionService/element?order[position]=asc&limit=100',\n })\n\n return execute({ urlParams: { distributionService } })\n}\n"],"mappings":";;;;AASA,IAAMA,IAAS,mBAKFC,KACX,GACA,GACA,GACA,IAAmBC,MAChB;CACH,IAAM,EAAE,eAAYC,EAAwC;EAC1D,QAAQC;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM,IAAW;CAC1B,CAAC;CAED,OAAOC,EAAQ,EAAE,WAAW;EAAE;EAAW;CAAU,EAAE,CAAC;AACxD,GAGaC,KACX,GACA,GACA,IAAmBN,MAChB;CACH,IAAM,EAAE,eAAYC,EAAwC;EAC1D,QAAQC;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM,IAAW;CAC1B,CAAC;CAED,OAAOC,EAAQ,EAAE,WAAW,EAAE,uBAAoB,EAAE,CAAC;AACvD"}
@@ -1 +1 @@
1
- {"version":3,"file":"damConfigApi.js","names":["ENTITY","fetchPubConfiguration","DAM_END_POINT_PUB_CONFIGURATION","useApiRequest","damClient","SYSTEM_CORE_DAM","endPoint","execute","fetchConfiguration","DAM_END_POINT_CONFIGURATION","fetchExtSystemConfiguration"],"sources":["../../../../../src/domains/dam/config/api/damConfigApi.ts"],"sourcesContent":["import type { DamExtSystemConfig, DamPrvConfig, DamPubConfig } from '@/domains/dam/types/DamConfig'\nimport type { AxiosInstance } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport { SYSTEM_CORE_DAM } from '@/domains/dam/api/damConstants'\nimport { useApiRequest } from '@/domains/api/composables/useApiRequest'\nimport { DAM_END_POINT_CONFIGURATION, DAM_END_POINT_PUB_CONFIGURATION } from '@/domains/dam/api/damEndPoints'\n\nconst ENTITY = 'settings'\n\n// `endPoint`: the address of the configuration of DAM the caller goes by; the default one where it gives none.\n\nexport const fetchPubConfiguration = (\n damClient: () => AxiosInstance,\n endPoint: string = DAM_END_POINT_PUB_CONFIGURATION\n) => {\n const { execute } = useApiRequest<DamPubConfig, null>({\n client: damClient,\n method: 'GET',\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint,\n })\n\n return execute()\n}\n\nexport const fetchConfiguration = (damClient: () => AxiosInstance, endPoint: string = DAM_END_POINT_CONFIGURATION) => {\n const { execute } = useApiRequest<DamPrvConfig, null>({\n client: damClient,\n method: 'GET',\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint,\n })\n\n return execute()\n}\n\n// The id goes through `urlParams` rather than into the string, because that is the shape the rest\n// of the migrated calls use. It does not bring the call under `anzu/url-params-match-template`:\n// that rule wants `urlTemplate` and `urlParams` in one object literal, and every call here passes\n// `urlParams` to `execute` instead, so the rule checks none of them either way.\nexport const fetchExtSystemConfiguration = (\n extSystem: IntegerId,\n damClient: () => AxiosInstance,\n endPoint: string = DAM_END_POINT_CONFIGURATION\n) => {\n const { execute } = useApiRequest<DamExtSystemConfig, null>({\n client: damClient,\n method: 'GET',\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + '/ext-system/:extSystem',\n })\n\n return execute({ urlParams: { extSystem } })\n}\n"],"mappings":";;;;AAOA,IAAMA,IAAS,YAIFC,KACX,GACA,IAAmBC,MAChB;CACH,IAAM,EAAE,eAAYC,EAAkC;EACpD,QAAQC;EACR,QAAQ;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM;CACf,CAAC;CAED,OAAOC,EAAQ;AACjB,GAEaC,KAAsB,GAAgC,IAAmBC,MAAgC;CACpH,IAAM,EAAE,eAAYN,EAAkC;EACpD,QAAQC;EACR,QAAQ;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM;CACf,CAAC;CAED,OAAOC,EAAQ;AACjB,GAMaG,KACX,GACA,GACA,IAAmBD,MAChB;CACH,IAAM,EAAE,eAAYN,EAAwC;EAC1D,QAAQC;EACR,QAAQ;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM,IAAW;CAC1B,CAAC;CAED,OAAOC,EAAQ,EAAE,WAAW,EAAE,aAAU,EAAE,CAAC;AAC7C"}
1
+ {"version":3,"file":"damConfigApi.js","names":["ENTITY","fetchPubConfiguration","DAM_END_POINT_PUB_CONFIGURATION","useApiRequest","damClient","SYSTEM_CORE_DAM","endPoint","execute","fetchConfiguration","DAM_END_POINT_CONFIGURATION","fetchExtSystemConfiguration"],"sources":["../../../../../src/domains/dam/config/api/damConfigApi.ts"],"sourcesContent":["import type { DamExtSystemConfig, DamPrvConfig, DamPubConfig } from '@/domains/dam/types/DamConfig'\nimport type { AxiosInstance } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport { SYSTEM_CORE_DAM } from '@/domains/dam/api/damConstants'\nimport { useApiRequest } from '@/domains/api/composables/useApiRequest'\nimport { DAM_END_POINT_CONFIGURATION, DAM_END_POINT_PUB_CONFIGURATION } from '@/domains/dam/api/damEndPoints'\n\nconst ENTITY = 'settings'\n\n// `endPoint`: DAM configuration address. Defaults when not given.\n\nexport const fetchPubConfiguration = (\n damClient: () => AxiosInstance,\n endPoint: string = DAM_END_POINT_PUB_CONFIGURATION\n) => {\n const { execute } = useApiRequest<DamPubConfig, null>({\n client: damClient,\n method: 'GET',\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint,\n })\n\n return execute()\n}\n\nexport const fetchConfiguration = (damClient: () => AxiosInstance, endPoint: string = DAM_END_POINT_CONFIGURATION) => {\n const { execute } = useApiRequest<DamPrvConfig, null>({\n client: damClient,\n method: 'GET',\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint,\n })\n\n return execute()\n}\n\n// The id goes through `urlParams` to match the other migrated calls.\n// `anzu/url-params-match-template` does not check these calls: it needs `urlTemplate`\n// and `urlParams` in one object literal, and here `urlParams` goes to `execute`.\nexport const fetchExtSystemConfiguration = (\n extSystem: IntegerId,\n damClient: () => AxiosInstance,\n endPoint: string = DAM_END_POINT_CONFIGURATION\n) => {\n const { execute } = useApiRequest<DamExtSystemConfig, null>({\n client: damClient,\n method: 'GET',\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + '/ext-system/:extSystem',\n })\n\n return execute({ urlParams: { extSystem } })\n}\n"],"mappings":";;;;AAOA,IAAMA,IAAS,YAIFC,KACX,GACA,IAAmBC,MAChB;CACH,IAAM,EAAE,eAAYC,EAAkC;EACpD,QAAQC;EACR,QAAQ;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM;CACf,CAAC;CAED,OAAOC,EAAQ;AACjB,GAEaC,KAAsB,GAAgC,IAAmBC,MAAgC;CACpH,IAAM,EAAE,eAAYN,EAAkC;EACpD,QAAQC;EACR,QAAQ;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM;CACf,CAAC;CAED,OAAOC,EAAQ;AACjB,GAKaG,KACX,GACA,GACA,IAAmBD,MAChB;CACH,IAAM,EAAE,eAAYN,EAAwC;EAC1D,QAAQC;EACR,QAAQ;EACR,QAAQC;EACR,QAAQL;EACR,aAAaM,IAAW;CAC1B,CAAC;CAED,OAAOC,EAAQ,EAAE,WAAW,EAAE,aAAU,EAAE,CAAC;AAC7C"}
@@ -4,11 +4,11 @@ import { DamAssetTypeType, DamDistributionServiceName } from '../../types/Asset'
4
4
  import { DamConfigLicenceExtSystemReturnType, DamExtSystemConfig } from '../../types/DamConfig';
5
5
  import { AxiosInstance } from 'axios';
6
6
  /**
7
- * Loads into and reads from the DAM configuration store of `configName` (`useDamConfigStoreOf`); a name left out is
8
- * the inherited one in a component's setup, else `default`. Without a client nothing loads. It loads from the
9
- * addresses that configuration sets (`endPointConfiguration`, `endPointPubConfiguration`, `endPointAssetLicence`,
10
- * `endPointAssetCustomForm`), the default ones where it sets none or the plugin is not configured yet. Once the plugin
11
- * has set the options, a configuration the application has not got throws, as the caches of names do.
7
+ * Loads into and reads from the DAM configuration store of `configName` (`useDamConfigStoreOf`).
8
+ * Without a name, uses the inherited one in component setup, else `default`.
9
+ * Without a client nothing loads. Uses that configuration's endpoints (`endPointConfiguration`,
10
+ * `endPointPubConfiguration`, `endPointAssetLicence`, `endPointAssetCustomForm`), or defaults.
11
+ * After the plugin sets options, an unknown configuration throws, as the name caches do.
12
12
  */
13
13
  export declare function useDamConfigState(client?: undefined | (() => AxiosInstance), configName?: string): {
14
14
  getOrLoadDamConfigExtSystemByLicences: (licences: IntegerId[]) => Promise<DamConfigLicenceExtSystemReturnType[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"damConfigState.js","names":["customFormTypesNotLoaded","useDamConfigState","name","inheritedDamConfigName","configName","damConfigStore","useDamConfigStoreOf","endPoints","damEndPointsOf","onConfigError","error","loadDamPubConfig","isUndefined","client","reject","fetchPubConfiguration","config","setDamPubConfig","resolve","err","data","loadDamPrvConfig","fetchConfiguration","setDamPrvConfig","loadDamConfigExtSystem","fetchExtSystemConfiguration","extSystemId","setDamConfigExtSystem","loadDamConfigAssetCustomFormElements","DamAssetType","promises","types","fetchAssetCustomFormElements","type","endPointAssetCustomForm","loadedTypes","loadedResponses","failedTypes","result","index","anyField","fields","setDamConfigAssetCustomFormElements","storedConfig","responses","notLoadedBefore","failedNotLoaded","notLoaded","loadDamConfigDistributionCustomFormElements","distributionServiceName","fetchDistributionCustomFormElements","res","isDamPubConfigLoaded","isDamPrvConfigLoaded","getDamConfigExtSystem","getDamConfigAssetCustomFormElements","assetType","getOrLoadDamConfigExtSystemByLicences","licences","getOrLoadDamConfigExtSystemByLicence","licence","foundLicenceConfig","licenceRes","fetchDamAssetLicence","isNull","foundExtSystemConfig","cloneDeep","getExtSystemByLicence","cached"],"sources":["../../../../../src/domains/dam/config/composables/damConfigState.ts"],"sourcesContent":["import type { CustomDataFormElement } from '@/domains/customDataForm/types/CustomDataForm'\nimport { fetchDamAssetLicence } from '@/domains/dam/api/damAssetLicenceApi'\nimport {\n fetchAssetCustomFormElements,\n fetchDistributionCustomFormElements,\n} from '@/domains/dam/config/api/damAssetCustomFormApi'\nimport {\n fetchConfiguration,\n fetchExtSystemConfiguration,\n fetchPubConfiguration,\n} from '@/domains/dam/config/api/damConfigApi'\nimport { useDamConfigStoreOf } from '@/domains/dam/config/store/damConfigStore'\nimport { checkDamConfigName, inheritedDamConfigName } from '@/domains/dam/composables/damConfigName'\nimport { damEndPointsOf } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport type { IntegerId } from '@/shared/types/common'\nimport { DamAssetType, type DamAssetTypeType, type DamDistributionServiceName } from '@/domains/dam/types/Asset'\nimport type {\n DamConfigLicenceExtSystemReturnType,\n DamExtSystemConfig,\n DamPrvConfig,\n DamPubConfig,\n} from '@/domains/dam/types/DamConfig'\nimport { cloneDeep, isNull, isUndefined } from '@/shared/utils/common'\nimport type { AxiosInstance } from 'axios'\n\n// The types of asset whose custom fields are not loaded, by the custom fields of an ext system the loader stored: their\n// read failed beside reads that answered. Those stay `[]` there, as the store has always held them, and are read again\n// where they are needed. By the stored object, not by the ext system: one an application writes into the store itself\n// has every type loaded.\nconst customFormTypesNotLoaded = new WeakMap<object, ReadonlySet<DamAssetTypeType>>()\n\n/**\n * Loads into and reads from the DAM configuration store of `configName` (`useDamConfigStoreOf`); a name left out is\n * the inherited one in a component's setup, else `default`. Without a client nothing loads. It loads from the\n * addresses that configuration sets (`endPointConfiguration`, `endPointPubConfiguration`, `endPointAssetLicence`,\n * `endPointAssetCustomForm`), the default ones where it sets none or the plugin is not configured yet. Once the plugin\n * has set the options, a configuration the application has not got throws, as the caches of names do.\n */\nexport function useDamConfigState(client: undefined | (() => AxiosInstance) = undefined, configName?: string) {\n const name = inheritedDamConfigName(configName)\n checkDamConfigName(name)\n const damConfigStore = useDamConfigStoreOf(name)\n // Read when a request is made.\n const endPoints = () => damEndPointsOf(name)\n\n function onConfigError(error: Error) {\n console.error(error)\n }\n\n function loadDamPubConfig() {\n return new Promise((resolve, reject) => {\n damConfigStore.initialized.damPubConfig = false\n if (isUndefined(client)) {\n reject(false)\n return\n }\n fetchPubConfiguration(client, endPoints().endPointPubConfiguration)\n .then((config) => {\n if (Object.keys(config).length < 1) {\n throw new Error('Unable to load pub config. Incorrect response body.')\n }\n setDamPubConfig(config)\n resolve(true)\n })\n .catch((err) => {\n onConfigError(err)\n reject(false)\n })\n })\n }\n\n function setDamPubConfig(data: DamPubConfig) {\n try {\n damConfigStore.damPubConfig.userAuthType = data.userAuthType\n damConfigStore.initialized.damPubConfig = true\n } catch (err) {\n throw new Error('Unable to load dam pub config. Incorrect fields in json.')\n }\n }\n\n function loadDamPrvConfig() {\n return new Promise((resolve, reject) => {\n if (isUndefined(client)) {\n reject(false)\n return\n }\n fetchConfiguration(client, endPoints().endPointConfiguration)\n .then((config) => {\n if (Object.keys(config).length < 1) {\n throw new Error('Unable to load dam prv config. Incorrect response body.')\n }\n setDamPrvConfig(config)\n resolve(true)\n })\n .catch((err) => {\n onConfigError(err)\n reject(false)\n })\n })\n }\n\n function setDamPrvConfig(data: DamPrvConfig) {\n try {\n damConfigStore.damPrvConfig.settings = data.settings\n damConfigStore.damPrvConfig.colorSet = data.colorSet\n damConfigStore.damPrvConfig.assetExternalProviders = data.assetExternalProviders\n damConfigStore.damPrvConfig.distributionServices = data.distributionServices\n damConfigStore.initialized.damPrvConfig = true\n } catch (err) {\n throw new Error('Unable to load dam config. Incorrect fields in json.')\n }\n }\n\n function loadDamConfigExtSystem(extSystemId: IntegerId) {\n return new Promise((resolve, reject) => {\n if (isUndefined(client)) {\n reject(false)\n return\n }\n fetchExtSystemConfiguration(extSystemId, client, endPoints().endPointConfiguration)\n .then((config) => {\n if (Object.keys(config).length < 1) {\n throw new Error('Unable to load dam ext system config. Incorrect response body.')\n }\n setDamConfigExtSystem(config, extSystemId)\n resolve(true)\n })\n .catch((err) => {\n onConfigError(err)\n reject(false)\n })\n })\n }\n\n function setDamConfigExtSystem(data: DamExtSystemConfig, extSystemId: IntegerId) {\n try {\n const config = {\n assetExternalProviders: data.assetExternalProviders,\n audio: data.audio,\n document: data.document,\n image: data.image,\n video: data.video,\n }\n damConfigStore.damConfigExtSystem.set(extSystemId, config)\n } catch (err) {\n throw new Error('Unable to load dam ext system config. Incorrect fields in json.')\n }\n }\n\n function loadDamConfigAssetCustomFormElements(\n extSystemId: IntegerId,\n types: DamAssetTypeType[] = [DamAssetType.Image, DamAssetType.Audio, DamAssetType.Video, DamAssetType.Document]\n ) {\n return new Promise((resolve, reject) => {\n if (isUndefined(client)) {\n reject(false)\n return\n }\n const { endPointAssetCustomForm } = endPoints()\n const promises = types.map((type) =>\n fetchAssetCustomFormElements(client, extSystemId, type, endPointAssetCustomForm)\n )\n\n // allSettled: one unavailable type must not discard the successfully loaded ones.\n Promise.allSettled(promises)\n .then((results) => {\n const loadedTypes: DamAssetTypeType[] = []\n const loadedResponses: CustomDataFormElement[][] = []\n const failedTypes: DamAssetTypeType[] = []\n\n // A read that answers is loaded, also when it brings no field: an ext system may have none for a type, or\n // for any, and that is its configuration. Counted as failed, an ext system without a custom field never\n // had one, and whatever waits for it said it could not be loaded.\n results.forEach((result, index) => {\n if (result.status === 'fulfilled') {\n loadedTypes.push(types[index]!)\n loadedResponses.push(result.value)\n return\n }\n failedTypes.push(types[index]!)\n })\n\n // A read that failed beside reads that answered with no field: nothing tells an ext system without a field\n // from one whose fields are in the very part that failed. Not loaded, as before.\n const anyField = loadedResponses.some((fields) => fields.length > 0)\n if (types.length > 0 && (loadedTypes.length === 0 || (failedTypes.length > 0 && !anyField))) {\n throw new Error('Unable to load asset custom form config. Incorrect response body.')\n }\n setDamConfigAssetCustomFormElements(loadedResponses, extSystemId, loadedTypes, failedTypes)\n if (failedTypes.length > 0) {\n onConfigError(new Error(`Unable to load asset custom form config for: ${failedTypes.join(', ')}.`))\n }\n resolve(true)\n })\n .catch((err) => {\n onConfigError(err)\n reject(false)\n })\n })\n }\n\n function setDamConfigAssetCustomFormElements(\n responses: CustomDataFormElement[][],\n extSystemId: IntegerId,\n types: DamAssetTypeType[],\n failedTypes: DamAssetTypeType[] = []\n ) {\n try {\n const storedConfig = damConfigStore.damConfigAssetCustomFormElements.get(extSystemId)\n const existingConfig = storedConfig || {\n image: [],\n audio: [],\n video: [],\n document: [],\n }\n\n const config = { ...existingConfig }\n\n types.forEach((type, index) => {\n config[type] = responses[index]!\n })\n\n // Not loaded: the types whose read failed now, and those not loaded before that were not read again. A type the\n // stored object holds loaded is not marked by a read of it that failed: two reads go at once (two widgets of a\n // page), and the one that failed may answer last.\n const notLoadedBefore = storedConfig ? customFormTypesNotLoaded.get(storedConfig) : undefined\n const failedNotLoaded = failedTypes.filter((type) => !storedConfig || !!notLoadedBefore?.has(type))\n const notLoaded = new Set(\n [...(notLoadedBefore ?? []), ...failedNotLoaded].filter((type) => !types.includes(type))\n )\n if (notLoaded.size > 0) customFormTypesNotLoaded.set(config, notLoaded)\n\n damConfigStore.damConfigAssetCustomFormElements.set(extSystemId, config)\n } catch (err) {\n throw new Error('Unable to load asset custom form config. Incorrect fields in json.')\n }\n }\n\n function loadDamConfigDistributionCustomFormElements(distributionServiceName: DamDistributionServiceName) {\n return new Promise((resolve, reject) => {\n if (isUndefined(client)) {\n reject(false)\n return\n }\n if (damConfigStore.damConfigDistributionCustomFormElements.has(distributionServiceName)) {\n resolve(true)\n return\n }\n fetchDistributionCustomFormElements(client, distributionServiceName, endPoints().endPointAssetCustomForm)\n .then((res) => {\n damConfigStore.damConfigDistributionCustomFormElements.set(distributionServiceName, res)\n resolve(true)\n return\n })\n .catch((error) => {\n reject(error)\n return\n })\n })\n }\n\n function isDamPubConfigLoaded() {\n return damConfigStore.initialized.damPubConfig\n }\n\n function isDamPrvConfigLoaded() {\n return damConfigStore.initialized.damPrvConfig\n }\n\n function getDamConfigExtSystem(extSystemId: IntegerId) {\n return damConfigStore.damConfigExtSystem.get(extSystemId)\n }\n\n /**\n * The custom fields of the assets of the ext system, by type of asset; `undefined` while they are not loaded. With\n * `assetType`, `undefined` also while the fields of that type are not: their read failed beside reads that answered,\n * and the type holds `[]` till it is read again.\n */\n function getDamConfigAssetCustomFormElements(extSystemId: IntegerId, assetType?: DamAssetTypeType) {\n const config = damConfigStore.damConfigAssetCustomFormElements.get(extSystemId)\n if (config && assetType && customFormTypesNotLoaded.get(config)?.has(assetType)) return undefined\n return config\n }\n\n async function getOrLoadDamConfigExtSystemByLicences(\n licences: IntegerId[]\n ): Promise<DamConfigLicenceExtSystemReturnType[]> {\n const promises = licences.map((licence) =>\n getOrLoadDamConfigExtSystemByLicence(licence).catch((error) => {\n console.error(`Error fetching licence ${licence}:`, error)\n return undefined\n })\n )\n\n const responses = await Promise.allSettled(promises)\n\n return responses\n .filter(\n (result): result is PromiseFulfilledResult<DamConfigLicenceExtSystemReturnType> =>\n result.status === 'fulfilled' && !isUndefined(result.value)\n )\n .map((result) => result.value)\n }\n\n async function getOrLoadDamConfigExtSystemByLicence(\n licence: IntegerId\n ): Promise<DamConfigLicenceExtSystemReturnType | undefined> {\n if (isUndefined(client)) {\n console.warn('Client is undefined')\n return undefined\n }\n\n let foundLicenceConfig = damConfigStore.damConfigLicenceExtSystem.get(licence)\n\n if (isUndefined(foundLicenceConfig)) {\n try {\n const licenceRes = await fetchDamAssetLicence(client, licence, endPoints().endPointAssetLicence)\n if (isNull(licenceRes.extSystem)) return undefined\n\n foundLicenceConfig = {\n extSystem: licenceRes.extSystem,\n name: licenceRes.name,\n }\n damConfigStore.damConfigLicenceExtSystem.set(licence, foundLicenceConfig)\n } catch (error) {\n console.error(`Error fetching asset licence for ${licence}:`, error)\n return undefined\n }\n }\n\n let foundExtSystemConfig = damConfigStore.damConfigExtSystem.get(foundLicenceConfig.extSystem)\n\n if (isUndefined(foundExtSystemConfig)) {\n try {\n await loadDamConfigExtSystem(foundLicenceConfig.extSystem)\n foundExtSystemConfig = damConfigStore.damConfigExtSystem.get(foundLicenceConfig.extSystem)\n } catch (error) {\n console.error(`Error loading extension system ${foundLicenceConfig.extSystem}:`, error)\n return undefined\n }\n }\n\n if (isUndefined(foundExtSystemConfig)) return undefined\n\n return {\n licence,\n extSystem: foundLicenceConfig.extSystem,\n licenceName: foundLicenceConfig.name,\n extSystemConfig: cloneDeep(foundExtSystemConfig),\n }\n }\n\n async function getExtSystemByLicence(licence: IntegerId): Promise<IntegerId | null> {\n const cached = damConfigStore.damConfigLicenceExtSystem.get(licence)\n if (cached) return cached.extSystem\n\n if (isUndefined(client)) return null\n\n try {\n const licenceRes = await fetchDamAssetLicence(client, licence, endPoints().endPointAssetLicence)\n if (isNull(licenceRes.extSystem)) return null\n\n damConfigStore.damConfigLicenceExtSystem.set(licence, {\n extSystem: licenceRes.extSystem,\n name: licenceRes.name,\n })\n return licenceRes.extSystem\n } catch (error) {\n console.error(`Error fetching asset licence for ${licence}:`, error)\n return null\n }\n }\n\n return {\n getOrLoadDamConfigExtSystemByLicences,\n getOrLoadDamConfigExtSystemByLicence,\n getExtSystemByLicence,\n loadDamPrvConfig,\n loadDamPubConfig,\n loadDamConfigExtSystem,\n loadDamConfigAssetCustomFormElements,\n loadDamConfigDistributionCustomFormElements,\n isDamPubConfigLoaded,\n isDamPrvConfigLoaded,\n getDamConfigExtS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AAO;EACnE,IAAIQ,GAAQ,OAAOA,EAAO;EAE1B,IAAIxD,EAAYC,CAAM,GAAG,OAAO;EAEhC,IAAI;GACF,IAAMiD,IAAa,MAAMC,EAAqBlD,GAAQ+C,GAASrD,EAAU,CAAC,CAAC,oBAAoB;GAO/F,OANIyD,EAAOF,EAAW,SAAS,IAAU,QAEzCzD,EAAe,0BAA0B,IAAIuD,GAAS;IACpD,WAAWE,EAAW;IACtB,MAAMA,EAAW;GACnB,CAAC,GACMA,EAAW;EACpB,SAASpD,GAAO;GAEd,OADA,QAAQ,MAAM,oCAAoCkD,EAAQ,IAAIlD,CAAK,GAC5D;EACT;CACF;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"damConfigState.js","names":["customFormTypesNotLoaded","useDamConfigState","name","inheritedDamConfigName","configName","damConfigStore","useDamConfigStoreOf","endPoints","damEndPointsOf","onConfigError","error","loadDamPubConfig","isUndefined","client","reject","fetchPubConfiguration","config","setDamPubConfig","resolve","err","data","loadDamPrvConfig","fetchConfiguration","setDamPrvConfig","loadDamConfigExtSystem","fetchExtSystemConfiguration","extSystemId","setDamConfigExtSystem","loadDamConfigAssetCustomFormElements","DamAssetType","promises","types","fetchAssetCustomFormElements","type","endPointAssetCustomForm","loadedTypes","loadedResponses","failedTypes","result","index","anyField","fields","setDamConfigAssetCustomFormElements","storedConfig","responses","notLoadedBefore","failedNotLoaded","notLoaded","loadDamConfigDistributionCustomFormElements","distributionServiceName","fetchDistributionCustomFormElements","res","isDamPubConfigLoaded","isDamPrvConfigLoaded","getDamConfigExtSystem","getDamConfigAssetCustomFormElements","assetType","getOrLoadDamConfigExtSystemByLicences","licences","getOrLoadDamConfigExtSystemByLicence","licence","foundLicenceConfig","licenceRes","fetchDamAssetLicence","isNull","foundExtSystemConfig","cloneDeep","getExtSystemByLicence","cached"],"sources":["../../../../../src/domains/dam/config/composables/damConfigState.ts"],"sourcesContent":["import type { CustomDataFormElement } from '@/domains/customDataForm/types/CustomDataForm'\nimport { fetchDamAssetLicence } from '@/domains/dam/api/damAssetLicenceApi'\nimport {\n fetchAssetCustomFormElements,\n fetchDistributionCustomFormElements,\n} from '@/domains/dam/config/api/damAssetCustomFormApi'\nimport {\n fetchConfiguration,\n fetchExtSystemConfiguration,\n fetchPubConfiguration,\n} from '@/domains/dam/config/api/damConfigApi'\nimport { useDamConfigStoreOf } from '@/domains/dam/config/store/damConfigStore'\nimport { checkDamConfigName, inheritedDamConfigName } from '@/domains/dam/composables/damConfigName'\nimport { damEndPointsOf } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport type { IntegerId } from '@/shared/types/common'\nimport { DamAssetType, type DamAssetTypeType, type DamDistributionServiceName } from '@/domains/dam/types/Asset'\nimport type {\n DamConfigLicenceExtSystemReturnType,\n DamExtSystemConfig,\n DamPrvConfig,\n DamPubConfig,\n} from '@/domains/dam/types/DamConfig'\nimport { cloneDeep, isNull, isUndefined } from '@/shared/utils/common'\nimport type { AxiosInstance } from 'axios'\n\n// Asset types whose custom fields failed to load while other reads succeeded, keyed by the stored config object.\n// Those types stay `[]` in the store and are re-read where needed.\n// Keyed by object, not ext system: a config an app writes into the store itself has every type loaded.\nconst customFormTypesNotLoaded = new WeakMap<object, ReadonlySet<DamAssetTypeType>>()\n\n/**\n * Loads into and reads from the DAM configuration store of `configName` (`useDamConfigStoreOf`).\n * Without a name, uses the inherited one in component setup, else `default`.\n * Without a client nothing loads. Uses that configuration's endpoints (`endPointConfiguration`,\n * `endPointPubConfiguration`, `endPointAssetLicence`, `endPointAssetCustomForm`), or defaults.\n * After the plugin sets options, an unknown configuration throws, as the name caches do.\n */\nexport function useDamConfigState(client: undefined | (() => AxiosInstance) = undefined, configName?: string) {\n const name = inheritedDamConfigName(configName)\n checkDamConfigName(name)\n const damConfigStore = useDamConfigStoreOf(name)\n // Read at request time.\n const endPoints = () => damEndPointsOf(name)\n\n function onConfigError(error: Error) {\n console.error(error)\n }\n\n function loadDamPubConfig() {\n return new Promise((resolve, reject) => {\n damConfigStore.initialized.damPubConfig = false\n if (isUndefined(client)) {\n reject(false)\n return\n }\n fetchPubConfiguration(client, endPoints().endPointPubConfiguration)\n .then((config) => {\n if (Object.keys(config).length < 1) {\n throw new Error('Unable to load pub config. Incorrect response body.')\n }\n setDamPubConfig(config)\n resolve(true)\n })\n .catch((err) => {\n onConfigError(err)\n reject(false)\n })\n })\n }\n\n function setDamPubConfig(data: DamPubConfig) {\n try {\n damConfigStore.damPubConfig.userAuthType = data.userAuthType\n damConfigStore.initialized.damPubConfig = true\n } catch (err) {\n throw new Error('Unable to load dam pub config. Incorrect fields in json.')\n }\n }\n\n function loadDamPrvConfig() {\n return new Promise((resolve, reject) => {\n if (isUndefined(client)) {\n reject(false)\n return\n }\n fetchConfiguration(client, endPoints().endPointConfiguration)\n .then((config) => {\n if (Object.keys(config).length < 1) {\n throw new Error('Unable to load dam prv config. Incorrect response body.')\n }\n setDamPrvConfig(config)\n resolve(true)\n })\n .catch((err) => {\n onConfigError(err)\n reject(false)\n })\n })\n }\n\n function setDamPrvConfig(data: DamPrvConfig) {\n try {\n damConfigStore.damPrvConfig.settings = data.settings\n damConfigStore.damPrvConfig.colorSet = data.colorSet\n damConfigStore.damPrvConfig.assetExternalProviders = data.assetExternalProviders\n damConfigStore.damPrvConfig.distributionServices = data.distributionServices\n damConfigStore.initialized.damPrvConfig = true\n } catch (err) {\n throw new Error('Unable to load dam config. Incorrect fields in json.')\n }\n }\n\n function loadDamConfigExtSystem(extSystemId: IntegerId) {\n return new Promise((resolve, reject) => {\n if (isUndefined(client)) {\n reject(false)\n return\n }\n fetchExtSystemConfiguration(extSystemId, client, endPoints().endPointConfiguration)\n .then((config) => {\n if (Object.keys(config).length < 1) {\n throw new Error('Unable to load dam ext system config. Incorrect response body.')\n }\n setDamConfigExtSystem(config, extSystemId)\n resolve(true)\n })\n .catch((err) => {\n onConfigError(err)\n reject(false)\n })\n })\n }\n\n function setDamConfigExtSystem(data: DamExtSystemConfig, extSystemId: IntegerId) {\n try {\n const config = {\n assetExternalProviders: data.assetExternalProviders,\n audio: data.audio,\n document: data.document,\n image: data.image,\n video: data.video,\n }\n damConfigStore.damConfigExtSystem.set(extSystemId, config)\n } catch (err) {\n throw new Error('Unable to load dam ext system config. Incorrect fields in json.')\n }\n }\n\n function loadDamConfigAssetCustomFormElements(\n extSystemId: IntegerId,\n types: DamAssetTypeType[] = [DamAssetType.Image, DamAssetType.Audio, DamAssetType.Video, DamAssetType.Document]\n ) {\n return new Promise((resolve, reject) => {\n if (isUndefined(client)) {\n reject(false)\n return\n }\n const { endPointAssetCustomForm } = endPoints()\n const promises = types.map((type) =>\n fetchAssetCustomFormElements(client, extSystemId, type, endPointAssetCustomForm)\n )\n\n // allSettled: one unavailable type must not discard the successfully loaded ones.\n Promise.allSettled(promises)\n .then((results) => {\n const loadedTypes: DamAssetTypeType[] = []\n const loadedResponses: CustomDataFormElement[][] = []\n const failedTypes: DamAssetTypeType[] = []\n\n // A successful read counts as loaded even with no fields. An ext system may have none for a type.\n // Counting it as failed made such ext systems report that fields could not be loaded.\n results.forEach((result, index) => {\n if (result.status === 'fulfilled') {\n loadedTypes.push(types[index]!)\n loadedResponses.push(result.value)\n return\n }\n failedTypes.push(types[index]!)\n })\n\n // Some reads failed and the rest returned no fields. The missing\n // fields may be in the failed part, so treat as not loaded.\n const anyField = loadedResponses.some((fields) => fields.length > 0)\n if (types.length > 0 && (loadedTypes.length === 0 || (failedTypes.length > 0 && !anyField))) {\n throw new Error('Unable to load asset custom form config. Incorrect response body.')\n }\n setDamConfigAssetCustomFormElements(loadedResponses, extSystemId, loadedTypes, failedTypes)\n if (failedTypes.length > 0) {\n onConfigError(new Error(`Unable to load asset custom form config for: ${failedTypes.join(', ')}.`))\n }\n resolve(true)\n })\n .catch((err) => {\n onConfigError(err)\n reject(false)\n })\n })\n }\n\n function setDamConfigAssetCustomFormElements(\n responses: CustomDataFormElement[][],\n extSystemId: IntegerId,\n types: DamAssetTypeType[],\n failedTypes: DamAssetTypeType[] = []\n ) {\n try {\n const storedConfig = damConfigStore.damConfigAssetCustomFormElements.get(extSystemId)\n const existingConfig = storedConfig || {\n image: [],\n audio: [],\n video: [],\n document: [],\n }\n\n const config = { ...existingConfig }\n\n types.forEach((type, index) => {\n config[type] = responses[index]!\n })\n\n // Not loaded: types that failed now, plus previously unloaded types not re-read.\n // A failed read does not unmark a type already loaded. Two reads can\n // run at once (two widgets), and the failed one may answer last.\n const notLoadedBefore = storedConfig ? customFormTypesNotLoaded.get(storedConfig) : undefined\n const failedNotLoaded = failedTypes.filter((type) => !storedConfig || !!notLoadedBefore?.has(type))\n const notLoaded = new Set(\n [...(notLoadedBefore ?? []), ...failedNotLoaded].filter((type) => !types.includes(type))\n )\n if (notLoaded.size > 0) customFormTypesNotLoaded.set(config, notLoaded)\n\n damConfigStore.damConfigAssetCustomFormElements.set(extSystemId, config)\n } catch (err) {\n throw new Error('Unable to load asset custom form config. Incorrect fields in json.')\n }\n }\n\n function loadDamConfigDistributionCustomFormElements(distributionServiceName: DamDistributionServiceName) {\n return new Promise((resolve, reject) => {\n if (isUndefined(client)) {\n reject(false)\n return\n }\n if (damConfigStore.damConfigDistributionCustomFormElements.has(distributionServiceName)) {\n resolve(true)\n return\n }\n fetchDistributionCustomFormElements(client, distributionServiceName, endPoints().endPointAssetCustomForm)\n .then((res) => {\n damConfigStore.damConfigDistributionCustomFormElements.set(distributionServiceName, res)\n resolve(true)\n return\n })\n .catch((error) => {\n reject(error)\n return\n })\n })\n }\n\n function isDamPubConfigLoaded() {\n return damConfigStore.initialized.damPubConfig\n }\n\n function isDamPrvConfigLoaded() {\n return damConfigStore.initialized.damPrvConfig\n }\n\n function getDamConfigExtSystem(extSystemId: IntegerId) {\n return damConfigStore.damConfigExtSystem.get(extSystemId)\n }\n\n /**\n * Custom fields of the ext system's assets by asset type. `undefined` while not loaded.\n * With `assetType`, also `undefined` while that type's read failed. The type holds `[]` until re-read.\n */\n function getDamConfigAssetCustomFormElements(extSystemId: IntegerId, assetType?: DamAssetTypeType) {\n const config = damConfigStore.damConfigAssetCustomFormElements.get(extSystemId)\n if (config && assetType && customFormTypesNotLoaded.get(config)?.has(assetType)) return undefined\n return config\n }\n\n async function getOrLoadDamConfigExtSystemByLicences(\n licences: IntegerId[]\n ): Promise<DamConfigLicenceExtSystemReturnType[]> {\n const promises = licences.map((licence) =>\n getOrLoadDamConfigExtSystemByLicence(licence).catch((error) => {\n console.error(`Error fetching licence ${licence}:`, error)\n return undefined\n })\n )\n\n const responses = await Promise.allSettled(promises)\n\n return responses\n .filter(\n (result): result is PromiseFulfilledResult<DamConfigLicenceExtSystemReturnType> =>\n result.status === 'fulfilled' && !isUndefined(result.value)\n )\n .map((result) => result.value)\n }\n\n async function getOrLoadDamConfigExtSystemByLicence(\n licence: IntegerId\n ): Promise<DamConfigLicenceExtSystemReturnType | undefined> {\n if (isUndefined(client)) {\n console.warn('Client is undefined')\n return undefined\n }\n\n let foundLicenceConfig = damConfigStore.damConfigLicenceExtSystem.get(licence)\n\n if (isUndefined(foundLicenceConfig)) {\n try {\n const licenceRes = await fetchDamAssetLicence(client, licence, endPoints().endPointAssetLicence)\n if (isNull(licenceRes.extSystem)) return undefined\n\n foundLicenceConfig = {\n extSystem: licenceRes.extSystem,\n name: licenceRes.name,\n }\n damConfigStore.damConfigLicenceExtSystem.set(licence, foundLicenceConfig)\n } catch (error) {\n console.error(`Error fetching asset licence for ${licence}:`, error)\n return undefined\n }\n }\n\n let foundExtSystemConfig = damConfigStore.damConfigExtSystem.get(foundLicenceConfig.extSystem)\n\n if (isUndefined(foundExtSystemConfig)) {\n try {\n await loadDamConfigExtSystem(foundLicenceConfig.extSystem)\n foundExtSystemConfig = damConfigStore.damConfigExtSystem.get(foundLicenceConfig.extSystem)\n } catch (error) {\n console.error(`Error loading extension system ${foundLicenceConfig.extSystem}:`, error)\n return undefined\n }\n }\n\n if (isUndefined(foundExtSystemConfig)) return undefined\n\n return {\n licence,\n extSystem: foundLicenceConfig.extSystem,\n licenceName: foundLicenceConfig.name,\n extSystemConfig: cloneDeep(foundExtSystemConfig),\n }\n }\n\n async function getExtSystemByLicence(licence: IntegerId): Promise<IntegerId | null> {\n const cached = damConfigStore.damConfigLicenceExtSystem.get(licence)\n if (cached) return cached.extSystem\n\n if (isUndefined(client)) return null\n\n try {\n const licenceRes = await fetchDamAssetLicence(client, licence, endPoints().endPointAssetLicence)\n if (isNull(licenceRes.extSystem)) return null\n\n damConfigStore.damConfigLicenceExtSystem.set(licence, {\n extSystem: licenceRes.extSystem,\n name: licenceRes.name,\n })\n return licenceRes.extSystem\n } catch (error) {\n console.error(`Error fetching asset licence for ${licence}:`, error)\n return null\n }\n }\n\n return {\n getOrLoadDamConfigExtSystemByLicences,\n getOrLoadDamConfigExtSystemByLicence,\n getExtSystemByLicence,\n loadDamPrvConfig,\n loadDamPubConfig,\n loadDamConfigExtSystem,\n loadDamConfigAssetCustomFormElements,\n loadDamConfigDistributionCustomFormElements,\n isDamPubConfigLoaded,\n isDamPrvConfigLoaded,\n getDamConfigExtSystem,\n getDamConfigAssetCustomFormElements,\n }\n}\n"],"mappings":";;;;;;;;;AA4BA,IAAMA,oBAA2B,IAAI,QAA+C;AASpF,SAAgBC,EAAkB,IAA4C,KAAA,GAAW,GAAqB;CAC5G,IAAMC,IAAOC,EAAuBC,CAAU;CAC9C,EAAmBF,CAAI;CACvB,IAAMG,IAAiBC,EAAoBJ,CAAI,GAEzCK,UAAkBC,EAAeN,CAAI;CAE3C,SAASO,EAAc,GAAc;EACnC,QAAQ,MAAMC,CAAK;CACrB;CAEA,SAASC,IAAmB;EAC1B,OAAO,IAAI,SAAS,GAAS,MAAW;GAEtC,AADA,EAAe,YAAY,eAAe,IACtCC,EAAYC,CAAM,IACpBC,EAAO,EAAK,IAGdC,EAAsBF,GAAQN,EAAU,CAAC,CAAC,wBAAwB,CAAC,CAChE,MAAM,MAAW;IAChB,IAAI,OA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reDefinition<"co
25
25
  damConfigDistributionCustomFormElements: import('vue').ShallowRef<Map<string, CustomDataFormElement[]>, Map<string, CustomDataFormElement[]>>;
26
26
  reset: () => void;
27
27
  }>;
28
- /** A DAM configuration store, of `default` or of another name: its `$id` is the name's. */
28
+ /** A DAM configuration store of `default` or another name. Its `$id` is per name. */
29
29
  export type DamConfigStore = Omit<ReturnType<typeof useDamConfigStore>, '$id'> & {
30
30
  readonly $id: string;
31
31
  };
32
32
  /**
33
- * The DAM configuration store of the DAM configuration `configName`: for `default` the store of `useDamConfigStore()`,
34
- * for any other name a store of its own, with the same members. What a named configuration loads with its client goes
35
- * there; an application whose named client cannot read it fills this store before its components mount.
33
+ * DAM configuration store of `configName`. For `default` the
34
+ * `useDamConfigStore()` store, else a separate store with the same members.
35
+ * A named configuration loads into it. An app whose named client
36
+ * cannot load it fills this store before its components mount.
36
37
  */
37
38
  export declare function useDamConfigStoreOf(configName?: string, pinia?: Pinia): DamConfigStore;
@@ -1 +1 @@
1
- {"version":3,"file":"damConfigStore.js","names":["damPubConfigDefault","UserAuthType","damPrvConfigDefault","damConfigStoreSetup","initialized","reactive","damPubConfig","shallowRef","damPrvConfig","damConfigExtSystem","damConfigLicenceExtSystem","damConfigAssetCustomFormElements","damConfigDistributionCustomFormElements","reset","useDamConfigStore","defineStore","namedDefinitions","useDamConfigStoreOf","configName","pinia","definition"],"sources":["../../../../../src/domains/dam/config/store/damConfigStore.ts"],"sourcesContent":["import { acceptHMRUpdate, defineStore, type Pinia } from 'pinia'\nimport { reactive, shallowRef } from 'vue'\nimport {\n type DamConfigLicenceExtSystem,\n type DamExtSystemConfig,\n type DamPrvConfig,\n type DamPubConfig,\n UserAuthType,\n} from '@/domains/dam/types/DamConfig'\nimport type { IntegerId } from '@/shared/types/common'\nimport { type DamAssetTypeType, type DamDistributionServiceName } from '@/domains/dam/types/Asset'\nimport type { CustomDataFormElement } from '@/domains/customDataForm/types/CustomDataForm'\n\nconst damPubConfigDefault = () => ({\n userAuthType: UserAuthType.JsonCredentials,\n})\nconst damPrvConfigDefault = () => ({\n colorSet: {},\n assetExternalProviders: {},\n distributionServices: {},\n settings: {\n aclCheckEnabled: true,\n adminAllowListName: 'root',\n allowSelectExtSystem: false,\n allowSelectLicenceId: false,\n defaultAssetLicenceId: 0,\n defaultExtSystemId: 0,\n imageChunkConfig: {\n minSize: 0,\n maxSize: 0,\n },\n maxBulkItemCount: 0,\n },\n})\n\nconst damConfigStoreSetup = () => {\n const initialized = reactive<{\n damPubConfig: boolean\n damPrvConfig: boolean\n }>({\n damPubConfig: false,\n damPrvConfig: false,\n })\n const damPubConfig = shallowRef<DamPubConfig>(damPubConfigDefault())\n const damPrvConfig = shallowRef<DamPrvConfig>(damPrvConfigDefault())\n const damConfigExtSystem = shallowRef(new Map<IntegerId, DamExtSystemConfig>())\n const damConfigLicenceExtSystem = shallowRef(new Map<IntegerId, DamConfigLicenceExtSystem>())\n const damConfigAssetCustomFormElements = shallowRef(\n new Map<IntegerId, { [key in DamAssetTypeType]: CustomDataFormElement[] }>()\n )\n const damConfigDistributionCustomFormElements = shallowRef(\n new Map<DamDistributionServiceName, CustomDataFormElement[]>()\n )\n\n function reset() {\n damPubConfig.value = damPubConfigDefault()\n damPrvConfig.value = damPrvConfigDefault()\n damConfigExtSystem.value.clear()\n damConfigLicenceExtSystem.value.clear()\n damConfigAssetCustomFormElements.value.clear()\n damConfigDistributionCustomFormElements.value.clear()\n initialized.damPrvConfig = false\n initialized.damPubConfig = false\n }\n\n return {\n initialized,\n damPubConfig,\n damPrvConfig,\n damConfigExtSystem,\n damConfigLicenceExtSystem,\n damConfigAssetCustomFormElements,\n damConfigDistributionCustomFormElements,\n reset,\n }\n}\n\n/** The DAM configuration store of the configuration `default`. */\nexport const useDamConfigStore = defineStore('commonAdminDamConfigStore', damConfigStoreSetup)\n\n/** A DAM configuration store, of `default` or of another name: its `$id` is the name's. */\nexport type DamConfigStore = Omit<ReturnType<typeof useDamConfigStore>, '$id'> & { readonly $id: string }\n\ninterface DamConfigStoreHotData {\n namedDamConfigDefinitions?: Map<string, typeof useDamConfigStore>\n damConfigStoreSetup?: typeof damConfigStoreSetup\n}\n// Kept across the hot updates of this module (development only): each version writes its setup there, and they share\n// the definitions of the named stores, which the importers of the first version go on making.\n// @ts-ignore vue-tsc v3 --build mode bug: import.meta.hot type not resolved for this file\nconst hotData: DamConfigStoreHotData | undefined = import.meta.hot?.data\nif (hotData) hotData.damConfigStoreSetup = damConfigStoreSetup\n\n// One definition per configuration name, made when the name is first asked for: the store of each name is its own,\n// and two names never share one.\nconst namedDefinitions = hotData?.namedDamConfigDefinitions ?? new Map<string, typeof useDamConfigStore>()\nif (hotData) hotData.namedDamConfigDefinitions = namedDefinitions\n\n/**\n * The DAM configuration store of the DAM configuration `configName`: for `default` the store of `useDamConfigStore()`,\n * for any other name a store of its own, with the same members. What a named configuration loads with its client goes\n * there; an application whose named client cannot read it fills this store before its components mount.\n */\nexport function useDamConfigStoreOf(configName = 'default', pinia?: Pinia): DamConfigStore {\n if (configName === 'default') return useDamConfigStore(pinia)\n let definition = namedDefinitions.get(configName)\n if (!definition) {\n // The setup of the latest version of this module, where it was hot updated.\n definition = defineStore(\n 'commonAdminDamConfigStore:' + configName,\n hotData?.damConfigStoreSetup ?? damConfigStoreSetup\n ) as unknown as typeof useDamConfigStore\n namedDefinitions.set(configName, definition)\n }\n\n return definition(pinia)\n}\n\n// @ts-ignore vue-tsc v3 --build mode bug: import.meta.hot type not resolved for this file\nif (import.meta.hot) {\n // @ts-ignore see above\n const hot = import.meta.hot\n const acceptDefault = acceptHMRUpdate(useDamConfigStore, hot)\n hot.accept((newModule: unknown) => {\n // A named store's definition is made at run time, not exported: the new module could not hand its store a new\n // setup. While one exists, made by this version of the module or an earlier one, the page is loaded anew.\n if (namedDefinitions.size > 0) {\n window.location.reload()\n return\n }\n acceptDefault(newModule)\n })\n}\n"],"mappings":";;;;AAaA,IAAMA,WAA6B,EACjC,cAAcC,EAAa,gBAC7B,IACMC,WAA6B;CACjC,UAAU,CAAC;CACX,wBAAwB,CAAC;CACzB,sBAAsB,CAAC;CACvB,UAAU;EACR,iBAAiB;EACjB,oBAAoB;EACpB,sBAAsB;EACtB,sBAAsB;EACtB,uBAAuB;EACvB,oBAAoB;EACpB,kBAAkB;GAChB,SAAS;GACT,SAAS;EACX;EACA,kBAAkB;CACpB;AACF,IAEMC,UAA4B;CAChC,IAAMC,IAAcC,EAGjB;EACD,cAAc;EACd,cAAc;CAChB,CAAC,GACKC,IAAeC,EAAyBP,EAAoB,CAAC,GAC7DQ,IAAeD,EAAyBL,EAAoB,CAAC,GAC7DO,IAAqBF,kBAAW,IAAI,IAAmC,CAAC,GACxEG,IAA4BH,kBAAW,IAAI,IAA0C,CAAC,GACtFI,IAAmCJ,kBACvC,IAAI,IAAuE,CAC7E,GACMK,IAA0CL,kBAC9C,IAAI,IAAyD,CAC/D;CAEA,SAASM,IAAQ;EAQf,AAPA,EAAa,QAAQb,EAAoB,GACzC,EAAa,QAAQE,EAAoB,GACzCO,EAAmB,MAAM,MAAM,GAC/BC,EAA0B,MAAM,MAAM,GACtCC,EAAiC,MAAM,MAAM,GAC7CC,EAAwC,MAAM,MAAM,GACpD,EAAY,eAAe,IAC3B,EAAY,eAAe;CAC7B;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,GAGaE,IAAoBC,EAAY,6BAA6BZ,CAAmB,GAiBvFa,oBAAyD,IAAI,IAAsC;AAQzG,SAAgBC,EAAoB,IAAa,WAAW,GAA+B;CACzF,IAAIC,MAAe,WAAW,OAAOJ,EAAkBK,CAAK;CAC5D,IAAIC,IAAaJ,EAAiB,IAAIE,CAAU;CAUhD,OATKE,MAEH,IAAaL,EACX,+BAA+BG,GACCf,CAClC,GACAa,EAAiB,IAAIE,GAAYE,CAAU,IAGtCA,EAAWD,CAAK;AACzB"}
1
+ {"version":3,"file":"damConfigStore.js","names":["damPubConfigDefault","UserAuthType","damPrvConfigDefault","damConfigStoreSetup","initialized","reactive","damPubConfig","shallowRef","damPrvConfig","damConfigExtSystem","damConfigLicenceExtSystem","damConfigAssetCustomFormElements","damConfigDistributionCustomFormElements","reset","useDamConfigStore","defineStore","namedDefinitions","useDamConfigStoreOf","configName","pinia","definition"],"sources":["../../../../../src/domains/dam/config/store/damConfigStore.ts"],"sourcesContent":["import { acceptHMRUpdate, defineStore, type Pinia } from 'pinia'\nimport { reactive, shallowRef } from 'vue'\nimport {\n type DamConfigLicenceExtSystem,\n type DamExtSystemConfig,\n type DamPrvConfig,\n type DamPubConfig,\n UserAuthType,\n} from '@/domains/dam/types/DamConfig'\nimport type { IntegerId } from '@/shared/types/common'\nimport { type DamAssetTypeType, type DamDistributionServiceName } from '@/domains/dam/types/Asset'\nimport type { CustomDataFormElement } from '@/domains/customDataForm/types/CustomDataForm'\n\nconst damPubConfigDefault = () => ({\n userAuthType: UserAuthType.JsonCredentials,\n})\nconst damPrvConfigDefault = () => ({\n colorSet: {},\n assetExternalProviders: {},\n distributionServices: {},\n settings: {\n aclCheckEnabled: true,\n adminAllowListName: 'root',\n allowSelectExtSystem: false,\n allowSelectLicenceId: false,\n defaultAssetLicenceId: 0,\n defaultExtSystemId: 0,\n imageChunkConfig: {\n minSize: 0,\n maxSize: 0,\n },\n maxBulkItemCount: 0,\n },\n})\n\nconst damConfigStoreSetup = () => {\n const initialized = reactive<{\n damPubConfig: boolean\n damPrvConfig: boolean\n }>({\n damPubConfig: false,\n damPrvConfig: false,\n })\n const damPubConfig = shallowRef<DamPubConfig>(damPubConfigDefault())\n const damPrvConfig = shallowRef<DamPrvConfig>(damPrvConfigDefault())\n const damConfigExtSystem = shallowRef(new Map<IntegerId, DamExtSystemConfig>())\n const damConfigLicenceExtSystem = shallowRef(new Map<IntegerId, DamConfigLicenceExtSystem>())\n const damConfigAssetCustomFormElements = shallowRef(\n new Map<IntegerId, { [key in DamAssetTypeType]: CustomDataFormElement[] }>()\n )\n const damConfigDistributionCustomFormElements = shallowRef(\n new Map<DamDistributionServiceName, CustomDataFormElement[]>()\n )\n\n function reset() {\n damPubConfig.value = damPubConfigDefault()\n damPrvConfig.value = damPrvConfigDefault()\n damConfigExtSystem.value.clear()\n damConfigLicenceExtSystem.value.clear()\n damConfigAssetCustomFormElements.value.clear()\n damConfigDistributionCustomFormElements.value.clear()\n initialized.damPrvConfig = false\n initialized.damPubConfig = false\n }\n\n return {\n initialized,\n damPubConfig,\n damPrvConfig,\n damConfigExtSystem,\n damConfigLicenceExtSystem,\n damConfigAssetCustomFormElements,\n damConfigDistributionCustomFormElements,\n reset,\n }\n}\n\n/** The DAM configuration store of the configuration `default`. */\nexport const useDamConfigStore = defineStore('commonAdminDamConfigStore', damConfigStoreSetup)\n\n/** A DAM configuration store of `default` or another name. Its `$id` is per name. */\nexport type DamConfigStore = Omit<ReturnType<typeof useDamConfigStore>, '$id'> & { readonly $id: string }\n\ninterface DamConfigStoreHotData {\n namedDamConfigDefinitions?: Map<string, typeof useDamConfigStore>\n damConfigStoreSetup?: typeof damConfigStoreSetup\n}\n// Kept across hot updates (development only). Each version writes its setup here and they\n// share the named store definitions, which importers of the first version keep creating.\n// @ts-ignore vue-tsc v3 --build mode bug: import.meta.hot type not resolved for this file\nconst hotData: DamConfigStoreHotData | undefined = import.meta.hot?.data\nif (hotData) hotData.damConfigStoreSetup = damConfigStoreSetup\n\n// One definition per configuration name, created on first use. Names never share a store.\nconst namedDefinitions = hotData?.namedDamConfigDefinitions ?? new Map<string, typeof useDamConfigStore>()\nif (hotData) hotData.namedDamConfigDefinitions = namedDefinitions\n\n/**\n * DAM configuration store of `configName`. For `default` the\n * `useDamConfigStore()` store, else a separate store with the same members.\n * A named configuration loads into it. An app whose named client\n * cannot load it fills this store before its components mount.\n */\nexport function useDamConfigStoreOf(configName = 'default', pinia?: Pinia): DamConfigStore {\n if (configName === 'default') return useDamConfigStore(pinia)\n let definition = namedDefinitions.get(configName)\n if (!definition) {\n // Uses the setup of the latest hot-updated version of this module.\n definition = defineStore(\n 'commonAdminDamConfigStore:' + configName,\n hotData?.damConfigStoreSetup ?? damConfigStoreSetup\n ) as unknown as typeof useDamConfigStore\n namedDefinitions.set(configName, definition)\n }\n\n return definition(pinia)\n}\n\n// @ts-ignore vue-tsc v3 --build mode bug: import.meta.hot type not resolved for this file\nif (import.meta.hot) {\n // @ts-ignore see above\n const hot = import.meta.hot\n const acceptDefault = acceptHMRUpdate(useDamConfigStore, hot)\n hot.accept((newModule: unknown) => {\n // Named store definitions are created at runtime, not exported, so the new\n // module cannot give them a new setup. Reload the page while any exists.\n if (namedDefinitions.size > 0) {\n window.location.reload()\n return\n }\n acceptDefault(newModule)\n })\n}\n"],"mappings":";;;;AAaA,IAAMA,WAA6B,EACjC,cAAcC,EAAa,gBAC7B,IACMC,WAA6B;CACjC,UAAU,CAAC;CACX,wBAAwB,CAAC;CACzB,sBAAsB,CAAC;CACvB,UAAU;EACR,iBAAiB;EACjB,oBAAoB;EACpB,sBAAsB;EACtB,sBAAsB;EACtB,uBAAuB;EACvB,oBAAoB;EACpB,kBAAkB;GAChB,SAAS;GACT,SAAS;EACX;EACA,kBAAkB;CACpB;AACF,IAEMC,UAA4B;CAChC,IAAMC,IAAcC,EAGjB;EACD,cAAc;EACd,cAAc;CAChB,CAAC,GACKC,IAAeC,EAAyBP,EAAoB,CAAC,GAC7DQ,IAAeD,EAAyBL,EAAoB,CAAC,GAC7DO,IAAqBF,kBAAW,IAAI,IAAmC,CAAC,GACxEG,IAA4BH,kBAAW,IAAI,IAA0C,CAAC,GACtFI,IAAmCJ,kBACvC,IAAI,IAAuE,CAC7E,GACMK,IAA0CL,kBAC9C,IAAI,IAAyD,CAC/D;CAEA,SAASM,IAAQ;EAQf,AAPA,EAAa,QAAQb,EAAoB,GACzC,EAAa,QAAQE,EAAoB,GACzCO,EAAmB,MAAM,MAAM,GAC/BC,EAA0B,MAAM,MAAM,GACtCC,EAAiC,MAAM,MAAM,GAC7CC,EAAwC,MAAM,MAAM,GACpD,EAAY,eAAe,IAC3B,EAAY,eAAe;CAC7B;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,GAGaE,IAAoBC,EAAY,6BAA6BZ,CAAmB,GAgBvFa,oBAAyD,IAAI,IAAsC;AASzG,SAAgBC,EAAoB,IAAa,WAAW,GAA+B;CACzF,IAAIC,MAAe,WAAW,OAAOJ,EAAkBK,CAAK;CAC5D,IAAIC,IAAaJ,EAAiB,IAAIE,CAAU;CAUhD,OATKE,MAEH,IAAaL,EACX,+BAA+BG,GACCf,CAClC,GACAa,EAAiB,IAAIE,GAAYE,CAAU,IAGtCA,EAAWD,CAAK;AACzB"}
@@ -1,5 +1,7 @@
1
1
  import { DamConfigLicenceExtSystemReturnType } from '../../types/DamConfig';
2
2
  /** The licences the current user of the system `currentUser` of the configuration `configName` may pick from. */
3
3
  export declare function filterAllowedImageWidgetSelectConfigs(values: DamConfigLicenceExtSystemReturnType[], configName: string): DamConfigLicenceExtSystemReturnType[];
4
- /** Whether the current user of the system `currentUser` of the configuration `configName` may upload into the licence. */
4
+ /**
5
+ * Whether the current user of the system `currentUser` of the configuration `configName` may upload into the licence.
6
+ */
5
7
  export declare function isImageWidgetUploadConfigAllowed(value: DamConfigLicenceExtSystemReturnType, configName: string): boolean;