@anzusystems/common-admin 2.0.0-rc.5 → 2.0.0-rc.7
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.
- package/README.md +4 -0
- package/dist/AnzuSystemsCommonAdmin.d.ts +42 -32
- package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
- package/dist/common-admin.css +1 -1
- package/dist/common-admin.js +282 -282
- package/dist/domains/anzuUser/api/anzuUserApi.d.ts +9 -12
- package/dist/domains/anzuUser/api/anzuUserApi.js.map +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserDatatable.js.map +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue.d.ts +38 -44
- package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserFilter.js.map +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserFilter.vue.d.ts +12 -13
- package/dist/domains/anzuUser/components/AAnzuUserFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserForm.js.map +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserForm.vue.d.ts +18 -20
- package/dist/domains/anzuUser/components/AAnzuUserForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.js.map +1 -1
- package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserBulkActionDialog.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserBulkActionDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue.d.ts +2 -3
- package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserCreateInSystemButton.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue.d.ts +9 -15
- package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserEnabledSwitch.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue.d.ts +8 -7
- package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserManageButton.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserManageButton.vue.d.ts +0 -1
- package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserMetadataForm.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserMetadataForm.vue.d.ts +8 -9
- package/dist/domains/anzuUser/components/AUserMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserOtherSystemsTable.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue.d.ts +1 -2
- package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemOverview.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemPanel.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemPanel.vue.d.ts +2 -2
- package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemStatusChip.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserSystemStatusChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserTabsShell.js.map +1 -1
- package/dist/domains/anzuUser/components/AUserTabsShell.vue.d.ts +17 -22
- package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/anzuUser/composables/anzuUserActions.d.ts +5 -9
- package/dist/domains/anzuUser/composables/anzuUserActions.js.map +1 -1
- package/dist/domains/anzuUser/composables/anzuUserValidations.d.ts +4 -6
- package/dist/domains/anzuUser/composables/anzuUserValidations.js.map +1 -1
- package/dist/domains/anzuUser/composables/cachedAnzuUsers.d.ts +3 -3
- package/dist/domains/anzuUser/composables/cachedAnzuUsers.js.map +1 -1
- package/dist/domains/anzuUser/composables/userCrossSystemSearch.d.ts +2 -4
- package/dist/domains/anzuUser/composables/userCrossSystemSearch.js.map +1 -1
- package/dist/domains/anzuUser/composables/userCrossSystemWrites.d.ts +5 -11
- package/dist/domains/anzuUser/composables/userCrossSystemWrites.js.map +1 -1
- package/dist/domains/anzuUser/composables/userSystemDescriptor.d.ts +33 -57
- package/dist/domains/anzuUser/composables/userSystemDescriptor.js.map +1 -1
- package/dist/domains/anzuUser/composables/userSystemProbe.d.ts +7 -27
- package/dist/domains/anzuUser/composables/userSystemProbe.js.map +1 -1
- package/dist/domains/anzuUser/filter/anzuUserFilter.d.ts +6 -16
- package/dist/domains/anzuUser/filter/anzuUserFilter.js.map +1 -1
- package/dist/domains/anzuUser/store/anzuUserStore.d.ts +1 -5
- package/dist/domains/anzuUser/store/anzuUserStore.js.map +1 -1
- package/dist/domains/anzuUser/store/userCrossSystemStore.d.ts +3 -14
- package/dist/domains/anzuUser/store/userCrossSystemStore.js.map +1 -1
- package/dist/domains/anzuUser/utils/userMetadataDiff.d.ts +7 -19
- package/dist/domains/anzuUser/utils/userMetadataDiff.js.map +1 -1
- package/dist/domains/anzuUser/utils/userSystemState.d.ts +12 -30
- package/dist/domains/anzuUser/utils/userSystemState.js.map +1 -1
- package/dist/domains/anzuUser/utils/userTabs.d.ts +1 -3
- package/dist/domains/anzuUser/utils/userTabs.js.map +1 -1
- package/dist/domains/api/composables/defineApiClient.d.ts +4 -8
- package/dist/domains/api/composables/defineApiClient.js.map +1 -1
- package/dist/domains/api/composables/request.d.ts +18 -48
- package/dist/domains/api/composables/request.js.map +1 -1
- package/dist/domains/api/composables/useApiFetchByIds.d.ts +7 -21
- package/dist/domains/api/composables/useApiFetchByIds.js.map +1 -1
- package/dist/domains/api/composables/useApiFetchItems.d.ts +18 -57
- package/dist/domains/api/composables/useApiFetchItems.js.map +1 -1
- package/dist/domains/api/composables/useApiFetchList.d.ts +7 -23
- package/dist/domains/api/composables/useApiFetchList.js.map +1 -1
- package/dist/domains/api/composables/useApiFetchListBatch.d.ts +5 -22
- package/dist/domains/api/composables/useApiFetchListBatch.js.map +1 -1
- package/dist/domains/api/composables/useApiQueryBuilder.js.map +1 -1
- package/dist/domains/api/composables/useApiRequest.d.ts +16 -39
- package/dist/domains/api/composables/useApiRequest.js.map +1 -1
- package/dist/domains/api/utils/apiErrors.d.ts +28 -55
- package/dist/domains/api/utils/apiErrors.js.map +1 -1
- package/dist/domains/api/utils/listBody.d.ts +22 -43
- package/dist/domains/api/utils/listBody.js.map +1 -1
- package/dist/domains/auth/components/Acl.js.map +1 -1
- package/dist/domains/auth/components/Acl.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/auth/composables/aclAllowed.d.ts +2 -3
- package/dist/domains/auth/composables/aclAllowed.js.map +1 -1
- package/dist/domains/auth/composables/defineAuth.js.map +1 -1
- package/dist/domains/auth/composables/refreshSession.d.ts +10 -13
- package/dist/domains/auth/composables/refreshSession.js.map +1 -1
- package/dist/domains/cached/components/ACachedChip.js.map +1 -1
- package/dist/domains/cached/components/ACachedChip.vue.d.ts +13 -11
- package/dist/domains/cached/components/ACachedChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/cached/components/ACachedUserChip.js +1 -1
- package/dist/domains/cached/components/ACachedUserChip.js.map +1 -1
- package/dist/domains/cached/components/ACachedUserChip.vue.d.ts +3 -3
- package/dist/domains/cached/components/ACachedUserChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/cached/composables/createUserAndTimeTrackingFields.d.ts +9 -9
- package/dist/domains/cached/composables/createUserAndTimeTrackingFields.js.map +1 -1
- package/dist/domains/cached/composables/defineCached.d.ts +13 -11
- package/dist/domains/cached/composables/defineCached.js.map +1 -1
- package/dist/domains/cached/composables/useCachedItem.d.ts +7 -8
- package/dist/domains/cached/composables/useCachedItem.js.map +1 -1
- package/dist/domains/collab/components/ACollabLockedByUser.js.map +1 -1
- package/dist/domains/collab/components/ACollabLockedByUser.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/collab/composables/collabAnyDataChange.js.map +1 -1
- package/dist/domains/collab/composables/collabField.d.ts +5 -3
- package/dist/domains/collab/composables/collabField.js.map +1 -1
- package/dist/domains/collab/composables/collabInit.js +58 -54
- package/dist/domains/collab/composables/collabInit.js.map +1 -1
- package/dist/domains/collab/composables/collabRecovery.d.ts +49 -0
- package/dist/domains/collab/composables/collabRecovery.js +99 -0
- package/dist/domains/collab/composables/collabRecovery.js.map +1 -0
- package/dist/domains/collab/composables/collabRoom.js +106 -106
- package/dist/domains/collab/composables/collabRoom.js.map +1 -1
- package/dist/domains/collab/composables/collabState.d.ts +11 -4
- package/dist/domains/collab/composables/collabState.js +34 -25
- package/dist/domains/collab/composables/collabState.js.map +1 -1
- package/dist/domains/collab/composables/commonAdminCollabOptions.d.ts +4 -2
- package/dist/domains/collab/types/Collab.d.ts +31 -5
- package/dist/domains/collab/types/Collab.js +23 -11
- package/dist/domains/collab/types/Collab.js.map +1 -1
- package/dist/domains/customDataForm/components/ACustomDataForm.js.map +1 -1
- package/dist/domains/customDataForm/components/ACustomDataForm.vue.d.ts +7 -5
- package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/customDataForm/components/ACustomDataFormElement.js.map +1 -1
- package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.js.map +1 -1
- package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue.d.ts +5 -3
- package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/customDataForm/composables/useCustomDataForm.js.map +1 -1
- package/dist/domains/customDataForm/types/CustomDataForm.d.ts +4 -1
- package/dist/domains/dam/api/damAssetApi.d.ts +7 -7
- package/dist/domains/dam/api/damAssetApi.js.map +1 -1
- package/dist/domains/dam/api/damAssetLicenceApi.d.ts +1 -1
- package/dist/domains/dam/api/damAssetLicenceApi.js.map +1 -1
- package/dist/domains/dam/api/damConstants.js.map +1 -1
- package/dist/domains/dam/api/damEndPoints.js.map +1 -1
- package/dist/domains/dam/api/damImageApi.js.map +1 -1
- package/dist/domains/dam/api/uploadApi.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue.d.ts +7 -5
- package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailDialog.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue.d.ts +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailSidebarActionsWrapper.vue.d.ts +5 -3
- package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue.d.ts +1 -1
- package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetImage.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetImage.vue.d.ts +1 -1
- package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue.d.ts +2 -2
- package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetInfobox.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetInfobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetMetadata.js.map +1 -1
- package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.d.ts +5 -6
- package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.js.map +1 -1
- package/dist/domains/dam/assetDetail/composables/assetDetailView.d.ts +10 -10
- package/dist/domains/dam/assetDetail/composables/assetDetailView.js.map +1 -1
- package/dist/domains/dam/assetDetail/store/assetDetailStore.js.map +1 -1
- package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.d.ts +4 -3
- package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.js.map +1 -1
- package/dist/domains/dam/assetSelect/api/damPodcastApi.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetListInner.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetListInner.vue.d.ts +789 -787
- package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetSelect.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +395 -393
- package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue.d.ts +14 -12
- package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectListBar.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue.d.ts +9 -7
- package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.js.map +1 -1
- package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
- package/dist/domains/dam/assetSelect/store/assetSelectStore.js.map +1 -1
- package/dist/domains/dam/author/api/authorApi.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorCreateButton.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorCreateButton.vue.d.ts +1 -1
- package/dist/domains/dam/author/components/AuthorCreateButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue.d.ts +9 -6
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js.map +1 -1
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue.d.ts +2 -2
- package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.js.map +1 -1
- package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue.d.ts +1 -1
- package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/author/composables/cachedAuthors.d.ts +5 -4
- package/dist/domains/dam/author/composables/cachedAuthors.js.map +1 -1
- package/dist/domains/dam/author/composables/cachedUsers.d.ts +5 -4
- package/dist/domains/dam/author/composables/cachedUsers.js.map +1 -1
- package/dist/domains/dam/author/composables/damAuthorConfig.d.ts +2 -2
- package/dist/domains/dam/author/composables/damAuthorConfig.js.map +1 -1
- package/dist/domains/dam/components/DamAdminAssetLink.js.map +1 -1
- package/dist/domains/dam/components/DamAdminAssetLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.d.ts +10 -8
- package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
- package/dist/domains/dam/composables/damConfigName.d.ts +8 -9
- package/dist/domains/dam/composables/damConfigName.js.map +1 -1
- package/dist/domains/dam/composables/damNotifications.d.ts +9 -9
- package/dist/domains/dam/composables/damNotifications.js.map +1 -1
- package/dist/domains/dam/composables/damNotificationsConnection.d.ts +4 -4
- package/dist/domains/dam/composables/damNotificationsConnection.js.map +1 -1
- package/dist/domains/dam/composables/damNotificationsEventBus.d.ts +2 -2
- package/dist/domains/dam/composables/damNotificationsEventBus.js.map +1 -1
- package/dist/domains/dam/composables/extSystemIdForCached.d.ts +5 -4
- package/dist/domains/dam/composables/extSystemIdForCached.js.map +1 -1
- package/dist/domains/dam/config/api/damAssetCustomFormApi.js.map +1 -1
- package/dist/domains/dam/config/api/damConfigApi.js.map +1 -1
- package/dist/domains/dam/config/composables/damConfigState.d.ts +5 -5
- package/dist/domains/dam/config/composables/damConfigState.js.map +1 -1
- package/dist/domains/dam/config/store/damConfigStore.d.ts +5 -4
- package/dist/domains/dam/config/store/damConfigStore.js.map +1 -1
- package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.d.ts +3 -1
- package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.js.map +1 -1
- package/dist/domains/dam/cropper/components/ACropper.js.map +1 -1
- package/dist/domains/dam/cropper/components/ACropper.vue.d.ts +8 -16
- package/dist/domains/dam/cropper/components/ACropper.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.js.map +1 -1
- package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/cropper/store/imageRoiStore.d.ts +9 -12
- package/dist/domains/dam/cropper/store/imageRoiStore.js.map +1 -1
- package/dist/domains/dam/cropper/utils/cropperGeometry.d.ts +24 -38
- package/dist/domains/dam/cropper/utils/cropperGeometry.js.map +1 -1
- package/dist/domains/dam/cropper/utils/cropperJsService.d.ts +3 -7
- package/dist/domains/dam/cropper/utils/cropperJsService.js +10 -3
- package/dist/domains/dam/cropper/utils/cropperJsService.js.map +1 -1
- package/dist/domains/dam/cropper/utils/cropperTypes.d.ts +3 -6
- package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.d.ts +5 -5
- package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageMediaWidget.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImagePublicInput.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidget.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/AImageWidgetSimple.vue.d.ts +43 -41
- package/dist/domains/dam/imageWidget/components/AMediaWidgetSimple.vue.d.ts +31 -29
- package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue.d.ts +29 -27
- package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageMassOperations.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue.d.ts +1 -1
- package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +68 -66
- package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +402 -400
- package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +384 -382
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/imageWidget/components/MediaWidgetSimpleDialog.vue.d.ts +7 -5
- package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.js.map +1 -1
- package/dist/domains/dam/imageWidget/composables/imageApiCms.js.map +1 -1
- package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.d.ts +11 -13
- package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js.map +1 -1
- package/dist/domains/dam/imageWidget/composables/useImageMassOperations.js.map +1 -1
- package/dist/domains/dam/imageWidget/store/imageMediaWidgetStore.js.map +1 -1
- package/dist/domains/dam/imageWidget/store/imageStore.js.map +1 -1
- package/dist/domains/dam/imageWidget/utils/damImage.d.ts +5 -6
- package/dist/domains/dam/imageWidget/utils/damImage.js.map +1 -1
- package/dist/domains/dam/imageWidget/utils/fieldLockTurns.d.ts +1 -2
- package/dist/domains/dam/imageWidget/utils/fieldLockTurns.js.map +1 -1
- package/dist/domains/dam/imageWidget/utils/imageSaves.d.ts +10 -14
- package/dist/domains/dam/imageWidget/utils/imageSaves.js.map +1 -1
- package/dist/domains/dam/imageWidget/utils/metadataToImageMap.js.map +1 -1
- package/dist/domains/dam/imageWidget/utils/waitLimit.d.ts +4 -6
- package/dist/domains/dam/imageWidget/utils/waitLimit.js.map +1 -1
- package/dist/domains/dam/keyword/api/keywordApi.js.map +1 -1
- package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.js.map +1 -1
- package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue.d.ts +1 -1
- package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.js.map +1 -1
- package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue.d.ts +8 -5
- package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js +1 -1
- package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js.map +1 -1
- package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue.d.ts +2 -2
- package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/keyword/composables/cachedKeywords.d.ts +5 -4
- package/dist/domains/dam/keyword/composables/cachedKeywords.js.map +1 -1
- package/dist/domains/dam/keyword/composables/damKeywordConfig.d.ts +2 -2
- package/dist/domains/dam/keyword/composables/damKeywordConfig.js.map +1 -1
- package/dist/domains/dam/types/Asset.d.ts +1 -1
- package/dist/domains/dam/types/Asset.js.map +1 -1
- package/dist/domains/dam/types/UploadQueue.d.ts +5 -4
- package/dist/domains/dam/types/UploadQueue.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue.d.ts +2 -2
- package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue.d.ts +6 -4
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue.d.ts +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue.d.ts +6 -6
- package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue.d.ts +13 -13
- package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.d.ts +13 -13
- package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.js.map +1 -1
- package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.d.ts +2 -2
- package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.js.map +1 -1
- package/dist/domains/dam/uploadQueue/composables/uploadMeter.d.ts +12 -12
- package/dist/domains/dam/uploadQueue/composables/uploadMeter.js.map +1 -1
- package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.d.ts +5 -5
- package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.js.map +1 -1
- package/dist/domains/dam/uploadQueue/composables/uploadService.d.ts +2 -3
- package/dist/domains/dam/uploadQueue/composables/uploadService.js.map +1 -1
- package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.d.ts +5 -4
- package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.js.map +1 -1
- package/dist/domains/dam/uploadQueue/core/uploadQueueCore.d.ts +3 -2
- package/dist/domains/dam/uploadQueue/core/uploadQueueCore.js.map +1 -1
- package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.d.ts +8 -5
- package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.js.map +1 -1
- package/dist/domains/dam/uploadQueue/core/uploadQueueFill.d.ts +3 -3
- package/dist/domains/dam/uploadQueue/core/uploadQueueFill.js.map +1 -1
- package/dist/domains/dam/uploadQueue/presets/queuePresets.d.ts +8 -5
- package/dist/domains/dam/uploadQueue/presets/queuePresets.js.map +1 -1
- package/dist/domains/dam/uploadQueue/presets/uploadPresets.d.ts +15 -13
- package/dist/domains/dam/uploadQueue/presets/uploadPresets.js.map +1 -1
- package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.d.ts +7 -7
- package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.js.map +1 -1
- package/dist/domains/dam/uploadQueue/settlement/uploadPoller.d.ts +4 -4
- package/dist/domains/dam/uploadQueue/settlement/uploadPoller.js.map +1 -1
- package/dist/domains/dam/uploadQueue/settlement/uploadSettle.d.ts +28 -30
- package/dist/domains/dam/uploadQueue/settlement/uploadSettle.js.map +1 -1
- package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.d.ts +2 -2
- package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.js.map +1 -1
- package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.d.ts +2 -2
- package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.js.map +1 -1
- package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.d.ts +63 -73
- package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.js.map +1 -1
- package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.d.ts +8 -9
- package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.js.map +1 -1
- package/dist/domains/dam/user/api/userApi.d.ts +2 -2
- package/dist/domains/dam/user/api/userApi.js.map +1 -1
- package/dist/domains/dam/user/components/DamDistributionServiceSelect.js.map +1 -1
- package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue.d.ts +1 -1
- package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.js.map +1 -1
- package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue.d.ts +1 -1
- package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.js.map +1 -1
- package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue.d.ts +1 -1
- package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/dam/user/composables/damUserSelectActions.d.ts +1 -1
- package/dist/domains/dam/user/composables/damUserSelectActions.js.map +1 -1
- package/dist/domains/dam/user/types/DamDistributionServiceType.d.ts +2 -2
- package/dist/domains/dam/user/types/DamDistributionServiceType.js.map +1 -1
- package/dist/domains/dam/user/types/DamExternalProviderAssetType.d.ts +1 -1
- package/dist/domains/dam/user/types/DamExternalProviderAssetType.js.map +1 -1
- package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.js.map +1 -1
- package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/bookmarks/store/bookmarksStore.d.ts +3 -3
- package/dist/domains/filters/bookmarks/store/bookmarksStore.js.map +1 -1
- package/dist/domains/filters/components/AFilterDatetimePicker.js.map +1 -1
- package/dist/domains/filters/components/AFilterDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/components/AFilterInteger.js.map +1 -1
- package/dist/domains/filters/components/AFilterInteger.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/components/AFilterString.js.map +1 -1
- package/dist/domains/filters/components/AFilterString.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/components/AFilterTimeInterval.js +1 -1
- package/dist/domains/filters/components/AFilterTimeInterval.js.map +1 -1
- package/dist/domains/filters/components/AFilterTimeInterval.vue.d.ts +5 -3
- package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.js.map +1 -1
- package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/components/AFilterWrapper.js.map +1 -1
- package/dist/domains/filters/components/AFilterWrapper.vue.d.ts +17 -15
- package/dist/domains/filters/components/AFilterWrapper.vue_vue_type_script_setup_true_lang.js +63 -62
- package/dist/domains/filters/components/AFilterWrapper.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/components/AFilterWrapperSidebar.vue.d.ts +5 -3
- package/dist/domains/filters/components/FiltersSelected.js.map +1 -1
- package/dist/domains/filters/components/FiltersSelected.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/composables/filterFactory.d.ts +16 -26
- package/dist/domains/filters/composables/filterFactory.js +38 -31
- package/dist/domains/filters/composables/filterFactory.js.map +1 -1
- package/dist/domains/filters/datatable/components/ADatatableOrdering.js.map +1 -1
- package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/datatable/components/ADatatablePagination.js.map +1 -1
- package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js +2 -4
- package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/filters/utils/filterInjectionKeys.js.map +1 -1
- package/dist/domains/form/components/AFormDatetimePicker.js.map +1 -1
- package/dist/domains/form/components/AFormDatetimePicker.vue.d.ts +7 -5
- package/dist/domains/form/components/AFormDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/form/components/AFormFlagDatetimePicker.js.map +1 -1
- package/dist/domains/form/components/AFormFlagDatetimePicker.vue.d.ts +7 -5
- package/dist/domains/form/components/AFormFlagDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/form/components/AFormSwitch.vue.d.ts +7 -5
- package/dist/domains/form/components/AFormTextField.js.map +1 -1
- package/dist/domains/form/components/AFormTextField.vue.d.ts +9 -7
- package/dist/domains/form/components/AFormTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/form/components/AFormTextarea.vue.d.ts +13 -11
- package/dist/domains/form/components/AFormValueObjectOptionsSelect.vue.d.ts +7 -5
- package/dist/domains/form/components/ASystemEntityScope.vue.d.ts +5 -3
- package/dist/domains/job/api/jobApi.js.map +1 -1
- package/dist/domains/job/components/AJobDetailCommon.vue.d.ts +5 -3
- package/dist/domains/listEditor/components/AListEditor.js.map +1 -1
- package/dist/domains/listEditor/components/AListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/listEditor/components/ANestedSortableListEditor.js.map +1 -1
- package/dist/domains/listEditor/components/ANestedSortableListEditor.vue.d.ts +2 -3
- package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/listEditor/components/ASortableListEditor.js.map +1 -1
- package/dist/domains/listEditor/components/ASortableListEditor.vue.d.ts +2 -3
- package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/listEditor/composables/useListEditorController.d.ts +4 -5
- package/dist/domains/listEditor/composables/useListEditorController.js.map +1 -1
- package/dist/domains/listEditor/composables/useNestedListEditor.d.ts +3 -4
- package/dist/domains/listEditor/composables/useNestedListEditor.js.map +1 -1
- package/dist/domains/listEditor/composables/useNestedListEditorController.d.ts +5 -4
- package/dist/domains/listEditor/composables/useNestedListEditorController.js.map +1 -1
- package/dist/domains/listEditor/composables/useReorderMode.js.map +1 -1
- package/dist/domains/listEditor/types/listEditorTypes.d.ts +2 -2
- package/dist/domains/listEditor/utils/listEditorLoader.d.ts +5 -5
- package/dist/domains/listEditor/utils/listEditorLoader.js.map +1 -1
- package/dist/domains/listEditor/utils/resolveCompactText.js.map +1 -1
- package/dist/domains/log/api/logApi.d.ts +2 -3
- package/dist/domains/log/api/logApi.js.map +1 -1
- package/dist/domains/log/components/ALogDatatable.js.map +1 -1
- package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/log/components/ALogDetailView.js.map +1 -1
- package/dist/domains/log/components/ALogDetailView.vue.d.ts +1 -1
- package/dist/domains/log/components/ALogDetailView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/log/components/ALogFilter.js.map +1 -1
- package/dist/domains/log/components/ALogFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/log/components/ALogListView.js.map +1 -1
- package/dist/domains/log/components/ALogListView.vue.d.ts +1 -1
- package/dist/domains/log/components/ALogListView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/log/composables/logActions.d.ts +4 -5
- package/dist/domains/log/composables/logActions.js.map +1 -1
- package/dist/domains/log/composables/logType.d.ts +6 -7
- package/dist/domains/log/composables/logType.js.map +1 -1
- package/dist/domains/log/filter/logFilter.d.ts +8 -11
- package/dist/domains/log/filter/logFilter.js.map +1 -1
- package/dist/domains/permission/components/APermissionEditor.js.map +1 -1
- package/dist/domains/permission/components/APermissionEditor.vue.d.ts +4 -4
- package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/permission/composables/permissionActions.d.ts +3 -6
- package/dist/domains/permission/composables/permissionActions.js.map +1 -1
- package/dist/domains/permission/config/api/permissionConfigApi.d.ts +2 -2
- package/dist/domains/permission/config/api/permissionConfigApi.js.map +1 -1
- package/dist/domains/permission/config/composables/permissionConfigActions.d.ts +3 -7
- package/dist/domains/permission/config/composables/permissionConfigActions.js.map +1 -1
- package/dist/domains/permission/config/store/permissionConfigStore.d.ts +2 -4
- package/dist/domains/permission/config/store/permissionConfigStore.js.map +1 -1
- package/dist/domains/permission/group/api/permissionGroupApi.d.ts +8 -10
- package/dist/domains/permission/group/api/permissionGroupApi.js.map +1 -1
- package/dist/domains/permission/group/components/APermissionGroupDatatable.js.map +1 -1
- package/dist/domains/permission/group/components/APermissionGroupDatatable.vue.d.ts +12 -10
- package/dist/domains/permission/group/components/APermissionGroupDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/permission/group/components/APermissionGroupDetail.js.map +1 -1
- package/dist/domains/permission/group/components/APermissionGroupDetail.vue.d.ts +21 -22
- package/dist/domains/permission/group/components/APermissionGroupDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/permission/group/components/APermissionGroupManage.js.map +1 -1
- package/dist/domains/permission/group/components/APermissionGroupManage.vue.d.ts +21 -22
- package/dist/domains/permission/group/components/APermissionGroupManage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/permission/group/composables/cachedPermissionGroups.js.map +1 -1
- package/dist/domains/permission/group/composables/permissionGroupActions.d.ts +6 -8
- package/dist/domains/permission/group/composables/permissionGroupActions.js.map +1 -1
- package/dist/domains/permission/group/composables/permissionGroupValidations.d.ts +2 -3
- package/dist/domains/permission/group/composables/permissionGroupValidations.js.map +1 -1
- package/dist/domains/permission/group/filter/permissionGroupFilter.d.ts +2 -3
- package/dist/domains/permission/group/filter/permissionGroupFilter.js.map +1 -1
- package/dist/domains/permission/group/store/permissionGroupStore.d.ts +3 -6
- package/dist/domains/permission/group/store/permissionGroupStore.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.vue.d.ts +5 -3
- package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.d.ts +11 -13
- package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.js.map +1 -1
- package/dist/domains/subjectSelect/components/AFilterWrapperSubjectSelect.vue.d.ts +13 -11
- package/dist/domains/subjectSelect/components/ASubjectSelect.js.map +1 -1
- package/dist/domains/subjectSelect/components/ASubjectSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/subjectSelect/composables/useSubjectSelect.js +53 -51
- package/dist/domains/subjectSelect/composables/useSubjectSelect.js.map +1 -1
- package/dist/domains/system/appShell/components/AActionbar.vue.d.ts +7 -5
- package/dist/domains/system/appShell/components/ALayoutSwitch.js.map +1 -1
- package/dist/domains/system/appShell/components/ALayoutSwitch.vue.d.ts +7 -5
- package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/system/appShell/composables/teleportSlot.d.ts +0 -1
- package/dist/domains/system/appShell/composables/teleportSlot.js.map +1 -1
- package/dist/domains/system/components/AAlerts.js.map +1 -1
- package/dist/domains/system/components/AAlerts.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/system/composables/alerts.js.map +1 -1
- package/dist/domains/system/composables/breadcrumbs.d.ts +3 -3
- package/dist/domains/system/composables/breadcrumbs.js.map +1 -1
- package/dist/domains/system/composables/languageSettings.js.map +1 -1
- package/dist/domains/system/composables/loginStatus.js.map +1 -1
- package/dist/domains/system/composables/navigationError.d.ts +6 -8
- package/dist/domains/system/composables/navigationError.js.map +1 -1
- package/dist/domains/system/composables/pageNavigation.d.ts +9 -10
- package/dist/domains/system/composables/pageNavigation.js.map +1 -1
- package/dist/domains/system/composables/recordActions.d.ts +14 -22
- package/dist/domains/system/composables/recordActions.js.map +1 -1
- package/dist/domains/system/composables/recordPage.d.ts +23 -38
- package/dist/domains/system/composables/recordPage.js.map +1 -1
- package/dist/domains/system/composables/routeHistory.d.ts +4 -5
- package/dist/domains/system/composables/routeHistory.js.map +1 -1
- package/dist/domains/system/composables/sentry.js.map +1 -1
- package/dist/domains/system/composables/useDebugFeatures.d.ts +3 -6
- package/dist/domains/system/composables/useDebugFeatures.js.map +1 -1
- package/dist/domains/system/store/datatablePageStore.d.ts +8 -1
- package/dist/domains/system/store/datatablePageStore.js +10 -3
- package/dist/domains/system/store/datatablePageStore.js.map +1 -1
- package/dist/domains/system/systemBar/components/ASystemBar.js.map +1 -1
- package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/system/systemBar/utils/appReload.d.ts +5 -5
- package/dist/domains/system/systemBar/utils/appReload.js.map +1 -1
- package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.js.map +1 -1
- package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue.d.ts +2 -3
- package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/buttons/action/components/AActionDeleteButton.js.map +1 -1
- package/dist/domains/ui/buttons/action/components/AActionDeleteButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/buttons/components/ABtnSplit.vue.d.ts +9 -7
- package/dist/domains/ui/components/AAvatarColorPicker.js.map +1 -1
- package/dist/domains/ui/components/AAvatarColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/components/ACard.js.map +1 -1
- package/dist/domains/ui/components/ACard.vue.d.ts +7 -3
- package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/components/ACardLoader.js.map +1 -1
- package/dist/domains/ui/components/ACardLoader.vue.d.ts +1 -0
- package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js +13 -7
- package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/components/AChipNoLink.vue.d.ts +5 -3
- package/dist/domains/ui/components/ACopyText.vue.d.ts +9 -7
- package/dist/domains/ui/components/ACreateDialog.js.map +1 -1
- package/dist/domains/ui/components/ACreateDialog.vue.d.ts +11 -9
- package/dist/domains/ui/components/ACreateDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/components/ADialogToolbar.vue.d.ts +5 -3
- package/dist/domains/ui/components/ARow.vue.d.ts +5 -3
- package/dist/domains/ui/components/ATimeTrackingFields.js.map +1 -1
- package/dist/domains/ui/components/ATimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/components/AUserAndTimeTrackingFields.js.map +1 -1
- package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue.d.ts +3 -5
- package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/datetime/components/ADatetimePicker.js +1 -1
- package/dist/domains/ui/datetime/components/ADatetimePicker.js.map +1 -1
- package/dist/domains/ui/datetime/components/ADatetimePicker.vue.d.ts +5 -3
- package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/file/components/AFileDropzone.js.map +1 -1
- package/dist/domains/ui/file/components/AFileDropzone.vue.d.ts +1 -1
- package/dist/domains/ui/file/components/AFileDropzone.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/file/components/AFileInput.js.map +1 -1
- package/dist/domains/ui/file/components/AFileInput.vue.d.ts +9 -7
- package/dist/domains/ui/file/components/AFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/file/components/AFileInputDialog.js.map +1 -1
- package/dist/domains/ui/file/components/AFileInputDialog.vue.d.ts +9 -7
- package/dist/domains/ui/file/components/AFileInputDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/file/composables/dropzone.js.map +1 -1
- package/dist/domains/ui/file/composables/formatAndSizeCheck.js.map +1 -1
- package/dist/domains/ui/view/components/AGenericView.vue.d.ts +7 -5
- package/dist/domains/ui/view/components/ALoginView.js +1 -1
- package/dist/domains/ui/view/components/ALoginView.js.map +1 -1
- package/dist/domains/ui/view/components/ALoginView.vue.d.ts +5 -3
- package/dist/domains/ui/view/components/ALoginView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/view/components/ALogoutView.js.map +1 -1
- package/dist/domains/ui/view/components/ALogoutView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/ui/view/components/ANotFoundView.js.map +1 -1
- package/dist/domains/ui/view/components/ANotFoundView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.d.ts +6 -7
- package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.js.map +1 -1
- package/dist/lib.d.ts +2 -2
- package/dist/plugins/commonVuetifyConfig.d.ts +3 -3
- package/dist/plugins/commonVuetifyConfig.js.map +1 -1
- package/dist/plugins/i18n.d.ts +4 -5
- package/dist/plugins/i18n.js.map +1 -1
- package/dist/plugins/pluginOptions.d.ts +4 -2
- package/dist/plugins/pluginOptions.js.map +1 -1
- package/dist/plugins/webfontloader.js.map +1 -1
- package/dist/shared/error/AnzuApiCancelledError.d.ts +5 -8
- package/dist/shared/error/AnzuApiCancelledError.js.map +1 -1
- package/dist/shared/error/AnzuError.d.ts +3 -5
- package/dist/shared/error/AnzuError.js.map +1 -1
- package/dist/shared/error/AuthUnavailableError.d.ts +3 -3
- package/dist/shared/error/AuthUnavailableError.js.map +1 -1
- package/dist/shared/error/isInCauseChain.d.ts +2 -2
- package/dist/shared/error/isInCauseChain.js.map +1 -1
- package/dist/shared/types/UserAndTimeTracking.d.ts +5 -5
- package/dist/shared/types/Validation.d.ts +4 -5
- package/dist/shared/types/common.d.ts +1 -3
- package/dist/shared/types/globalComponents.d.ts +5 -6
- package/dist/shared/utils/common.js.map +1 -1
- package/dist/shared/utils/datetime.d.ts +0 -1
- package/dist/shared/utils/datetime.js.map +1 -1
- package/dist/shared/utils/datetimePickerValue.d.ts +4 -7
- package/dist/shared/utils/datetimePickerValue.js.map +1 -1
- package/dist/shared/utils/development.d.ts +3 -3
- package/dist/shared/utils/development.js.map +1 -1
- package/dist/shared/utils/envConfig.d.ts +4 -4
- package/dist/shared/utils/envConfig.js.map +1 -1
- package/dist/shared/utils/json.d.ts +1 -1
- package/dist/shared/utils/json.js.map +1 -1
- package/dist/shared/utils/userAndTimeTracking.d.ts +5 -7
- package/dist/shared/utils/userAndTimeTracking.js.map +1 -1
- package/dist/shared/validators/vuelidate/common/useValidateHexColor.d.ts +3 -5
- package/dist/shared/validators/vuelidate/common/useValidateHexColor.js.map +1 -1
- package/dist/testing/appShell.d.ts +11 -11
- package/dist/testing/appShell.js.map +1 -1
- package/dist/testing/closeButtons.d.ts +9 -11
- package/dist/testing/closeButtons.js.map +1 -1
- package/dist/testing/declaredDependencies.d.ts +7 -7
- package/dist/testing/declaredDependencies.js.map +1 -1
- package/dist/testing/generatedRoutes.d.ts +6 -11
- package/dist/testing/generatedRoutes.js.map +1 -1
- package/dist/testing/routeHistory.d.ts +5 -12
- package/dist/testing/routeHistory.js.map +1 -1
- package/dist/testing/sortableLists.d.ts +16 -21
- package/dist/testing/sortableLists.js.map +1 -1
- package/dist/testing/typedRouter.d.ts +0 -1
- package/dist/testing/typedRouter.js.map +1 -1
- package/package.json +39 -29
- package/src/e2e/conventions.d.mts +4 -0
- package/src/e2e/conventions.mjs +15 -0
- package/src/e2e/index.d.mts +8 -0
- package/src/e2e/index.mjs +1 -0
- package/src/e2e/routeWalk.d.mts +43 -0
- package/src/e2e/routeWalk.mjs +606 -0
- package/src/e2e/types.d.mts +161 -0
- package/src/eslint/adminConfig.mjs +19 -27
- package/src/eslint/globalComponentNames.mjs +3 -4
- package/src/eslint/oxlint.mjs +7 -20
- package/src/eslint/plugin.d.mts +2 -4
- package/src/eslint/plugin.mjs +18 -34
- package/src/eslint/validRouteName.mjs +6 -7
- package/src/vite/devWatch.mjs +30 -43
- package/src/vite/index.d.mts +5 -5
- package/src/vite/sentry.mjs +7 -12
- package/src/vite/sourcemaps.mjs +4 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userMetadataDiff.js","names":["USER_METADATA_FIELDS","readMetadataField","field","user","writeMetadataField","value","findMetadataDifferences","differences","records","values","system","pickPrefillSource","order","systemsNeedingWrite","systems","fields","target"],"sources":["../../../../src/domains/anzuUser/utils/userMetadataDiff.ts"],"sourcesContent":["import type { BaseUser } from '@/shared/types/AnzuUser'\n\n/**\n * The six fields
|
|
1
|
+
{"version":3,"file":"userMetadataDiff.js","names":["USER_METADATA_FIELDS","readMetadataField","field","user","writeMetadataField","value","findMetadataDifferences","differences","records","values","system","pickPrefillSource","order","systemsNeedingWrite","systems","fields","target"],"sources":["../../../../src/domains/anzuUser/utils/userMetadataDiff.ts"],"sourcesContent":["import type { BaseUser } from '@/shared/types/AnzuUser'\n\n/**\n * The six compared fields.\n * `email` is why e-mail search runs twice: a system with a different\n * address answers nothing. The id round reveals that as an inconsistency.\n */\nexport const USER_METADATA_FIELDS = [\n 'email',\n 'person.firstName',\n 'person.lastName',\n 'person.fullName',\n 'avatar.color',\n 'avatar.text',\n] as const\n\nexport type UserMetadataField = (typeof USER_METADATA_FIELDS)[number]\n\nexport const readMetadataField = (user: BaseUser, field: UserMetadataField): string => {\n switch (field) {\n case 'email':\n return user.email\n case 'person.firstName':\n return user.person.firstName\n case 'person.lastName':\n return user.person.lastName\n case 'person.fullName':\n return user.person.fullName\n case 'avatar.color':\n return user.avatar.color\n case 'avatar.text':\n return user.avatar.text\n }\n}\n\nexport const writeMetadataField = (user: BaseUser, field: UserMetadataField, value: string): void => {\n switch (field) {\n case 'email':\n user.email = value\n break\n case 'person.firstName':\n user.person.firstName = value\n break\n case 'person.lastName':\n user.person.lastName = value\n break\n case 'person.fullName':\n user.person.fullName = value\n break\n case 'avatar.color':\n user.avatar.color = value\n break\n case 'avatar.text':\n user.avatar.text = value\n break\n }\n}\n\nexport interface MetadataDifference {\n field: UserMetadataField\n /** System to the value it holds, for every system that answered with a record. */\n values: Map<string, string>\n}\n\n/**\n * Blog is compared on `person.*`. Its root `firstName`/`lastName` are the public byline and are excluded.\n * Blog's empty `person` reads as different on purpose; the first repair fills it.\n */\nexport const findMetadataDifferences = (records: Map<string, BaseUser>): MetadataDifference[] => {\n const differences: MetadataDifference[] = []\n if (records.size < 2) return differences\n\n for (const field of USER_METADATA_FIELDS) {\n const values = new Map<string, string>()\n for (const [system, user] of records) {\n values.set(system, readMetadataField(user, field))\n }\n const distinct = new Set(values.values())\n if (distinct.size > 1) differences.push({ field, values })\n }\n\n return differences\n}\n\n/**\n * Prefill source: the first system in configured order with a record.\n * Not the first to answer, since the fan-out is parallel. The dialog names the source and lets it be changed.\n */\nexport const pickPrefillSource = (order: string[], records: Map<string, BaseUser>): string | null => {\n for (const system of order) {\n if (records.has(system)) return system\n }\n return null\n}\n\n/** Systems whose stored value differs from the one about to be written. Nothing else is touched. */\nexport const systemsNeedingWrite = (\n target: BaseUser,\n records: Map<string, BaseUser>,\n fields: readonly UserMetadataField[] = USER_METADATA_FIELDS\n): string[] => {\n const systems: string[] = []\n for (const [system, user] of records) {\n const differs = fields.some((field) => readMetadataField(user, field) !== readMetadataField(target, field))\n if (differs) systems.push(system)\n }\n return systems\n}\n"],"mappings":";AAOA,IAAaA,IAAuB;CAClC;CACA;CACA;CACA;CACA;CACA;AACF,GAIaC,KAAqB,GAAgB,MAAqC;CACrF,QAAQC,GAAR;EACE,KAAK,SACH,OAAOC,EAAK;EACd,KAAK,oBACH,OAAOA,EAAK,OAAO;EACrB,KAAK,mBACH,OAAOA,EAAK,OAAO;EACrB,KAAK,mBACH,OAAOA,EAAK,OAAO;EACrB,KAAK,gBACH,OAAOA,EAAK,OAAO;EACrB,KAAK,eACH,OAAOA,EAAK,OAAO;CACvB;AACF,GAEaC,KAAsB,GAAgB,GAA0B,MAAwB;CACnG,QAAQF,GAAR;EACE,KAAK;GACH,EAAK,QAAQG;GACb;EACF,KAAK;GACH,EAAK,OAAO,YAAYA;GACxB;EACF,KAAK;GACH,EAAK,OAAO,WAAWA;GACvB;EACF,KAAK;GACH,EAAK,OAAO,WAAWA;GACvB;EACF,KAAK;GACH,EAAK,OAAO,QAAQA;GACpB;EACF,KAAK,eACH,EAAK,OAAO,OAAOA;CAEvB;AACF,GAYaC,KAA2B,MAAyD;CAC/F,IAAMC,IAAoC,CAAC;CAC3C,IAAIC,EAAQ,OAAO,GAAG,OAAOD;CAE7B,KAAK,IAAML,KAASF,GAAsB;EACxC,IAAMS,oBAAS,IAAI,IAAoB;EACvC,KAAK,IAAM,CAACC,GAAQP,MAASK,GAC3B,EAAO,IAAIE,GAAQT,EAAkBE,GAAMD,CAAK,CAAC;EAGnD,AAAI,IADiB,IAAIO,EAAO,OAAO,CACnC,CAAA,CAAS,OAAO,KAAGF,EAAY,KAAK;GAAE;GAAO;EAAO,CAAC;CAC3D;CAEA,OAAOA;AACT,GAMaI,KAAqB,GAAiB,MAAkD;CACnG,KAAK,IAAMD,KAAUE,GACnB,IAAIJ,EAAQ,IAAIE,CAAM,GAAG,OAAOA;CAElC,OAAO;AACT,GAGaG,KACX,GACA,GACA,IAAuCb,MAC1B;CACb,IAAMc,IAAoB,CAAC;CAC3B,KAAK,IAAM,CAACJ,GAAQP,MAASK,GAE3B,AADgBO,EAAO,MAAM,MAAUd,EAAkBE,GAAMD,CAAK,MAAMD,EAAkBe,GAAQd,CAAK,CACrG,KAASY,EAAQ,KAAKJ,CAAM;CAElC,OAAOI;AACT"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Four independent axes
|
|
3
|
-
*
|
|
4
|
-
* The axes are kept apart because they answer different questions and can move independently: a
|
|
5
|
-
* system can be loaded and forbidden, or absent and still enabled in configuration. Collapsing
|
|
6
|
-
* them into one enum early is what made the per-admin prototypes conflate "no access" with "no
|
|
7
|
-
* account here" -- admin-cms's panel leaves `userExists` at null on any non-404 and offers
|
|
8
|
-
* "Create" in a system the operator cannot even read.
|
|
2
|
+
* Four independent axes, one derived state.
|
|
3
|
+
* Collapsing them early conflated "no access" with "no account" and offered Create in unreadable systems.
|
|
9
4
|
*/
|
|
10
5
|
export declare const UserSystemLoad: {
|
|
11
6
|
readonly Idle: "idle";
|
|
@@ -29,11 +24,8 @@ export declare const UserSystemAccess: {
|
|
|
29
24
|
};
|
|
30
25
|
export type UserSystemAccessType = (typeof UserSystemAccess)[keyof typeof UserSystemAccess];
|
|
31
26
|
/**
|
|
32
|
-
* `enabled` is
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* Ownership is deliberately *not* an axis. None of the six visual states below distinguishes it;
|
|
36
|
-
* it decides which button is drawn, and that is the descriptor's `manage` union.
|
|
27
|
+
* `enabled` is an axis so "here and on" and "here and off" can be told apart.
|
|
28
|
+
* Ownership is not an axis; the descriptor's `manage` decides the button.
|
|
37
29
|
*/
|
|
38
30
|
export interface UserSystemAxes {
|
|
39
31
|
load: UserSystemLoadType;
|
|
@@ -54,30 +46,20 @@ export declare const UserSystemState: {
|
|
|
54
46
|
export type UserSystemStateType = (typeof UserSystemState)[keyof typeof UserSystemState];
|
|
55
47
|
export declare const emptyUserSystemAxes: () => UserSystemAxes;
|
|
56
48
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* presence because a forbidden record is not an absent one.
|
|
49
|
+
* Order matters. Config-disabled wins over everything.
|
|
50
|
+
* Access is checked before presence because a forbidden record is not an absent one.
|
|
60
51
|
*/
|
|
61
52
|
export declare const resolveUserSystemState: (axes: UserSystemAxes) => UserSystemStateType;
|
|
62
53
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* exactly like "no account here" -- and since the buttons are gated by this answer alone, showing
|
|
67
|
-
* an expired token as "no account here" is the one confusion decision 16 forbids. The caller is
|
|
68
|
-
* expected to have retried through its refresh hook before classifying; what arrives here is the
|
|
69
|
-
* verdict after that retry.
|
|
70
|
-
*
|
|
71
|
-
* 422 deliberately has no case. A detail GET loads the record and returns it; it does not validate
|
|
72
|
-
* a body. A 422 belongs to the log of writes.
|
|
54
|
+
* 401 is its own case: an expired session must not show as "no account here" (decision 16).
|
|
55
|
+
* The caller retries through its refresh hook first; this receives the verdict.
|
|
56
|
+
* 422 has no case: a detail GET does not validate. A 422 belongs to the write log.
|
|
73
57
|
*/
|
|
74
58
|
export declare const classifyProbeStatus: (status: number | null) => Pick<UserSystemAxes, "presence" | "access">;
|
|
75
59
|
/**
|
|
76
|
-
* Whether
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* be read is not a record that does not exist, and since no admin can delete an AnzuUser, a
|
|
80
|
-
* duplicate identity created on a guess cannot be taken back.
|
|
60
|
+
* Whether every relevant system answered authoritatively that the account does not exist.
|
|
61
|
+
* Account creation is offered only then. An unreadable record is not a missing one, and
|
|
62
|
+
* an AnzuUser cannot be deleted, so a duplicate created on a guess cannot be undone.
|
|
81
63
|
*/
|
|
82
64
|
export declare const isAuthoritativelyAbsent: (axes: UserSystemAxes) => boolean;
|
|
83
65
|
/** A system a bulk action may act on: it answered, the account is there, and access was granted. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userSystemState.js","names":["UserSystemLoad","UserSystemPresence","UserSystemAccess","UserSystemState","emptyUserSystemAxes","resolveUserSystemState","axes","classifyProbeStatus","status","isAuthoritativelyAbsent","isActionable"],"sources":["../../../../src/domains/anzuUser/utils/userSystemState.ts"],"sourcesContent":["/**\n * Four independent axes
|
|
1
|
+
{"version":3,"file":"userSystemState.js","names":["UserSystemLoad","UserSystemPresence","UserSystemAccess","UserSystemState","emptyUserSystemAxes","resolveUserSystemState","axes","classifyProbeStatus","status","isAuthoritativelyAbsent","isActionable"],"sources":["../../../../src/domains/anzuUser/utils/userSystemState.ts"],"sourcesContent":["/**\n * Four independent axes, one derived state.\n * Collapsing them early conflated \"no access\" with \"no account\" and offered Create in unreadable systems.\n */\nexport const UserSystemLoad = {\n Idle: 'idle',\n Loading: 'loading',\n Loaded: 'loaded',\n Error: 'error',\n} as const\nexport type UserSystemLoadType = (typeof UserSystemLoad)[keyof typeof UserSystemLoad]\n\nexport const UserSystemPresence = {\n Present: 'present',\n Absent: 'absent',\n Unknown: 'unknown',\n} as const\nexport type UserSystemPresenceType = (typeof UserSystemPresence)[keyof typeof UserSystemPresence]\n\nexport const UserSystemAccess = {\n Ok: 'ok',\n Forbidden: 'forbidden',\n Unauthenticated: 'unauthenticated',\n Unavailable: 'unavailable',\n ConfigDisabled: 'configDisabled',\n} as const\nexport type UserSystemAccessType = (typeof UserSystemAccess)[keyof typeof UserSystemAccess]\n\n/**\n * `enabled` is an axis so \"here and on\" and \"here and off\" can be told apart.\n * Ownership is not an axis; the descriptor's `manage` decides the button.\n */\nexport interface UserSystemAxes {\n load: UserSystemLoadType\n presence: UserSystemPresenceType\n access: UserSystemAccessType\n enabled: boolean | 'unknown'\n}\n\nexport const UserSystemState = {\n /** Nothing has been asked yet, or the answer is still on its way. */\n Loading: 'loading',\n Enabled: 'enabled',\n Disabled: 'disabled',\n Absent: 'absent',\n Forbidden: 'forbidden',\n Unavailable: 'unavailable',\n ConfigDisabled: 'configDisabled',\n} as const\nexport type UserSystemStateType = (typeof UserSystemState)[keyof typeof UserSystemState]\n\nexport const emptyUserSystemAxes = (): UserSystemAxes => ({\n load: UserSystemLoad.Idle,\n presence: UserSystemPresence.Unknown,\n access: UserSystemAccess.Ok,\n enabled: 'unknown',\n})\n\n/**\n * Order matters. Config-disabled wins over everything.\n * Access is checked before presence because a forbidden record is not an absent one.\n */\nexport const resolveUserSystemState = (axes: UserSystemAxes): UserSystemStateType => {\n if (axes.access === UserSystemAccess.ConfigDisabled) return UserSystemState.ConfigDisabled\n if (axes.access === UserSystemAccess.Forbidden) return UserSystemState.Forbidden\n if (axes.access === UserSystemAccess.Unauthenticated || axes.access === UserSystemAccess.Unavailable) {\n return UserSystemState.Unavailable\n }\n if (axes.load === UserSystemLoad.Idle || axes.load === UserSystemLoad.Loading) return UserSystemState.Loading\n if (axes.presence === UserSystemPresence.Absent) return UserSystemState.Absent\n if (axes.presence === UserSystemPresence.Unknown) return UserSystemState.Unavailable\n return axes.enabled === true ? UserSystemState.Enabled : UserSystemState.Disabled\n}\n\n/**\n * 401 is its own case: an expired session must not show as \"no account here\" (decision 16).\n * The caller retries through its refresh hook first; this receives the verdict.\n * 422 has no case: a detail GET does not validate. A 422 belongs to the write log.\n */\nexport const classifyProbeStatus = (status: number | null): Pick<UserSystemAxes, 'presence' | 'access'> => {\n if (status === null) {\n // A timeout, a network failure, or anything that never reached a status.\n return { presence: UserSystemPresence.Unknown, access: UserSystemAccess.Unavailable }\n }\n if (status === 404) return { presence: UserSystemPresence.Absent, access: UserSystemAccess.Ok }\n if (status === 403) return { presence: UserSystemPresence.Unknown, access: UserSystemAccess.Forbidden }\n if (status === 401) return { presence: UserSystemPresence.Unknown, access: UserSystemAccess.Unauthenticated }\n if (status >= 500) return { presence: UserSystemPresence.Unknown, access: UserSystemAccess.Unavailable }\n if (status >= 200 && status < 300) return { presence: UserSystemPresence.Present, access: UserSystemAccess.Ok }\n return { presence: UserSystemPresence.Unknown, access: UserSystemAccess.Unavailable }\n}\n\n/**\n * Whether every relevant system answered authoritatively that the account does not exist.\n * Account creation is offered only then. An unreadable record is not a missing one, and\n * an AnzuUser cannot be deleted, so a duplicate created on a guess cannot be undone.\n */\nexport const isAuthoritativelyAbsent = (axes: UserSystemAxes): boolean =>\n axes.load === UserSystemLoad.Loaded &&\n axes.presence === UserSystemPresence.Absent &&\n axes.access === UserSystemAccess.Ok\n\n/** A system a bulk action may act on: it answered, the account is there, and access was granted. */\nexport const isActionable = (axes: UserSystemAxes): boolean =>\n axes.load === UserSystemLoad.Loaded &&\n axes.presence === UserSystemPresence.Present &&\n axes.access === UserSystemAccess.Ok\n"],"mappings":";AAIA,IAAaA,IAAiB;CAC5B,MAAM;CACN,SAAS;CACT,QAAQ;CACR,OAAO;AACT,GAGaC,IAAqB;CAChC,SAAS;CACT,QAAQ;CACR,SAAS;AACX,GAGaC,IAAmB;CAC9B,IAAI;CACJ,WAAW;CACX,iBAAiB;CACjB,aAAa;CACb,gBAAgB;AAClB,GAcaC,IAAkB;CAE7B,SAAS;CACT,SAAS;CACT,UAAU;CACV,QAAQ;CACR,WAAW;CACX,aAAa;CACb,gBAAgB;AAClB,GAGaC,WAA6C;CACxD,MAAMJ,EAAe;CACrB,UAAUC,EAAmB;CAC7B,QAAQC,EAAiB;CACzB,SAAS;AACX,IAMaG,KAA0B,MACjCC,EAAK,WAAWJ,EAAiB,iBAAuBC,EAAgB,iBACxEG,EAAK,WAAWJ,EAAiB,YAAkBC,EAAgB,YACnEG,EAAK,WAAWJ,EAAiB,mBAAmBI,EAAK,WAAWJ,EAAiB,cAChFC,EAAgB,cAErBG,EAAK,SAASN,EAAe,QAAQM,EAAK,SAASN,EAAe,UAAgBG,EAAgB,UAClGG,EAAK,aAAaL,EAAmB,SAAeE,EAAgB,SACpEG,EAAK,aAAaL,EAAmB,UAAgBE,EAAgB,cAClEG,EAAK,YAAY,KAAOH,EAAgB,UAAUA,EAAgB,UAQ9DI,KAAuB,MAC9BC,MAAW,OAEN;CAAE,UAAUP,EAAmB;CAAS,QAAQC,EAAiB;AAAY,IAElFM,MAAW,MAAY;CAAE,UAAUP,EAAmB;CAAQ,QAAQC,EAAiB;AAAG,IAC1FM,MAAW,MAAY;CAAE,UAAUP,EAAmB;CAAS,QAAQC,EAAiB;AAAU,IAClGM,MAAW,MAAY;CAAE,UAAUP,EAAmB;CAAS,QAAQC,EAAiB;AAAgB,IACxGM,KAAU,MAAY;CAAE,UAAUP,EAAmB;CAAS,QAAQC,EAAiB;AAAY,IACnGM,KAAU,OAAOA,IAAS,MAAY;CAAE,UAAUP,EAAmB;CAAS,QAAQC,EAAiB;AAAG,IACvG;CAAE,UAAUD,EAAmB;CAAS,QAAQC,EAAiB;AAAY,GAQzEO,KAA2B,MACtCH,EAAK,SAASN,EAAe,UAC7BM,EAAK,aAAaL,EAAmB,UACrCK,EAAK,WAAWJ,EAAiB,IAGtBQ,KAAgB,MAC3BJ,EAAK,SAASN,EAAe,UAC7BM,EAAK,aAAaL,EAAmB,WACrCK,EAAK,WAAWJ,EAAiB"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The one tab that is not a system.
|
|
3
|
-
*
|
|
4
|
-
* A module of its own because `<script setup>` cannot export, and both the shell and the pages that
|
|
5
|
-
* read `?tab=` need to name it.
|
|
3
|
+
* Its own module because `<script setup>` cannot export, and both the shell and the pages reading `?tab=` need it.
|
|
6
4
|
*/
|
|
7
5
|
export declare const OTHER_SYSTEMS_TAB = "__otherSystems";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userTabs.js","names":["OTHER_SYSTEMS_TAB"],"sources":["../../../../src/domains/anzuUser/utils/userTabs.ts"],"sourcesContent":["/**\n * The one tab that is not a system.\n
|
|
1
|
+
{"version":3,"file":"userTabs.js","names":["OTHER_SYSTEMS_TAB"],"sources":["../../../../src/domains/anzuUser/utils/userTabs.ts"],"sourcesContent":["/**\n * The one tab that is not a system.\n * Its own module because `<script setup>` cannot export, and both the shell and the pages reading `?tab=` need it.\n */\nexport const OTHER_SYSTEMS_TAB = '__otherSystems'\n"],"mappings":";AAIA,IAAaA,IAAoB"}
|
|
@@ -17,14 +17,10 @@ export interface ApiClientSetup {
|
|
|
17
17
|
response?: ApiClientResponseInterceptor[];
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* `setup` runs on that first call, not when the module loads, as the guards did: an admin's env config
|
|
25
|
-
* is empty until it has loaded, and a client's interceptors come from modules in an import cycle with
|
|
26
|
-
* it (the refresh interceptor calls the auth api, which goes through the client), so at load time they
|
|
27
|
-
* may not be initialized yet.
|
|
20
|
+
* Returns a lazily created singleton axios client whose interceptors are registered once.
|
|
21
|
+
* Registering outside the guard stacks a copy of every interceptor per call.
|
|
22
|
+
* `setup` runs on the first call, not at module load. Env config is empty until loaded, and interceptors come from
|
|
23
|
+
* modules in an import cycle with the client (refresh calls the auth api), so they may not be initialized at load time.
|
|
28
24
|
*/
|
|
29
25
|
export declare function defineApiClient(setup: () => ApiClientSetup): () => AxiosInstance;
|
|
30
26
|
/** A `runWhen` that leaves out requests to urls starting with one of `prefixes` (the auth endpoints). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineApiClient.js","names":["axios","defineApiClient","instance","isNull","setup","created","config","request","onFulfilled","onRejected","options","response","skipUrlPrefixes","prefixes","prefix"],"sources":["../../../../src/domains/api/composables/defineApiClient.ts"],"sourcesContent":["import axios, {\n type AxiosInstance,\n type AxiosInterceptorManager,\n type AxiosRequestConfig,\n type AxiosResponse,\n type CreateAxiosDefaults,\n type InternalAxiosRequestConfig,\n} from 'axios'\nimport { isNull } from '@/shared/utils/common'\n\n// axios's own handler types, which it does not export.\ntype RequestUse = Parameters<AxiosInterceptorManager<InternalAxiosRequestConfig>['use']>\ntype ResponseUse = Parameters<AxiosInterceptorManager<AxiosResponse>['use']>\n\nexport interface ApiClientRequestInterceptor {\n onFulfilled?: RequestUse[0]\n onRejected?: RequestUse[1]\n options?: RequestUse[2]\n}\n\nexport interface ApiClientResponseInterceptor {\n onFulfilled?: ResponseUse[0]\n onRejected?: ResponseUse[1]\n}\n\nexport interface ApiClientSetup {\n /** The instance's defaults; nothing is added to them. */\n config: CreateAxiosDefaults\n request?: ApiClientRequestInterceptor[]\n response?: ApiClientResponseInterceptor[]\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"defineApiClient.js","names":["axios","defineApiClient","instance","isNull","setup","created","config","request","onFulfilled","onRejected","options","response","skipUrlPrefixes","prefixes","prefix"],"sources":["../../../../src/domains/api/composables/defineApiClient.ts"],"sourcesContent":["import axios, {\n type AxiosInstance,\n type AxiosInterceptorManager,\n type AxiosRequestConfig,\n type AxiosResponse,\n type CreateAxiosDefaults,\n type InternalAxiosRequestConfig,\n} from 'axios'\nimport { isNull } from '@/shared/utils/common'\n\n// axios's own handler types, which it does not export.\ntype RequestUse = Parameters<AxiosInterceptorManager<InternalAxiosRequestConfig>['use']>\ntype ResponseUse = Parameters<AxiosInterceptorManager<AxiosResponse>['use']>\n\nexport interface ApiClientRequestInterceptor {\n onFulfilled?: RequestUse[0]\n onRejected?: RequestUse[1]\n options?: RequestUse[2]\n}\n\nexport interface ApiClientResponseInterceptor {\n onFulfilled?: ResponseUse[0]\n onRejected?: ResponseUse[1]\n}\n\nexport interface ApiClientSetup {\n /** The instance's defaults; nothing is added to them. */\n config: CreateAxiosDefaults\n request?: ApiClientRequestInterceptor[]\n response?: ApiClientResponseInterceptor[]\n}\n\n/**\n * Returns a lazily created singleton axios client whose interceptors are registered once.\n * Registering outside the guard stacks a copy of every interceptor per call.\n * `setup` runs on the first call, not at module load. Env config is empty until loaded, and interceptors come from\n * modules in an import cycle with the client (refresh calls the auth api), so they may not be initialized at load time.\n */\nexport function defineApiClient(setup: () => ApiClientSetup): () => AxiosInstance {\n let instance: AxiosInstance | null = null\n return () => {\n if (isNull(instance)) {\n const { config, request = [], response = [] } = setup()\n const created = axios.create(config)\n for (const { onFulfilled, onRejected, options } of request) {\n created.interceptors.request.use(onFulfilled, onRejected, options)\n }\n for (const { onFulfilled, onRejected } of response) {\n created.interceptors.response.use(onFulfilled, onRejected)\n }\n instance = created\n }\n return instance\n }\n}\n\n/** A `runWhen` that leaves out requests to urls starting with one of `prefixes` (the auth endpoints). */\nexport const skipUrlPrefixes =\n (...prefixes: string[]) =>\n (config: AxiosRequestConfig): boolean =>\n !prefixes.some((prefix) => config.url?.startsWith(prefix) ?? false)\n"],"mappings":";;;AAsCA,SAAgBC,EAAgB,GAAkD;CAChF,IAAIC,IAAiC;CACrC,aAAa;EACX,IAAIC,EAAOD,CAAQ,GAAG;GACpB,IAAM,EAAE,WAAQ,aAAU,CAAC,GAAG,cAAW,CAAC,MAAME,EAAM,GAChDC,IAAUL,EAAM,OAAOM,CAAM;GACnC,KAAK,IAAM,EAAE,gBAAa,eAAY,gBAAaC,GACjD,EAAQ,aAAa,QAAQ,IAAIC,GAAaC,GAAYC,CAAO;GAEnE,KAAK,IAAM,EAAE,gBAAa,mBAAgBC,GACxC,EAAQ,aAAa,SAAS,IAAIH,GAAaC,CAAU;GAE3D,IAAWJ;EACb;EACA,OAAOH;CACT;AACF;AAGA,IAAaU,KACV,GAAGC,OACH,MACC,CAACA,EAAS,MAAM,MAAWP,EAAO,KAAK,WAAWQ,CAAM,KAAK,EAAK"}
|
|
@@ -2,60 +2,31 @@ import { AxiosClientFn } from '../utils/client';
|
|
|
2
2
|
import { AxiosRequestConfig } from 'axios';
|
|
3
3
|
import { Ref } from 'vue';
|
|
4
4
|
/**
|
|
5
|
-
* Whether the response carries a body
|
|
6
|
-
*
|
|
7
|
-
* `''`
|
|
8
|
-
*
|
|
9
|
-
* truthy, so a 204 and a body-less 200 both arrive as `''`. `0` and `false` do parse and are real
|
|
10
|
-
* values -- reading them as absent is the bug this replaces.
|
|
11
|
-
*
|
|
12
|
-
* `null` is treated as absent too. It is distinguishable from `''` at runtime, but nothing can carry
|
|
13
|
-
* it in the type: the response type excludes `null` so that a command site cannot declare itself as
|
|
14
|
-
* returning one.
|
|
5
|
+
* Whether the response carries a body.
|
|
6
|
+
* axios returns `''` when no bytes arrived, so a 204 and a body-less 200
|
|
7
|
+
* both arrive as `''`. `0` and `false` are real values and count as a body.
|
|
8
|
+
* `null` is treated as absent too, because the response type excludes `null`.
|
|
15
9
|
*/
|
|
16
10
|
export declare const hasBody: (res: {
|
|
17
11
|
data: unknown;
|
|
18
12
|
}) => boolean;
|
|
19
13
|
/**
|
|
20
|
-
* Strips
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* survived the spread whenever no body was passed, so a caller could put a body on a GET through
|
|
24
|
-
* the back door and skip the serialisation with it.
|
|
14
|
+
* Strips the helper-owned keys from the caller's `options` at runtime.
|
|
15
|
+
* The type forbids them, but without this `data` survived the
|
|
16
|
+
* spread when no body was passed, which allowed a body on a GET.
|
|
25
17
|
*/
|
|
26
18
|
declare const HELPER_OWNED: readonly ["method", "url", "data", "signal"];
|
|
27
19
|
export declare const ownedByHelper: <T extends object>(options: T) => Omit<T, (typeof HELPER_OWNED)[number]>;
|
|
28
20
|
/**
|
|
29
|
-
* The url as axios
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* `undefined` in, `undefined` out: a call that failed before it had a url has none to report, and
|
|
39
|
-
* asking axios for one would answer with the client's root -- a url that was never requested and
|
|
40
|
-
* that reads like an endpoint. An empty string is different: that is a call whose url really is the
|
|
41
|
-
* client root, and it gets rendered.
|
|
42
|
-
*
|
|
43
|
-
* Rendered from the config axios actually used whenever there is one: the one it keeps on its own
|
|
44
|
-
* error, or the one it keeps on the response it did return, which covers the failures the helper
|
|
45
|
-
* raises itself after reading that response. Both are the request as it went out -- merged, and past
|
|
46
|
-
* any request interceptor that rewrote the url or the params -- while anything rebuilt here is a
|
|
47
|
-
* reconstruction, and by the time a failure is described the factory may hand back a different
|
|
48
|
-
* instance or its defaults may have moved on.
|
|
49
|
-
*
|
|
50
|
-
* A config that axios kept is rendered through an instance with no defaults of its own, for that
|
|
51
|
-
* same reason: `getUri` merges the instance's defaults *under* the config it is given, so rendering
|
|
52
|
-
* it through the caller's client would let a default added since the request appear in a url that
|
|
53
|
-
* never carried it. The rebuild is the one case that does want those defaults -- there is no record
|
|
54
|
-
* of the request to read them from -- so it goes through the client.
|
|
55
|
-
*
|
|
56
|
-
* Never throws. It runs on every failure path, inside the catch, so an exception here would replace
|
|
57
|
-
* the error the caller is waiting for with one about building a diagnostic string -- and a client
|
|
58
|
-
* without `getUri` (a hand-built stub, a mock) must not turn a mapped failure into a `TypeError`.
|
|
21
|
+
* The url as axios actually requests it, rendered by axios itself. An approximation
|
|
22
|
+
* renders arrays, nested objects and dates differently from the wire.
|
|
23
|
+
* `undefined` in gives `undefined` out. A call that failed before it had a url has none, and
|
|
24
|
+
* axios would answer with the client root. An empty string is a real root url and is rendered.
|
|
25
|
+
* Prefers the config axios kept on the error or response, since it reflects merging and
|
|
26
|
+
* interceptor rewrites. It is rendered through a defaults-free instance, because `getUri`
|
|
27
|
+
* merges instance defaults under the config. Only the rebuild goes through the client.
|
|
28
|
+
* Never throws. It runs inside the catch, and a client without `getUri` (a
|
|
29
|
+
* stub or mock) must not replace the original error with a `TypeError`.
|
|
59
30
|
*/
|
|
60
31
|
export declare const requestedUrl: (client: AxiosClientFn, url: string | undefined, options?: AxiosRequestConfig, failure?: unknown, dispatched?: AxiosRequestConfig) => string | undefined;
|
|
61
32
|
export type Abortable = {
|
|
@@ -65,13 +36,12 @@ export type Abortable = {
|
|
|
65
36
|
abort: () => void;
|
|
66
37
|
/** The generation a call starts in; a stale one must not write to state the caller can see. */
|
|
67
38
|
generation: () => number;
|
|
68
|
-
/** Whether this instance has anything in flight. */
|
|
69
39
|
loading: Ref<boolean>;
|
|
70
40
|
};
|
|
71
41
|
export type AbortableOptions = {
|
|
72
42
|
/**
|
|
73
|
-
* Each call supersedes the one
|
|
74
|
-
*
|
|
43
|
+
* Each call supersedes the previous one. The abort happens before the new
|
|
44
|
+
* call registers, so the latest call always wins regardless of interleaving.
|
|
75
45
|
*/
|
|
76
46
|
cancelPrevious?: boolean;
|
|
77
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","names":["axios","hasBody","isUndefined","res","isNull","HELPER_OWNED","ownedByHelper","rest","options","key","rendererInstance","renderer","requestedUrl","url","sent","failure","dispatched","built","client","isString","createAbortable","controllers","generation","loading","ref","syncLoading","abortAll","controller","cancelPrevious","relay","external","fn","err"],"sources":["../../../../src/domains/api/composables/request.ts"],"sourcesContent":["import type { AxiosClientFn } from '@/domains/api/utils/client'\nimport axios, { type AxiosInstance, type AxiosRequestConfig } from 'axios'\nimport { isNull, isString, isUndefined } from '@/shared/utils/common'\nimport { ref, type Ref } from 'vue'\n\n/**\n * Whether the response carries a body at all.\n *\n * `''` is not an empty document, it is what axios hands back when no bytes arrived: its adapter\n * returns `responseText`, and `transformResponse` only attempts `JSON.parse` when the string is\n * truthy, so a 204 and a body-less 200 both arrive as `''`. `0` and `false` do parse and are real\n * values -- reading them as absent is the bug this replaces.\n *\n * `null` is treated as absent too. It is distinguishable from `''` at runtime, but nothing can carry\n * it in the type: the response type excludes `null` so that a command site cannot declare itself as\n * returning one.\n */\nexport const hasBody = (res: { data: unknown }): boolean =>\n !isUndefined(res.data) && !isNull(res.data) && res.data !== ''\n\n/**\n * Strips what the helper decides from whatever the caller passed as `options`.\n *\n * The type says these cannot be set, but a type says nothing at runtime: `data` in particular\n * survived the spread whenever no body was passed, so a caller could put a body on a GET through\n * the back door and skip the serialisation with it.\n */\nconst HELPER_OWNED = ['method', 'url', 'data', 'signal'] as const\n\nexport const ownedByHelper = <T extends object>(options: T): Omit<T, (typeof HELPER_OWNED)[number]> => {\n const rest = { ...options } as Record<string, unknown>\n for (const key of HELPER_OWNED) delete rest[key]\n\n return rest as Omit<T, (typeof HELPER_OWNED)[number]>\n}\n\n/**\n * Renders a config axios kept, and nothing else. It has no `baseURL` and no `params` of its own, so\n * what comes out is what the config carries.\n *\n * Built on first use rather than at module load: importing this library should not create an axios\n * instance. A consumer that mocks axios and counts `create` calls would otherwise see one it never\n * made -- which is exactly how this was found, in a fleet test asserting that its own client is\n * built once.\n */\nlet rendererInstance: AxiosInstance | undefined\nconst renderer = (): AxiosInstance => (rendererInstance ??= axios.create())\n\n/**\n * The url as axios will actually request it: the client's `baseURL` and default `params`, the\n * request's own `params`, and whatever `paramsSerializer` renders them.\n *\n * Built by axios itself rather than approximated: a url recorded before the call is not the one\n * that went out, and an approximation renders arrays, nested objects and dates differently from the\n * wire -- which is worse than no url, because it looks findable and is not. It is handed the same\n * config the request was given, minus what this helper owns, for the same reason: a call carrying\n * its own `paramsSerializer` or `baseURL` is asking for a url that the defaults do not produce.\n *\n * `undefined` in, `undefined` out: a call that failed before it had a url has none to report, and\n * asking axios for one would answer with the client's root -- a url that was never requested and\n * that reads like an endpoint. An empty string is different: that is a call whose url really is the\n * client root, and it gets rendered.\n *\n * Rendered from the config axios actually used whenever there is one: the one it keeps on its own\n * error, or the one it keeps on the response it did return, which covers the failures the helper\n * raises itself after reading that response. Both are the request as it went out -- merged, and past\n * any request interceptor that rewrote the url or the params -- while anything rebuilt here is a\n * reconstruction, and by the time a failure is described the factory may hand back a different\n * instance or its defaults may have moved on.\n *\n * A config that axios kept is rendered through an instance with no defaults of its own, for that\n * same reason: `getUri` merges the instance's defaults *under* the config it is given, so rendering\n * it through the caller's client would let a default added since the request appear in a url that\n * never carried it. The rebuild is the one case that does want those defaults -- there is no record\n * of the request to read them from -- so it goes through the client.\n *\n * Never throws. It runs on every failure path, inside the catch, so an exception here would replace\n * the error the caller is waiting for with one about building a diagnostic string -- and a client\n * without `getUri` (a hand-built stub, a mock) must not turn a mapped failure into a `TypeError`.\n */\nexport const requestedUrl = (\n client: AxiosClientFn,\n url: string | undefined,\n options: AxiosRequestConfig = {},\n failure?: unknown,\n dispatched?: AxiosRequestConfig\n): string | undefined => {\n if (isUndefined(url)) return undefined\n\n try {\n const sent = (axios.isAxiosError(failure) ? failure.config : undefined) ?? dispatched\n const built: unknown = isUndefined(sent)\n ? client().getUri({ ...ownedByHelper(options), url })\n : renderer().getUri(sent)\n\n // A stub can answer with anything. The declared type says string, so it has to be one.\n return isString(built) ? built : url\n } catch {\n return url\n }\n}\n\nexport type Abortable = {\n /** Runs one call with a signal of its own, registered so `abort()` can reach it. */\n run: <T>(fn: (signal: AbortSignal, generation: number) => Promise<T>, external?: AbortSignal) => Promise<T>\n /** Stops every call this instance still has in flight. */\n abort: () => void\n /** The generation a call starts in; a stale one must not write to state the caller can see. */\n generation: () => number\n /** Whether this instance has anything in flight. */\n loading: Ref<boolean>\n}\n\nexport type AbortableOptions = {\n /**\n * Each call supersedes the one before it. The abort happens before the new call registers, so\n * \"the latest wins\" holds by construction rather than by how the two calls happen to interleave.\n */\n cancelPrevious?: boolean\n}\n\nexport const createAbortable = (options: AbortableOptions = {}): Abortable => {\n const { cancelPrevious = false } = options\n const controllers = new Set<AbortController>()\n let generation = 0\n\n /**\n * True while this instance has a request in flight.\n *\n * It is derived from the set rather than counted, which is what makes it safe to turn\n * `cancelPrevious` on. The pattern everywhere in the fleet is a `loading` ref the caller clears in\n * a `finally`, and under `cancelPrevious` that `finally` belongs to the call that was just\n * superseded -- so the spinner goes out while the call the user is waiting for is still running.\n * Here the superseded call's controller leaves the set at the same moment the new one joins it, so\n * the value never dips between the two.\n */\n const loading = ref(false)\n const syncLoading = () => {\n loading.value = controllers.size > 0\n }\n\n const abortAll = () => {\n controllers.forEach((controller) => controller.abort())\n controllers.clear()\n }\n\n const run = async <T>(\n fn: (signal: AbortSignal, generation: number) => Promise<T>,\n external?: AbortSignal\n ): Promise<T> => {\n // Before the new controller is registered, or the abort would take the new call with it.\n if (cancelPrevious) abortAll()\n\n generation += 1\n const controller = new AbortController()\n controllers.add(controller)\n syncLoading()\n\n // The external signal is relayed rather than passed through: `abort()` has to keep working, and\n // it can only reach a controller this set owns.\n const relay = () => controller.abort()\n if (external) {\n if (external.aborted) controller.abort()\n else external.addEventListener('abort', relay, { once: true })\n }\n\n try {\n return await fn(controller.signal, generation)\n } catch (err: unknown) {\n // A call can have more than one request under its signal -- the batch sends a page set at\n // once -- and when one of them fails the rest are work nobody is waiting for any more. Stop\n // them here, while the controller is still reachable: the `finally` below drops it from the\n // set, and after that a later `abort()` has nothing to abort them with.\n controller.abort()\n throw err\n } finally {\n external?.removeEventListener('abort', relay)\n controllers.delete(controller)\n syncLoading()\n }\n }\n\n return {\n run,\n abort: () => {\n // Bumped so a call already on its way back cannot write to the caller's state afterwards.\n generation += 1\n abortAll()\n syncLoading()\n },\n generation: () => generation,\n loading,\n }\n}\n"],"mappings":";;;;AAiBA,IAAaC,KAAW,MACtB,CAACC,EAAYC,EAAI,IAAI,KAAK,CAACC,EAAOD,EAAI,IAAI,KAAKA,EAAI,SAAS,IASxDE,IAAe;CAAC;CAAU;CAAO;CAAQ;AAAQ,GAE1CC,KAAmC,MAAuD;CACrG,IAAMC,IAAO,EAAE,GAAGC,EAAQ;CAC1B,KAAK,IAAMC,KAAOJ,GAAc,OAAOE,EAAKE;CAE5C,OAAOF;AACT,GAWIG,GACEC,UAAiC,MAAqBX,EAAM,OAAO,GAkC5DY,KACX,GACA,GACA,IAA8B,CAAC,GAC/B,GACA,MACuB;CACvB,IAAI,GAAYC,CAAG,GAEnB,IAAI;EACF,IAAMC,KAAQd,EAAM,aAAae,CAAO,IAAIA,EAAQ,SAAS,KAAA,MAAcC,GACrEC,IAAiBf,EAAYY,CAAI,IACnCI,EAAO,CAAC,CAAC,OAAO;GAAE,GAAGZ,EAAcE,CAAO;GAAG;EAAI,CAAC,IAClDG,EAAS,CAAC,CAAC,OAAOG,CAAI;EAG1B,OAAOK,EAASF,CAAK,IAAIA,IAAQJ;CACnC,QAAQ;EACN,OAAOA;CACT;AACF,GAqBaO,KAAmB,IAA4B,CAAC,MAAiB;CAC5E,IAAM,EAAE,oBAAiB,OAAUZ,GAC7Ba,oBAAc,IAAI,IAAqB,GACzCC,IAAa,GAYXC,IAAUC,EAAI,EAAK,GACnBC,UAAoB;EACxB,EAAQ,QAAQJ,EAAY,OAAO;CACrC,GAEMK,UAAiB;EAErB,AADAL,EAAY,SAAS,MAAeM,EAAW,MAAM,CAAC,GACtDN,EAAY,MAAM;CACpB;CAsCA,OAAO;EACL,YApCA,GACA,MACe;GAIf,AAFIO,KAAgBF,EAAS,GAE7B,KAAc;GACd,IAAMC,IAAa,IAAI,gBAAgB;GAEvC,AADAN,EAAY,IAAIM,CAAU,GAC1BF,EAAY;GAIZ,IAAMI,UAAcF,EAAW,MAAM;GACrC,AAAIG,MACEA,EAAS,UAASH,EAAW,MAAM,IAClCG,EAAS,iBAAiB,SAASD,GAAO,EAAE,MAAM,GAAK,CAAC;GAG/D,IAAI;IACF,OAAO,MAAME,EAAGJ,EAAW,QAAQL,CAAU;GAC/C,SAASU,GAAc;IAMrB,MADAL,EAAW,MAAM,GACXK;GACR,UAAU;IAGR,AAFAF,GAAU,oBAAoB,SAASD,CAAK,GAC5CR,EAAY,OAAOM,CAAU,GAC7BF,EAAY;GACd;EACF;EAIE,aAAa;GAIX,AAFA,KAAc,GACdC,EAAS,GACTD,EAAY;EACd;EACA,kBAAkBH;EAClB;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"request.js","names":["axios","hasBody","isUndefined","res","isNull","HELPER_OWNED","ownedByHelper","rest","options","key","rendererInstance","renderer","requestedUrl","url","sent","failure","dispatched","built","client","isString","createAbortable","controllers","generation","loading","ref","syncLoading","abortAll","controller","cancelPrevious","relay","external","fn","err"],"sources":["../../../../src/domains/api/composables/request.ts"],"sourcesContent":["import type { AxiosClientFn } from '@/domains/api/utils/client'\nimport axios, { type AxiosInstance, type AxiosRequestConfig } from 'axios'\nimport { isNull, isString, isUndefined } from '@/shared/utils/common'\nimport { ref, type Ref } from 'vue'\n\n/**\n * Whether the response carries a body.\n * axios returns `''` when no bytes arrived, so a 204 and a body-less 200\n * both arrive as `''`. `0` and `false` are real values and count as a body.\n * `null` is treated as absent too, because the response type excludes `null`.\n */\nexport const hasBody = (res: { data: unknown }): boolean =>\n !isUndefined(res.data) && !isNull(res.data) && res.data !== ''\n\n/**\n * Strips the helper-owned keys from the caller's `options` at runtime.\n * The type forbids them, but without this `data` survived the\n * spread when no body was passed, which allowed a body on a GET.\n */\nconst HELPER_OWNED = ['method', 'url', 'data', 'signal'] as const\n\nexport const ownedByHelper = <T extends object>(options: T): Omit<T, (typeof HELPER_OWNED)[number]> => {\n const rest = { ...options } as Record<string, unknown>\n for (const key of HELPER_OWNED) delete rest[key]\n\n return rest as Omit<T, (typeof HELPER_OWNED)[number]>\n}\n\n/**\n * Renders a config axios kept. It has no `baseURL` or `params`\n * of its own, so the output is only what the config carries.\n * Created lazily so importing the library does not create an axios instance.\n * Consumers that mock axios and count `create` calls would see an extra one.\n */\nlet rendererInstance: AxiosInstance | undefined\nconst renderer = (): AxiosInstance => (rendererInstance ??= axios.create())\n\n/**\n * The url as axios actually requests it, rendered by axios itself. An approximation\n * renders arrays, nested objects and dates differently from the wire.\n * `undefined` in gives `undefined` out. A call that failed before it had a url has none, and\n * axios would answer with the client root. An empty string is a real root url and is rendered.\n * Prefers the config axios kept on the error or response, since it reflects merging and\n * interceptor rewrites. It is rendered through a defaults-free instance, because `getUri`\n * merges instance defaults under the config. Only the rebuild goes through the client.\n * Never throws. It runs inside the catch, and a client without `getUri` (a\n * stub or mock) must not replace the original error with a `TypeError`.\n */\nexport const requestedUrl = (\n client: AxiosClientFn,\n url: string | undefined,\n options: AxiosRequestConfig = {},\n failure?: unknown,\n dispatched?: AxiosRequestConfig\n): string | undefined => {\n if (isUndefined(url)) return undefined\n\n try {\n const sent = (axios.isAxiosError(failure) ? failure.config : undefined) ?? dispatched\n const built: unknown = isUndefined(sent)\n ? client().getUri({ ...ownedByHelper(options), url })\n : renderer().getUri(sent)\n\n // A stub can answer with anything. The declared type says string, so it has to be one.\n return isString(built) ? built : url\n } catch {\n return url\n }\n}\n\nexport type Abortable = {\n /** Runs one call with a signal of its own, registered so `abort()` can reach it. */\n run: <T>(fn: (signal: AbortSignal, generation: number) => Promise<T>, external?: AbortSignal) => Promise<T>\n /** Stops every call this instance still has in flight. */\n abort: () => void\n /** The generation a call starts in; a stale one must not write to state the caller can see. */\n generation: () => number\n loading: Ref<boolean>\n}\n\nexport type AbortableOptions = {\n /**\n * Each call supersedes the previous one. The abort happens before the new\n * call registers, so the latest call always wins regardless of interleaving.\n */\n cancelPrevious?: boolean\n}\n\nexport const createAbortable = (options: AbortableOptions = {}): Abortable => {\n const { cancelPrevious = false } = options\n const controllers = new Set<AbortController>()\n let generation = 0\n\n /**\n * Derived from the in-flight set, not counted, so it is safe with `cancelPrevious`.\n * A caller-cleared `finally` flag would turn off when the superseded call ends. Here\n * the old controller leaves the set as the new one joins, so the value never dips.\n */\n const loading = ref(false)\n const syncLoading = () => {\n loading.value = controllers.size > 0\n }\n\n const abortAll = () => {\n controllers.forEach((controller) => controller.abort())\n controllers.clear()\n }\n\n const run = async <T>(\n fn: (signal: AbortSignal, generation: number) => Promise<T>,\n external?: AbortSignal\n ): Promise<T> => {\n // Before the new controller is registered, or the abort would take the new call with it.\n if (cancelPrevious) abortAll()\n\n generation += 1\n const controller = new AbortController()\n controllers.add(controller)\n syncLoading()\n\n // The external signal is relayed, not passed through, because `abort()` can only reach controllers this set owns.\n const relay = () => controller.abort()\n if (external) {\n if (external.aborted) controller.abort()\n else external.addEventListener('abort', relay, { once: true })\n }\n\n try {\n return await fn(controller.signal, generation)\n } catch (err: unknown) {\n // One call can have several requests under its signal (the batch\n // sends a page set at once). When one fails, abort the rest now.\n // The `finally` below drops the controller from the set, so a later `abort()` could no longer reach them.\n controller.abort()\n throw err\n } finally {\n external?.removeEventListener('abort', relay)\n controllers.delete(controller)\n syncLoading()\n }\n }\n\n return {\n run,\n abort: () => {\n // Bumped so a call already on its way back cannot write to the caller's state afterwards.\n generation += 1\n abortAll()\n syncLoading()\n },\n generation: () => generation,\n loading,\n }\n}\n"],"mappings":";;;;AAWA,IAAaC,KAAW,MACtB,CAACC,EAAYC,EAAI,IAAI,KAAK,CAACC,EAAOD,EAAI,IAAI,KAAKA,EAAI,SAAS,IAOxDE,IAAe;CAAC;CAAU;CAAO;CAAQ;AAAQ,GAE1CC,KAAmC,MAAuD;CACrG,IAAMC,IAAO,EAAE,GAAGC,EAAQ;CAC1B,KAAK,IAAMC,KAAOJ,GAAc,OAAOE,EAAKE;CAE5C,OAAOF;AACT,GAQIG,GACEC,UAAiC,MAAqBX,EAAM,OAAO,GAa5DY,KACX,GACA,GACA,IAA8B,CAAC,GAC/B,GACA,MACuB;CACvB,IAAI,GAAYC,CAAG,GAEnB,IAAI;EACF,IAAMC,KAAQd,EAAM,aAAae,CAAO,IAAIA,EAAQ,SAAS,KAAA,MAAcC,GACrEC,IAAiBf,EAAYY,CAAI,IACnCI,EAAO,CAAC,CAAC,OAAO;GAAE,GAAGZ,EAAcE,CAAO;GAAG;EAAI,CAAC,IAClDG,EAAS,CAAC,CAAC,OAAOG,CAAI;EAG1B,OAAOK,EAASF,CAAK,IAAIA,IAAQJ;CACnC,QAAQ;EACN,OAAOA;CACT;AACF,GAoBaO,KAAmB,IAA4B,CAAC,MAAiB;CAC5E,IAAM,EAAE,oBAAiB,OAAUZ,GAC7Ba,oBAAc,IAAI,IAAqB,GACzCC,IAAa,GAOXC,IAAUC,EAAI,EAAK,GACnBC,UAAoB;EACxB,EAAQ,QAAQJ,EAAY,OAAO;CACrC,GAEMK,UAAiB;EAErB,AADAL,EAAY,SAAS,MAAeM,EAAW,MAAM,CAAC,GACtDN,EAAY,MAAM;CACpB;CAoCA,OAAO;EACL,YAlCA,GACA,MACe;GAIf,AAFIO,KAAgBF,EAAS,GAE7B,KAAc;GACd,IAAMC,IAAa,IAAI,gBAAgB;GAEvC,AADAN,EAAY,IAAIM,CAAU,GAC1BF,EAAY;GAGZ,IAAMI,UAAcF,EAAW,MAAM;GACrC,AAAIG,MACEA,EAAS,UAASH,EAAW,MAAM,IAClCG,EAAS,iBAAiB,SAASD,GAAO,EAAE,MAAM,GAAK,CAAC;GAG/D,IAAI;IACF,OAAO,MAAME,EAAGJ,EAAW,QAAQL,CAAU;GAC/C,SAASU,GAAc;IAKrB,MADAL,EAAW,MAAM,GACXK;GACR,UAAU;IAGR,AAFAF,GAAU,oBAAoB,SAASD,CAAK,GAC5CR,EAAY,OAAOM,CAAU,GAC7BF,EAAY;GACd;EACF;EAIE,aAAa;GAIX,AAFA,KAAc,GACdC,EAAS,GACTD,EAAY;EACd;EACA,kBAAkBH;EAClB;CACF;AACF"}
|
|
@@ -12,7 +12,6 @@ export type UseApiFetchByIdsParams = {
|
|
|
12
12
|
validationEntity?: string;
|
|
13
13
|
urlTemplate?: string;
|
|
14
14
|
urlParams?: UrlParams;
|
|
15
|
-
/** Anything axios takes except what this helper decides: the method, the url, the body and the signal. */
|
|
16
15
|
options?: Omit<AxiosRequestConfig, 'method' | 'url' | 'data' | 'signal'>;
|
|
17
16
|
isSearchApi?: boolean;
|
|
18
17
|
field?: string;
|
|
@@ -25,8 +24,8 @@ export type FetchByIdsParams = {
|
|
|
25
24
|
signal?: AbortSignal;
|
|
26
25
|
};
|
|
27
26
|
/**
|
|
28
|
-
* Ids per request. A cache drains
|
|
29
|
-
*
|
|
27
|
+
* Ids per request. A cache drains all queued ids at once, and a thousand ids in
|
|
28
|
+
* a query string exceed the default 8 KB proxy request line limit, giving a 414.
|
|
30
29
|
*/
|
|
31
30
|
export declare const FETCH_BY_IDS_BATCH_SIZE = 100;
|
|
32
31
|
export declare const useApiFetchByIds: <T>(params: UseApiFetchByIdsParams) => UseApiFetchByIdsReturnType<T>;
|
|
@@ -34,24 +33,11 @@ export type UseApiFetchByIdsReturnType<T> = {
|
|
|
34
33
|
execute: (ids: DocId[] | IntegerId[], params?: FetchByIdsParams) => Promise<T[]>;
|
|
35
34
|
abort: () => void;
|
|
36
35
|
/**
|
|
37
|
-
* True while this instance has a request in flight
|
|
38
|
-
*
|
|
39
|
-
* It
|
|
40
|
-
*
|
|
41
|
-
* `
|
|
42
|
-
* for is still running. This one never dips between a superseded call and the one that replaced it.
|
|
43
|
-
*
|
|
44
|
-
* Two things to know before replacing a hand-rolled flag with it.
|
|
45
|
-
*
|
|
46
|
-
* It covers what this helper does and nothing the caller does afterwards. A flag that also spans a
|
|
47
|
-
* follow-up cached fetch, a mapping pass or a second endpoint is not the same flag, and swapping it
|
|
48
|
-
* for this one turns the spinner off too early. Keep your own where it means more than "this helper
|
|
49
|
-
* is working".
|
|
50
|
-
*
|
|
51
|
-
* It belongs to the instance, so it is only reachable if you hold the instance. A factory that
|
|
52
|
-
* builds one per call and hands back the promise alone -- `const { execute } = useX()` inside the
|
|
53
|
-
* function that calls it -- cannot expose `loading`, `abort` or `cancelPrevious` at all. Hoist the
|
|
54
|
-
* instance to where the caller lives first.
|
|
36
|
+
* True while this instance has a request in flight. Unlike a caller-cleared
|
|
37
|
+
* `finally` flag, it does not dip when `cancelPrevious` supersedes a call.
|
|
38
|
+
* It covers only this helper's work. Keep your own flag if it also spans follow-up fetches or mapping.
|
|
39
|
+
* It belongs to the instance. A factory that builds one per call cannot
|
|
40
|
+
* expose `loading`, `abort` or `cancelPrevious`, so hoist the instance first.
|
|
55
41
|
*/
|
|
56
42
|
loading: Ref<boolean>;
|
|
57
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useApiFetchByIds.js","names":["generateByIdsApiQuery","useApiQueryBuilder","limit","ids","querySetLimit","querySetOffset","querySetOrder","field","isSearchApi","queryAdd","queryAddFilter","queryBuild","useApiFetchByIds","params","abortable","createAbortable","executeBatch","urlTemplateOverride","urlParamsOverride","fetchParams","url","dispatched","res","template","isDefined","urlTemplate","isUndefined","AnzuFatalError","resolvedParams","urlParams","requestUrl","replaceUrlParameters","instance","client","ownedByHelper","options","abortSignal","signal","asSent","requestedUrl","isValidHTTPStatus","AnzuApiResponseCodeError","hasBody","readListBody","err","context","report","mapApiError","items","start","batch"],"sources":["../../../../src/domains/api/composables/useApiFetchByIds.ts"],"sourcesContent":["import { AnzuFatalError } from '@/shared/error/AnzuFatalError'\nimport { AnzuApiResponseCodeError } from '@/shared/error/AnzuApiResponseCodeError'\nimport { replaceUrlParameters, type UrlParams } from '@/domains/api/utils/apiHelper'\nimport { isValidHTTPStatus } from '@/domains/api/utils/response'\nimport type { AxiosRequestConfig } from 'axios'\nimport { HTTP_STATUS_NO_CONTENT } from '@/shared/statusCodes'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { isDefined, isUndefined } from '@/shared/utils/common'\nimport type { Ref } from 'vue'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport { useApiQueryBuilder } from '@/domains/api/composables/useApiQueryBuilder'\nimport { mapApiError, report } from '@/domains/api/utils/apiErrors'\nimport { createAbortable, hasBody, ownedByHelper, requestedUrl } from '@/domains/api/composables/request'\nimport { readListBody } from '@/domains/api/utils/listBody'\n\nexport type UseApiFetchByIdsParams = {\n client: AxiosClientFn\n system: string\n entity: string\n /** i18n scope for field-level validation failures; defaults to `system` / `entity`. */\n validationSystem?: string\n validationEntity?: string\n urlTemplate?: string\n urlParams?: UrlParams\n /** Anything axios takes except what this helper decides: the method, the url, the body and the signal. */\n options?: Omit<AxiosRequestConfig, 'method' | 'url' | 'data' | 'signal'>\n isSearchApi?: boolean\n field?: string\n cancelPrevious?: boolean\n}\n\nexport type FetchByIdsParams = {\n urlTemplate?: string\n urlParams?: UrlParams\n /** Stops this one call, leaving the instance's other calls alone. */\n signal?: AbortSignal\n}\n\n/**\n * Ids per request. A cache drains everything queued in one go, and a thousand ids in a query string is\n * past the 8 KB request line a proxy takes by default -- the request would come back 414.\n */\nexport const FETCH_BY_IDS_BATCH_SIZE = 100\n\n/** The `filter_in` query that fetches exactly the ids asked for, in one request. */\nconst generateByIdsApiQuery = (ids: IntegerId[] | DocId[], isSearchApi: boolean, field = 'id'): string => {\n const { querySetLimit, querySetOffset, querySetOrder, queryBuild, queryAddFilter, queryAdd } = useApiQueryBuilder()\n const limit = ids.length\n querySetLimit(limit)\n querySetOffset(1, limit)\n querySetOrder(field, false)\n if (isSearchApi) queryAdd(field, ids.join(','))\n else queryAddFilter('in', field, ids.join(','))\n\n return queryBuild()\n}\n\nexport const useApiFetchByIds = <T>(params: UseApiFetchByIdsParams): UseApiFetchByIdsReturnType<T> => {\n const {\n client,\n system,\n entity,\n validationSystem,\n validationEntity,\n urlTemplate,\n urlParams,\n options = {},\n isSearchApi = false,\n field = 'id',\n cancelPrevious = false,\n } = params\n const abortable = createAbortable({ cancelPrevious })\n\n const executeBatch = async (ids: DocId[] | IntegerId[], fetchParams: FetchByIdsParams): Promise<T[]> => {\n const { urlTemplate: urlTemplateOverride, urlParams: urlParamsOverride, signal } = fetchParams\n\n // Assigned inside `run`, once, at the moment there is a url to ask for; undefined until then,\n // which is what a failure before dispatch honestly reports.\n let url: string | undefined\n // The config axios used, kept for the failures this helper raises after reading the response:\n // they carry no config of their own, and rebuilding one describes the request as the client\n // would send it now rather than as it was sent.\n let dispatched: AxiosRequestConfig | undefined\n\n try {\n const res = await abortable.run((abortSignal) => {\n // Derived inside `run`, the way the list does it: `run` opens the generation and, with\n // `cancelPrevious`, stops the call before this one, so work done ahead of it would let a\n // call that never dispatches leave its predecessor running. Inside the try as well, so a\n // caller that forgot the template gets the same error class as every other failure rather\n // than a bare `Error`.\n const template = isDefined(urlTemplateOverride) ? urlTemplateOverride : urlTemplate\n if (isUndefined(template)) throw new AnzuFatalError(undefined, 'Url template is undefined')\n\n const resolvedParams = isDefined(urlParamsOverride) ? urlParamsOverride : urlParams\n const baseUrl = isUndefined(resolvedParams) ? template : replaceUrlParameters(template, resolvedParams)\n const requestUrl = baseUrl + generateByIdsApiQuery(ids, isSearchApi, field)\n const instance = client()\n\n // Recorded last, when nothing between here and the call can throw any more: a client factory\n // that fails is a request that never happened, and the report says so by naming no url.\n url = requestUrl\n\n return instance.get(requestUrl, { ...ownedByHelper(options), signal: abortSignal })\n }, signal)\n\n dispatched = res.config\n // The url the report will name, so a message and the context beside it cannot disagree about\n // which request failed when an interceptor rewrote it on the way out.\n const asSent = () => requestedUrl(client, url, options, undefined, dispatched)\n if (!isValidHTTPStatus(res.status)) throw new AnzuApiResponseCodeError(res.status)\n\n // Nothing matched the ids -- an empty answer, not a broken one.\n if (res.status === HTTP_STATUS_NO_CONTENT) return []\n\n if (!hasBody(res)) {\n throw new AnzuApiResponseCodeError(res.status, undefined, 'Expected a response body, url: ' + asSent())\n }\n\n return readListBody<T>(res.data, res.status, asSent()).items\n } catch (err: unknown) {\n // Built once and handed to both, the way the batch does it: half the work on the failure path,\n // and one place that could go wrong instead of two.\n const context = {\n system,\n entity,\n validationSystem,\n validationEntity,\n url: requestedUrl(client, url, options, err, dispatched),\n }\n\n throw report(mapApiError(err, context), context)\n }\n }\n\n // One batch after another, not side by side: with `cancelPrevious` each batch would stop the one\n // before it. A failed batch fails the call, as a single request would.\n const execute = async (ids: DocId[] | IntegerId[], fetchParams: FetchByIdsParams = {}): Promise<T[]> => {\n if (ids.length <= FETCH_BY_IDS_BATCH_SIZE) return executeBatch(ids, fetchParams)\n const items: T[] = []\n for (let start = 0; start < ids.length; start += FETCH_BY_IDS_BATCH_SIZE) {\n const batch = ids.slice(start, start + FETCH_BY_IDS_BATCH_SIZE) as DocId[] | IntegerId[]\n items.push(...(await executeBatch(batch, fetchParams)))\n }\n return items\n }\n\n return { execute, abort: abortable.abort, loading: abortable.loading }\n}\n\nexport type UseApiFetchByIdsReturnType<T> = {\n execute: (ids: DocId[] | IntegerId[], params?: FetchByIdsParams) => Promise<T[]>\n abort: () => void\n /**\n * True while this instance has a request in flight, false once the last one settles.\n *\n * It is here so a caller does not have to keep its own: the hand-rolled version is a ref cleared in\n * a `finally`, and that `finally` belongs to whichever call ended -- including one that\n * `cancelPrevious` just superseded, which turns the spinner off while the call the user is waiting\n * for is still running. This one never dips between a superseded call and the one that replaced it.\n *\n * Two things to know before replacing a hand-rolled flag with it.\n *\n * It covers what this helper does and nothing the caller does afterwards. A flag that also spans a\n * follow-up cached fetch, a mapping pass or a second endpoint is not the same flag, and swapping it\n * for this one turns the spinner off too early. Keep your own where it means more than \"this helper\n * is working\".\n *\n * It belongs to the instance, so it is only reachable if you hold the instance. A factory that\n * builds one per call and hands back the promise alone -- `const { execute } = useX()` inside the\n * function that calls it -- cannot expose `loading`, `abort` or `cancelPrevious` at all. Hoist the\n * instance to where the caller lives first.\n */\n loading: Ref<boolean>\n}\n"],"mappings":";;;;;;;;;;AA6CA,IAAMA,KAAyB,GAA4B,GAAsB,IAAQ,SAAiB;CACxG,IAAM,EAAE,kBAAe,mBAAgB,kBAAe,eAAY,mBAAgB,gBAAaC,EAAmB,GAC5GC,IAAQC,EAAI;CAOlB,OANAC,EAAcF,CAAK,GACnBG,EAAe,GAAGH,CAAK,GACvBI,EAAcC,GAAO,EAAK,GACtBC,IAAaC,EAASF,GAAOJ,EAAI,KAAK,GAAG,CAAC,IACzCO,EAAe,MAAMH,GAAOJ,EAAI,KAAK,GAAG,CAAC,GAEvCQ,EAAW;AACpB,GAEaC,KAAuB,MAAkE;CACpG,IAAM,EACJ,WACA,WACA,WACA,qBACA,qBACA,gBACA,cACA,aAAU,CAAC,GACX,iBAAc,IACd,WAAQ,MACR,oBAAiB,OACfC,GACEC,IAAYC,EAAgB,EAAE,kBAAe,CAAC,GAE9CC,IAAe,OAAO,GAA4B,MAAgD;EACtG,IAAM,EAAE,aAAaC,GAAqB,WAAWC,GAAmB,cAAWC,GAI/EC,GAIAC;EAEJ,IAAI;GACF,IAAMC,IAAM,MAAMR,EAAU,KAAK,MAAgB;IAM/C,IAAMS,IAAWC,EAAUP,CAAmB,IAAIA,IAAsBQ;IACxE,IAAIC,EAAYH,CAAQ,GAAG,MAAM,IAAII,EAAe,KAAA,GAAW,2BAA2B;IAE1F,IAAMC,IAAiBJ,EAAUN,CAAiB,IAAIA,IAAoBW,GAEpEC,KADUJ,EAAYE,CAAc,IAAIL,IAAWQ,EAAqBR,GAAUK,CAAc,KACzE5B,EAAsBG,GAAKK,GAAaD,CAAK,GACpEyB,IAAWC,EAAO;IAMxB,OAFA,IAAMH,GAECE,EAAS,IAAIF,GAAY;KAAE,GAAGI,EAAcC,CAAO;KAAG,QAAQC;IAAY,CAAC;GACpF,GAAGC,CAAM;GAET,IAAaf,EAAI;GAGjB,IAAMgB,UAAeC,EAAaN,GAAQb,GAAKe,GAAS,KAAA,GAAWd,CAAU;GAC7E,IAAI,CAACmB,EAAkBlB,EAAI,MAAM,GAAG,MAAM,IAAImB,EAAyBnB,EAAI,MAAM;GAGjF,IAAIA,EAAI,WAAA,KAAmC,OAAO,CAAC;GAEnD,IAAI,CAACoB,EAAQpB,CAAG,GACd,MAAM,IAAImB,EAAyBnB,EAAI,QAAQ,KAAA,GAAW,oCAAoCgB,EAAO,CAAC;GAGxG,OAAOK,EAAgBrB,EAAI,MAAMA,EAAI,QAAQgB,EAAO,CAAC,CAAC,CAAC;EACzD,SAASM,GAAc;GAGrB,IAAMC,IAAU;IACd;IACA;IACA;IACA;IACA,KAAKN,EAAaN,GAAQb,GAAKe,GAASS,GAAKvB,CAAU;GACzD;GAEA,MAAMyB,EAAOC,EAAYH,GAAKC,CAAO,GAAGA,CAAO;EACjD;CACF;CAcA,OAAO;EAAE,gBAVc,GAA4B,IAAgC,CAAC,MAAoB;GACtG,IAAI1C,EAAI,UAAA,KAAmC,OAAOa,EAAab,GAAKgB,CAAW;GAC/E,IAAM6B,IAAa,CAAC;GACpB,KAAK,IAAIC,IAAQ,GAAGA,IAAQ9C,EAAI,QAAQ,KAAA,KAAkC;IACxE,IAAM+C,IAAQ/C,EAAI,MAAM8C,GAAOA,IAAA,GAA+B;IAC9D,EAAM,KAAK,GAAI,MAAMjC,EAAakC,GAAO/B,CAAW,CAAE;GACxD;GACA,OAAO6B;EACT;EAEkB,OAAOlC,EAAU;EAAO,SAASA,EAAU;CAAQ;AACvE"}
|
|
1
|
+
{"version":3,"file":"useApiFetchByIds.js","names":["generateByIdsApiQuery","useApiQueryBuilder","limit","ids","querySetLimit","querySetOffset","querySetOrder","field","isSearchApi","queryAdd","queryAddFilter","queryBuild","useApiFetchByIds","params","abortable","createAbortable","executeBatch","urlTemplateOverride","urlParamsOverride","fetchParams","url","dispatched","res","template","isDefined","urlTemplate","isUndefined","AnzuFatalError","resolvedParams","urlParams","requestUrl","replaceUrlParameters","instance","client","ownedByHelper","options","abortSignal","signal","asSent","requestedUrl","isValidHTTPStatus","AnzuApiResponseCodeError","hasBody","readListBody","err","context","report","mapApiError","items","start","batch"],"sources":["../../../../src/domains/api/composables/useApiFetchByIds.ts"],"sourcesContent":["import { AnzuFatalError } from '@/shared/error/AnzuFatalError'\nimport { AnzuApiResponseCodeError } from '@/shared/error/AnzuApiResponseCodeError'\nimport { replaceUrlParameters, type UrlParams } from '@/domains/api/utils/apiHelper'\nimport { isValidHTTPStatus } from '@/domains/api/utils/response'\nimport type { AxiosRequestConfig } from 'axios'\nimport { HTTP_STATUS_NO_CONTENT } from '@/shared/statusCodes'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { isDefined, isUndefined } from '@/shared/utils/common'\nimport type { Ref } from 'vue'\nimport type { AxiosClientFn } from '@/domains/api/utils/client'\nimport { useApiQueryBuilder } from '@/domains/api/composables/useApiQueryBuilder'\nimport { mapApiError, report } from '@/domains/api/utils/apiErrors'\nimport { createAbortable, hasBody, ownedByHelper, requestedUrl } from '@/domains/api/composables/request'\nimport { readListBody } from '@/domains/api/utils/listBody'\n\nexport type UseApiFetchByIdsParams = {\n client: AxiosClientFn\n system: string\n entity: string\n /** i18n scope for field-level validation failures; defaults to `system` / `entity`. */\n validationSystem?: string\n validationEntity?: string\n urlTemplate?: string\n urlParams?: UrlParams\n options?: Omit<AxiosRequestConfig, 'method' | 'url' | 'data' | 'signal'>\n isSearchApi?: boolean\n field?: string\n cancelPrevious?: boolean\n}\n\nexport type FetchByIdsParams = {\n urlTemplate?: string\n urlParams?: UrlParams\n /** Stops this one call, leaving the instance's other calls alone. */\n signal?: AbortSignal\n}\n\n/**\n * Ids per request. A cache drains all queued ids at once, and a thousand ids in\n * a query string exceed the default 8 KB proxy request line limit, giving a 414.\n */\nexport const FETCH_BY_IDS_BATCH_SIZE = 100\n\nconst generateByIdsApiQuery = (ids: IntegerId[] | DocId[], isSearchApi: boolean, field = 'id'): string => {\n const { querySetLimit, querySetOffset, querySetOrder, queryBuild, queryAddFilter, queryAdd } = useApiQueryBuilder()\n const limit = ids.length\n querySetLimit(limit)\n querySetOffset(1, limit)\n querySetOrder(field, false)\n if (isSearchApi) queryAdd(field, ids.join(','))\n else queryAddFilter('in', field, ids.join(','))\n\n return queryBuild()\n}\n\nexport const useApiFetchByIds = <T>(params: UseApiFetchByIdsParams): UseApiFetchByIdsReturnType<T> => {\n const {\n client,\n system,\n entity,\n validationSystem,\n validationEntity,\n urlTemplate,\n urlParams,\n options = {},\n isSearchApi = false,\n field = 'id',\n cancelPrevious = false,\n } = params\n const abortable = createAbortable({ cancelPrevious })\n\n const executeBatch = async (ids: DocId[] | IntegerId[], fetchParams: FetchByIdsParams): Promise<T[]> => {\n const { urlTemplate: urlTemplateOverride, urlParams: urlParamsOverride, signal } = fetchParams\n\n // Assigned inside `run` once a url exists. It stays undefined\n // before that, so a failure before dispatch reports no url.\n let url: string | undefined\n // The config axios used, kept for failures raised after reading the response. Those carry\n // no config, and a rebuild would describe the request as the client would send it now.\n let dispatched: AxiosRequestConfig | undefined\n\n try {\n const res = await abortable.run((abortSignal) => {\n // Derived inside `run` because `run` opens the generation and, with `cancelPrevious`, stops the\n // previous call. Work done before it could leave the predecessor running if this call never dispatches.\n // Inside the try so a missing template raises the same error class as other failures.\n const template = isDefined(urlTemplateOverride) ? urlTemplateOverride : urlTemplate\n if (isUndefined(template)) throw new AnzuFatalError(undefined, 'Url template is undefined')\n\n const resolvedParams = isDefined(urlParamsOverride) ? urlParamsOverride : urlParams\n const baseUrl = isUndefined(resolvedParams) ? template : replaceUrlParameters(template, resolvedParams)\n const requestUrl = baseUrl + generateByIdsApiQuery(ids, isSearchApi, field)\n const instance = client()\n\n // Recorded last, when nothing before the call can throw. A failing\n // client factory means no request happened, so no url is reported.\n url = requestUrl\n\n return instance.get(requestUrl, { ...ownedByHelper(options), signal: abortSignal })\n }, signal)\n\n dispatched = res.config\n // The url the report names, so the message and context agree when an interceptor rewrote the request.\n const asSent = () => requestedUrl(client, url, options, undefined, dispatched)\n if (!isValidHTTPStatus(res.status)) throw new AnzuApiResponseCodeError(res.status)\n\n // Nothing matched the ids -- an empty answer, not a broken one.\n if (res.status === HTTP_STATUS_NO_CONTENT) return []\n\n if (!hasBody(res)) {\n throw new AnzuApiResponseCodeError(res.status, undefined, 'Expected a response body, url: ' + asSent())\n }\n\n return readListBody<T>(res.data, res.status, asSent()).items\n } catch (err: unknown) {\n // Built once and shared by both, as in the batch.\n const context = {\n system,\n entity,\n validationSystem,\n validationEntity,\n url: requestedUrl(client, url, options, err, dispatched),\n }\n\n throw report(mapApiError(err, context), context)\n }\n }\n\n // Batches run sequentially. In parallel, `cancelPrevious` would make each\n // batch stop the one before it. A failed batch fails the whole call.\n const execute = async (ids: DocId[] | IntegerId[], fetchParams: FetchByIdsParams = {}): Promise<T[]> => {\n if (ids.length <= FETCH_BY_IDS_BATCH_SIZE) return executeBatch(ids, fetchParams)\n const items: T[] = []\n for (let start = 0; start < ids.length; start += FETCH_BY_IDS_BATCH_SIZE) {\n const batch = ids.slice(start, start + FETCH_BY_IDS_BATCH_SIZE) as DocId[] | IntegerId[]\n items.push(...(await executeBatch(batch, fetchParams)))\n }\n return items\n }\n\n return { execute, abort: abortable.abort, loading: abortable.loading }\n}\n\nexport type UseApiFetchByIdsReturnType<T> = {\n execute: (ids: DocId[] | IntegerId[], params?: FetchByIdsParams) => Promise<T[]>\n abort: () => void\n /**\n * True while this instance has a request in flight. Unlike a caller-cleared\n * `finally` flag, it does not dip when `cancelPrevious` supersedes a call.\n * It covers only this helper's work. Keep your own flag if it also spans follow-up fetches or mapping.\n * It belongs to the instance. A factory that builds one per call cannot\n * expose `loading`, `abort` or `cancelPrevious`, so hoist the instance first.\n */\n loading: Ref<boolean>\n}\n"],"mappings":";;;;;;;;;;AA2CA,IAAMA,KAAyB,GAA4B,GAAsB,IAAQ,SAAiB;CACxG,IAAM,EAAE,kBAAe,mBAAgB,kBAAe,eAAY,mBAAgB,gBAAaC,EAAmB,GAC5GC,IAAQC,EAAI;CAOlB,OANAC,EAAcF,CAAK,GACnBG,EAAe,GAAGH,CAAK,GACvBI,EAAcC,GAAO,EAAK,GACtBC,IAAaC,EAASF,GAAOJ,EAAI,KAAK,GAAG,CAAC,IACzCO,EAAe,MAAMH,GAAOJ,EAAI,KAAK,GAAG,CAAC,GAEvCQ,EAAW;AACpB,GAEaC,KAAuB,MAAkE;CACpG,IAAM,EACJ,WACA,WACA,WACA,qBACA,qBACA,gBACA,cACA,aAAU,CAAC,GACX,iBAAc,IACd,WAAQ,MACR,oBAAiB,OACfC,GACEC,IAAYC,EAAgB,EAAE,kBAAe,CAAC,GAE9CC,IAAe,OAAO,GAA4B,MAAgD;EACtG,IAAM,EAAE,aAAaC,GAAqB,WAAWC,GAAmB,cAAWC,GAI/EC,GAGAC;EAEJ,IAAI;GACF,IAAMC,IAAM,MAAMR,EAAU,KAAK,MAAgB;IAI/C,IAAMS,IAAWC,EAAUP,CAAmB,IAAIA,IAAsBQ;IACxE,IAAIC,EAAYH,CAAQ,GAAG,MAAM,IAAII,EAAe,KAAA,GAAW,2BAA2B;IAE1F,IAAMC,IAAiBJ,EAAUN,CAAiB,IAAIA,IAAoBW,GAEpEC,KADUJ,EAAYE,CAAc,IAAIL,IAAWQ,EAAqBR,GAAUK,CAAc,KACzE5B,EAAsBG,GAAKK,GAAaD,CAAK,GACpEyB,IAAWC,EAAO;IAMxB,OAFA,IAAMH,GAECE,EAAS,IAAIF,GAAY;KAAE,GAAGI,EAAcC,CAAO;KAAG,QAAQC;IAAY,CAAC;GACpF,GAAGC,CAAM;GAET,IAAaf,EAAI;GAEjB,IAAMgB,UAAeC,EAAaN,GAAQb,GAAKe,GAAS,KAAA,GAAWd,CAAU;GAC7E,IAAI,CAACmB,EAAkBlB,EAAI,MAAM,GAAG,MAAM,IAAImB,EAAyBnB,EAAI,MAAM;GAGjF,IAAIA,EAAI,WAAA,KAAmC,OAAO,CAAC;GAEnD,IAAI,CAACoB,EAAQpB,CAAG,GACd,MAAM,IAAImB,EAAyBnB,EAAI,QAAQ,KAAA,GAAW,oCAAoCgB,EAAO,CAAC;GAGxG,OAAOK,EAAgBrB,EAAI,MAAMA,EAAI,QAAQgB,EAAO,CAAC,CAAC,CAAC;EACzD,SAASM,GAAc;GAErB,IAAMC,IAAU;IACd;IACA;IACA;IACA;IACA,KAAKN,EAAaN,GAAQb,GAAKe,GAASS,GAAKvB,CAAU;GACzD;GAEA,MAAMyB,EAAOC,EAAYH,GAAKC,CAAO,GAAGA,CAAO;EACjD;CACF;CAcA,OAAO;EAAE,gBAVc,GAA4B,IAAgC,CAAC,MAAoB;GACtG,IAAI1C,EAAI,UAAA,KAAmC,OAAOa,EAAab,GAAKgB,CAAW;GAC/E,IAAM6B,IAAa,CAAC;GACpB,KAAK,IAAIC,IAAQ,GAAGA,IAAQ9C,EAAI,QAAQ,KAAA,KAAkC;IACxE,IAAM+C,IAAQ/C,EAAI,MAAM8C,GAAOA,IAAA,GAA+B;IAC9D,EAAM,KAAK,GAAI,MAAMjC,EAAakC,GAAO/B,CAAW,CAAE;GACxD;GACA,OAAO6B;EACT;EAEkB,OAAOlC,EAAU;EAAO,SAASA,EAAU;CAAQ;AACvE"}
|
|
@@ -12,31 +12,23 @@ export type UseApiFetchItemsParams = {
|
|
|
12
12
|
validationSystem?: string;
|
|
13
13
|
validationEntity?: string;
|
|
14
14
|
/**
|
|
15
|
-
* The url
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `:id` and sends `:locale` as it stands. This is the helper written for hand-made queries, so it
|
|
19
|
-
* is the one place someone would reach for a placeholder in the query; put the value in the query
|
|
20
|
-
* when building it, or pass it through `options.params` and let axios serialise it.
|
|
15
|
+
* The full url including the query, already built by the caller.
|
|
16
|
+
* `urlParams` are substituted into the path only. A placeholder in the query
|
|
17
|
+
* is sent as is. Put the value in the query or pass it via `options.params`.
|
|
21
18
|
*/
|
|
22
19
|
urlTemplate?: string;
|
|
23
20
|
urlParams?: UrlParams;
|
|
24
|
-
/** Anything axios takes except what this helper decides: the method, the url, the body and the signal. */
|
|
25
21
|
options?: Omit<AxiosRequestConfig, 'method' | 'url' | 'data' | 'signal'>;
|
|
26
22
|
cancelPrevious?: boolean;
|
|
27
23
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* url goes out as a POST, and a mutation can answer with the list it just changed -- a swap, a
|
|
32
|
-
* shift, an upsert-all. What this helper is about is the answer, not the verb.
|
|
24
|
+
* Defaults to `GET`.
|
|
25
|
+
* Other verbs exist because a filter too big for a url goes out
|
|
26
|
+
* as a POST, and a mutation can answer with the changed list.
|
|
33
27
|
*/
|
|
34
28
|
method?: 'GET' | 'POST' | 'PUT' | 'PATCH';
|
|
35
29
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* Leaving it out cannot go wrong quietly: the reader refuses the shape that was not declared, so a
|
|
39
|
-
* forgotten `'array'` fails on the first run rather than handing back something that is not a list.
|
|
30
|
+
* Defaults to `'envelope'`, the fleet norm.
|
|
31
|
+
* The reader refuses an undeclared shape, so a forgotten `'array'` fails on the first run.
|
|
40
32
|
*/
|
|
41
33
|
shape?: ItemsShape;
|
|
42
34
|
};
|
|
@@ -49,53 +41,22 @@ export type FetchItemsParams<B = never> = {
|
|
|
49
41
|
signal?: AbortSignal;
|
|
50
42
|
};
|
|
51
43
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* `data` is an array, so a malformed answer still hands back `undefined` typed as `T[]`, which is
|
|
58
|
-
* the bug this whole family was built to end.
|
|
59
|
-
*
|
|
60
|
-
* `useApiFetchList` cannot serve them: it asks for a pagination ref, a `filterData` and a
|
|
61
|
-
* `filterConfig`, and these calls have none -- their filters are decided at the call site and are
|
|
62
|
-
* not the user's to change. So this is that helper with the pagination taken out: same core, same
|
|
63
|
-
* error mapping, same list-body check, and it answers with the items rather than the envelope.
|
|
64
|
-
*
|
|
65
|
-
* Read is the usual case, not the only one: a filter too big for a url goes out as a POST, and a
|
|
66
|
-
* mutation can answer with the list it just changed. The helper is about what comes back.
|
|
67
|
-
*
|
|
68
|
-
* Which shape it comes back in is declared, not guessed. `shape` picks the reader and the reader
|
|
69
|
-
* refuses the other shape, the way `optionalBody` makes a caller declare a body instead of leaving
|
|
70
|
-
* the helper to accept whatever turns up. A wrong declaration therefore fails loudly on the first
|
|
71
|
-
* run, which is what makes having a default safe at all.
|
|
72
|
-
*
|
|
73
|
-
* It writes no metadata. An endpoint whose paging the user drives is `useApiFetchList`; a list read
|
|
74
|
-
* page by page to the end is `useApiFetchListBatch`.
|
|
44
|
+
* Fetches a list from an endpoint whose query the caller already built, without pagination.
|
|
45
|
+
* Replaces `useApiRequest<ApiResponseList<T[]>>` reads, which never checked that `data`
|
|
46
|
+
* is an array. `useApiFetchList` needs pagination and filter config these calls lack.
|
|
47
|
+
* `shape` is declared, and the reader refuses the other shape, so a wrong declaration fails loudly.
|
|
48
|
+
* Writes no metadata. Use `useApiFetchList` for user-driven paging and `useApiFetchListBatch` to read all pages.
|
|
75
49
|
*/
|
|
76
50
|
export declare const useApiFetchItems: <T, B = never>(params: UseApiFetchItemsParams) => UseApiFetchItemsReturnType<T, B>;
|
|
77
51
|
export type UseApiFetchItemsReturnType<T, B = never> = {
|
|
78
52
|
execute: (params?: FetchItemsParams<B>) => Promise<T[]>;
|
|
79
53
|
abort: () => void;
|
|
80
54
|
/**
|
|
81
|
-
* True while this instance has a request in flight
|
|
82
|
-
*
|
|
83
|
-
* It
|
|
84
|
-
*
|
|
85
|
-
* `
|
|
86
|
-
* for is still running. This one never dips between a superseded call and the one that replaced it.
|
|
87
|
-
*
|
|
88
|
-
* Two things to know before replacing a hand-rolled flag with it.
|
|
89
|
-
*
|
|
90
|
-
* It covers what this helper does and nothing the caller does afterwards. A flag that also spans a
|
|
91
|
-
* follow-up cached fetch, a mapping pass or a second endpoint is not the same flag, and swapping it
|
|
92
|
-
* for this one turns the spinner off too early. Keep your own where it means more than "this helper
|
|
93
|
-
* is working".
|
|
94
|
-
*
|
|
95
|
-
* It belongs to the instance, so it is only reachable if you hold the instance. A factory that
|
|
96
|
-
* builds one per call and hands back the promise alone -- `const { execute } = useX()` inside the
|
|
97
|
-
* function that calls it -- cannot expose `loading`, `abort` or `cancelPrevious` at all. Hoist the
|
|
98
|
-
* instance to where the caller lives first.
|
|
55
|
+
* True while this instance has a request in flight. Unlike a caller-cleared
|
|
56
|
+
* `finally` flag, it does not dip when `cancelPrevious` supersedes a call.
|
|
57
|
+
* It covers only this helper's work. Keep your own flag if it also spans follow-up fetches or mapping.
|
|
58
|
+
* It belongs to the instance. A factory that builds one per call cannot
|
|
59
|
+
* expose `loading`, `abort` or `cancelPrevious`, so hoist the instance first.
|
|
99
60
|
*/
|
|
100
61
|
loading: Ref<boolean>;
|
|
101
62
|
};
|