@openapi-qraft/react 1.11.0-beta.2 → 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.
Files changed (371) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/QraftContext.js +31 -0
  3. package/dist/cjs/QraftContext.js.map +1 -0
  4. package/dist/cjs/ServiceOperation.js +17 -0
  5. package/dist/cjs/ServiceOperation.js.map +1 -0
  6. package/dist/cjs/Unstable_QraftSecureRequestFn.js +214 -0
  7. package/dist/cjs/Unstable_QraftSecureRequestFn.js.map +1 -0
  8. package/dist/cjs/callbacks/cancelQueries.js +36 -0
  9. package/dist/cjs/callbacks/cancelQueries.js.map +1 -0
  10. package/dist/cjs/callbacks/fetchInfiniteQuery.js +37 -0
  11. package/dist/cjs/callbacks/fetchInfiniteQuery.js.map +1 -0
  12. package/dist/cjs/callbacks/fetchQuery.js +37 -0
  13. package/dist/cjs/callbacks/fetchQuery.js.map +1 -0
  14. package/dist/cjs/callbacks/getInfiniteQueryData.js +37 -0
  15. package/dist/cjs/callbacks/getInfiniteQueryData.js.map +1 -0
  16. package/dist/cjs/callbacks/getInfiniteQueryKey.js +32 -0
  17. package/dist/cjs/callbacks/getInfiniteQueryKey.js.map +1 -0
  18. package/dist/cjs/callbacks/getInfiniteQueryState.js +37 -0
  19. package/dist/cjs/callbacks/getInfiniteQueryState.js.map +1 -0
  20. package/dist/cjs/callbacks/getMutationKey.js +32 -0
  21. package/dist/cjs/callbacks/getMutationKey.js.map +1 -0
  22. package/dist/cjs/callbacks/getQueriesData.js +36 -0
  23. package/dist/cjs/callbacks/getQueriesData.js.map +1 -0
  24. package/dist/cjs/callbacks/getQueryData.js +37 -0
  25. package/dist/cjs/callbacks/getQueryData.js.map +1 -0
  26. package/dist/cjs/callbacks/getQueryKey.js +32 -0
  27. package/dist/cjs/callbacks/getQueryKey.js.map +1 -0
  28. package/dist/cjs/callbacks/getQueryState.js +37 -0
  29. package/dist/cjs/callbacks/getQueryState.js.map +1 -0
  30. package/dist/cjs/callbacks/index.js +131 -0
  31. package/dist/cjs/callbacks/index.js.map +1 -0
  32. package/dist/cjs/callbacks/invalidateQueries.js +36 -0
  33. package/dist/cjs/callbacks/invalidateQueries.js.map +1 -0
  34. package/dist/cjs/callbacks/isFetching.js +36 -0
  35. package/dist/cjs/callbacks/isFetching.js.map +1 -0
  36. package/dist/cjs/callbacks/isMutating.js +36 -0
  37. package/dist/cjs/callbacks/isMutating.js.map +1 -0
  38. package/dist/cjs/callbacks/mutationFn.js +35 -0
  39. package/dist/cjs/callbacks/mutationFn.js.map +1 -0
  40. package/dist/cjs/callbacks/operationInvokeFn.js +41 -0
  41. package/dist/cjs/callbacks/operationInvokeFn.js.map +1 -0
  42. package/dist/cjs/callbacks/prefetchInfiniteQuery.js +37 -0
  43. package/dist/cjs/callbacks/prefetchInfiniteQuery.js.map +1 -0
  44. package/dist/cjs/callbacks/prefetchQuery.js +37 -0
  45. package/dist/cjs/callbacks/prefetchQuery.js.map +1 -0
  46. package/dist/cjs/callbacks/queryFn.js +39 -0
  47. package/dist/cjs/callbacks/queryFn.js.map +1 -0
  48. package/dist/cjs/callbacks/refetchQueries.js +36 -0
  49. package/dist/cjs/callbacks/refetchQueries.js.map +1 -0
  50. package/dist/cjs/callbacks/removeQueries.js +36 -0
  51. package/dist/cjs/callbacks/removeQueries.js.map +1 -0
  52. package/dist/cjs/callbacks/resetQueries.js +36 -0
  53. package/dist/cjs/callbacks/resetQueries.js.map +1 -0
  54. package/dist/cjs/callbacks/setInfiniteQueryData.js +37 -0
  55. package/dist/cjs/callbacks/setInfiniteQueryData.js.map +1 -0
  56. package/dist/cjs/callbacks/setQueriesData.js +36 -0
  57. package/dist/cjs/callbacks/setQueriesData.js.map +1 -0
  58. package/dist/cjs/callbacks/setQueryData.js +37 -0
  59. package/dist/cjs/callbacks/setQueryData.js.map +1 -0
  60. package/dist/cjs/callbacks/useInfiniteQuery.js +36 -0
  61. package/dist/cjs/callbacks/useInfiniteQuery.js.map +1 -0
  62. package/dist/cjs/callbacks/useIsFetching.js +39 -0
  63. package/dist/cjs/callbacks/useIsFetching.js.map +1 -0
  64. package/dist/cjs/callbacks/useIsMutating.js +39 -0
  65. package/dist/cjs/callbacks/useIsMutating.js.map +1 -0
  66. package/dist/cjs/callbacks/useMutation.js +66 -0
  67. package/dist/cjs/callbacks/useMutation.js.map +1 -0
  68. package/dist/cjs/callbacks/useMutationState.js +42 -0
  69. package/dist/cjs/callbacks/useMutationState.js.map +1 -0
  70. package/dist/cjs/callbacks/useQueries.js +69 -0
  71. package/dist/cjs/callbacks/useQueries.js.map +1 -0
  72. package/dist/cjs/callbacks/useQuery.js +36 -0
  73. package/dist/cjs/callbacks/useQuery.js.map +1 -0
  74. package/dist/cjs/callbacks/useSuspenseInfiniteQuery.js +36 -0
  75. package/dist/cjs/callbacks/useSuspenseInfiniteQuery.js.map +1 -0
  76. package/dist/cjs/callbacks/useSuspenseQueries.js +69 -0
  77. package/dist/cjs/callbacks/useSuspenseQueries.js.map +1 -0
  78. package/dist/cjs/callbacks/useSuspenseQuery.js +36 -0
  79. package/dist/cjs/callbacks/useSuspenseQuery.js.map +1 -0
  80. package/dist/cjs/index.js +63 -0
  81. package/dist/cjs/index.js.map +1 -0
  82. package/dist/cjs/lib/PartialParameters.type.js +17 -0
  83. package/dist/cjs/lib/PartialParameters.type.js.map +1 -0
  84. package/dist/cjs/lib/callQueryClientFetchMethod.js +69 -0
  85. package/dist/cjs/lib/callQueryClientFetchMethod.js.map +1 -0
  86. package/dist/cjs/lib/callQueryClientMethodWithMutationFilters.js +42 -0
  87. package/dist/cjs/lib/callQueryClientMethodWithMutationFilters.js.map +1 -0
  88. package/dist/cjs/lib/callQueryClientMethodWithQueryFilters.js +42 -0
  89. package/dist/cjs/lib/callQueryClientMethodWithQueryFilters.js.map +1 -0
  90. package/dist/cjs/lib/callQueryClientMethodWithQueryKey.js +41 -0
  91. package/dist/cjs/lib/callQueryClientMethodWithQueryKey.js.map +1 -0
  92. package/dist/cjs/lib/composeBaseQueryKey.js +34 -0
  93. package/dist/cjs/lib/composeBaseQueryKey.js.map +1 -0
  94. package/dist/cjs/lib/composeInfiniteQueryKey.js +32 -0
  95. package/dist/cjs/lib/composeInfiniteQueryKey.js.map +1 -0
  96. package/dist/cjs/lib/composeMutationFilters.js +55 -0
  97. package/dist/cjs/lib/composeMutationFilters.js.map +1 -0
  98. package/dist/cjs/lib/composeMutationKey.js +52 -0
  99. package/dist/cjs/lib/composeMutationKey.js.map +1 -0
  100. package/dist/cjs/lib/composeQueryFilters.js +57 -0
  101. package/dist/cjs/lib/composeQueryFilters.js.map +1 -0
  102. package/dist/cjs/lib/composeQueryKey.js +32 -0
  103. package/dist/cjs/lib/composeQueryKey.js.map +1 -0
  104. package/dist/cjs/lib/createRecursiveProxy.js +49 -0
  105. package/dist/cjs/lib/createRecursiveProxy.js.map +1 -0
  106. package/dist/cjs/lib/jwt-decode/index.js +91 -0
  107. package/dist/cjs/lib/jwt-decode/index.js.map +1 -0
  108. package/dist/cjs/lib/requestFn.js +202 -0
  109. package/dist/cjs/lib/requestFn.js.map +1 -0
  110. package/dist/cjs/lib/shelfMerge.js +53 -0
  111. package/dist/cjs/lib/shelfMerge.js.map +1 -0
  112. package/dist/cjs/lib/useComposeUseQueryOptions.js +56 -0
  113. package/dist/cjs/lib/useComposeUseQueryOptions.js.map +1 -0
  114. package/dist/cjs/lib/useQueryClient.js +38 -0
  115. package/dist/cjs/lib/useQueryClient.js.map +1 -0
  116. package/dist/cjs/qraftAPIClient.js +77 -0
  117. package/dist/cjs/qraftAPIClient.js.map +1 -0
  118. package/dist/cjs/service-operation/OperationInfiniteData.js +17 -0
  119. package/dist/cjs/service-operation/OperationInfiniteData.js.map +1 -0
  120. package/dist/cjs/service-operation/QueryFilters.js +17 -0
  121. package/dist/cjs/service-operation/QueryFilters.js.map +1 -0
  122. package/dist/cjs/service-operation/ServiceOperation.js +17 -0
  123. package/dist/cjs/service-operation/ServiceOperation.js.map +1 -0
  124. package/dist/cjs/service-operation/ServiceOperationCancelQueries.js +17 -0
  125. package/dist/cjs/service-operation/ServiceOperationCancelQueries.js.map +1 -0
  126. package/dist/cjs/service-operation/ServiceOperationFetchInfiniteQuery.js +17 -0
  127. package/dist/cjs/service-operation/ServiceOperationFetchInfiniteQuery.js.map +1 -0
  128. package/dist/cjs/service-operation/ServiceOperationFetchQuery.js +17 -0
  129. package/dist/cjs/service-operation/ServiceOperationFetchQuery.js.map +1 -0
  130. package/dist/cjs/service-operation/ServiceOperationGetInfiniteQueryData.js +17 -0
  131. package/dist/cjs/service-operation/ServiceOperationGetInfiniteQueryData.js.map +1 -0
  132. package/dist/cjs/service-operation/ServiceOperationGetQueriesData.js +17 -0
  133. package/dist/cjs/service-operation/ServiceOperationGetQueriesData.js.map +1 -0
  134. package/dist/cjs/service-operation/ServiceOperationGetQueryData.js +17 -0
  135. package/dist/cjs/service-operation/ServiceOperationGetQueryData.js.map +1 -0
  136. package/dist/cjs/service-operation/ServiceOperationGetQueryState.js +17 -0
  137. package/dist/cjs/service-operation/ServiceOperationGetQueryState.js.map +1 -0
  138. package/dist/cjs/service-operation/ServiceOperationInvalidateQueries.js +17 -0
  139. package/dist/cjs/service-operation/ServiceOperationInvalidateQueries.js.map +1 -0
  140. package/dist/cjs/service-operation/ServiceOperationIsFetchingQueries.js +17 -0
  141. package/dist/cjs/service-operation/ServiceOperationIsFetchingQueries.js.map +1 -0
  142. package/dist/cjs/service-operation/ServiceOperationIsMutatingQueries.js +17 -0
  143. package/dist/cjs/service-operation/ServiceOperationIsMutatingQueries.js.map +1 -0
  144. package/dist/cjs/service-operation/ServiceOperationKey.js +17 -0
  145. package/dist/cjs/service-operation/ServiceOperationKey.js.map +1 -0
  146. package/dist/cjs/service-operation/ServiceOperationMutationFn.js +17 -0
  147. package/dist/cjs/service-operation/ServiceOperationMutationFn.js.map +1 -0
  148. package/dist/cjs/service-operation/ServiceOperationQueryFn.js +17 -0
  149. package/dist/cjs/service-operation/ServiceOperationQueryFn.js.map +1 -0
  150. package/dist/cjs/service-operation/ServiceOperationRefetchQueries.js +17 -0
  151. package/dist/cjs/service-operation/ServiceOperationRefetchQueries.js.map +1 -0
  152. package/dist/cjs/service-operation/ServiceOperationRemoveQueries.js +17 -0
  153. package/dist/cjs/service-operation/ServiceOperationRemoveQueries.js.map +1 -0
  154. package/dist/cjs/service-operation/ServiceOperationResetQueries.js +17 -0
  155. package/dist/cjs/service-operation/ServiceOperationResetQueries.js.map +1 -0
  156. package/dist/cjs/service-operation/ServiceOperationSetInfiniteQueryData.js +17 -0
  157. package/dist/cjs/service-operation/ServiceOperationSetInfiniteQueryData.js.map +1 -0
  158. package/dist/cjs/service-operation/ServiceOperationSetQueriesData.js +17 -0
  159. package/dist/cjs/service-operation/ServiceOperationSetQueriesData.js.map +1 -0
  160. package/dist/cjs/service-operation/ServiceOperationSetQueryData.js +17 -0
  161. package/dist/cjs/service-operation/ServiceOperationSetQueryData.js.map +1 -0
  162. package/dist/cjs/service-operation/ServiceOperationUseInfiniteQuery.js +17 -0
  163. package/dist/cjs/service-operation/ServiceOperationUseInfiniteQuery.js.map +1 -0
  164. package/dist/cjs/service-operation/ServiceOperationUseIsFetchingQueries.js +17 -0
  165. package/dist/cjs/service-operation/ServiceOperationUseIsFetchingQueries.js.map +1 -0
  166. package/dist/cjs/service-operation/ServiceOperationUseIsMutating.js +17 -0
  167. package/dist/cjs/service-operation/ServiceOperationUseIsMutating.js.map +1 -0
  168. package/dist/cjs/service-operation/ServiceOperationUseMutation.js +17 -0
  169. package/dist/cjs/service-operation/ServiceOperationUseMutation.js.map +1 -0
  170. package/dist/cjs/service-operation/ServiceOperationUseMutationState.js +17 -0
  171. package/dist/cjs/service-operation/ServiceOperationUseMutationState.js.map +1 -0
  172. package/dist/cjs/service-operation/ServiceOperationUseQueries.js +17 -0
  173. package/dist/cjs/service-operation/ServiceOperationUseQueries.js.map +1 -0
  174. package/dist/cjs/service-operation/ServiceOperationUseQuery.js +17 -0
  175. package/dist/cjs/service-operation/ServiceOperationUseQuery.js.map +1 -0
  176. package/dist/cjs/service-operation/ServiceOperationUseSuspenseInfiniteQuery.js +17 -0
  177. package/dist/cjs/service-operation/ServiceOperationUseSuspenseInfiniteQuery.js.map +1 -0
  178. package/dist/cjs/service-operation/ServiceOperationUseSuspenseQueries.js +17 -0
  179. package/dist/cjs/service-operation/ServiceOperationUseSuspenseQueries.js.map +1 -0
  180. package/dist/cjs/service-operation/ServiceOperationUseSuspenseQueryQuery.js +17 -0
  181. package/dist/cjs/service-operation/ServiceOperationUseSuspenseQueryQuery.js.map +1 -0
  182. package/dist/cjs/service-operation/index.js +17 -0
  183. package/dist/cjs/service-operation/index.js.map +1 -0
  184. package/dist/esm/QraftContext.js +7 -0
  185. package/dist/esm/QraftContext.js.map +1 -0
  186. package/dist/esm/ServiceOperation.js +1 -0
  187. package/dist/esm/ServiceOperation.js.map +1 -0
  188. package/dist/esm/Unstable_QraftSecureRequestFn.js +190 -0
  189. package/dist/esm/Unstable_QraftSecureRequestFn.js.map +1 -0
  190. package/dist/esm/callbacks/cancelQueries.js +12 -0
  191. package/dist/esm/callbacks/cancelQueries.js.map +1 -0
  192. package/dist/esm/callbacks/fetchInfiniteQuery.js +13 -0
  193. package/dist/esm/callbacks/fetchInfiniteQuery.js.map +1 -0
  194. package/dist/esm/callbacks/fetchQuery.js +13 -0
  195. package/dist/esm/callbacks/fetchQuery.js.map +1 -0
  196. package/dist/esm/callbacks/getInfiniteQueryData.js +13 -0
  197. package/dist/esm/callbacks/getInfiniteQueryData.js.map +1 -0
  198. package/dist/esm/callbacks/getInfiniteQueryKey.js +8 -0
  199. package/dist/esm/callbacks/getInfiniteQueryKey.js.map +1 -0
  200. package/dist/esm/callbacks/getInfiniteQueryState.js +13 -0
  201. package/dist/esm/callbacks/getInfiniteQueryState.js.map +1 -0
  202. package/dist/esm/callbacks/getMutationKey.js +8 -0
  203. package/dist/esm/callbacks/getMutationKey.js.map +1 -0
  204. package/dist/esm/callbacks/getQueriesData.js +12 -0
  205. package/dist/esm/callbacks/getQueriesData.js.map +1 -0
  206. package/dist/esm/callbacks/getQueryData.js +13 -0
  207. package/dist/esm/callbacks/getQueryData.js.map +1 -0
  208. package/dist/esm/callbacks/getQueryKey.js +8 -0
  209. package/dist/esm/callbacks/getQueryKey.js.map +1 -0
  210. package/dist/esm/callbacks/getQueryState.js +13 -0
  211. package/dist/esm/callbacks/getQueryState.js.map +1 -0
  212. package/dist/esm/callbacks/index.js +73 -0
  213. package/dist/esm/callbacks/index.js.map +1 -0
  214. package/dist/esm/callbacks/invalidateQueries.js +12 -0
  215. package/dist/esm/callbacks/invalidateQueries.js.map +1 -0
  216. package/dist/esm/callbacks/isFetching.js +12 -0
  217. package/dist/esm/callbacks/isFetching.js.map +1 -0
  218. package/dist/esm/callbacks/isMutating.js +12 -0
  219. package/dist/esm/callbacks/isMutating.js.map +1 -0
  220. package/dist/esm/callbacks/mutationFn.js +11 -0
  221. package/dist/esm/callbacks/mutationFn.js.map +1 -0
  222. package/dist/esm/callbacks/operationInvokeFn.js +17 -0
  223. package/dist/esm/callbacks/operationInvokeFn.js.map +1 -0
  224. package/dist/esm/callbacks/prefetchInfiniteQuery.js +13 -0
  225. package/dist/esm/callbacks/prefetchInfiniteQuery.js.map +1 -0
  226. package/dist/esm/callbacks/prefetchQuery.js +13 -0
  227. package/dist/esm/callbacks/prefetchQuery.js.map +1 -0
  228. package/dist/esm/callbacks/queryFn.js +15 -0
  229. package/dist/esm/callbacks/queryFn.js.map +1 -0
  230. package/dist/esm/callbacks/refetchQueries.js +12 -0
  231. package/dist/esm/callbacks/refetchQueries.js.map +1 -0
  232. package/dist/esm/callbacks/removeQueries.js +12 -0
  233. package/dist/esm/callbacks/removeQueries.js.map +1 -0
  234. package/dist/esm/callbacks/resetQueries.js +12 -0
  235. package/dist/esm/callbacks/resetQueries.js.map +1 -0
  236. package/dist/esm/callbacks/setInfiniteQueryData.js +13 -0
  237. package/dist/esm/callbacks/setInfiniteQueryData.js.map +1 -0
  238. package/dist/esm/callbacks/setQueriesData.js +12 -0
  239. package/dist/esm/callbacks/setQueriesData.js.map +1 -0
  240. package/dist/esm/callbacks/setQueryData.js +13 -0
  241. package/dist/esm/callbacks/setQueryData.js.map +1 -0
  242. package/dist/esm/callbacks/useInfiniteQuery.js +14 -0
  243. package/dist/esm/callbacks/useInfiniteQuery.js.map +1 -0
  244. package/dist/esm/callbacks/useIsFetching.js +15 -0
  245. package/dist/esm/callbacks/useIsFetching.js.map +1 -0
  246. package/dist/esm/callbacks/useIsMutating.js +17 -0
  247. package/dist/esm/callbacks/useIsMutating.js.map +1 -0
  248. package/dist/esm/callbacks/useMutation.js +44 -0
  249. package/dist/esm/callbacks/useMutation.js.map +1 -0
  250. package/dist/esm/callbacks/useMutationState.js +20 -0
  251. package/dist/esm/callbacks/useMutationState.js.map +1 -0
  252. package/dist/esm/callbacks/useQueries.js +47 -0
  253. package/dist/esm/callbacks/useQueries.js.map +1 -0
  254. package/dist/esm/callbacks/useQuery.js +14 -0
  255. package/dist/esm/callbacks/useQuery.js.map +1 -0
  256. package/dist/esm/callbacks/useSuspenseInfiniteQuery.js +14 -0
  257. package/dist/esm/callbacks/useSuspenseInfiniteQuery.js.map +1 -0
  258. package/dist/esm/callbacks/useSuspenseQueries.js +47 -0
  259. package/dist/esm/callbacks/useSuspenseQueries.js.map +1 -0
  260. package/dist/esm/callbacks/useSuspenseQuery.js +14 -0
  261. package/dist/esm/callbacks/useSuspenseQuery.js.map +1 -0
  262. package/dist/esm/index.js +15 -1206
  263. package/dist/esm/index.js.map +1 -1
  264. package/dist/esm/lib/PartialParameters.type.js +1 -0
  265. package/dist/esm/lib/PartialParameters.type.js.map +1 -0
  266. package/dist/esm/lib/callQueryClientFetchMethod.js +45 -0
  267. package/dist/esm/lib/callQueryClientFetchMethod.js.map +1 -0
  268. package/dist/esm/lib/callQueryClientMethodWithMutationFilters.js +18 -0
  269. package/dist/esm/lib/callQueryClientMethodWithMutationFilters.js.map +1 -0
  270. package/dist/esm/lib/callQueryClientMethodWithQueryFilters.js +18 -0
  271. package/dist/esm/lib/callQueryClientMethodWithQueryFilters.js.map +1 -0
  272. package/dist/esm/lib/callQueryClientMethodWithQueryKey.js +17 -0
  273. package/dist/esm/lib/callQueryClientMethodWithQueryKey.js.map +1 -0
  274. package/dist/esm/lib/composeBaseQueryKey.js +10 -0
  275. package/dist/esm/lib/composeBaseQueryKey.js.map +1 -0
  276. package/dist/esm/lib/composeInfiniteQueryKey.js +8 -0
  277. package/dist/esm/lib/composeInfiniteQueryKey.js.map +1 -0
  278. package/dist/esm/lib/composeMutationFilters.js +31 -0
  279. package/dist/esm/lib/composeMutationFilters.js.map +1 -0
  280. package/dist/esm/lib/composeMutationKey.js +27 -0
  281. package/dist/esm/lib/composeMutationKey.js.map +1 -0
  282. package/dist/esm/lib/composeQueryFilters.js +33 -0
  283. package/dist/esm/lib/composeQueryFilters.js.map +1 -0
  284. package/dist/esm/lib/composeQueryKey.js +8 -0
  285. package/dist/esm/lib/composeQueryKey.js.map +1 -0
  286. package/dist/esm/lib/createRecursiveProxy.js +25 -0
  287. package/dist/esm/lib/createRecursiveProxy.js.map +1 -0
  288. package/dist/esm/lib/jwt-decode/index.js +65 -0
  289. package/dist/esm/lib/jwt-decode/index.js.map +1 -0
  290. package/dist/esm/lib/requestFn.js +174 -0
  291. package/dist/esm/lib/requestFn.js.map +1 -0
  292. package/dist/esm/lib/shelfMerge.js +29 -0
  293. package/dist/esm/lib/shelfMerge.js.map +1 -0
  294. package/dist/esm/lib/useComposeUseQueryOptions.js +32 -0
  295. package/dist/esm/lib/useComposeUseQueryOptions.js.map +1 -0
  296. package/dist/esm/lib/useQueryClient.js +16 -0
  297. package/dist/esm/lib/useQueryClient.js.map +1 -0
  298. package/dist/esm/qraftAPIClient.js +53 -0
  299. package/dist/esm/qraftAPIClient.js.map +1 -0
  300. package/dist/esm/service-operation/OperationInfiniteData.js +1 -0
  301. package/dist/esm/service-operation/OperationInfiniteData.js.map +1 -0
  302. package/dist/esm/service-operation/QueryFilters.js +1 -0
  303. package/dist/esm/service-operation/QueryFilters.js.map +1 -0
  304. package/dist/esm/service-operation/ServiceOperation.js +1 -0
  305. package/dist/esm/service-operation/ServiceOperation.js.map +1 -0
  306. package/dist/esm/service-operation/ServiceOperationCancelQueries.js +1 -0
  307. package/dist/esm/service-operation/ServiceOperationCancelQueries.js.map +1 -0
  308. package/dist/esm/service-operation/ServiceOperationFetchInfiniteQuery.js +1 -0
  309. package/dist/esm/service-operation/ServiceOperationFetchInfiniteQuery.js.map +1 -0
  310. package/dist/esm/service-operation/ServiceOperationFetchQuery.js +1 -0
  311. package/dist/esm/service-operation/ServiceOperationFetchQuery.js.map +1 -0
  312. package/dist/esm/service-operation/ServiceOperationGetInfiniteQueryData.js +1 -0
  313. package/dist/esm/service-operation/ServiceOperationGetInfiniteQueryData.js.map +1 -0
  314. package/dist/esm/service-operation/ServiceOperationGetQueriesData.js +1 -0
  315. package/dist/esm/service-operation/ServiceOperationGetQueriesData.js.map +1 -0
  316. package/dist/esm/service-operation/ServiceOperationGetQueryData.js +1 -0
  317. package/dist/esm/service-operation/ServiceOperationGetQueryData.js.map +1 -0
  318. package/dist/esm/service-operation/ServiceOperationGetQueryState.js +1 -0
  319. package/dist/esm/service-operation/ServiceOperationGetQueryState.js.map +1 -0
  320. package/dist/esm/service-operation/ServiceOperationInvalidateQueries.js +1 -0
  321. package/dist/esm/service-operation/ServiceOperationInvalidateQueries.js.map +1 -0
  322. package/dist/esm/service-operation/ServiceOperationIsFetchingQueries.js +1 -0
  323. package/dist/esm/service-operation/ServiceOperationIsFetchingQueries.js.map +1 -0
  324. package/dist/esm/service-operation/ServiceOperationIsMutatingQueries.js +1 -0
  325. package/dist/esm/service-operation/ServiceOperationIsMutatingQueries.js.map +1 -0
  326. package/dist/esm/service-operation/ServiceOperationKey.js +1 -0
  327. package/dist/esm/service-operation/ServiceOperationKey.js.map +1 -0
  328. package/dist/esm/service-operation/ServiceOperationMutationFn.js +1 -0
  329. package/dist/esm/service-operation/ServiceOperationMutationFn.js.map +1 -0
  330. package/dist/esm/service-operation/ServiceOperationQueryFn.js +1 -0
  331. package/dist/esm/service-operation/ServiceOperationQueryFn.js.map +1 -0
  332. package/dist/esm/service-operation/ServiceOperationRefetchQueries.js +1 -0
  333. package/dist/esm/service-operation/ServiceOperationRefetchQueries.js.map +1 -0
  334. package/dist/esm/service-operation/ServiceOperationRemoveQueries.js +1 -0
  335. package/dist/esm/service-operation/ServiceOperationRemoveQueries.js.map +1 -0
  336. package/dist/esm/service-operation/ServiceOperationResetQueries.js +1 -0
  337. package/dist/esm/service-operation/ServiceOperationResetQueries.js.map +1 -0
  338. package/dist/esm/service-operation/ServiceOperationSetInfiniteQueryData.js +1 -0
  339. package/dist/esm/service-operation/ServiceOperationSetInfiniteQueryData.js.map +1 -0
  340. package/dist/esm/service-operation/ServiceOperationSetQueriesData.js +1 -0
  341. package/dist/esm/service-operation/ServiceOperationSetQueriesData.js.map +1 -0
  342. package/dist/esm/service-operation/ServiceOperationSetQueryData.js +1 -0
  343. package/dist/esm/service-operation/ServiceOperationSetQueryData.js.map +1 -0
  344. package/dist/esm/service-operation/ServiceOperationUseInfiniteQuery.js +1 -0
  345. package/dist/esm/service-operation/ServiceOperationUseInfiniteQuery.js.map +1 -0
  346. package/dist/esm/service-operation/ServiceOperationUseIsFetchingQueries.js +1 -0
  347. package/dist/esm/service-operation/ServiceOperationUseIsFetchingQueries.js.map +1 -0
  348. package/dist/esm/service-operation/ServiceOperationUseIsMutating.js +1 -0
  349. package/dist/esm/service-operation/ServiceOperationUseIsMutating.js.map +1 -0
  350. package/dist/esm/service-operation/ServiceOperationUseMutation.js +1 -0
  351. package/dist/esm/service-operation/ServiceOperationUseMutation.js.map +1 -0
  352. package/dist/esm/service-operation/ServiceOperationUseMutationState.js +1 -0
  353. package/dist/esm/service-operation/ServiceOperationUseMutationState.js.map +1 -0
  354. package/dist/esm/service-operation/ServiceOperationUseQueries.js +1 -0
  355. package/dist/esm/service-operation/ServiceOperationUseQueries.js.map +1 -0
  356. package/dist/esm/service-operation/ServiceOperationUseQuery.js +1 -0
  357. package/dist/esm/service-operation/ServiceOperationUseQuery.js.map +1 -0
  358. package/dist/esm/service-operation/ServiceOperationUseSuspenseInfiniteQuery.js +1 -0
  359. package/dist/esm/service-operation/ServiceOperationUseSuspenseInfiniteQuery.js.map +1 -0
  360. package/dist/esm/service-operation/ServiceOperationUseSuspenseQueries.js +1 -0
  361. package/dist/esm/service-operation/ServiceOperationUseSuspenseQueries.js.map +1 -0
  362. package/dist/esm/service-operation/ServiceOperationUseSuspenseQueryQuery.js +1 -0
  363. package/dist/esm/service-operation/ServiceOperationUseSuspenseQueryQuery.js.map +1 -0
  364. package/dist/esm/service-operation/index.js +1 -0
  365. package/dist/esm/service-operation/index.js.map +1 -0
  366. package/dist/types/index.d.ts +1 -1
  367. package/dist/types/index.d.ts.map +1 -1
  368. package/package.json +8 -13
  369. package/src/index.ts +1 -1
  370. package/dist/cjs/index.cjs +0 -1267
  371. package/dist/cjs/index.cjs.map +0 -1
@@ -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":[]}