@openapi-qraft/react 1.11.0-beta.1 → 1.11.0-beta.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/CHANGELOG.md +12 -0
- package/dist/cjs/QraftContext.js +31 -0
- package/dist/cjs/QraftContext.js.map +1 -0
- package/dist/cjs/ServiceOperation.js +17 -0
- package/dist/cjs/ServiceOperation.js.map +1 -0
- package/dist/cjs/Unstable_QraftSecureRequestFn.js +214 -0
- package/dist/cjs/Unstable_QraftSecureRequestFn.js.map +1 -0
- package/dist/cjs/callbacks/cancelQueries.js +36 -0
- package/dist/cjs/callbacks/cancelQueries.js.map +1 -0
- package/dist/cjs/callbacks/fetchInfiniteQuery.js +37 -0
- package/dist/cjs/callbacks/fetchInfiniteQuery.js.map +1 -0
- package/dist/cjs/callbacks/fetchQuery.js +37 -0
- package/dist/cjs/callbacks/fetchQuery.js.map +1 -0
- package/dist/cjs/callbacks/getInfiniteQueryData.js +37 -0
- package/dist/cjs/callbacks/getInfiniteQueryData.js.map +1 -0
- package/dist/cjs/callbacks/getInfiniteQueryKey.js +32 -0
- package/dist/cjs/callbacks/getInfiniteQueryKey.js.map +1 -0
- package/dist/cjs/callbacks/getInfiniteQueryState.js +37 -0
- package/dist/cjs/callbacks/getInfiniteQueryState.js.map +1 -0
- package/dist/cjs/callbacks/getMutationKey.js +32 -0
- package/dist/cjs/callbacks/getMutationKey.js.map +1 -0
- package/dist/cjs/callbacks/getQueriesData.js +36 -0
- package/dist/cjs/callbacks/getQueriesData.js.map +1 -0
- package/dist/cjs/callbacks/getQueryData.js +37 -0
- package/dist/cjs/callbacks/getQueryData.js.map +1 -0
- package/dist/cjs/callbacks/getQueryKey.js +32 -0
- package/dist/cjs/callbacks/getQueryKey.js.map +1 -0
- package/dist/cjs/callbacks/getQueryState.js +37 -0
- package/dist/cjs/callbacks/getQueryState.js.map +1 -0
- package/dist/cjs/callbacks/index.js +131 -0
- package/dist/cjs/callbacks/index.js.map +1 -0
- package/dist/cjs/callbacks/invalidateQueries.js +36 -0
- package/dist/cjs/callbacks/invalidateQueries.js.map +1 -0
- package/dist/cjs/callbacks/isFetching.js +36 -0
- package/dist/cjs/callbacks/isFetching.js.map +1 -0
- package/dist/cjs/callbacks/isMutating.js +36 -0
- package/dist/cjs/callbacks/isMutating.js.map +1 -0
- package/dist/cjs/callbacks/mutationFn.js +35 -0
- package/dist/cjs/callbacks/mutationFn.js.map +1 -0
- package/dist/cjs/callbacks/operationInvokeFn.js +41 -0
- package/dist/cjs/callbacks/operationInvokeFn.js.map +1 -0
- package/dist/cjs/callbacks/prefetchInfiniteQuery.js +37 -0
- package/dist/cjs/callbacks/prefetchInfiniteQuery.js.map +1 -0
- package/dist/cjs/callbacks/prefetchQuery.js +37 -0
- package/dist/cjs/callbacks/prefetchQuery.js.map +1 -0
- package/dist/cjs/callbacks/queryFn.js +39 -0
- package/dist/cjs/callbacks/queryFn.js.map +1 -0
- package/dist/cjs/callbacks/refetchQueries.js +36 -0
- package/dist/cjs/callbacks/refetchQueries.js.map +1 -0
- package/dist/cjs/callbacks/removeQueries.js +36 -0
- package/dist/cjs/callbacks/removeQueries.js.map +1 -0
- package/dist/cjs/callbacks/resetQueries.js +36 -0
- package/dist/cjs/callbacks/resetQueries.js.map +1 -0
- package/dist/cjs/callbacks/setInfiniteQueryData.js +37 -0
- package/dist/cjs/callbacks/setInfiniteQueryData.js.map +1 -0
- package/dist/cjs/callbacks/setQueriesData.js +36 -0
- package/dist/cjs/callbacks/setQueriesData.js.map +1 -0
- package/dist/cjs/callbacks/setQueryData.js +37 -0
- package/dist/cjs/callbacks/setQueryData.js.map +1 -0
- package/dist/cjs/callbacks/useInfiniteQuery.js +36 -0
- package/dist/cjs/callbacks/useInfiniteQuery.js.map +1 -0
- package/dist/cjs/callbacks/useIsFetching.js +39 -0
- package/dist/cjs/callbacks/useIsFetching.js.map +1 -0
- package/dist/cjs/callbacks/useIsMutating.js +39 -0
- package/dist/cjs/callbacks/useIsMutating.js.map +1 -0
- package/dist/cjs/callbacks/useMutation.js +66 -0
- package/dist/cjs/callbacks/useMutation.js.map +1 -0
- package/dist/cjs/callbacks/useMutationState.js +42 -0
- package/dist/cjs/callbacks/useMutationState.js.map +1 -0
- package/dist/cjs/callbacks/useQueries.js +69 -0
- package/dist/cjs/callbacks/useQueries.js.map +1 -0
- package/dist/cjs/callbacks/useQuery.js +36 -0
- package/dist/cjs/callbacks/useQuery.js.map +1 -0
- package/dist/cjs/callbacks/useSuspenseInfiniteQuery.js +36 -0
- package/dist/cjs/callbacks/useSuspenseInfiniteQuery.js.map +1 -0
- package/dist/cjs/callbacks/useSuspenseQueries.js +69 -0
- package/dist/cjs/callbacks/useSuspenseQueries.js.map +1 -0
- package/dist/cjs/callbacks/useSuspenseQuery.js +36 -0
- package/dist/cjs/callbacks/useSuspenseQuery.js.map +1 -0
- package/dist/cjs/index.js +63 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/PartialParameters.type.js +17 -0
- package/dist/cjs/lib/PartialParameters.type.js.map +1 -0
- package/dist/cjs/lib/callQueryClientFetchMethod.js +69 -0
- package/dist/cjs/lib/callQueryClientFetchMethod.js.map +1 -0
- package/dist/cjs/lib/callQueryClientMethodWithMutationFilters.js +42 -0
- package/dist/cjs/lib/callQueryClientMethodWithMutationFilters.js.map +1 -0
- package/dist/cjs/lib/callQueryClientMethodWithQueryFilters.js +42 -0
- package/dist/cjs/lib/callQueryClientMethodWithQueryFilters.js.map +1 -0
- package/dist/cjs/lib/callQueryClientMethodWithQueryKey.js +41 -0
- package/dist/cjs/lib/callQueryClientMethodWithQueryKey.js.map +1 -0
- package/dist/cjs/lib/composeBaseQueryKey.js +34 -0
- package/dist/cjs/lib/composeBaseQueryKey.js.map +1 -0
- package/dist/cjs/lib/composeInfiniteQueryKey.js +32 -0
- package/dist/cjs/lib/composeInfiniteQueryKey.js.map +1 -0
- package/dist/cjs/lib/composeMutationFilters.js +55 -0
- package/dist/cjs/lib/composeMutationFilters.js.map +1 -0
- package/dist/cjs/lib/composeMutationKey.js +52 -0
- package/dist/cjs/lib/composeMutationKey.js.map +1 -0
- package/dist/cjs/lib/composeQueryFilters.js +57 -0
- package/dist/cjs/lib/composeQueryFilters.js.map +1 -0
- package/dist/cjs/lib/composeQueryKey.js +32 -0
- package/dist/cjs/lib/composeQueryKey.js.map +1 -0
- package/dist/cjs/lib/createRecursiveProxy.js +49 -0
- package/dist/cjs/lib/createRecursiveProxy.js.map +1 -0
- package/dist/cjs/lib/jwt-decode/index.js +91 -0
- package/dist/cjs/lib/jwt-decode/index.js.map +1 -0
- package/dist/cjs/lib/requestFn.js +202 -0
- package/dist/cjs/lib/requestFn.js.map +1 -0
- package/dist/cjs/lib/shelfMerge.js +53 -0
- package/dist/cjs/lib/shelfMerge.js.map +1 -0
- package/dist/cjs/lib/useComposeUseQueryOptions.js +56 -0
- package/dist/cjs/lib/useComposeUseQueryOptions.js.map +1 -0
- package/dist/cjs/lib/useQueryClient.js +38 -0
- package/dist/cjs/lib/useQueryClient.js.map +1 -0
- package/dist/cjs/qraftAPIClient.js +77 -0
- package/dist/cjs/qraftAPIClient.js.map +1 -0
- package/dist/cjs/service-operation/OperationInfiniteData.js +17 -0
- package/dist/cjs/service-operation/OperationInfiniteData.js.map +1 -0
- package/dist/cjs/service-operation/QueryFilters.js +17 -0
- package/dist/cjs/service-operation/QueryFilters.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperation.js +17 -0
- package/dist/cjs/service-operation/ServiceOperation.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationCancelQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationCancelQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationFetchInfiniteQuery.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationFetchInfiniteQuery.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationFetchQuery.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationFetchQuery.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationGetInfiniteQueryData.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationGetInfiniteQueryData.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationGetQueriesData.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationGetQueriesData.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationGetQueryData.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationGetQueryData.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationGetQueryState.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationGetQueryState.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationInvalidateQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationInvalidateQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationIsFetchingQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationIsFetchingQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationIsMutatingQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationIsMutatingQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationKey.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationKey.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationMutationFn.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationMutationFn.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationQueryFn.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationQueryFn.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationRefetchQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationRefetchQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationRemoveQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationRemoveQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationResetQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationResetQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationSetInfiniteQueryData.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationSetInfiniteQueryData.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationSetQueriesData.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationSetQueriesData.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationSetQueryData.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationSetQueryData.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseInfiniteQuery.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseInfiniteQuery.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseIsFetchingQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseIsFetchingQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseIsMutating.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseIsMutating.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseMutation.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseMutation.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseMutationState.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseMutationState.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseQuery.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseQuery.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseSuspenseInfiniteQuery.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseSuspenseInfiniteQuery.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseSuspenseQueries.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseSuspenseQueries.js.map +1 -0
- package/dist/cjs/service-operation/ServiceOperationUseSuspenseQueryQuery.js +17 -0
- package/dist/cjs/service-operation/ServiceOperationUseSuspenseQueryQuery.js.map +1 -0
- package/dist/cjs/service-operation/index.js +17 -0
- package/dist/cjs/service-operation/index.js.map +1 -0
- package/dist/esm/QraftContext.js +7 -0
- package/dist/esm/QraftContext.js.map +1 -0
- package/dist/esm/ServiceOperation.js +1 -0
- package/dist/esm/ServiceOperation.js.map +1 -0
- package/dist/esm/Unstable_QraftSecureRequestFn.js +190 -0
- package/dist/esm/Unstable_QraftSecureRequestFn.js.map +1 -0
- package/dist/esm/callbacks/cancelQueries.js +12 -0
- package/dist/esm/callbacks/cancelQueries.js.map +1 -0
- package/dist/esm/callbacks/fetchInfiniteQuery.js +13 -0
- package/dist/esm/callbacks/fetchInfiniteQuery.js.map +1 -0
- package/dist/esm/callbacks/fetchQuery.js +13 -0
- package/dist/esm/callbacks/fetchQuery.js.map +1 -0
- package/dist/esm/callbacks/getInfiniteQueryData.js +13 -0
- package/dist/esm/callbacks/getInfiniteQueryData.js.map +1 -0
- package/dist/esm/callbacks/getInfiniteQueryKey.js +8 -0
- package/dist/esm/callbacks/getInfiniteQueryKey.js.map +1 -0
- package/dist/esm/callbacks/getInfiniteQueryState.js +13 -0
- package/dist/esm/callbacks/getInfiniteQueryState.js.map +1 -0
- package/dist/esm/callbacks/getMutationKey.js +8 -0
- package/dist/esm/callbacks/getMutationKey.js.map +1 -0
- package/dist/esm/callbacks/getQueriesData.js +12 -0
- package/dist/esm/callbacks/getQueriesData.js.map +1 -0
- package/dist/esm/callbacks/getQueryData.js +13 -0
- package/dist/esm/callbacks/getQueryData.js.map +1 -0
- package/dist/esm/callbacks/getQueryKey.js +8 -0
- package/dist/esm/callbacks/getQueryKey.js.map +1 -0
- package/dist/esm/callbacks/getQueryState.js +13 -0
- package/dist/esm/callbacks/getQueryState.js.map +1 -0
- package/dist/esm/callbacks/index.js +73 -0
- package/dist/esm/callbacks/index.js.map +1 -0
- package/dist/esm/callbacks/invalidateQueries.js +12 -0
- package/dist/esm/callbacks/invalidateQueries.js.map +1 -0
- package/dist/esm/callbacks/isFetching.js +12 -0
- package/dist/esm/callbacks/isFetching.js.map +1 -0
- package/dist/esm/callbacks/isMutating.js +12 -0
- package/dist/esm/callbacks/isMutating.js.map +1 -0
- package/dist/esm/callbacks/mutationFn.js +11 -0
- package/dist/esm/callbacks/mutationFn.js.map +1 -0
- package/dist/esm/callbacks/operationInvokeFn.js +17 -0
- package/dist/esm/callbacks/operationInvokeFn.js.map +1 -0
- package/dist/esm/callbacks/prefetchInfiniteQuery.js +13 -0
- package/dist/esm/callbacks/prefetchInfiniteQuery.js.map +1 -0
- package/dist/esm/callbacks/prefetchQuery.js +13 -0
- package/dist/esm/callbacks/prefetchQuery.js.map +1 -0
- package/dist/esm/callbacks/queryFn.js +15 -0
- package/dist/esm/callbacks/queryFn.js.map +1 -0
- package/dist/esm/callbacks/refetchQueries.js +12 -0
- package/dist/esm/callbacks/refetchQueries.js.map +1 -0
- package/dist/esm/callbacks/removeQueries.js +12 -0
- package/dist/esm/callbacks/removeQueries.js.map +1 -0
- package/dist/esm/callbacks/resetQueries.js +12 -0
- package/dist/esm/callbacks/resetQueries.js.map +1 -0
- package/dist/esm/callbacks/setInfiniteQueryData.js +13 -0
- package/dist/esm/callbacks/setInfiniteQueryData.js.map +1 -0
- package/dist/esm/callbacks/setQueriesData.js +12 -0
- package/dist/esm/callbacks/setQueriesData.js.map +1 -0
- package/dist/esm/callbacks/setQueryData.js +13 -0
- package/dist/esm/callbacks/setQueryData.js.map +1 -0
- package/dist/esm/callbacks/useInfiniteQuery.js +14 -0
- package/dist/esm/callbacks/useInfiniteQuery.js.map +1 -0
- package/dist/esm/callbacks/useIsFetching.js +15 -0
- package/dist/esm/callbacks/useIsFetching.js.map +1 -0
- package/dist/esm/callbacks/useIsMutating.js +17 -0
- package/dist/esm/callbacks/useIsMutating.js.map +1 -0
- package/dist/esm/callbacks/useMutation.js +44 -0
- package/dist/esm/callbacks/useMutation.js.map +1 -0
- package/dist/esm/callbacks/useMutationState.js +20 -0
- package/dist/esm/callbacks/useMutationState.js.map +1 -0
- package/dist/esm/callbacks/useQueries.js +47 -0
- package/dist/esm/callbacks/useQueries.js.map +1 -0
- package/dist/esm/callbacks/useQuery.js +14 -0
- package/dist/esm/callbacks/useQuery.js.map +1 -0
- package/dist/esm/callbacks/useSuspenseInfiniteQuery.js +14 -0
- package/dist/esm/callbacks/useSuspenseInfiniteQuery.js.map +1 -0
- package/dist/esm/callbacks/useSuspenseQueries.js +47 -0
- package/dist/esm/callbacks/useSuspenseQueries.js.map +1 -0
- package/dist/esm/callbacks/useSuspenseQuery.js +14 -0
- package/dist/esm/callbacks/useSuspenseQuery.js.map +1 -0
- package/dist/esm/index.js +15 -1206
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/PartialParameters.type.js +1 -0
- package/dist/esm/lib/PartialParameters.type.js.map +1 -0
- package/dist/esm/lib/callQueryClientFetchMethod.js +45 -0
- package/dist/esm/lib/callQueryClientFetchMethod.js.map +1 -0
- package/dist/esm/lib/callQueryClientMethodWithMutationFilters.js +18 -0
- package/dist/esm/lib/callQueryClientMethodWithMutationFilters.js.map +1 -0
- package/dist/esm/lib/callQueryClientMethodWithQueryFilters.js +18 -0
- package/dist/esm/lib/callQueryClientMethodWithQueryFilters.js.map +1 -0
- package/dist/esm/lib/callQueryClientMethodWithQueryKey.js +17 -0
- package/dist/esm/lib/callQueryClientMethodWithQueryKey.js.map +1 -0
- package/dist/esm/lib/composeBaseQueryKey.js +10 -0
- package/dist/esm/lib/composeBaseQueryKey.js.map +1 -0
- package/dist/esm/lib/composeInfiniteQueryKey.js +8 -0
- package/dist/esm/lib/composeInfiniteQueryKey.js.map +1 -0
- package/dist/esm/lib/composeMutationFilters.js +31 -0
- package/dist/esm/lib/composeMutationFilters.js.map +1 -0
- package/dist/esm/lib/composeMutationKey.js +27 -0
- package/dist/esm/lib/composeMutationKey.js.map +1 -0
- package/dist/esm/lib/composeQueryFilters.js +33 -0
- package/dist/esm/lib/composeQueryFilters.js.map +1 -0
- package/dist/esm/lib/composeQueryKey.js +8 -0
- package/dist/esm/lib/composeQueryKey.js.map +1 -0
- package/dist/esm/lib/createRecursiveProxy.js +25 -0
- package/dist/esm/lib/createRecursiveProxy.js.map +1 -0
- package/dist/esm/lib/jwt-decode/index.js +65 -0
- package/dist/esm/lib/jwt-decode/index.js.map +1 -0
- package/dist/esm/lib/requestFn.js +174 -0
- package/dist/esm/lib/requestFn.js.map +1 -0
- package/dist/esm/lib/shelfMerge.js +29 -0
- package/dist/esm/lib/shelfMerge.js.map +1 -0
- package/dist/esm/lib/useComposeUseQueryOptions.js +32 -0
- package/dist/esm/lib/useComposeUseQueryOptions.js.map +1 -0
- package/dist/esm/lib/useQueryClient.js +16 -0
- package/dist/esm/lib/useQueryClient.js.map +1 -0
- package/dist/esm/qraftAPIClient.js +53 -0
- package/dist/esm/qraftAPIClient.js.map +1 -0
- package/dist/esm/service-operation/OperationInfiniteData.js +1 -0
- package/dist/esm/service-operation/OperationInfiniteData.js.map +1 -0
- package/dist/esm/service-operation/QueryFilters.js +1 -0
- package/dist/esm/service-operation/QueryFilters.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperation.js +1 -0
- package/dist/esm/service-operation/ServiceOperation.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationCancelQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationCancelQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationFetchInfiniteQuery.js +1 -0
- package/dist/esm/service-operation/ServiceOperationFetchInfiniteQuery.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationFetchQuery.js +1 -0
- package/dist/esm/service-operation/ServiceOperationFetchQuery.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationGetInfiniteQueryData.js +1 -0
- package/dist/esm/service-operation/ServiceOperationGetInfiniteQueryData.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationGetQueriesData.js +1 -0
- package/dist/esm/service-operation/ServiceOperationGetQueriesData.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationGetQueryData.js +1 -0
- package/dist/esm/service-operation/ServiceOperationGetQueryData.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationGetQueryState.js +1 -0
- package/dist/esm/service-operation/ServiceOperationGetQueryState.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationInvalidateQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationInvalidateQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationIsFetchingQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationIsFetchingQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationIsMutatingQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationIsMutatingQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationKey.js +1 -0
- package/dist/esm/service-operation/ServiceOperationKey.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationMutationFn.js +1 -0
- package/dist/esm/service-operation/ServiceOperationMutationFn.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationQueryFn.js +1 -0
- package/dist/esm/service-operation/ServiceOperationQueryFn.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationRefetchQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationRefetchQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationRemoveQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationRemoveQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationResetQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationResetQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationSetInfiniteQueryData.js +1 -0
- package/dist/esm/service-operation/ServiceOperationSetInfiniteQueryData.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationSetQueriesData.js +1 -0
- package/dist/esm/service-operation/ServiceOperationSetQueriesData.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationSetQueryData.js +1 -0
- package/dist/esm/service-operation/ServiceOperationSetQueryData.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseInfiniteQuery.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseInfiniteQuery.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseIsFetchingQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseIsFetchingQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseIsMutating.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseIsMutating.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseMutation.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseMutation.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseMutationState.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseMutationState.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseQuery.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseQuery.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseSuspenseInfiniteQuery.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseSuspenseInfiniteQuery.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseSuspenseQueries.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseSuspenseQueries.js.map +1 -0
- package/dist/esm/service-operation/ServiceOperationUseSuspenseQueryQuery.js +1 -0
- package/dist/esm/service-operation/ServiceOperationUseSuspenseQueryQuery.js.map +1 -0
- package/dist/esm/service-operation/index.js +1 -0
- package/dist/esm/service-operation/index.js.map +1 -0
- package/dist/types/QraftContext.d.ts +20 -0
- package/dist/types/QraftContext.d.ts.map +1 -0
- package/dist/types/ServiceOperation.d.ts +44 -0
- package/dist/types/ServiceOperation.d.ts.map +1 -0
- package/dist/types/Unstable_QraftSecureRequestFn.d.ts +81 -0
- package/dist/types/Unstable_QraftSecureRequestFn.d.ts.map +1 -0
- package/dist/types/callbacks/cancelQueries.d.ts +5 -0
- package/dist/types/callbacks/cancelQueries.d.ts.map +1 -0
- package/dist/types/callbacks/fetchInfiniteQuery.d.ts +7 -0
- package/dist/types/callbacks/fetchInfiniteQuery.d.ts.map +1 -0
- package/dist/types/callbacks/fetchQuery.d.ts +7 -0
- package/dist/types/callbacks/fetchQuery.d.ts.map +1 -0
- package/dist/types/callbacks/getInfiniteQueryData.d.ts +6 -0
- package/dist/types/callbacks/getInfiniteQueryData.d.ts.map +1 -0
- package/dist/types/callbacks/getInfiniteQueryKey.d.ts +5 -0
- package/dist/types/callbacks/getInfiniteQueryKey.d.ts.map +1 -0
- package/dist/types/callbacks/getInfiniteQueryState.d.ts +5 -0
- package/dist/types/callbacks/getInfiniteQueryState.d.ts.map +1 -0
- package/dist/types/callbacks/getMutationKey.d.ts +5 -0
- package/dist/types/callbacks/getMutationKey.d.ts.map +1 -0
- package/dist/types/callbacks/getQueriesData.d.ts +5 -0
- package/dist/types/callbacks/getQueriesData.d.ts.map +1 -0
- package/dist/types/callbacks/getQueryData.d.ts +5 -0
- package/dist/types/callbacks/getQueryData.d.ts.map +1 -0
- package/dist/types/callbacks/getQueryKey.d.ts +5 -0
- package/dist/types/callbacks/getQueryKey.d.ts.map +1 -0
- package/dist/types/callbacks/getQueryState.d.ts +5 -0
- package/dist/types/callbacks/getQueryState.d.ts.map +1 -0
- package/dist/types/callbacks/index.d.ts +36 -0
- package/dist/types/callbacks/index.d.ts.map +1 -0
- package/dist/types/callbacks/invalidateQueries.d.ts +5 -0
- package/dist/types/callbacks/invalidateQueries.d.ts.map +1 -0
- package/dist/types/callbacks/isFetching.d.ts +5 -0
- package/dist/types/callbacks/isFetching.d.ts.map +1 -0
- package/dist/types/callbacks/isMutating.d.ts +5 -0
- package/dist/types/callbacks/isMutating.d.ts.map +1 -0
- package/dist/types/callbacks/mutationFn.d.ts +4 -0
- package/dist/types/callbacks/mutationFn.d.ts.map +1 -0
- package/dist/types/callbacks/operationInvokeFn.d.ts +9 -0
- package/dist/types/callbacks/operationInvokeFn.d.ts.map +1 -0
- package/dist/types/callbacks/prefetchInfiniteQuery.d.ts +7 -0
- package/dist/types/callbacks/prefetchInfiniteQuery.d.ts.map +1 -0
- package/dist/types/callbacks/prefetchQuery.d.ts +7 -0
- package/dist/types/callbacks/prefetchQuery.d.ts.map +1 -0
- package/dist/types/callbacks/queryFn.d.ts +7 -0
- package/dist/types/callbacks/queryFn.d.ts.map +1 -0
- package/dist/types/callbacks/refetchQueries.d.ts +5 -0
- package/dist/types/callbacks/refetchQueries.d.ts.map +1 -0
- package/dist/types/callbacks/removeQueries.d.ts +5 -0
- package/dist/types/callbacks/removeQueries.d.ts.map +1 -0
- package/dist/types/callbacks/resetQueries.d.ts +5 -0
- package/dist/types/callbacks/resetQueries.d.ts.map +1 -0
- package/dist/types/callbacks/setInfiniteQueryData.d.ts +6 -0
- package/dist/types/callbacks/setInfiniteQueryData.d.ts.map +1 -0
- package/dist/types/callbacks/setQueriesData.d.ts +5 -0
- package/dist/types/callbacks/setQueriesData.d.ts.map +1 -0
- package/dist/types/callbacks/setQueryData.d.ts +5 -0
- package/dist/types/callbacks/setQueryData.d.ts.map +1 -0
- package/dist/types/callbacks/useInfiniteQuery.d.ts +7 -0
- package/dist/types/callbacks/useInfiniteQuery.d.ts.map +1 -0
- package/dist/types/callbacks/useIsFetching.d.ts +5 -0
- package/dist/types/callbacks/useIsFetching.d.ts.map +1 -0
- package/dist/types/callbacks/useIsMutating.d.ts +7 -0
- package/dist/types/callbacks/useIsMutating.d.ts.map +1 -0
- package/dist/types/callbacks/useMutation.d.ts +7 -0
- package/dist/types/callbacks/useMutation.d.ts.map +1 -0
- package/dist/types/callbacks/useMutationState.d.ts +7 -0
- package/dist/types/callbacks/useMutationState.d.ts.map +1 -0
- package/dist/types/callbacks/useQueries.d.ts +6 -0
- package/dist/types/callbacks/useQueries.d.ts.map +1 -0
- package/dist/types/callbacks/useQuery.d.ts +7 -0
- package/dist/types/callbacks/useQuery.d.ts.map +1 -0
- package/dist/types/callbacks/useSuspenseInfiniteQuery.d.ts +7 -0
- package/dist/types/callbacks/useSuspenseInfiniteQuery.d.ts.map +1 -0
- package/dist/types/callbacks/useSuspenseQueries.d.ts +6 -0
- package/dist/types/callbacks/useSuspenseQueries.d.ts.map +1 -0
- package/dist/types/callbacks/useSuspenseQuery.d.ts +7 -0
- package/dist/types/callbacks/useSuspenseQuery.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/PartialParameters.type.d.ts +13 -0
- package/dist/types/lib/PartialParameters.type.d.ts.map +1 -0
- package/dist/types/lib/callQueryClientFetchMethod.d.ts +20 -0
- package/dist/types/lib/callQueryClientFetchMethod.d.ts.map +1 -0
- package/dist/types/lib/callQueryClientMethodWithMutationFilters.d.ts +11 -0
- package/dist/types/lib/callQueryClientMethodWithMutationFilters.d.ts.map +1 -0
- package/dist/types/lib/callQueryClientMethodWithQueryFilters.d.ts +11 -0
- package/dist/types/lib/callQueryClientMethodWithQueryFilters.d.ts.map +1 -0
- package/dist/types/lib/callQueryClientMethodWithQueryKey.d.ts +11 -0
- package/dist/types/lib/callQueryClientMethodWithQueryKey.d.ts.map +1 -0
- package/dist/types/lib/composeBaseQueryKey.d.ts +6 -0
- package/dist/types/lib/composeBaseQueryKey.d.ts.map +1 -0
- package/dist/types/lib/composeInfiniteQueryKey.d.ts +4 -0
- package/dist/types/lib/composeInfiniteQueryKey.d.ts.map +1 -0
- package/dist/types/lib/composeMutationFilters.d.ts +11 -0
- package/dist/types/lib/composeMutationFilters.d.ts.map +1 -0
- package/dist/types/lib/composeMutationKey.d.ts +10 -0
- package/dist/types/lib/composeMutationKey.d.ts.map +1 -0
- package/dist/types/lib/composeQueryFilters.d.ts +14 -0
- package/dist/types/lib/composeQueryFilters.d.ts.map +1 -0
- package/dist/types/lib/composeQueryKey.d.ts +4 -0
- package/dist/types/lib/composeQueryKey.d.ts.map +1 -0
- package/dist/types/lib/createRecursiveProxy.d.ts +15 -0
- package/dist/types/lib/createRecursiveProxy.d.ts.map +1 -0
- package/dist/types/lib/jwt-decode/index.d.ts +29 -0
- package/dist/types/lib/jwt-decode/index.d.ts.map +1 -0
- package/dist/types/lib/jwt-decode/index.test.d.ts +2 -0
- package/dist/types/lib/jwt-decode/index.test.d.ts.map +1 -0
- package/dist/types/lib/requestFn.d.ts +100 -0
- package/dist/types/lib/requestFn.d.ts.map +1 -0
- package/dist/types/lib/shelfMerge.d.ts +7 -0
- package/dist/types/lib/shelfMerge.d.ts.map +1 -0
- package/dist/types/lib/useComposeUseQueryOptions.d.ts +16 -0
- package/dist/types/lib/useComposeUseQueryOptions.d.ts.map +1 -0
- package/dist/types/lib/useQueryClient.d.ts +9 -0
- package/dist/types/lib/useQueryClient.d.ts.map +1 -0
- package/dist/types/qraftAPIClient.d.ts +24 -0
- package/dist/types/qraftAPIClient.d.ts.map +1 -0
- package/dist/types/service-operation/OperationInfiniteData.d.ts +4 -0
- package/dist/types/service-operation/OperationInfiniteData.d.ts.map +1 -0
- package/dist/types/service-operation/QueryFilters.d.ts +123 -0
- package/dist/types/service-operation/QueryFilters.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperation.d.ts +53 -0
- package/dist/types/service-operation/ServiceOperation.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationCancelQueries.d.ts +20 -0
- package/dist/types/service-operation/ServiceOperationCancelQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationFetchInfiniteQuery.d.ts +58 -0
- package/dist/types/service-operation/ServiceOperationFetchInfiniteQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationFetchQuery.d.ts +49 -0
- package/dist/types/service-operation/ServiceOperationFetchQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationGetInfiniteQueryData.d.ts +10 -0
- package/dist/types/service-operation/ServiceOperationGetInfiniteQueryData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationGetQueriesData.d.ts +18 -0
- package/dist/types/service-operation/ServiceOperationGetQueriesData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationGetQueryData.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationGetQueryData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationGetQueryState.d.ts +11 -0
- package/dist/types/service-operation/ServiceOperationGetQueryState.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationInvalidateQueries.d.ts +26 -0
- package/dist/types/service-operation/ServiceOperationInvalidateQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationIsFetchingQueries.d.ts +19 -0
- package/dist/types/service-operation/ServiceOperationIsFetchingQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationIsMutatingQueries.d.ts +19 -0
- package/dist/types/service-operation/ServiceOperationIsMutatingQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationKey.d.ts +16 -0
- package/dist/types/service-operation/ServiceOperationKey.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationMutationFn.d.ts +47 -0
- package/dist/types/service-operation/ServiceOperationMutationFn.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationQueryFn.d.ts +79 -0
- package/dist/types/service-operation/ServiceOperationQueryFn.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationRefetchQueries.d.ts +30 -0
- package/dist/types/service-operation/ServiceOperationRefetchQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationRemoveQueries.d.ts +19 -0
- package/dist/types/service-operation/ServiceOperationRemoveQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationResetQueries.d.ts +20 -0
- package/dist/types/service-operation/ServiceOperationResetQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationSetInfiniteQueryData.d.ts +10 -0
- package/dist/types/service-operation/ServiceOperationSetInfiniteQueryData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationSetQueriesData.d.ts +20 -0
- package/dist/types/service-operation/ServiceOperationSetQueriesData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationSetQueryData.d.ts +19 -0
- package/dist/types/service-operation/ServiceOperationSetQueryData.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseInfiniteQuery.d.ts +14 -0
- package/dist/types/service-operation/ServiceOperationUseInfiniteQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseIsFetchingQueries.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationUseIsFetchingQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseIsMutating.d.ts +9 -0
- package/dist/types/service-operation/ServiceOperationUseIsMutating.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseMutation.d.ts +17 -0
- package/dist/types/service-operation/ServiceOperationUseMutation.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseMutationState.d.ts +46 -0
- package/dist/types/service-operation/ServiceOperationUseMutationState.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseQueries.d.ts +20 -0
- package/dist/types/service-operation/ServiceOperationUseQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseQuery.d.ts +12 -0
- package/dist/types/service-operation/ServiceOperationUseQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseInfiniteQuery.d.ts +12 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseInfiniteQuery.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseQueries.d.ts +18 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseQueries.d.ts.map +1 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseQueryQuery.d.ts +10 -0
- package/dist/types/service-operation/ServiceOperationUseSuspenseQueryQuery.d.ts.map +1 -0
- package/dist/types/service-operation/index.d.ts +2 -0
- package/dist/types/service-operation/index.d.ts.map +1 -0
- package/package.json +10 -15
- package/src/index.ts +1 -1
- package/dist/cjs/index.cjs +0 -1267
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/index.d.cts +0 -1035
- package/dist/esm/index.d.ts +0 -1035
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/callbacks/useQuery.ts"],"sourcesContent":["'use client';\n\nimport type { DefaultError } from '@tanstack/query-core';\nimport {\n useQuery as useQueryTanstack,\n type UseQueryResult,\n} from '@tanstack/react-query';\n\nimport type { OperationSchema } from '../lib/requestFn.js';\nimport { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js';\nimport type { QraftClientOptions } from '../qraftAPIClient.js';\nimport type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js';\n\nexport const useQuery: <TData = unknown, TError = DefaultError>(\n qraftOptions: QraftClientOptions | undefined,\n schema: OperationSchema,\n args: Parameters<\n ServiceOperationQuery<OperationSchema, unknown, unknown>['useQuery']\n >\n) => UseQueryResult<TData, TError> = (qraftOptions, schema, args) => {\n return useQueryTanstack(\n // @ts-expect-error - Too complex to type\n ...useComposeUseQueryOptions(qraftOptions, schema, args, false)\n ) as never;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAGO;AAGP,uCAA0C;AAInC,MAAM,WAMwB,CAAC,cAAc,QAAQ,SAAS;AACnE,aAAO,mBAAAA;AAAA,IAEL,OAAG,4DAA0B,cAAc,QAAQ,MAAM,KAAK;AAAA,EAChE;AACF;","names":["useQueryTanstack"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var useSuspenseInfiniteQuery_exports = {};
|
|
21
|
+
__export(useSuspenseInfiniteQuery_exports, {
|
|
22
|
+
useSuspenseInfiniteQuery: () => useSuspenseInfiniteQuery
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useSuspenseInfiniteQuery_exports);
|
|
25
|
+
var import_react_query = require("@tanstack/react-query");
|
|
26
|
+
var import_useComposeUseQueryOptions = require("../lib/useComposeUseQueryOptions.js");
|
|
27
|
+
const useSuspenseInfiniteQuery = (qraftOptions, schema, args) => {
|
|
28
|
+
return (0, import_react_query.useSuspenseInfiniteQuery)(
|
|
29
|
+
...(0, import_useComposeUseQueryOptions.useComposeUseQueryOptions)(qraftOptions, schema, args, true)
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
useSuspenseInfiniteQuery
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=useSuspenseInfiniteQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/callbacks/useSuspenseInfiniteQuery.ts"],"sourcesContent":["'use client';\n\nimport type { DefaultError, InfiniteData } from '@tanstack/query-core';\nimport {\n useSuspenseInfiniteQuery as useSuspenseInfiniteQueryTanstack,\n type UseSuspenseInfiniteQueryResult,\n} from '@tanstack/react-query';\n\nimport type { OperationSchema } from '../lib/requestFn.js';\nimport { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js';\nimport type { QraftClientOptions } from '../qraftAPIClient.js';\nimport type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js';\n\nexport const useSuspenseInfiniteQuery: <\n TQueryFnData,\n TError = DefaultError,\n TData = InfiniteData<TQueryFnData>,\n>(\n qraftOptions: QraftClientOptions | undefined,\n schema: OperationSchema,\n args: Parameters<\n ServiceOperationQuery<\n OperationSchema,\n unknown,\n unknown\n >['useSuspenseInfiniteQuery']\n >\n) => UseSuspenseInfiniteQueryResult<TData, TError> = (\n qraftOptions,\n schema,\n args\n) => {\n return useSuspenseInfiniteQueryTanstack(\n // @ts-expect-error - Too complex to type\n ...useComposeUseQueryOptions(qraftOptions, schema, args, true)\n ) as never;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAGO;AAGP,uCAA0C;AAInC,MAAM,2BAcwC,CACnD,cACA,QACA,SACG;AACH,aAAO,mBAAAA;AAAA,IAEL,OAAG,4DAA0B,cAAc,QAAQ,MAAM,IAAI;AAAA,EAC/D;AACF;","names":["useSuspenseInfiniteQueryTanstack"]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var useSuspenseQueries_exports = {};
|
|
21
|
+
__export(useSuspenseQueries_exports, {
|
|
22
|
+
useSuspenseQueries: () => useSuspenseQueries
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useSuspenseQueries_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_react_query = require("@tanstack/react-query");
|
|
27
|
+
var import_composeQueryKey = require("../lib/composeQueryKey.js");
|
|
28
|
+
var import_useQueryClient = require("../lib/useQueryClient.js");
|
|
29
|
+
var import_QraftContext = require("../QraftContext.js");
|
|
30
|
+
const useSuspenseQueries = (qraftOptions, schema, args) => {
|
|
31
|
+
const [options, queryClientByArg] = args;
|
|
32
|
+
const contextValue = (0, import_react.useContext)(qraftOptions?.context ?? import_QraftContext.QraftContext);
|
|
33
|
+
if (!contextValue?.requestFn)
|
|
34
|
+
throw new Error(`QraftContext.requestFn not found`);
|
|
35
|
+
return (0, import_react_query.useSuspenseQueries)(
|
|
36
|
+
{
|
|
37
|
+
...options,
|
|
38
|
+
queries: options.queries.map((queryOptions) => {
|
|
39
|
+
const optionsWithQueryKey = "parameters" in queryOptions ? (() => {
|
|
40
|
+
const queryOptionsCopy = Object.assign(
|
|
41
|
+
{
|
|
42
|
+
queryKey: (0, import_composeQueryKey.composeQueryKey)(schema, queryOptions.parameters)
|
|
43
|
+
},
|
|
44
|
+
queryOptions
|
|
45
|
+
);
|
|
46
|
+
delete queryOptionsCopy.parameters;
|
|
47
|
+
return queryOptionsCopy;
|
|
48
|
+
})() : queryOptions;
|
|
49
|
+
return {
|
|
50
|
+
...optionsWithQueryKey,
|
|
51
|
+
queryFn: optionsWithQueryKey.queryFn ?? function({ queryKey: [, queryParams], signal, meta }) {
|
|
52
|
+
return contextValue.requestFn(schema, {
|
|
53
|
+
parameters: queryParams,
|
|
54
|
+
baseUrl: contextValue.baseUrl,
|
|
55
|
+
signal,
|
|
56
|
+
meta
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
})
|
|
61
|
+
},
|
|
62
|
+
(0, import_useQueryClient.useQueryClient)(qraftOptions, queryClientByArg)
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
useSuspenseQueries
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=useSuspenseQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/callbacks/useSuspenseQueries.ts"],"sourcesContent":["'use client';\n\nimport { useContext } from 'react';\n\nimport {\n SuspenseQueriesResults,\n useSuspenseQueries as useSuspenseQueriesTanstack,\n} from '@tanstack/react-query';\n\nimport { composeQueryKey } from '../lib/composeQueryKey.js';\nimport type { OperationSchema } from '../lib/requestFn.js';\nimport { useQueryClient } from '../lib/useQueryClient.js';\nimport type { QraftClientOptions } from '../qraftAPIClient.js';\nimport { QraftContext } from '../QraftContext.js';\nimport { ServiceOperationQuery } from '../service-operation/ServiceOperation.js';\n\nexport const useSuspenseQueries: (\n qraftOptions: QraftClientOptions | undefined,\n schema: OperationSchema,\n args: Parameters<\n ServiceOperationQuery<\n OperationSchema,\n unknown,\n unknown\n >['useSuspenseQueries']\n >\n) => SuspenseQueriesResults<never> = (qraftOptions, schema, args) => {\n const [options, queryClientByArg] = args;\n\n const contextValue = useContext(qraftOptions?.context ?? QraftContext);\n if (!contextValue?.requestFn)\n throw new Error(`QraftContext.requestFn not found`);\n\n return useSuspenseQueriesTanstack(\n {\n ...options,\n queries: options.queries.map((queryOptions) => {\n const optionsWithQueryKey =\n 'parameters' in queryOptions\n ? (() => {\n const queryOptionsCopy = Object.assign(\n {\n queryKey: composeQueryKey(schema, queryOptions.parameters),\n },\n queryOptions\n );\n // @ts-expect-error - `parameters` is not inferred as a property of `queryOptionsCopy`\n delete queryOptionsCopy.parameters;\n return queryOptionsCopy;\n })()\n : queryOptions;\n\n return {\n ...optionsWithQueryKey,\n queryFn:\n optionsWithQueryKey.queryFn ??\n function ({ queryKey: [, queryParams], signal, meta }) {\n return contextValue.requestFn(schema, {\n parameters: queryParams as never,\n baseUrl: contextValue.baseUrl,\n signal,\n meta,\n });\n },\n };\n }),\n },\n useQueryClient(qraftOptions, queryClientByArg)\n ) as never;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA2B;AAE3B,yBAGO;AAEP,6BAAgC;AAEhC,4BAA+B;AAE/B,0BAA6B;AAGtB,MAAM,qBAUwB,CAAC,cAAc,QAAQ,SAAS;AACnE,QAAM,CAAC,SAAS,gBAAgB,IAAI;AAEpC,QAAM,mBAAe,yBAAW,cAAc,WAAW,gCAAY;AACrE,MAAI,CAAC,cAAc;AACjB,UAAM,IAAI,MAAM,kCAAkC;AAEpD,aAAO,mBAAAA;AAAA,IACL;AAAA,MACE,GAAG;AAAA,MACH,SAAS,QAAQ,QAAQ,IAAI,CAAC,iBAAiB;AAC7C,cAAM,sBACJ,gBAAgB,gBACX,MAAM;AACL,gBAAM,mBAAmB,OAAO;AAAA,YAC9B;AAAA,cACE,cAAU,wCAAgB,QAAQ,aAAa,UAAU;AAAA,YAC3D;AAAA,YACA;AAAA,UACF;AAEA,iBAAO,iBAAiB;AACxB,iBAAO;AAAA,QACT,GAAG,IACH;AAEN,eAAO;AAAA,UACL,GAAG;AAAA,UACH,SACE,oBAAoB,WACpB,SAAU,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,KAAK,GAAG;AACrD,mBAAO,aAAa,UAAU,QAAQ;AAAA,cACpC,YAAY;AAAA,cACZ,SAAS,aAAa;AAAA,cACtB;AAAA,cACA;AAAA,YACF,CAAC;AAAA,UACH;AAAA,QACJ;AAAA,MACF,CAAC;AAAA,IACH;AAAA,QACA,sCAAe,cAAc,gBAAgB;AAAA,EAC/C;AACF;","names":["useSuspenseQueriesTanstack"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var useSuspenseQuery_exports = {};
|
|
21
|
+
__export(useSuspenseQuery_exports, {
|
|
22
|
+
useSuspenseQuery: () => useSuspenseQuery
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useSuspenseQuery_exports);
|
|
25
|
+
var import_react_query = require("@tanstack/react-query");
|
|
26
|
+
var import_useComposeUseQueryOptions = require("../lib/useComposeUseQueryOptions.js");
|
|
27
|
+
const useSuspenseQuery = (qraftOptions, schema, args) => {
|
|
28
|
+
return (0, import_react_query.useSuspenseQuery)(
|
|
29
|
+
...(0, import_useComposeUseQueryOptions.useComposeUseQueryOptions)(qraftOptions, schema, args, false)
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
useSuspenseQuery
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=useSuspenseQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/callbacks/useSuspenseQuery.ts"],"sourcesContent":["'use client';\n\nimport type { DefaultError } from '@tanstack/query-core';\nimport {\n type UseQueryResult,\n useSuspenseQuery as useSuspenseQueryTanstack,\n} from '@tanstack/react-query';\n\nimport type { OperationSchema } from '../lib/requestFn.js';\nimport { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js';\nimport type { QraftClientOptions } from '../qraftAPIClient.js';\nimport type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js';\n\nexport const useSuspenseQuery: <\n TQueryFnData = unknown,\n TError = DefaultError,\n TData = TQueryFnData,\n>(\n qraftOptions: QraftClientOptions | undefined,\n schema: OperationSchema,\n args: Parameters<\n ServiceOperationQuery<OperationSchema, unknown, unknown>['useSuspenseQuery']\n >\n) => UseQueryResult<TData, TError> = (qraftOptions, schema, args) => {\n return useSuspenseQueryTanstack(\n // @ts-expect-error - Too complex to type\n ...useComposeUseQueryOptions(qraftOptions, schema, args, false)\n ) as never;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,yBAGO;AAGP,uCAA0C;AAInC,MAAM,mBAUwB,CAAC,cAAc,QAAQ,SAAS;AACnE,aAAO,mBAAAA;AAAA,IAEL,OAAG,4DAA0B,cAAc,QAAQ,MAAM,KAAK;AAAA,EAChE;AACF;","names":["useSuspenseQueryTanstack"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
QraftContext: () => import_QraftContext.QraftContext,
|
|
32
|
+
Unstable_QraftSecureRequestFn: () => import_Unstable_QraftSecureRequestFn.QraftSecureRequestFn,
|
|
33
|
+
baseRequestFn: () => import_requestFn.baseRequestFn,
|
|
34
|
+
bodySerializer: () => import_requestFn.bodySerializer,
|
|
35
|
+
callbacks: () => callbacks,
|
|
36
|
+
createSecureRequestFn: () => import_Unstable_QraftSecureRequestFn.createSecureRequestFn,
|
|
37
|
+
mergeHeaders: () => import_requestFn.mergeHeaders,
|
|
38
|
+
qraftAPIClient: () => import_qraftAPIClient.qraftAPIClient,
|
|
39
|
+
requestFn: () => import_requestFn.requestFn,
|
|
40
|
+
urlSerializer: () => import_requestFn.urlSerializer,
|
|
41
|
+
useSecuritySchemeAuth: () => import_Unstable_QraftSecureRequestFn.useSecuritySchemeAuth
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(src_exports);
|
|
44
|
+
var import_qraftAPIClient = require("./qraftAPIClient.js");
|
|
45
|
+
var import_QraftContext = require("./QraftContext.js");
|
|
46
|
+
var import_requestFn = require("./lib/requestFn.js");
|
|
47
|
+
var callbacks = __toESM(require("./callbacks/index.js"), 1);
|
|
48
|
+
var import_Unstable_QraftSecureRequestFn = require("./Unstable_QraftSecureRequestFn.js");
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
QraftContext,
|
|
52
|
+
Unstable_QraftSecureRequestFn,
|
|
53
|
+
baseRequestFn,
|
|
54
|
+
bodySerializer,
|
|
55
|
+
callbacks,
|
|
56
|
+
createSecureRequestFn,
|
|
57
|
+
mergeHeaders,
|
|
58
|
+
qraftAPIClient,
|
|
59
|
+
requestFn,
|
|
60
|
+
urlSerializer,
|
|
61
|
+
useSecuritySchemeAuth
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { qraftAPIClient, type QraftClientOptions } from './qraftAPIClient.js';\nexport { QraftContext, type QraftContextValue } from './QraftContext.js';\nexport {\n requestFn,\n baseRequestFn,\n urlSerializer,\n bodySerializer,\n mergeHeaders,\n type RequestFn,\n type RequestFnPayload,\n type OperationSchema,\n type RequestFnOptions,\n type HeadersOptions,\n} from './lib/requestFn.js';\nexport type * from './service-operation/index.js';\nexport * as callbacks from './callbacks/index.js';\nexport {\n QraftSecureRequestFn as Unstable_QraftSecureRequestFn,\n type QraftSecureRequestFnProps,\n useSecuritySchemeAuth,\n createSecureRequestFn,\n type SecuritySchemeHandlers,\n type SecuritySchemeCookie,\n type SecuritySchemeBasic,\n type SecuritySchemeBearer,\n type SecuritySchemeAPIKey,\n} from './Unstable_QraftSecureRequestFn.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAwD;AACxD,0BAAqD;AACrD,uBAWO;AAEP,gBAA2B;AAC3B,2CAUO;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var PartialParameters_type_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(PartialParameters_type_exports);
|
|
17
|
+
//# sourceMappingURL=PartialParameters.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/PartialParameters.type.ts"],"sourcesContent":["/**\n * Shallow partial 'parameters'.\n * @example\n * ```ts\n * {query?: {page: number, nested: {still: 'not_partial'}}}\n * // =>\n * {query?: {page?: number, nested?: {still: 'not_partial'}}}\n * ```\n */\nexport type PartialParameters<T> = T extends object\n ? { [K in keyof T]?: T[K] extends object ? Partial<T[K]> : T[K] }\n : T;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var callQueryClientFetchMethod_exports = {};
|
|
20
|
+
__export(callQueryClientFetchMethod_exports, {
|
|
21
|
+
callQueryClientMethodWithQueryKey: () => callQueryClientMethodWithQueryKey
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(callQueryClientFetchMethod_exports);
|
|
24
|
+
var import_composeInfiniteQueryKey = require("./composeInfiniteQueryKey.js");
|
|
25
|
+
var import_composeQueryKey = require("./composeQueryKey.js");
|
|
26
|
+
var import_shelfMerge = require("./shelfMerge.js");
|
|
27
|
+
function callQueryClientMethodWithQueryKey(queryFilterMethod, schema, infinite, args) {
|
|
28
|
+
const [{ requestFn, baseUrl, parameters, ...options }, queryClient] = args;
|
|
29
|
+
if (!queryClient) throw new Error("queryClient is required");
|
|
30
|
+
if (!queryClient[queryFilterMethod])
|
|
31
|
+
throw new Error(
|
|
32
|
+
`queryClient is invalid, ${queryFilterMethod} method does not exist`
|
|
33
|
+
);
|
|
34
|
+
if (options.queryKey && parameters) {
|
|
35
|
+
throw new Error(
|
|
36
|
+
"callQueryClientMethodWithQueryKey: options.queryKey and options.parameters are mutually exclusive"
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
if (options.queryFn && requestFn) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
"callQueryClientMethodWithQueryKey: options.queryFn and requestFn are mutually exclusive"
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const queryFn = options.queryFn ?? (requestFn ? (
|
|
45
|
+
// @ts-expect-error - Not inferring the correct type for `queryFn`
|
|
46
|
+
function({ queryKey: [, queryParams], signal, meta, pageParam }) {
|
|
47
|
+
return requestFn(schema, {
|
|
48
|
+
parameters: infinite ? (0, import_shelfMerge.shelfMerge)(2, queryParams, pageParam) : queryParams,
|
|
49
|
+
baseUrl,
|
|
50
|
+
signal,
|
|
51
|
+
meta
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
) : void 0);
|
|
55
|
+
if (parameters) {
|
|
56
|
+
return queryClient[queryFilterMethod]({
|
|
57
|
+
...options,
|
|
58
|
+
// Event if queryFn is undefined, it will override the default queryFn from `setQueryDefaults(...)`
|
|
59
|
+
...queryFn ? { queryFn } : {},
|
|
60
|
+
queryKey: infinite ? (0, import_composeInfiniteQueryKey.composeInfiniteQueryKey)(schema, parameters) : (0, import_composeQueryKey.composeQueryKey)(schema, parameters)
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return queryClient[queryFilterMethod]({ ...options, queryFn });
|
|
64
|
+
}
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
callQueryClientMethodWithQueryKey
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=callQueryClientFetchMethod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/callQueryClientFetchMethod.ts"],"sourcesContent":["import type { QueryClient } from '@tanstack/query-core';\n\nimport { composeInfiniteQueryKey } from './composeInfiniteQueryKey.js';\nimport { composeQueryKey } from './composeQueryKey.js';\nimport type { OperationSchema, RequestFn } from './requestFn.js';\nimport { shelfMerge } from './shelfMerge.js';\n\n/**\n * Calls a query client fetch method with parameters and options,\n * and automatically composes the `QueryKey` based on the schema and parameters.\n */\nexport function callQueryClientMethodWithQueryKey<\n QFMethod extends QueryKeyMethods,\n>(\n queryFilterMethod: QFMethod,\n schema: OperationSchema,\n infinite: boolean,\n args: QueryClientMethodArgs<QFMethod>\n): ReturnType<(typeof QueryClient.prototype)[QFMethod]> {\n const [{ requestFn, baseUrl, parameters, ...options }, queryClient] = args;\n\n if (!queryClient) throw new Error('queryClient is required');\n if (!queryClient[queryFilterMethod])\n throw new Error(\n `queryClient is invalid, ${queryFilterMethod} method does not exist`\n );\n\n if (options.queryKey && parameters) {\n throw new Error(\n 'callQueryClientMethodWithQueryKey: options.queryKey and options.parameters are mutually exclusive'\n );\n }\n\n if (options.queryFn && requestFn) {\n throw new Error(\n 'callQueryClientMethodWithQueryKey: options.queryFn and requestFn are mutually exclusive'\n );\n }\n\n const queryFn =\n options.queryFn ??\n (requestFn\n ? // @ts-expect-error - Not inferring the correct type for `queryFn`\n function ({ queryKey: [, queryParams], signal, meta, pageParam }) {\n return requestFn(schema, {\n parameters: infinite\n ? (shelfMerge(2, queryParams, pageParam) as never)\n : queryParams,\n baseUrl,\n signal,\n meta,\n });\n }\n : undefined);\n\n if (parameters) {\n // @ts-expect-error - Too complex union to type\n return queryClient[queryFilterMethod]({\n ...options,\n // Event if queryFn is undefined, it will override the default queryFn from `setQueryDefaults(...)`\n ...(queryFn ? { queryFn } : {}),\n queryKey: infinite\n ? composeInfiniteQueryKey(schema, parameters)\n : composeQueryKey(schema, parameters),\n });\n }\n\n // @ts-expect-error - Too complex union to type\n return queryClient[queryFilterMethod]({ ...options, queryFn });\n}\n\ntype QueryClientMethodArgs<QMethod extends keyof QueryClientPrototype> = [\n options: Parameters<QueryClientPrototype[QMethod]>[0] & {\n parameters?: unknown;\n baseUrl?: string;\n requestFn?: RequestFn<unknown>;\n },\n queryClient: QueryClient,\n];\n\ntype QueryKeyMethods =\n | QueryKeyMethod<'fetchQuery'>\n | QueryKeyMethod<'prefetchQuery'>\n | QueryKeyMethod<'fetchInfiniteQuery'>\n | QueryKeyMethod<'prefetchInfiniteQuery'>;\n\ntype QueryClientPrototype = typeof QueryClient.prototype;\n\ntype QueryKeyMethod<QFMethod extends keyof typeof QueryClient.prototype> =\n QFMethod;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qCAAwC;AACxC,6BAAgC;AAEhC,wBAA2B;AAMpB,SAAS,kCAGd,mBACA,QACA,UACA,MACsD;AACtD,QAAM,CAAC,EAAE,WAAW,SAAS,YAAY,GAAG,QAAQ,GAAG,WAAW,IAAI;AAEtE,MAAI,CAAC,YAAa,OAAM,IAAI,MAAM,yBAAyB;AAC3D,MAAI,CAAC,YAAY,iBAAiB;AAChC,UAAM,IAAI;AAAA,MACR,2BAA2B,iBAAiB;AAAA,IAC9C;AAEF,MAAI,QAAQ,YAAY,YAAY;AAClC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,MAAI,QAAQ,WAAW,WAAW;AAChC,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,QAAM,UACJ,QAAQ,YACP;AAAA;AAAA,IAEG,SAAU,EAAE,UAAU,CAAC,EAAE,WAAW,GAAG,QAAQ,MAAM,UAAU,GAAG;AAChE,aAAO,UAAU,QAAQ;AAAA,QACvB,YAAY,eACP,8BAAW,GAAG,aAAa,SAAS,IACrC;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,MACA;AAEN,MAAI,YAAY;AAEd,WAAO,YAAY,iBAAiB,EAAE;AAAA,MACpC,GAAG;AAAA;AAAA,MAEH,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;AAAA,MAC7B,UAAU,eACN,wDAAwB,QAAQ,UAAU,QAC1C,wCAAgB,QAAQ,UAAU;AAAA,IACxC,CAAC;AAAA,EACH;AAGA,SAAO,YAAY,iBAAiB,EAAE,EAAE,GAAG,SAAS,QAAQ,CAAC;AAC/D;","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var callQueryClientMethodWithMutationFilters_exports = {};
|
|
20
|
+
__export(callQueryClientMethodWithMutationFilters_exports, {
|
|
21
|
+
callQueryClientMethodWithMutationFilters: () => callQueryClientMethodWithMutationFilters
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(callQueryClientMethodWithMutationFilters_exports);
|
|
24
|
+
var import_composeMutationFilters = require("./composeMutationFilters.js");
|
|
25
|
+
function callQueryClientMethodWithMutationFilters(queryFilterMethod, schema, args) {
|
|
26
|
+
const filters = args.length > 1 ? args[0] : void 0;
|
|
27
|
+
const queryClient = args[args.length - 1];
|
|
28
|
+
if (!queryClient) throw new Error("queryClient is required");
|
|
29
|
+
if (!queryClient[queryFilterMethod])
|
|
30
|
+
throw new Error(
|
|
31
|
+
`queryClient is invalid, ${queryFilterMethod} method does not exist`
|
|
32
|
+
);
|
|
33
|
+
return queryClient[queryFilterMethod](
|
|
34
|
+
(0, import_composeMutationFilters.composeMutationFilters)(schema, filters),
|
|
35
|
+
...args.slice(1, -1)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
callQueryClientMethodWithMutationFilters
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=callQueryClientMethodWithMutationFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/callQueryClientMethodWithMutationFilters.ts"],"sourcesContent":["import type { QueryClient } from '@tanstack/query-core';\n\nimport { composeMutationFilters } from './composeMutationFilters.js';\nimport type { OperationSchema } from './requestFn.js';\n\n/**\n * Calls a query client method with mutation filters and options,\n * and automatically composes the `MutationKey` based on the schema and parameters.\n */\nexport function callQueryClientMethodWithMutationFilters<\n QFMethod extends QueryFilterMethods,\n>(\n queryFilterMethod: QFMethod,\n schema: OperationSchema,\n args: [...Parameters<(typeof QueryClient.prototype)[QFMethod]>, QueryClient]\n): ReturnType<(typeof QueryClient.prototype)[QFMethod]> {\n const filters = args.length > 1 ? args[0] : undefined;\n const queryClient = args[args.length - 1] as QueryClient | undefined;\n\n if (!queryClient) throw new Error('queryClient is required');\n if (!queryClient[queryFilterMethod])\n throw new Error(\n `queryClient is invalid, ${queryFilterMethod} method does not exist`\n );\n\n // @ts-expect-error - Too complex to type\n return queryClient[queryFilterMethod](\n composeMutationFilters(schema, filters as never),\n // @ts-expect-error - Argument types are too complex\n ...args.slice(1, -1)\n );\n}\n\ntype QueryFiltersMethod<QFMethod extends keyof typeof QueryClient.prototype> =\n QFMethod;\n\ntype QueryFilterMethods = QueryFiltersMethod<'isMutating'>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oCAAuC;AAOhC,SAAS,yCAGd,mBACA,QACA,MACsD;AACtD,QAAM,UAAU,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI;AAC5C,QAAM,cAAc,KAAK,KAAK,SAAS,CAAC;AAExC,MAAI,CAAC,YAAa,OAAM,IAAI,MAAM,yBAAyB;AAC3D,MAAI,CAAC,YAAY,iBAAiB;AAChC,UAAM,IAAI;AAAA,MACR,2BAA2B,iBAAiB;AAAA,IAC9C;AAGF,SAAO,YAAY,iBAAiB;AAAA,QAClC,sDAAuB,QAAQ,OAAgB;AAAA,IAE/C,GAAG,KAAK,MAAM,GAAG,EAAE;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var callQueryClientMethodWithQueryFilters_exports = {};
|
|
20
|
+
__export(callQueryClientMethodWithQueryFilters_exports, {
|
|
21
|
+
callQueryClientMethodWithQueryFilters: () => callQueryClientMethodWithQueryFilters
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(callQueryClientMethodWithQueryFilters_exports);
|
|
24
|
+
var import_composeQueryFilters = require("./composeQueryFilters.js");
|
|
25
|
+
function callQueryClientMethodWithQueryFilters(queryFilterMethod, schema, args) {
|
|
26
|
+
const filters = args.length > 1 ? args[0] : void 0;
|
|
27
|
+
const queryClient = args[args.length - 1];
|
|
28
|
+
if (!queryClient) throw new Error("queryClient is required");
|
|
29
|
+
if (!queryClient[queryFilterMethod])
|
|
30
|
+
throw new Error(
|
|
31
|
+
`queryClient is invalid, ${queryFilterMethod} method does not exist`
|
|
32
|
+
);
|
|
33
|
+
return queryClient[queryFilterMethod](
|
|
34
|
+
(0, import_composeQueryFilters.composeQueryFilters)(schema, filters),
|
|
35
|
+
...args.slice(1, -1)
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
callQueryClientMethodWithQueryFilters
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=callQueryClientMethodWithQueryFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/callQueryClientMethodWithQueryFilters.ts"],"sourcesContent":["import type { QueryClient } from '@tanstack/query-core';\n\nimport { composeQueryFilters } from './composeQueryFilters.js';\nimport type { OperationSchema } from './requestFn.js';\n\n/**\n * Calls a query client method with query filters and options,\n * and automatically composes the `QueryKey` based on the schema and parameters.\n */\nexport function callQueryClientMethodWithQueryFilters<\n QFMethod extends QueryFilterMethods,\n>(\n queryFilterMethod: QFMethod,\n schema: OperationSchema,\n args: [...Parameters<(typeof QueryClient.prototype)[QFMethod]>, QueryClient]\n): ReturnType<(typeof QueryClient.prototype)[QFMethod]> {\n const filters = args.length > 1 ? args[0] : undefined;\n const queryClient = args[args.length - 1] as QueryClient | undefined;\n\n if (!queryClient) throw new Error('queryClient is required');\n if (!queryClient[queryFilterMethod])\n throw new Error(\n `queryClient is invalid, ${queryFilterMethod} method does not exist`\n );\n\n // @ts-expect-error - Too complex to type\n return queryClient[queryFilterMethod](\n composeQueryFilters(schema, filters as never),\n // @ts-expect-error - Argument types are too complex\n ...args.slice(1, -1)\n );\n}\n\ntype QueryFiltersMethod<QFMethod extends keyof typeof QueryClient.prototype> =\n QFMethod;\n\ntype QueryFilterMethods =\n | QueryFiltersMethod<'isFetching'>\n | QueryFiltersMethod<'getQueriesData'>\n | QueryFiltersMethod<'setQueriesData'>\n | QueryFiltersMethod<'removeQueries'>\n | QueryFiltersMethod<'resetQueries'>\n | QueryFiltersMethod<'cancelQueries'>\n | QueryFiltersMethod<'invalidateQueries'>\n | QueryFiltersMethod<'refetchQueries'>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iCAAoC;AAO7B,SAAS,sCAGd,mBACA,QACA,MACsD;AACtD,QAAM,UAAU,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI;AAC5C,QAAM,cAAc,KAAK,KAAK,SAAS,CAAC;AAExC,MAAI,CAAC,YAAa,OAAM,IAAI,MAAM,yBAAyB;AAC3D,MAAI,CAAC,YAAY,iBAAiB;AAChC,UAAM,IAAI;AAAA,MACR,2BAA2B,iBAAiB;AAAA,IAC9C;AAGF,SAAO,YAAY,iBAAiB;AAAA,QAClC,gDAAoB,QAAQ,OAAgB;AAAA,IAE5C,GAAG,KAAK,MAAM,GAAG,EAAE;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var callQueryClientMethodWithQueryKey_exports = {};
|
|
20
|
+
__export(callQueryClientMethodWithQueryKey_exports, {
|
|
21
|
+
callQueryClientMethodWithQueryKey: () => callQueryClientMethodWithQueryKey
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(callQueryClientMethodWithQueryKey_exports);
|
|
24
|
+
var import_composeInfiniteQueryKey = require("./composeInfiniteQueryKey.js");
|
|
25
|
+
var import_composeQueryKey = require("./composeQueryKey.js");
|
|
26
|
+
function callQueryClientMethodWithQueryKey(queryFilterMethod, schema, infinite, args) {
|
|
27
|
+
const parameters = args.length > 1 ? args[0] : void 0;
|
|
28
|
+
const queryClient = args[args.length - 1];
|
|
29
|
+
if (!queryClient) throw new Error("queryClient is required");
|
|
30
|
+
if (!queryClient[queryFilterMethod])
|
|
31
|
+
throw new Error(
|
|
32
|
+
`queryClient is invalid, ${queryFilterMethod} method does not exist`
|
|
33
|
+
);
|
|
34
|
+
const queryKey = Array.isArray(parameters) ? parameters : infinite ? (0, import_composeInfiniteQueryKey.composeInfiniteQueryKey)(schema, parameters) : (0, import_composeQueryKey.composeQueryKey)(schema, parameters);
|
|
35
|
+
return queryClient[queryFilterMethod](queryKey, ...args.slice(1, -1));
|
|
36
|
+
}
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
callQueryClientMethodWithQueryKey
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=callQueryClientMethodWithQueryKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/callQueryClientMethodWithQueryKey.ts"],"sourcesContent":["import type { QueryClient } from '@tanstack/query-core';\n\nimport { composeInfiniteQueryKey } from './composeInfiniteQueryKey.js';\nimport { composeQueryKey } from './composeQueryKey.js';\nimport type { OperationSchema } from './requestFn.js';\n\n/**\n * Calls a query client method with parameters and options,\n * and automatically composes the `QueryKey` based on the schema and parameters.\n */\nexport function callQueryClientMethodWithQueryKey<\n QFMethod extends QueryKeyMethods,\n>(\n queryFilterMethod: QFMethod,\n schema: OperationSchema,\n infinite: boolean,\n args: [...Parameters<(typeof QueryClient.prototype)[QFMethod]>, QueryClient]\n): ReturnType<(typeof QueryClient.prototype)[QFMethod]> {\n const parameters = args.length > 1 ? args[0] : undefined;\n const queryClient = args[args.length - 1] as QueryClient | undefined;\n\n if (!queryClient) throw new Error('queryClient is required');\n if (!queryClient[queryFilterMethod])\n throw new Error(\n `queryClient is invalid, ${queryFilterMethod} method does not exist`\n );\n\n const queryKey = Array.isArray(parameters)\n ? parameters\n : infinite\n ? composeInfiniteQueryKey(schema, parameters)\n : composeQueryKey(schema, parameters);\n\n // @ts-expect-error - Too complex to type\n return queryClient[queryFilterMethod](queryKey, ...args.slice(1, -1));\n}\n\ntype QueryKeyMethod<QFMethod extends keyof typeof QueryClient.prototype> =\n QFMethod;\n\ntype QueryKeyMethods =\n | QueryKeyMethod<'setQueryData'>\n | QueryKeyMethod<'getQueryData'>\n | QueryKeyMethod<'getQueryState'>\n | QueryKeyMethod<'setQueryDefaults'>\n | QueryKeyMethod<'getQueryDefaults'>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qCAAwC;AACxC,6BAAgC;AAOzB,SAAS,kCAGd,mBACA,QACA,UACA,MACsD;AACtD,QAAM,aAAa,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI;AAC/C,QAAM,cAAc,KAAK,KAAK,SAAS,CAAC;AAExC,MAAI,CAAC,YAAa,OAAM,IAAI,MAAM,yBAAyB;AAC3D,MAAI,CAAC,YAAY,iBAAiB;AAChC,UAAM,IAAI;AAAA,MACR,2BAA2B,iBAAiB;AAAA,IAC9C;AAEF,QAAM,WAAW,MAAM,QAAQ,UAAU,IACrC,aACA,eACE,wDAAwB,QAAQ,UAAU,QAC1C,wCAAgB,QAAQ,UAAU;AAGxC,SAAO,YAAY,iBAAiB,EAAE,UAAU,GAAG,KAAK,MAAM,GAAG,EAAE,CAAC;AACtE;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var composeBaseQueryKey_exports = {};
|
|
20
|
+
__export(composeBaseQueryKey_exports, {
|
|
21
|
+
composeBaseQueryKey: () => composeBaseQueryKey
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(composeBaseQueryKey_exports);
|
|
24
|
+
function composeBaseQueryKey(schema, parameters, infinite) {
|
|
25
|
+
return [
|
|
26
|
+
typeof infinite === "boolean" ? { ...schema, infinite } : schema,
|
|
27
|
+
parameters ?? {}
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
composeBaseQueryKey
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=composeBaseQueryKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/composeBaseQueryKey.ts"],"sourcesContent":["import type {\n ServiceOperationInfiniteQueryKey,\n ServiceOperationQueryKey,\n} from '../service-operation/ServiceOperationKey.js';\nimport type { OperationSchema } from './requestFn.js';\n\nexport function composeBaseQueryKey<TSchema extends OperationSchema, TParams>(\n schema: TSchema,\n parameters: TParams | undefined,\n infinite: undefined\n): [TSchema, TParams];\nexport function composeBaseQueryKey<TSchema extends OperationSchema, TParams>(\n schema: TSchema,\n parameters: TParams | undefined,\n infinite: true\n): ServiceOperationInfiniteQueryKey<TSchema, TParams>;\nexport function composeBaseQueryKey<TSchema extends OperationSchema, TParams>(\n schema: TSchema,\n parameters: TParams | undefined,\n infinite: false\n): ServiceOperationQueryKey<TSchema, TParams>;\nexport function composeBaseQueryKey<TSchema extends OperationSchema, TParams>(\n schema: TSchema,\n parameters: TParams | undefined,\n infinite: boolean | undefined\n):\n | ServiceOperationQueryKey<TSchema, TParams>\n | ServiceOperationInfiniteQueryKey<TSchema, TParams>\n | [TSchema, TParams] {\n return [\n typeof infinite === 'boolean' ? { ...schema, infinite } : schema,\n parameters ?? ({} as TParams),\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBO,SAAS,oBACd,QACA,YACA,UAIqB;AACrB,SAAO;AAAA,IACL,OAAO,aAAa,YAAY,EAAE,GAAG,QAAQ,SAAS,IAAI;AAAA,IAC1D,cAAe,CAAC;AAAA,EAClB;AACF;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var composeInfiniteQueryKey_exports = {};
|
|
20
|
+
__export(composeInfiniteQueryKey_exports, {
|
|
21
|
+
composeInfiniteQueryKey: () => composeInfiniteQueryKey
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(composeInfiniteQueryKey_exports);
|
|
24
|
+
var import_composeBaseQueryKey = require("./composeBaseQueryKey.js");
|
|
25
|
+
function composeInfiniteQueryKey(schema, parameters) {
|
|
26
|
+
return (0, import_composeBaseQueryKey.composeBaseQueryKey)(schema, parameters, true);
|
|
27
|
+
}
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
composeInfiniteQueryKey
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=composeInfiniteQueryKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/composeInfiniteQueryKey.ts"],"sourcesContent":["import type { ServiceOperationInfiniteQueryKey } from '../service-operation/ServiceOperationKey.js';\nimport { composeBaseQueryKey } from './composeBaseQueryKey.js';\nimport type { OperationSchema } from './requestFn.js';\n\nexport function composeInfiniteQueryKey<\n TSchema extends OperationSchema,\n TParams,\n>(\n schema: TSchema,\n parameters: TParams | undefined\n): ServiceOperationInfiniteQueryKey<TSchema, TParams> {\n return composeBaseQueryKey(schema, parameters, true);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iCAAoC;AAG7B,SAAS,wBAId,QACA,YACoD;AACpD,aAAO,gDAAoB,QAAQ,YAAY,IAAI;AACrD;","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var composeMutationFilters_exports = {};
|
|
20
|
+
__export(composeMutationFilters_exports, {
|
|
21
|
+
composeMutationFilters: () => composeMutationFilters
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(composeMutationFilters_exports);
|
|
24
|
+
var import_composeMutationKey = require("./composeMutationKey.js");
|
|
25
|
+
function composeMutationFilters(schema, filters) {
|
|
26
|
+
if (!filters) {
|
|
27
|
+
return {
|
|
28
|
+
mutationKey: (0, import_composeMutationKey.composeMutationKey)(schema, void 0)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (filters && "mutationKey" in filters && "parameters" in filters) {
|
|
32
|
+
throw new Error(
|
|
33
|
+
`'composeMutationFilters': 'mutationKey' and 'parameters' cannot be used together`
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
if ("mutationKey" in filters) {
|
|
37
|
+
return filters;
|
|
38
|
+
}
|
|
39
|
+
if ("parameters" in filters) {
|
|
40
|
+
const { parameters, ...filtersWithoutParameters } = filters;
|
|
41
|
+
Object.assign(filtersWithoutParameters, {
|
|
42
|
+
mutationKey: (0, import_composeMutationKey.composeMutationKey)(schema, parameters)
|
|
43
|
+
});
|
|
44
|
+
return filtersWithoutParameters;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
...filters,
|
|
48
|
+
mutationKey: (0, import_composeMutationKey.composeMutationKey)(schema, void 0)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
composeMutationFilters
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=composeMutationFilters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/composeMutationFilters.ts"],"sourcesContent":["import { composeMutationKey } from './composeMutationKey.js';\nimport type { OperationSchema } from './requestFn.js';\n\n/**\n * Replaces the `parameters` field in the filters with a `mutationKey` field based on the schema.\n * If no filters are provided, a `mutationKey` will be composed schema's base query key.\n * @param schema\n * @param filters\n */\nexport function composeMutationFilters<Filters extends object>(\n schema: OperationSchema,\n filters: Filters | undefined\n) {\n if (!filters) {\n return {\n mutationKey: composeMutationKey(schema, undefined),\n };\n }\n\n if (filters && 'mutationKey' in filters && 'parameters' in filters) {\n throw new Error(\n `'composeMutationFilters': 'mutationKey' and 'parameters' cannot be used together`\n );\n }\n\n if ('mutationKey' in filters) {\n return filters;\n }\n\n if ('parameters' in filters) {\n const { parameters, ...filtersWithoutParameters } = filters;\n\n Object.assign(filtersWithoutParameters, {\n mutationKey: composeMutationKey(schema, parameters),\n });\n\n return filtersWithoutParameters;\n }\n\n return {\n ...filters,\n mutationKey: composeMutationKey(schema, undefined),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAmC;AAS5B,SAAS,uBACd,QACA,SACA;AACA,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,MACL,iBAAa,8CAAmB,QAAQ,MAAS;AAAA,IACnD;AAAA,EACF;AAEA,MAAI,WAAW,iBAAiB,WAAW,gBAAgB,SAAS;AAClE,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,MAAI,iBAAiB,SAAS;AAC5B,WAAO;AAAA,EACT;AAEA,MAAI,gBAAgB,SAAS;AAC3B,UAAM,EAAE,YAAY,GAAG,yBAAyB,IAAI;AAEpD,WAAO,OAAO,0BAA0B;AAAA,MACtC,iBAAa,8CAAmB,QAAQ,UAAU;AAAA,IACpD,CAAC;AAED,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,iBAAa,8CAAmB,QAAQ,MAAS;AAAA,EACnD;AACF;","names":[]}
|