@everysk/apps-sdk 0.2.0 → 0.3.0-beta-20261016180126

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 (349) hide show
  1. package/README.md +298 -12
  2. package/dist/EveryskApp.d.ts +34 -2
  3. package/dist/EveryskApp.d.ts.map +1 -1
  4. package/dist/EveryskApp.js +35 -2
  5. package/dist/EveryskApp.js.map +1 -1
  6. package/dist/agGrid/handleRowsScrollEnd.d.ts +53 -0
  7. package/dist/agGrid/handleRowsScrollEnd.d.ts.map +1 -0
  8. package/dist/agGrid/handleRowsScrollEnd.js +47 -0
  9. package/dist/agGrid/handleRowsScrollEnd.js.map +1 -0
  10. package/dist/agGrid/index.d.ts +2 -0
  11. package/dist/agGrid/index.d.ts.map +1 -1
  12. package/dist/agGrid/index.js +2 -1
  13. package/dist/api/datastore.d.ts +10 -8
  14. package/dist/api/datastore.d.ts.map +1 -1
  15. package/dist/api/datastore.js +24 -55
  16. package/dist/api/datastore.js.map +1 -1
  17. package/dist/api/entityQuery.d.ts +46 -41
  18. package/dist/api/entityQuery.d.ts.map +1 -1
  19. package/dist/api/entityQuery.js +55 -14
  20. package/dist/api/entityQuery.js.map +1 -1
  21. package/dist/api/file.d.ts +26 -9
  22. package/dist/api/file.d.ts.map +1 -1
  23. package/dist/api/file.js +45 -55
  24. package/dist/api/file.js.map +1 -1
  25. package/dist/api/portfolio.d.ts +11 -8
  26. package/dist/api/portfolio.d.ts.map +1 -1
  27. package/dist/api/portfolio.js +24 -55
  28. package/dist/api/portfolio.js.map +1 -1
  29. package/dist/api/profile.d.ts +3 -2
  30. package/dist/api/profile.d.ts.map +1 -1
  31. package/dist/api/profile.js +4 -9
  32. package/dist/api/profile.js.map +1 -1
  33. package/dist/api/request.d.ts +106 -0
  34. package/dist/api/request.d.ts.map +1 -0
  35. package/dist/api/request.js +132 -0
  36. package/dist/api/request.js.map +1 -0
  37. package/dist/api/websocketsConfig.d.ts +7 -2
  38. package/dist/api/websocketsConfig.d.ts.map +1 -1
  39. package/dist/api/websocketsConfig.js +2 -10
  40. package/dist/api/websocketsConfig.js.map +1 -1
  41. package/dist/api/workflow.d.ts +84 -89
  42. package/dist/api/workflow.d.ts.map +1 -1
  43. package/dist/api/workflow.js +121 -208
  44. package/dist/api/workflow.js.map +1 -1
  45. package/dist/api/workspace.d.ts +18 -8
  46. package/dist/api/workspace.d.ts.map +1 -1
  47. package/dist/api/workspace.js +21 -26
  48. package/dist/api/workspace.js.map +1 -1
  49. package/dist/components/ui/Footer/index.d.ts.map +1 -1
  50. package/dist/components/ui/Footer/index.js.map +1 -1
  51. package/dist/components/ui/GlobalLoading/index.d.ts.map +1 -1
  52. package/dist/components/ui/GlobalLoading/index.js.map +1 -1
  53. package/dist/components/ui/PageContainer/index.d.ts +1 -1
  54. package/dist/components/ui/PageContainer/index.d.ts.map +1 -1
  55. package/dist/components/ui/PageContainer/index.js.map +1 -1
  56. package/dist/components/ui/Toolbar/index.d.ts +40 -3
  57. package/dist/components/ui/Toolbar/index.d.ts.map +1 -1
  58. package/dist/components/ui/Toolbar/index.js +42 -15
  59. package/dist/components/ui/Toolbar/index.js.map +1 -1
  60. package/dist/contexts/appAlertContext/provider.js.map +1 -1
  61. package/dist/contexts/appAlertContext/types.d.ts.map +1 -1
  62. package/dist/contexts/appConfigContext/index.d.ts.map +1 -1
  63. package/dist/contexts/appConfigContext/index.js.map +1 -1
  64. package/dist/contexts/appConfigContext/provider.d.ts.map +1 -1
  65. package/dist/contexts/appConfigContext/provider.js.map +1 -1
  66. package/dist/contexts/webSocketContext/handler.d.ts +3 -2
  67. package/dist/contexts/webSocketContext/handler.d.ts.map +1 -1
  68. package/dist/contexts/webSocketContext/handler.js.map +1 -1
  69. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.d.ts +1 -1
  70. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js +1 -1
  71. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js.map +1 -1
  72. package/dist/contexts/webSocketContext/provider.d.ts +6 -3
  73. package/dist/contexts/webSocketContext/provider.d.ts.map +1 -1
  74. package/dist/contexts/webSocketContext/provider.js +42 -7
  75. package/dist/contexts/webSocketContext/provider.js.map +1 -1
  76. package/dist/contexts/webSocketContext/types.d.ts +7 -5
  77. package/dist/contexts/webSocketContext/types.d.ts.map +1 -1
  78. package/dist/file/index.d.ts +2 -0
  79. package/dist/file/index.d.ts.map +1 -1
  80. package/dist/hooks/datastore/useDatastoreMutations.d.ts +4 -4
  81. package/dist/hooks/datastore/useDatastoreMutations.d.ts.map +1 -1
  82. package/dist/hooks/datastore/useDatastoreMutations.js +17 -55
  83. package/dist/hooks/datastore/useDatastoreMutations.js.map +1 -1
  84. package/dist/hooks/datastore/useFetchDatastore.d.ts +30 -41
  85. package/dist/hooks/datastore/useFetchDatastore.d.ts.map +1 -1
  86. package/dist/hooks/datastore/useFetchDatastore.js +25 -59
  87. package/dist/hooks/datastore/useFetchDatastore.js.map +1 -1
  88. package/dist/hooks/datastore/useFetchDatastores.d.ts +47 -52
  89. package/dist/hooks/datastore/useFetchDatastores.d.ts.map +1 -1
  90. package/dist/hooks/datastore/useFetchDatastores.js +55 -70
  91. package/dist/hooks/datastore/useFetchDatastores.js.map +1 -1
  92. package/dist/hooks/file/fileData.d.ts +17 -0
  93. package/dist/hooks/file/fileData.d.ts.map +1 -0
  94. package/dist/hooks/file/fileData.js +10 -0
  95. package/dist/hooks/file/fileData.js.map +1 -0
  96. package/dist/hooks/file/useFetchFile.d.ts +38 -58
  97. package/dist/hooks/file/useFetchFile.d.ts.map +1 -1
  98. package/dist/hooks/file/useFetchFile.js +26 -66
  99. package/dist/hooks/file/useFetchFile.js.map +1 -1
  100. package/dist/hooks/file/useFetchFiles.d.ts +18 -52
  101. package/dist/hooks/file/useFetchFiles.d.ts.map +1 -1
  102. package/dist/hooks/file/useFetchFiles.js +53 -69
  103. package/dist/hooks/file/useFetchFiles.js.map +1 -1
  104. package/dist/hooks/file/useFileMutations.d.ts +9 -8
  105. package/dist/hooks/file/useFileMutations.d.ts.map +1 -1
  106. package/dist/hooks/file/useFileMutations.js +23 -60
  107. package/dist/hooks/file/useFileMutations.js.map +1 -1
  108. package/dist/hooks/portfolio/useFetchPortfolio.d.ts +16 -50
  109. package/dist/hooks/portfolio/useFetchPortfolio.d.ts.map +1 -1
  110. package/dist/hooks/portfolio/useFetchPortfolio.js +15 -63
  111. package/dist/hooks/portfolio/useFetchPortfolio.js.map +1 -1
  112. package/dist/hooks/portfolio/useFetchPortfolios.d.ts +13 -52
  113. package/dist/hooks/portfolio/useFetchPortfolios.d.ts.map +1 -1
  114. package/dist/hooks/portfolio/useFetchPortfolios.js +29 -71
  115. package/dist/hooks/portfolio/useFetchPortfolios.js.map +1 -1
  116. package/dist/hooks/portfolio/usePortfolioMutations.d.ts +8 -8
  117. package/dist/hooks/portfolio/usePortfolioMutations.d.ts.map +1 -1
  118. package/dist/hooks/portfolio/usePortfolioMutations.js +20 -58
  119. package/dist/hooks/portfolio/usePortfolioMutations.js.map +1 -1
  120. package/dist/hooks/profile/useFetchProfile.d.ts +18 -44
  121. package/dist/hooks/profile/useFetchProfile.d.ts.map +1 -1
  122. package/dist/hooks/profile/useFetchProfile.js +16 -48
  123. package/dist/hooks/profile/useFetchProfile.js.map +1 -1
  124. package/dist/hooks/useAxios.js.map +1 -1
  125. package/dist/hooks/useEntityInfiniteQuery.d.ts +88 -0
  126. package/dist/hooks/useEntityInfiniteQuery.d.ts.map +1 -0
  127. package/dist/hooks/useEntityInfiniteQuery.js +111 -0
  128. package/dist/hooks/useEntityInfiniteQuery.js.map +1 -0
  129. package/dist/hooks/useEntityMutation.d.ts +47 -0
  130. package/dist/hooks/useEntityMutation.d.ts.map +1 -0
  131. package/dist/hooks/useEntityMutation.js +58 -0
  132. package/dist/hooks/useEntityMutation.js.map +1 -0
  133. package/dist/hooks/useEntityQuery.d.ts +68 -0
  134. package/dist/hooks/useEntityQuery.d.ts.map +1 -0
  135. package/dist/hooks/useEntityQuery.js +75 -0
  136. package/dist/hooks/useEntityQuery.js.map +1 -0
  137. package/dist/hooks/workflow/useFetchWorkerExecution.d.ts +17 -34
  138. package/dist/hooks/workflow/useFetchWorkerExecution.d.ts.map +1 -1
  139. package/dist/hooks/workflow/useFetchWorkerExecution.js +16 -46
  140. package/dist/hooks/workflow/useFetchWorkerExecution.js.map +1 -1
  141. package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts +179 -41
  142. package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts.map +1 -1
  143. package/dist/hooks/workflow/useFetchWorkerExecutions.js +29 -62
  144. package/dist/hooks/workflow/useFetchWorkerExecutions.js.map +1 -1
  145. package/dist/hooks/workflow/useFetchWorkflow.d.ts +16 -35
  146. package/dist/hooks/workflow/useFetchWorkflow.d.ts.map +1 -1
  147. package/dist/hooks/workflow/useFetchWorkflow.js +15 -48
  148. package/dist/hooks/workflow/useFetchWorkflow.js.map +1 -1
  149. package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts +17 -34
  150. package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts.map +1 -1
  151. package/dist/hooks/workflow/useFetchWorkflowExecution.js +16 -46
  152. package/dist/hooks/workflow/useFetchWorkflowExecution.js.map +1 -1
  153. package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts +22 -36
  154. package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts.map +1 -1
  155. package/dist/hooks/workflow/useFetchWorkflowExecutions.js +43 -56
  156. package/dist/hooks/workflow/useFetchWorkflowExecutions.js.map +1 -1
  157. package/dist/hooks/workflow/useFetchWorkflows.d.ts +20 -37
  158. package/dist/hooks/workflow/useFetchWorkflows.d.ts.map +1 -1
  159. package/dist/hooks/workflow/useFetchWorkflows.js +32 -47
  160. package/dist/hooks/workflow/useFetchWorkflows.js.map +1 -1
  161. package/dist/hooks/workflow/useRunWorkflow.d.ts +21 -16
  162. package/dist/hooks/workflow/useRunWorkflow.d.ts.map +1 -1
  163. package/dist/hooks/workflow/useRunWorkflow.js +66 -29
  164. package/dist/hooks/workflow/useRunWorkflow.js.map +1 -1
  165. package/dist/hooks/workflow/useTriggerWorkflow.d.ts +20 -0
  166. package/dist/hooks/workflow/useTriggerWorkflow.d.ts.map +1 -0
  167. package/dist/hooks/workflow/useTriggerWorkflow.js +32 -0
  168. package/dist/hooks/workflow/useTriggerWorkflow.js.map +1 -0
  169. package/dist/hooks/workspace/useFetchWorkspace.d.ts +19 -34
  170. package/dist/hooks/workspace/useFetchWorkspace.d.ts.map +1 -1
  171. package/dist/hooks/workspace/useFetchWorkspace.js +16 -46
  172. package/dist/hooks/workspace/useFetchWorkspace.js.map +1 -1
  173. package/dist/hooks/workspace/useFetchWorkspaces.d.ts +17 -37
  174. package/dist/hooks/workspace/useFetchWorkspaces.d.ts.map +1 -1
  175. package/dist/hooks/workspace/useFetchWorkspaces.js +25 -47
  176. package/dist/hooks/workspace/useFetchWorkspaces.js.map +1 -1
  177. package/dist/index.d.ts +13 -10
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +13 -11
  180. package/dist/lib/abort.d.ts +58 -0
  181. package/dist/lib/abort.d.ts.map +1 -0
  182. package/dist/lib/abort.js +112 -0
  183. package/dist/lib/abort.js.map +1 -0
  184. package/dist/lib/datastoreTable.d.ts +59 -54
  185. package/dist/lib/datastoreTable.d.ts.map +1 -1
  186. package/dist/lib/datastoreTable.js +58 -62
  187. package/dist/lib/datastoreTable.js.map +1 -1
  188. package/dist/lib/file.d.ts +34 -0
  189. package/dist/lib/file.d.ts.map +1 -0
  190. package/dist/lib/file.js +63 -0
  191. package/dist/lib/file.js.map +1 -0
  192. package/dist/lib/queryClient.d.ts.map +1 -1
  193. package/dist/lib/queryClient.js.map +1 -1
  194. package/dist/lib/workflowRun.d.ts +91 -0
  195. package/dist/lib/workflowRun.d.ts.map +1 -0
  196. package/dist/lib/workflowRun.js +224 -0
  197. package/dist/lib/workflowRun.js.map +1 -0
  198. package/dist/socket/index.d.ts +1 -3
  199. package/dist/socket/index.d.ts.map +1 -1
  200. package/dist/socket/index.js +3 -5
  201. package/dist/test/mocks/index.d.ts +1 -1
  202. package/dist/test/mocks/index.d.ts.map +1 -1
  203. package/dist/test/renderWithProviders.d.ts +2 -2
  204. package/dist/test/renderWithProviders.d.ts.map +1 -1
  205. package/dist/test/renderWithProviders.js.map +1 -1
  206. package/dist/test/setup.js.map +1 -1
  207. package/dist/theme/index.d.ts +1 -1
  208. package/dist/theme/index.d.ts.map +1 -1
  209. package/dist/theme/overrides/index.d.ts +4 -2
  210. package/dist/theme/overrides/index.d.ts.map +1 -1
  211. package/dist/theme/overrides/index.js +5 -3
  212. package/dist/theme/overrides/index.js.map +1 -1
  213. package/dist/theme/overrides/muiButton.d.ts +2 -2
  214. package/dist/theme/overrides/muiButton.js.map +1 -1
  215. package/dist/theme/overrides/muiCssBaseline.d.ts.map +1 -1
  216. package/dist/theme/overrides/muiCssBaseline.js.map +1 -1
  217. package/dist/theme/overrides/muiDatePicker.js.map +1 -1
  218. package/dist/theme/overrides/muiFormControl.js.map +1 -1
  219. package/dist/theme/overrides/muiIconButton.d.ts +2 -2
  220. package/dist/theme/overrides/muiIconButton.js.map +1 -1
  221. package/dist/theme/overrides/muiSelect.d.ts.map +1 -1
  222. package/dist/theme/overrides/muiSelect.js.map +1 -1
  223. package/dist/theme/overrides/muiSvgIcon.d.ts.map +1 -1
  224. package/dist/theme/overrides/muiSvgIcon.js.map +1 -1
  225. package/dist/theme/overrides/muiTextField.js.map +1 -1
  226. package/dist/theme/overrides/muiToggleButton.d.ts +2 -2
  227. package/dist/theme/overrides/muiToggleButton.js.map +1 -1
  228. package/dist/theme/overrides/muiToggleButtonGroup.d.ts +2 -2
  229. package/dist/theme/overrides/muiToggleButtonGroup.js.map +1 -1
  230. package/dist/theme/themes/DefaultDark.js +2 -2
  231. package/dist/theme/themes/DefaultDark.js.map +1 -1
  232. package/dist/theme/themes/DefaultLight.js +2 -2
  233. package/dist/theme/themes/DefaultLight.js.map +1 -1
  234. package/dist/theme/themes/EveryskDark.js +2 -2
  235. package/dist/theme/themes/EveryskDark.js.map +1 -1
  236. package/dist/theme/themes/EveryskLight.js +2 -2
  237. package/dist/theme/themes/EveryskLight.js.map +1 -1
  238. package/dist/theme/themes/MidnightEmber.js +2 -2
  239. package/dist/theme/themes/MidnightEmber.js.map +1 -1
  240. package/dist/types/anyRecord.d.ts.map +1 -1
  241. package/dist/types/datastore.d.ts +35 -5
  242. package/dist/types/datastore.d.ts.map +1 -1
  243. package/dist/types/datastoreDataFormat.d.ts +13 -0
  244. package/dist/types/datastoreDataFormat.d.ts.map +1 -0
  245. package/dist/types/entityQuery.d.ts +86 -16
  246. package/dist/types/entityQuery.d.ts.map +1 -1
  247. package/dist/types/file.d.ts +7 -3
  248. package/dist/types/file.d.ts.map +1 -1
  249. package/dist/types/portfolio.d.ts +1 -3
  250. package/dist/types/portfolio.d.ts.map +1 -1
  251. package/dist/types/profile.d.ts +0 -10
  252. package/dist/types/profile.d.ts.map +1 -1
  253. package/dist/types/workflow.d.ts +35 -6
  254. package/dist/types/workflow.d.ts.map +1 -1
  255. package/dist/types/workspace.d.ts +1 -2
  256. package/dist/types/workspace.d.ts.map +1 -1
  257. package/dist/ui/index.d.ts +1 -1
  258. package/dist/ui/index.d.ts.map +1 -1
  259. package/dist/workflow/index.d.ts +2 -0
  260. package/dist/workflow/index.d.ts.map +1 -1
  261. package/package.json +1 -1
  262. package/src/EveryskApp.tsx +53 -2
  263. package/src/agGrid/handleRowsScrollEnd.ts +71 -0
  264. package/src/agGrid/index.ts +5 -1
  265. package/src/api/datastore.ts +79 -107
  266. package/src/api/entityQuery.ts +86 -17
  267. package/src/api/file.ts +110 -103
  268. package/src/api/portfolio.ts +82 -125
  269. package/src/api/profile.ts +25 -18
  270. package/src/api/request.ts +168 -0
  271. package/src/api/websocketsConfig.ts +11 -19
  272. package/src/api/workflow.ts +232 -334
  273. package/src/api/workspace.ts +43 -43
  274. package/src/components/ui/Footer/index.tsx +8 -7
  275. package/src/components/ui/GlobalLoading/index.tsx +13 -3
  276. package/src/components/ui/PageContainer/index.tsx +9 -2
  277. package/src/components/ui/Toolbar/index.tsx +105 -30
  278. package/src/contexts/appAlertContext/provider.tsx +1 -1
  279. package/src/contexts/appAlertContext/types.ts +3 -3
  280. package/src/contexts/appConfigContext/index.tsx +1 -1
  281. package/src/contexts/appConfigContext/provider.tsx +1 -5
  282. package/src/contexts/webSocketContext/handler.ts +8 -2
  283. package/src/contexts/webSocketContext/hooks/useWebSocket/index.ts +1 -1
  284. package/src/contexts/webSocketContext/provider.tsx +64 -14
  285. package/src/contexts/webSocketContext/types.ts +7 -6
  286. package/src/file/index.ts +2 -0
  287. package/src/hooks/datastore/useDatastoreMutations.ts +19 -60
  288. package/src/hooks/datastore/useFetchDatastore.ts +45 -73
  289. package/src/hooks/datastore/useFetchDatastores.ts +106 -131
  290. package/src/hooks/file/fileData.ts +19 -0
  291. package/src/hooks/file/useFetchFile.ts +41 -76
  292. package/src/hooks/file/useFetchFiles.ts +92 -87
  293. package/src/hooks/file/useFileMutations.ts +23 -73
  294. package/src/hooks/portfolio/useFetchPortfolio.ts +26 -78
  295. package/src/hooks/portfolio/useFetchPortfolios.ts +50 -93
  296. package/src/hooks/portfolio/usePortfolioMutations.ts +22 -72
  297. package/src/hooks/profile/useFetchProfile.ts +24 -65
  298. package/src/hooks/useAxios.ts +5 -5
  299. package/src/hooks/useEntityInfiniteQuery.ts +193 -0
  300. package/src/hooks/useEntityMutation.ts +70 -0
  301. package/src/hooks/useEntityQuery.ts +117 -0
  302. package/src/hooks/workflow/useFetchWorkerExecution.ts +27 -56
  303. package/src/hooks/workflow/useFetchWorkerExecutions.ts +54 -79
  304. package/src/hooks/workflow/useFetchWorkflow.ts +24 -58
  305. package/src/hooks/workflow/useFetchWorkflowExecution.ts +27 -57
  306. package/src/hooks/workflow/useFetchWorkflowExecutions.ts +64 -73
  307. package/src/hooks/workflow/useFetchWorkflows.ts +48 -64
  308. package/src/hooks/workflow/useRunWorkflow.ts +82 -36
  309. package/src/hooks/workflow/useTriggerWorkflow.ts +36 -0
  310. package/src/hooks/workspace/useFetchWorkspace.ts +25 -58
  311. package/src/hooks/workspace/useFetchWorkspaces.ts +38 -69
  312. package/src/index.ts +34 -19
  313. package/src/lib/abort.ts +131 -0
  314. package/src/lib/datastoreTable.ts +127 -74
  315. package/src/lib/file.ts +67 -0
  316. package/src/lib/queryClient.ts +11 -13
  317. package/src/lib/workflowRun.ts +329 -0
  318. package/src/socket/index.ts +1 -3
  319. package/src/test/mocks/index.ts +1 -5
  320. package/src/test/renderWithProviders.tsx +8 -3
  321. package/src/test/setup.ts +16 -16
  322. package/src/theme/index.ts +1 -1
  323. package/src/theme/overrides/index.ts +5 -3
  324. package/src/theme/overrides/muiButton.ts +3 -3
  325. package/src/theme/overrides/muiCssBaseline.ts +11 -12
  326. package/src/theme/overrides/muiDatePicker.ts +2 -2
  327. package/src/theme/overrides/muiFormControl.ts +2 -2
  328. package/src/theme/overrides/muiIconButton.ts +3 -3
  329. package/src/theme/overrides/muiSelect.ts +2 -2
  330. package/src/theme/overrides/muiSvgIcon.ts +2 -2
  331. package/src/theme/overrides/muiTextField.ts +1 -1
  332. package/src/theme/overrides/muiToggleButton.ts +4 -4
  333. package/src/theme/overrides/muiToggleButtonGroup.ts +4 -4
  334. package/src/theme/themes/DefaultDark.ts +2 -2
  335. package/src/theme/themes/DefaultLight.ts +2 -2
  336. package/src/theme/themes/EveryskDark.ts +2 -2
  337. package/src/theme/themes/EveryskLight.ts +2 -2
  338. package/src/theme/themes/MidnightEmber.ts +15 -15
  339. package/src/types/anyRecord.ts +2 -2
  340. package/src/types/datastore.ts +56 -22
  341. package/src/types/datastoreDataFormat.ts +12 -0
  342. package/src/types/entityQuery.ts +122 -38
  343. package/src/types/file.ts +8 -6
  344. package/src/types/portfolio.ts +70 -74
  345. package/src/types/profile.ts +0 -11
  346. package/src/types/workflow.ts +38 -9
  347. package/src/types/workspace.ts +2 -4
  348. package/src/ui/index.ts +1 -1
  349. package/src/workflow/index.ts +5 -0
@@ -1,40 +1,23 @@
1
1
  import type { WorkflowExecution } from "../../types/workflow.d.ts";
2
- import type { EntityQueryOptions } from "../../types/entityQuery.d.ts";
3
- export type FetchWorkflowExecutionProps<TData = WorkflowExecution, TSelected = TData> = {
2
+ import type { FetchEntityProps } from "../../types/entityQuery.d.ts";
3
+ export type FetchWorkflowExecutionProps<TData = WorkflowExecution, TSelected = TData> = FetchEntityProps<TData, TSelected> & {
4
4
  workflowId: string;
5
5
  workflowExecutionId: string;
6
6
  workspace: string;
7
- queryOptions?: EntityQueryOptions<TData, TSelected>;
8
7
  };
9
8
  /**
10
9
  * useFetchWorkflowExecution
11
10
  *
12
- * Data-fetching hook built on TanStack Query to retrieve a single workflow execution.
11
+ * Fetches one execution of a workflow; `data` is the execution, or whatever `select` makes of
12
+ * it. Idle while an id is empty; fails loudly, without a request, while `workspace` is. A failure is shown as an error alert.
13
13
  *
14
- * It also:
15
- * - builds a stable React Query `queryKey` that can be reused by mutation hooks for cache invalidation
16
- * - triggers an error alert via `useAppAlert` whenever `query.error` is present
17
- *
18
- * @param workflowId - Workflow identifier the execution belongs to (required).
19
- * @param workflowExecutionId - Workflow execution identifier (required).
20
- * @param workspace - Workspace the workflow belongs to (required).
21
- * @param queryOptions - TanStack Query options passed through to `useQuery` (e.g., enabled, staleTime, gcTime, etc.).
22
- *
23
- * @returns TanStack Query result extended with `queryKey`.
24
- *
25
- * Example:
26
- * ```ts
27
- * const { data, isLoading } = useFetchWorkflowExecution({
28
- * workflowId: "wf-123",
29
- * workflowExecutionId: "exec-456",
30
- * workspace: "main",
31
- * });
32
- * // data -> WorkflowExecution
33
- * ```
14
+ * @param {FetchWorkflowExecutionProps} props - `workflowId`, `workflowExecutionId`, `workspace`,
15
+ * `select` and TanStack `queryOptions`.
16
+ * @returns {object} The `useQuery` result, plus `queryKey`.
34
17
  */
35
- export declare const useFetchWorkflowExecution: ({ workflowId, workflowExecutionId, workspace, queryOptions }: FetchWorkflowExecutionProps) => {
18
+ export declare const useFetchWorkflowExecution: <TSelected = WorkflowExecution>({ workflowId, workflowExecutionId, workspace, select, queryOptions, }: FetchWorkflowExecutionProps<WorkflowExecution, TSelected>) => {
36
19
  queryKey: string[];
37
- data: WorkflowExecution;
20
+ data: TSelected;
38
21
  error: Error;
39
22
  isError: true;
40
23
  isPending: false;
@@ -57,11 +40,11 @@ export declare const useFetchWorkflowExecution: ({ workflowId, workflowExecution
57
40
  isRefetching: boolean;
58
41
  isStale: boolean;
59
42
  isEnabled: boolean;
60
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
43
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
61
44
  fetchStatus: import("@tanstack/query-core").FetchStatus;
62
45
  } | {
63
46
  queryKey: string[];
64
- data: WorkflowExecution;
47
+ data: TSelected;
65
48
  error: null;
66
49
  isError: false;
67
50
  isPending: false;
@@ -84,7 +67,7 @@ export declare const useFetchWorkflowExecution: ({ workflowId, workflowExecution
84
67
  isRefetching: boolean;
85
68
  isStale: boolean;
86
69
  isEnabled: boolean;
87
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
70
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
88
71
  fetchStatus: import("@tanstack/query-core").FetchStatus;
89
72
  } | {
90
73
  queryKey: string[];
@@ -111,7 +94,7 @@ export declare const useFetchWorkflowExecution: ({ workflowId, workflowExecution
111
94
  isRefetching: boolean;
112
95
  isStale: boolean;
113
96
  isEnabled: boolean;
114
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
97
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
115
98
  fetchStatus: import("@tanstack/query-core").FetchStatus;
116
99
  } | {
117
100
  queryKey: string[];
@@ -138,7 +121,7 @@ export declare const useFetchWorkflowExecution: ({ workflowId, workflowExecution
138
121
  isRefetching: boolean;
139
122
  isStale: boolean;
140
123
  isEnabled: boolean;
141
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
124
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
142
125
  fetchStatus: import("@tanstack/query-core").FetchStatus;
143
126
  } | {
144
127
  queryKey: string[];
@@ -165,11 +148,11 @@ export declare const useFetchWorkflowExecution: ({ workflowId, workflowExecution
165
148
  isRefetching: boolean;
166
149
  isStale: boolean;
167
150
  isEnabled: boolean;
168
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
151
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
169
152
  fetchStatus: import("@tanstack/query-core").FetchStatus;
170
153
  } | {
171
154
  queryKey: string[];
172
- data: WorkflowExecution;
155
+ data: TSelected;
173
156
  isError: false;
174
157
  error: null;
175
158
  isPending: false;
@@ -192,7 +175,7 @@ export declare const useFetchWorkflowExecution: ({ workflowId, workflowExecution
192
175
  isRefetching: boolean;
193
176
  isStale: boolean;
194
177
  isEnabled: boolean;
195
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
178
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
196
179
  fetchStatus: import("@tanstack/query-core").FetchStatus;
197
180
  };
198
181
  //# sourceMappingURL=useFetchWorkflowExecution.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchWorkflowExecution.d.ts","sourceRoot":"","sources":["../../../src/hooks/workflow/useFetchWorkflowExecution.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,MAAM,2BAA2B,CAAC,KAAK,GAAG,iBAAiB,EAAE,SAAS,GAAG,KAAK,IAAI;IACpF,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,kBAAkB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACvD,CAAC;AAQF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,yBAAyB,GAAI,8DAAoF,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BxJ,CAAC"}
1
+ {"version":3,"file":"useFetchWorkflowExecution.d.ts","sourceRoot":"","sources":["../../../src/hooks/workflow/useFetchWorkflowExecution.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,MAAM,2BAA2B,CACnC,KAAK,GAAG,iBAAiB,EACzB,SAAS,GAAG,KAAK,IACjB,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,GAAI,SAAS,GAAG,iBAAiB,EAAE,uEAMtE,2BAA2B,CAAC,iBAAiB,EAAE,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB3D,CAAC"}
@@ -1,65 +1,35 @@
1
- import { useAppAlert } from "../../contexts/appAlertContext/useAppAlert.js";
2
1
  import { useAxios } from "../useAxios.js";
2
+ import { useEntityQuery } from "../useEntityQuery.js";
3
+ import { missingWorkspaceError } from "../../api/entityQuery.js";
3
4
  import { getWorkflowExecution } from "../../api/workflow.js";
4
- import { useEffect } from "react";
5
- import { useQuery } from "@tanstack/react-query";
6
5
  //#region src/hooks/workflow/useFetchWorkflowExecution.ts
7
- var defaultQueryOptions = {
8
- refetchOnMount: "always",
9
- staleTime: 0,
10
- gcTime: 0
11
- };
12
6
  /**
13
7
  * useFetchWorkflowExecution
14
8
  *
15
- * Data-fetching hook built on TanStack Query to retrieve a single workflow execution.
16
- *
17
- * It also:
18
- * - builds a stable React Query `queryKey` that can be reused by mutation hooks for cache invalidation
19
- * - triggers an error alert via `useAppAlert` whenever `query.error` is present
20
- *
21
- * @param workflowId - Workflow identifier the execution belongs to (required).
22
- * @param workflowExecutionId - Workflow execution identifier (required).
23
- * @param workspace - Workspace the workflow belongs to (required).
24
- * @param queryOptions - TanStack Query options passed through to `useQuery` (e.g., enabled, staleTime, gcTime, etc.).
25
- *
26
- * @returns TanStack Query result extended with `queryKey`.
9
+ * Fetches one execution of a workflow; `data` is the execution, or whatever `select` makes of
10
+ * it. Idle while an id is empty; fails loudly, without a request, while `workspace` is. A failure is shown as an error alert.
27
11
  *
28
- * Example:
29
- * ```ts
30
- * const { data, isLoading } = useFetchWorkflowExecution({
31
- * workflowId: "wf-123",
32
- * workflowExecutionId: "exec-456",
33
- * workspace: "main",
34
- * });
35
- * // data -> WorkflowExecution
36
- * ```
12
+ * @param {FetchWorkflowExecutionProps} props - `workflowId`, `workflowExecutionId`, `workspace`,
13
+ * `select` and TanStack `queryOptions`.
14
+ * @returns {object} The `useQuery` result, plus `queryKey`.
37
15
  */
38
- var useFetchWorkflowExecution = ({ workflowId, workflowExecutionId, workspace, queryOptions = defaultQueryOptions }) => {
16
+ var useFetchWorkflowExecution = ({ workflowId, workflowExecutionId, workspace, select, queryOptions }) => {
39
17
  const { api } = useAxios();
40
- const { showAlert } = useAppAlert();
41
18
  const queryKey = [
42
19
  "workflow_execution",
43
20
  workflowId,
44
21
  workflowExecutionId,
45
22
  workspace
46
23
  ];
47
- const query = useQuery({
48
- queryKey,
49
- queryFn: async () => {
50
- return await getWorkflowExecution(api, workflowId, workflowExecutionId, workspace);
51
- },
52
- ...queryOptions ?? {}
53
- });
54
- useEffect(() => {
55
- if (!query.error) return;
56
- showAlert({
57
- severity: "error",
58
- message: query.error.message
59
- });
60
- }, [query.error, showAlert]);
61
24
  return {
62
- ...query,
25
+ ...useEntityQuery({
26
+ queryKey,
27
+ fetchEntity: (signal) => getWorkflowExecution(api, workflowId, workflowExecutionId, workspace, signal),
28
+ select,
29
+ enabled: Boolean(workflowId) && Boolean(workflowExecutionId),
30
+ configError: workspace ? void 0 : missingWorkspaceError("useFetchWorkflowExecution"),
31
+ queryOptions
32
+ }),
63
33
  queryKey
64
34
  };
65
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchWorkflowExecution.js","names":[],"sources":["../../../src/hooks/workflow/useFetchWorkflowExecution.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nimport { useQuery } from \"@tanstack/react-query\";\n\nimport { useAxios } from \"@/hooks/useAxios\";\nimport { useAppAlert } from \"@/contexts/appAlertContext/useAppAlert\";\nimport { getWorkflowExecution } from \"@/api/workflow\";\nimport type { WorkflowExecution } from \"@/types/workflow\";\nimport type { EntityQueryOptions } from \"@/types/entityQuery\";\n\nexport type FetchWorkflowExecutionProps<TData = WorkflowExecution, TSelected = TData> = {\n workflowId: string;\n workflowExecutionId: string;\n workspace: string;\n queryOptions?: EntityQueryOptions<TData, TSelected>;\n};\n\nconst defaultQueryOptions: EntityQueryOptions<WorkflowExecution> = {\n refetchOnMount: \"always\",\n staleTime: 0,\n gcTime: 0,\n};\n\n/**\n * useFetchWorkflowExecution\n *\n * Data-fetching hook built on TanStack Query to retrieve a single workflow execution.\n *\n * It also:\n * - builds a stable React Query `queryKey` that can be reused by mutation hooks for cache invalidation\n * - triggers an error alert via `useAppAlert` whenever `query.error` is present\n *\n * @param workflowId - Workflow identifier the execution belongs to (required).\n * @param workflowExecutionId - Workflow execution identifier (required).\n * @param workspace - Workspace the workflow belongs to (required).\n * @param queryOptions - TanStack Query options passed through to `useQuery` (e.g., enabled, staleTime, gcTime, etc.).\n *\n * @returns TanStack Query result extended with `queryKey`.\n *\n * Example:\n * ```ts\n * const { data, isLoading } = useFetchWorkflowExecution({\n * workflowId: \"wf-123\",\n * workflowExecutionId: \"exec-456\",\n * workspace: \"main\",\n * });\n * // data -> WorkflowExecution\n * ```\n */\nexport const useFetchWorkflowExecution = ({ workflowId, workflowExecutionId, workspace, queryOptions = defaultQueryOptions }: FetchWorkflowExecutionProps) => {\n\n const { api } = useAxios();\n const { showAlert } = useAppAlert();\n\n const queryKey = [\"workflow_execution\", workflowId, workflowExecutionId, workspace];\n\n const query = useQuery<WorkflowExecution>({\n queryKey,\n queryFn: async () => {\n const execution = await getWorkflowExecution(api, workflowId, workflowExecutionId, workspace);\n return execution;\n },\n ...queryOptions ?? {}\n });\n\n useEffect(() => {\n if (!query.error) return;\n\n showAlert({\n severity: \"error\",\n message: query.error.message,\n });\n }, [query.error, showAlert]);\n\n return {\n ...query,\n queryKey,\n };\n};\n"],"mappings":";;;;;;AAiBA,IAAM,sBAA6D;CAC/D,gBAAgB;CAChB,WAAW;CACX,QAAQ;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAa,6BAA6B,EAAE,YAAY,qBAAqB,WAAW,eAAe,0BAAuD;CAE1J,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,EAAE,cAAc,YAAY;CAElC,MAAM,WAAW;EAAC;EAAsB;EAAY;EAAqB;CAAS;CAElF,MAAM,QAAQ,SAA4B;EACtC;EACA,SAAS,YAAY;GAEjB,OAAO,MADiB,qBAAqB,KAAK,YAAY,qBAAqB,SAAS;EAEhG;EACA,GAAG,gBAAgB,CAAC;CACxB,CAAC;CAED,gBAAgB;EACZ,IAAI,CAAC,MAAM,OAAO;EAElB,UAAU;GACN,UAAU;GACV,SAAS,MAAM,MAAM;EACzB,CAAC;CACL,GAAG,CAAC,MAAM,OAAO,SAAS,CAAC;CAE3B,OAAO;EACH,GAAG;EACH;CACJ;AACJ"}
1
+ {"version":3,"file":"useFetchWorkflowExecution.js","names":[],"sources":["../../../src/hooks/workflow/useFetchWorkflowExecution.ts"],"sourcesContent":["import { useAxios } from \"@/hooks/useAxios\";\nimport { useEntityQuery } from \"@/hooks/useEntityQuery\";\nimport { missingWorkspaceError } from \"@/api/entityQuery\";\nimport { getWorkflowExecution } from \"@/api/workflow\";\nimport type { WorkflowExecution } from \"@/types/workflow\";\nimport type { FetchEntityProps } from \"@/types/entityQuery\";\n\nexport type FetchWorkflowExecutionProps<\n TData = WorkflowExecution,\n TSelected = TData,\n> = FetchEntityProps<TData, TSelected> & {\n workflowId: string;\n workflowExecutionId: string;\n workspace: string;\n};\n\n/**\n * useFetchWorkflowExecution\n *\n * Fetches one execution of a workflow; `data` is the execution, or whatever `select` makes of\n * it. Idle while an id is empty; fails loudly, without a request, while `workspace` is. A failure is shown as an error alert.\n *\n * @param {FetchWorkflowExecutionProps} props - `workflowId`, `workflowExecutionId`, `workspace`,\n * `select` and TanStack `queryOptions`.\n * @returns {object} The `useQuery` result, plus `queryKey`.\n */\nexport const useFetchWorkflowExecution = <TSelected = WorkflowExecution>({\n workflowId,\n workflowExecutionId,\n workspace,\n select,\n queryOptions,\n}: FetchWorkflowExecutionProps<WorkflowExecution, TSelected>) => {\n const { api } = useAxios();\n\n const queryKey = [\"workflow_execution\", workflowId, workflowExecutionId, workspace];\n\n const query = useEntityQuery<WorkflowExecution, TSelected>({\n queryKey,\n fetchEntity: (signal) =>\n getWorkflowExecution(api, workflowId, workflowExecutionId, workspace, signal),\n select,\n enabled: Boolean(workflowId) && Boolean(workflowExecutionId),\n configError: workspace ? undefined : missingWorkspaceError(\"useFetchWorkflowExecution\"),\n queryOptions,\n });\n\n return { ...query, queryKey };\n};\n"],"mappings":";;;;;;;;;;;;;;;AA0BA,IAAa,6BAA4D,EACrE,YACA,qBACA,WACA,QACA,mBAC6D;CAC7D,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,WAAW;EAAC;EAAsB;EAAY;EAAqB;CAAS;CAYlF,OAAO;EAAE,GAVK,eAA6C;GACvD;GACA,cAAc,WACV,qBAAqB,KAAK,YAAY,qBAAqB,WAAW,MAAM;GAChF;GACA,SAAS,QAAQ,UAAU,KAAK,QAAQ,mBAAmB;GAC3D,aAAa,YAAY,KAAA,IAAY,sBAAsB,2BAA2B;GACtF;EACJ,CAEY;EAAO;CAAS;AAChC"}
@@ -1,49 +1,35 @@
1
- import { type UseInfiniteQueryOptions, type QueryKey } from "@tanstack/react-query";
2
- import type { FetchEntitiesParams } from "../../types/entityQuery.d.ts";
1
+ import type { FetchEntitiesProps, ListCache } from "../../types/entityQuery.d.ts";
3
2
  import type { WorkflowExecution, WorkflowExecutionListResponse } from "../../types/workflow.d.ts";
4
- type PageToken = string | null;
5
- type InfiniteOptions<TData> = Omit<UseInfiniteQueryOptions<WorkflowExecutionListResponse, Error, TData, QueryKey, PageToken>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
6
- export type FetchInfiniteWorkflowExecutionProps = FetchEntitiesParams<WorkflowExecution[], InfiniteOptions<WorkflowExecution[]>> & {
3
+ /** The query cache of `useFetchWorkflowExecutions`, for typing `setQueryData`. */
4
+ export type WorkflowExecutionsCache = ListCache<WorkflowExecutionListResponse>;
5
+ export type FetchWorkflowExecutionsProps<TData = WorkflowExecution[]> = FetchEntitiesProps<WorkflowExecution, TData, WorkflowExecutionListResponse> & {
7
6
  workflowId: string;
8
- pageSize?: number;
7
+ workspace: string;
8
+ /** Only the executions this worker took part in. */
9
+ workerId?: string;
10
+ /** Include each execution's `resume`, the per-worker summary. */
11
+ withResume?: boolean;
9
12
  };
10
13
  /**
11
14
  * useFetchWorkflowExecutions
12
15
  *
13
- * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
14
- * workflow executions for a given workflow with cursor-based pagination.
16
+ * Lists the executions of one workflow, newest first, with cursor pagination; `query.data` is
17
+ * every loaded page merged, or whatever `select` makes of it. `select`, `fetchAllPages` and the
18
+ * missing-workspace error behave as in `useFetchDatastores`. Idle while `workflowId` is empty.
15
19
  *
16
- * Automatically flattens all pages into a single `WorkflowExecution[]` via `select`.
20
+ * The endpoint takes no filters, order or projection: only a worker id and `withResume`. It used
21
+ * to accept them as props and send them in a JSON query the endpoint ignores, along with the
22
+ * cursor, so every "next page" was the first one.
17
23
  *
18
- * Note: `query.data` returns a flat `WorkflowExecution[]` with all fetched items merged across pages.
24
+ * The key starts with `["workflow_executions", workflowId]`, which is what apps invalidate to
25
+ * refresh the list after running a workflow.
19
26
  *
20
- * @param workflowId - Workflow identifier whose executions to fetch (required).
21
- * @param filters - Filters applied to every page request. Must include a `workspace` filter.
22
- * @param order - Sorting applied to every page request.
23
- * @param projection - Single field to project: `"field"` returns only that field (others come
24
- * back null), `"-field"` returns every field except that one. One field only — lists 500. Omitted when empty.
25
- * @param pageSize - Number of executions to fetch per page. Defaults to `10`.
26
- * @param queryOptions - TanStack Query options passed through to `useInfiniteQuery`.
27
- *
28
- * @returns
29
- * - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
30
- * - `queryKey`: the cache key used by React Query
31
- *
32
- * @example
33
- * ```ts
34
- * const { query } = useFetchWorkflowExecutions({
35
- * workflowId: "wf-123",
36
- * filters: [{ field: "workspace", value: "main" }],
37
- * pageSize: 20,
38
- * });
39
- *
40
- * // Flat list of all fetched executions
41
- * const executions = query.data ?? [];
42
- * ```
27
+ * @param {FetchWorkflowExecutionsProps} props - Workflow id, workspace, worker id,
28
+ * `withResume`, page size, `select`, `fetchAllPages`, `queryOptions`.
29
+ * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.
43
30
  */
44
- export declare function useFetchWorkflowExecutions({ workflowId, filters, order, projection, pageSize, queryOptions }: FetchInfiniteWorkflowExecutionProps): {
45
- query: import("@tanstack/react-query").UseInfiniteQueryResult<WorkflowExecution[], Error>;
31
+ export declare function useFetchWorkflowExecutions<TData = WorkflowExecution[]>({ workflowId, workspace, workerId, withResume, pageSize, select, fetchAllPages, queryOptions, }: FetchWorkflowExecutionsProps<TData>): {
32
+ query: import("@tanstack/react-query").UseInfiniteQueryResult<TData, Error>;
46
33
  queryKey: unknown[];
47
34
  };
48
- export {};
49
35
  //# sourceMappingURL=useFetchWorkflowExecutions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchWorkflowExecutions.d.ts","sourceRoot":"","sources":["../../../src/hooks/workflow/useFetchWorkflowExecutions.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,uBAAuB,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEzF,KAAK,SAAS,GAAG,MAAM,GAAG,IAAI,CAAC;AAE/B,KAAK,eAAe,CAAC,KAAK,IAAI,IAAI,CAAC,uBAAuB,CAAC,6BAA6B,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,kBAAkB,GAAG,kBAAkB,CAAC,CAAC;AAEhM,MAAM,MAAM,mCAAmC,GAAG,mBAAmB,CAAC,iBAAiB,EAAE,EAAE,eAAe,CAAC,iBAAiB,EAAE,CAAC,CAAC,GAAG;IAC/H,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,0BAA0B,CAAC,EAAE,UAAU,EAAE,OAAY,EAAE,KAAU,EAAE,UAAe,EAAE,QAAa,EAAE,YAAY,EAAE,EAAE,mCAAmC;;;EAoCrK"}
1
+ {"version":3,"file":"useFetchWorkflowExecutions.d.ts","sourceRoot":"","sources":["../../../src/hooks/workflow/useFetchWorkflowExecutions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAEzF,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG,SAAS,CAAC,6BAA6B,CAAC,CAAC;AAE/E,MAAM,MAAM,4BAA4B,CAAC,KAAK,GAAG,iBAAiB,EAAE,IAAI,kBAAkB,CACtF,iBAAiB,EACjB,KAAK,EACL,6BAA6B,CAChC,GAAG;IACA,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,GAAG,iBAAiB,EAAE,EAAE,EACpE,UAAU,EACV,SAAS,EACT,QAAQ,EACR,UAAU,EACV,QAAa,EACb,MAAM,EACN,aAAqB,EACrB,YAAY,GACf,EAAE,4BAA4B,CAAC,KAAK,CAAC;;;EAmCrC"}
@@ -1,72 +1,59 @@
1
1
  import { useAxios } from "../useAxios.js";
2
- import { buildQueryKey, buildQueryObject } from "../../api/entityQuery.js";
2
+ import { useEntityInfiniteQuery } from "../useEntityInfiniteQuery.js";
3
+ import { buildQueryKey, missingWorkspaceError } from "../../api/entityQuery.js";
3
4
  import { listWorkflowExecutions } from "../../api/workflow.js";
4
- import { useMemo } from "react";
5
- import { useInfiniteQuery } from "@tanstack/react-query";
6
5
  //#region src/hooks/workflow/useFetchWorkflowExecutions.ts
7
- var defaultQueryOptions = {
8
- refetchOnMount: "always",
9
- staleTime: 0,
10
- gcTime: 0
11
- };
12
6
  /**
13
7
  * useFetchWorkflowExecutions
14
8
  *
15
- * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
16
- * workflow executions for a given workflow with cursor-based pagination.
9
+ * Lists the executions of one workflow, newest first, with cursor pagination; `query.data` is
10
+ * every loaded page merged, or whatever `select` makes of it. `select`, `fetchAllPages` and the
11
+ * missing-workspace error behave as in `useFetchDatastores`. Idle while `workflowId` is empty.
17
12
  *
18
- * Automatically flattens all pages into a single `WorkflowExecution[]` via `select`.
13
+ * The endpoint takes no filters, order or projection: only a worker id and `withResume`. It used
14
+ * to accept them as props and send them in a JSON query the endpoint ignores, along with the
15
+ * cursor, so every "next page" was the first one.
19
16
  *
20
- * Note: `query.data` returns a flat `WorkflowExecution[]` with all fetched items merged across pages.
17
+ * The key starts with `["workflow_executions", workflowId]`, which is what apps invalidate to
18
+ * refresh the list after running a workflow.
21
19
  *
22
- * @param workflowId - Workflow identifier whose executions to fetch (required).
23
- * @param filters - Filters applied to every page request. Must include a `workspace` filter.
24
- * @param order - Sorting applied to every page request.
25
- * @param projection - Single field to project: `"field"` returns only that field (others come
26
- * back null), `"-field"` returns every field except that one. One field only — lists 500. Omitted when empty.
27
- * @param pageSize - Number of executions to fetch per page. Defaults to `10`.
28
- * @param queryOptions - TanStack Query options passed through to `useInfiniteQuery`.
29
- *
30
- * @returns
31
- * - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
32
- * - `queryKey`: the cache key used by React Query
33
- *
34
- * @example
35
- * ```ts
36
- * const { query } = useFetchWorkflowExecutions({
37
- * workflowId: "wf-123",
38
- * filters: [{ field: "workspace", value: "main" }],
39
- * pageSize: 20,
40
- * });
41
- *
42
- * // Flat list of all fetched executions
43
- * const executions = query.data ?? [];
44
- * ```
20
+ * @param {FetchWorkflowExecutionsProps} props - Workflow id, workspace, worker id,
21
+ * `withResume`, page size, `select`, `fetchAllPages`, `queryOptions`.
22
+ * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.
45
23
  */
46
- function useFetchWorkflowExecutions({ workflowId, filters = [], order = [], projection = "", pageSize = 10, queryOptions }) {
24
+ function useFetchWorkflowExecutions({ workflowId, workspace, workerId, withResume, pageSize = 10, select, fetchAllPages = false, queryOptions }) {
47
25
  const { api } = useAxios();
48
- const queryKey = buildQueryKey(["workflow_executions", workflowId], filters);
49
- const mergedQueryOptions = useMemo(() => ({
50
- ...defaultQueryOptions,
51
- ...queryOptions ?? {}
52
- }), [queryOptions]);
26
+ const filters = [...workerId ? [{
27
+ field: "worker_id",
28
+ value: workerId
29
+ }] : [], ...withResume !== void 0 ? [{
30
+ field: "with_resume",
31
+ value: withResume
32
+ }] : []];
33
+ const queryKey = buildQueryKey([
34
+ "workflow_executions",
35
+ workflowId,
36
+ workspace
37
+ ], filters, {
38
+ pageSize,
39
+ fetchAllPages
40
+ });
53
41
  return {
54
- query: useInfiniteQuery({
42
+ query: useEntityInfiniteQuery({
55
43
  queryKey,
56
- initialPageParam: null,
57
- getNextPageParam: (lastPage) => lastPage.next_page_token ?? void 0,
58
- queryFn: async ({ pageParam }) => {
59
- const queryFilter = buildQueryObject({
60
- filters,
61
- order,
62
- projection,
63
- pageSize,
64
- pageToken: pageParam ?? void 0
65
- });
66
- return await listWorkflowExecutions(api, workflowId, queryFilter);
67
- },
68
- select: (data) => data.pages.flatMap((p) => p.workflow_executions),
69
- ...mergedQueryOptions
44
+ itemsKey: "workflow_executions",
45
+ fetchPage: (pageToken, signal) => listWorkflowExecutions(api, workflowId, {
46
+ workspace,
47
+ pageSize,
48
+ pageToken: pageToken ?? void 0,
49
+ workerId,
50
+ withResume
51
+ }, signal),
52
+ select,
53
+ fetchAllPages,
54
+ enabled: Boolean(workflowId),
55
+ configError: workspace ? void 0 : missingWorkspaceError("useFetchWorkflowExecutions"),
56
+ queryOptions
70
57
  }),
71
58
  queryKey
72
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchWorkflowExecutions.js","names":[],"sources":["../../../src/hooks/workflow/useFetchWorkflowExecutions.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useInfiniteQuery, type UseInfiniteQueryOptions, type QueryKey } from \"@tanstack/react-query\";\n\nimport { useAxios } from \"@/hooks/useAxios\";\nimport { listWorkflowExecutions } from \"@/api/workflow\";\nimport type { FetchEntitiesParams } from \"@/types/entityQuery\";\nimport { buildQueryKey, buildQueryObject } from \"@/api/entityQuery\";\nimport type { WorkflowExecution, WorkflowExecutionListResponse } from \"@/types/workflow\";\n\ntype PageToken = string | null;\n\ntype InfiniteOptions<TData> = Omit<UseInfiniteQueryOptions<WorkflowExecutionListResponse, Error, TData, QueryKey, PageToken>, \"queryKey\" | \"queryFn\" | \"initialPageParam\" | \"getNextPageParam\">;\n\nexport type FetchInfiniteWorkflowExecutionProps = FetchEntitiesParams<WorkflowExecution[], InfiniteOptions<WorkflowExecution[]>> & {\n workflowId: string;\n pageSize?: number;\n};\n\nconst defaultQueryOptions: InfiniteOptions<WorkflowExecution[]> = {\n refetchOnMount: \"always\",\n staleTime: 0,\n gcTime: 0,\n};\n\n/**\n * useFetchWorkflowExecutions\n *\n * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve\n * workflow executions for a given workflow with cursor-based pagination.\n *\n * Automatically flattens all pages into a single `WorkflowExecution[]` via `select`.\n *\n * Note: `query.data` returns a flat `WorkflowExecution[]` with all fetched items merged across pages.\n *\n * @param workflowId - Workflow identifier whose executions to fetch (required).\n * @param filters - Filters applied to every page request. Must include a `workspace` filter.\n * @param order - Sorting applied to every page request.\n * @param projection - Single field to project: `\"field\"` returns only that field (others come\n * back null), `\"-field\"` returns every field except that one. One field only — lists 500. Omitted when empty.\n * @param pageSize - Number of executions to fetch per page. Defaults to `10`.\n * @param queryOptions - TanStack Query options passed through to `useInfiniteQuery`.\n *\n * @returns\n * - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)\n * - `queryKey`: the cache key used by React Query\n *\n * @example\n * ```ts\n * const { query } = useFetchWorkflowExecutions({\n * workflowId: \"wf-123\",\n * filters: [{ field: \"workspace\", value: \"main\" }],\n * pageSize: 20,\n * });\n *\n * // Flat list of all fetched executions\n * const executions = query.data ?? [];\n * ```\n */\nexport function useFetchWorkflowExecutions({ workflowId, filters = [], order = [], projection = \"\", pageSize = 10, queryOptions }: FetchInfiniteWorkflowExecutionProps) {\n const { api } = useAxios();\n\n const queryKey = buildQueryKey([\"workflow_executions\", workflowId], filters);\n\n const mergedQueryOptions = useMemo<InfiniteOptions<WorkflowExecution[]>>(() => ({\n ...defaultQueryOptions,\n ...(queryOptions ?? {}),\n }), [queryOptions]);\n\n const query = useInfiniteQuery<WorkflowExecutionListResponse, Error, WorkflowExecution[], QueryKey, PageToken>({\n queryKey,\n initialPageParam: null,\n getNextPageParam: (lastPage) => lastPage.next_page_token ?? undefined,\n\n queryFn: async ({ pageParam }) => {\n const queryFilter = buildQueryObject({\n filters,\n order,\n projection,\n pageSize,\n pageToken: pageParam ?? undefined,\n });\n\n return await listWorkflowExecutions(api, workflowId, queryFilter);\n },\n\n select: (data) => data.pages.flatMap((p) => p.workflow_executions),\n\n ...mergedQueryOptions,\n });\n\n return {\n query,\n queryKey,\n };\n}\n"],"mappings":";;;;;;AAkBA,IAAM,sBAA4D;CAC9D,gBAAgB;CAChB,WAAW;CACX,QAAQ;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAgB,2BAA2B,EAAE,YAAY,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,aAAa,IAAI,WAAW,IAAI,gBAAqD;CACpK,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,WAAW,cAAc,CAAC,uBAAuB,UAAU,GAAG,OAAO;CAE3E,MAAM,qBAAqB,eAAqD;EAC5E,GAAG;EACH,GAAI,gBAAgB,CAAC;CACzB,IAAI,CAAC,YAAY,CAAC;CAwBlB,OAAO;EACH,OAvBU,iBAAiG;GAC3G;GACA,kBAAkB;GAClB,mBAAmB,aAAa,SAAS,mBAAmB,KAAA;GAE5D,SAAS,OAAO,EAAE,gBAAgB;IAC9B,MAAM,cAAc,iBAAiB;KACjC;KACA;KACA;KACA;KACA,WAAW,aAAa,KAAA;IAC5B,CAAC;IAED,OAAO,MAAM,uBAAuB,KAAK,YAAY,WAAW;GACpE;GAEA,SAAS,SAAS,KAAK,MAAM,SAAS,MAAM,EAAE,mBAAmB;GAEjE,GAAG;EACP,CAGI;EACA;CACJ;AACJ"}
1
+ {"version":3,"file":"useFetchWorkflowExecutions.js","names":[],"sources":["../../../src/hooks/workflow/useFetchWorkflowExecutions.ts"],"sourcesContent":["import { useAxios } from \"@/hooks/useAxios\";\nimport { useEntityInfiniteQuery } from \"@/hooks/useEntityInfiniteQuery\";\nimport { listWorkflowExecutions } from \"@/api/workflow\";\nimport type { FetchEntitiesProps, ListCache } from \"@/types/entityQuery\";\nimport { buildQueryKey, missingWorkspaceError } from \"@/api/entityQuery\";\nimport type { WorkflowExecution, WorkflowExecutionListResponse } from \"@/types/workflow\";\n\n/** The query cache of `useFetchWorkflowExecutions`, for typing `setQueryData`. */\nexport type WorkflowExecutionsCache = ListCache<WorkflowExecutionListResponse>;\n\nexport type FetchWorkflowExecutionsProps<TData = WorkflowExecution[]> = FetchEntitiesProps<\n WorkflowExecution,\n TData,\n WorkflowExecutionListResponse\n> & {\n workflowId: string;\n workspace: string;\n /** Only the executions this worker took part in. */\n workerId?: string;\n /** Include each execution's `resume`, the per-worker summary. */\n withResume?: boolean;\n};\n\n/**\n * useFetchWorkflowExecutions\n *\n * Lists the executions of one workflow, newest first, with cursor pagination; `query.data` is\n * every loaded page merged, or whatever `select` makes of it. `select`, `fetchAllPages` and the\n * missing-workspace error behave as in `useFetchDatastores`. Idle while `workflowId` is empty.\n *\n * The endpoint takes no filters, order or projection: only a worker id and `withResume`. It used\n * to accept them as props and send them in a JSON query the endpoint ignores, along with the\n * cursor, so every \"next page\" was the first one.\n *\n * The key starts with `[\"workflow_executions\", workflowId]`, which is what apps invalidate to\n * refresh the list after running a workflow.\n *\n * @param {FetchWorkflowExecutionsProps} props - Workflow id, workspace, worker id,\n * `withResume`, page size, `select`, `fetchAllPages`, `queryOptions`.\n * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.\n */\nexport function useFetchWorkflowExecutions<TData = WorkflowExecution[]>({\n workflowId,\n workspace,\n workerId,\n withResume,\n pageSize = 10,\n select,\n fetchAllPages = false,\n queryOptions,\n}: FetchWorkflowExecutionsProps<TData>) {\n const { api } = useAxios();\n\n // The endpoint's two filters go in the key as filters, so a list per worker gets its own entry.\n const filters = [\n ...(workerId ? [{ field: \"worker_id\", value: workerId }] : []),\n ...(withResume !== undefined ? [{ field: \"with_resume\", value: withResume }] : []),\n ];\n const queryKey = buildQueryKey([\"workflow_executions\", workflowId, workspace], filters, {\n pageSize,\n fetchAllPages,\n });\n\n const query = useEntityInfiniteQuery<\n WorkflowExecutionListResponse,\n \"workflow_executions\",\n TData\n >({\n queryKey,\n itemsKey: \"workflow_executions\",\n fetchPage: (pageToken, signal) =>\n listWorkflowExecutions(\n api,\n workflowId,\n { workspace, pageSize, pageToken: pageToken ?? undefined, workerId, withResume },\n signal,\n ),\n select,\n fetchAllPages,\n enabled: Boolean(workflowId),\n configError: workspace ? undefined : missingWorkspaceError(\"useFetchWorkflowExecutions\"),\n queryOptions,\n });\n\n return { query, queryKey };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,2BAAwD,EACpE,YACA,WACA,UACA,YACA,WAAW,IACX,QACA,gBAAgB,OAChB,gBACoC;CACpC,MAAM,EAAE,QAAQ,SAAS;CAGzB,MAAM,UAAU,CACZ,GAAI,WAAW,CAAC;EAAE,OAAO;EAAa,OAAO;CAAS,CAAC,IAAI,CAAC,GAC5D,GAAI,eAAe,KAAA,IAAY,CAAC;EAAE,OAAO;EAAe,OAAO;CAAW,CAAC,IAAI,CAAC,CACpF;CACA,MAAM,WAAW,cAAc;EAAC;EAAuB;EAAY;CAAS,GAAG,SAAS;EACpF;EACA;CACJ,CAAC;CAuBD,OAAO;EAAE,OArBK,uBAIZ;GACE;GACA,UAAU;GACV,YAAY,WAAW,WACnB,uBACI,KACA,YACA;IAAE;IAAW;IAAU,WAAW,aAAa,KAAA;IAAW;IAAU;GAAW,GAC/E,MACJ;GACJ;GACA;GACA,SAAS,QAAQ,UAAU;GAC3B,aAAa,YAAY,KAAA,IAAY,sBAAsB,4BAA4B;GACvF;EACJ,CAES;EAAO;CAAS;AAC7B"}
@@ -1,47 +1,30 @@
1
- import { type UseInfiniteQueryOptions, type QueryKey } from "@tanstack/react-query";
2
1
  import type { Workflow, WorkflowListResponse } from "../../types/workflow.d.ts";
3
- type PageToken = string | null;
4
- type InfiniteOptions<TData> = Omit<UseInfiniteQueryOptions<WorkflowListResponse, Error, TData, QueryKey, PageToken>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
5
- export type FetchInfiniteWorkflowProps = {
6
- workspace?: string;
7
- pageSize?: number;
8
- queryOptions?: InfiniteOptions<Workflow[]>;
2
+ import type { FetchEntitiesProps, ListCache } from "../../types/entityQuery.d.ts";
3
+ /** The query cache of `useFetchWorkflows`, for typing `setQueryData`. */
4
+ export type WorkflowsCache = ListCache<WorkflowListResponse>;
5
+ export type FetchWorkflowsProps<TData = Workflow[]> = FetchEntitiesProps<Workflow, TData, WorkflowListResponse> & {
6
+ /** Workspace to list. Required: without one the API reads `main`, not the account. */
7
+ workspace: string;
8
+ /** A name prefix, an id, `#tag #tag` (every tag), or `&link_uid`. */
9
+ search?: string;
9
10
  };
10
11
  /**
11
12
  * useFetchWorkflows
12
13
  *
13
- * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
14
- * workflows with cursor-based pagination using the legacy method (workspace as query param).
14
+ * Lists workflows with cursor pagination; `query.data` is every loaded page merged, or
15
+ * whatever `select` makes of it. `select` and `fetchAllPages` behave as in
16
+ * `useFetchDatastores`. This endpoint takes a workspace and a text `search` rather than
17
+ * filters.
15
18
  *
16
- * Automatically flattens all pages into a single `Workflow[]` via `select`.
19
+ * A missing workspace fails loudly, without a request, as in every other hook. This hook used to
20
+ * allow one, documented as listing the account's workflows; the API reads `main` instead.
17
21
  *
18
- * Note: `query.data` returns a flat `Workflow[]` with all fetched items merged across pages.
19
- *
20
- * @param {string} [workspace]
21
- * Current workspace name. Sent as a query param via the legacy method, required by some API configurations.
22
- *
23
- * @param {number} [pageSize=10]
24
- * Number of workflows to fetch per page.
25
- *
26
- * @param {InfiniteOptions<Workflow[]>} [queryOptions]
27
- * TanStack Query options passed through to `useInfiniteQuery`
28
- * (e.g., enabled, staleTime, gcTime, etc.).
29
- *
30
- * @returns {{ query, queryKey }}
31
- * - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
32
- * - `queryKey`: the cache key used by React Query
33
- *
34
- * @example
35
- * ```ts
36
- * const { query } = useFetchWorkflows({ workspace: "ws-1", pageSize: 20 });
37
- *
38
- * // Flat list of all fetched workflows
39
- * const workflows = query.data ?? [];
40
- * ```
22
+ * @param {FetchWorkflowsProps} props - Workspace, search, page size, `select`,
23
+ * `fetchAllPages` and TanStack `queryOptions`.
24
+ * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.
41
25
  */
42
- export declare function useFetchWorkflows({ workspace, pageSize, queryOptions }: FetchInfiniteWorkflowProps): {
43
- query: import("@tanstack/react-query").UseInfiniteQueryResult<Workflow[], Error>;
44
- queryKey: readonly unknown[];
26
+ export declare function useFetchWorkflows<TData = Workflow[]>({ workspace, search, pageSize, select, fetchAllPages, queryOptions, }: FetchWorkflowsProps<TData>): {
27
+ query: import("@tanstack/react-query").UseInfiniteQueryResult<TData, Error>;
28
+ queryKey: unknown[];
45
29
  };
46
- export {};
47
30
  //# sourceMappingURL=useFetchWorkflows.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchWorkflows.d.ts","sourceRoot":"","sources":["../../../src/hooks/workflow/useFetchWorkflows.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,uBAAuB,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItG,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,KAAK,SAAS,GAAG,MAAM,GAAG,IAAI,CAAC;AAE/B,KAAK,eAAe,CAAC,KAAK,IAAI,IAAI,CAAC,uBAAuB,CAAC,oBAAoB,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,EAAC,UAAU,GAAG,SAAS,GAAG,kBAAkB,GAAG,kBAAkB,CAAC,CAAC;AAEtL,MAAM,MAAM,0BAA0B,GAAG;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC;CAC9C,CAAC;AAQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,QAAa,EAAE,YAAY,EAAE,EAAE,0BAA0B;;;EA4BvG"}
1
+ {"version":3,"file":"useFetchWorkflows.d.ts","sourceRoot":"","sources":["../../../src/hooks/workflow/useFetchWorkflows.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEzE,yEAAyE;AACzE,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC,oBAAoB,CAAC,CAAC;AAE7D,MAAM,MAAM,mBAAmB,CAAC,KAAK,GAAG,QAAQ,EAAE,IAAI,kBAAkB,CACpE,QAAQ,EACR,KAAK,EACL,oBAAoB,CACvB,GAAG;IACA,sFAAsF;IACtF,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,GAAG,QAAQ,EAAE,EAAE,EAClD,SAAS,EACT,MAAM,EACN,QAAa,EACb,MAAM,EACN,aAAqB,EACrB,YAAY,GACf,EAAE,mBAAmB,CAAC,KAAK,CAAC;;;EAwB5B"}