@everysk/apps-sdk 0.1.0-beta.0

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 (450) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -0
  3. package/dist/EveryskApp.d.ts +73 -0
  4. package/dist/EveryskApp.d.ts.map +1 -0
  5. package/dist/EveryskApp.js +66 -0
  6. package/dist/EveryskApp.js.map +1 -0
  7. package/dist/agGrid/agGridTheme.d.ts +77 -0
  8. package/dist/agGrid/agGridTheme.d.ts.map +1 -0
  9. package/dist/agGrid/agGridTheme.js +88 -0
  10. package/dist/agGrid/agGridTheme.js.map +1 -0
  11. package/dist/agGrid/index.d.ts +4 -0
  12. package/dist/agGrid/index.d.ts.map +1 -0
  13. package/dist/agGrid/index.js +3 -0
  14. package/dist/api/datastore.d.ts +68 -0
  15. package/dist/api/datastore.d.ts.map +1 -0
  16. package/dist/api/datastore.js +125 -0
  17. package/dist/api/datastore.js.map +1 -0
  18. package/dist/api/entityQuery.d.ts +78 -0
  19. package/dist/api/entityQuery.d.ts.map +1 -0
  20. package/dist/api/entityQuery.js +100 -0
  21. package/dist/api/entityQuery.js.map +1 -0
  22. package/dist/api/file.d.ts +70 -0
  23. package/dist/api/file.d.ts.map +1 -0
  24. package/dist/api/file.js +126 -0
  25. package/dist/api/file.js.map +1 -0
  26. package/dist/api/portfolio.d.ts +67 -0
  27. package/dist/api/portfolio.d.ts.map +1 -0
  28. package/dist/api/portfolio.js +125 -0
  29. package/dist/api/portfolio.js.map +1 -0
  30. package/dist/api/profile.d.ts +40 -0
  31. package/dist/api/profile.d.ts.map +1 -0
  32. package/dist/api/profile.js +71 -0
  33. package/dist/api/profile.js.map +1 -0
  34. package/dist/api/websocketsConfig.d.ts +13 -0
  35. package/dist/api/websocketsConfig.d.ts.map +1 -0
  36. package/dist/api/websocketsConfig.js +25 -0
  37. package/dist/api/websocketsConfig.js.map +1 -0
  38. package/dist/api/workflow.d.ts +154 -0
  39. package/dist/api/workflow.d.ts.map +1 -0
  40. package/dist/api/workflow.js +289 -0
  41. package/dist/api/workflow.js.map +1 -0
  42. package/dist/api/workspace.d.ts +29 -0
  43. package/dist/api/workspace.d.ts.map +1 -0
  44. package/dist/api/workspace.js +54 -0
  45. package/dist/api/workspace.js.map +1 -0
  46. package/dist/components/ui/EveryskIcon/index.d.ts +5 -0
  47. package/dist/components/ui/EveryskIcon/index.d.ts.map +1 -0
  48. package/dist/components/ui/EveryskIcon/index.js +25 -0
  49. package/dist/components/ui/EveryskIcon/index.js.map +1 -0
  50. package/dist/components/ui/Footer/index.d.ts +5 -0
  51. package/dist/components/ui/Footer/index.d.ts.map +1 -0
  52. package/dist/components/ui/Footer/index.js +23 -0
  53. package/dist/components/ui/Footer/index.js.map +1 -0
  54. package/dist/components/ui/GlobalLoading/index.d.ts +8 -0
  55. package/dist/components/ui/GlobalLoading/index.d.ts.map +1 -0
  56. package/dist/components/ui/GlobalLoading/index.js +42 -0
  57. package/dist/components/ui/GlobalLoading/index.js.map +1 -0
  58. package/dist/components/ui/PageContainer/index.d.ts +7 -0
  59. package/dist/components/ui/PageContainer/index.d.ts.map +1 -0
  60. package/dist/components/ui/PageContainer/index.js +20 -0
  61. package/dist/components/ui/PageContainer/index.js.map +1 -0
  62. package/dist/components/ui/Toolbar/index.d.ts +5 -0
  63. package/dist/components/ui/Toolbar/index.d.ts.map +1 -0
  64. package/dist/components/ui/Toolbar/index.js +32 -0
  65. package/dist/components/ui/Toolbar/index.js.map +1 -0
  66. package/dist/contexts/agGridLicenseContext/provider.d.ts +51 -0
  67. package/dist/contexts/agGridLicenseContext/provider.d.ts.map +1 -0
  68. package/dist/contexts/agGridLicenseContext/provider.js +58 -0
  69. package/dist/contexts/agGridLicenseContext/provider.js.map +1 -0
  70. package/dist/contexts/appAlertContext/index.d.ts +3 -0
  71. package/dist/contexts/appAlertContext/index.d.ts.map +1 -0
  72. package/dist/contexts/appAlertContext/index.js +7 -0
  73. package/dist/contexts/appAlertContext/index.js.map +1 -0
  74. package/dist/contexts/appAlertContext/provider.d.ts +40 -0
  75. package/dist/contexts/appAlertContext/provider.d.ts.map +1 -0
  76. package/dist/contexts/appAlertContext/provider.js +96 -0
  77. package/dist/contexts/appAlertContext/provider.js.map +1 -0
  78. package/dist/contexts/appAlertContext/types.d.ts +15 -0
  79. package/dist/contexts/appAlertContext/types.d.ts.map +1 -0
  80. package/dist/contexts/appAlertContext/useAppAlert.d.ts +30 -0
  81. package/dist/contexts/appAlertContext/useAppAlert.d.ts.map +1 -0
  82. package/dist/contexts/appAlertContext/useAppAlert.js +40 -0
  83. package/dist/contexts/appAlertContext/useAppAlert.js.map +1 -0
  84. package/dist/contexts/appConfigContext/index.d.ts +3 -0
  85. package/dist/contexts/appConfigContext/index.d.ts.map +1 -0
  86. package/dist/contexts/appConfigContext/index.js +7 -0
  87. package/dist/contexts/appConfigContext/index.js.map +1 -0
  88. package/dist/contexts/appConfigContext/provider.d.ts +45 -0
  89. package/dist/contexts/appConfigContext/provider.d.ts.map +1 -0
  90. package/dist/contexts/appConfigContext/provider.js +63 -0
  91. package/dist/contexts/appConfigContext/provider.js.map +1 -0
  92. package/dist/contexts/appConfigContext/types.d.ts +28 -0
  93. package/dist/contexts/appConfigContext/types.d.ts.map +1 -0
  94. package/dist/contexts/appConfigContext/useAppConfig.d.ts +20 -0
  95. package/dist/contexts/appConfigContext/useAppConfig.d.ts.map +1 -0
  96. package/dist/contexts/appConfigContext/useAppConfig.js +30 -0
  97. package/dist/contexts/appConfigContext/useAppConfig.js.map +1 -0
  98. package/dist/contexts/webSocketContext/constants.d.ts +4 -0
  99. package/dist/contexts/webSocketContext/constants.d.ts.map +1 -0
  100. package/dist/contexts/webSocketContext/constants.js +8 -0
  101. package/dist/contexts/webSocketContext/constants.js.map +1 -0
  102. package/dist/contexts/webSocketContext/handler.d.ts +43 -0
  103. package/dist/contexts/webSocketContext/handler.d.ts.map +1 -0
  104. package/dist/contexts/webSocketContext/handler.js +87 -0
  105. package/dist/contexts/webSocketContext/handler.js.map +1 -0
  106. package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.d.ts +19 -0
  107. package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.d.ts.map +1 -0
  108. package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.js +31 -0
  109. package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.js.map +1 -0
  110. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.d.ts +11 -0
  111. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.d.ts.map +1 -0
  112. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js +21 -0
  113. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js.map +1 -0
  114. package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.d.ts +30 -0
  115. package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.d.ts.map +1 -0
  116. package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.js +44 -0
  117. package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.js.map +1 -0
  118. package/dist/contexts/webSocketContext/index.d.ts +3 -0
  119. package/dist/contexts/webSocketContext/index.d.ts.map +1 -0
  120. package/dist/contexts/webSocketContext/index.js +7 -0
  121. package/dist/contexts/webSocketContext/index.js.map +1 -0
  122. package/dist/contexts/webSocketContext/provider.d.ts +39 -0
  123. package/dist/contexts/webSocketContext/provider.d.ts.map +1 -0
  124. package/dist/contexts/webSocketContext/provider.js +121 -0
  125. package/dist/contexts/webSocketContext/provider.js.map +1 -0
  126. package/dist/contexts/webSocketContext/types.d.ts +41 -0
  127. package/dist/contexts/webSocketContext/types.d.ts.map +1 -0
  128. package/dist/datastore/index.d.ts +7 -0
  129. package/dist/datastore/index.d.ts.map +1 -0
  130. package/dist/file/index.d.ts +6 -0
  131. package/dist/file/index.d.ts.map +1 -0
  132. package/dist/hooks/datastore/useDatastoreMutations.d.ts +151 -0
  133. package/dist/hooks/datastore/useDatastoreMutations.d.ts.map +1 -0
  134. package/dist/hooks/datastore/useDatastoreMutations.js +198 -0
  135. package/dist/hooks/datastore/useDatastoreMutations.js.map +1 -0
  136. package/dist/hooks/datastore/useFetchDatastore.d.ts +205 -0
  137. package/dist/hooks/datastore/useFetchDatastore.d.ts.map +1 -0
  138. package/dist/hooks/datastore/useFetchDatastore.js +85 -0
  139. package/dist/hooks/datastore/useFetchDatastore.js.map +1 -0
  140. package/dist/hooks/datastore/useFetchDatastores.d.ts +70 -0
  141. package/dist/hooks/datastore/useFetchDatastores.d.ts.map +1 -0
  142. package/dist/hooks/datastore/useFetchDatastores.js +105 -0
  143. package/dist/hooks/datastore/useFetchDatastores.js.map +1 -0
  144. package/dist/hooks/file/useFetchFile.d.ts +212 -0
  145. package/dist/hooks/file/useFetchFile.d.ts.map +1 -0
  146. package/dist/hooks/file/useFetchFile.js +87 -0
  147. package/dist/hooks/file/useFetchFile.js.map +1 -0
  148. package/dist/hooks/file/useFetchFiles.d.ts +60 -0
  149. package/dist/hooks/file/useFetchFiles.d.ts.map +1 -0
  150. package/dist/hooks/file/useFetchFiles.js +89 -0
  151. package/dist/hooks/file/useFetchFiles.js.map +1 -0
  152. package/dist/hooks/file/useFileMutations.d.ts +161 -0
  153. package/dist/hooks/file/useFileMutations.d.ts.map +1 -0
  154. package/dist/hooks/file/useFileMutations.js +208 -0
  155. package/dist/hooks/file/useFileMutations.js.map +1 -0
  156. package/dist/hooks/portfolio/useFetchPortfolio.d.ts +210 -0
  157. package/dist/hooks/portfolio/useFetchPortfolio.d.ts.map +1 -0
  158. package/dist/hooks/portfolio/useFetchPortfolio.js +85 -0
  159. package/dist/hooks/portfolio/useFetchPortfolio.js.map +1 -0
  160. package/dist/hooks/portfolio/useFetchPortfolios.d.ts +60 -0
  161. package/dist/hooks/portfolio/useFetchPortfolios.d.ts.map +1 -0
  162. package/dist/hooks/portfolio/useFetchPortfolios.js +89 -0
  163. package/dist/hooks/portfolio/useFetchPortfolios.js.map +1 -0
  164. package/dist/hooks/portfolio/usePortfolioMutations.d.ts +171 -0
  165. package/dist/hooks/portfolio/usePortfolioMutations.d.ts.map +1 -0
  166. package/dist/hooks/portfolio/usePortfolioMutations.js +218 -0
  167. package/dist/hooks/portfolio/usePortfolioMutations.js.map +1 -0
  168. package/dist/hooks/profile/useFetchProfile.d.ts +206 -0
  169. package/dist/hooks/profile/useFetchProfile.d.ts.map +1 -0
  170. package/dist/hooks/profile/useFetchProfile.js +70 -0
  171. package/dist/hooks/profile/useFetchProfile.js.map +1 -0
  172. package/dist/hooks/useAxios.d.ts +40 -0
  173. package/dist/hooks/useAxios.d.ts.map +1 -0
  174. package/dist/hooks/useAxios.js +76 -0
  175. package/dist/hooks/useAxios.js.map +1 -0
  176. package/dist/hooks/workflow/useFetchWorkerExecution.d.ts +198 -0
  177. package/dist/hooks/workflow/useFetchWorkerExecution.d.ts.map +1 -0
  178. package/dist/hooks/workflow/useFetchWorkerExecution.js +69 -0
  179. package/dist/hooks/workflow/useFetchWorkerExecution.js.map +1 -0
  180. package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts +52 -0
  181. package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts.map +1 -0
  182. package/dist/hooks/workflow/useFetchWorkerExecutions.js +83 -0
  183. package/dist/hooks/workflow/useFetchWorkerExecutions.js.map +1 -0
  184. package/dist/hooks/workflow/useFetchWorkflow.d.ts +195 -0
  185. package/dist/hooks/workflow/useFetchWorkflow.d.ts.map +1 -0
  186. package/dist/hooks/workflow/useFetchWorkflow.js +70 -0
  187. package/dist/hooks/workflow/useFetchWorkflow.js.map +1 -0
  188. package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts +198 -0
  189. package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts.map +1 -0
  190. package/dist/hooks/workflow/useFetchWorkflowExecution.js +69 -0
  191. package/dist/hooks/workflow/useFetchWorkflowExecution.js.map +1 -0
  192. package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts +49 -0
  193. package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts.map +1 -0
  194. package/dist/hooks/workflow/useFetchWorkflowExecutions.js +77 -0
  195. package/dist/hooks/workflow/useFetchWorkflowExecutions.js.map +1 -0
  196. package/dist/hooks/workflow/useFetchWorkflows.d.ts +47 -0
  197. package/dist/hooks/workflow/useFetchWorkflows.d.ts.map +1 -0
  198. package/dist/hooks/workflow/useFetchWorkflows.js +67 -0
  199. package/dist/hooks/workflow/useFetchWorkflows.js.map +1 -0
  200. package/dist/hooks/workflow/useRunWorkflow.d.ts +30 -0
  201. package/dist/hooks/workflow/useRunWorkflow.d.ts.map +1 -0
  202. package/dist/hooks/workflow/useRunWorkflow.js +50 -0
  203. package/dist/hooks/workflow/useRunWorkflow.js.map +1 -0
  204. package/dist/hooks/workspace/useFetchWorkspace.d.ts +197 -0
  205. package/dist/hooks/workspace/useFetchWorkspace.d.ts.map +1 -0
  206. package/dist/hooks/workspace/useFetchWorkspace.js +65 -0
  207. package/dist/hooks/workspace/useFetchWorkspace.js.map +1 -0
  208. package/dist/hooks/workspace/useFetchWorkspaces.d.ts +46 -0
  209. package/dist/hooks/workspace/useFetchWorkspaces.d.ts.map +1 -0
  210. package/dist/hooks/workspace/useFetchWorkspaces.js +66 -0
  211. package/dist/hooks/workspace/useFetchWorkspaces.js.map +1 -0
  212. package/dist/index.d.ts +24 -0
  213. package/dist/index.d.ts.map +1 -0
  214. package/dist/index.js +50 -0
  215. package/dist/lib/datastoreTable.d.ts +126 -0
  216. package/dist/lib/datastoreTable.d.ts.map +1 -0
  217. package/dist/lib/datastoreTable.js +146 -0
  218. package/dist/lib/datastoreTable.js.map +1 -0
  219. package/dist/lib/queryClient.d.ts +24 -0
  220. package/dist/lib/queryClient.d.ts.map +1 -0
  221. package/dist/lib/queryClient.js +48 -0
  222. package/dist/lib/queryClient.js.map +1 -0
  223. package/dist/portfolio/index.d.ts +6 -0
  224. package/dist/portfolio/index.d.ts.map +1 -0
  225. package/dist/profile/index.d.ts +4 -0
  226. package/dist/profile/index.d.ts.map +1 -0
  227. package/dist/socket/index.d.ts +10 -0
  228. package/dist/socket/index.d.ts.map +1 -0
  229. package/dist/socket/index.js +9 -0
  230. package/dist/test/index.d.ts +2 -0
  231. package/dist/test/index.d.ts.map +1 -0
  232. package/dist/test/index.js +2 -0
  233. package/dist/test/mocks/agGridEnterprise.d.ts +38 -0
  234. package/dist/test/mocks/agGridEnterprise.d.ts.map +1 -0
  235. package/dist/test/mocks/agGridEnterprise.js +43 -0
  236. package/dist/test/mocks/agGridEnterprise.js.map +1 -0
  237. package/dist/test/mocks/agGridReact.d.ts +42 -0
  238. package/dist/test/mocks/agGridReact.d.ts.map +1 -0
  239. package/dist/test/mocks/agGridReact.js +47 -0
  240. package/dist/test/mocks/agGridReact.js.map +1 -0
  241. package/dist/test/mocks/index.d.ts +5 -0
  242. package/dist/test/mocks/index.d.ts.map +1 -0
  243. package/dist/test/mocks/index.js +4 -0
  244. package/dist/test/mocks/socketIoClient.d.ts +45 -0
  245. package/dist/test/mocks/socketIoClient.d.ts.map +1 -0
  246. package/dist/test/mocks/socketIoClient.js +54 -0
  247. package/dist/test/mocks/socketIoClient.js.map +1 -0
  248. package/dist/test/renderWithProviders.d.ts +107 -0
  249. package/dist/test/renderWithProviders.d.ts.map +1 -0
  250. package/dist/test/renderWithProviders.js +85 -0
  251. package/dist/test/renderWithProviders.js.map +1 -0
  252. package/dist/test/setup.d.ts +2 -0
  253. package/dist/test/setup.d.ts.map +1 -0
  254. package/dist/test/setup.js +25 -0
  255. package/dist/test/setup.js.map +1 -0
  256. package/dist/theme/ThemeProvider.d.ts +12 -0
  257. package/dist/theme/ThemeProvider.d.ts.map +1 -0
  258. package/dist/theme/ThemeProvider.js +22 -0
  259. package/dist/theme/ThemeProvider.js.map +1 -0
  260. package/dist/theme/index.d.ts +9 -0
  261. package/dist/theme/index.d.ts.map +1 -0
  262. package/dist/theme/overrides/index.d.ts +7 -0
  263. package/dist/theme/overrides/index.d.ts.map +1 -0
  264. package/dist/theme/overrides/index.js +31 -0
  265. package/dist/theme/overrides/index.js.map +1 -0
  266. package/dist/theme/overrides/muiButton.d.ts +3 -0
  267. package/dist/theme/overrides/muiButton.d.ts.map +1 -0
  268. package/dist/theme/overrides/muiButton.js +6 -0
  269. package/dist/theme/overrides/muiButton.js.map +1 -0
  270. package/dist/theme/overrides/muiCssBaseline.d.ts +31 -0
  271. package/dist/theme/overrides/muiCssBaseline.d.ts.map +1 -0
  272. package/dist/theme/overrides/muiCssBaseline.js +27 -0
  273. package/dist/theme/overrides/muiCssBaseline.js.map +1 -0
  274. package/dist/theme/overrides/muiDatePicker.d.ts +10 -0
  275. package/dist/theme/overrides/muiDatePicker.d.ts.map +1 -0
  276. package/dist/theme/overrides/muiDatePicker.js +6 -0
  277. package/dist/theme/overrides/muiDatePicker.js.map +1 -0
  278. package/dist/theme/overrides/muiFormControl.d.ts +3 -0
  279. package/dist/theme/overrides/muiFormControl.d.ts.map +1 -0
  280. package/dist/theme/overrides/muiFormControl.js +6 -0
  281. package/dist/theme/overrides/muiFormControl.js.map +1 -0
  282. package/dist/theme/overrides/muiIconButton.d.ts +3 -0
  283. package/dist/theme/overrides/muiIconButton.d.ts.map +1 -0
  284. package/dist/theme/overrides/muiIconButton.js +6 -0
  285. package/dist/theme/overrides/muiIconButton.js.map +1 -0
  286. package/dist/theme/overrides/muiSelect.d.ts +3 -0
  287. package/dist/theme/overrides/muiSelect.d.ts.map +1 -0
  288. package/dist/theme/overrides/muiSelect.js +6 -0
  289. package/dist/theme/overrides/muiSelect.js.map +1 -0
  290. package/dist/theme/overrides/muiSvgIcon.d.ts +3 -0
  291. package/dist/theme/overrides/muiSvgIcon.d.ts.map +1 -0
  292. package/dist/theme/overrides/muiSvgIcon.js +6 -0
  293. package/dist/theme/overrides/muiSvgIcon.js.map +1 -0
  294. package/dist/theme/overrides/muiTextField.d.ts +3 -0
  295. package/dist/theme/overrides/muiTextField.d.ts.map +1 -0
  296. package/dist/theme/overrides/muiTextField.js +6 -0
  297. package/dist/theme/overrides/muiTextField.js.map +1 -0
  298. package/dist/theme/overrides/muiToggleButton.d.ts +3 -0
  299. package/dist/theme/overrides/muiToggleButton.d.ts.map +1 -0
  300. package/dist/theme/overrides/muiToggleButton.js +6 -0
  301. package/dist/theme/overrides/muiToggleButton.js.map +1 -0
  302. package/dist/theme/overrides/muiToggleButtonGroup.d.ts +3 -0
  303. package/dist/theme/overrides/muiToggleButtonGroup.d.ts.map +1 -0
  304. package/dist/theme/overrides/muiToggleButtonGroup.js +6 -0
  305. package/dist/theme/overrides/muiToggleButtonGroup.js.map +1 -0
  306. package/dist/theme/themes/DefaultDark.d.ts +7 -0
  307. package/dist/theme/themes/DefaultDark.d.ts.map +1 -0
  308. package/dist/theme/themes/DefaultDark.js +15 -0
  309. package/dist/theme/themes/DefaultDark.js.map +1 -0
  310. package/dist/theme/themes/DefaultLight.d.ts +7 -0
  311. package/dist/theme/themes/DefaultLight.d.ts.map +1 -0
  312. package/dist/theme/themes/DefaultLight.js +15 -0
  313. package/dist/theme/themes/DefaultLight.js.map +1 -0
  314. package/dist/theme/themes/EveryskDark.d.ts +15 -0
  315. package/dist/theme/themes/EveryskDark.d.ts.map +1 -0
  316. package/dist/theme/themes/EveryskDark.js +63 -0
  317. package/dist/theme/themes/EveryskDark.js.map +1 -0
  318. package/dist/theme/themes/EveryskLight.d.ts +21 -0
  319. package/dist/theme/themes/EveryskLight.d.ts.map +1 -0
  320. package/dist/theme/themes/EveryskLight.js +69 -0
  321. package/dist/theme/themes/EveryskLight.js.map +1 -0
  322. package/dist/theme/themes/MidnightEmber.d.ts +3 -0
  323. package/dist/theme/themes/MidnightEmber.d.ts.map +1 -0
  324. package/dist/theme/themes/MidnightEmber.js +31 -0
  325. package/dist/theme/themes/MidnightEmber.js.map +1 -0
  326. package/dist/theme/themes/index.d.ts +17 -0
  327. package/dist/theme/themes/index.d.ts.map +1 -0
  328. package/dist/theme/themes/index.js +32 -0
  329. package/dist/theme/themes/index.js.map +1 -0
  330. package/dist/types/anyRecord.d.ts +4 -0
  331. package/dist/types/anyRecord.d.ts.map +1 -0
  332. package/dist/types/datastore.d.ts +26 -0
  333. package/dist/types/datastore.d.ts.map +1 -0
  334. package/dist/types/entityQuery.d.ts +47 -0
  335. package/dist/types/entityQuery.d.ts.map +1 -0
  336. package/dist/types/file.d.ts +29 -0
  337. package/dist/types/file.d.ts.map +1 -0
  338. package/dist/types/portfolio.d.ts +77 -0
  339. package/dist/types/portfolio.d.ts.map +1 -0
  340. package/dist/types/profile.d.ts +37 -0
  341. package/dist/types/profile.d.ts.map +1 -0
  342. package/dist/types/workflow.d.ts +68 -0
  343. package/dist/types/workflow.d.ts.map +1 -0
  344. package/dist/types/workspace.d.ts +13 -0
  345. package/dist/types/workspace.d.ts.map +1 -0
  346. package/dist/ui/index.d.ts +6 -0
  347. package/dist/ui/index.d.ts.map +1 -0
  348. package/dist/workflow/index.d.ts +10 -0
  349. package/dist/workflow/index.d.ts.map +1 -0
  350. package/dist/workspace/index.d.ts +5 -0
  351. package/dist/workspace/index.d.ts.map +1 -0
  352. package/package.json +148 -0
  353. package/src/EveryskApp.tsx +108 -0
  354. package/src/agGrid/agGridTheme.ts +113 -0
  355. package/src/agGrid/index.ts +15 -0
  356. package/src/api/datastore.ts +175 -0
  357. package/src/api/entityQuery.ts +101 -0
  358. package/src/api/file.ts +174 -0
  359. package/src/api/portfolio.ts +190 -0
  360. package/src/api/profile.ts +80 -0
  361. package/src/api/websocketsConfig.ts +32 -0
  362. package/src/api/workflow.ts +427 -0
  363. package/src/api/workspace.ts +72 -0
  364. package/src/components/ui/EveryskIcon/index.tsx +24 -0
  365. package/src/components/ui/Footer/index.tsx +30 -0
  366. package/src/components/ui/GlobalLoading/index.tsx +38 -0
  367. package/src/components/ui/PageContainer/index.tsx +14 -0
  368. package/src/components/ui/Toolbar/index.tsx +44 -0
  369. package/src/contexts/agGridLicenseContext/provider.tsx +63 -0
  370. package/src/contexts/appAlertContext/index.tsx +4 -0
  371. package/src/contexts/appAlertContext/provider.tsx +92 -0
  372. package/src/contexts/appAlertContext/types.ts +17 -0
  373. package/src/contexts/appAlertContext/useAppAlert.ts +39 -0
  374. package/src/contexts/appConfigContext/index.tsx +4 -0
  375. package/src/contexts/appConfigContext/provider.tsx +67 -0
  376. package/src/contexts/appConfigContext/types.ts +28 -0
  377. package/src/contexts/appConfigContext/useAppConfig.ts +30 -0
  378. package/src/contexts/webSocketContext/constants.ts +3 -0
  379. package/src/contexts/webSocketContext/handler.ts +108 -0
  380. package/src/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.ts +36 -0
  381. package/src/contexts/webSocketContext/hooks/useWebSocket/index.ts +18 -0
  382. package/src/contexts/webSocketContext/hooks/useWebSocketSubscription/index.ts +45 -0
  383. package/src/contexts/webSocketContext/index.tsx +5 -0
  384. package/src/contexts/webSocketContext/provider.tsx +125 -0
  385. package/src/contexts/webSocketContext/types.ts +50 -0
  386. package/src/datastore/index.ts +14 -0
  387. package/src/file/index.ts +13 -0
  388. package/src/hooks/datastore/useDatastoreMutations.ts +221 -0
  389. package/src/hooks/datastore/useFetchDatastore.ts +95 -0
  390. package/src/hooks/datastore/useFetchDatastores.ts +162 -0
  391. package/src/hooks/file/useFetchFile.ts +93 -0
  392. package/src/hooks/file/useFetchFiles.ts +109 -0
  393. package/src/hooks/file/useFileMutations.ts +240 -0
  394. package/src/hooks/portfolio/useFetchPortfolio.ts +94 -0
  395. package/src/hooks/portfolio/useFetchPortfolios.ts +109 -0
  396. package/src/hooks/portfolio/usePortfolioMutations.ts +250 -0
  397. package/src/hooks/profile/useFetchProfile.ts +93 -0
  398. package/src/hooks/useAxios.ts +98 -0
  399. package/src/hooks/workflow/useFetchWorkerExecution.ts +78 -0
  400. package/src/hooks/workflow/useFetchWorkerExecutions.ts +98 -0
  401. package/src/hooks/workflow/useFetchWorkflow.ts +76 -0
  402. package/src/hooks/workflow/useFetchWorkflowExecution.ts +79 -0
  403. package/src/hooks/workflow/useFetchWorkflowExecutions.ts +95 -0
  404. package/src/hooks/workflow/useFetchWorkflows.ts +84 -0
  405. package/src/hooks/workflow/useRunWorkflow.ts +62 -0
  406. package/src/hooks/workspace/useFetchWorkspace.ts +78 -0
  407. package/src/hooks/workspace/useFetchWorkspaces.ts +86 -0
  408. package/src/index.ts +72 -0
  409. package/src/lib/datastoreTable.ts +159 -0
  410. package/src/lib/queryClient.ts +60 -0
  411. package/src/portfolio/index.ts +13 -0
  412. package/src/profile/index.ts +11 -0
  413. package/src/socket/index.ts +19 -0
  414. package/src/test/index.ts +10 -0
  415. package/src/test/mocks/agGridEnterprise.ts +45 -0
  416. package/src/test/mocks/agGridReact.tsx +61 -0
  417. package/src/test/mocks/index.ts +22 -0
  418. package/src/test/mocks/socketIoClient.ts +78 -0
  419. package/src/test/renderWithProviders.tsx +114 -0
  420. package/src/test/setup.ts +46 -0
  421. package/src/theme/ThemeProvider.tsx +33 -0
  422. package/src/theme/index.ts +15 -0
  423. package/src/theme/overrides/index.ts +31 -0
  424. package/src/theme/overrides/muiButton.ts +7 -0
  425. package/src/theme/overrides/muiCssBaseline.ts +35 -0
  426. package/src/theme/overrides/muiDatePicker.ts +5 -0
  427. package/src/theme/overrides/muiFormControl.ts +7 -0
  428. package/src/theme/overrides/muiIconButton.ts +7 -0
  429. package/src/theme/overrides/muiSelect.ts +7 -0
  430. package/src/theme/overrides/muiSvgIcon.ts +7 -0
  431. package/src/theme/overrides/muiTextField.ts +7 -0
  432. package/src/theme/overrides/muiToggleButton.ts +7 -0
  433. package/src/theme/overrides/muiToggleButtonGroup.ts +7 -0
  434. package/src/theme/themes/DefaultDark.ts +14 -0
  435. package/src/theme/themes/DefaultLight.ts +14 -0
  436. package/src/theme/themes/EveryskDark.ts +62 -0
  437. package/src/theme/themes/EveryskLight.ts +68 -0
  438. package/src/theme/themes/MidnightEmber.ts +30 -0
  439. package/src/theme/themes/index.ts +35 -0
  440. package/src/types/anyRecord.ts +4 -0
  441. package/src/types/datastore.ts +33 -0
  442. package/src/types/entityQuery.ts +64 -0
  443. package/src/types/file.ts +32 -0
  444. package/src/types/portfolio.ts +81 -0
  445. package/src/types/profile.ts +39 -0
  446. package/src/types/workflow.ts +76 -0
  447. package/src/types/workspace.ts +15 -0
  448. package/src/ui/index.ts +14 -0
  449. package/src/workflow/index.ts +17 -0
  450. package/src/workspace/index.ts +12 -0
@@ -0,0 +1,70 @@
1
+ import { useAppAlert } from "../../contexts/appAlertContext/useAppAlert.js";
2
+ import { useAxios } from "../useAxios.js";
3
+ import { getWorkflow } from "../../api/workflow.js";
4
+ import { useEffect } from "react";
5
+ import { useQuery } from "@tanstack/react-query";
6
+ //#region src/hooks/workflow/useFetchWorkflow.ts
7
+ var defaultQueryOptions = {
8
+ refetchOnMount: "always",
9
+ staleTime: 0,
10
+ gcTime: 0
11
+ };
12
+ /**
13
+ * useFetchWorkflow
14
+ *
15
+ * Data-fetching hook built on TanStack Query to retrieve a single workflow by ID.
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 id - Workflow identifier (required).
22
+ * @param workspace - Workspace the workflow belongs to (required).
23
+ * @param queryOptions - TanStack Query options passed through to `useQuery` (e.g., enabled, staleTime, gcTime, etc.).
24
+ *
25
+ * @returns TanStack Query result extended with `queryKey`.
26
+ *
27
+ * Tip:
28
+ * - The returned `queryKey` can be reused by mutation hooks for cache invalidation:
29
+ * ```ts
30
+ * const fetch = useFetchWorkflow({ id: "wf-123", workspace: "main" });
31
+ * useWorkflowMutations({ queryKey: fetch.queryKey });
32
+ * ```
33
+ *
34
+ * Example:
35
+ * ```ts
36
+ * const { data, isLoading } = useFetchWorkflow({ id: "wf-123", workspace: "main" });
37
+ * // data -> Workflow
38
+ * ```
39
+ */
40
+ var useFetchWorkflow = ({ id, workspace, queryOptions = defaultQueryOptions }) => {
41
+ const { api } = useAxios();
42
+ const { showAlert } = useAppAlert();
43
+ const queryKey = [
44
+ "workflow",
45
+ id,
46
+ workspace
47
+ ];
48
+ const query = useQuery({
49
+ queryKey,
50
+ queryFn: async () => {
51
+ return await getWorkflow(api, id, workspace);
52
+ },
53
+ ...queryOptions ?? {}
54
+ });
55
+ useEffect(() => {
56
+ if (!query.error) return;
57
+ showAlert({
58
+ severity: "error",
59
+ message: query.error.message
60
+ });
61
+ }, [query.error, showAlert]);
62
+ return {
63
+ ...query,
64
+ queryKey
65
+ };
66
+ };
67
+ //#endregion
68
+ export { useFetchWorkflow };
69
+
70
+ //# sourceMappingURL=useFetchWorkflow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchWorkflow.js","names":[],"sources":["../../../src/hooks/workflow/useFetchWorkflow.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 { getWorkflow } from \"@/api/workflow\";\nimport type { Workflow } from \"@/types/workflow\";\nimport type { EntityQueryOptions, FetchEntityParams } from \"@/types/entityQuery\";\n\nexport type FetchWorkflowProps<TData = Workflow, TSelected = TData> = FetchEntityParams<TData, TSelected>;\n\nconst defaultQueryOptions: EntityQueryOptions<Workflow> = {\n refetchOnMount: \"always\",\n staleTime: 0,\n gcTime: 0\n}\n\n/**\n * useFetchWorkflow\n *\n * Data-fetching hook built on TanStack Query to retrieve a single workflow by ID.\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 id - Workflow 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 * Tip:\n * - The returned `queryKey` can be reused by mutation hooks for cache invalidation:\n * ```ts\n * const fetch = useFetchWorkflow({ id: \"wf-123\", workspace: \"main\" });\n * useWorkflowMutations({ queryKey: fetch.queryKey });\n * ```\n *\n * Example:\n * ```ts\n * const { data, isLoading } = useFetchWorkflow({ id: \"wf-123\", workspace: \"main\" });\n * // data -> Workflow\n * ```\n */\nexport const useFetchWorkflow = ({ id, workspace, queryOptions = defaultQueryOptions }: FetchWorkflowProps) => {\n\n const { api } = useAxios();\n const { showAlert } = useAppAlert();\n\n const queryKey = [\"workflow\", id, workspace];\n\n const query = useQuery<Workflow>({\n queryKey,\n queryFn: async () => {\n const workflow = await getWorkflow(api, id, workspace);\n return workflow;\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":";;;;;;AAYA,IAAM,sBAAoD;CACtD,gBAAgB;CAChB,WAAW;CACX,QAAQ;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAa,oBAAoB,EAAE,IAAI,WAAW,eAAe,0BAA8C;CAE3G,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,EAAE,cAAc,YAAY;CAElC,MAAM,WAAW;EAAC;EAAY;EAAI;CAAS;CAE3C,MAAM,QAAQ,SAAmB;EAC7B;EACA,SAAS,YAAY;GAEjB,OAAO,MADgB,YAAY,KAAK,IAAI,SAAS;EAEzD;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"}
@@ -0,0 +1,198 @@
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> = {
4
+ workflowId: string;
5
+ workflowExecutionId: string;
6
+ workspace: string;
7
+ queryOptions?: EntityQueryOptions<TData, TSelected>;
8
+ };
9
+ /**
10
+ * useFetchWorkflowExecution
11
+ *
12
+ * Data-fetching hook built on TanStack Query to retrieve a single workflow execution.
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
+ * ```
34
+ */
35
+ export declare const useFetchWorkflowExecution: ({ workflowId, workflowExecutionId, workspace, queryOptions }: FetchWorkflowExecutionProps) => {
36
+ queryKey: string[];
37
+ data: WorkflowExecution;
38
+ error: Error;
39
+ isError: true;
40
+ isPending: false;
41
+ isLoading: false;
42
+ isLoadingError: false;
43
+ isRefetchError: true;
44
+ isSuccess: false;
45
+ isPlaceholderData: false;
46
+ status: "error";
47
+ dataUpdatedAt: number;
48
+ errorUpdatedAt: number;
49
+ failureCount: number;
50
+ failureReason: Error | null;
51
+ errorUpdateCount: number;
52
+ isFetched: boolean;
53
+ isFetchedAfterMount: boolean;
54
+ isFetching: boolean;
55
+ isInitialLoading: boolean;
56
+ isPaused: boolean;
57
+ isRefetching: boolean;
58
+ isStale: boolean;
59
+ isEnabled: boolean;
60
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
61
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
62
+ } | {
63
+ queryKey: string[];
64
+ data: WorkflowExecution;
65
+ error: null;
66
+ isError: false;
67
+ isPending: false;
68
+ isLoading: false;
69
+ isLoadingError: false;
70
+ isRefetchError: false;
71
+ isSuccess: true;
72
+ isPlaceholderData: false;
73
+ status: "success";
74
+ dataUpdatedAt: number;
75
+ errorUpdatedAt: number;
76
+ failureCount: number;
77
+ failureReason: Error | null;
78
+ errorUpdateCount: number;
79
+ isFetched: boolean;
80
+ isFetchedAfterMount: boolean;
81
+ isFetching: boolean;
82
+ isInitialLoading: boolean;
83
+ isPaused: boolean;
84
+ isRefetching: boolean;
85
+ isStale: boolean;
86
+ isEnabled: boolean;
87
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
88
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
89
+ } | {
90
+ queryKey: string[];
91
+ data: undefined;
92
+ error: Error;
93
+ isError: true;
94
+ isPending: false;
95
+ isLoading: false;
96
+ isLoadingError: true;
97
+ isRefetchError: false;
98
+ isSuccess: false;
99
+ isPlaceholderData: false;
100
+ status: "error";
101
+ dataUpdatedAt: number;
102
+ errorUpdatedAt: number;
103
+ failureCount: number;
104
+ failureReason: Error | null;
105
+ errorUpdateCount: number;
106
+ isFetched: boolean;
107
+ isFetchedAfterMount: boolean;
108
+ isFetching: boolean;
109
+ isInitialLoading: boolean;
110
+ isPaused: boolean;
111
+ isRefetching: boolean;
112
+ isStale: boolean;
113
+ isEnabled: boolean;
114
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
115
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
116
+ } | {
117
+ queryKey: string[];
118
+ data: undefined;
119
+ error: null;
120
+ isError: false;
121
+ isPending: true;
122
+ isLoading: true;
123
+ isLoadingError: false;
124
+ isRefetchError: false;
125
+ isSuccess: false;
126
+ isPlaceholderData: false;
127
+ status: "pending";
128
+ dataUpdatedAt: number;
129
+ errorUpdatedAt: number;
130
+ failureCount: number;
131
+ failureReason: Error | null;
132
+ errorUpdateCount: number;
133
+ isFetched: boolean;
134
+ isFetchedAfterMount: boolean;
135
+ isFetching: boolean;
136
+ isInitialLoading: boolean;
137
+ isPaused: boolean;
138
+ isRefetching: boolean;
139
+ isStale: boolean;
140
+ isEnabled: boolean;
141
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
142
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
143
+ } | {
144
+ queryKey: string[];
145
+ data: undefined;
146
+ error: null;
147
+ isError: false;
148
+ isPending: true;
149
+ isLoadingError: false;
150
+ isRefetchError: false;
151
+ isSuccess: false;
152
+ isPlaceholderData: false;
153
+ status: "pending";
154
+ dataUpdatedAt: number;
155
+ errorUpdatedAt: number;
156
+ failureCount: number;
157
+ failureReason: Error | null;
158
+ errorUpdateCount: number;
159
+ isFetched: boolean;
160
+ isFetchedAfterMount: boolean;
161
+ isFetching: boolean;
162
+ isLoading: boolean;
163
+ isInitialLoading: boolean;
164
+ isPaused: boolean;
165
+ isRefetching: boolean;
166
+ isStale: boolean;
167
+ isEnabled: boolean;
168
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
169
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
170
+ } | {
171
+ queryKey: string[];
172
+ data: WorkflowExecution;
173
+ isError: false;
174
+ error: null;
175
+ isPending: false;
176
+ isLoading: false;
177
+ isLoadingError: false;
178
+ isRefetchError: false;
179
+ isSuccess: true;
180
+ isPlaceholderData: true;
181
+ status: "success";
182
+ dataUpdatedAt: number;
183
+ errorUpdatedAt: number;
184
+ failureCount: number;
185
+ failureReason: Error | null;
186
+ errorUpdateCount: number;
187
+ isFetched: boolean;
188
+ isFetchedAfterMount: boolean;
189
+ isFetching: boolean;
190
+ isInitialLoading: boolean;
191
+ isPaused: boolean;
192
+ isRefetching: boolean;
193
+ isStale: boolean;
194
+ isEnabled: boolean;
195
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WorkflowExecution, Error>>;
196
+ fetchStatus: import("@tanstack/query-core").FetchStatus;
197
+ };
198
+ //# sourceMappingURL=useFetchWorkflowExecution.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,69 @@
1
+ import { useAppAlert } from "../../contexts/appAlertContext/useAppAlert.js";
2
+ import { useAxios } from "../useAxios.js";
3
+ import { getWorkflowExecution } from "../../api/workflow.js";
4
+ import { useEffect } from "react";
5
+ import { useQuery } from "@tanstack/react-query";
6
+ //#region src/hooks/workflow/useFetchWorkflowExecution.ts
7
+ var defaultQueryOptions = {
8
+ refetchOnMount: "always",
9
+ staleTime: 0,
10
+ gcTime: 0
11
+ };
12
+ /**
13
+ * useFetchWorkflowExecution
14
+ *
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`.
27
+ *
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
+ * ```
37
+ */
38
+ var useFetchWorkflowExecution = ({ workflowId, workflowExecutionId, workspace, queryOptions = defaultQueryOptions }) => {
39
+ const { api } = useAxios();
40
+ const { showAlert } = useAppAlert();
41
+ const queryKey = [
42
+ "workflow_execution",
43
+ workflowId,
44
+ workflowExecutionId,
45
+ workspace
46
+ ];
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
+ return {
62
+ ...query,
63
+ queryKey
64
+ };
65
+ };
66
+ //#endregion
67
+ export { useFetchWorkflowExecution };
68
+
69
+ //# sourceMappingURL=useFetchWorkflowExecution.js.map
@@ -0,0 +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"}
@@ -0,0 +1,49 @@
1
+ import { type UseInfiniteQueryOptions, type QueryKey } from "@tanstack/react-query";
2
+ import type { FetchEntitiesParams } from "../../types/entityQuery.d.ts";
3
+ 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[]>> & {
7
+ workflowId: string;
8
+ pageSize?: number;
9
+ };
10
+ /**
11
+ * useFetchWorkflowExecutions
12
+ *
13
+ * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
14
+ * workflow executions for a given workflow with cursor-based pagination.
15
+ *
16
+ * Automatically flattens all pages into a single `WorkflowExecution[]` via `select`.
17
+ *
18
+ * Note: `query.data` returns a flat `WorkflowExecution[]` with all fetched items merged across pages.
19
+ *
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
+ * ```
43
+ */
44
+ export declare function useFetchWorkflowExecutions({ workflowId, filters, order, projection, pageSize, queryOptions }: FetchInfiniteWorkflowExecutionProps): {
45
+ query: import("@tanstack/react-query").UseInfiniteQueryResult<WorkflowExecution[], Error>;
46
+ queryKey: unknown[];
47
+ };
48
+ export {};
49
+ //# sourceMappingURL=useFetchWorkflowExecutions.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,77 @@
1
+ import { useAxios } from "../useAxios.js";
2
+ import { buildQueryKey, buildQueryObject } from "../../api/entityQuery.js";
3
+ import { listWorkflowExecutions } from "../../api/workflow.js";
4
+ import { useMemo } from "react";
5
+ import { useInfiniteQuery } from "@tanstack/react-query";
6
+ //#region src/hooks/workflow/useFetchWorkflowExecutions.ts
7
+ var defaultQueryOptions = {
8
+ refetchOnMount: "always",
9
+ staleTime: 0,
10
+ gcTime: 0
11
+ };
12
+ /**
13
+ * useFetchWorkflowExecutions
14
+ *
15
+ * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
16
+ * workflow executions for a given workflow with cursor-based pagination.
17
+ *
18
+ * Automatically flattens all pages into a single `WorkflowExecution[]` via `select`.
19
+ *
20
+ * Note: `query.data` returns a flat `WorkflowExecution[]` with all fetched items merged across pages.
21
+ *
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
+ * ```
45
+ */
46
+ function useFetchWorkflowExecutions({ workflowId, filters = [], order = [], projection = "", pageSize = 10, queryOptions }) {
47
+ const { api } = useAxios();
48
+ const queryKey = buildQueryKey(["workflow_executions", workflowId], filters);
49
+ const mergedQueryOptions = useMemo(() => ({
50
+ ...defaultQueryOptions,
51
+ ...queryOptions ?? {}
52
+ }), [queryOptions]);
53
+ return {
54
+ query: useInfiniteQuery({
55
+ 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
70
+ }),
71
+ queryKey
72
+ };
73
+ }
74
+ //#endregion
75
+ export { useFetchWorkflowExecutions };
76
+
77
+ //# sourceMappingURL=useFetchWorkflowExecutions.js.map
@@ -0,0 +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"}
@@ -0,0 +1,47 @@
1
+ import { type UseInfiniteQueryOptions, type QueryKey } from "@tanstack/react-query";
2
+ 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[]>;
9
+ };
10
+ /**
11
+ * useFetchWorkflows
12
+ *
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).
15
+ *
16
+ * Automatically flattens all pages into a single `Workflow[]` via `select`.
17
+ *
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
+ * ```
41
+ */
42
+ export declare function useFetchWorkflows({ workspace, pageSize, queryOptions }: FetchInfiniteWorkflowProps): {
43
+ query: import("@tanstack/react-query").UseInfiniteQueryResult<Workflow[], Error>;
44
+ queryKey: readonly unknown[];
45
+ };
46
+ export {};
47
+ //# sourceMappingURL=useFetchWorkflows.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,67 @@
1
+ import { useAxios } from "../useAxios.js";
2
+ import { listWorkflows } from "../../api/workflow.js";
3
+ import { useMemo } from "react";
4
+ import { useInfiniteQuery } from "@tanstack/react-query";
5
+ //#region src/hooks/workflow/useFetchWorkflows.ts
6
+ var defaultQueryOptions = {
7
+ refetchOnMount: "always",
8
+ staleTime: 0,
9
+ gcTime: 0
10
+ };
11
+ /**
12
+ * useFetchWorkflows
13
+ *
14
+ * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
15
+ * workflows with cursor-based pagination using the legacy method (workspace as query param).
16
+ *
17
+ * Automatically flattens all pages into a single `Workflow[]` via `select`.
18
+ *
19
+ * Note: `query.data` returns a flat `Workflow[]` with all fetched items merged across pages.
20
+ *
21
+ * @param {string} [workspace]
22
+ * Current workspace name. Sent as a query param via the legacy method, required by some API configurations.
23
+ *
24
+ * @param {number} [pageSize=10]
25
+ * Number of workflows to fetch per page.
26
+ *
27
+ * @param {InfiniteOptions<Workflow[]>} [queryOptions]
28
+ * TanStack Query options passed through to `useInfiniteQuery`
29
+ * (e.g., enabled, staleTime, gcTime, etc.).
30
+ *
31
+ * @returns {{ query, queryKey }}
32
+ * - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
33
+ * - `queryKey`: the cache key used by React Query
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const { query } = useFetchWorkflows({ workspace: "ws-1", pageSize: 20 });
38
+ *
39
+ * // Flat list of all fetched workflows
40
+ * const workflows = query.data ?? [];
41
+ * ```
42
+ */
43
+ function useFetchWorkflows({ workspace, pageSize = 10, queryOptions }) {
44
+ const { api } = useAxios();
45
+ const queryKey = ["workflows", workspace ?? null];
46
+ const mergedQueryOptions = useMemo(() => ({
47
+ ...defaultQueryOptions,
48
+ ...queryOptions ?? {}
49
+ }), [queryOptions]);
50
+ return {
51
+ query: useInfiniteQuery({
52
+ queryKey,
53
+ initialPageParam: null,
54
+ getNextPageParam: (lastPage) => lastPage.next_page_token ?? void 0,
55
+ queryFn: async ({ pageParam }) => {
56
+ return await listWorkflows(api, workspace, pageSize, pageParam ?? void 0);
57
+ },
58
+ select: (data) => data.pages.flatMap((p) => p.workflows),
59
+ ...mergedQueryOptions
60
+ }),
61
+ queryKey
62
+ };
63
+ }
64
+ //#endregion
65
+ export { useFetchWorkflows };
66
+
67
+ //# sourceMappingURL=useFetchWorkflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFetchWorkflows.js","names":[],"sources":["../../../src/hooks/workflow/useFetchWorkflows.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useInfiniteQuery, type UseInfiniteQueryOptions, type QueryKey } from \"@tanstack/react-query\";\n\nimport { useAxios } from \"@/hooks/useAxios\";\nimport { listWorkflows } from \"@/api/workflow\";\nimport type { Workflow, WorkflowListResponse } from \"@/types/workflow\";\n\ntype PageToken = string | null;\n\ntype InfiniteOptions<TData> = Omit<UseInfiniteQueryOptions<WorkflowListResponse, Error, TData, QueryKey, PageToken>,\"queryKey\" | \"queryFn\" | \"initialPageParam\" | \"getNextPageParam\">;\n\nexport type FetchInfiniteWorkflowProps = {\n workspace?: string;\n pageSize?: number;\n queryOptions?: InfiniteOptions<Workflow[]>;\n};\n\nconst defaultQueryOptions: InfiniteOptions<Workflow[]> = {\n refetchOnMount: \"always\",\n staleTime: 0,\n gcTime: 0,\n};\n\n/**\n * useFetchWorkflows\n *\n * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve\n * workflows with cursor-based pagination using the legacy method (workspace as query param).\n *\n * Automatically flattens all pages into a single `Workflow[]` via `select`.\n *\n * Note: `query.data` returns a flat `Workflow[]` with all fetched items merged across pages.\n *\n * @param {string} [workspace]\n * Current workspace name. Sent as a query param via the legacy method, required by some API configurations.\n *\n * @param {number} [pageSize=10]\n * Number of workflows to fetch per page.\n *\n * @param {InfiniteOptions<Workflow[]>} [queryOptions]\n * TanStack Query options passed through to `useInfiniteQuery`\n * (e.g., enabled, staleTime, gcTime, etc.).\n *\n * @returns {{ query, queryKey }}\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 } = useFetchWorkflows({ workspace: \"ws-1\", pageSize: 20 });\n *\n * // Flat list of all fetched workflows\n * const workflows = query.data ?? [];\n * ```\n */\nexport function useFetchWorkflows({ workspace, pageSize = 10, queryOptions }: FetchInfiniteWorkflowProps) {\n const { api } = useAxios();\n\n const queryKey: QueryKey = [\"workflows\", workspace ?? null];\n\n const mergedQueryOptions = useMemo<InfiniteOptions<Workflow[]>>(() => ({\n ...defaultQueryOptions,\n ...(queryOptions ?? {}),\n }), [queryOptions]);\n\n const query = useInfiniteQuery<WorkflowListResponse, Error, Workflow[], QueryKey, PageToken>({\n queryKey,\n initialPageParam: null,\n getNextPageParam: (lastPage) => lastPage.next_page_token ?? undefined,\n\n queryFn: async ({ pageParam }) => {\n return await listWorkflows(api, workspace, pageSize, pageParam ?? undefined);\n },\n\n select: (data) => data.pages.flatMap((p) => p.workflows),\n\n ...mergedQueryOptions,\n });\n\n return {\n query,\n queryKey,\n };\n}\n"],"mappings":";;;;;AAiBA,IAAM,sBAAmD;CACrD,gBAAgB;CAChB,WAAW;CACX,QAAQ;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,SAAgB,kBAAkB,EAAE,WAAW,WAAW,IAAI,gBAA4C;CACtG,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,WAAqB,CAAC,aAAa,aAAa,IAAI;CAE1D,MAAM,qBAAqB,eAA4C;EACnE,GAAG;EACH,GAAI,gBAAgB,CAAC;CACzB,IAAI,CAAC,YAAY,CAAC;CAgBlB,OAAO;EACH,OAfU,iBAA+E;GACzF;GACA,kBAAkB;GAClB,mBAAmB,aAAa,SAAS,mBAAmB,KAAA;GAE5D,SAAS,OAAO,EAAE,gBAAgB;IAC9B,OAAO,MAAM,cAAc,KAAK,WAAW,UAAU,aAAa,KAAA,CAAS;GAC/E;GAEA,SAAS,SAAS,KAAK,MAAM,SAAS,MAAM,EAAE,SAAS;GAEvD,GAAG;EACP,CAGI;EACA;CACJ;AACJ"}
@@ -0,0 +1,30 @@
1
+ import type { AnyRecord } from "../../types/anyRecord.d.ts";
2
+ import type { PollWorkflowExecutionOptions } from "../../api/workflow.js";
3
+ type RunWorkflowProps = {
4
+ id: string;
5
+ workspace: string;
6
+ parameters: AnyRecord;
7
+ pollOptions?: PollWorkflowExecutionOptions;
8
+ };
9
+ /**
10
+ * useRunWorkflow
11
+ *
12
+ * TanStack Query mutations to run a workflow. Synchronous execution (`synchronous: true`) is
13
+ * intentionally not used; instead the workflow is started asynchronously and, when the result
14
+ * is needed, its execution is polled until it reaches a terminal state.
15
+ *
16
+ * - `runAsync`: starts the workflow and returns immediately (fire-and-forget). Use when you do
17
+ * not need to wait for completion or consume the output.
18
+ * - `runAndGetResult`: starts the workflow, polls until it finishes, then fetches the output of
19
+ * the ender worker. Resolves with `{ execution, workerExecution, result }`; `result` is `null`
20
+ * when the workflow produces no output. This is the replacement for the old synchronous flow.
21
+ *
22
+ * Both surface the standard mutation helpers (`mutate`, `mutateAsync`, `isPending`, `data`, ...)
23
+ * and report failures through `useAppAlert`.
24
+ */
25
+ export declare const useRunWorkflow: () => {
26
+ runAsync: import("@tanstack/react-query").UseMutationResult<AnyRecord, Error, RunWorkflowProps, unknown>;
27
+ runAndGetResult: import("@tanstack/react-query").UseMutationResult<import("../../api/workflow.js").WorkflowResult, Error, RunWorkflowProps, unknown>;
28
+ };
29
+ export {};
30
+ //# sourceMappingURL=useRunWorkflow.d.ts.map