@anzusystems/common-admin 2.0.0-rc.4 → 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 (680) hide show
  1. package/README.md +1 -1
  2. package/dist/AnzuSystemsCommonAdmin.d.ts +42 -32
  3. package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
  4. package/dist/common-admin.css +1 -1
  5. package/dist/common-admin.js +282 -282
  6. package/dist/domains/anzuUser/api/anzuUserApi.d.ts +9 -12
  7. package/dist/domains/anzuUser/api/anzuUserApi.js.map +1 -1
  8. package/dist/domains/anzuUser/components/AAnzuUserDatatable.js.map +1 -1
  9. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue.d.ts +38 -44
  10. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  11. package/dist/domains/anzuUser/components/AAnzuUserFilter.js.map +1 -1
  12. package/dist/domains/anzuUser/components/AAnzuUserFilter.vue.d.ts +12 -13
  13. package/dist/domains/anzuUser/components/AAnzuUserFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/domains/anzuUser/components/AAnzuUserForm.js.map +1 -1
  15. package/dist/domains/anzuUser/components/AAnzuUserForm.vue.d.ts +18 -20
  16. package/dist/domains/anzuUser/components/AAnzuUserForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.js.map +1 -1
  18. package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/domains/anzuUser/components/AUserBulkActionDialog.js.map +1 -1
  20. package/dist/domains/anzuUser/components/AUserBulkActionDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.js.map +1 -1
  22. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue.d.ts +2 -3
  23. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.js.map +1 -1
  25. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue.d.ts +9 -15
  26. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  27. package/dist/domains/anzuUser/components/AUserEnabledSwitch.js.map +1 -1
  28. package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue.d.ts +8 -7
  29. package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/domains/anzuUser/components/AUserManageButton.js.map +1 -1
  31. package/dist/domains/anzuUser/components/AUserManageButton.vue.d.ts +0 -1
  32. package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/domains/anzuUser/components/AUserMetadataForm.js.map +1 -1
  34. package/dist/domains/anzuUser/components/AUserMetadataForm.vue.d.ts +8 -9
  35. package/dist/domains/anzuUser/components/AUserMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.js.map +1 -1
  37. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.js.map +1 -1
  39. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue.d.ts +1 -2
  40. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/domains/anzuUser/components/AUserSystemOverview.js.map +1 -1
  42. package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/domains/anzuUser/components/AUserSystemPanel.js.map +1 -1
  44. package/dist/domains/anzuUser/components/AUserSystemPanel.vue.d.ts +2 -2
  45. package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/domains/anzuUser/components/AUserSystemStatusChip.js.map +1 -1
  47. package/dist/domains/anzuUser/components/AUserSystemStatusChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  48. package/dist/domains/anzuUser/components/AUserTabsShell.js.map +1 -1
  49. package/dist/domains/anzuUser/components/AUserTabsShell.vue.d.ts +17 -22
  50. package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  51. package/dist/domains/anzuUser/composables/anzuUserActions.d.ts +5 -9
  52. package/dist/domains/anzuUser/composables/anzuUserActions.js.map +1 -1
  53. package/dist/domains/anzuUser/composables/anzuUserValidations.d.ts +4 -6
  54. package/dist/domains/anzuUser/composables/anzuUserValidations.js.map +1 -1
  55. package/dist/domains/anzuUser/composables/cachedAnzuUsers.d.ts +3 -3
  56. package/dist/domains/anzuUser/composables/cachedAnzuUsers.js.map +1 -1
  57. package/dist/domains/anzuUser/composables/userCrossSystemSearch.d.ts +2 -4
  58. package/dist/domains/anzuUser/composables/userCrossSystemSearch.js.map +1 -1
  59. package/dist/domains/anzuUser/composables/userCrossSystemWrites.d.ts +5 -11
  60. package/dist/domains/anzuUser/composables/userCrossSystemWrites.js.map +1 -1
  61. package/dist/domains/anzuUser/composables/userSystemDescriptor.d.ts +33 -57
  62. package/dist/domains/anzuUser/composables/userSystemDescriptor.js.map +1 -1
  63. package/dist/domains/anzuUser/composables/userSystemProbe.d.ts +7 -27
  64. package/dist/domains/anzuUser/composables/userSystemProbe.js.map +1 -1
  65. package/dist/domains/anzuUser/filter/anzuUserFilter.d.ts +6 -16
  66. package/dist/domains/anzuUser/filter/anzuUserFilter.js.map +1 -1
  67. package/dist/domains/anzuUser/store/anzuUserStore.d.ts +1 -5
  68. package/dist/domains/anzuUser/store/anzuUserStore.js.map +1 -1
  69. package/dist/domains/anzuUser/store/userCrossSystemStore.d.ts +3 -14
  70. package/dist/domains/anzuUser/store/userCrossSystemStore.js.map +1 -1
  71. package/dist/domains/anzuUser/utils/userMetadataDiff.d.ts +7 -19
  72. package/dist/domains/anzuUser/utils/userMetadataDiff.js.map +1 -1
  73. package/dist/domains/anzuUser/utils/userSystemState.d.ts +12 -30
  74. package/dist/domains/anzuUser/utils/userSystemState.js.map +1 -1
  75. package/dist/domains/anzuUser/utils/userTabs.d.ts +1 -3
  76. package/dist/domains/anzuUser/utils/userTabs.js.map +1 -1
  77. package/dist/domains/api/composables/defineApiClient.d.ts +4 -8
  78. package/dist/domains/api/composables/defineApiClient.js.map +1 -1
  79. package/dist/domains/api/composables/request.d.ts +18 -48
  80. package/dist/domains/api/composables/request.js.map +1 -1
  81. package/dist/domains/api/composables/useApiFetchByIds.d.ts +7 -21
  82. package/dist/domains/api/composables/useApiFetchByIds.js.map +1 -1
  83. package/dist/domains/api/composables/useApiFetchItems.d.ts +18 -57
  84. package/dist/domains/api/composables/useApiFetchItems.js.map +1 -1
  85. package/dist/domains/api/composables/useApiFetchList.d.ts +7 -23
  86. package/dist/domains/api/composables/useApiFetchList.js.map +1 -1
  87. package/dist/domains/api/composables/useApiFetchListBatch.d.ts +5 -22
  88. package/dist/domains/api/composables/useApiFetchListBatch.js.map +1 -1
  89. package/dist/domains/api/composables/useApiQueryBuilder.js.map +1 -1
  90. package/dist/domains/api/composables/useApiRequest.d.ts +16 -39
  91. package/dist/domains/api/composables/useApiRequest.js.map +1 -1
  92. package/dist/domains/api/utils/apiErrors.d.ts +28 -55
  93. package/dist/domains/api/utils/apiErrors.js.map +1 -1
  94. package/dist/domains/api/utils/listBody.d.ts +22 -43
  95. package/dist/domains/api/utils/listBody.js.map +1 -1
  96. package/dist/domains/auth/components/Acl.js.map +1 -1
  97. package/dist/domains/auth/components/Acl.vue_vue_type_script_setup_true_lang.js.map +1 -1
  98. package/dist/domains/auth/composables/aclAllowed.d.ts +2 -3
  99. package/dist/domains/auth/composables/aclAllowed.js.map +1 -1
  100. package/dist/domains/auth/composables/defineAuth.js.map +1 -1
  101. package/dist/domains/auth/composables/refreshSession.d.ts +10 -13
  102. package/dist/domains/auth/composables/refreshSession.js.map +1 -1
  103. package/dist/domains/cached/components/ACachedChip.js.map +1 -1
  104. package/dist/domains/cached/components/ACachedChip.vue.d.ts +13 -11
  105. package/dist/domains/cached/components/ACachedChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  106. package/dist/domains/cached/components/ACachedUserChip.js +1 -1
  107. package/dist/domains/cached/components/ACachedUserChip.js.map +1 -1
  108. package/dist/domains/cached/components/ACachedUserChip.vue.d.ts +3 -3
  109. package/dist/domains/cached/components/ACachedUserChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/domains/cached/composables/createUserAndTimeTrackingFields.d.ts +9 -9
  111. package/dist/domains/cached/composables/createUserAndTimeTrackingFields.js.map +1 -1
  112. package/dist/domains/cached/composables/defineCached.d.ts +13 -11
  113. package/dist/domains/cached/composables/defineCached.js.map +1 -1
  114. package/dist/domains/cached/composables/useCachedItem.d.ts +7 -8
  115. package/dist/domains/cached/composables/useCachedItem.js.map +1 -1
  116. package/dist/domains/collab/components/ACollabLockedByUser.js.map +1 -1
  117. package/dist/domains/collab/components/ACollabLockedByUser.vue_vue_type_script_setup_true_lang.js.map +1 -1
  118. package/dist/domains/collab/composables/collabAnyDataChange.js.map +1 -1
  119. package/dist/domains/collab/composables/collabField.d.ts +5 -3
  120. package/dist/domains/collab/composables/collabField.js.map +1 -1
  121. package/dist/domains/collab/composables/collabInit.js +58 -54
  122. package/dist/domains/collab/composables/collabInit.js.map +1 -1
  123. package/dist/domains/collab/composables/collabRecovery.d.ts +49 -0
  124. package/dist/domains/collab/composables/collabRecovery.js +99 -0
  125. package/dist/domains/collab/composables/collabRecovery.js.map +1 -0
  126. package/dist/domains/collab/composables/collabRoom.js +106 -106
  127. package/dist/domains/collab/composables/collabRoom.js.map +1 -1
  128. package/dist/domains/collab/composables/collabState.d.ts +11 -4
  129. package/dist/domains/collab/composables/collabState.js +34 -25
  130. package/dist/domains/collab/composables/collabState.js.map +1 -1
  131. package/dist/domains/collab/composables/commonAdminCollabOptions.d.ts +4 -2
  132. package/dist/domains/collab/types/Collab.d.ts +31 -5
  133. package/dist/domains/collab/types/Collab.js +23 -11
  134. package/dist/domains/collab/types/Collab.js.map +1 -1
  135. package/dist/domains/customDataForm/components/ACustomDataForm.js.map +1 -1
  136. package/dist/domains/customDataForm/components/ACustomDataForm.vue.d.ts +7 -5
  137. package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/domains/customDataForm/components/ACustomDataFormElement.js.map +1 -1
  139. package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
  140. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.js.map +1 -1
  141. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue.d.ts +5 -3
  142. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/domains/customDataForm/composables/useCustomDataForm.js.map +1 -1
  144. package/dist/domains/customDataForm/types/CustomDataForm.d.ts +4 -1
  145. package/dist/domains/dam/api/damAssetApi.d.ts +7 -7
  146. package/dist/domains/dam/api/damAssetApi.js.map +1 -1
  147. package/dist/domains/dam/api/damAssetLicenceApi.d.ts +1 -1
  148. package/dist/domains/dam/api/damAssetLicenceApi.js.map +1 -1
  149. package/dist/domains/dam/api/damConstants.js.map +1 -1
  150. package/dist/domains/dam/api/damEndPoints.js.map +1 -1
  151. package/dist/domains/dam/api/damImageApi.js.map +1 -1
  152. package/dist/domains/dam/api/uploadApi.js.map +1 -1
  153. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.js.map +1 -1
  154. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue.d.ts +7 -5
  155. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  156. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.js.map +1 -1
  157. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  158. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.js.map +1 -1
  159. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue.d.ts +1 -1
  160. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  161. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarActionsWrapper.vue.d.ts +5 -3
  162. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.js.map +1 -1
  163. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  164. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.js.map +1 -1
  165. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  166. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.js.map +1 -1
  167. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.vue_vue_type_script_setup_true_lang.js.map +1 -1
  168. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.js.map +1 -1
  169. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue.d.ts +1 -1
  170. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/domains/dam/assetDetail/components/AssetImage.js.map +1 -1
  172. package/dist/domains/dam/assetDetail/components/AssetImage.vue.d.ts +1 -1
  173. package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  174. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.js.map +1 -1
  175. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue.d.ts +2 -2
  176. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js.map +1 -1
  177. package/dist/domains/dam/assetDetail/components/AssetInfobox.js.map +1 -1
  178. package/dist/domains/dam/assetDetail/components/AssetInfobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/domains/dam/assetDetail/components/AssetMetadata.js.map +1 -1
  180. package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  181. package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.d.ts +5 -6
  182. package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.js.map +1 -1
  183. package/dist/domains/dam/assetDetail/composables/assetDetailView.d.ts +10 -10
  184. package/dist/domains/dam/assetDetail/composables/assetDetailView.js.map +1 -1
  185. package/dist/domains/dam/assetDetail/store/assetDetailStore.js.map +1 -1
  186. package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.d.ts +4 -3
  187. package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.js.map +1 -1
  188. package/dist/domains/dam/assetSelect/api/damPodcastApi.js.map +1 -1
  189. package/dist/domains/dam/assetSelect/components/AAssetListInner.js.map +1 -1
  190. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue.d.ts +789 -787
  191. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  192. package/dist/domains/dam/assetSelect/components/AAssetSelect.js.map +1 -1
  193. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +395 -393
  194. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.js.map +1 -1
  196. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue.d.ts +14 -12
  197. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
  198. package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.js.map +1 -1
  199. package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  200. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.js.map +1 -1
  201. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue.d.ts +9 -7
  202. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.js.map +1 -1
  204. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  205. package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
  206. package/dist/domains/dam/assetSelect/store/assetSelectStore.js.map +1 -1
  207. package/dist/domains/dam/author/api/authorApi.js.map +1 -1
  208. package/dist/domains/dam/author/components/AuthorCreateButton.js.map +1 -1
  209. package/dist/domains/dam/author/components/AuthorCreateButton.vue.d.ts +1 -1
  210. package/dist/domains/dam/author/components/AuthorCreateButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  211. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.js.map +1 -1
  212. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue.d.ts +9 -6
  213. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  214. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.js.map +1 -1
  215. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  216. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js +1 -1
  217. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js.map +1 -1
  218. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue.d.ts +2 -2
  219. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.js.map +1 -1
  221. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue.d.ts +1 -1
  222. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  223. package/dist/domains/dam/author/composables/cachedAuthors.d.ts +5 -4
  224. package/dist/domains/dam/author/composables/cachedAuthors.js.map +1 -1
  225. package/dist/domains/dam/author/composables/cachedUsers.d.ts +5 -4
  226. package/dist/domains/dam/author/composables/cachedUsers.js.map +1 -1
  227. package/dist/domains/dam/author/composables/damAuthorConfig.d.ts +2 -2
  228. package/dist/domains/dam/author/composables/damAuthorConfig.js.map +1 -1
  229. package/dist/domains/dam/components/DamAdminAssetLink.js.map +1 -1
  230. package/dist/domains/dam/components/DamAdminAssetLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/domains/dam/composables/commonAdminCoreDamOptions.d.ts +10 -8
  232. package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
  233. package/dist/domains/dam/composables/damConfigName.d.ts +8 -9
  234. package/dist/domains/dam/composables/damConfigName.js.map +1 -1
  235. package/dist/domains/dam/composables/damNotifications.d.ts +9 -9
  236. package/dist/domains/dam/composables/damNotifications.js.map +1 -1
  237. package/dist/domains/dam/composables/damNotificationsConnection.d.ts +4 -4
  238. package/dist/domains/dam/composables/damNotificationsConnection.js.map +1 -1
  239. package/dist/domains/dam/composables/damNotificationsEventBus.d.ts +2 -2
  240. package/dist/domains/dam/composables/damNotificationsEventBus.js.map +1 -1
  241. package/dist/domains/dam/composables/extSystemIdForCached.d.ts +5 -4
  242. package/dist/domains/dam/composables/extSystemIdForCached.js.map +1 -1
  243. package/dist/domains/dam/config/api/damAssetCustomFormApi.js.map +1 -1
  244. package/dist/domains/dam/config/api/damConfigApi.js.map +1 -1
  245. package/dist/domains/dam/config/composables/damConfigState.d.ts +5 -5
  246. package/dist/domains/dam/config/composables/damConfigState.js.map +1 -1
  247. package/dist/domains/dam/config/store/damConfigStore.d.ts +5 -4
  248. package/dist/domains/dam/config/store/damConfigStore.js.map +1 -1
  249. package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.d.ts +3 -1
  250. package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.js.map +1 -1
  251. package/dist/domains/dam/cropper/components/ACropper.js.map +1 -1
  252. package/dist/domains/dam/cropper/components/ACropper.vue.d.ts +8 -16
  253. package/dist/domains/dam/cropper/components/ACropper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  254. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.js.map +1 -1
  255. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  256. package/dist/domains/dam/cropper/store/imageRoiStore.d.ts +9 -12
  257. package/dist/domains/dam/cropper/store/imageRoiStore.js.map +1 -1
  258. package/dist/domains/dam/cropper/utils/cropperGeometry.d.ts +24 -38
  259. package/dist/domains/dam/cropper/utils/cropperGeometry.js.map +1 -1
  260. package/dist/domains/dam/cropper/utils/cropperJsService.d.ts +3 -7
  261. package/dist/domains/dam/cropper/utils/cropperJsService.js +10 -3
  262. package/dist/domains/dam/cropper/utils/cropperJsService.js.map +1 -1
  263. package/dist/domains/dam/cropper/utils/cropperTypes.d.ts +3 -6
  264. package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.d.ts +5 -5
  265. package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.js.map +1 -1
  266. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.js.map +1 -1
  267. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  268. package/dist/domains/dam/imageWidget/components/AImagePublicInput.js.map +1 -1
  269. package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  270. package/dist/domains/dam/imageWidget/components/AImageWidget.js.map +1 -1
  271. package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  272. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.js.map +1 -1
  273. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
  274. package/dist/domains/dam/imageWidget/components/AImageWidgetSimple.vue.d.ts +43 -41
  275. package/dist/domains/dam/imageWidget/components/AMediaWidgetSimple.vue.d.ts +31 -29
  276. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.js.map +1 -1
  277. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue.d.ts +29 -27
  278. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  279. package/dist/domains/dam/imageWidget/components/ImageMassOperations.js.map +1 -1
  280. package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue.d.ts +1 -1
  281. package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  282. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.js.map +1 -1
  283. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +68 -66
  284. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  285. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.js.map +1 -1
  286. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +402 -400
  287. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  288. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.js.map +1 -1
  289. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +384 -382
  290. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  291. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.js.map +1 -1
  292. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  293. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.js.map +1 -1
  294. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  295. package/dist/domains/dam/imageWidget/components/MediaWidgetSimpleDialog.vue.d.ts +7 -5
  296. package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.js.map +1 -1
  297. package/dist/domains/dam/imageWidget/composables/imageApiCms.js.map +1 -1
  298. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.d.ts +11 -13
  299. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js.map +1 -1
  300. package/dist/domains/dam/imageWidget/composables/useImageMassOperations.js.map +1 -1
  301. package/dist/domains/dam/imageWidget/store/imageMediaWidgetStore.js.map +1 -1
  302. package/dist/domains/dam/imageWidget/store/imageStore.js.map +1 -1
  303. package/dist/domains/dam/imageWidget/utils/damImage.d.ts +5 -6
  304. package/dist/domains/dam/imageWidget/utils/damImage.js.map +1 -1
  305. package/dist/domains/dam/imageWidget/utils/fieldLockTurns.d.ts +1 -2
  306. package/dist/domains/dam/imageWidget/utils/fieldLockTurns.js.map +1 -1
  307. package/dist/domains/dam/imageWidget/utils/imageSaves.d.ts +10 -14
  308. package/dist/domains/dam/imageWidget/utils/imageSaves.js.map +1 -1
  309. package/dist/domains/dam/imageWidget/utils/metadataToImageMap.js.map +1 -1
  310. package/dist/domains/dam/imageWidget/utils/waitLimit.d.ts +4 -6
  311. package/dist/domains/dam/imageWidget/utils/waitLimit.js.map +1 -1
  312. package/dist/domains/dam/keyword/api/keywordApi.js.map +1 -1
  313. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.js.map +1 -1
  314. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue.d.ts +1 -1
  315. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  316. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.js.map +1 -1
  317. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue.d.ts +8 -5
  318. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  319. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js +1 -1
  320. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js.map +1 -1
  321. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue.d.ts +2 -2
  322. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  323. package/dist/domains/dam/keyword/composables/cachedKeywords.d.ts +5 -4
  324. package/dist/domains/dam/keyword/composables/cachedKeywords.js.map +1 -1
  325. package/dist/domains/dam/keyword/composables/damKeywordConfig.d.ts +2 -2
  326. package/dist/domains/dam/keyword/composables/damKeywordConfig.js.map +1 -1
  327. package/dist/domains/dam/types/Asset.d.ts +1 -1
  328. package/dist/domains/dam/types/Asset.js.map +1 -1
  329. package/dist/domains/dam/types/UploadQueue.d.ts +5 -4
  330. package/dist/domains/dam/types/UploadQueue.js.map +1 -1
  331. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.js.map +1 -1
  332. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  333. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.js.map +1 -1
  334. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue.d.ts +2 -2
  335. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  336. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.js.map +1 -1
  337. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  338. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.js.map +1 -1
  339. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  340. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.js.map +1 -1
  341. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue.d.ts +6 -4
  342. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  343. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.js.map +1 -1
  344. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue.d.ts +1 -1
  345. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  346. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.js.map +1 -1
  347. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  348. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.js.map +1 -1
  349. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue.d.ts +6 -6
  350. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  351. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.js.map +1 -1
  352. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue.d.ts +13 -13
  353. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  354. package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.d.ts +13 -13
  355. package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.js.map +1 -1
  356. package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.d.ts +2 -2
  357. package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.js.map +1 -1
  358. package/dist/domains/dam/uploadQueue/composables/uploadMeter.d.ts +12 -12
  359. package/dist/domains/dam/uploadQueue/composables/uploadMeter.js.map +1 -1
  360. package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.d.ts +5 -5
  361. package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.js.map +1 -1
  362. package/dist/domains/dam/uploadQueue/composables/uploadService.d.ts +2 -3
  363. package/dist/domains/dam/uploadQueue/composables/uploadService.js.map +1 -1
  364. package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.d.ts +5 -4
  365. package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.js.map +1 -1
  366. package/dist/domains/dam/uploadQueue/core/uploadQueueCore.d.ts +3 -2
  367. package/dist/domains/dam/uploadQueue/core/uploadQueueCore.js.map +1 -1
  368. package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.d.ts +8 -5
  369. package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.js.map +1 -1
  370. package/dist/domains/dam/uploadQueue/core/uploadQueueFill.d.ts +3 -3
  371. package/dist/domains/dam/uploadQueue/core/uploadQueueFill.js.map +1 -1
  372. package/dist/domains/dam/uploadQueue/presets/queuePresets.d.ts +8 -5
  373. package/dist/domains/dam/uploadQueue/presets/queuePresets.js.map +1 -1
  374. package/dist/domains/dam/uploadQueue/presets/uploadPresets.d.ts +15 -13
  375. package/dist/domains/dam/uploadQueue/presets/uploadPresets.js.map +1 -1
  376. package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.d.ts +7 -7
  377. package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.js.map +1 -1
  378. package/dist/domains/dam/uploadQueue/settlement/uploadPoller.d.ts +4 -4
  379. package/dist/domains/dam/uploadQueue/settlement/uploadPoller.js.map +1 -1
  380. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.d.ts +28 -30
  381. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.js.map +1 -1
  382. package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.d.ts +2 -2
  383. package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.js.map +1 -1
  384. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.d.ts +2 -2
  385. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.js.map +1 -1
  386. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.d.ts +63 -73
  387. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.js.map +1 -1
  388. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.d.ts +8 -9
  389. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.js.map +1 -1
  390. package/dist/domains/dam/user/api/userApi.d.ts +2 -2
  391. package/dist/domains/dam/user/api/userApi.js.map +1 -1
  392. package/dist/domains/dam/user/components/DamDistributionServiceSelect.js.map +1 -1
  393. package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue.d.ts +1 -1
  394. package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  395. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.js.map +1 -1
  396. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue.d.ts +1 -1
  397. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  398. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.js.map +1 -1
  399. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue.d.ts +1 -1
  400. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  401. package/dist/domains/dam/user/composables/damUserSelectActions.d.ts +1 -1
  402. package/dist/domains/dam/user/composables/damUserSelectActions.js.map +1 -1
  403. package/dist/domains/dam/user/types/DamDistributionServiceType.d.ts +2 -2
  404. package/dist/domains/dam/user/types/DamDistributionServiceType.js.map +1 -1
  405. package/dist/domains/dam/user/types/DamExternalProviderAssetType.d.ts +1 -1
  406. package/dist/domains/dam/user/types/DamExternalProviderAssetType.js.map +1 -1
  407. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.js.map +1 -1
  408. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  409. package/dist/domains/filters/bookmarks/store/bookmarksStore.d.ts +3 -3
  410. package/dist/domains/filters/bookmarks/store/bookmarksStore.js.map +1 -1
  411. package/dist/domains/filters/components/AFilterDatetimePicker.js.map +1 -1
  412. package/dist/domains/filters/components/AFilterDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  413. package/dist/domains/filters/components/AFilterInteger.js.map +1 -1
  414. package/dist/domains/filters/components/AFilterInteger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  415. package/dist/domains/filters/components/AFilterString.js.map +1 -1
  416. package/dist/domains/filters/components/AFilterString.vue_vue_type_script_setup_true_lang.js.map +1 -1
  417. package/dist/domains/filters/components/AFilterTimeInterval.js +1 -1
  418. package/dist/domains/filters/components/AFilterTimeInterval.js.map +1 -1
  419. package/dist/domains/filters/components/AFilterTimeInterval.vue.d.ts +5 -3
  420. package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js.map +1 -1
  421. package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.js.map +1 -1
  422. package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  423. package/dist/domains/filters/components/AFilterWrapper.vue.d.ts +17 -15
  424. package/dist/domains/filters/components/AFilterWrapperSidebar.vue.d.ts +5 -3
  425. package/dist/domains/filters/components/FiltersSelected.js.map +1 -1
  426. package/dist/domains/filters/components/FiltersSelected.vue_vue_type_script_setup_true_lang.js.map +1 -1
  427. package/dist/domains/filters/composables/filterFactory.d.ts +16 -26
  428. package/dist/domains/filters/composables/filterFactory.js +38 -31
  429. package/dist/domains/filters/composables/filterFactory.js.map +1 -1
  430. package/dist/domains/filters/datatable/components/ADatatableOrdering.js.map +1 -1
  431. package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js +3 -1
  432. package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js.map +1 -1
  433. package/dist/domains/filters/datatable/components/ADatatablePagination.js.map +1 -1
  434. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js +2 -4
  435. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  436. package/dist/domains/filters/utils/filterInjectionKeys.js.map +1 -1
  437. package/dist/domains/form/components/AFormDatetimePicker.js.map +1 -1
  438. package/dist/domains/form/components/AFormDatetimePicker.vue.d.ts +7 -5
  439. package/dist/domains/form/components/AFormDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  440. package/dist/domains/form/components/AFormFlagDatetimePicker.js.map +1 -1
  441. package/dist/domains/form/components/AFormFlagDatetimePicker.vue.d.ts +7 -5
  442. package/dist/domains/form/components/AFormFlagDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  443. package/dist/domains/form/components/AFormSwitch.vue.d.ts +7 -5
  444. package/dist/domains/form/components/AFormTextField.js.map +1 -1
  445. package/dist/domains/form/components/AFormTextField.vue.d.ts +9 -7
  446. package/dist/domains/form/components/AFormTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  447. package/dist/domains/form/components/AFormTextarea.vue.d.ts +13 -11
  448. package/dist/domains/form/components/AFormValueObjectOptionsSelect.vue.d.ts +7 -5
  449. package/dist/domains/form/components/ASystemEntityScope.vue.d.ts +5 -3
  450. package/dist/domains/job/api/jobApi.js.map +1 -1
  451. package/dist/domains/job/components/AJobDetailCommon.vue.d.ts +5 -3
  452. package/dist/domains/listEditor/components/AListEditor.js.map +1 -1
  453. package/dist/domains/listEditor/components/AListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  454. package/dist/domains/listEditor/components/ANestedSortableListEditor.js.map +1 -1
  455. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue.d.ts +2 -3
  456. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  457. package/dist/domains/listEditor/components/ASortableListEditor.js.map +1 -1
  458. package/dist/domains/listEditor/components/ASortableListEditor.vue.d.ts +2 -3
  459. package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  460. package/dist/domains/listEditor/composables/useListEditorController.d.ts +4 -5
  461. package/dist/domains/listEditor/composables/useListEditorController.js.map +1 -1
  462. package/dist/domains/listEditor/composables/useNestedListEditor.d.ts +3 -4
  463. package/dist/domains/listEditor/composables/useNestedListEditor.js.map +1 -1
  464. package/dist/domains/listEditor/composables/useNestedListEditorController.d.ts +5 -4
  465. package/dist/domains/listEditor/composables/useNestedListEditorController.js.map +1 -1
  466. package/dist/domains/listEditor/composables/useReorderMode.js.map +1 -1
  467. package/dist/domains/listEditor/types/listEditorTypes.d.ts +2 -2
  468. package/dist/domains/listEditor/utils/listEditorLoader.d.ts +5 -5
  469. package/dist/domains/listEditor/utils/listEditorLoader.js.map +1 -1
  470. package/dist/domains/listEditor/utils/resolveCompactText.js.map +1 -1
  471. package/dist/domains/log/api/logApi.d.ts +2 -3
  472. package/dist/domains/log/api/logApi.js.map +1 -1
  473. package/dist/domains/log/components/ALogDatatable.js.map +1 -1
  474. package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  475. package/dist/domains/log/components/ALogDetailView.js.map +1 -1
  476. package/dist/domains/log/components/ALogDetailView.vue.d.ts +1 -1
  477. package/dist/domains/log/components/ALogDetailView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  478. package/dist/domains/log/components/ALogFilter.js.map +1 -1
  479. package/dist/domains/log/components/ALogFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  480. package/dist/domains/log/components/ALogListView.js.map +1 -1
  481. package/dist/domains/log/components/ALogListView.vue.d.ts +1 -1
  482. package/dist/domains/log/components/ALogListView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  483. package/dist/domains/log/composables/logActions.d.ts +4 -5
  484. package/dist/domains/log/composables/logActions.js.map +1 -1
  485. package/dist/domains/log/composables/logType.d.ts +6 -7
  486. package/dist/domains/log/composables/logType.js.map +1 -1
  487. package/dist/domains/log/filter/logFilter.d.ts +8 -11
  488. package/dist/domains/log/filter/logFilter.js.map +1 -1
  489. package/dist/domains/permission/components/APermissionEditor.js.map +1 -1
  490. package/dist/domains/permission/components/APermissionEditor.vue.d.ts +4 -4
  491. package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  492. package/dist/domains/permission/composables/permissionActions.d.ts +3 -6
  493. package/dist/domains/permission/composables/permissionActions.js.map +1 -1
  494. package/dist/domains/permission/config/api/permissionConfigApi.d.ts +2 -2
  495. package/dist/domains/permission/config/api/permissionConfigApi.js.map +1 -1
  496. package/dist/domains/permission/config/composables/permissionConfigActions.d.ts +3 -7
  497. package/dist/domains/permission/config/composables/permissionConfigActions.js.map +1 -1
  498. package/dist/domains/permission/config/store/permissionConfigStore.d.ts +2 -4
  499. package/dist/domains/permission/config/store/permissionConfigStore.js.map +1 -1
  500. package/dist/domains/permission/group/api/permissionGroupApi.d.ts +8 -10
  501. package/dist/domains/permission/group/api/permissionGroupApi.js.map +1 -1
  502. package/dist/domains/permission/group/components/APermissionGroupDatatable.js.map +1 -1
  503. package/dist/domains/permission/group/components/APermissionGroupDatatable.vue.d.ts +12 -10
  504. package/dist/domains/permission/group/components/APermissionGroupDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  505. package/dist/domains/permission/group/components/APermissionGroupDetail.js.map +1 -1
  506. package/dist/domains/permission/group/components/APermissionGroupDetail.vue.d.ts +21 -22
  507. package/dist/domains/permission/group/components/APermissionGroupDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
  508. package/dist/domains/permission/group/components/APermissionGroupManage.js.map +1 -1
  509. package/dist/domains/permission/group/components/APermissionGroupManage.vue.d.ts +21 -22
  510. package/dist/domains/permission/group/components/APermissionGroupManage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  511. package/dist/domains/permission/group/composables/cachedPermissionGroups.js.map +1 -1
  512. package/dist/domains/permission/group/composables/permissionGroupActions.d.ts +6 -8
  513. package/dist/domains/permission/group/composables/permissionGroupActions.js.map +1 -1
  514. package/dist/domains/permission/group/composables/permissionGroupValidations.d.ts +2 -3
  515. package/dist/domains/permission/group/composables/permissionGroupValidations.js.map +1 -1
  516. package/dist/domains/permission/group/filter/permissionGroupFilter.d.ts +2 -3
  517. package/dist/domains/permission/group/filter/permissionGroupFilter.js.map +1 -1
  518. package/dist/domains/permission/group/store/permissionGroupStore.d.ts +3 -6
  519. package/dist/domains/permission/group/store/permissionGroupStore.js.map +1 -1
  520. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.js.map +1 -1
  521. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  522. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.js.map +1 -1
  523. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  524. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.js.map +1 -1
  525. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  526. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.vue.d.ts +5 -3
  527. package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.d.ts +11 -13
  528. package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.js.map +1 -1
  529. package/dist/domains/subjectSelect/components/AFilterWrapperSubjectSelect.vue.d.ts +13 -11
  530. package/dist/domains/subjectSelect/components/ASubjectSelect.js.map +1 -1
  531. package/dist/domains/subjectSelect/components/ASubjectSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  532. package/dist/domains/subjectSelect/composables/useSubjectSelect.js +53 -51
  533. package/dist/domains/subjectSelect/composables/useSubjectSelect.js.map +1 -1
  534. package/dist/domains/system/appShell/components/AActionbar.vue.d.ts +7 -5
  535. package/dist/domains/system/appShell/components/ALayoutSwitch.js.map +1 -1
  536. package/dist/domains/system/appShell/components/ALayoutSwitch.vue.d.ts +7 -5
  537. package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  538. package/dist/domains/system/appShell/composables/teleportSlot.d.ts +0 -1
  539. package/dist/domains/system/appShell/composables/teleportSlot.js.map +1 -1
  540. package/dist/domains/system/components/AAlerts.js.map +1 -1
  541. package/dist/domains/system/components/AAlerts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  542. package/dist/domains/system/composables/alerts.js.map +1 -1
  543. package/dist/domains/system/composables/breadcrumbs.d.ts +3 -3
  544. package/dist/domains/system/composables/breadcrumbs.js.map +1 -1
  545. package/dist/domains/system/composables/languageSettings.js.map +1 -1
  546. package/dist/domains/system/composables/loginStatus.js.map +1 -1
  547. package/dist/domains/system/composables/navigationError.d.ts +6 -8
  548. package/dist/domains/system/composables/navigationError.js.map +1 -1
  549. package/dist/domains/system/composables/pageNavigation.d.ts +9 -10
  550. package/dist/domains/system/composables/pageNavigation.js.map +1 -1
  551. package/dist/domains/system/composables/recordActions.d.ts +14 -22
  552. package/dist/domains/system/composables/recordActions.js.map +1 -1
  553. package/dist/domains/system/composables/recordPage.d.ts +23 -38
  554. package/dist/domains/system/composables/recordPage.js.map +1 -1
  555. package/dist/domains/system/composables/routeHistory.d.ts +4 -5
  556. package/dist/domains/system/composables/routeHistory.js.map +1 -1
  557. package/dist/domains/system/composables/sentry.js.map +1 -1
  558. package/dist/domains/system/composables/useDebugFeatures.d.ts +3 -6
  559. package/dist/domains/system/composables/useDebugFeatures.js.map +1 -1
  560. package/dist/domains/system/store/datatablePageStore.d.ts +8 -1
  561. package/dist/domains/system/store/datatablePageStore.js +10 -3
  562. package/dist/domains/system/store/datatablePageStore.js.map +1 -1
  563. package/dist/domains/system/systemBar/components/ASystemBar.js.map +1 -1
  564. package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  565. package/dist/domains/system/systemBar/utils/appReload.d.ts +5 -5
  566. package/dist/domains/system/systemBar/utils/appReload.js.map +1 -1
  567. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.js.map +1 -1
  568. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue.d.ts +2 -3
  569. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue_vue_type_script_setup_true_lang.js.map +1 -1
  570. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.js.map +1 -1
  571. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  572. package/dist/domains/ui/buttons/components/ABtnSplit.vue.d.ts +9 -7
  573. package/dist/domains/ui/components/AAvatarColorPicker.js.map +1 -1
  574. package/dist/domains/ui/components/AAvatarColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  575. package/dist/domains/ui/components/ACard.js.map +1 -1
  576. package/dist/domains/ui/components/ACard.vue.d.ts +7 -3
  577. package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js +6 -2
  578. package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  579. package/dist/domains/ui/components/ACardLoader.js.map +1 -1
  580. package/dist/domains/ui/components/ACardLoader.vue.d.ts +1 -0
  581. package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js +13 -7
  582. package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  583. package/dist/domains/ui/components/AChipNoLink.vue.d.ts +5 -3
  584. package/dist/domains/ui/components/ACopyText.vue.d.ts +9 -7
  585. package/dist/domains/ui/components/ACreateDialog.js.map +1 -1
  586. package/dist/domains/ui/components/ACreateDialog.vue.d.ts +11 -9
  587. package/dist/domains/ui/components/ACreateDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  588. package/dist/domains/ui/components/ADialogToolbar.vue.d.ts +5 -3
  589. package/dist/domains/ui/components/ARow.vue.d.ts +5 -3
  590. package/dist/domains/ui/components/ATimeTrackingFields.js.map +1 -1
  591. package/dist/domains/ui/components/ATimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  592. package/dist/domains/ui/components/AUserAndTimeTrackingFields.js.map +1 -1
  593. package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue.d.ts +3 -5
  594. package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  595. package/dist/domains/ui/datetime/components/ADatetimePicker.js +1 -1
  596. package/dist/domains/ui/datetime/components/ADatetimePicker.js.map +1 -1
  597. package/dist/domains/ui/datetime/components/ADatetimePicker.vue.d.ts +5 -3
  598. package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  599. package/dist/domains/ui/file/components/AFileDropzone.js.map +1 -1
  600. package/dist/domains/ui/file/components/AFileDropzone.vue.d.ts +1 -1
  601. package/dist/domains/ui/file/components/AFileDropzone.vue_vue_type_script_setup_true_lang.js.map +1 -1
  602. package/dist/domains/ui/file/components/AFileInput.js.map +1 -1
  603. package/dist/domains/ui/file/components/AFileInput.vue.d.ts +9 -7
  604. package/dist/domains/ui/file/components/AFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  605. package/dist/domains/ui/file/components/AFileInputDialog.js.map +1 -1
  606. package/dist/domains/ui/file/components/AFileInputDialog.vue.d.ts +9 -7
  607. package/dist/domains/ui/file/components/AFileInputDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  608. package/dist/domains/ui/file/composables/dropzone.js.map +1 -1
  609. package/dist/domains/ui/file/composables/formatAndSizeCheck.js.map +1 -1
  610. package/dist/domains/ui/view/components/AGenericView.vue.d.ts +7 -5
  611. package/dist/domains/ui/view/components/ALoginView.js +1 -1
  612. package/dist/domains/ui/view/components/ALoginView.js.map +1 -1
  613. package/dist/domains/ui/view/components/ALoginView.vue.d.ts +5 -3
  614. package/dist/domains/ui/view/components/ALoginView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  615. package/dist/domains/ui/view/components/ALogoutView.js.map +1 -1
  616. package/dist/domains/ui/view/components/ALogoutView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  617. package/dist/domains/ui/view/components/ANotFoundView.js.map +1 -1
  618. package/dist/domains/ui/view/components/ANotFoundView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  619. package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.d.ts +6 -7
  620. package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.js.map +1 -1
  621. package/dist/lib.d.ts +2 -2
  622. package/dist/plugins/commonVuetifyConfig.d.ts +3 -3
  623. package/dist/plugins/commonVuetifyConfig.js.map +1 -1
  624. package/dist/plugins/i18n.d.ts +4 -5
  625. package/dist/plugins/i18n.js.map +1 -1
  626. package/dist/plugins/pluginOptions.d.ts +4 -2
  627. package/dist/plugins/pluginOptions.js.map +1 -1
  628. package/dist/plugins/webfontloader.js.map +1 -1
  629. package/dist/shared/error/AnzuApiCancelledError.d.ts +5 -8
  630. package/dist/shared/error/AnzuApiCancelledError.js.map +1 -1
  631. package/dist/shared/error/AnzuError.d.ts +3 -5
  632. package/dist/shared/error/AnzuError.js.map +1 -1
  633. package/dist/shared/error/AuthUnavailableError.d.ts +3 -3
  634. package/dist/shared/error/AuthUnavailableError.js.map +1 -1
  635. package/dist/shared/error/isInCauseChain.d.ts +2 -2
  636. package/dist/shared/error/isInCauseChain.js.map +1 -1
  637. package/dist/shared/types/UserAndTimeTracking.d.ts +5 -5
  638. package/dist/shared/types/Validation.d.ts +4 -5
  639. package/dist/shared/types/common.d.ts +1 -3
  640. package/dist/shared/types/globalComponents.d.ts +5 -6
  641. package/dist/shared/utils/common.js.map +1 -1
  642. package/dist/shared/utils/datetime.d.ts +0 -1
  643. package/dist/shared/utils/datetime.js.map +1 -1
  644. package/dist/shared/utils/datetimePickerValue.d.ts +4 -7
  645. package/dist/shared/utils/datetimePickerValue.js.map +1 -1
  646. package/dist/shared/utils/development.d.ts +3 -3
  647. package/dist/shared/utils/development.js.map +1 -1
  648. package/dist/shared/utils/envConfig.d.ts +4 -4
  649. package/dist/shared/utils/envConfig.js.map +1 -1
  650. package/dist/shared/utils/json.d.ts +1 -1
  651. package/dist/shared/utils/json.js.map +1 -1
  652. package/dist/shared/utils/userAndTimeTracking.d.ts +5 -7
  653. package/dist/shared/utils/userAndTimeTracking.js.map +1 -1
  654. package/dist/shared/validators/vuelidate/common/useValidateHexColor.d.ts +3 -5
  655. package/dist/shared/validators/vuelidate/common/useValidateHexColor.js.map +1 -1
  656. package/dist/testing/appShell.d.ts +11 -11
  657. package/dist/testing/appShell.js.map +1 -1
  658. package/dist/testing/closeButtons.d.ts +9 -11
  659. package/dist/testing/closeButtons.js.map +1 -1
  660. package/dist/testing/declaredDependencies.d.ts +7 -7
  661. package/dist/testing/declaredDependencies.js.map +1 -1
  662. package/dist/testing/generatedRoutes.d.ts +6 -11
  663. package/dist/testing/generatedRoutes.js.map +1 -1
  664. package/dist/testing/routeHistory.d.ts +5 -12
  665. package/dist/testing/routeHistory.js.map +1 -1
  666. package/dist/testing/sortableLists.d.ts +16 -21
  667. package/dist/testing/sortableLists.js.map +1 -1
  668. package/dist/testing/typedRouter.d.ts +0 -1
  669. package/dist/testing/typedRouter.js.map +1 -1
  670. package/package.json +26 -26
  671. package/src/eslint/adminConfig.mjs +19 -27
  672. package/src/eslint/globalComponentNames.mjs +3 -4
  673. package/src/eslint/oxlint.mjs +7 -20
  674. package/src/eslint/plugin.d.mts +2 -4
  675. package/src/eslint/plugin.mjs +18 -34
  676. package/src/eslint/validRouteName.mjs +6 -7
  677. package/src/vite/devWatch.mjs +30 -43
  678. package/src/vite/index.d.mts +5 -5
  679. package/src/vite/sentry.mjs +7 -12
  680. package/src/vite/sourcemaps.mjs +4 -8
@@ -1 +1 @@
1
- {"version":3,"file":"uploadSettlement.js","names":["TICK_INTENT","createUploadSettlement","memory","createUploadSettleMemory","pollers","pending","unsubscribe","disposed","generations","lanes","laneOf","key","profile","configName","lane","laneOfQueue","queueKey","laneOfTarget","target","failureReported","error","scheduler","uploadSettlementRuntime","isDisposed","generationOf","trackedRows","tracked","queue","row","state","toRaw","UploadQueueItemStatus","isNull","youngestAgeMs","now","youngest","age","settle","createUploadSettle","enqueueRead","result","run","fetchCaches","namesOfQueue","countMiss","missesOfLeft","countsMissesOfLeft","countMissOfLeft","raw","misses","concernedRows","all","targets","intent","anyRowMatches","purpose","readSucceeded","rows","untold","readUnitsOf","byLicence","bySlotAsset","reader","byAsset","units","licenceId","assetIds","asset","options","from","batch","assetId","assets","slotRows","slotFiles","applyAssets","goesOn","startedAt","present","unit","applySlotFile","file","candidate","configNames","AssetFileProcessStatus","scheduleNamed","applySlotFiles","readQueue","generation","answers","index","failed","reportedFailure","answer","told","report","notice","mergeTarget","fileId","known","read","armNamed","delay","fireNamed","releaseWaiters","waiters","resolve","names","scheduleRead","delayMs","name","isUndefined","waiting","readNamed","retryNamed","UPLOAD_POLL_ERROR_LADDER_MS","attempt","warnAboutRead","namesOfRead","rowsOfRead","askedFor","left","exhausted","warned","entry","concerned","untracked","OUTCOME_ORDER","readTargetNow","readOneNow","one","outcomes","outcome","givenUp","askedOn","leftWithout","isFinalFileStatus","refreshAsset","settleKnownProcessed","settleKnownFailed","failReason","settleKnownDuplicate","originFileId","assetType","notify","event","UPLOAD_NOTIFY_METADATA_DELAY_MS","AssetFileFailReason","subscribe","visible","poller","unsubscribeAll","stop","pollerOf","createQueuePoller","queueOf","track","item","cancelUnneeded","leaving"],"sources":["../../../../../src/domains/dam/uploadQueue/settlement/uploadSettlement.ts"],"sourcesContent":["import { toRaw } from 'vue'\nimport type { DocId, DocIdNullable, IntegerId } from '@/shared/types/common'\nimport type { AssetDetailItemDto, DamAssetTypeType } from '@/domains/dam/types/Asset'\nimport {\n AssetFileFailReason,\n type AssetFileFailReasonType,\n type AssetFileNullable,\n AssetFileProcessStatus,\n} from '@/domains/dam/types/AssetFile'\nimport {\n type UploadQueue,\n type UploadQueueItem,\n UploadQueueItemStatus,\n type UploadQueueKey,\n} from '@/domains/dam/types/UploadQueue'\nimport { createQueuePoller, type QueuePoller } from '@/domains/dam/uploadQueue/settlement/uploadPoller'\nimport {\n UPLOAD_NOTIFY_FILE_DELAY_MS,\n UPLOAD_NOTIFY_METADATA_DELAY_MS,\n UPLOAD_POLL_ERROR_LADDER_MS,\n UPLOAD_POLL_MISSING_LIMIT,\n UPLOAD_POLL_READ_FAILURE_LIMIT,\n UPLOAD_POLL_SLOW_TEXT_AFTER_MS,\n UPLOAD_READ_BATCH_LIMIT,\n} from '@/domains/dam/uploadQueue/settlement/uploadPollSchedule'\nimport {\n createUploadSettle,\n createUploadSettleMemory,\n isFinalFileStatus,\n type UploadReadIntent,\n type UploadTrackState,\n} from '@/domains/dam/uploadQueue/settlement/uploadSettle'\nimport { uploadSettlementRuntime } from '@/domains/dam/uploadQueue/settlement/uploadSettlementRuntime'\nimport type {\n UploadReadOptions,\n UploadRefreshOutcome,\n UploadSettlement,\n UploadSettlementEvent,\n UploadSettlementProfile,\n UploadSettlementTarget,\n} from '@/domains/dam/uploadQueue/settlement/uploadSettlementTypes'\nimport { isNull, isUndefined } from '@/shared/utils/common'\n\ninterface TrackedRow {\n queueKey: UploadQueueKey\n queue: UploadQueue\n row: UploadQueueItem\n state: UploadTrackState\n /** The asset the row is read by. A duplicate that becomes its original changes the one of the row. */\n assetId: DocId\n}\n\n/** One request of a tick, and the tracked rows it asks about. */\ninterface ReadUnit {\n rows: TrackedRow[]\n /** `missing`: the one asset that was asked for by itself does not exist, which its reader was free to report. */\n read(\n options: UploadReadOptions\n ): Promise<{ assets: AssetDetailItemDto[]; missing?: boolean } | { slotFiles: AssetFileNullable[] }>\n}\n\n/** The reads of one DAM, one after another, and whether a streak of their failures is being reported. */\ninterface ReadLane {\n chain: Promise<void>\n failing: boolean\n}\n\n/** A read of one asset an event asked for, waiting for its time. */\ninterface PendingNamedRead {\n /** Of `pending`: the asset, and the configuration the read is for. */\n key: string\n assetId: DocId\n /** The configuration whose rows the read is for (`configOf` of the profile); every queue's when left out. */\n configName?: string\n // By `fileId ?? ''`.\n targets: Map<string, { fileId: DocIdNullable; intent: UploadReadIntent }>\n dueAt: number\n /** Failed tries in a row. */\n failures: number\n /** Tries in a row that found no asset. */\n misses: number\n /** A failure of its tries was written down: the next ones are not reported. */\n told: boolean\n timer: { handle: unknown } | null\n waiters: Array<() => void>\n}\n\nconst TICK_INTENT: UploadReadIntent = { hint: null, metadata: true, early: false, seen: true }\n\n/**\n * The settlement of the rows of one store: which rows wait for the server, one coordinator of all the reads, and\n * what starts a read: the tick of a queue, a notification, the refresh of a row.\n */\nexport function createUploadSettlement(profile: UploadSettlementProfile): UploadSettlement {\n const memory = createUploadSettleMemory()\n const pollers = new Map<UploadQueueKey, QueuePoller>()\n // One read of an asset waits at a time, and with the configurations of the queues one for each configuration.\n const pending = new Map<string, PendingNamedRead>()\n let unsubscribe: Array<() => void> = []\n let disposed = false\n // Raised when a queue is dropped: a tick that waited for its turn meanwhile is not for the queue that has the\n // key now.\n const generations = new Map<UploadQueueKey, number>()\n // The poll and the notifications ask for as long as a row waits, and a reader is to report only the first of\n // their requests that fails and is written down: `failing` of the lane from such a failure until a read answers,\n // and beside it the `reported` of each tracked row, until a read brings its asset. A failure that was not written\n // down (a timeout, 401, 403, as the readers say) has told nobody, and begins nothing.\n // One read at a time in a lane: its reads have one order, and a later one never overtakes. With the configurations\n // of the queues (`configOf`) a lane for each configuration, and one for the reads that name none: a slow DAM holds\n // back no read of another, and the failures of each are a streak of their own. Without them, one lane for the\n // whole store, as ever.\n const lanes = new Map<string | undefined, ReadLane>()\n const laneOf = (configName?: string) => {\n const key = profile.configOf ? configName : undefined\n let lane = lanes.get(key)\n if (!lane) {\n lane = { chain: Promise.resolve(), failing: false }\n lanes.set(key, lane)\n }\n return lane\n }\n /** The lane of the reads of the queue. */\n const laneOfQueue = (queueKey: UploadQueueKey) => laneOf(profile.configOf?.(queueKey))\n /** The lane of the reads of a target: of the one configuration it names. */\n const laneOfTarget = (target: UploadSettlementTarget) =>\n laneOf(target.configNames?.length === 1 ? target.configNames[0] : undefined)\n const failureReported = (error: unknown) => profile.readers.failureReported?.(error) ?? true\n\n const scheduler = () => uploadSettlementRuntime.scheduler\n // Asked anew after every wait: nothing is written, called or planned for a settlement that was disposed of.\n const isDisposed = () => disposed\n const generationOf = (queueKey: UploadQueueKey) => generations.get(queueKey) ?? 0\n\n const trackedRows = (queueKey?: UploadQueueKey): TrackedRow[] => {\n const tracked: TrackedRow[] = []\n for (const [key, queue] of profile.queues()) {\n if (queueKey !== undefined && key !== queueKey) continue\n for (const row of queue.items) {\n const state = memory.tracked.get(toRaw(row))\n if (!state || state.queueKey !== key) continue\n if (row.status === UploadQueueItemStatus.Stop || isNull(row.assetId)) continue\n tracked.push({ queueKey: key, queue, row, state, assetId: row.assetId })\n }\n }\n return tracked\n }\n\n const youngestAgeMs = (queueKey: UploadQueueKey) => {\n const now = scheduler().now()\n let youngest: number | null = null\n for (const { state } of trackedRows(queueKey)) {\n const age = now - state.eligibleSince\n if (youngest === null || age < youngest) youngest = age\n }\n return youngest\n }\n\n const settle = createUploadSettle(profile, memory, {\n // A queue that tracks nothing any more holds no timer.\n onUntrack: (queueKey) => {\n if (youngestAgeMs(queueKey) === null) pollers.get(queueKey)?.reschedule()\n },\n isDisposed,\n })\n\n const enqueueRead = <T>(lane: ReadLane, run: (startedAt: number) => Promise<T>): Promise<T> => {\n const result = lane.chain.then(() => run(settle.startRead()))\n lane.chain = result.then(\n () => undefined,\n () => undefined\n )\n return result\n }\n\n const fetchCaches = () => settle.fetchNames()\n\n /** The configuration of the queue, as a target names it; nothing for a profile without `configOf`. */\n const namesOfQueue = (queueKey: UploadQueueKey) => (profile.configOf ? [profile.configOf(queueKey)] : undefined)\n\n /** Answers whether this miss was the one too many: the row is given up. */\n const countMiss = (tracked: Pick<TrackedRow, 'queueKey' | 'row' | 'state'>) => {\n tracked.state.misses++\n if (tracked.state.misses < UPLOAD_POLL_MISSING_LIMIT) return false\n settle.giveUpOnMissing(tracked)\n return true\n }\n\n // A row left failed without the original of its duplicate, and an uploaded one still without its metadata, are\n // no longer tracked, and a refresh may still help them. The reads that find no asset are counted for them here,\n // across them all and until one answers: at the limit there is nothing a refresh could read, and the uploaded\n // row fails. Answers as `countMiss` does.\n const missesOfLeft = new WeakMap<UploadQueueItem, number>()\n const countsMissesOfLeft = (row: UploadQueueItem) =>\n memory.refreshMayHelp.has(toRaw(row)) || settle.awaitsMetadata(row)\n const countMissOfLeft = ({ queueKey, row }: { queueKey: UploadQueueKey; row: UploadQueueItem }) => {\n const raw = toRaw(row)\n if (!countsMissesOfLeft(row)) return false\n const misses = (missesOfLeft.get(raw) ?? 0) + 1\n if (misses < UPLOAD_POLL_MISSING_LIMIT) {\n missesOfLeft.set(raw, misses)\n return false\n }\n missesOfLeft.delete(raw)\n settle.giveUpOnMissing({ queueKey, row })\n return true\n }\n\n /** The live rows a read of the asset would write into, for any of the given targets, of the configurations named. */\n const concernedRows = (\n assetId: DocId,\n targets: Iterable<{ fileId: DocIdNullable; intent: Pick<UploadReadIntent, 'early'> }>,\n configNames?: string[]\n ) => {\n const all = [...targets]\n return settle.rows().filter(({ queueKey, row }) => {\n if (row.status === UploadQueueItemStatus.Stop) return false\n return all.some(({ fileId, intent }) => {\n const target = { assetId, fileId, configNames }\n return (\n settle.concerns(queueKey, row, target, 'decorate') ||\n (intent.early && settle.concerns(queueKey, row, target, 'metadata'))\n )\n })\n })\n }\n\n const anyRowMatches = (target: UploadSettlementTarget, purpose: 'settle' | 'decorate' | 'metadata') =>\n settle\n .rows()\n .some(\n ({ queueKey, row }) =>\n row.status !== UploadQueueItemStatus.Stop && settle.concerns(queueKey, row, target, purpose)\n )\n\n // A read brought the asset of these rows: the counts of the tracked ones start anew, and their warning goes.\n const readSucceeded = (rows: Array<{ row: UploadQueueItem }>) => {\n for (const { row } of rows) {\n missesOfLeft.delete(toRaw(row))\n const state = settle.trackStateOf(row)\n if (!state) continue\n state.misses = 0\n state.readFailures = 0\n state.reported = false\n settle.noticeOf(row).readWarning = false\n settle.syncNotice(row)\n }\n }\n\n const untold = (rows: Array<{ row: UploadQueueItem }>) =>\n rows.every(({ row }) => settle.trackStateOf(row)?.reported !== true)\n\n // ---- the tick of a queue\n\n const readUnitsOf = (rows: TrackedRow[]): ReadUnit[] => {\n const byLicence = new Map<IntegerId, Map<DocId, TrackedRow[]>>()\n const bySlotAsset = new Map<DocId, TrackedRow[]>()\n for (const tracked of rows) {\n const reader = settle.policyOf(tracked.row).reader\n if (reader === 'none') continue\n let byAsset = bySlotAsset\n if (reader === 'asset') {\n byAsset = byLicence.get(tracked.row.licenceId) ?? new Map<DocId, TrackedRow[]>()\n byLicence.set(tracked.row.licenceId, byAsset)\n }\n byAsset.set(tracked.assetId, [...(byAsset.get(tracked.assetId) ?? []), tracked])\n }\n\n const units: ReadUnit[] = []\n for (const [licenceId, byAsset] of byLicence) {\n const assetIds = [...byAsset.keys()]\n // One asset is asked for by itself, as a notification asks for it.\n if (assetIds.length === 1) {\n units.push({\n rows: byAsset.get(assetIds[0]!)!,\n read: async (options) => {\n const asset = await profile.readers.asset(assetIds[0]!, options)\n return { assets: asset ? [asset] : [], missing: asset === null }\n },\n })\n continue\n }\n for (let from = 0; from < assetIds.length; from += UPLOAD_READ_BATCH_LIMIT) {\n const batch = assetIds.slice(from, from + UPLOAD_READ_BATCH_LIMIT)\n units.push({\n rows: batch.flatMap((assetId) => byAsset.get(assetId)!),\n read: async (options) => {\n const assets = await profile.readers.assets(licenceId, batch, options)\n // Not \"every asset is missing\".\n if (!Array.isArray(assets)) throw new Error('uploadSettlement: unexpected asset list')\n return { assets }\n },\n })\n }\n }\n for (const [assetId, slotRows] of bySlotAsset) {\n units.push({\n rows: slotRows,\n read: async (options) => {\n if (!profile.readers.slotFiles) throw new Error('uploadSettlement: no reader of the slots')\n const slotFiles = await profile.readers.slotFiles(assetId, options)\n if (!Array.isArray(slotFiles)) throw new Error('uploadSettlement: unexpected slot list')\n return { slotFiles }\n },\n })\n }\n return units\n }\n\n const applyAssets = async (\n unit: ReadUnit,\n assets: AssetDetailItemDto[],\n startedAt: number,\n goesOn: () => boolean,\n configNames: string[] | undefined\n ) => {\n for (const asset of assets) {\n if (!goesOn()) return\n try {\n await settle.applyAssetRead(\n asset,\n { assetId: asset.id, fileId: asset.mainFile?.id ?? null, configNames },\n TICK_INTENT,\n startedAt\n )\n } catch (error) {\n // One asset that cannot be written is not the end of the tick: the others, and the counts and the texts of\n // every row, go on.\n console.error('uploadQueue: a read asset could not be written', error)\n }\n }\n if (!goesOn()) return\n const present = new Set(assets.map((asset) => asset.id))\n for (const { state, assetId } of unit.rows) {\n if (present.has(assetId)) {\n state.misses = 0\n state.reported = false\n } else {\n state.misses++\n }\n }\n }\n\n const applySlotFile = async (tracked: TrackedRow, slotFiles: AssetFileNullable[], startedAt: number) => {\n const { row, state, assetId } = tracked\n if (!settle.isLive(row) || row.status === UploadQueueItemStatus.Stop || settle.isStale(row, startedAt)) return\n const file = slotFiles.find((candidate) => candidate?.id === row.fileId)\n if (!file) {\n state.misses++\n return\n }\n state.misses = 0\n state.reported = false\n const configNames = namesOfQueue(tracked.queueKey)\n const target = { assetId, fileId: row.fileId, configNames }\n switch (file.fileAttributes?.status) {\n case AssetFileProcessStatus.Processed:\n settle.settleProcessedByEvent(target)\n // The asset completes the row, and gives an open detail its main file. Not awaited: it waits for this\n // very read to end.\n void scheduleNamed(\n assetId,\n row.fileId,\n { hint: 'processed', metadata: false, early: false, seen: true },\n 0,\n configNames\n )\n break\n case AssetFileProcessStatus.Failed:\n settle.settleFailed(tracked, file.fileAttributes.failReason)\n break\n case AssetFileProcessStatus.Duplicate:\n await settle.settleDuplicate(target, file.originAssetFile, row.assetType, (candidate) => {\n return !settle.isStale(candidate, startedAt)\n })\n break\n }\n }\n\n // The bulk read carries only the main file of an asset, so a slot row is read from the list of its asset's slots.\n const applySlotFiles = async (\n unit: ReadUnit,\n slotFiles: AssetFileNullable[],\n startedAt: number,\n goesOn: () => boolean\n ) => {\n for (const tracked of unit.rows) {\n if (!goesOn()) return\n try {\n await applySlotFile(tracked, slotFiles, startedAt)\n } catch (error) {\n console.error('uploadQueue: a read slot file could not be written', error)\n }\n }\n }\n\n const readQueue = async (queueKey: UploadQueueKey, generation: number, startedAt: number) => {\n // Asked when the tick gets its turn and after every wait: it may have waited behind another read, and its\n // queue may have been dropped meanwhile, with another one under the same key by now.\n const goesOn = () => !isDisposed() && generationOf(queueKey) === generation\n if (!goesOn()) return\n const lane = laneOfQueue(queueKey)\n const units = readUnitsOf(trackedRows(queueKey))\n if (!units.length) return\n // Each request is told whether a failure of it is the first of a streak: for every request of a tick that\n // begins one, since they go out together.\n const options = units.map((unit) => ({\n report: !lane.failing && unit.rows.every(({ state }) => !state.reported),\n queueKey,\n }))\n // The requests go out together; what they brought is written one after another.\n const answers = await Promise.allSettled(units.map((unit, index) => unit.read(options[index]!)))\n if (!goesOn()) return\n let failed = 0\n let reportedFailure = false\n for (const [index, unit] of units.entries()) {\n const answer = answers[index]!\n const { report } = options[index]!\n if (answer.status === 'rejected') {\n failed++\n const told = report && failureReported(answer.reason)\n if (told) reportedFailure = true\n unit.rows.forEach(({ state }) => {\n state.readFailures++\n if (told) state.reported = true\n })\n continue\n }\n unit.rows.forEach(({ state }) => (state.readFailures = 0))\n if ('assets' in answer.value) {\n // Into the rows of the configuration of the queue alone: another DAM may have an asset of that id.\n await applyAssets(unit, answer.value.assets, startedAt, goesOn, namesOfQueue(queueKey))\n // The reader has said so, when it was let: it is not let again for these rows.\n if (answer.value.missing && report) unit.rows.forEach(({ state }) => (state.reported = true))\n } else {\n await applySlotFiles(unit, answer.value.slotFiles, startedAt, goesOn)\n }\n if (!goesOn()) return\n }\n // A request that answered ends the streak; one that failed and was written down begins it.\n if (failed < units.length) lane.failing = false\n else if (reportedFailure) lane.failing = true\n fetchCaches()\n\n const now = scheduler().now()\n for (const tracked of trackedRows(queueKey)) {\n const { row, state } = tracked\n if (state.misses >= UPLOAD_POLL_MISSING_LIMIT) {\n settle.giveUpOnMissing(tracked)\n continue\n }\n const notice = settle.noticeOf(row)\n if (state.readFailures >= UPLOAD_POLL_READ_FAILURE_LIMIT) notice.readWarning = true\n else if (state.readFailures === 0) notice.readWarning = false\n const waitsForServer = row.status === UploadQueueItemStatus.Processing && !state.clientFailed\n if (waitsForServer && now - state.eligibleSince >= UPLOAD_POLL_SLOW_TEXT_AFTER_MS) notice.slow = true\n settle.syncNotice(row)\n }\n\n // The poller takes this for a failed read and waits by its error ladder.\n if (failed === units.length) throw new Error('uploadSettlement: the read of the queue failed')\n }\n\n // ---- reads a notification asks for\n\n const mergeTarget = (read: PendingNamedRead, fileId: DocIdNullable, intent: UploadReadIntent) => {\n const key = fileId ?? ''\n const known = read.targets.get(key)?.intent\n read.targets.set(key, {\n fileId,\n intent: known\n ? {\n hint: known.hint ?? intent.hint,\n metadata: known.metadata || intent.metadata,\n early: known.early || intent.early,\n seen: known.seen || intent.seen,\n }\n : { ...intent },\n })\n }\n\n const armNamed = (read: PendingNamedRead) => {\n if (read.timer) scheduler().clearTimeout(read.timer.handle)\n const delay = Math.max(0, read.dueAt - scheduler().now())\n read.timer = { handle: scheduler().setTimeout(() => fireNamed(read), delay) }\n }\n\n const releaseWaiters = (read: PendingNamedRead) => {\n const waiters = read.waiters\n read.waiters = []\n waiters.forEach((resolve) => resolve())\n }\n\n /**\n * A read of the named asset in `delayMs`; joins the read of that asset that waits already. Of each configuration\n * named, a read of its own for the rows of its queues; without one, a read for the rows of every queue.\n */\n const scheduleNamed = (\n assetId: DocId,\n fileId: DocIdNullable,\n intent: UploadReadIntent,\n delayMs: number,\n configNames?: string[]\n ) => {\n const names = profile.configOf && configNames?.length ? [...new Set(configNames)] : [undefined]\n return Promise.all(names.map((name) => scheduleRead(assetId, fileId, intent, delayMs, name))).then(() => undefined)\n }\n\n const scheduleRead = (\n assetId: DocId,\n fileId: DocIdNullable,\n intent: UploadReadIntent,\n delayMs: number,\n configName: string | undefined\n ) => {\n const key = isUndefined(configName) ? assetId : `${configName}\\u0000${assetId}`\n let read = pending.get(key)\n if (!read) {\n read = {\n key,\n assetId,\n configName,\n targets: new Map(),\n dueAt: Infinity,\n failures: 0,\n misses: 0,\n told: false,\n timer: null,\n waiters: [],\n }\n pending.set(key, read)\n }\n mergeTarget(read, fileId, intent)\n read.dueAt = Math.min(read.dueAt, scheduler().now() + delayMs)\n armNamed(read)\n const waiting = read\n return new Promise<void>((resolve) => waiting.waiters.push(resolve))\n }\n\n const fireNamed = (read: PendingNamedRead) => {\n read.timer = null\n if (pending.get(read.key) === read) pending.delete(read.key)\n void enqueueRead(laneOf(read.configName), (startedAt) => readNamed(read, startedAt))\n }\n\n const retryNamed = (read: PendingNamedRead, attempt: number) => {\n const delay = UPLOAD_POLL_ERROR_LADDER_MS[Math.min(attempt, UPLOAD_POLL_ERROR_LADDER_MS.length) - 1]!\n const waiting = pending.get(read.key)\n if (!waiting) {\n read.dueAt = scheduler().now() + delay\n pending.set(read.key, read)\n armNamed(read)\n return\n }\n // An event came while this read was on its way and waits in a read of its own: the retry joins it.\n read.targets.forEach(({ fileId, intent }) => mergeTarget(waiting, fileId, intent))\n waiting.failures = Math.max(waiting.failures, read.failures)\n waiting.misses = Math.max(waiting.misses, read.misses)\n waiting.told ||= read.told\n }\n\n const warnAboutRead = (rows: Array<{ row: UploadQueueItem }>) => {\n for (const { row } of rows) {\n settle.noticeOf(row).readWarning = true\n settle.syncNotice(row)\n }\n }\n\n /** The configurations a pending read names: its own, or none. */\n const namesOfRead = (read: PendingNamedRead) => (isUndefined(read.configName) ? undefined : [read.configName])\n /** The rows the pending read is for, as they are now. */\n const rowsOfRead = (read: PendingNamedRead) => concernedRows(read.assetId, read.targets.values(), namesOfRead(read))\n\n const readNamed = async (read: PendingNamedRead, startedAt: number) => {\n try {\n // The rows it was for have left their queues meanwhile: nothing to ask for.\n const askedFor = rowsOfRead(read)\n if (isDisposed() || !askedFor.length) return\n const lane = laneOf(read.configName)\n // Until one of its tries was written down, when no streak runs and none of its rows has had its trouble\n // reported.\n const report = !lane.failing && !read.told && read.misses === 0 && untold(askedFor)\n let asset: AssetDetailItemDto | null\n try {\n asset = await profile.readers.asset(read.assetId, { report, queueKey: askedFor[0]!.queueKey })\n } catch (error) {\n if (isDisposed()) return\n // Its rows left while it was on the wire: nobody waits for another try, and it begins no streak.\n const left = rowsOfRead(read)\n if (!left.length) return\n read.failures++\n const told = report && failureReported(error)\n if (told) {\n read.told = true\n lane.failing = true\n }\n // The count of the read times its tries, and says when a row no tick asks about has waited in vain. A\n // tracked row warns by its own count: ticks fail and succeed for it between the tries of this read.\n const exhausted = read.failures >= UPLOAD_POLL_READ_FAILURE_LIMIT\n const warned: Array<{ row: UploadQueueItem }> = []\n for (const entry of left) {\n const state = settle.trackStateOf(entry.row)\n if (state) {\n state.readFailures++\n if (told) state.reported = true\n }\n if (state ? state.readFailures >= UPLOAD_POLL_READ_FAILURE_LIMIT : exhausted) warned.push(entry)\n }\n // Once exhausted, only the refresh of the row asks again.\n if (!exhausted) retryNamed(read, read.failures)\n warnAboutRead(warned)\n return\n }\n if (isDisposed()) return\n read.failures = 0\n lane.failing = false\n if (asset === null) {\n read.misses++\n const concerned = rowsOfRead(read)\n const untracked = concerned.filter(({ row }) => !settle.trackStateOf(row))\n for (const { queueKey, row } of concerned) {\n const state = settle.trackStateOf(row)\n if (!state) {\n countMissOfLeft({ queueKey, row })\n continue\n }\n if (report) state.reported = true\n countMiss({ queueKey, row, state })\n }\n // Nobody is left to try again for.\n if (!concerned.length) return\n if (read.misses < UPLOAD_POLL_MISSING_LIMIT) retryNamed(read, read.misses)\n // A row an event has settled is not flipped to failed; it only says its data could not be read. One still\n // without its metadata has failed by its count above.\n else warnAboutRead(untracked)\n return\n }\n readSucceeded(rowsOfRead(read))\n for (const { fileId, intent } of read.targets.values()) {\n if (isDisposed()) return\n await settle.applyAssetRead(\n asset,\n { assetId: read.assetId, fileId, configNames: namesOfRead(read) },\n intent,\n startedAt\n )\n }\n if (isDisposed()) return\n fetchCaches()\n } catch (error) {\n console.error('uploadQueue: the asset of a notification could not be settled', error)\n } finally {\n releaseWaiters(read)\n }\n }\n\n // ---- reads asked for at once\n\n // Of the reads of several configurations, the outcome first in this order that any of them had is told.\n const OUTCOME_ORDER: UploadRefreshOutcome[] = ['error', 'originalUnread', 'missing', 'pending', 'settled']\n\n /**\n * What the one who asked is told of the read. What asking again may mend, by its cause: the read failed\n * (`error`), the asset was not found (`missing`), or a row is left without the original of its duplicate\n * (`originalUnread`). A target that names several configurations is read once for each, by a queue of it.\n */\n const readTargetNow = (target: UploadSettlementTarget, intent: UploadReadIntent): Promise<UploadRefreshOutcome> => {\n const targets = settle.byConfiguration(target)\n if (targets.length === 1) return readOneNow(target, intent)\n return Promise.all(targets.map((one) => readOneNow(one, intent))).then(\n (outcomes) => OUTCOME_ORDER.find((outcome) => outcomes.includes(outcome)) ?? 'settled'\n )\n }\n\n const readOneNow = (target: UploadSettlementTarget, intent: UploadReadIntent): Promise<UploadRefreshOutcome> =>\n enqueueRead(laneOfTarget(target), async (startedAt) => {\n try {\n if (isDisposed()) return 'error'\n // The queue of the first row the read is for, noted before it is asked.\n const queueKey = concernedRows(target.assetId, [{ fileId: target.fileId, intent }], target.configNames)[0]\n ?.queueKey\n // A configuration named that has no row of the asset (any longer): its DAM is not asked.\n if (profile.configOf && target.configNames?.length && isUndefined(queueKey)) return 'settled'\n // The user asked: every failure of it is reported.\n const asset = await profile.readers.asset(target.assetId, { report: true, queueKey })\n if (isDisposed()) return 'error'\n laneOfTarget(target).failing = false\n const concerned = concernedRows(target.assetId, [{ fileId: target.fileId, intent }], target.configNames)\n if (asset === null) {\n let givenUp = false\n let askedOn = false\n for (const { queueKey, row } of concerned) {\n const state = settle.trackStateOf(row)\n // Said by this read: the poll does not say it again.\n if (state) state.reported = true\n if (state ? countMiss({ queueKey, row, state }) : countMissOfLeft({ queueKey, row })) givenUp = true\n else if (state || countsMissesOfLeft(row)) askedOn = true\n }\n // The miss that was one too many has settled its rows, as given up: there is nothing to ask again.\n return givenUp && !askedOn ? 'settled' : 'missing'\n }\n readSucceeded(concerned)\n const leftWithout = await settle.applyAssetRead(asset, target, intent, startedAt)\n if (isDisposed()) return 'error'\n fetchCaches()\n if (leftWithout) return 'originalUnread'\n // Otherwise by the state of the main file alone, whichever rows were written.\n return isFinalFileStatus(asset.mainFile?.fileAttributes?.status) ? 'settled' : 'pending'\n } catch {\n return 'error'\n }\n })\n\n const refreshAsset = (target: UploadSettlementTarget) =>\n readTargetNow(target, { hint: null, metadata: true, early: false, seen: true })\n\n const settleKnownProcessed = async (target: UploadSettlementTarget, options: { withMetadata: boolean }) => {\n await readTargetNow(target, { hint: 'processed', metadata: options.withMetadata, early: false, seen: true })\n }\n\n const settleKnownFailed = (target: UploadSettlementTarget, failReason: AssetFileFailReasonType) => {\n if (isDisposed()) return\n settle.settleKnownFailed(target, failReason)\n }\n\n const settleKnownDuplicate = (\n target: UploadSettlementTarget,\n originFileId: DocIdNullable,\n assetType: DamAssetTypeType | null\n ) => (isDisposed() ? Promise.resolve() : settle.settleKnownDuplicate(target, originFileId, assetType))\n\n const notify = (event: UploadSettlementEvent): Promise<void> => {\n if (isDisposed()) return Promise.resolve()\n const target = { assetId: event.assetId, fileId: event.fileId, configNames: event.configNames }\n try {\n switch (event.kind) {\n case 'processed':\n if (!anyRowMatches(target, 'decorate')) break\n settle.settleProcessedByEvent(target)\n settle.announceProcessed(target)\n return scheduleNamed(\n event.assetId,\n event.fileId,\n { hint: 'processed', metadata: false, early: false, seen: true },\n UPLOAD_NOTIFY_FILE_DELAY_MS,\n event.configNames\n )\n case 'copied':\n if (!anyRowMatches(target, 'decorate')) break\n // A copy gets no metadata notification: its metadata comes with this read.\n return scheduleNamed(\n event.assetId,\n event.fileId,\n { hint: 'processed', metadata: true, early: false, seen: true },\n UPLOAD_NOTIFY_FILE_DELAY_MS,\n event.configNames\n )\n case 'metadata':\n if (!anyRowMatches(target, 'metadata')) break\n return scheduleNamed(\n event.assetId,\n event.fileId,\n { hint: null, metadata: true, early: true, seen: false },\n UPLOAD_NOTIFY_METADATA_DELAY_MS,\n event.configNames\n )\n case 'failed':\n settle.settleKnownFailed(target, event.failReason ?? AssetFileFailReason.Unknown)\n break\n case 'duplicate':\n if (!anyRowMatches(target, 'settle')) break\n return settle.settleKnownDuplicate(target, event.originAssetFile ?? null, event.assetType ?? null)\n }\n } catch (error) {\n console.error('uploadQueue: the notification could not be settled', error)\n }\n return Promise.resolve()\n }\n\n // ---- tracking\n\n const subscribe = () => {\n if (unsubscribe.length) return\n unsubscribe = [\n uploadSettlementRuntime.visibility.onChange(() => {\n const visible = uploadSettlementRuntime.visibility.isVisible()\n pollers.forEach((poller) => (visible ? poller.readNow('visible') : poller.reschedule()))\n }),\n // The notifications came alive or died: the rhythm of the other mode.\n profile.connection.onChange(() => pollers.forEach((poller) => poller.reschedule())),\n ]\n }\n\n const unsubscribeAll = () => {\n unsubscribe.forEach((stop) => stop())\n unsubscribe = []\n }\n\n const pollerOf = (queueKey: UploadQueueKey) => {\n let poller = pollers.get(queueKey)\n if (!poller) {\n poller = createQueuePoller({\n youngestAgeMs: () => youngestAgeMs(queueKey),\n // The socket of the configuration of the queue: the queue of one without a socket polls densely.\n mode: () => (profile.connection.isPushAlive(queueKey) ? 'sparse' : 'dense'),\n read: () => {\n const generation = generationOf(queueKey)\n return enqueueRead(laneOfQueue(queueKey), (startedAt) => readQueue(queueKey, generation, startedAt))\n },\n })\n pollers.set(queueKey, poller)\n subscribe()\n }\n return poller\n }\n\n const queueOf = (queueKey: UploadQueueKey) => {\n for (const [key, queue] of profile.queues()) {\n if (key === queueKey) return queue\n }\n return null\n }\n\n const track = (queueKey: UploadQueueKey, row: UploadQueueItem, options: { clientFailed?: boolean } = {}) => {\n if (isDisposed()) return\n const raw = toRaw(row)\n const queue = queueOf(queueKey)\n if (!queue || !toRaw(queue.items).some((item) => toRaw(item) === raw)) return\n // Nothing a tick could ask about.\n if (row.status === UploadQueueItemStatus.Stop || isNull(row.assetId)) return\n const reader = settle.policyOf(row).reader\n if (reader === 'none' || (reader === 'slots' && !profile.readers.slotFiles)) return\n memory.tracked.set(raw, {\n queueKey,\n eligibleSince: scheduler().now(),\n clientFailed: options.clientFailed === true,\n misses: 0,\n readFailures: 0,\n reported: false,\n })\n // Failed by the client, and the server may finish the file all the same.\n settle.setRefreshMayHelp(queueKey, row, options.clientFailed === true)\n pollerOf(queueKey).rowAdded()\n }\n\n // The rows a waiting read was asked for are leaving: a read no other row needs does not wait on.\n const cancelUnneeded = (leaving: (entry: { queueKey: UploadQueueKey; row: UploadQueueItem }) => boolean) => {\n for (const read of pending.values()) {\n if (rowsOfRead(read).some((entry) => !leaving(entry))) continue\n if (read.timer) scheduler().clearTimeout(read.timer.handle)\n read.timer = null\n pending.delete(read.key)\n releaseWaiters(read)\n }\n }\n\n // The store takes the row out: its ticks end here, and so do the reads notifications asked for on its behalf.\n const untrack = (row: UploadQueueItem) => {\n if (isDisposed()) return\n const raw = toRaw(row)\n const leaving = settle.rows().find((entry) => toRaw(entry.row) === raw)\n if (leaving) settle.setRefreshMayHelp(leaving.queueKey, row, false)\n settle.untrack(row)\n cancelUnneeded((entry) => toRaw(entry.row) === raw)\n }\n\n const dropQueue = (queueKey: UploadQueueKey) => {\n if (isDisposed()) return\n const queue = queueOf(queueKey)\n if (queue) {\n for (const row of queue.items) {\n settle.setRefreshMayHelp(queueKey, row, false)\n if (memory.tracked.get(toRaw(row))?.queueKey === queueKey) memory.tracked.delete(toRaw(row))\n }\n }\n generations.set(queueKey, generationOf(queueKey) + 1)\n const lane = laneOfQueue(queueKey)\n pollers.get(queueKey)?.stop()\n pollers.delete(queueKey)\n // Nothing is asked about any more, by the store or in the lane of the queue: what fails for the next rows is a\n // streak of its own.\n if (!pollers.size) {\n unsubscribeAll()\n lanes.forEach((one) => (one.failing = false))\n } else if (![...pollers.keys()].some((key) => laneOfQueue(key) === lane)) {\n lane.failing = false\n }\n cancelUnneeded((entry) => entry.queueKey === queueKey)\n }\n\n const hasTracked = () => !isDisposed() && trackedRows().length > 0\n const isGivenUpMissing = (row: UploadQueueItem) => memory.givenUpMissing.has(toRaw(row))\n\n const dispose = () => {\n disposed = true\n pollers.forEach((poller) => poller.stop())\n pollers.clear()\n pending.forEach((read) => {\n if (read.timer) scheduler().clearTimeout(read.timer.handle)\n read.timer = null\n releaseWaiters(read)\n })\n pending.clear()\n unsubscribeAll()\n }\n\n return {\n track,\n untrack,\n dropQueue,\n notify,\n refreshAsset,\n settleKnownProcessed,\n settleKnownDuplicate,\n settleKnownFailed,\n isGivenUpMissing,\n hasTracked,\n dispose,\n }\n}\n"],"mappings":";;;;;;;;;AAuFA,IAAMA,KAAgC;CAAE,MAAM;CAAM,UAAU;CAAM,OAAO;CAAO,MAAM;AAAK;AAM7F,SAAgBC,EAAuB,GAAoD;CACzF,IAAMC,IAASC,EAAyB,GAClCC,oBAAU,IAAI,IAAiC,GAE/CC,oBAAU,IAAI,IAA8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/F,EAAY,IAAIZ,GAAUQ,EAAaR,CAAQ,IAAI,CAAC;GACpD,IAAMF,IAAOC,EAAYC,CAAQ;GAWjC,AAVAZ,EAAQ,IAAIY,CAAQ,CAAC,EAAE,KAAK,GAC5BZ,EAAQ,OAAOY,CAAQ,GAGlBZ,EAAQ,OAGD,CAAC,GAAGA,EAAQ,KAAK,CAAC,CAAC,CAAC,MAAM,MAAQW,EAAYJ,CAAG,MAAMG,CAAI,MACrE,EAAK,UAAU,OAHfyI,EAAe,GACf9I,EAAM,SAAS,MAAS,EAAI,UAAU,EAAM,IAI9CqJ,GAAgB,MAAUlC,EAAM,aAAa5G,CAAQ;EACvD;EAsBE;EACA;EACA;EACA;EACA;EACA,mBAxBwB,MAAyBd,EAAO,eAAe,IAAI4B,EAAMF,CAAG,CAAC;EAyBrF,kBA1BuB,CAACL,EAAW,KAAKE,EAAY,CAAC,CAAC,SAAS;EA2B/D,eAxBoB;GAUpB,AATA,IAAW,IACXrB,EAAQ,SAAS,MAAWkJ,EAAO,KAAK,CAAC,GACzClJ,EAAQ,MAAM,GACdC,EAAQ,SAAS,MAAS;IAGxB,AAFI+F,EAAK,SAAO/E,EAAU,CAAC,CAAC,aAAa+E,EAAK,MAAM,MAAM,GAC1D,EAAK,QAAQ,MACbI,EAAeJ,CAAI;GACrB,CAAC,GACD/F,EAAQ,MAAM,GACdkJ,EAAe;EACjB;CAcA;AACF"}
1
+ {"version":3,"file":"uploadSettlement.js","names":["TICK_INTENT","createUploadSettlement","memory","createUploadSettleMemory","pollers","pending","unsubscribe","disposed","generations","lanes","laneOf","key","profile","configName","lane","laneOfQueue","queueKey","laneOfTarget","target","failureReported","error","scheduler","uploadSettlementRuntime","isDisposed","generationOf","trackedRows","tracked","queue","row","state","toRaw","UploadQueueItemStatus","isNull","youngestAgeMs","now","youngest","age","settle","createUploadSettle","enqueueRead","result","run","fetchCaches","namesOfQueue","countMiss","missesOfLeft","countsMissesOfLeft","countMissOfLeft","raw","misses","concernedRows","all","targets","intent","anyRowMatches","purpose","readSucceeded","rows","untold","readUnitsOf","byLicence","bySlotAsset","reader","byAsset","units","licenceId","assetIds","asset","options","from","batch","assetId","assets","slotRows","slotFiles","applyAssets","goesOn","startedAt","present","unit","applySlotFile","file","candidate","configNames","AssetFileProcessStatus","scheduleNamed","applySlotFiles","readQueue","generation","answers","index","failed","reportedFailure","answer","told","report","notice","mergeTarget","fileId","known","read","armNamed","delay","fireNamed","releaseWaiters","waiters","resolve","names","scheduleRead","delayMs","name","isUndefined","waiting","readNamed","retryNamed","UPLOAD_POLL_ERROR_LADDER_MS","attempt","warnAboutRead","namesOfRead","rowsOfRead","askedFor","left","exhausted","warned","entry","concerned","untracked","OUTCOME_ORDER","readTargetNow","readOneNow","one","outcomes","outcome","givenUp","askedOn","leftWithout","isFinalFileStatus","refreshAsset","settleKnownProcessed","settleKnownFailed","failReason","settleKnownDuplicate","originFileId","assetType","notify","event","UPLOAD_NOTIFY_METADATA_DELAY_MS","AssetFileFailReason","subscribe","visible","poller","unsubscribeAll","stop","pollerOf","createQueuePoller","queueOf","track","item","cancelUnneeded","leaving"],"sources":["../../../../../src/domains/dam/uploadQueue/settlement/uploadSettlement.ts"],"sourcesContent":["import { toRaw } from 'vue'\nimport type { DocId, DocIdNullable, IntegerId } from '@/shared/types/common'\nimport type { AssetDetailItemDto, DamAssetTypeType } from '@/domains/dam/types/Asset'\nimport {\n AssetFileFailReason,\n type AssetFileFailReasonType,\n type AssetFileNullable,\n AssetFileProcessStatus,\n} from '@/domains/dam/types/AssetFile'\nimport {\n type UploadQueue,\n type UploadQueueItem,\n UploadQueueItemStatus,\n type UploadQueueKey,\n} from '@/domains/dam/types/UploadQueue'\nimport { createQueuePoller, type QueuePoller } from '@/domains/dam/uploadQueue/settlement/uploadPoller'\nimport {\n UPLOAD_NOTIFY_FILE_DELAY_MS,\n UPLOAD_NOTIFY_METADATA_DELAY_MS,\n UPLOAD_POLL_ERROR_LADDER_MS,\n UPLOAD_POLL_MISSING_LIMIT,\n UPLOAD_POLL_READ_FAILURE_LIMIT,\n UPLOAD_POLL_SLOW_TEXT_AFTER_MS,\n UPLOAD_READ_BATCH_LIMIT,\n} from '@/domains/dam/uploadQueue/settlement/uploadPollSchedule'\nimport {\n createUploadSettle,\n createUploadSettleMemory,\n isFinalFileStatus,\n type UploadReadIntent,\n type UploadTrackState,\n} from '@/domains/dam/uploadQueue/settlement/uploadSettle'\nimport { uploadSettlementRuntime } from '@/domains/dam/uploadQueue/settlement/uploadSettlementRuntime'\nimport type {\n UploadReadOptions,\n UploadRefreshOutcome,\n UploadSettlement,\n UploadSettlementEvent,\n UploadSettlementProfile,\n UploadSettlementTarget,\n} from '@/domains/dam/uploadQueue/settlement/uploadSettlementTypes'\nimport { isNull, isUndefined } from '@/shared/utils/common'\n\ninterface TrackedRow {\n queueKey: UploadQueueKey\n queue: UploadQueue\n row: UploadQueueItem\n state: UploadTrackState\n /** The asset the row is read by. It changes when a duplicate becomes its original. */\n assetId: DocId\n}\n\n/** One request of a tick, and the tracked rows it asks about. */\ninterface ReadUnit {\n rows: TrackedRow[]\n /** `missing`: the single asset requested alone does not exist. Its reader may report that. */\n read(\n options: UploadReadOptions\n ): Promise<{ assets: AssetDetailItemDto[]; missing?: boolean } | { slotFiles: AssetFileNullable[] }>\n}\n\n/** Sequential reads of one DAM, and whether a streak of their failures is being reported. */\ninterface ReadLane {\n chain: Promise<void>\n failing: boolean\n}\n\n/** A read of one asset requested by an event, waiting for its time. */\ninterface PendingNamedRead {\n /** Key in `pending`: the asset and the configuration the read is for. */\n key: string\n assetId: DocId\n /** The configuration whose rows the read is for (`configOf` of the profile). All queues when omitted. */\n configName?: string\n // Keyed by `fileId ?? ''`.\n targets: Map<string, { fileId: DocIdNullable; intent: UploadReadIntent }>\n dueAt: number\n /** Consecutive failed tries. */\n failures: number\n /** Consecutive tries that found no asset. */\n misses: number\n /** A failure of these tries was reported. Further ones are not. */\n told: boolean\n timer: { handle: unknown } | null\n waiters: Array<() => void>\n}\n\nconst TICK_INTENT: UploadReadIntent = { hint: null, metadata: true, early: false, seen: true }\n\n/**\n * Settlement for the rows of one store: tracks rows waiting for the server and coordinates all reads.\n * Reads start from a queue tick, a notification or a row refresh.\n */\nexport function createUploadSettlement(profile: UploadSettlementProfile): UploadSettlement {\n const memory = createUploadSettleMemory()\n const pollers = new Map<UploadQueueKey, QueuePoller>()\n // At most one pending read per asset, or one per configuration when queues have configurations.\n const pending = new Map<string, PendingNamedRead>()\n let unsubscribe: Array<() => void> = []\n let disposed = false\n // Incremented when a queue is dropped. A tick that waited meanwhile must not run for the queue that now has the key.\n const generations = new Map<UploadQueueKey, number>()\n // The poll and notifications retry while a row waits. A reader reports only the first failure that is written down.\n // `failing` of the lane holds from such a failure until a read answers.\n // `reported` of each tracked row holds until a read brings its asset.\n // A failure that was not written down (timeout, 401, 403) starts\n // no streak. One read at a time per lane keeps reads in order.\n // With `configOf`, each configuration has its own lane and streak, plus one lane for\n // reads naming none, so a slow DAM blocks no other. Without it, one lane for the store.\n const lanes = new Map<string | undefined, ReadLane>()\n const laneOf = (configName?: string) => {\n const key = profile.configOf ? configName : undefined\n let lane = lanes.get(key)\n if (!lane) {\n lane = { chain: Promise.resolve(), failing: false }\n lanes.set(key, lane)\n }\n return lane\n }\n const laneOfQueue = (queueKey: UploadQueueKey) => laneOf(profile.configOf?.(queueKey))\n /** Only a target that names exactly one configuration gets that configuration's lane. */\n const laneOfTarget = (target: UploadSettlementTarget) =>\n laneOf(target.configNames?.length === 1 ? target.configNames[0] : undefined)\n const failureReported = (error: unknown) => profile.readers.failureReported?.(error) ?? true\n\n const scheduler = () => uploadSettlementRuntime.scheduler\n // Checked after every wait: a disposed settlement writes, calls and schedules nothing.\n const isDisposed = () => disposed\n const generationOf = (queueKey: UploadQueueKey) => generations.get(queueKey) ?? 0\n\n const trackedRows = (queueKey?: UploadQueueKey): TrackedRow[] => {\n const tracked: TrackedRow[] = []\n for (const [key, queue] of profile.queues()) {\n if (queueKey !== undefined && key !== queueKey) continue\n for (const row of queue.items) {\n const state = memory.tracked.get(toRaw(row))\n if (!state || state.queueKey !== key) continue\n if (row.status === UploadQueueItemStatus.Stop || isNull(row.assetId)) continue\n tracked.push({ queueKey: key, queue, row, state, assetId: row.assetId })\n }\n }\n return tracked\n }\n\n const youngestAgeMs = (queueKey: UploadQueueKey) => {\n const now = scheduler().now()\n let youngest: number | null = null\n for (const { state } of trackedRows(queueKey)) {\n const age = now - state.eligibleSince\n if (youngest === null || age < youngest) youngest = age\n }\n return youngest\n }\n\n const settle = createUploadSettle(profile, memory, {\n // A queue that tracks nothing any more holds no timer.\n onUntrack: (queueKey) => {\n if (youngestAgeMs(queueKey) === null) pollers.get(queueKey)?.reschedule()\n },\n isDisposed,\n })\n\n const enqueueRead = <T>(lane: ReadLane, run: (startedAt: number) => Promise<T>): Promise<T> => {\n const result = lane.chain.then(() => run(settle.startRead()))\n lane.chain = result.then(\n () => undefined,\n () => undefined\n )\n return result\n }\n\n const fetchCaches = () => settle.fetchNames()\n\n /** `undefined` for a profile without `configOf`. */\n const namesOfQueue = (queueKey: UploadQueueKey) => (profile.configOf ? [profile.configOf(queueKey)] : undefined)\n\n /** Returns true when this miss reaches the limit and the row is given up. */\n const countMiss = (tracked: Pick<TrackedRow, 'queueKey' | 'row' | 'state'>) => {\n tracked.state.misses++\n if (tracked.state.misses < UPLOAD_POLL_MISSING_LIMIT) return false\n settle.giveUpOnMissing(tracked)\n return true\n }\n\n // Untracked rows that a refresh may still help: failed without\n // the duplicate's original, or uploaded without metadata.\n // Misses are counted across all reads until one answers. At\n // the limit the uploaded row fails. Returns like `countMiss`.\n const missesOfLeft = new WeakMap<UploadQueueItem, number>()\n const countsMissesOfLeft = (row: UploadQueueItem) =>\n memory.refreshMayHelp.has(toRaw(row)) || settle.awaitsMetadata(row)\n const countMissOfLeft = ({ queueKey, row }: { queueKey: UploadQueueKey; row: UploadQueueItem }) => {\n const raw = toRaw(row)\n if (!countsMissesOfLeft(row)) return false\n const misses = (missesOfLeft.get(raw) ?? 0) + 1\n if (misses < UPLOAD_POLL_MISSING_LIMIT) {\n missesOfLeft.set(raw, misses)\n return false\n }\n missesOfLeft.delete(raw)\n settle.giveUpOnMissing({ queueKey, row })\n return true\n }\n\n /** Live rows a read of the asset would write into, for any of the targets, limited to the named configurations. */\n const concernedRows = (\n assetId: DocId,\n targets: Iterable<{ fileId: DocIdNullable; intent: Pick<UploadReadIntent, 'early'> }>,\n configNames?: string[]\n ) => {\n const all = [...targets]\n return settle.rows().filter(({ queueKey, row }) => {\n if (row.status === UploadQueueItemStatus.Stop) return false\n return all.some(({ fileId, intent }) => {\n const target = { assetId, fileId, configNames }\n return (\n settle.concerns(queueKey, row, target, 'decorate') ||\n (intent.early && settle.concerns(queueKey, row, target, 'metadata'))\n )\n })\n })\n }\n\n const anyRowMatches = (target: UploadSettlementTarget, purpose: 'settle' | 'decorate' | 'metadata') =>\n settle\n .rows()\n .some(\n ({ queueKey, row }) =>\n row.status !== UploadQueueItemStatus.Stop && settle.concerns(queueKey, row, target, purpose)\n )\n\n // A read found the asset: reset the miss counts of tracked rows and clear their warning.\n const readSucceeded = (rows: Array<{ row: UploadQueueItem }>) => {\n for (const { row } of rows) {\n missesOfLeft.delete(toRaw(row))\n const state = settle.trackStateOf(row)\n if (!state) continue\n state.misses = 0\n state.readFailures = 0\n state.reported = false\n settle.noticeOf(row).readWarning = false\n settle.syncNotice(row)\n }\n }\n\n const untold = (rows: Array<{ row: UploadQueueItem }>) =>\n rows.every(({ row }) => settle.trackStateOf(row)?.reported !== true)\n\n const readUnitsOf = (rows: TrackedRow[]): ReadUnit[] => {\n const byLicence = new Map<IntegerId, Map<DocId, TrackedRow[]>>()\n const bySlotAsset = new Map<DocId, TrackedRow[]>()\n for (const tracked of rows) {\n const reader = settle.policyOf(tracked.row).reader\n if (reader === 'none') continue\n let byAsset = bySlotAsset\n if (reader === 'asset') {\n byAsset = byLicence.get(tracked.row.licenceId) ?? new Map<DocId, TrackedRow[]>()\n byLicence.set(tracked.row.licenceId, byAsset)\n }\n byAsset.set(tracked.assetId, [...(byAsset.get(tracked.assetId) ?? []), tracked])\n }\n\n const units: ReadUnit[] = []\n for (const [licenceId, byAsset] of byLicence) {\n const assetIds = [...byAsset.keys()]\n // A single asset uses the same single read as a notification.\n if (assetIds.length === 1) {\n units.push({\n rows: byAsset.get(assetIds[0]!)!,\n read: async (options) => {\n const asset = await profile.readers.asset(assetIds[0]!, options)\n return { assets: asset ? [asset] : [], missing: asset === null }\n },\n })\n continue\n }\n for (let from = 0; from < assetIds.length; from += UPLOAD_READ_BATCH_LIMIT) {\n const batch = assetIds.slice(from, from + UPLOAD_READ_BATCH_LIMIT)\n units.push({\n rows: batch.flatMap((assetId) => byAsset.get(assetId)!),\n read: async (options) => {\n const assets = await profile.readers.assets(licenceId, batch, options)\n // A non-list answer must not be taken as \"every asset is missing\".\n if (!Array.isArray(assets)) throw new Error('uploadSettlement: unexpected asset list')\n return { assets }\n },\n })\n }\n }\n for (const [assetId, slotRows] of bySlotAsset) {\n units.push({\n rows: slotRows,\n read: async (options) => {\n if (!profile.readers.slotFiles) throw new Error('uploadSettlement: no reader of the slots')\n const slotFiles = await profile.readers.slotFiles(assetId, options)\n if (!Array.isArray(slotFiles)) throw new Error('uploadSettlement: unexpected slot list')\n return { slotFiles }\n },\n })\n }\n return units\n }\n\n const applyAssets = async (\n unit: ReadUnit,\n assets: AssetDetailItemDto[],\n startedAt: number,\n goesOn: () => boolean,\n configNames: string[] | undefined\n ) => {\n for (const asset of assets) {\n if (!goesOn()) return\n try {\n await settle.applyAssetRead(\n asset,\n { assetId: asset.id, fileId: asset.mainFile?.id ?? null, configNames },\n TICK_INTENT,\n startedAt\n )\n } catch (error) {\n // One asset that fails to write does not end the tick. Other\n // assets and the counts and texts of every row continue.\n console.error('uploadQueue: a read asset could not be written', error)\n }\n }\n if (!goesOn()) return\n const present = new Set(assets.map((asset) => asset.id))\n for (const { state, assetId } of unit.rows) {\n if (present.has(assetId)) {\n state.misses = 0\n state.reported = false\n } else {\n state.misses++\n }\n }\n }\n\n const applySlotFile = async (tracked: TrackedRow, slotFiles: AssetFileNullable[], startedAt: number) => {\n const { row, state, assetId } = tracked\n if (!settle.isLive(row) || row.status === UploadQueueItemStatus.Stop || settle.isStale(row, startedAt)) return\n const file = slotFiles.find((candidate) => candidate?.id === row.fileId)\n if (!file) {\n state.misses++\n return\n }\n state.misses = 0\n state.reported = false\n const configNames = namesOfQueue(tracked.queueKey)\n const target = { assetId, fileId: row.fileId, configNames }\n switch (file.fileAttributes?.status) {\n case AssetFileProcessStatus.Processed:\n settle.settleProcessedByEvent(target)\n // Not awaited: it waits for this read to end.\n void scheduleNamed(\n assetId,\n row.fileId,\n { hint: 'processed', metadata: false, early: false, seen: true },\n 0,\n configNames\n )\n break\n case AssetFileProcessStatus.Failed:\n settle.settleFailed(tracked, file.fileAttributes.failReason)\n break\n case AssetFileProcessStatus.Duplicate:\n await settle.settleDuplicate(target, file.originAssetFile, row.assetType, (candidate) => {\n return !settle.isStale(candidate, startedAt)\n })\n break\n }\n }\n\n // The bulk read carries only the main file of an asset, so a slot row is read from the list of its asset's slots.\n const applySlotFiles = async (\n unit: ReadUnit,\n slotFiles: AssetFileNullable[],\n startedAt: number,\n goesOn: () => boolean\n ) => {\n for (const tracked of unit.rows) {\n if (!goesOn()) return\n try {\n await applySlotFile(tracked, slotFiles, startedAt)\n } catch (error) {\n console.error('uploadQueue: a read slot file could not be written', error)\n }\n }\n }\n\n const readQueue = async (queueKey: UploadQueueKey, generation: number, startedAt: number) => {\n // Checked when the tick gets its turn and after every wait. It may have queued behind\n // another read, and its queue may have been dropped and replaced under the same key.\n const goesOn = () => !isDisposed() && generationOf(queueKey) === generation\n if (!goesOn()) return\n const lane = laneOfQueue(queueKey)\n const units = readUnitsOf(trackedRows(queueKey))\n if (!units.length) return\n // The requests of a tick go out together, so each one that could start a streak may report its failure.\n const options = units.map((unit) => ({\n report: !lane.failing && unit.rows.every(({ state }) => !state.reported),\n queueKey,\n }))\n // Requests go out in parallel; results are applied sequentially.\n const answers = await Promise.allSettled(units.map((unit, index) => unit.read(options[index]!)))\n if (!goesOn()) return\n let failed = 0\n let reportedFailure = false\n for (const [index, unit] of units.entries()) {\n const answer = answers[index]!\n const { report } = options[index]!\n if (answer.status === 'rejected') {\n failed++\n const told = report && failureReported(answer.reason)\n if (told) reportedFailure = true\n unit.rows.forEach(({ state }) => {\n state.readFailures++\n if (told) state.reported = true\n })\n continue\n }\n unit.rows.forEach(({ state }) => (state.readFailures = 0))\n if ('assets' in answer.value) {\n // Only into rows of the queue's configuration: another DAM may have an asset with the same id.\n await applyAssets(unit, answer.value.assets, startedAt, goesOn, namesOfQueue(queueKey))\n // The reader already reported the missing asset, so these rows do not report it again.\n if (answer.value.missing && report) unit.rows.forEach(({ state }) => (state.reported = true))\n } else {\n await applySlotFiles(unit, answer.value.slotFiles, startedAt, goesOn)\n }\n if (!goesOn()) return\n }\n // Any answered request ends the streak. A failure that was written down starts it.\n if (failed < units.length) lane.failing = false\n else if (reportedFailure) lane.failing = true\n fetchCaches()\n\n const now = scheduler().now()\n for (const tracked of trackedRows(queueKey)) {\n const { row, state } = tracked\n if (state.misses >= UPLOAD_POLL_MISSING_LIMIT) {\n settle.giveUpOnMissing(tracked)\n continue\n }\n const notice = settle.noticeOf(row)\n if (state.readFailures >= UPLOAD_POLL_READ_FAILURE_LIMIT) notice.readWarning = true\n else if (state.readFailures === 0) notice.readWarning = false\n const waitsForServer = row.status === UploadQueueItemStatus.Processing && !state.clientFailed\n if (waitsForServer && now - state.eligibleSince >= UPLOAD_POLL_SLOW_TEXT_AFTER_MS) notice.slow = true\n settle.syncNotice(row)\n }\n\n // The poller treats this as a failed read and backs off by its error ladder.\n if (failed === units.length) throw new Error('uploadSettlement: the read of the queue failed')\n }\n\n const mergeTarget = (read: PendingNamedRead, fileId: DocIdNullable, intent: UploadReadIntent) => {\n const key = fileId ?? ''\n const known = read.targets.get(key)?.intent\n read.targets.set(key, {\n fileId,\n intent: known\n ? {\n hint: known.hint ?? intent.hint,\n metadata: known.metadata || intent.metadata,\n early: known.early || intent.early,\n seen: known.seen || intent.seen,\n }\n : { ...intent },\n })\n }\n\n const armNamed = (read: PendingNamedRead) => {\n if (read.timer) scheduler().clearTimeout(read.timer.handle)\n const delay = Math.max(0, read.dueAt - scheduler().now())\n read.timer = { handle: scheduler().setTimeout(() => fireNamed(read), delay) }\n }\n\n const releaseWaiters = (read: PendingNamedRead) => {\n const waiters = read.waiters\n read.waiters = []\n waiters.forEach((resolve) => resolve())\n }\n\n /**\n * Schedules a read of the asset in `delayMs`, joining a read of it that already waits.\n * Each named configuration gets its own read for its queues' rows. Without names, one read covers every queue.\n */\n const scheduleNamed = (\n assetId: DocId,\n fileId: DocIdNullable,\n intent: UploadReadIntent,\n delayMs: number,\n configNames?: string[]\n ) => {\n const names = profile.configOf && configNames?.length ? [...new Set(configNames)] : [undefined]\n return Promise.all(names.map((name) => scheduleRead(assetId, fileId, intent, delayMs, name))).then(() => undefined)\n }\n\n const scheduleRead = (\n assetId: DocId,\n fileId: DocIdNullable,\n intent: UploadReadIntent,\n delayMs: number,\n configName: string | undefined\n ) => {\n const key = isUndefined(configName) ? assetId : `${configName}\\u0000${assetId}`\n let read = pending.get(key)\n if (!read) {\n read = {\n key,\n assetId,\n configName,\n targets: new Map(),\n dueAt: Infinity,\n failures: 0,\n misses: 0,\n told: false,\n timer: null,\n waiters: [],\n }\n pending.set(key, read)\n }\n mergeTarget(read, fileId, intent)\n read.dueAt = Math.min(read.dueAt, scheduler().now() + delayMs)\n armNamed(read)\n const waiting = read\n return new Promise<void>((resolve) => waiting.waiters.push(resolve))\n }\n\n const fireNamed = (read: PendingNamedRead) => {\n read.timer = null\n if (pending.get(read.key) === read) pending.delete(read.key)\n void enqueueRead(laneOf(read.configName), (startedAt) => readNamed(read, startedAt))\n }\n\n const retryNamed = (read: PendingNamedRead, attempt: number) => {\n const delay = UPLOAD_POLL_ERROR_LADDER_MS[Math.min(attempt, UPLOAD_POLL_ERROR_LADDER_MS.length) - 1]!\n const waiting = pending.get(read.key)\n if (!waiting) {\n read.dueAt = scheduler().now() + delay\n pending.set(read.key, read)\n armNamed(read)\n return\n }\n // An event arrived during this read and waits in its own read. The retry joins it.\n read.targets.forEach(({ fileId, intent }) => mergeTarget(waiting, fileId, intent))\n waiting.failures = Math.max(waiting.failures, read.failures)\n waiting.misses = Math.max(waiting.misses, read.misses)\n waiting.told ||= read.told\n }\n\n const warnAboutRead = (rows: Array<{ row: UploadQueueItem }>) => {\n for (const { row } of rows) {\n settle.noticeOf(row).readWarning = true\n settle.syncNotice(row)\n }\n }\n\n const namesOfRead = (read: PendingNamedRead) => (isUndefined(read.configName) ? undefined : [read.configName])\n /** Evaluated anew each time, since rows may have left meanwhile. */\n const rowsOfRead = (read: PendingNamedRead) => concernedRows(read.assetId, read.targets.values(), namesOfRead(read))\n\n const readNamed = async (read: PendingNamedRead, startedAt: number) => {\n try {\n // Its rows have left their queues meanwhile.\n const askedFor = rowsOfRead(read)\n if (isDisposed() || !askedFor.length) return\n const lane = laneOf(read.configName)\n // Reports until one of its tries was written down, while no streak runs and none of its rows was reported.\n const report = !lane.failing && !read.told && read.misses === 0 && untold(askedFor)\n let asset: AssetDetailItemDto | null\n try {\n asset = await profile.readers.asset(read.assetId, { report, queueKey: askedFor[0]!.queueKey })\n } catch (error) {\n if (isDisposed()) return\n // Its rows left while it was in flight: no retry and no streak.\n const left = rowsOfRead(read)\n if (!left.length) return\n read.failures++\n const told = report && failureReported(error)\n if (told) {\n read.told = true\n lane.failing = true\n }\n // The read's own count paces its retries and warns for untracked rows.\n // A tracked row warns by its own count, because ticks fail and succeed for it between these retries.\n const exhausted = read.failures >= UPLOAD_POLL_READ_FAILURE_LIMIT\n const warned: Array<{ row: UploadQueueItem }> = []\n for (const entry of left) {\n const state = settle.trackStateOf(entry.row)\n if (state) {\n state.readFailures++\n if (told) state.reported = true\n }\n if (state ? state.readFailures >= UPLOAD_POLL_READ_FAILURE_LIMIT : exhausted) warned.push(entry)\n }\n // Once exhausted, only a manual refresh of the row reads again.\n if (!exhausted) retryNamed(read, read.failures)\n warnAboutRead(warned)\n return\n }\n if (isDisposed()) return\n read.failures = 0\n lane.failing = false\n if (asset === null) {\n read.misses++\n const concerned = rowsOfRead(read)\n const untracked = concerned.filter(({ row }) => !settle.trackStateOf(row))\n for (const { queueKey, row } of concerned) {\n const state = settle.trackStateOf(row)\n if (!state) {\n countMissOfLeft({ queueKey, row })\n continue\n }\n if (report) state.reported = true\n countMiss({ queueKey, row, state })\n }\n if (!concerned.length) return\n if (read.misses < UPLOAD_POLL_MISSING_LIMIT) retryNamed(read, read.misses)\n // A row an event has settled is not flipped to failed. It only warns that its data could not be read.\n // A row still without metadata already failed by its count above.\n else warnAboutRead(untracked)\n return\n }\n readSucceeded(rowsOfRead(read))\n for (const { fileId, intent } of read.targets.values()) {\n if (isDisposed()) return\n await settle.applyAssetRead(\n asset,\n { assetId: read.assetId, fileId, configNames: namesOfRead(read) },\n intent,\n startedAt\n )\n }\n if (isDisposed()) return\n fetchCaches()\n } catch (error) {\n console.error('uploadQueue: the asset of a notification could not be settled', error)\n } finally {\n releaseWaiters(read)\n }\n }\n\n // With reads of several configurations, the first outcome in this order that any of them had is returned.\n const OUTCOME_ORDER: UploadRefreshOutcome[] = ['error', 'originalUnread', 'missing', 'pending', 'settled']\n\n /**\n * Outcome of the read for the caller. Retryable causes: `error` (read failed),\n * `missing` (asset not found), `originalUnread` (duplicate's original not read).\n * A target naming several configurations is read once per configuration, through one of its queues.\n */\n const readTargetNow = (target: UploadSettlementTarget, intent: UploadReadIntent): Promise<UploadRefreshOutcome> => {\n const targets = settle.byConfiguration(target)\n if (targets.length === 1) return readOneNow(target, intent)\n return Promise.all(targets.map((one) => readOneNow(one, intent))).then(\n (outcomes) => OUTCOME_ORDER.find((outcome) => outcomes.includes(outcome)) ?? 'settled'\n )\n }\n\n const readOneNow = (target: UploadSettlementTarget, intent: UploadReadIntent): Promise<UploadRefreshOutcome> =>\n enqueueRead(laneOfTarget(target), async (startedAt) => {\n try {\n if (isDisposed()) return 'error'\n // Queue of the first concerned row, taken before the read.\n const queueKey = concernedRows(target.assetId, [{ fileId: target.fileId, intent }], target.configNames)[0]\n ?.queueKey\n // A named configuration with no row of the asset left: its DAM is not asked.\n if (profile.configOf && target.configNames?.length && isUndefined(queueKey)) return 'settled'\n // A user-requested read reports every failure.\n const asset = await profile.readers.asset(target.assetId, { report: true, queueKey })\n if (isDisposed()) return 'error'\n laneOfTarget(target).failing = false\n const concerned = concernedRows(target.assetId, [{ fileId: target.fileId, intent }], target.configNames)\n if (asset === null) {\n let givenUp = false\n let askedOn = false\n for (const { queueKey, row } of concerned) {\n const state = settle.trackStateOf(row)\n // Reported by this read, so the poll does not report it again.\n if (state) state.reported = true\n if (state ? countMiss({ queueKey, row, state }) : countMissOfLeft({ queueKey, row })) givenUp = true\n else if (state || countsMissesOfLeft(row)) askedOn = true\n }\n // The final miss gave up and settled its rows, so there is nothing to retry.\n return givenUp && !askedOn ? 'settled' : 'missing'\n }\n readSucceeded(concerned)\n const leftWithout = await settle.applyAssetRead(asset, target, intent, startedAt)\n if (isDisposed()) return 'error'\n fetchCaches()\n if (leftWithout) return 'originalUnread'\n // Otherwise decided by the main file status alone, regardless of which rows were written.\n return isFinalFileStatus(asset.mainFile?.fileAttributes?.status) ? 'settled' : 'pending'\n } catch {\n return 'error'\n }\n })\n\n const refreshAsset = (target: UploadSettlementTarget) =>\n readTargetNow(target, { hint: null, metadata: true, early: false, seen: true })\n\n const settleKnownProcessed = async (target: UploadSettlementTarget, options: { withMetadata: boolean }) => {\n await readTargetNow(target, { hint: 'processed', metadata: options.withMetadata, early: false, seen: true })\n }\n\n const settleKnownFailed = (target: UploadSettlementTarget, failReason: AssetFileFailReasonType) => {\n if (isDisposed()) return\n settle.settleKnownFailed(target, failReason)\n }\n\n const settleKnownDuplicate = (\n target: UploadSettlementTarget,\n originFileId: DocIdNullable,\n assetType: DamAssetTypeType | null\n ) => (isDisposed() ? Promise.resolve() : settle.settleKnownDuplicate(target, originFileId, assetType))\n\n const notify = (event: UploadSettlementEvent): Promise<void> => {\n if (isDisposed()) return Promise.resolve()\n const target = { assetId: event.assetId, fileId: event.fileId, configNames: event.configNames }\n try {\n switch (event.kind) {\n case 'processed':\n if (!anyRowMatches(target, 'decorate')) break\n settle.settleProcessedByEvent(target)\n settle.announceProcessed(target)\n return scheduleNamed(\n event.assetId,\n event.fileId,\n { hint: 'processed', metadata: false, early: false, seen: true },\n UPLOAD_NOTIFY_FILE_DELAY_MS,\n event.configNames\n )\n case 'copied':\n if (!anyRowMatches(target, 'decorate')) break\n // A copy gets no metadata notification: its metadata comes with this read.\n return scheduleNamed(\n event.assetId,\n event.fileId,\n { hint: 'processed', metadata: true, early: false, seen: true },\n UPLOAD_NOTIFY_FILE_DELAY_MS,\n event.configNames\n )\n case 'metadata':\n if (!anyRowMatches(target, 'metadata')) break\n return scheduleNamed(\n event.assetId,\n event.fileId,\n { hint: null, metadata: true, early: true, seen: false },\n UPLOAD_NOTIFY_METADATA_DELAY_MS,\n event.configNames\n )\n case 'failed':\n settle.settleKnownFailed(target, event.failReason ?? AssetFileFailReason.Unknown)\n break\n case 'duplicate':\n if (!anyRowMatches(target, 'settle')) break\n return settle.settleKnownDuplicate(target, event.originAssetFile ?? null, event.assetType ?? null)\n }\n } catch (error) {\n console.error('uploadQueue: the notification could not be settled', error)\n }\n return Promise.resolve()\n }\n\n const subscribe = () => {\n if (unsubscribe.length) return\n unsubscribe = [\n uploadSettlementRuntime.visibility.onChange(() => {\n const visible = uploadSettlementRuntime.visibility.isVisible()\n pollers.forEach((poller) => (visible ? poller.readNow('visible') : poller.reschedule()))\n }),\n // Notifications connected or dropped: switch pollers to the other rhythm.\n profile.connection.onChange(() => pollers.forEach((poller) => poller.reschedule())),\n ]\n }\n\n const unsubscribeAll = () => {\n unsubscribe.forEach((stop) => stop())\n unsubscribe = []\n }\n\n const pollerOf = (queueKey: UploadQueueKey) => {\n let poller = pollers.get(queueKey)\n if (!poller) {\n poller = createQueuePoller({\n youngestAgeMs: () => youngestAgeMs(queueKey),\n // Uses the socket of the queue's configuration. A queue without a live socket polls densely.\n mode: () => (profile.connection.isPushAlive(queueKey) ? 'sparse' : 'dense'),\n read: () => {\n const generation = generationOf(queueKey)\n return enqueueRead(laneOfQueue(queueKey), (startedAt) => readQueue(queueKey, generation, startedAt))\n },\n })\n pollers.set(queueKey, poller)\n subscribe()\n }\n return poller\n }\n\n const queueOf = (queueKey: UploadQueueKey) => {\n for (const [key, queue] of profile.queues()) {\n if (key === queueKey) return queue\n }\n return null\n }\n\n const track = (queueKey: UploadQueueKey, row: UploadQueueItem, options: { clientFailed?: boolean } = {}) => {\n if (isDisposed()) return\n const raw = toRaw(row)\n const queue = queueOf(queueKey)\n if (!queue || !toRaw(queue.items).some((item) => toRaw(item) === raw)) return\n if (row.status === UploadQueueItemStatus.Stop || isNull(row.assetId)) return\n const reader = settle.policyOf(row).reader\n if (reader === 'none' || (reader === 'slots' && !profile.readers.slotFiles)) return\n memory.tracked.set(raw, {\n queueKey,\n eligibleSince: scheduler().now(),\n clientFailed: options.clientFailed === true,\n misses: 0,\n readFailures: 0,\n reported: false,\n })\n // The client failed it, but the server may still finish the file.\n settle.setRefreshMayHelp(queueKey, row, options.clientFailed === true)\n pollerOf(queueKey).rowAdded()\n }\n\n // Its rows are leaving: cancel a waiting read that no other row needs.\n const cancelUnneeded = (leaving: (entry: { queueKey: UploadQueueKey; row: UploadQueueItem }) => boolean) => {\n for (const read of pending.values()) {\n if (rowsOfRead(read).some((entry) => !leaving(entry))) continue\n if (read.timer) scheduler().clearTimeout(read.timer.handle)\n read.timer = null\n pending.delete(read.key)\n releaseWaiters(read)\n }\n }\n\n // The store removed the row: its ticks end, and so do notification reads made for it.\n const untrack = (row: UploadQueueItem) => {\n if (isDisposed()) return\n const raw = toRaw(row)\n const leaving = settle.rows().find((entry) => toRaw(entry.row) === raw)\n if (leaving) settle.setRefreshMayHelp(leaving.queueKey, row, false)\n settle.untrack(row)\n cancelUnneeded((entry) => toRaw(entry.row) === raw)\n }\n\n const dropQueue = (queueKey: UploadQueueKey) => {\n if (isDisposed()) return\n const queue = queueOf(queueKey)\n if (queue) {\n for (const row of queue.items) {\n settle.setRefreshMayHelp(queueKey, row, false)\n if (memory.tracked.get(toRaw(row))?.queueKey === queueKey) memory.tracked.delete(toRaw(row))\n }\n }\n generations.set(queueKey, generationOf(queueKey) + 1)\n const lane = laneOfQueue(queueKey)\n pollers.get(queueKey)?.stop()\n pollers.delete(queueKey)\n // Nothing is tracked any more, so failures of later rows start a new streak.\n if (!pollers.size) {\n unsubscribeAll()\n lanes.forEach((one) => (one.failing = false))\n } else if (![...pollers.keys()].some((key) => laneOfQueue(key) === lane)) {\n lane.failing = false\n }\n cancelUnneeded((entry) => entry.queueKey === queueKey)\n }\n\n const hasTracked = () => !isDisposed() && trackedRows().length > 0\n const isGivenUpMissing = (row: UploadQueueItem) => memory.givenUpMissing.has(toRaw(row))\n\n const dispose = () => {\n disposed = true\n pollers.forEach((poller) => poller.stop())\n pollers.clear()\n pending.forEach((read) => {\n if (read.timer) scheduler().clearTimeout(read.timer.handle)\n read.timer = null\n releaseWaiters(read)\n })\n pending.clear()\n unsubscribeAll()\n }\n\n return {\n track,\n untrack,\n dropQueue,\n notify,\n refreshAsset,\n settleKnownProcessed,\n settleKnownDuplicate,\n settleKnownFailed,\n isGivenUpMissing,\n hasTracked,\n dispose,\n }\n}\n"],"mappings":";;;;;;;;;AAuFA,IAAMA,KAAgC;CAAE,MAAM;CAAM,UAAU;CAAM,OAAO;CAAO,MAAM;AAAK;AAM7F,SAAgBC,EAAuB,GAAoD;CACzF,IAAMC,IAASC,EAAyB,GAClCC,oBAAU,IAAI,IAAiC,GAE/CC,oBAAU,IAAI,IAA8B,GAC9CC,IAAiC,CAAC,GAClCC,IAAW,IAETC,oBAAc,IAAI,IAA4B,GAQ9CC,oBAAQ,IAAI,I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,AATAZ,EAAQ,IAAIY,CAAQ,CAAC,EAAE,KAAK,GAC5BZ,EAAQ,OAAOY,CAAQ,GAElBZ,EAAQ,OAGD,CAAC,GAAGA,EAAQ,KAAK,CAAC,CAAC,CAAC,MAAM,MAAQW,EAAYJ,CAAG,MAAMG,CAAI,MACrE,EAAK,UAAU,OAHfyI,EAAe,GACf9I,EAAM,SAAS,MAAS,EAAI,UAAU,EAAM,IAI9CqJ,GAAgB,MAAUlC,EAAM,aAAa5G,CAAQ;EACvD;EAsBE;EACA;EACA;EACA;EACA;EACA,mBAxBwB,MAAyBd,EAAO,eAAe,IAAI4B,EAAMF,CAAG,CAAC;EAyBrF,kBA1BuB,CAACL,EAAW,KAAKE,EAAY,CAAC,CAAC,SAAS;EA2B/D,eAxBoB;GAUpB,AATA,IAAW,IACXrB,EAAQ,SAAS,MAAWkJ,EAAO,KAAK,CAAC,GACzClJ,EAAQ,MAAM,GACdC,EAAQ,SAAS,MAAS;IAGxB,AAFI+F,EAAK,SAAO/E,EAAU,CAAC,CAAC,aAAa+E,EAAK,MAAM,MAAM,GAC1D,EAAK,QAAQ,MACbI,EAAeJ,CAAI;GACrB,CAAC,GACD/F,EAAQ,MAAM,GACdkJ,EAAe;EACjB;CAcA;AACF"}
@@ -8,8 +8,8 @@ export interface UploadSettlementVisibility {
8
8
  onChange(callback: () => void): () => void;
9
9
  }
10
10
  /**
11
- * An object with writable fields: a test replaces a field, not the binding. Production code never writes here.
12
- * The settlement reads the fields at each use, not once when it is created.
11
+ * Writable fields so a test can replace a field, not the binding. Production code never writes here.
12
+ * The settlement reads the fields at each use, not once at creation.
13
13
  */
14
14
  export declare const uploadSettlementRuntime: {
15
15
  scheduler: UploadSettlementScheduler;
@@ -1 +1 @@
1
- {"version":3,"file":"uploadSettlementRuntime.js","names":["uploadSettlementRuntime","callback","ms","handle"],"sources":["../../../../../src/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.ts"],"sourcesContent":["export interface UploadSettlementScheduler {\n now(): number\n setTimeout(callback: () => void, ms: number): unknown\n clearTimeout(handle: unknown): void\n}\n\nexport interface UploadSettlementVisibility {\n isVisible(): boolean\n onChange(callback: () => void): () => void\n}\n\n/**\n * An object with writable fields: a test replaces a field, not the binding. Production code never writes here.\n * The settlement reads the fields at each use, not once when it is created.\n */\nexport const uploadSettlementRuntime: {\n scheduler: UploadSettlementScheduler\n visibility: UploadSettlementVisibility\n} = {\n scheduler: {\n now: () => Date.now(),\n setTimeout: (callback, ms) => globalThis.setTimeout(callback, ms),\n clearTimeout: (handle) => globalThis.clearTimeout(handle as ReturnType<typeof setTimeout>),\n },\n visibility: {\n isVisible: () => typeof document === 'undefined' || document.visibilityState !== 'hidden',\n onChange: (callback) => {\n if (typeof document === 'undefined') return () => {}\n document.addEventListener('visibilitychange', callback)\n return () => document.removeEventListener('visibilitychange', callback)\n },\n },\n}\n"],"mappings":";AAeA,IAAaA,IAGT;CACF,WAAW;EACT,WAAW,KAAK,IAAI;EACpB,aAAa,GAAU,MAAO,WAAW,WAAWC,GAAUC,CAAE;EAChE,eAAe,MAAW,WAAW,aAAaC,CAAuC;CAC3F;CACA,YAAY;EACV,iBAAiB,OAAO,WAAa,OAAe,SAAS,oBAAoB;EACjF,WAAW,MACL,OAAO,WAAa,YAA0B,CAAC,KACnD,SAAS,iBAAiB,oBAAoBF,CAAQ,SACzC,SAAS,oBAAoB,oBAAoBA,CAAQ;CAE1E;AACF"}
1
+ {"version":3,"file":"uploadSettlementRuntime.js","names":["uploadSettlementRuntime","callback","ms","handle"],"sources":["../../../../../src/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.ts"],"sourcesContent":["export interface UploadSettlementScheduler {\n now(): number\n setTimeout(callback: () => void, ms: number): unknown\n clearTimeout(handle: unknown): void\n}\n\nexport interface UploadSettlementVisibility {\n isVisible(): boolean\n onChange(callback: () => void): () => void\n}\n\n/**\n * Writable fields so a test can replace a field, not the binding. Production code never writes here.\n * The settlement reads the fields at each use, not once at creation.\n */\nexport const uploadSettlementRuntime: {\n scheduler: UploadSettlementScheduler\n visibility: UploadSettlementVisibility\n} = {\n scheduler: {\n now: () => Date.now(),\n setTimeout: (callback, ms) => globalThis.setTimeout(callback, ms),\n clearTimeout: (handle) => globalThis.clearTimeout(handle as ReturnType<typeof setTimeout>),\n },\n visibility: {\n isVisible: () => typeof document === 'undefined' || document.visibilityState !== 'hidden',\n onChange: (callback) => {\n if (typeof document === 'undefined') return () => {}\n document.addEventListener('visibilitychange', callback)\n return () => document.removeEventListener('visibilitychange', callback)\n },\n },\n}\n"],"mappings":";AAeA,IAAaA,IAGT;CACF,WAAW;EACT,WAAW,KAAK,IAAI;EACpB,aAAa,GAAU,MAAO,WAAW,WAAWC,GAAUC,CAAE;EAChE,eAAe,MAAW,WAAW,aAAaC,CAAuC;CAC3F;CACA,YAAY;EACV,iBAAiB,OAAO,WAAa,OAAe,SAAS,oBAAoB;EACjF,WAAW,MACL,OAAO,WAAa,YAA0B,CAAC,KACnD,SAAS,iBAAiB,oBAAoBF,CAAQ,SACzC,SAAS,oBAAoB,oBAAoBA,CAAQ;CAE1E;AACF"}
@@ -11,71 +11,66 @@ export declare const UploadRowRole: {
11
11
  };
12
12
  export type UploadRowRoleType = (typeof UploadRowRole)[keyof typeof UploadRowRole];
13
13
  export interface UploadSettlePolicy {
14
- /** What a tick reads the state of the row's file with. `none`: the row is never tracked. */
14
+ /** How a tick reads the state of the row's file. `none`: the row is never tracked. */
15
15
  reader: 'asset' | 'slots' | 'none';
16
16
  /**
17
- * For the `processed` state ONLY.
18
- * `read`: uploaded only from a read, the event merely starts that read.
19
- * `event`: the state of the event is written at once, the read completes the row.
20
- * `never`: `processed` does not change the state of the row (mass edit), it only completes it.
21
- * `failed` and `duplicate` are written to every row that passes `matches(…, 'settle')`.
17
+ * Applies to the `processed` state only.
18
+ * `read`: uploaded only after a read; the event just starts the read.
19
+ * `event`: the event state is written at once; the read completes the row.
20
+ * `never`: `processed` does not change the row state (mass edit), it only completes
21
+ * it. `failed` and `duplicate` apply to every row matching `matches(…, 'settle')`.
22
22
  */
23
23
  settleOn: 'read' | 'event' | 'never';
24
24
  duplicate: 'becomeOriginal' | 'markDuplicate';
25
- /** `load`: the row is to have a form, and its metadata is loaded into it. */
25
+ /** `load`: the row gets a form, and its metadata is loaded into it. */
26
26
  metadata: 'load' | 'none';
27
27
  }
28
28
  export interface UploadSettlementTarget {
29
29
  assetId: DocId;
30
- /** The file the event or the read speaks of; `null` when the caller does not know it. */
30
+ /** `null` when the caller does not know the file. */
31
31
  fileId: DocIdNullable;
32
32
  /**
33
- * The DAM configurations the target is of: with `configOf` of the profile, a row in a queue of another configuration
34
- * is not concerned. Left out or empty: the rows of every queue. Two DAMs may give one asset id.
33
+ * DAM configurations of the target. With `configOf`, rows in queues of other configurations are not concerned.
34
+ * Omitted or empty: rows of every queue. Two DAMs may share an asset id.
35
35
  */
36
36
  configNames?: string[];
37
37
  }
38
- /** What the settlement says of one request it asks a reader for. A reader that ignores it behaves as before. */
38
+ /** Per-request options a reader may honour. A reader that ignores them keeps its old behaviour. */
39
39
  export interface UploadReadOptions {
40
40
  /**
41
- * Whether a failure of this request is to be reported to whoever collects the errors of the application.
42
- *
43
- * The poll and the notifications ask again and again for as long as a row waits, so of their requests only
44
- * the first that fails in a streak is `true`; a read that answers ends the streak (with `configOf` of the profile,
45
- * a streak is of one configuration, and only a read of that configuration ends it). The streak begins with a
46
- * failure that was written down (`readers.failureReported`): after one that was not, the next request is
47
- * `true` again. An asset that does not exist (404) counts as such a failure: it is `true` once per row at most.
48
- * A read the user asked for (the refresh) is always `true`.
41
+ * Whether a failure of this request should be reported to the app error collector.
42
+ * Polls and notifications retry while a row waits, so only the first failure of a streak is
43
+ * `true`. An answered read ends the streak; with `configOf`, streaks are per configuration.
44
+ * A streak starts only with a failure that was written down (`readers.failureReported`).
45
+ * A 404 counts as such, so it is `true` at most once per row.
46
+ * A user-requested refresh is always `true`.
49
47
  */
50
48
  report: boolean;
51
49
  /**
52
- * The queue the read is for: of the poll its own queue; of a read a notification or the refresh asked for, the
53
- * queue of the first row it concerns. For a reader that asks under the configuration of the queue. Not given when
54
- * the read concerns no row.
50
+ * The queue the read is for: the polled queue, or for notification
51
+ * and refresh reads the queue of the first concerned row.
52
+ * Lets a reader use the queue's configuration. Omitted when the read concerns no row.
55
53
  */
56
54
  queueKey?: UploadQueueKey;
57
55
  }
58
- /** What a store hands its settlement. */
59
56
  export interface UploadSettlementProfile {
60
- /** A live view of the queues of the store. The settlement keeps no rows, it always asks. */
57
+ /** Live view of the store's queues. The settlement keeps no rows and always asks. */
61
58
  queues(): Iterable<[UploadQueueKey, UploadQueue]>;
62
59
  /**
63
- * The DAM configuration the queue `queueKey` is of. With it, a target or an event that names configurations
64
- * concerns only the rows of their queues: the poll of a queue names that of the queue, and every read made for a
65
- * target or an event (one a notification asks for, the refresh, a known processed file, the original of a duplicate)
66
- * is made once for each configuration it names, by the queue of its first concerned row of that configuration, and
67
- * written into its rows alone; a configuration named whose queues have no row of the asset is not read. The reads of
68
- * a configuration go one after another, beside those of the others (and those that name none in a lane of their
69
- * own), each configuration with its own streak of failures. The caches are told the queue of the rows whose names
70
- * they get. Without it, every row of the asset is concerned, all reads go one after another with one streak, and the
71
- * caches are called without a queue, as before.
60
+ * DAM configuration of the queue. With it, named targets and
61
+ * events concern only rows of their configurations' queues.
62
+ * Each such read runs once per named configuration, through the queue of its first concerned
63
+ * row, and writes only into those rows. A configuration with no row of the asset is not read.
64
+ * Reads run sequentially per configuration, in parallel across configurations (unnamed reads get
65
+ * their own lane), each with its own failure streak. Caches get the queue of the named rows.
66
+ * Without it, every row of the asset is concerned, all reads share one lane and streak, and caches get no queue.
72
67
  */
73
68
  configOf?(queueKey: UploadQueueKey): string;
74
69
  roleOf(row: UploadQueueItem): UploadRowRoleType;
75
70
  policyFor(role: UploadRowRoleType): UploadSettlePolicy;
76
71
  /**
77
- * `settle`: the row may be given a state. `decorate`: it may be completed without a change of state.
78
- * `metadata`: it may be given its metadata from the metadata notification.
72
+ * `settle`: the row may get a new state. `decorate`: it may be completed without a state change.
73
+ * `metadata`: it may get metadata from the metadata notification.
79
74
  */
80
75
  matches(row: UploadQueueItem, target: UploadSettlementTarget, purpose: 'settle' | 'decorate' | 'metadata'): boolean;
81
76
  readers: {
@@ -85,23 +80,25 @@ export interface UploadSettlementProfile {
85
80
  assets(licenceId: IntegerId, assetIds: DocId[], options?: UploadReadOptions): Promise<AssetDetailItemDto[]>;
86
81
  /** DAM: the files of all the slots of an asset. An answer that is no list throws. */
87
82
  slotFiles?(assetId: DocId, options?: UploadReadOptions): Promise<AssetFileNullable[]>;
88
- /** LIB: the asset the original file of a duplicate belongs to. `queueKey`: of the first row that is to become it. */
83
+ /**
84
+ * LIB: the asset the original file of a duplicate belongs to. `queueKey`: of the first row that is to become it.
85
+ */
89
86
  duplicateOriginAsset?(originFileId: DocId, options?: Pick<UploadReadOptions, 'queueKey'>): Promise<AssetDetailItemDto>;
90
87
  /** DAM: the original file of a duplicate, by its type. */
91
88
  duplicateOriginFile?(originFileId: DocId, assetType: DamAssetTypeType): Promise<AssetFileNullable>;
92
89
  /**
93
- * Whether a failure of a read that was let report (`report: true`) was written down, by what the read threw:
94
- * `apiErrorIsReported` for readers that report through the api error logger. One that was not (a timeout, a
95
- * 401, a 403) has told nobody, and the next read is let report again. Without it, every such failure was.
90
+ * Whether a failure of a read with `report: true` was written
91
+ * down, judged by the thrown error, e.g. `apiErrorIsReported`.
92
+ * If not (timeout, 401, 403), nobody was told and the next read may
93
+ * report again. Without this, every failure counts as written down.
96
94
  */
97
95
  failureReported?(error: unknown): boolean;
98
96
  };
99
97
  /**
100
- * `queueKey`: the queue of the rows whose names are added, and the one whose names are to be fetched, given only to
101
- * a profile with `configOf`, as the second argument (an `add` of `defineCached`, which takes every argument as an
102
- * id, is to be wrapped). Such a profile is asked to fetch, where the fetch was asked for before (after a read,
103
- * after a duplicate became its original), for each queue whose rows were given names since its last fetch. A
104
- * profile without it is called without a queue, as before.
98
+ * `queueKey` is passed as the second argument only to a profile with `configOf`.
99
+ * Wrap a `defineCached` `add`, which treats every argument as an id.
100
+ * Such a profile is asked to fetch once per queue whose rows got
101
+ * names since its last fetch. Without `configOf`, calls get no queue.
105
102
  */
106
103
  caches: {
107
104
  addAuthors(ids: DocId[], queueKey?: UploadQueueKey): void;
@@ -114,14 +111,14 @@ export interface UploadSettlementProfile {
114
111
  readFailed(row: UploadQueueItem): string;
115
112
  assetMissing(row: UploadQueueItem): string;
116
113
  /**
117
- * The text of an uploaded row still without its metadata whose asset was missing from as many reads as it
118
- * takes: it fails with it. Without it, `assetMissing`.
114
+ * Fail text for an uploaded row without metadata whose asset
115
+ * was missing from too many reads. Defaults to `assetMissing`.
119
116
  */
120
117
  assetGone?(row: UploadQueueItem): string;
121
118
  };
122
119
  /**
123
- * `'load'`: this row may be given its metadata from the notification although it has failed. `undefined`: the
124
- * default rules. DAM: a mass-edit row its batch load left out.
120
+ * `'load'`: the row may get metadata from the notification although it failed. `undefined`: default rules.
121
+ * DAM: a mass-edit row its batch load left out.
125
122
  */
126
123
  metadataGate?(queueKey: UploadQueueKey, row: UploadQueueItem): 'load' | undefined;
127
124
  hooks: {
@@ -131,24 +128,21 @@ export interface UploadSettlementProfile {
131
128
  onAssetRead?(asset: AssetDetailItemDto): void;
132
129
  /** A row with `settleOn: 'never'` has learnt its file is processed (an event, a tick or a manual read). */
133
130
  onProcessedSeen?(queueKey: UploadQueueKey, row: UploadQueueItem): void;
134
- /** The row was given its metadata. */
135
131
  afterMetadataLoaded?(queueKey: UploadQueueKey, row: UploadQueueItem): void;
136
132
  /**
137
- * Whether a refresh may still change a failed row, told whenever that changes. For a store that offers
138
- * refresh on a failed row only where it can help.
139
- *
140
- * `true`: the row is asked about although the client gave it up (`track(…, { clientFailed: true })`), or its
141
- * file is a duplicate whose original could not be read. `false`: the server has said what became of the file
142
- * (processed, failed, a duplicate that was settled), its asset is gone from as many reads as it takes, or the
143
- * store took the row out (`untrack`, `dropQueue`). A row never told `true` is never told `false`. Not called
144
- * by `dispose()`.
133
+ * Whether a refresh may still change a failed row; called when
134
+ * that changes, for stores that offer refresh only where it helps.
135
+ * `true`: tracked despite `clientFailed: true`, or a duplicate whose original could not be read.
136
+ * `false`: the server settled the file, the asset was missing too
137
+ * often, or the store removed the row (`untrack`, `dropQueue`).
138
+ * Never `false` without a prior `true`. Not called by `dispose()`.
145
139
  */
146
140
  onRefreshMayHelp?(queueKey: UploadQueueKey, row: UploadQueueItem, mayHelp: boolean): void;
147
141
  };
148
142
  connection: {
149
143
  /**
150
- * Whether notifications come for the rows of the queue `queueKey`: its poll is then only a backup. A profile
151
- * that keeps one state for all its queues may leave the queue unread.
144
+ * Whether notifications arrive for the queue's rows; the poll is then
145
+ * only a backup. A profile with one shared state may ignore `queueKey`.
152
146
  */
153
147
  isPushAlive(queueKey?: UploadQueueKey): boolean;
154
148
  /** Called whenever that may have changed, for any queue. */
@@ -163,18 +157,17 @@ export interface UploadSettlementEvent {
163
157
  failReason?: AssetFileFailReasonType;
164
158
  originAssetFile?: DocIdNullable;
165
159
  assetType?: DamAssetTypeType | null;
166
- /** The DAM configurations the event is of, as on `UploadSettlementTarget`. Left out: every queue. */
160
+ /** DAM configurations of the event, as on `UploadSettlementTarget`. Omitted: every queue. */
167
161
  configNames?: string[];
168
162
  }
169
163
  /**
170
- * `settled`: the main file is in a final state, or its asset was missing once too often and its rows were given
171
- * up. `pending`: not yet. And what asking again may mend: `error`, the read failed; `missing`, the asset was not
172
- * found; `originalUnread`, a row is left without the original of its duplicate, which could not be read.
164
+ * `settled`: the main file is final, or the asset was missing too often and its rows were given up. `pending`: not yet.
165
+ * Retryable: `error` (read failed), `missing` (asset not found),
166
+ * `originalUnread` (duplicate's original could not be read).
173
167
  */
174
168
  export type UploadRefreshOutcome = 'settled' | 'pending' | 'error' | 'missing' | 'originalUnread';
175
- /** What a store uses. */
176
169
  export interface UploadSettlement {
177
- /** The row began to wait for the server. A row that is not in the queue `queueKey` is ignored. */
170
+ /** The row starts waiting for the server. Ignored if the row is not in `queueKey`. */
178
171
  track(queueKey: UploadQueueKey, row: UploadQueueItem, options?: {
179
172
  clientFailed?: boolean;
180
173
  }): void;
@@ -184,23 +177,20 @@ export interface UploadSettlement {
184
177
  /** A notification. Resolves after the write (a delayed read included) or after a failed read; never rejects. */
185
178
  notify(event: UploadSettlementEvent): Promise<void>;
186
179
  /**
187
- * The manual refresh: a read at once, with the metadata, without a hint. With `configOf` of the profile, a
188
- * configuration the target names whose queues have no row of the asset is not read (`settled`); of several, the
189
- * outcome first of `error`, `originalUnread`, `missing`, `pending`, `settled` that any of their reads had.
180
+ * Manual refresh: an immediate read with metadata and no hint.
181
+ * With `configOf`, a named configuration with no row of the asset is not read (`settled`). With several,
182
+ * returns the first of `error`, `originalUnread`, `missing`, `pending`, `settled` any read had.
190
183
  */
191
184
  refreshAsset(target: UploadSettlementTarget): Promise<UploadRefreshOutcome>;
192
185
  /** The caller knows the file is processed: a read at once, with the hint `processed`. */
193
186
  settleKnownProcessed(target: UploadSettlementTarget, options: {
194
187
  withMetadata: boolean;
195
188
  }): Promise<void>;
196
- /** A known duplicate without a read of the asset: the `duplicate` event, and a copy the licence already has. */
189
+ /** Settles a known duplicate without reading the asset: the `duplicate` event, or a copy the licence already has. */
197
190
  settleKnownDuplicate(target: UploadSettlementTarget, originFileId: DocIdNullable, assetType: DamAssetTypeType | null): Promise<void>;
198
191
  /** A known failure, without a read. Synchronous. */
199
192
  settleKnownFailed(target: UploadSettlementTarget, failReason: AssetFileFailReasonType): void;
200
- /**
201
- * The row failed by the read that was one too many to find no asset of it (the poll's, a notification's, a
202
- * refresh's), and the server has settled it by nothing else since.
203
- */
193
+ /** The row failed because too many reads found no asset, and the server has not settled it otherwise since. */
204
194
  isGivenUpMissing(row: UploadQueueItem): boolean;
205
195
  hasTracked(): boolean;
206
196
  dispose(): void;