@everysk/apps-sdk 0.1.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 +395 -8
  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 +6 -6
  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,70 +1,65 @@
1
- import { type UseInfiniteQueryOptions, type QueryKey } from "@tanstack/react-query";
2
- import type { DatastoreWithRows } from "../../types/datastore.d.ts";
3
- import type { FetchEntitiesParams, EntityDefaultResponse } from "../../types/entityQuery.d.ts";
4
- type PageToken = string | null;
5
- type InfiniteOptions<TData> = Omit<UseInfiniteQueryOptions<DatastoreQueryPage, Error, TData, QueryKey, PageToken>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
6
- export type DatastoreQueryPage = EntityDefaultResponse & {
7
- datastores: DatastoreWithRows[];
1
+ import type { ParsedDatastore } from "../../types/datastore.d.ts";
2
+ import type { DatastoreDataFormat } from "../../types/datastoreDataFormat.d.ts";
3
+ import type { PagedResponse, FetchEntitiesProps, ListQueryProps, ListCache } from "../../types/entityQuery.d.ts";
4
+ export type DatastoreQueryPage<F extends DatastoreDataFormat = "object"> = PagedResponse & {
5
+ datastores: ParsedDatastore<F>[];
8
6
  };
9
- export type FetchInfiniteDatastoreProps = FetchEntitiesParams<DatastoreWithRows[], InfiniteOptions<DatastoreWithRows[]>> & {
10
- pageSize?: number;
7
+ /** The query cache of `useFetchDatastores`, for typing `setQueryData`. */
8
+ export type DatastoresCache<F extends DatastoreDataFormat = "object"> = ListCache<DatastoreQueryPage<F>>;
9
+ export type FetchDatastoresProps<F extends DatastoreDataFormat = "object", TData = ParsedDatastore<F>[]> = ListQueryProps & FetchEntitiesProps<ParsedDatastore<F>, TData, DatastoreQueryPage<F>> & {
10
+ /**
11
+ * Tabular datastores only: `"object"` (default) turns the matrix into one object per row;
12
+ * `"matrix"` leaves the matrix, header row included. A JSON datastore's `data` is unchanged either way.
13
+ */
14
+ dataFormat?: F;
11
15
  };
12
16
  /**
13
17
  * useFetchDatastores
14
18
  *
15
- * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
16
- * datastores with cursor-based pagination.
19
+ * Lists datastores with cursor pagination. `query.data` is every loaded page merged into one
20
+ * `ParsedDatastore[]`, each datastore's matrix converted to row objects — or whatever
21
+ * `select` makes of that list.
17
22
  *
18
- * It also:
19
- * - flattens all pages into a single `DatastoreWithRows[]` via `select`
20
- * - exposes `actions` for cache management
21
- * - exposes `events` for ag-Grid integration
23
+ * Built to be used directly rather than wrapped: `select` shapes the result, `queryKey` and
24
+ * `DatastoresCache` let an app write to the cache, and `fetchAllPages` reads a whole set.
25
+ * Paging on grid scroll is `handleRowsScrollEnd` from `@everysk/apps-sdk/ag-grid`, kept out of
26
+ * this hook so it works for any list.
22
27
  *
23
- * Important notes:
24
- * - `query.data` returns a flat `DatastoreWithRows[]` (all pages merged).
25
- * - Each item retains the full `Datastore` shape, with `data` replaced by `AnyRecord[]` (rows transformed via `tableToObjects`).
28
+ * Without a `workspace` filter, or with an empty one, the read fails at once with an error
29
+ * naming this hook, logged to the console, and no request is sent. The app config is in place
30
+ * before the app renders, so a missing workspace is a misconfigured app, never a wait.
26
31
  *
27
- * Parameters (FetchInfiniteDatastoreProps):
28
- * @param {FilterClause[]} [filters=[]]
29
- * Filters applied to every page request. Must include a `workspace` filter.
32
+ * Rows are converted in the request (`parseDatastore`), so the cache holds objects and an
33
+ * app patches a row as `{ ...row, ...patch }`. `dataFormat: "matrix"` skips the conversion and
34
+ * leaves a tabular datastore's matrix unconverted, for a grid that takes arrays, an export, or a
35
+ * datastore too large to convert. It is a value, not a conversion function, so that it can be
36
+ * part of the cache key: two callers converting differently would otherwise share one entry.
30
37
  *
31
- * @param {string[]} [order=[]]
32
- * Sorting applied to every page request.
33
- *
34
- * @param {string} [projection=""]
35
- * Single field to project: `"field"` returns only that field (others come back null),
36
- * `"-field"` returns every field except that one. One field only — lists 500. Omitted when empty.
37
- *
38
- * @param {number} [pageSize=10]
39
- * Number of datastores to fetch per page.
40
- *
41
- * @param {InfiniteOptions<DatastoreWithRows[]>} [queryOptions]
42
- * TanStack Query options passed through to `useInfiniteQuery`
43
- * (e.g., enabled, staleTime, gcTime, etc.).
44
- *
45
- * Returns:
46
- * @returns {object}
47
- * - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
48
- * - `queryKey`: the cache key used by React Query
49
- * - `events.handleFetchIfGridEmptyOrNearEnd(gridApi)`: triggers next page fetch when the ag-Grid is empty or near the end of the list
38
+ * @param {FilterClause[]} [filters=[]] - Filters of every page request; one must be `workspace`.
39
+ * @param {string[]} [order=[]] - Sorting of every page request.
40
+ * @param {Projection} [projection=""] - The fields to return, one or a list: `"field"` returns
41
+ * only that field (others come back null), `"-field"` every field but that one. Several go as a
42
+ * list, never comma-joined — `"a,b"` is a 500.
43
+ * @param {number} [pageSize=10] - Datastores per request.
44
+ * @param {"object" | "matrix"} [dataFormat="object"] - How a table's rows are handed over.
45
+ * @param {(datastores: ParsedDatastore[]) => TData} [select] - Shapes the merged list.
46
+ * @param {boolean} [fetchAllPages=false] - Reads to the last page before reporting success.
47
+ * @param {EntityInfiniteQueryOptions} [queryOptions] - Passed through to `useInfiniteQuery`.
48
+ * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.
50
49
  *
51
50
  * Example:
52
51
  * ```ts
53
- * const { query, events } = useFetchDatastores({
54
- * filters: [{ field: "workspace", value: "ws-1" }],
55
- * pageSize: 20,
56
- * });
57
- *
58
- * // Flat list of all fetched datastores with transformed rows
59
- * const datastores = query.data ?? [];
52
+ * // A list can mix tabular and JSON datastores; only a table's `data` is rows.
53
+ * const toRows = (datastores: ParsedDatastore[]) => datastores.filter(isTableDatastore).flatMap((d) => d.data);
60
54
  *
61
- * // Load next page when grid is near end
62
- * <AgGridReact onBodyScroll={() => events.handleFetchIfGridEmptyOrNearEnd(gridApi)} />
55
+ * const { query } = useFetchDatastores({
56
+ * filters: [{ field: "workspace", value: workspace }],
57
+ * select: toRows, // query.data: AnyRecord[]
58
+ * });
63
59
  * ```
64
60
  */
65
- export declare function useFetchDatastores({ filters, order, projection, pageSize, queryOptions }: FetchInfiniteDatastoreProps): {
66
- query: import("@tanstack/react-query").UseInfiniteQueryResult<DatastoreWithRows[], Error>;
61
+ export declare function useFetchDatastores<F extends DatastoreDataFormat = "object", TData = ParsedDatastore<F>[]>({ filters, order, projection, pageSize, dataFormat, select, fetchAllPages, queryOptions, }: FetchDatastoresProps<F, TData>): {
62
+ query: import("@tanstack/react-query").UseInfiniteQueryResult<TData, Error>;
67
63
  queryKey: unknown[];
68
64
  };
69
- export {};
70
65
  //# sourceMappingURL=useFetchDatastores.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchDatastores.d.ts","sourceRoot":"","sources":["../../../src/hooks/datastore/useFetchDatastores.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,uBAAuB,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQtG,OAAO,KAAK,EAAoC,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAGtF,KAAK,SAAS,GAAG,MAAM,GAAG,IAAI,CAAC;AAE/B,KAAK,eAAe,CAAC,KAAK,IAAI,IAAI,CAC9B,uBAAuB,CAAC,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,EAC9E,UAAU,GAAG,SAAS,GAAG,kBAAkB,GAAG,kBAAkB,CACnE,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,qBAAqB,GAAG;IACrD,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,CAAC,iBAAiB,EAAE,EAAE,eAAe,CAAC,iBAAiB,EAAE,CAAC,CAAC,GAAG;IACvH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,OAAY,EAAE,KAAU,EAAE,UAAe,EAAE,QAAa,EAAE,YAAY,EAAE,EAAE,2BAA2B;;;EAwEzI"}
1
+ {"version":3,"file":"useFetchDatastores.d.ts","sourceRoot":"","sources":["../../../src/hooks/datastore/useFetchDatastores.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EACR,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,SAAS,EACZ,MAAM,qBAAqB,CAAC;AAQ7B,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,mBAAmB,GAAG,QAAQ,IAAI,aAAa,GAAG;IACvF,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;CACpC,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,mBAAmB,GAAG,QAAQ,IAAI,SAAS,CAC7E,kBAAkB,CAAC,CAAC,CAAC,CACxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAC5B,CAAC,SAAS,mBAAmB,GAAG,QAAQ,EACxC,KAAK,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,IAC5B,cAAc,GACd,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG;IACnE;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,CAAC;CAClB,CAAC;AAEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,kBAAkB,CAC9B,CAAC,SAAS,mBAAmB,GAAG,QAAQ,EACxC,KAAK,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,EAC9B,EACE,OAAY,EACZ,KAAU,EACV,UAAe,EACf,QAAa,EACb,UAAU,EACV,MAAM,EACN,aAAqB,EACrB,YAAY,GACf,EAAE,oBAAoB,CAAC,CAAC,EAAE,KAAK,CAAC;;;EAsChC"}
@@ -1,100 +1,85 @@
1
1
  import { useAxios } from "../useAxios.js";
2
- import { buildQueryKey, buildQueryObject } from "../../api/entityQuery.js";
2
+ import { useEntityInfiniteQuery } from "../useEntityInfiniteQuery.js";
3
+ import { buildQueryKey, buildQueryObject, hasWorkspaceFilter, missingWorkspaceError } from "../../api/entityQuery.js";
3
4
  import { listDatastores } from "../../api/datastore.js";
4
- import { tableToObjects } from "../../lib/datastoreTable.js";
5
- import { useMemo } from "react";
6
- import { useInfiniteQuery } from "@tanstack/react-query";
5
+ import { parseDatastore } from "../../lib/datastoreTable.js";
7
6
  //#region src/hooks/datastore/useFetchDatastores.ts
8
- var defaultQueryOptions = {
9
- refetchOnMount: "always",
10
- staleTime: 0,
11
- gcTime: 0
12
- };
13
7
  /**
14
8
  * useFetchDatastores
15
9
  *
16
- * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
17
- * datastores with cursor-based pagination.
10
+ * Lists datastores with cursor pagination. `query.data` is every loaded page merged into one
11
+ * `ParsedDatastore[]`, each datastore's matrix converted to row objects — or whatever
12
+ * `select` makes of that list.
18
13
  *
19
- * It also:
20
- * - flattens all pages into a single `DatastoreWithRows[]` via `select`
21
- * - exposes `actions` for cache management
22
- * - exposes `events` for ag-Grid integration
14
+ * Built to be used directly rather than wrapped: `select` shapes the result, `queryKey` and
15
+ * `DatastoresCache` let an app write to the cache, and `fetchAllPages` reads a whole set.
16
+ * Paging on grid scroll is `handleRowsScrollEnd` from `@everysk/apps-sdk/ag-grid`, kept out of
17
+ * this hook so it works for any list.
23
18
  *
24
- * Important notes:
25
- * - `query.data` returns a flat `DatastoreWithRows[]` (all pages merged).
26
- * - Each item retains the full `Datastore` shape, with `data` replaced by `AnyRecord[]` (rows transformed via `tableToObjects`).
19
+ * Without a `workspace` filter, or with an empty one, the read fails at once with an error
20
+ * naming this hook, logged to the console, and no request is sent. The app config is in place
21
+ * before the app renders, so a missing workspace is a misconfigured app, never a wait.
27
22
  *
28
- * Parameters (FetchInfiniteDatastoreProps):
29
- * @param {FilterClause[]} [filters=[]]
30
- * Filters applied to every page request. Must include a `workspace` filter.
23
+ * Rows are converted in the request (`parseDatastore`), so the cache holds objects and an
24
+ * app patches a row as `{ ...row, ...patch }`. `dataFormat: "matrix"` skips the conversion and
25
+ * leaves a tabular datastore's matrix unconverted, for a grid that takes arrays, an export, or a
26
+ * datastore too large to convert. It is a value, not a conversion function, so that it can be
27
+ * part of the cache key: two callers converting differently would otherwise share one entry.
31
28
  *
32
- * @param {string[]} [order=[]]
33
- * Sorting applied to every page request.
34
- *
35
- * @param {string} [projection=""]
36
- * Single field to project: `"field"` returns only that field (others come back null),
37
- * `"-field"` returns every field except that one. One field only — lists 500. Omitted when empty.
38
- *
39
- * @param {number} [pageSize=10]
40
- * Number of datastores to fetch per page.
41
- *
42
- * @param {InfiniteOptions<DatastoreWithRows[]>} [queryOptions]
43
- * TanStack Query options passed through to `useInfiniteQuery`
44
- * (e.g., enabled, staleTime, gcTime, etc.).
45
- *
46
- * Returns:
47
- * @returns {object}
48
- * - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
49
- * - `queryKey`: the cache key used by React Query
50
- * - `events.handleFetchIfGridEmptyOrNearEnd(gridApi)`: triggers next page fetch when the ag-Grid is empty or near the end of the list
29
+ * @param {FilterClause[]} [filters=[]] - Filters of every page request; one must be `workspace`.
30
+ * @param {string[]} [order=[]] - Sorting of every page request.
31
+ * @param {Projection} [projection=""] - The fields to return, one or a list: `"field"` returns
32
+ * only that field (others come back null), `"-field"` every field but that one. Several go as a
33
+ * list, never comma-joined — `"a,b"` is a 500.
34
+ * @param {number} [pageSize=10] - Datastores per request.
35
+ * @param {"object" | "matrix"} [dataFormat="object"] - How a table's rows are handed over.
36
+ * @param {(datastores: ParsedDatastore[]) => TData} [select] - Shapes the merged list.
37
+ * @param {boolean} [fetchAllPages=false] - Reads to the last page before reporting success.
38
+ * @param {EntityInfiniteQueryOptions} [queryOptions] - Passed through to `useInfiniteQuery`.
39
+ * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.
51
40
  *
52
41
  * Example:
53
42
  * ```ts
54
- * const { query, events } = useFetchDatastores({
55
- * filters: [{ field: "workspace", value: "ws-1" }],
56
- * pageSize: 20,
57
- * });
58
- *
59
- * // Flat list of all fetched datastores with transformed rows
60
- * const datastores = query.data ?? [];
43
+ * // A list can mix tabular and JSON datastores; only a table's `data` is rows.
44
+ * const toRows = (datastores: ParsedDatastore[]) => datastores.filter(isTableDatastore).flatMap((d) => d.data);
61
45
  *
62
- * // Load next page when grid is near end
63
- * <AgGridReact onBodyScroll={() => events.handleFetchIfGridEmptyOrNearEnd(gridApi)} />
46
+ * const { query } = useFetchDatastores({
47
+ * filters: [{ field: "workspace", value: workspace }],
48
+ * select: toRows, // query.data: AnyRecord[]
49
+ * });
64
50
  * ```
65
51
  */
66
- function useFetchDatastores({ filters = [], order = [], projection = "", pageSize = 10, queryOptions }) {
52
+ function useFetchDatastores({ filters = [], order = [], projection = "", pageSize = 10, dataFormat, select, fetchAllPages = false, queryOptions }) {
67
53
  const { api } = useAxios();
68
- const queryKey = buildQueryKey(["datastores"], filters);
69
- const mergedQueryOptions = useMemo(() => ({
70
- ...defaultQueryOptions,
71
- ...queryOptions ?? {}
72
- }), [queryOptions]);
54
+ const format = dataFormat ?? "object";
55
+ const queryKey = buildQueryKey(["datastores"], filters, {
56
+ order,
57
+ projection,
58
+ pageSize,
59
+ fetchAllPages,
60
+ dataFormat: format
61
+ });
73
62
  return {
74
- query: useInfiniteQuery({
63
+ query: useEntityInfiniteQuery({
75
64
  queryKey,
76
- initialPageParam: null,
77
- getNextPageParam: (lastPage) => lastPage.next_page_token ?? void 0,
78
- queryFn: async ({ pageParam }) => {
79
- const queryFilter = buildQueryObject({
65
+ itemsKey: "datastores",
66
+ fetchPage: async (pageToken, signal) => {
67
+ const response = await listDatastores(api, buildQueryObject({
80
68
  filters,
81
69
  order,
82
70
  projection,
83
71
  pageSize,
84
- pageToken: pageParam ?? void 0
85
- });
86
- const response = await listDatastores(api, queryFilter);
87
- const nested = response.datastores.map((datastore) => ({
88
- ...datastore,
89
- data: tableToObjects(datastore.id, datastore.data?.[0], datastore.data)
90
- }));
72
+ pageToken
73
+ }), signal);
91
74
  return {
92
75
  next_page_token: response.next_page_token,
93
- datastores: nested
76
+ datastores: response.datastores.map((datastore) => parseDatastore(datastore, format))
94
77
  };
95
78
  },
96
- select: (data) => data.pages.flatMap((p) => p.datastores),
97
- ...mergedQueryOptions
79
+ select,
80
+ fetchAllPages,
81
+ configError: hasWorkspaceFilter(filters) ? void 0 : missingWorkspaceError("useFetchDatastores"),
82
+ queryOptions
98
83
  }),
99
84
  queryKey
100
85
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchDatastores.js","names":[],"sources":["../../../src/hooks/datastore/useFetchDatastores.ts"],"sourcesContent":["//import { useCallback, useMemo, useRef } from \"react\";\nimport { useMemo } from \"react\";\nimport { useInfiniteQuery, type UseInfiniteQueryOptions, type QueryKey } from \"@tanstack/react-query\";\n\n//import type { GridApi } from \"ag-grid-community\";\n\nimport { useAxios } from \"@/hooks/useAxios\";\nimport { tableToObjects } from \"@/lib/datastoreTable\";\nimport { listDatastores } from \"@/api/datastore\";\n\nimport type { Datastore, DatastoreListResponse, DatastoreWithRows } from \"@/types/datastore\";\nimport type { FetchEntitiesParams, EntityDefaultResponse } from \"@/types/entityQuery\";\nimport { buildQueryKey, buildQueryObject } from \"@/api/entityQuery\";\n\ntype PageToken = string | null;\n\ntype InfiniteOptions<TData> = Omit<\n UseInfiniteQueryOptions<DatastoreQueryPage, Error, TData, QueryKey, PageToken>,\n \"queryKey\" | \"queryFn\" | \"initialPageParam\" | \"getNextPageParam\"\n>;\n\n\nexport type DatastoreQueryPage = EntityDefaultResponse & {\n datastores: DatastoreWithRows[];\n};\n\nexport type FetchInfiniteDatastoreProps = FetchEntitiesParams<DatastoreWithRows[], InfiniteOptions<DatastoreWithRows[]>> & {\n pageSize?: number;\n};\n\nconst defaultQueryOptions: InfiniteOptions<DatastoreWithRows[]> = {\n refetchOnMount: \"always\",\n staleTime: 0,\n gcTime: 0,\n};\n\n/**\n * useFetchDatastores\n *\n * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve\n * datastores with cursor-based pagination.\n *\n * It also:\n * - flattens all pages into a single `DatastoreWithRows[]` via `select`\n * - exposes `actions` for cache management\n * - exposes `events` for ag-Grid integration\n *\n * Important notes:\n * - `query.data` returns a flat `DatastoreWithRows[]` (all pages merged).\n * - Each item retains the full `Datastore` shape, with `data` replaced by `AnyRecord[]` (rows transformed via `tableToObjects`).\n *\n * Parameters (FetchInfiniteDatastoreProps):\n * @param {FilterClause[]} [filters=[]]\n * Filters applied to every page request. Must include a `workspace` filter.\n *\n * @param {string[]} [order=[]]\n * Sorting applied to every page request.\n *\n * @param {string} [projection=\"\"]\n * Single field to project: `\"field\"` returns only that field (others come back null),\n * `\"-field\"` returns every field except that one. One field only — lists 500. Omitted when empty.\n *\n * @param {number} [pageSize=10]\n * Number of datastores to fetch per page.\n *\n * @param {InfiniteOptions<DatastoreWithRows[]>} [queryOptions]\n * TanStack Query options passed through to `useInfiniteQuery`\n * (e.g., enabled, staleTime, gcTime, etc.).\n *\n * Returns:\n * @returns {object}\n * - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)\n * - `queryKey`: the cache key used by React Query\n * - `events.handleFetchIfGridEmptyOrNearEnd(gridApi)`: triggers next page fetch when the ag-Grid is empty or near the end of the list\n *\n * Example:\n * ```ts\n * const { query, events } = useFetchDatastores({\n * filters: [{ field: \"workspace\", value: \"ws-1\" }],\n * pageSize: 20,\n * });\n *\n * // Flat list of all fetched datastores with transformed rows\n * const datastores = query.data ?? [];\n *\n * // Load next page when grid is near end\n * <AgGridReact onBodyScroll={() => events.handleFetchIfGridEmptyOrNearEnd(gridApi)} />\n * ```\n */\nexport function useFetchDatastores({ filters = [], order = [], projection = \"\", pageSize = 10, queryOptions }: FetchInfiniteDatastoreProps) {\n const { api } = useAxios();\n\n //const fetchingGuardRef = useRef(false);\n const queryKey = buildQueryKey([\"datastores\"], filters);\n\n const mergedQueryOptions = useMemo<InfiniteOptions<DatastoreWithRows[]>>(() => ({\n ...defaultQueryOptions,\n ...(queryOptions ?? {}),\n }), [queryOptions]);\n\n const query = useInfiniteQuery<DatastoreQueryPage, Error, DatastoreWithRows[], 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 const response: DatastoreListResponse = await listDatastores(api, queryFilter);\n\n const nested: DatastoreWithRows[] = response.datastores.map((datastore: Datastore) => ({\n ...datastore,\n data: tableToObjects(\n datastore.id,\n datastore.data?.[0] as string[],\n datastore.data\n ),\n }));\n\n return {\n next_page_token: response.next_page_token,\n datastores: nested,\n };\n },\n\n select: (data) => data.pages.flatMap((p) => p.datastores),\n\n ...mergedQueryOptions,\n });\n\n /*\n const { hasNextPage, isFetchingNextPage, fetchNextPage } = query;\n const handleFetchIfGridEmptyOrNearEnd = useCallback((gridApi: GridApi) => {\n if (!hasNextPage || isFetchingNextPage || fetchingGuardRef.current) return;\n\n const total = gridApi.getDisplayedRowCount();\n const last = gridApi.getLastDisplayedRowIndex();\n\n const isEmpty = total === 0 || last < 0;\n const isNearEnd = !isEmpty && (total - 1 - last) <= 30;\n\n if (!isEmpty && !isNearEnd) return;\n\n fetchingGuardRef.current = true;\n fetchNextPage().finally(() => {\n fetchingGuardRef.current = false;\n });\n }, [hasNextPage, isFetchingNextPage, fetchNextPage]);\n */\n\n return {\n query,\n queryKey,\n //events: { handleFetchIfGridEmptyOrNearEnd },\n };\n}"],"mappings":";;;;;;;AA8BA,IAAM,sBAA4D;CAC9D,gBAAgB;CAChB,WAAW;CACX,QAAQ;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgB,mBAAmB,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,aAAa,IAAI,WAAW,IAAI,gBAA6C;CACxI,MAAM,EAAE,QAAQ,SAAS;CAGzB,MAAM,WAAW,cAAc,CAAC,YAAY,GAAG,OAAO;CAEtD,MAAM,qBAAqB,eAAqD;EAC5E,GAAG;EACH,GAAI,gBAAgB,CAAC;CACzB,IAAI,CAAC,YAAY,CAAC;CA0DlB,OAAO;EACH,OAzDU,iBAAsF;GAChG;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,MAAM,WAAkC,MAAM,eAAe,KAAK,WAAW;IAE7E,MAAM,SAA8B,SAAS,WAAW,KAAK,eAA0B;KACnF,GAAG;KACH,MAAM,eACF,UAAU,IACV,UAAU,OAAO,IACjB,UAAU,IACd;IACJ,EAAE;IAEF,OAAO;KACH,iBAAiB,SAAS;KAC1B,YAAY;IAChB;GACJ;GAEA,SAAS,SAAS,KAAK,MAAM,SAAS,MAAM,EAAE,UAAU;GAExD,GAAG;EACP,CAuBI;EACA;CAEJ;AACJ"}
1
+ {"version":3,"file":"useFetchDatastores.js","names":[],"sources":["../../../src/hooks/datastore/useFetchDatastores.ts"],"sourcesContent":["import { useAxios } from \"@/hooks/useAxios\";\nimport { useEntityInfiniteQuery } from \"@/hooks/useEntityInfiniteQuery\";\nimport { parseDatastore } from \"@/lib/datastoreTable\";\nimport { listDatastores } from \"@/api/datastore\";\n\nimport type { DatastoreListResponse, ParsedDatastore } from \"@/types/datastore\";\nimport type { DatastoreDataFormat } from \"@/types/datastoreDataFormat\";\nimport type {\n PagedResponse,\n FetchEntitiesProps,\n ListQueryProps,\n ListCache,\n} from \"@/types/entityQuery\";\nimport {\n buildQueryKey,\n buildQueryObject,\n hasWorkspaceFilter,\n missingWorkspaceError,\n} from \"@/api/entityQuery\";\n\nexport type DatastoreQueryPage<F extends DatastoreDataFormat = \"object\"> = PagedResponse & {\n datastores: ParsedDatastore<F>[];\n};\n\n/** The query cache of `useFetchDatastores`, for typing `setQueryData`. */\nexport type DatastoresCache<F extends DatastoreDataFormat = \"object\"> = ListCache<\n DatastoreQueryPage<F>\n>;\n\nexport type FetchDatastoresProps<\n F extends DatastoreDataFormat = \"object\",\n TData = ParsedDatastore<F>[],\n> = ListQueryProps &\n FetchEntitiesProps<ParsedDatastore<F>, TData, DatastoreQueryPage<F>> & {\n /**\n * Tabular datastores only: `\"object\"` (default) turns the matrix into one object per row;\n * `\"matrix\"` leaves the matrix, header row included. A JSON datastore's `data` is unchanged either way.\n */\n dataFormat?: F;\n };\n\n/**\n * useFetchDatastores\n *\n * Lists datastores with cursor pagination. `query.data` is every loaded page merged into one\n * `ParsedDatastore[]`, each datastore's matrix converted to row objects — or whatever\n * `select` makes of that list.\n *\n * Built to be used directly rather than wrapped: `select` shapes the result, `queryKey` and\n * `DatastoresCache` let an app write to the cache, and `fetchAllPages` reads a whole set.\n * Paging on grid scroll is `handleRowsScrollEnd` from `@everysk/apps-sdk/ag-grid`, kept out of\n * this hook so it works for any list.\n *\n * Without a `workspace` filter, or with an empty one, the read fails at once with an error\n * naming this hook, logged to the console, and no request is sent. The app config is in place\n * before the app renders, so a missing workspace is a misconfigured app, never a wait.\n *\n * Rows are converted in the request (`parseDatastore`), so the cache holds objects and an\n * app patches a row as `{ ...row, ...patch }`. `dataFormat: \"matrix\"` skips the conversion and\n * leaves a tabular datastore's matrix unconverted, for a grid that takes arrays, an export, or a\n * datastore too large to convert. It is a value, not a conversion function, so that it can be\n * part of the cache key: two callers converting differently would otherwise share one entry.\n *\n * @param {FilterClause[]} [filters=[]] - Filters of every page request; one must be `workspace`.\n * @param {string[]} [order=[]] - Sorting of every page request.\n * @param {Projection} [projection=\"\"] - The fields to return, one or a list: `\"field\"` returns\n * only that field (others come back null), `\"-field\"` every field but that one. Several go as a\n * list, never comma-joined — `\"a,b\"` is a 500.\n * @param {number} [pageSize=10] - Datastores per request.\n * @param {\"object\" | \"matrix\"} [dataFormat=\"object\"] - How a table's rows are handed over.\n * @param {(datastores: ParsedDatastore[]) => TData} [select] - Shapes the merged list.\n * @param {boolean} [fetchAllPages=false] - Reads to the last page before reporting success.\n * @param {EntityInfiniteQueryOptions} [queryOptions] - Passed through to `useInfiniteQuery`.\n * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.\n *\n * Example:\n * ```ts\n * // A list can mix tabular and JSON datastores; only a table's `data` is rows.\n * const toRows = (datastores: ParsedDatastore[]) => datastores.filter(isTableDatastore).flatMap((d) => d.data);\n *\n * const { query } = useFetchDatastores({\n * filters: [{ field: \"workspace\", value: workspace }],\n * select: toRows, // query.data: AnyRecord[]\n * });\n * ```\n */\nexport function useFetchDatastores<\n F extends DatastoreDataFormat = \"object\",\n TData = ParsedDatastore<F>[],\n>({\n filters = [],\n order = [],\n projection = \"\",\n pageSize = 10,\n dataFormat,\n select,\n fetchAllPages = false,\n queryOptions,\n}: FetchDatastoresProps<F, TData>) {\n const { api } = useAxios();\n\n const format = (dataFormat ?? \"object\") as F;\n const queryKey = buildQueryKey([\"datastores\"], filters, {\n order,\n projection,\n pageSize,\n fetchAllPages,\n dataFormat: format,\n });\n\n const query = useEntityInfiniteQuery<DatastoreQueryPage<F>, \"datastores\", TData>({\n queryKey,\n itemsKey: \"datastores\",\n fetchPage: async (pageToken, signal) => {\n const response: DatastoreListResponse = await listDatastores(\n api,\n buildQueryObject({ filters, order, projection, pageSize, pageToken }),\n signal,\n );\n\n return {\n next_page_token: response.next_page_token,\n datastores: response.datastores.map((datastore) =>\n parseDatastore(datastore, format),\n ),\n };\n },\n select,\n fetchAllPages,\n configError: hasWorkspaceFilter(filters)\n ? undefined\n : missingWorkspaceError(\"useFetchDatastores\"),\n queryOptions,\n });\n\n return { query, queryKey };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,SAAgB,mBAGd,EACE,UAAU,CAAC,GACX,QAAQ,CAAC,GACT,aAAa,IACb,WAAW,IACX,YACA,QACA,gBAAgB,OAChB,gBAC+B;CAC/B,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,SAAU,cAAc;CAC9B,MAAM,WAAW,cAAc,CAAC,YAAY,GAAG,SAAS;EACpD;EACA;EACA;EACA;EACA,YAAY;CAChB,CAAC;CA2BD,OAAO;EAAE,OAzBK,uBAAmE;GAC7E;GACA,UAAU;GACV,WAAW,OAAO,WAAW,WAAW;IACpC,MAAM,WAAkC,MAAM,eAC1C,KACA,iBAAiB;KAAE;KAAS;KAAO;KAAY;KAAU;IAAU,CAAC,GACpE,MACJ;IAEA,OAAO;KACH,iBAAiB,SAAS;KAC1B,YAAY,SAAS,WAAW,KAAK,cACjC,eAAe,WAAW,MAAM,CACpC;IACJ;GACJ;GACA;GACA;GACA,aAAa,mBAAmB,OAAO,IACjC,KAAA,IACA,sBAAsB,oBAAoB;GAChD;EACJ,CAES;EAAO;CAAS;AAC7B"}
@@ -0,0 +1,17 @@
1
+ import type { EveryskFile } from "../../types/file.d.ts";
2
+ /** What the file hooks take about a file's content. */
3
+ export type FileDataProps = {
4
+ /**
5
+ * `true` returns the content (`data`, base64). Left out by default: it is a third larger than
6
+ * the file, and showing or downloading a file needs only its `url` (`/file/<hash>`), which
7
+ * the platform serves inline with the user's session and the devkit's dev server serves too.
8
+ * With a list `projection` of the app's own that includes fields, `data` comes only if the
9
+ * projection names it.
10
+ */
11
+ withData?: boolean;
12
+ };
13
+ /** The file without its content, as the hooks return it unless `withData` asks for it. */
14
+ export declare const withoutData: <F extends {
15
+ data: EveryskFile["data"];
16
+ }>(file: F) => F;
17
+ //# sourceMappingURL=fileData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileData.d.ts","sourceRoot":"","sources":["../../../src/hooks/file/fileData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,uDAAuD;AACvD,MAAM,MAAM,aAAa,GAAG;IACxB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS;IAAE,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,EAAE,MAAM,CAAC,KAAG,CAG7E,CAAC"}
@@ -0,0 +1,10 @@
1
+ //#region src/hooks/file/fileData.ts
2
+ /** The file without its content, as the hooks return it unless `withData` asks for it. */
3
+ var withoutData = (file) => ({
4
+ ...file,
5
+ data: null
6
+ });
7
+ //#endregion
8
+ export { withoutData };
9
+
10
+ //# sourceMappingURL=fileData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileData.js","names":[],"sources":["../../../src/hooks/file/fileData.ts"],"sourcesContent":["import type { EveryskFile } from \"@/types/file\";\n\n/** What the file hooks take about a file's content. */\nexport type FileDataProps = {\n /**\n * `true` returns the content (`data`, base64). Left out by default: it is a third larger than\n * the file, and showing or downloading a file needs only its `url` (`/file/<hash>`), which\n * the platform serves inline with the user's session and the devkit's dev server serves too.\n * With a list `projection` of the app's own that includes fields, `data` comes only if the\n * projection names it.\n */\n withData?: boolean;\n};\n\n/** The file without its content, as the hooks return it unless `withData` asks for it. */\nexport const withoutData = <F extends { data: EveryskFile[\"data\"] }>(file: F): F => ({\n ...file,\n data: null,\n});\n"],"mappings":";;AAeA,IAAa,eAAwD,UAAgB;CACjF,GAAG;CACH,MAAM;AACV"}
@@ -1,54 +1,24 @@
1
1
  import type { EveryskFile } from "../../types/file.d.ts";
2
- import type { FetchEntityParams } from "../../types/entityQuery.d.ts";
3
- export type FetchFileProps<TData = EveryskFile, TSelected = TData> = FetchEntityParams<TData, TSelected>;
2
+ import type { FetchEntityByIdProps } from "../../types/entityQuery.d.ts";
3
+ import { type FileDataProps } from "./fileData";
4
+ export type FetchFileProps<TData = EveryskFile, TSelected = TData> = FetchEntityByIdProps<TData, TSelected> & FileDataProps;
4
5
  /**
5
6
  * useFetchFile
6
7
  *
7
- * Data-fetching hook built on TanStack Query to retrieve a single file by ID.
8
+ * Fetches one file; `data` is the file, or whatever `select` makes of it. Idle while `id` is
9
+ * empty; fails loudly, without a request, while `workspace` is. A failure is shown as an error
10
+ * alert. The file comes without its content unless `withData` asks for it: show or download it
11
+ * through its `url`.
8
12
  *
9
- * It also:
10
- * - builds a stable React Query `queryKey` that can be reused by mutation hooks for cache invalidation
11
- * - triggers an error alert via `useAppAlert` whenever `query.error` is present
12
- *
13
- * Important notes:
14
- * - Always returns a single `EveryskFile` object.
15
- * - `EveryskFile.data` represents the file content and is expected to be a Base64-encoded string
16
- * when provided by the API (or when sending content through mutations).
17
- *
18
- * Parameters (FetchFileProps):
19
- * @param {string} id
20
- * EveryskFile identifier (required).
21
- *
22
- * @param {string} workspace
23
- * Workspace the file belongs to (required by `getFile`).
24
- *
25
- * @param {EntityQueryOptions<any>} [queryOptions=defaultQueryOptions]
26
- * TanStack Query options passed through to `useQuery` (e.g., enabled, staleTime, gcTime, etc.).
27
- *
28
- * Returns:
29
- * @returns {object}
30
- * TanStack Query's `query` object extended with:
31
- * - `queryKey`: the cache key used by React Query
32
- *
33
- * Tip:
34
- * - The returned `queryKey` can be reused by mutation hooks for cache invalidation:
35
- * ```ts
36
- * const fetch = useFetchFile({ id: "file-123", workspace: "ws-1" });
37
- * useFileMutations({ queryKey: fetch.queryKey });
38
- * ```
39
- *
40
- * Example:
41
- * ```ts
42
- * const { data, isLoading } = useFetchFile({
43
- * id: "file-123",
44
- * workspace: "ws-1",
45
- * });
46
- * // data -> EveryskFile
47
- * ```
13
+ * @param {FetchFileProps} props - `id`, `workspace`, `withData`, `select` and TanStack
14
+ * `queryOptions`.
15
+ * @returns {object} The `useQuery` result, plus `queryKey`.
48
16
  */
49
- export declare const useFetchFile: ({ id, workspace, queryOptions }: FetchFileProps) => {
50
- queryKey: string[];
51
- data: EveryskFile;
17
+ export declare const useFetchFile: <TSelected = EveryskFile>({ id, workspace, select, queryOptions, withData, }: FetchFileProps<EveryskFile, TSelected>) => {
18
+ queryKey: (string | {
19
+ withData: boolean;
20
+ })[];
21
+ data: TSelected;
52
22
  error: Error;
53
23
  isError: true;
54
24
  isPending: false;
@@ -71,11 +41,13 @@ export declare const useFetchFile: ({ id, workspace, queryOptions }: FetchFilePr
71
41
  isRefetching: boolean;
72
42
  isStale: boolean;
73
43
  isEnabled: boolean;
74
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<EveryskFile, Error>>;
44
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
75
45
  fetchStatus: import("@tanstack/query-core").FetchStatus;
76
46
  } | {
77
- queryKey: string[];
78
- data: EveryskFile;
47
+ queryKey: (string | {
48
+ withData: boolean;
49
+ })[];
50
+ data: TSelected;
79
51
  error: null;
80
52
  isError: false;
81
53
  isPending: false;
@@ -98,10 +70,12 @@ export declare const useFetchFile: ({ id, workspace, queryOptions }: FetchFilePr
98
70
  isRefetching: boolean;
99
71
  isStale: boolean;
100
72
  isEnabled: boolean;
101
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<EveryskFile, Error>>;
73
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
102
74
  fetchStatus: import("@tanstack/query-core").FetchStatus;
103
75
  } | {
104
- queryKey: string[];
76
+ queryKey: (string | {
77
+ withData: boolean;
78
+ })[];
105
79
  data: undefined;
106
80
  error: Error;
107
81
  isError: true;
@@ -125,10 +99,12 @@ export declare const useFetchFile: ({ id, workspace, queryOptions }: FetchFilePr
125
99
  isRefetching: boolean;
126
100
  isStale: boolean;
127
101
  isEnabled: boolean;
128
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<EveryskFile, Error>>;
102
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
129
103
  fetchStatus: import("@tanstack/query-core").FetchStatus;
130
104
  } | {
131
- queryKey: string[];
105
+ queryKey: (string | {
106
+ withData: boolean;
107
+ })[];
132
108
  data: undefined;
133
109
  error: null;
134
110
  isError: false;
@@ -152,10 +128,12 @@ export declare const useFetchFile: ({ id, workspace, queryOptions }: FetchFilePr
152
128
  isRefetching: boolean;
153
129
  isStale: boolean;
154
130
  isEnabled: boolean;
155
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<EveryskFile, Error>>;
131
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
156
132
  fetchStatus: import("@tanstack/query-core").FetchStatus;
157
133
  } | {
158
- queryKey: string[];
134
+ queryKey: (string | {
135
+ withData: boolean;
136
+ })[];
159
137
  data: undefined;
160
138
  error: null;
161
139
  isError: false;
@@ -179,11 +157,13 @@ export declare const useFetchFile: ({ id, workspace, queryOptions }: FetchFilePr
179
157
  isRefetching: boolean;
180
158
  isStale: boolean;
181
159
  isEnabled: boolean;
182
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<EveryskFile, Error>>;
160
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
183
161
  fetchStatus: import("@tanstack/query-core").FetchStatus;
184
162
  } | {
185
- queryKey: string[];
186
- data: EveryskFile;
163
+ queryKey: (string | {
164
+ withData: boolean;
165
+ })[];
166
+ data: TSelected;
187
167
  isError: false;
188
168
  error: null;
189
169
  isPending: false;
@@ -206,7 +186,7 @@ export declare const useFetchFile: ({ id, workspace, queryOptions }: FetchFilePr
206
186
  isRefetching: boolean;
207
187
  isStale: boolean;
208
188
  isEnabled: boolean;
209
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<EveryskFile, Error>>;
189
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<TSelected, Error>>;
210
190
  fetchStatus: import("@tanstack/query-core").FetchStatus;
211
191
  };
212
192
  //# sourceMappingURL=useFetchFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchFile.d.ts","sourceRoot":"","sources":["../../../src/hooks/file/useFetchFile.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,KAAK,EAAsB,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,MAAM,MAAM,cAAc,CAAC,KAAK,GAAG,WAAW,EAAE,SAAS,GAAG,KAAK,IAAI,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAQzG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,eAAO,MAAM,YAAY,GAAI,iCAAuD,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BjG,CAAC"}
1
+ {"version":3,"file":"useFetchFile.d.ts","sourceRoot":"","sources":["../../../src/hooks/file/useFetchFile.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,MAAM,cAAc,CAAC,KAAK,GAAG,WAAW,EAAE,SAAS,GAAG,KAAK,IAAI,oBAAoB,CACrF,KAAK,EACL,SAAS,CACZ,GACG,aAAa,CAAC;AAElB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,GAAG,WAAW,EAAE,oDAMnD,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBxC,CAAC"}