fastapi-rtk 1.0.2 → 1.0.3
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/dist/.external/cjs/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/hydration.cjs +148 -0
- package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/infiniteQueryBehavior.cjs +10 -0
- package/dist/.external/cjs/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/infiniteQueryObserver.cjs +66 -0
- package/dist/.external/cjs/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/mutationObserver.cjs +140 -0
- package/dist/.external/cjs/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/queriesObserver.cjs +205 -0
- package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/query.cjs +13 -9
- package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/retryer.cjs +4 -0
- package/dist/.external/cjs/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/streamedQuery.cjs +41 -0
- package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/thenable.cjs +14 -0
- package/dist/.external/cjs/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/types.cjs +8 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/HydrationBoundary.cjs +70 -0
- package/dist/.external/cjs/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.cjs +2 -1
- package/dist/.external/cjs/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.cjs +3 -0
- package/dist/.external/cjs/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.cjs +8 -1
- package/dist/.external/cjs/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.cjs +1 -1
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/index.cjs +95 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/infiniteQueryOptions.cjs +6 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/mutationOptions.cjs +6 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/queryOptions.cjs +6 -0
- package/dist/.external/cjs/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/suspense.cjs +2 -0
- package/dist/.external/cjs/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.cjs +3 -3
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useInfiniteQuery.cjs +12 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useIsFetching.cjs +35 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useMutation.cjs +55 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useMutationState.cjs +65 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.cjs +10 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/usePrefetchQuery.cjs +10 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useQueries.cjs +113 -0
- package/dist/.external/cjs/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.cjs +2 -2
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.cjs +24 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useSuspenseQueries.cjs +28 -0
- package/dist/.external/cjs/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useSuspenseQuery.cjs +25 -0
- package/dist/.external/cjs/ajv-formats@2.1.1_ajv@8.17.1/ajv-formats/dist/formats.cjs +7 -7
- package/dist/.external/cjs/ajv-formats@2.1.1_ajv@8.17.1/ajv-formats/dist/index.cjs +5 -5
- package/dist/.external/cjs/ajv-formats@2.1.1_ajv@8.17.1/ajv-formats/dist/limit.cjs +6 -6
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/ajv.cjs +16 -16
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/codegen/code.cjs +20 -20
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/codegen/index.cjs +23 -23
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/codegen/scope.cjs +9 -9
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/errors.cjs +11 -11
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/core.cjs +11 -11
- package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/applicator/dependencies.cjs +8 -8
- package/dist/.external/cjs/{i18next@25.6.0_typescript@5.9.3 → i18next@25.6.2_typescript@5.9.3}/i18next/dist/esm/i18next.cjs +3 -2
- package/dist/.external/cjs/lodash@4.17.21/lodash/_cloneBuffer.cjs +2 -2
- package/dist/.external/cjs/lodash@4.17.21/lodash/_nodeUtil.cjs +2 -2
- package/dist/.external/cjs/lodash@4.17.21/lodash/fp/_mapping.cjs +14 -14
- package/dist/.external/cjs/lodash@4.17.21/lodash/isBuffer.cjs +2 -2
- package/dist/.external/cjs/lodash@4.17.21/lodash/lodash.cjs +2 -2
- package/dist/.external/esm/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/hydration.mjs +148 -0
- package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/infiniteQueryBehavior.mjs +10 -0
- package/dist/.external/esm/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/infiniteQueryObserver.mjs +66 -0
- package/dist/.external/esm/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/mutationObserver.mjs +140 -0
- package/dist/.external/esm/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/queriesObserver.mjs +205 -0
- package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/query.mjs +13 -9
- package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/retryer.mjs +5 -1
- package/dist/.external/esm/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/streamedQuery.mjs +41 -0
- package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/thenable.mjs +15 -1
- package/dist/.external/esm/@tanstack_query-core@5.90.7/@tanstack/query-core/build/modern/types.mjs +8 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/HydrationBoundary.mjs +53 -0
- package/dist/.external/esm/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/IsRestoringProvider.mjs +2 -1
- package/dist/.external/esm/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/QueryClientProvider.mjs +3 -0
- package/dist/.external/esm/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/QueryErrorResetBoundary.mjs +8 -1
- package/dist/.external/esm/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/errorBoundaryUtils.mjs +1 -1
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/index.mjs +95 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/infiniteQueryOptions.mjs +6 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/mutationOptions.mjs +6 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/queryOptions.mjs +6 -0
- package/dist/.external/esm/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/suspense.mjs +2 -0
- package/dist/.external/esm/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/useBaseQuery.mjs +3 -3
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useInfiniteQuery.mjs +12 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useIsFetching.mjs +18 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useMutation.mjs +38 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useMutationState.mjs +48 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.mjs +10 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/usePrefetchQuery.mjs +10 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useQueries.mjs +96 -0
- package/dist/.external/esm/{@tanstack_react-query@5.90.5_react@18.3.1 → @tanstack_react-query@5.90.7_react@18.3.1}/@tanstack/react-query/build/modern/useQuery.mjs +2 -2
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.mjs +24 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useSuspenseQueries.mjs +28 -0
- package/dist/.external/esm/@tanstack_react-query@5.90.7_react@18.3.1/@tanstack/react-query/build/modern/useSuspenseQuery.mjs +25 -0
- package/dist/.external/esm/ajv-formats@2.1.1_ajv@8.17.1/ajv-formats/dist/formats.mjs +7 -7
- package/dist/.external/esm/ajv-formats@2.1.1_ajv@8.17.1/ajv-formats/dist/index.mjs +5 -5
- package/dist/.external/esm/ajv-formats@2.1.1_ajv@8.17.1/ajv-formats/dist/limit.mjs +6 -6
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/ajv.mjs +16 -16
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/codegen/code.mjs +20 -20
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/codegen/index.mjs +23 -23
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/codegen/scope.mjs +9 -9
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/errors.mjs +11 -11
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/core.mjs +11 -11
- package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/applicator/dependencies.mjs +8 -8
- package/dist/.external/esm/{i18next@25.6.0_typescript@5.9.3 → i18next@25.6.2_typescript@5.9.3}/i18next/dist/esm/i18next.mjs +3 -2
- package/dist/.external/esm/lodash@4.17.21/lodash/_cloneBuffer.mjs +2 -2
- package/dist/.external/esm/lodash@4.17.21/lodash/_nodeUtil.mjs +2 -2
- package/dist/.external/esm/lodash@4.17.21/lodash/fp/_mapping.mjs +14 -14
- package/dist/.external/esm/lodash@4.17.21/lodash/isBuffer.mjs +2 -2
- package/dist/.external/esm/lodash@4.17.21/lodash/lodash.mjs +2 -2
- package/dist/constants/cjs/_virtual/index.cjs +1 -1
- package/dist/constants/cjs/_virtual/index2.cjs +1 -1
- package/dist/constants/esm/_virtual/index.mjs +1 -1
- package/dist/constants/esm/_virtual/index2.mjs +1 -1
- package/dist/core/cjs/ActionIcons/Add/Add.cjs +1 -1
- package/dist/core/cjs/ActionIcons/Delete/Delete.cjs +1 -1
- package/dist/core/cjs/ActionIcons/Download/Download.cjs +1 -1
- package/dist/core/cjs/ActionIcons/Edit/Edit.cjs +1 -1
- package/dist/core/cjs/ActionIcons/Refresh/Refresh.cjs +1 -1
- package/dist/core/cjs/ActionIcons/View/View.cjs +1 -1
- package/dist/core/cjs/Dialogs/AddDialog.cjs +2 -2
- package/dist/core/cjs/Dialogs/DeleteDialog.cjs +1 -1
- package/dist/core/cjs/Dialogs/EditDialog.cjs +2 -2
- package/dist/core/cjs/Modals/CommonModal.cjs +1 -1
- package/dist/core/cjs/Tables/DataGrid/ErrorDialog.cjs +1 -1
- package/dist/core/cjs/Tables/DataGrid/Toolbar/Filter/FilterMenu.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/NextGenDataGrid.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/ColumnHeaderFilterInput.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderBetweenInput.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/FilterModeDescription.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/HeaderAdvancedFiltersMenuButton.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbar/basicToolbars.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/MRT_TableContainer.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/MRT_TablePaper.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/MRT_TopToolbar.cjs +1 -1
- package/dist/core/cjs/Tables/NextGenDataGrid/patch/MantineReactTable.cjs +1 -1
- package/dist/core/cjs/Wrappers/ApiProvider/hooks/useProvideApi.cjs +2 -2
- package/dist/core/cjs/Wrappers/Provider/Contexts/LangContext.cjs +3 -3
- package/dist/core/cjs/Wrappers/Provider/Provider.cjs +2 -2
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideAuth.cjs +2 -2
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideInfo.cjs +1 -1
- package/dist/core/cjs/Wrappers/Provider/hooks/useProvideLang.cjs +1 -1
- package/dist/core/cjs/fab-react-toolkit-patch/api/utils/api/getItems.cjs +8 -3
- package/dist/core/cjs/index.cjs +4 -2
- package/dist/core/esm/ActionIcons/Add/Add.mjs +1 -1
- package/dist/core/esm/ActionIcons/Delete/Delete.mjs +1 -1
- package/dist/core/esm/ActionIcons/Download/Download.mjs +1 -1
- package/dist/core/esm/ActionIcons/Edit/Edit.mjs +1 -1
- package/dist/core/esm/ActionIcons/Refresh/Refresh.mjs +1 -1
- package/dist/core/esm/ActionIcons/View/View.mjs +1 -1
- package/dist/core/esm/Dialogs/AddDialog.mjs +2 -2
- package/dist/core/esm/Dialogs/DeleteDialog.mjs +1 -1
- package/dist/core/esm/Dialogs/EditDialog.mjs +2 -2
- package/dist/core/esm/Modals/CommonModal.mjs +1 -1
- package/dist/core/esm/Tables/DataGrid/ErrorDialog.mjs +1 -1
- package/dist/core/esm/Tables/DataGrid/Toolbar/Filter/FilterMenu.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/NextGenDataGrid.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/ColumnHeaderFilterInput.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/ColumnHeaderFilterInput/HeaderInputs/HeaderBetweenInput.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/FilterModeDescription.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/HeaderAdvancedFiltersMenuButton.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbar/basicToolbars.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/patch/MRT_TableContainer.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/patch/MRT_TablePaper.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/patch/MRT_TopToolbar.mjs +1 -1
- package/dist/core/esm/Tables/NextGenDataGrid/patch/MantineReactTable.mjs +1 -1
- package/dist/core/esm/Wrappers/ApiProvider/hooks/useProvideApi.mjs +2 -2
- package/dist/core/esm/Wrappers/Provider/Contexts/LangContext.mjs +3 -3
- package/dist/core/esm/Wrappers/Provider/Provider.mjs +2 -2
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideAuth.mjs +2 -2
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideInfo.mjs +1 -1
- package/dist/core/esm/Wrappers/Provider/hooks/useProvideLang.mjs +1 -1
- package/dist/core/esm/fab-react-toolkit-patch/api/utils/api/getItems.mjs +8 -3
- package/dist/core/esm/index.mjs +4 -2
- package/dist/core/lib/fab-react-toolkit-patch/api/utils/api/getItems.d.ts +1 -1
- package/dist/core/lib/index.d.ts +1 -0
- package/package.json +1 -1
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/focusManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/mutation.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/mutationCache.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/notifyManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/onlineManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/queryCache.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/queryClient.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/queryObserver.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/removable.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/subscribable.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/timeoutManager.cjs +0 -0
- /package/dist/.external/cjs/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/utils.cjs +0 -0
- /package/dist/.external/cjs/{mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.6_yup@1.7.1 → mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.7_yup@1.7.1}/mantine-form-yup-resolver/dist/esm/index.cjs +0 -0
- /package/dist/.external/cjs/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ndh5vv3rq66ztxn2u3n6xapebe}/mantine-react-table/dist/index.esm.cjs +0 -0
- /package/dist/.external/cjs/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ndh5vv3rq66ztxn2u3n6xapebe}/mantine-react-table/locales/de/index.cjs +0 -0
- /package/dist/.external/cjs/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ndh5vv3rq66ztxn2u3n6xapebe}/mantine-react-table/locales/en/index.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/I18nextProvider.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/context.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/defaults.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/i18nInstance.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/initReactI18next.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/unescape.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/useTranslation.cjs +0 -0
- /package/dist/.external/cjs/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/utils.cjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/focusManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/mutation.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/mutationCache.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/notifyManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/onlineManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/queryCache.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/queryClient.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/queryObserver.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/removable.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/subscribable.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/timeoutManager.mjs +0 -0
- /package/dist/.external/esm/{@tanstack_query-core@5.90.5 → @tanstack_query-core@5.90.7}/@tanstack/query-core/build/modern/utils.mjs +0 -0
- /package/dist/.external/esm/{mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.6_yup@1.7.1 → mantine-form-yup-resolver@2.0.0_@mantine_form@8.3.7_yup@1.7.1}/mantine-form-yup-resolver/dist/esm/index.mjs +0 -0
- /package/dist/.external/esm/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ndh5vv3rq66ztxn2u3n6xapebe}/mantine-react-table/dist/index.esm.mjs +0 -0
- /package/dist/.external/esm/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ndh5vv3rq66ztxn2u3n6xapebe}/mantine-react-table/locales/de/index.mjs +0 -0
- /package/dist/.external/esm/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._v6brefjjgmgbqbolvm3v6bkbsa → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ndh5vv3rq66ztxn2u3n6xapebe}/mantine-react-table/locales/en/index.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/I18nextProvider.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/context.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/defaults.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/i18nInstance.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/initReactI18next.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/unescape.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/useTranslation.mjs +0 -0
- /package/dist/.external/esm/{react-i18next@15.7.4_i18next@25.6.0_react-dom@18.3.1_react@18.3.1_typescript@5.9.3 → react-i18next@15.7.4_i18next@25.6.2_react-dom@18.3.1_react@18.3.1_typescript@5.9.3}/react-i18next/dist/es/utils.mjs +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const thenable = require("./thenable.cjs");
|
|
4
|
+
const utils = require("./utils.cjs");
|
|
5
|
+
function defaultTransformerFn(data) {
|
|
6
|
+
return data;
|
|
7
|
+
}
|
|
8
|
+
function dehydrateMutation(mutation) {
|
|
9
|
+
return {
|
|
10
|
+
mutationKey: mutation.options.mutationKey,
|
|
11
|
+
state: mutation.state,
|
|
12
|
+
...mutation.options.scope && { scope: mutation.options.scope },
|
|
13
|
+
...mutation.meta && { meta: mutation.meta }
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function dehydrateQuery(query, serializeData, shouldRedactErrors) {
|
|
17
|
+
const dehydratePromise = () => {
|
|
18
|
+
var _a;
|
|
19
|
+
const promise = (_a = query.promise) == null ? void 0 : _a.then(serializeData).catch((error) => {
|
|
20
|
+
if (!shouldRedactErrors(error)) {
|
|
21
|
+
return Promise.reject(error);
|
|
22
|
+
}
|
|
23
|
+
if (process.env.NODE_ENV !== "production") {
|
|
24
|
+
console.error(
|
|
25
|
+
`A query that was dehydrated as pending ended up rejecting. [${query.queryHash}]: ${error}; The error will be redacted in production builds`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return Promise.reject(new Error("redacted"));
|
|
29
|
+
});
|
|
30
|
+
promise == null ? void 0 : promise.catch(utils.noop);
|
|
31
|
+
return promise;
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
dehydratedAt: Date.now(),
|
|
35
|
+
state: {
|
|
36
|
+
...query.state,
|
|
37
|
+
...query.state.data !== void 0 && {
|
|
38
|
+
data: serializeData(query.state.data)
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
queryKey: query.queryKey,
|
|
42
|
+
queryHash: query.queryHash,
|
|
43
|
+
...query.state.status === "pending" && {
|
|
44
|
+
promise: dehydratePromise()
|
|
45
|
+
},
|
|
46
|
+
...query.meta && { meta: query.meta }
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function defaultShouldDehydrateMutation(mutation) {
|
|
50
|
+
return mutation.state.isPaused;
|
|
51
|
+
}
|
|
52
|
+
function defaultShouldDehydrateQuery(query) {
|
|
53
|
+
return query.state.status === "success";
|
|
54
|
+
}
|
|
55
|
+
function defaultShouldRedactErrors(_) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
function dehydrate(client, options = {}) {
|
|
59
|
+
var _a, _b, _c, _d;
|
|
60
|
+
const filterMutation = options.shouldDehydrateMutation ?? ((_a = client.getDefaultOptions().dehydrate) == null ? void 0 : _a.shouldDehydrateMutation) ?? defaultShouldDehydrateMutation;
|
|
61
|
+
const mutations = client.getMutationCache().getAll().flatMap(
|
|
62
|
+
(mutation) => filterMutation(mutation) ? [dehydrateMutation(mutation)] : []
|
|
63
|
+
);
|
|
64
|
+
const filterQuery = options.shouldDehydrateQuery ?? ((_b = client.getDefaultOptions().dehydrate) == null ? void 0 : _b.shouldDehydrateQuery) ?? defaultShouldDehydrateQuery;
|
|
65
|
+
const shouldRedactErrors = options.shouldRedactErrors ?? ((_c = client.getDefaultOptions().dehydrate) == null ? void 0 : _c.shouldRedactErrors) ?? defaultShouldRedactErrors;
|
|
66
|
+
const serializeData = options.serializeData ?? ((_d = client.getDefaultOptions().dehydrate) == null ? void 0 : _d.serializeData) ?? defaultTransformerFn;
|
|
67
|
+
const queries = client.getQueryCache().getAll().flatMap(
|
|
68
|
+
(query) => filterQuery(query) ? [dehydrateQuery(query, serializeData, shouldRedactErrors)] : []
|
|
69
|
+
);
|
|
70
|
+
return { mutations, queries };
|
|
71
|
+
}
|
|
72
|
+
function hydrate(client, dehydratedState, options) {
|
|
73
|
+
var _a, _b;
|
|
74
|
+
if (typeof dehydratedState !== "object" || dehydratedState === null) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const mutationCache = client.getMutationCache();
|
|
78
|
+
const queryCache = client.getQueryCache();
|
|
79
|
+
const deserializeData = ((_a = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _a.deserializeData) ?? ((_b = client.getDefaultOptions().hydrate) == null ? void 0 : _b.deserializeData) ?? defaultTransformerFn;
|
|
80
|
+
const mutations = dehydratedState.mutations || [];
|
|
81
|
+
const queries = dehydratedState.queries || [];
|
|
82
|
+
mutations.forEach(({ state, ...mutationOptions }) => {
|
|
83
|
+
var _a2, _b2;
|
|
84
|
+
mutationCache.build(
|
|
85
|
+
client,
|
|
86
|
+
{
|
|
87
|
+
...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.mutations,
|
|
88
|
+
...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.mutations,
|
|
89
|
+
...mutationOptions
|
|
90
|
+
},
|
|
91
|
+
state
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
queries.forEach(
|
|
95
|
+
({ queryKey, state, queryHash, meta, promise, dehydratedAt }) => {
|
|
96
|
+
var _a2, _b2;
|
|
97
|
+
const syncData = promise ? thenable.tryResolveSync(promise) : void 0;
|
|
98
|
+
const rawData = state.data === void 0 ? syncData == null ? void 0 : syncData.data : state.data;
|
|
99
|
+
const data = rawData === void 0 ? rawData : deserializeData(rawData);
|
|
100
|
+
let query = queryCache.get(queryHash);
|
|
101
|
+
const existingQueryIsPending = (query == null ? void 0 : query.state.status) === "pending";
|
|
102
|
+
const existingQueryIsFetching = (query == null ? void 0 : query.state.fetchStatus) === "fetching";
|
|
103
|
+
if (query) {
|
|
104
|
+
const hasNewerSyncData = syncData && // We only need this undefined check to handle older dehydration
|
|
105
|
+
// payloads that might not have dehydratedAt
|
|
106
|
+
dehydratedAt !== void 0 && dehydratedAt > query.state.dataUpdatedAt;
|
|
107
|
+
if (state.dataUpdatedAt > query.state.dataUpdatedAt || hasNewerSyncData) {
|
|
108
|
+
const { fetchStatus: _ignored, ...serializedState } = state;
|
|
109
|
+
query.setState({
|
|
110
|
+
...serializedState,
|
|
111
|
+
data
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
} else {
|
|
115
|
+
query = queryCache.build(
|
|
116
|
+
client,
|
|
117
|
+
{
|
|
118
|
+
...(_a2 = client.getDefaultOptions().hydrate) == null ? void 0 : _a2.queries,
|
|
119
|
+
...(_b2 = options == null ? void 0 : options.defaultOptions) == null ? void 0 : _b2.queries,
|
|
120
|
+
queryKey,
|
|
121
|
+
queryHash,
|
|
122
|
+
meta
|
|
123
|
+
},
|
|
124
|
+
// Reset fetch status to idle to avoid
|
|
125
|
+
// query being stuck in fetching state upon hydration
|
|
126
|
+
{
|
|
127
|
+
...state,
|
|
128
|
+
data,
|
|
129
|
+
fetchStatus: "idle",
|
|
130
|
+
status: data !== void 0 ? "success" : state.status
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
if (promise && !existingQueryIsPending && !existingQueryIsFetching && // Only hydrate if dehydration is newer than any existing data,
|
|
135
|
+
// this is always true for new queries
|
|
136
|
+
(dehydratedAt === void 0 || dehydratedAt > query.state.dataUpdatedAt)) {
|
|
137
|
+
query.fetch(void 0, {
|
|
138
|
+
// RSC transformed promises are not thenable
|
|
139
|
+
initialPromise: Promise.resolve(promise).then(deserializeData)
|
|
140
|
+
}).catch(utils.noop);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
exports.defaultShouldDehydrateMutation = defaultShouldDehydrateMutation;
|
|
146
|
+
exports.defaultShouldDehydrateQuery = defaultShouldDehydrateQuery;
|
|
147
|
+
exports.dehydrate = dehydrate;
|
|
148
|
+
exports.hydrate = hydrate;
|
|
@@ -112,4 +112,14 @@ function getPreviousPageParam(options, { pages, pageParams }) {
|
|
|
112
112
|
var _a;
|
|
113
113
|
return pages.length > 0 ? (_a = options.getPreviousPageParam) == null ? void 0 : _a.call(options, pages[0], pages, pageParams[0], pageParams) : void 0;
|
|
114
114
|
}
|
|
115
|
+
function hasNextPage(options, data) {
|
|
116
|
+
if (!data) return false;
|
|
117
|
+
return getNextPageParam(options, data) != null;
|
|
118
|
+
}
|
|
119
|
+
function hasPreviousPage(options, data) {
|
|
120
|
+
if (!data || !options.getPreviousPageParam) return false;
|
|
121
|
+
return getPreviousPageParam(options, data) != null;
|
|
122
|
+
}
|
|
123
|
+
exports.hasNextPage = hasNextPage;
|
|
124
|
+
exports.hasPreviousPage = hasPreviousPage;
|
|
115
125
|
exports.infiniteQueryBehavior = infiniteQueryBehavior;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const queryObserver = require("./queryObserver.cjs");
|
|
4
|
+
const infiniteQueryBehavior = require("./infiniteQueryBehavior.cjs");
|
|
5
|
+
var InfiniteQueryObserver = class extends queryObserver.QueryObserver {
|
|
6
|
+
constructor(client, options) {
|
|
7
|
+
super(client, options);
|
|
8
|
+
}
|
|
9
|
+
bindMethods() {
|
|
10
|
+
super.bindMethods();
|
|
11
|
+
this.fetchNextPage = this.fetchNextPage.bind(this);
|
|
12
|
+
this.fetchPreviousPage = this.fetchPreviousPage.bind(this);
|
|
13
|
+
}
|
|
14
|
+
setOptions(options) {
|
|
15
|
+
super.setOptions({
|
|
16
|
+
...options,
|
|
17
|
+
behavior: infiniteQueryBehavior.infiniteQueryBehavior()
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
getOptimisticResult(options) {
|
|
21
|
+
options.behavior = infiniteQueryBehavior.infiniteQueryBehavior();
|
|
22
|
+
return super.getOptimisticResult(options);
|
|
23
|
+
}
|
|
24
|
+
fetchNextPage(options) {
|
|
25
|
+
return this.fetch({
|
|
26
|
+
...options,
|
|
27
|
+
meta: {
|
|
28
|
+
fetchMore: { direction: "forward" }
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
fetchPreviousPage(options) {
|
|
33
|
+
return this.fetch({
|
|
34
|
+
...options,
|
|
35
|
+
meta: {
|
|
36
|
+
fetchMore: { direction: "backward" }
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
createResult(query, options) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
const { state } = query;
|
|
43
|
+
const parentResult = super.createResult(query, options);
|
|
44
|
+
const { isFetching, isRefetching, isError, isRefetchError } = parentResult;
|
|
45
|
+
const fetchDirection = (_b = (_a = state.fetchMeta) == null ? void 0 : _a.fetchMore) == null ? void 0 : _b.direction;
|
|
46
|
+
const isFetchNextPageError = isError && fetchDirection === "forward";
|
|
47
|
+
const isFetchingNextPage = isFetching && fetchDirection === "forward";
|
|
48
|
+
const isFetchPreviousPageError = isError && fetchDirection === "backward";
|
|
49
|
+
const isFetchingPreviousPage = isFetching && fetchDirection === "backward";
|
|
50
|
+
const result = {
|
|
51
|
+
...parentResult,
|
|
52
|
+
fetchNextPage: this.fetchNextPage,
|
|
53
|
+
fetchPreviousPage: this.fetchPreviousPage,
|
|
54
|
+
hasNextPage: infiniteQueryBehavior.hasNextPage(options, state.data),
|
|
55
|
+
hasPreviousPage: infiniteQueryBehavior.hasPreviousPage(options, state.data),
|
|
56
|
+
isFetchNextPageError,
|
|
57
|
+
isFetchingNextPage,
|
|
58
|
+
isFetchPreviousPageError,
|
|
59
|
+
isFetchingPreviousPage,
|
|
60
|
+
isRefetchError: isRefetchError && !isFetchNextPageError && !isFetchPreviousPageError,
|
|
61
|
+
isRefetching: isRefetching && !isFetchingNextPage && !isFetchingPreviousPage
|
|
62
|
+
};
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
exports.InfiniteQueryObserver = InfiniteQueryObserver;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
4
|
+
};
|
|
5
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
6
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
7
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
8
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
9
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
10
|
+
var _client, _currentResult, _currentMutation, _mutateOptions, _MutationObserver_instances, updateResult_fn, notify_fn, _a;
|
|
11
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
12
|
+
const mutation = require("./mutation.cjs");
|
|
13
|
+
const notifyManager = require("./notifyManager.cjs");
|
|
14
|
+
const subscribable = require("./subscribable.cjs");
|
|
15
|
+
const utils = require("./utils.cjs");
|
|
16
|
+
var MutationObserver = (_a = class extends subscribable.Subscribable {
|
|
17
|
+
constructor(client, options) {
|
|
18
|
+
super();
|
|
19
|
+
__privateAdd(this, _MutationObserver_instances);
|
|
20
|
+
__privateAdd(this, _client);
|
|
21
|
+
__privateAdd(this, _currentResult);
|
|
22
|
+
__privateAdd(this, _currentMutation);
|
|
23
|
+
__privateAdd(this, _mutateOptions);
|
|
24
|
+
__privateSet(this, _client, client);
|
|
25
|
+
this.setOptions(options);
|
|
26
|
+
this.bindMethods();
|
|
27
|
+
__privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this);
|
|
28
|
+
}
|
|
29
|
+
bindMethods() {
|
|
30
|
+
this.mutate = this.mutate.bind(this);
|
|
31
|
+
this.reset = this.reset.bind(this);
|
|
32
|
+
}
|
|
33
|
+
setOptions(options) {
|
|
34
|
+
var _a2;
|
|
35
|
+
const prevOptions = this.options;
|
|
36
|
+
this.options = __privateGet(this, _client).defaultMutationOptions(options);
|
|
37
|
+
if (!utils.shallowEqualObjects(this.options, prevOptions)) {
|
|
38
|
+
__privateGet(this, _client).getMutationCache().notify({
|
|
39
|
+
type: "observerOptionsUpdated",
|
|
40
|
+
mutation: __privateGet(this, _currentMutation),
|
|
41
|
+
observer: this
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if ((prevOptions == null ? void 0 : prevOptions.mutationKey) && this.options.mutationKey && utils.hashKey(prevOptions.mutationKey) !== utils.hashKey(this.options.mutationKey)) {
|
|
45
|
+
this.reset();
|
|
46
|
+
} else if (((_a2 = __privateGet(this, _currentMutation)) == null ? void 0 : _a2.state.status) === "pending") {
|
|
47
|
+
__privateGet(this, _currentMutation).setOptions(this.options);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
onUnsubscribe() {
|
|
51
|
+
var _a2;
|
|
52
|
+
if (!this.hasListeners()) {
|
|
53
|
+
(_a2 = __privateGet(this, _currentMutation)) == null ? void 0 : _a2.removeObserver(this);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
onMutationUpdate(action) {
|
|
57
|
+
__privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this);
|
|
58
|
+
__privateMethod(this, _MutationObserver_instances, notify_fn).call(this, action);
|
|
59
|
+
}
|
|
60
|
+
getCurrentResult() {
|
|
61
|
+
return __privateGet(this, _currentResult);
|
|
62
|
+
}
|
|
63
|
+
reset() {
|
|
64
|
+
var _a2;
|
|
65
|
+
(_a2 = __privateGet(this, _currentMutation)) == null ? void 0 : _a2.removeObserver(this);
|
|
66
|
+
__privateSet(this, _currentMutation, void 0);
|
|
67
|
+
__privateMethod(this, _MutationObserver_instances, updateResult_fn).call(this);
|
|
68
|
+
__privateMethod(this, _MutationObserver_instances, notify_fn).call(this);
|
|
69
|
+
}
|
|
70
|
+
mutate(variables, options) {
|
|
71
|
+
var _a2;
|
|
72
|
+
__privateSet(this, _mutateOptions, options);
|
|
73
|
+
(_a2 = __privateGet(this, _currentMutation)) == null ? void 0 : _a2.removeObserver(this);
|
|
74
|
+
__privateSet(this, _currentMutation, __privateGet(this, _client).getMutationCache().build(__privateGet(this, _client), this.options));
|
|
75
|
+
__privateGet(this, _currentMutation).addObserver(this);
|
|
76
|
+
return __privateGet(this, _currentMutation).execute(variables);
|
|
77
|
+
}
|
|
78
|
+
}, _client = new WeakMap(), _currentResult = new WeakMap(), _currentMutation = new WeakMap(), _mutateOptions = new WeakMap(), _MutationObserver_instances = new WeakSet(), updateResult_fn = function() {
|
|
79
|
+
var _a2;
|
|
80
|
+
const state = ((_a2 = __privateGet(this, _currentMutation)) == null ? void 0 : _a2.state) ?? mutation.getDefaultState();
|
|
81
|
+
__privateSet(this, _currentResult, {
|
|
82
|
+
...state,
|
|
83
|
+
isPending: state.status === "pending",
|
|
84
|
+
isSuccess: state.status === "success",
|
|
85
|
+
isError: state.status === "error",
|
|
86
|
+
isIdle: state.status === "idle",
|
|
87
|
+
mutate: this.mutate,
|
|
88
|
+
reset: this.reset
|
|
89
|
+
});
|
|
90
|
+
}, notify_fn = function(action) {
|
|
91
|
+
notifyManager.notifyManager.batch(() => {
|
|
92
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
93
|
+
if (__privateGet(this, _mutateOptions) && this.hasListeners()) {
|
|
94
|
+
const variables = __privateGet(this, _currentResult).variables;
|
|
95
|
+
const onMutateResult = __privateGet(this, _currentResult).context;
|
|
96
|
+
const context = {
|
|
97
|
+
client: __privateGet(this, _client),
|
|
98
|
+
meta: this.options.meta,
|
|
99
|
+
mutationKey: this.options.mutationKey
|
|
100
|
+
};
|
|
101
|
+
if ((action == null ? void 0 : action.type) === "success") {
|
|
102
|
+
(_b = (_a2 = __privateGet(this, _mutateOptions)).onSuccess) == null ? void 0 : _b.call(
|
|
103
|
+
_a2,
|
|
104
|
+
action.data,
|
|
105
|
+
variables,
|
|
106
|
+
onMutateResult,
|
|
107
|
+
context
|
|
108
|
+
);
|
|
109
|
+
(_d = (_c = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _d.call(
|
|
110
|
+
_c,
|
|
111
|
+
action.data,
|
|
112
|
+
null,
|
|
113
|
+
variables,
|
|
114
|
+
onMutateResult,
|
|
115
|
+
context
|
|
116
|
+
);
|
|
117
|
+
} else if ((action == null ? void 0 : action.type) === "error") {
|
|
118
|
+
(_f = (_e = __privateGet(this, _mutateOptions)).onError) == null ? void 0 : _f.call(
|
|
119
|
+
_e,
|
|
120
|
+
action.error,
|
|
121
|
+
variables,
|
|
122
|
+
onMutateResult,
|
|
123
|
+
context
|
|
124
|
+
);
|
|
125
|
+
(_h = (_g = __privateGet(this, _mutateOptions)).onSettled) == null ? void 0 : _h.call(
|
|
126
|
+
_g,
|
|
127
|
+
void 0,
|
|
128
|
+
action.error,
|
|
129
|
+
variables,
|
|
130
|
+
onMutateResult,
|
|
131
|
+
context
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
this.listeners.forEach((listener) => {
|
|
136
|
+
listener(__privateGet(this, _currentResult));
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
}, _a);
|
|
140
|
+
exports.MutationObserver = MutationObserver;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
4
|
+
};
|
|
5
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
6
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
7
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
8
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
9
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
10
|
+
var _client, _result, _queries, _options, _observers, _combinedResult, _lastCombine, _lastResult, _observerMatches, _QueriesObserver_instances, trackResult_fn, combineResult_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn, _a;
|
|
11
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
12
|
+
const notifyManager = require("./notifyManager.cjs");
|
|
13
|
+
const queryObserver = require("./queryObserver.cjs");
|
|
14
|
+
const subscribable = require("./subscribable.cjs");
|
|
15
|
+
const utils = require("./utils.cjs");
|
|
16
|
+
function difference(array1, array2) {
|
|
17
|
+
const excludeSet = new Set(array2);
|
|
18
|
+
return array1.filter((x) => !excludeSet.has(x));
|
|
19
|
+
}
|
|
20
|
+
function replaceAt(array, index, value) {
|
|
21
|
+
const copy = array.slice(0);
|
|
22
|
+
copy[index] = value;
|
|
23
|
+
return copy;
|
|
24
|
+
}
|
|
25
|
+
var QueriesObserver = (_a = class extends subscribable.Subscribable {
|
|
26
|
+
constructor(client, queries, options) {
|
|
27
|
+
super();
|
|
28
|
+
__privateAdd(this, _QueriesObserver_instances);
|
|
29
|
+
__privateAdd(this, _client);
|
|
30
|
+
__privateAdd(this, _result);
|
|
31
|
+
__privateAdd(this, _queries);
|
|
32
|
+
__privateAdd(this, _options);
|
|
33
|
+
__privateAdd(this, _observers);
|
|
34
|
+
__privateAdd(this, _combinedResult);
|
|
35
|
+
__privateAdd(this, _lastCombine);
|
|
36
|
+
__privateAdd(this, _lastResult);
|
|
37
|
+
__privateAdd(this, _observerMatches, []);
|
|
38
|
+
__privateSet(this, _client, client);
|
|
39
|
+
__privateSet(this, _options, options);
|
|
40
|
+
__privateSet(this, _queries, []);
|
|
41
|
+
__privateSet(this, _observers, []);
|
|
42
|
+
__privateSet(this, _result, []);
|
|
43
|
+
this.setQueries(queries);
|
|
44
|
+
}
|
|
45
|
+
onSubscribe() {
|
|
46
|
+
if (this.listeners.size === 1) {
|
|
47
|
+
__privateGet(this, _observers).forEach((observer) => {
|
|
48
|
+
observer.subscribe((result) => {
|
|
49
|
+
__privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
onUnsubscribe() {
|
|
55
|
+
if (!this.listeners.size) {
|
|
56
|
+
this.destroy();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
destroy() {
|
|
60
|
+
this.listeners = /* @__PURE__ */ new Set();
|
|
61
|
+
__privateGet(this, _observers).forEach((observer) => {
|
|
62
|
+
observer.destroy();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
setQueries(queries, options) {
|
|
66
|
+
__privateSet(this, _queries, queries);
|
|
67
|
+
__privateSet(this, _options, options);
|
|
68
|
+
if (process.env.NODE_ENV !== "production") {
|
|
69
|
+
const queryHashes = queries.map(
|
|
70
|
+
(query) => __privateGet(this, _client).defaultQueryOptions(query).queryHash
|
|
71
|
+
);
|
|
72
|
+
if (new Set(queryHashes).size !== queryHashes.length) {
|
|
73
|
+
console.warn(
|
|
74
|
+
"[QueriesObserver]: Duplicate Queries found. This might result in unexpected behavior."
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
notifyManager.notifyManager.batch(() => {
|
|
79
|
+
const prevObservers = __privateGet(this, _observers);
|
|
80
|
+
const newObserverMatches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, __privateGet(this, _queries));
|
|
81
|
+
__privateSet(this, _observerMatches, newObserverMatches);
|
|
82
|
+
newObserverMatches.forEach(
|
|
83
|
+
(match) => match.observer.setOptions(match.defaultedQueryOptions)
|
|
84
|
+
);
|
|
85
|
+
const newObservers = newObserverMatches.map((match) => match.observer);
|
|
86
|
+
const newResult = newObservers.map(
|
|
87
|
+
(observer) => observer.getCurrentResult()
|
|
88
|
+
);
|
|
89
|
+
const hasLengthChange = prevObservers.length !== newObservers.length;
|
|
90
|
+
const hasIndexChange = newObservers.some(
|
|
91
|
+
(observer, index) => observer !== prevObservers[index]
|
|
92
|
+
);
|
|
93
|
+
const hasStructuralChange = hasLengthChange || hasIndexChange;
|
|
94
|
+
const hasResultChange = hasStructuralChange ? true : newResult.some((result, index) => {
|
|
95
|
+
const prev = __privateGet(this, _result)[index];
|
|
96
|
+
return !prev || !utils.shallowEqualObjects(result, prev);
|
|
97
|
+
});
|
|
98
|
+
if (!hasStructuralChange && !hasResultChange) return;
|
|
99
|
+
if (hasStructuralChange) {
|
|
100
|
+
__privateSet(this, _observers, newObservers);
|
|
101
|
+
}
|
|
102
|
+
__privateSet(this, _result, newResult);
|
|
103
|
+
if (!this.hasListeners()) return;
|
|
104
|
+
if (hasStructuralChange) {
|
|
105
|
+
difference(prevObservers, newObservers).forEach((observer) => {
|
|
106
|
+
observer.destroy();
|
|
107
|
+
});
|
|
108
|
+
difference(newObservers, prevObservers).forEach((observer) => {
|
|
109
|
+
observer.subscribe((result) => {
|
|
110
|
+
__privateMethod(this, _QueriesObserver_instances, onUpdate_fn).call(this, observer, result);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
__privateMethod(this, _QueriesObserver_instances, notify_fn).call(this);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
getCurrentResult() {
|
|
118
|
+
return __privateGet(this, _result);
|
|
119
|
+
}
|
|
120
|
+
getQueries() {
|
|
121
|
+
return __privateGet(this, _observers).map((observer) => observer.getCurrentQuery());
|
|
122
|
+
}
|
|
123
|
+
getObservers() {
|
|
124
|
+
return __privateGet(this, _observers);
|
|
125
|
+
}
|
|
126
|
+
getOptimisticResult(queries, combine) {
|
|
127
|
+
const matches = __privateMethod(this, _QueriesObserver_instances, findMatchingObservers_fn).call(this, queries);
|
|
128
|
+
const result = matches.map(
|
|
129
|
+
(match) => match.observer.getOptimisticResult(match.defaultedQueryOptions)
|
|
130
|
+
);
|
|
131
|
+
return [
|
|
132
|
+
result,
|
|
133
|
+
(r) => {
|
|
134
|
+
return __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, r ?? result, combine);
|
|
135
|
+
},
|
|
136
|
+
() => {
|
|
137
|
+
return __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, result, matches);
|
|
138
|
+
}
|
|
139
|
+
];
|
|
140
|
+
}
|
|
141
|
+
}, _client = new WeakMap(), _result = new WeakMap(), _queries = new WeakMap(), _options = new WeakMap(), _observers = new WeakMap(), _combinedResult = new WeakMap(), _lastCombine = new WeakMap(), _lastResult = new WeakMap(), _observerMatches = new WeakMap(), _QueriesObserver_instances = new WeakSet(), trackResult_fn = function(result, matches) {
|
|
142
|
+
return matches.map((match, index) => {
|
|
143
|
+
const observerResult = result[index];
|
|
144
|
+
return !match.defaultedQueryOptions.notifyOnChangeProps ? match.observer.trackResult(observerResult, (accessedProp) => {
|
|
145
|
+
matches.forEach((m) => {
|
|
146
|
+
m.observer.trackProp(accessedProp);
|
|
147
|
+
});
|
|
148
|
+
}) : observerResult;
|
|
149
|
+
});
|
|
150
|
+
}, combineResult_fn = function(input, combine) {
|
|
151
|
+
if (combine) {
|
|
152
|
+
if (!__privateGet(this, _combinedResult) || __privateGet(this, _result) !== __privateGet(this, _lastResult) || combine !== __privateGet(this, _lastCombine)) {
|
|
153
|
+
__privateSet(this, _lastCombine, combine);
|
|
154
|
+
__privateSet(this, _lastResult, __privateGet(this, _result));
|
|
155
|
+
__privateSet(this, _combinedResult, utils.replaceEqualDeep(
|
|
156
|
+
__privateGet(this, _combinedResult),
|
|
157
|
+
combine(input)
|
|
158
|
+
));
|
|
159
|
+
}
|
|
160
|
+
return __privateGet(this, _combinedResult);
|
|
161
|
+
}
|
|
162
|
+
return input;
|
|
163
|
+
}, findMatchingObservers_fn = function(queries) {
|
|
164
|
+
const prevObserversMap = new Map(
|
|
165
|
+
__privateGet(this, _observers).map((observer) => [observer.options.queryHash, observer])
|
|
166
|
+
);
|
|
167
|
+
const observers = [];
|
|
168
|
+
queries.forEach((options) => {
|
|
169
|
+
const defaultedOptions = __privateGet(this, _client).defaultQueryOptions(options);
|
|
170
|
+
const match = prevObserversMap.get(defaultedOptions.queryHash);
|
|
171
|
+
if (match) {
|
|
172
|
+
observers.push({
|
|
173
|
+
defaultedQueryOptions: defaultedOptions,
|
|
174
|
+
observer: match
|
|
175
|
+
});
|
|
176
|
+
} else {
|
|
177
|
+
observers.push({
|
|
178
|
+
defaultedQueryOptions: defaultedOptions,
|
|
179
|
+
observer: new queryObserver.QueryObserver(__privateGet(this, _client), defaultedOptions)
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return observers;
|
|
184
|
+
}, onUpdate_fn = function(observer, result) {
|
|
185
|
+
const index = __privateGet(this, _observers).indexOf(observer);
|
|
186
|
+
if (index !== -1) {
|
|
187
|
+
__privateSet(this, _result, replaceAt(__privateGet(this, _result), index, result));
|
|
188
|
+
__privateMethod(this, _QueriesObserver_instances, notify_fn).call(this);
|
|
189
|
+
}
|
|
190
|
+
}, notify_fn = function() {
|
|
191
|
+
var _a2;
|
|
192
|
+
if (this.hasListeners()) {
|
|
193
|
+
const previousResult = __privateGet(this, _combinedResult);
|
|
194
|
+
const newTracked = __privateMethod(this, _QueriesObserver_instances, trackResult_fn).call(this, __privateGet(this, _result), __privateGet(this, _observerMatches));
|
|
195
|
+
const newResult = __privateMethod(this, _QueriesObserver_instances, combineResult_fn).call(this, newTracked, (_a2 = __privateGet(this, _options)) == null ? void 0 : _a2.combine);
|
|
196
|
+
if (previousResult !== newResult) {
|
|
197
|
+
notifyManager.notifyManager.batch(() => {
|
|
198
|
+
this.listeners.forEach((listener) => {
|
|
199
|
+
listener(__privateGet(this, _result));
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}, _a);
|
|
205
|
+
exports.QueriesObserver = QueriesObserver;
|
|
@@ -49,10 +49,9 @@ var Query = (_a = class extends removable.Removable {
|
|
|
49
49
|
if (this.state && this.state.data === void 0) {
|
|
50
50
|
const defaultState = getDefaultState(this.options);
|
|
51
51
|
if (defaultState.data !== void 0) {
|
|
52
|
-
this.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
52
|
+
this.setState(
|
|
53
|
+
successState(defaultState.data, defaultState.dataUpdatedAt)
|
|
54
|
+
);
|
|
56
55
|
__privateSet(this, _initialState, defaultState);
|
|
57
56
|
}
|
|
58
57
|
}
|
|
@@ -354,12 +353,8 @@ var Query = (_a = class extends removable.Removable {
|
|
|
354
353
|
case "success":
|
|
355
354
|
const newState = {
|
|
356
355
|
...state,
|
|
357
|
-
data
|
|
356
|
+
...successState(action.data, action.dataUpdatedAt),
|
|
358
357
|
dataUpdateCount: state.dataUpdateCount + 1,
|
|
359
|
-
dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),
|
|
360
|
-
error: null,
|
|
361
|
-
isInvalidated: false,
|
|
362
|
-
status: "success",
|
|
363
358
|
...!action.manual && {
|
|
364
359
|
fetchStatus: "idle",
|
|
365
360
|
fetchFailureCount: 0,
|
|
@@ -411,6 +406,15 @@ function fetchState(data, options) {
|
|
|
411
406
|
}
|
|
412
407
|
};
|
|
413
408
|
}
|
|
409
|
+
function successState(data, dataUpdatedAt) {
|
|
410
|
+
return {
|
|
411
|
+
data,
|
|
412
|
+
dataUpdatedAt: dataUpdatedAt ?? Date.now(),
|
|
413
|
+
error: null,
|
|
414
|
+
isInvalidated: false,
|
|
415
|
+
status: "success"
|
|
416
|
+
};
|
|
417
|
+
}
|
|
414
418
|
function getDefaultState(options) {
|
|
415
419
|
const data = typeof options.initialData === "function" ? options.initialData() : options.initialData;
|
|
416
420
|
const hasData = data !== void 0;
|
|
@@ -17,6 +17,9 @@ var CancelledError = class extends Error {
|
|
|
17
17
|
this.silent = options == null ? void 0 : options.silent;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
+
function isCancelledError(value) {
|
|
21
|
+
return value instanceof CancelledError;
|
|
22
|
+
}
|
|
20
23
|
function createRetryer(config) {
|
|
21
24
|
let isRetryCancelled = false;
|
|
22
25
|
let failureCount = 0;
|
|
@@ -129,3 +132,4 @@ function createRetryer(config) {
|
|
|
129
132
|
exports.CancelledError = CancelledError;
|
|
130
133
|
exports.canFetch = canFetch;
|
|
131
134
|
exports.createRetryer = createRetryer;
|
|
135
|
+
exports.isCancelledError = isCancelledError;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const utils = require("./utils.cjs");
|
|
4
|
+
function streamedQuery({
|
|
5
|
+
streamFn,
|
|
6
|
+
refetchMode = "reset",
|
|
7
|
+
reducer = (items, chunk) => utils.addToEnd(items, chunk),
|
|
8
|
+
initialValue = []
|
|
9
|
+
}) {
|
|
10
|
+
return async (context) => {
|
|
11
|
+
const query = context.client.getQueryCache().find({ queryKey: context.queryKey, exact: true });
|
|
12
|
+
const isRefetch = !!query && query.state.data !== void 0;
|
|
13
|
+
if (isRefetch && refetchMode === "reset") {
|
|
14
|
+
query.setState({
|
|
15
|
+
status: "pending",
|
|
16
|
+
data: void 0,
|
|
17
|
+
error: null,
|
|
18
|
+
fetchStatus: "fetching"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
let result = initialValue;
|
|
22
|
+
const stream = await streamFn(context);
|
|
23
|
+
for await (const chunk of stream) {
|
|
24
|
+
if (context.signal.aborted) {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
if (!isRefetch || refetchMode !== "replace") {
|
|
28
|
+
context.client.setQueryData(
|
|
29
|
+
context.queryKey,
|
|
30
|
+
(prev) => reducer(prev === void 0 ? initialValue : prev, chunk)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
result = reducer(result, chunk);
|
|
34
|
+
}
|
|
35
|
+
if (isRefetch && refetchMode === "replace" && !context.signal.aborted) {
|
|
36
|
+
context.client.setQueryData(context.queryKey, result);
|
|
37
|
+
}
|
|
38
|
+
return context.client.getQueryData(context.queryKey);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
exports.streamedQuery = streamedQuery;
|