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

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 (378) hide show
  1. package/README.md +342 -12
  2. package/dist/EveryskApp.d.ts +34 -2
  3. package/dist/EveryskApp.d.ts.map +1 -1
  4. package/dist/EveryskApp.js +35 -2
  5. package/dist/EveryskApp.js.map +1 -1
  6. package/dist/agGrid/handleRowsScrollEnd.d.ts +53 -0
  7. package/dist/agGrid/handleRowsScrollEnd.d.ts.map +1 -0
  8. package/dist/agGrid/handleRowsScrollEnd.js +47 -0
  9. package/dist/agGrid/handleRowsScrollEnd.js.map +1 -0
  10. package/dist/agGrid/index.d.ts +2 -0
  11. package/dist/agGrid/index.d.ts.map +1 -1
  12. package/dist/agGrid/index.js +2 -1
  13. package/dist/api/datastore.d.ts +10 -8
  14. package/dist/api/datastore.d.ts.map +1 -1
  15. package/dist/api/datastore.js +24 -55
  16. package/dist/api/datastore.js.map +1 -1
  17. package/dist/api/entityQuery.d.ts +46 -41
  18. package/dist/api/entityQuery.d.ts.map +1 -1
  19. package/dist/api/entityQuery.js +55 -14
  20. package/dist/api/entityQuery.js.map +1 -1
  21. package/dist/api/file.d.ts +26 -9
  22. package/dist/api/file.d.ts.map +1 -1
  23. package/dist/api/file.js +45 -55
  24. package/dist/api/file.js.map +1 -1
  25. package/dist/api/portfolio.d.ts +11 -8
  26. package/dist/api/portfolio.d.ts.map +1 -1
  27. package/dist/api/portfolio.js +24 -55
  28. package/dist/api/portfolio.js.map +1 -1
  29. package/dist/api/profile.d.ts +3 -2
  30. package/dist/api/profile.d.ts.map +1 -1
  31. package/dist/api/profile.js +4 -9
  32. package/dist/api/profile.js.map +1 -1
  33. package/dist/api/request.d.ts +106 -0
  34. package/dist/api/request.d.ts.map +1 -0
  35. package/dist/api/request.js +132 -0
  36. package/dist/api/request.js.map +1 -0
  37. package/dist/api/websocketsConfig.d.ts +7 -2
  38. package/dist/api/websocketsConfig.d.ts.map +1 -1
  39. package/dist/api/websocketsConfig.js +2 -10
  40. package/dist/api/websocketsConfig.js.map +1 -1
  41. package/dist/api/workflow.d.ts +84 -89
  42. package/dist/api/workflow.d.ts.map +1 -1
  43. package/dist/api/workflow.js +121 -208
  44. package/dist/api/workflow.js.map +1 -1
  45. package/dist/api/workspace.d.ts +18 -8
  46. package/dist/api/workspace.d.ts.map +1 -1
  47. package/dist/api/workspace.js +21 -26
  48. package/dist/api/workspace.js.map +1 -1
  49. package/dist/components/ui/Footer/index.d.ts.map +1 -1
  50. package/dist/components/ui/Footer/index.js.map +1 -1
  51. package/dist/components/ui/GlobalLoading/index.d.ts.map +1 -1
  52. package/dist/components/ui/GlobalLoading/index.js.map +1 -1
  53. package/dist/components/ui/PageContainer/index.d.ts +1 -1
  54. package/dist/components/ui/PageContainer/index.d.ts.map +1 -1
  55. package/dist/components/ui/PageContainer/index.js.map +1 -1
  56. package/dist/components/ui/Toolbar/index.d.ts +40 -3
  57. package/dist/components/ui/Toolbar/index.d.ts.map +1 -1
  58. package/dist/components/ui/Toolbar/index.js +42 -15
  59. package/dist/components/ui/Toolbar/index.js.map +1 -1
  60. package/dist/contexts/appAlertContext/provider.js.map +1 -1
  61. package/dist/contexts/appAlertContext/types.d.ts.map +1 -1
  62. package/dist/contexts/appConfigContext/index.d.ts.map +1 -1
  63. package/dist/contexts/appConfigContext/index.js.map +1 -1
  64. package/dist/contexts/appConfigContext/provider.d.ts.map +1 -1
  65. package/dist/contexts/appConfigContext/provider.js.map +1 -1
  66. package/dist/contexts/webSocketContext/handler.d.ts +3 -2
  67. package/dist/contexts/webSocketContext/handler.d.ts.map +1 -1
  68. package/dist/contexts/webSocketContext/handler.js.map +1 -1
  69. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.d.ts +1 -1
  70. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js +1 -1
  71. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js.map +1 -1
  72. package/dist/contexts/webSocketContext/provider.d.ts +6 -3
  73. package/dist/contexts/webSocketContext/provider.d.ts.map +1 -1
  74. package/dist/contexts/webSocketContext/provider.js +42 -7
  75. package/dist/contexts/webSocketContext/provider.js.map +1 -1
  76. package/dist/contexts/webSocketContext/types.d.ts +7 -5
  77. package/dist/contexts/webSocketContext/types.d.ts.map +1 -1
  78. package/dist/file/index.d.ts +2 -0
  79. package/dist/file/index.d.ts.map +1 -1
  80. package/dist/hooks/datastore/useDatastoreMutations.d.ts +4 -4
  81. package/dist/hooks/datastore/useDatastoreMutations.d.ts.map +1 -1
  82. package/dist/hooks/datastore/useDatastoreMutations.js +17 -55
  83. package/dist/hooks/datastore/useDatastoreMutations.js.map +1 -1
  84. package/dist/hooks/datastore/useFetchDatastore.d.ts +30 -41
  85. package/dist/hooks/datastore/useFetchDatastore.d.ts.map +1 -1
  86. package/dist/hooks/datastore/useFetchDatastore.js +25 -59
  87. package/dist/hooks/datastore/useFetchDatastore.js.map +1 -1
  88. package/dist/hooks/datastore/useFetchDatastores.d.ts +47 -52
  89. package/dist/hooks/datastore/useFetchDatastores.d.ts.map +1 -1
  90. package/dist/hooks/datastore/useFetchDatastores.js +55 -70
  91. package/dist/hooks/datastore/useFetchDatastores.js.map +1 -1
  92. package/dist/hooks/file/fileData.d.ts +17 -0
  93. package/dist/hooks/file/fileData.d.ts.map +1 -0
  94. package/dist/hooks/file/fileData.js +10 -0
  95. package/dist/hooks/file/fileData.js.map +1 -0
  96. package/dist/hooks/file/useFetchFile.d.ts +38 -58
  97. package/dist/hooks/file/useFetchFile.d.ts.map +1 -1
  98. package/dist/hooks/file/useFetchFile.js +26 -66
  99. package/dist/hooks/file/useFetchFile.js.map +1 -1
  100. package/dist/hooks/file/useFetchFiles.d.ts +18 -52
  101. package/dist/hooks/file/useFetchFiles.d.ts.map +1 -1
  102. package/dist/hooks/file/useFetchFiles.js +53 -69
  103. package/dist/hooks/file/useFetchFiles.js.map +1 -1
  104. package/dist/hooks/file/useFileMutations.d.ts +9 -8
  105. package/dist/hooks/file/useFileMutations.d.ts.map +1 -1
  106. package/dist/hooks/file/useFileMutations.js +23 -60
  107. package/dist/hooks/file/useFileMutations.js.map +1 -1
  108. package/dist/hooks/portfolio/useFetchPortfolio.d.ts +16 -50
  109. package/dist/hooks/portfolio/useFetchPortfolio.d.ts.map +1 -1
  110. package/dist/hooks/portfolio/useFetchPortfolio.js +15 -63
  111. package/dist/hooks/portfolio/useFetchPortfolio.js.map +1 -1
  112. package/dist/hooks/portfolio/useFetchPortfolios.d.ts +13 -52
  113. package/dist/hooks/portfolio/useFetchPortfolios.d.ts.map +1 -1
  114. package/dist/hooks/portfolio/useFetchPortfolios.js +29 -71
  115. package/dist/hooks/portfolio/useFetchPortfolios.js.map +1 -1
  116. package/dist/hooks/portfolio/usePortfolioMutations.d.ts +8 -8
  117. package/dist/hooks/portfolio/usePortfolioMutations.d.ts.map +1 -1
  118. package/dist/hooks/portfolio/usePortfolioMutations.js +20 -58
  119. package/dist/hooks/portfolio/usePortfolioMutations.js.map +1 -1
  120. package/dist/hooks/profile/useFetchProfile.d.ts +18 -44
  121. package/dist/hooks/profile/useFetchProfile.d.ts.map +1 -1
  122. package/dist/hooks/profile/useFetchProfile.js +16 -48
  123. package/dist/hooks/profile/useFetchProfile.js.map +1 -1
  124. package/dist/hooks/useAxios.js.map +1 -1
  125. package/dist/hooks/useEntityInfiniteQuery.d.ts +88 -0
  126. package/dist/hooks/useEntityInfiniteQuery.d.ts.map +1 -0
  127. package/dist/hooks/useEntityInfiniteQuery.js +111 -0
  128. package/dist/hooks/useEntityInfiniteQuery.js.map +1 -0
  129. package/dist/hooks/useEntityMutation.d.ts +47 -0
  130. package/dist/hooks/useEntityMutation.d.ts.map +1 -0
  131. package/dist/hooks/useEntityMutation.js +58 -0
  132. package/dist/hooks/useEntityMutation.js.map +1 -0
  133. package/dist/hooks/useEntityQuery.d.ts +68 -0
  134. package/dist/hooks/useEntityQuery.d.ts.map +1 -0
  135. package/dist/hooks/useEntityQuery.js +75 -0
  136. package/dist/hooks/useEntityQuery.js.map +1 -0
  137. package/dist/hooks/workflow/useFetchWorkerExecution.d.ts +17 -34
  138. package/dist/hooks/workflow/useFetchWorkerExecution.d.ts.map +1 -1
  139. package/dist/hooks/workflow/useFetchWorkerExecution.js +16 -46
  140. package/dist/hooks/workflow/useFetchWorkerExecution.js.map +1 -1
  141. package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts +179 -41
  142. package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts.map +1 -1
  143. package/dist/hooks/workflow/useFetchWorkerExecutions.js +29 -62
  144. package/dist/hooks/workflow/useFetchWorkerExecutions.js.map +1 -1
  145. package/dist/hooks/workflow/useFetchWorkflow.d.ts +16 -35
  146. package/dist/hooks/workflow/useFetchWorkflow.d.ts.map +1 -1
  147. package/dist/hooks/workflow/useFetchWorkflow.js +15 -48
  148. package/dist/hooks/workflow/useFetchWorkflow.js.map +1 -1
  149. package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts +17 -34
  150. package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts.map +1 -1
  151. package/dist/hooks/workflow/useFetchWorkflowExecution.js +16 -46
  152. package/dist/hooks/workflow/useFetchWorkflowExecution.js.map +1 -1
  153. package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts +22 -36
  154. package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts.map +1 -1
  155. package/dist/hooks/workflow/useFetchWorkflowExecutions.js +43 -56
  156. package/dist/hooks/workflow/useFetchWorkflowExecutions.js.map +1 -1
  157. package/dist/hooks/workflow/useFetchWorkflows.d.ts +20 -37
  158. package/dist/hooks/workflow/useFetchWorkflows.d.ts.map +1 -1
  159. package/dist/hooks/workflow/useFetchWorkflows.js +32 -47
  160. package/dist/hooks/workflow/useFetchWorkflows.js.map +1 -1
  161. package/dist/hooks/workflow/useRunWorkflow.d.ts +21 -16
  162. package/dist/hooks/workflow/useRunWorkflow.d.ts.map +1 -1
  163. package/dist/hooks/workflow/useRunWorkflow.js +66 -29
  164. package/dist/hooks/workflow/useRunWorkflow.js.map +1 -1
  165. package/dist/hooks/workflow/useTriggerWorkflow.d.ts +20 -0
  166. package/dist/hooks/workflow/useTriggerWorkflow.d.ts.map +1 -0
  167. package/dist/hooks/workflow/useTriggerWorkflow.js +32 -0
  168. package/dist/hooks/workflow/useTriggerWorkflow.js.map +1 -0
  169. package/dist/hooks/workspace/useFetchWorkspace.d.ts +19 -34
  170. package/dist/hooks/workspace/useFetchWorkspace.d.ts.map +1 -1
  171. package/dist/hooks/workspace/useFetchWorkspace.js +16 -46
  172. package/dist/hooks/workspace/useFetchWorkspace.js.map +1 -1
  173. package/dist/hooks/workspace/useFetchWorkspaces.d.ts +17 -37
  174. package/dist/hooks/workspace/useFetchWorkspaces.d.ts.map +1 -1
  175. package/dist/hooks/workspace/useFetchWorkspaces.js +25 -47
  176. package/dist/hooks/workspace/useFetchWorkspaces.js.map +1 -1
  177. package/dist/index.d.ts +13 -10
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +13 -11
  180. package/dist/lib/abort.d.ts +58 -0
  181. package/dist/lib/abort.d.ts.map +1 -0
  182. package/dist/lib/abort.js +112 -0
  183. package/dist/lib/abort.js.map +1 -0
  184. package/dist/lib/datastoreTable.d.ts +59 -54
  185. package/dist/lib/datastoreTable.d.ts.map +1 -1
  186. package/dist/lib/datastoreTable.js +58 -62
  187. package/dist/lib/datastoreTable.js.map +1 -1
  188. package/dist/lib/file.d.ts +34 -0
  189. package/dist/lib/file.d.ts.map +1 -0
  190. package/dist/lib/file.js +63 -0
  191. package/dist/lib/file.js.map +1 -0
  192. package/dist/lib/queryClient.d.ts.map +1 -1
  193. package/dist/lib/queryClient.js.map +1 -1
  194. package/dist/lib/workflowRun.d.ts +91 -0
  195. package/dist/lib/workflowRun.d.ts.map +1 -0
  196. package/dist/lib/workflowRun.js +224 -0
  197. package/dist/lib/workflowRun.js.map +1 -0
  198. package/dist/socket/index.d.ts +1 -3
  199. package/dist/socket/index.d.ts.map +1 -1
  200. package/dist/socket/index.js +3 -5
  201. package/dist/test/mocks/index.d.ts +1 -1
  202. package/dist/test/mocks/index.d.ts.map +1 -1
  203. package/dist/test/msw/fakeApi.d.ts +43 -0
  204. package/dist/test/msw/fakeApi.d.ts.map +1 -0
  205. package/dist/test/msw/fakeApi.js +74 -0
  206. package/dist/test/msw/fakeApi.js.map +1 -0
  207. package/dist/test/msw/handlers.d.ts +20 -0
  208. package/dist/test/msw/handlers.d.ts.map +1 -0
  209. package/dist/test/msw/handlers.js +279 -0
  210. package/dist/test/msw/handlers.js.map +1 -0
  211. package/dist/test/msw/index.d.ts +5 -0
  212. package/dist/test/msw/index.d.ts.map +1 -0
  213. package/dist/test/msw/index.js +2 -0
  214. package/dist/test/msw/query.d.ts +34 -0
  215. package/dist/test/msw/query.d.ts.map +1 -0
  216. package/dist/test/msw/query.js +96 -0
  217. package/dist/test/msw/query.js.map +1 -0
  218. package/dist/test/msw/recorder.d.ts +30 -0
  219. package/dist/test/msw/recorder.d.ts.map +1 -0
  220. package/dist/test/msw/recorder.js +65 -0
  221. package/dist/test/msw/recorder.js.map +1 -0
  222. package/dist/test/msw/store.d.ts +57 -0
  223. package/dist/test/msw/store.d.ts.map +1 -0
  224. package/dist/test/msw/store.js +145 -0
  225. package/dist/test/msw/store.js.map +1 -0
  226. package/dist/test/renderWithProviders.d.ts +2 -2
  227. package/dist/test/renderWithProviders.d.ts.map +1 -1
  228. package/dist/test/renderWithProviders.js.map +1 -1
  229. package/dist/test/setup.js.map +1 -1
  230. package/dist/theme/index.d.ts +1 -1
  231. package/dist/theme/index.d.ts.map +1 -1
  232. package/dist/theme/overrides/index.d.ts +4 -2
  233. package/dist/theme/overrides/index.d.ts.map +1 -1
  234. package/dist/theme/overrides/index.js +5 -3
  235. package/dist/theme/overrides/index.js.map +1 -1
  236. package/dist/theme/overrides/muiButton.d.ts +2 -2
  237. package/dist/theme/overrides/muiButton.js.map +1 -1
  238. package/dist/theme/overrides/muiCssBaseline.d.ts.map +1 -1
  239. package/dist/theme/overrides/muiCssBaseline.js.map +1 -1
  240. package/dist/theme/overrides/muiDatePicker.js.map +1 -1
  241. package/dist/theme/overrides/muiFormControl.js.map +1 -1
  242. package/dist/theme/overrides/muiIconButton.d.ts +2 -2
  243. package/dist/theme/overrides/muiIconButton.js.map +1 -1
  244. package/dist/theme/overrides/muiSelect.d.ts.map +1 -1
  245. package/dist/theme/overrides/muiSelect.js.map +1 -1
  246. package/dist/theme/overrides/muiSvgIcon.d.ts.map +1 -1
  247. package/dist/theme/overrides/muiSvgIcon.js.map +1 -1
  248. package/dist/theme/overrides/muiTextField.js.map +1 -1
  249. package/dist/theme/overrides/muiToggleButton.d.ts +2 -2
  250. package/dist/theme/overrides/muiToggleButton.js.map +1 -1
  251. package/dist/theme/overrides/muiToggleButtonGroup.d.ts +2 -2
  252. package/dist/theme/overrides/muiToggleButtonGroup.js.map +1 -1
  253. package/dist/theme/themes/DefaultDark.js +2 -2
  254. package/dist/theme/themes/DefaultDark.js.map +1 -1
  255. package/dist/theme/themes/DefaultLight.js +2 -2
  256. package/dist/theme/themes/DefaultLight.js.map +1 -1
  257. package/dist/theme/themes/EveryskDark.js +2 -2
  258. package/dist/theme/themes/EveryskDark.js.map +1 -1
  259. package/dist/theme/themes/EveryskLight.js +2 -2
  260. package/dist/theme/themes/EveryskLight.js.map +1 -1
  261. package/dist/theme/themes/MidnightEmber.js +2 -2
  262. package/dist/theme/themes/MidnightEmber.js.map +1 -1
  263. package/dist/types/anyRecord.d.ts.map +1 -1
  264. package/dist/types/datastore.d.ts +35 -5
  265. package/dist/types/datastore.d.ts.map +1 -1
  266. package/dist/types/datastoreDataFormat.d.ts +13 -0
  267. package/dist/types/datastoreDataFormat.d.ts.map +1 -0
  268. package/dist/types/entityQuery.d.ts +86 -16
  269. package/dist/types/entityQuery.d.ts.map +1 -1
  270. package/dist/types/file.d.ts +7 -3
  271. package/dist/types/file.d.ts.map +1 -1
  272. package/dist/types/portfolio.d.ts +1 -3
  273. package/dist/types/portfolio.d.ts.map +1 -1
  274. package/dist/types/profile.d.ts +0 -10
  275. package/dist/types/profile.d.ts.map +1 -1
  276. package/dist/types/workflow.d.ts +35 -6
  277. package/dist/types/workflow.d.ts.map +1 -1
  278. package/dist/types/workspace.d.ts +1 -2
  279. package/dist/types/workspace.d.ts.map +1 -1
  280. package/dist/ui/index.d.ts +1 -1
  281. package/dist/ui/index.d.ts.map +1 -1
  282. package/dist/workflow/index.d.ts +2 -0
  283. package/dist/workflow/index.d.ts.map +1 -1
  284. package/package.json +10 -1
  285. package/src/EveryskApp.tsx +53 -2
  286. package/src/agGrid/handleRowsScrollEnd.ts +71 -0
  287. package/src/agGrid/index.ts +5 -1
  288. package/src/api/datastore.ts +79 -107
  289. package/src/api/entityQuery.ts +86 -17
  290. package/src/api/file.ts +110 -103
  291. package/src/api/portfolio.ts +82 -125
  292. package/src/api/profile.ts +25 -18
  293. package/src/api/request.ts +168 -0
  294. package/src/api/websocketsConfig.ts +11 -19
  295. package/src/api/workflow.ts +232 -334
  296. package/src/api/workspace.ts +43 -43
  297. package/src/components/ui/Footer/index.tsx +8 -7
  298. package/src/components/ui/GlobalLoading/index.tsx +13 -3
  299. package/src/components/ui/PageContainer/index.tsx +9 -2
  300. package/src/components/ui/Toolbar/index.tsx +105 -30
  301. package/src/contexts/appAlertContext/provider.tsx +1 -1
  302. package/src/contexts/appAlertContext/types.ts +3 -3
  303. package/src/contexts/appConfigContext/index.tsx +1 -1
  304. package/src/contexts/appConfigContext/provider.tsx +1 -5
  305. package/src/contexts/webSocketContext/handler.ts +8 -2
  306. package/src/contexts/webSocketContext/hooks/useWebSocket/index.ts +1 -1
  307. package/src/contexts/webSocketContext/provider.tsx +64 -14
  308. package/src/contexts/webSocketContext/types.ts +7 -6
  309. package/src/file/index.ts +2 -0
  310. package/src/hooks/datastore/useDatastoreMutations.ts +19 -60
  311. package/src/hooks/datastore/useFetchDatastore.ts +45 -73
  312. package/src/hooks/datastore/useFetchDatastores.ts +106 -131
  313. package/src/hooks/file/fileData.ts +19 -0
  314. package/src/hooks/file/useFetchFile.ts +41 -76
  315. package/src/hooks/file/useFetchFiles.ts +92 -87
  316. package/src/hooks/file/useFileMutations.ts +23 -73
  317. package/src/hooks/portfolio/useFetchPortfolio.ts +26 -78
  318. package/src/hooks/portfolio/useFetchPortfolios.ts +50 -93
  319. package/src/hooks/portfolio/usePortfolioMutations.ts +22 -72
  320. package/src/hooks/profile/useFetchProfile.ts +24 -65
  321. package/src/hooks/useAxios.ts +5 -5
  322. package/src/hooks/useEntityInfiniteQuery.ts +193 -0
  323. package/src/hooks/useEntityMutation.ts +70 -0
  324. package/src/hooks/useEntityQuery.ts +117 -0
  325. package/src/hooks/workflow/useFetchWorkerExecution.ts +27 -56
  326. package/src/hooks/workflow/useFetchWorkerExecutions.ts +54 -79
  327. package/src/hooks/workflow/useFetchWorkflow.ts +24 -58
  328. package/src/hooks/workflow/useFetchWorkflowExecution.ts +27 -57
  329. package/src/hooks/workflow/useFetchWorkflowExecutions.ts +64 -73
  330. package/src/hooks/workflow/useFetchWorkflows.ts +48 -64
  331. package/src/hooks/workflow/useRunWorkflow.ts +82 -36
  332. package/src/hooks/workflow/useTriggerWorkflow.ts +36 -0
  333. package/src/hooks/workspace/useFetchWorkspace.ts +25 -58
  334. package/src/hooks/workspace/useFetchWorkspaces.ts +38 -69
  335. package/src/index.ts +34 -19
  336. package/src/lib/abort.ts +131 -0
  337. package/src/lib/datastoreTable.ts +127 -74
  338. package/src/lib/file.ts +67 -0
  339. package/src/lib/queryClient.ts +11 -13
  340. package/src/lib/workflowRun.ts +329 -0
  341. package/src/socket/index.ts +1 -3
  342. package/src/test/mocks/index.ts +1 -5
  343. package/src/test/msw/fakeApi.ts +83 -0
  344. package/src/test/msw/handlers.ts +350 -0
  345. package/src/test/msw/index.ts +9 -0
  346. package/src/test/msw/query.ts +134 -0
  347. package/src/test/msw/recorder.ts +88 -0
  348. package/src/test/msw/store.ts +182 -0
  349. package/src/test/renderWithProviders.tsx +8 -3
  350. package/src/test/setup.ts +16 -16
  351. package/src/theme/index.ts +1 -1
  352. package/src/theme/overrides/index.ts +5 -3
  353. package/src/theme/overrides/muiButton.ts +3 -3
  354. package/src/theme/overrides/muiCssBaseline.ts +11 -12
  355. package/src/theme/overrides/muiDatePicker.ts +2 -2
  356. package/src/theme/overrides/muiFormControl.ts +2 -2
  357. package/src/theme/overrides/muiIconButton.ts +3 -3
  358. package/src/theme/overrides/muiSelect.ts +2 -2
  359. package/src/theme/overrides/muiSvgIcon.ts +2 -2
  360. package/src/theme/overrides/muiTextField.ts +1 -1
  361. package/src/theme/overrides/muiToggleButton.ts +4 -4
  362. package/src/theme/overrides/muiToggleButtonGroup.ts +4 -4
  363. package/src/theme/themes/DefaultDark.ts +2 -2
  364. package/src/theme/themes/DefaultLight.ts +2 -2
  365. package/src/theme/themes/EveryskDark.ts +2 -2
  366. package/src/theme/themes/EveryskLight.ts +2 -2
  367. package/src/theme/themes/MidnightEmber.ts +15 -15
  368. package/src/types/anyRecord.ts +2 -2
  369. package/src/types/datastore.ts +56 -22
  370. package/src/types/datastoreDataFormat.ts +12 -0
  371. package/src/types/entityQuery.ts +122 -38
  372. package/src/types/file.ts +8 -6
  373. package/src/types/portfolio.ts +70 -74
  374. package/src/types/profile.ts +0 -11
  375. package/src/types/workflow.ts +38 -9
  376. package/src/types/workspace.ts +2 -4
  377. package/src/ui/index.ts +1 -1
  378. package/src/workflow/index.ts +5 -0
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchWorkspace.js","names":[],"sources":["../../../src/hooks/workspace/useFetchWorkspace.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 type { Workspace } from \"@/types/workspace\";\nimport { getWorkspace } from \"@/api/workspace\";\nimport type { EntityQueryOptions } from \"@/types/entityQuery\";\n\nexport type FetchWorkspaceProps<TData = Workspace, TSelected = TData> = {\n name: string;\n queryOptions?: EntityQueryOptions<TData, TSelected>;\n};\n\nconst defaultQueryOptions: EntityQueryOptions<Workspace> = {\n refetchOnMount: \"always\",\n staleTime: 0,\n gcTime: 0,\n};\n\n/**\n * useFetchWorkspace\n *\n * Data-fetching hook built on TanStack Query to retrieve a single workspace by name.\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 * Parameters (FetchWorkspaceProps):\n * @param {string} name\n * Workspace name (required).\n *\n * @param queryOptions\n * TanStack Query options passed through to `useQuery` (e.g., enabled, staleTime, gcTime, etc.).\n *\n * Returns:\n * @returns {object}\n * TanStack Query's `query` object extended with:\n * - `queryKey`: the cache key used by React Query\n *\n * Example:\n * ```ts\n * const { data, isLoading } = useFetchWorkspace({ name: \"main\" });\n * // data -> Workspace\n * ```\n */\nexport const useFetchWorkspace = ({ name, queryOptions = defaultQueryOptions }: FetchWorkspaceProps) => {\n\n const { api } = useAxios();\n const { showAlert } = useAppAlert();\n\n const queryKey = [\"workspace\", name];\n\n const query = useQuery<Workspace>({\n queryKey,\n queryFn: async () => {\n const workspace = await getWorkspace(api, name);\n return workspace;\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":";;;;;;AAeA,IAAM,sBAAqD;CACvD,gBAAgB;CAChB,WAAW;CACX,QAAQ;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,IAAa,qBAAqB,EAAE,MAAM,eAAe,0BAA+C;CAEpG,MAAM,EAAE,QAAQ,SAAS;CACzB,MAAM,EAAE,cAAc,YAAY;CAElC,MAAM,WAAW,CAAC,aAAa,IAAI;CAEnC,MAAM,QAAQ,SAAoB;EAC9B;EACA,SAAS,YAAY;GAEjB,OAAO,MADiB,aAAa,KAAK,IAAI;EAElD;EACA,GAAG,gBAAgB,CAAC;CACxB,CAAC;CAED,gBAAgB;EACZ,IAAI,CAAC,MAAM,OAAO;EAElB,UAAU;GACN,UAAU;GACV,SAAS,MAAM,MAAM;EACzB,CAAC;CACL,GAAG,CAAC,MAAM,OAAO,SAAS,CAAC;CAE3B,OAAO;EACH,GAAG;EACH;CACJ;AACJ"}
1
+ {"version":3,"file":"useFetchWorkspace.js","names":[],"sources":["../../../src/hooks/workspace/useFetchWorkspace.ts"],"sourcesContent":["import { useAxios } from \"@/hooks/useAxios\";\nimport { useEntityQuery } from \"@/hooks/useEntityQuery\";\nimport { getWorkspace } from \"@/api/workspace\";\nimport type { Workspace } from \"@/types/workspace\";\nimport type { FetchEntityProps } from \"@/types/entityQuery\";\n\nexport type FetchWorkspaceProps<TData = Workspace, TSelected = TData> = FetchEntityProps<\n TData,\n TSelected\n> & {\n name: string;\n};\n\n/**\n * useFetchWorkspace\n *\n * Fetches one workspace by name; `data` is the workspace, or whatever `select` makes of it.\n *\n * A workspace is identified by its name — the API's `GET /workspaces/:id` takes the name, its\n * UID — so `name` is this hook's id, and like the other hooks' id it usually comes from a\n * selection the user has not made yet: while it is empty the hook stays idle, rather than fail\n * as a misconfigured app. A failure is shown as an error alert.\n *\n * @param {FetchWorkspaceProps} props - `name`, `select` and TanStack `queryOptions`.\n * @returns {object} The `useQuery` result, plus `queryKey`.\n */\nexport const useFetchWorkspace = <TSelected = Workspace>({\n name,\n select,\n queryOptions,\n}: FetchWorkspaceProps<Workspace, TSelected>) => {\n const { api } = useAxios();\n\n const queryKey = [\"workspace\", name];\n\n const query = useEntityQuery<Workspace, TSelected>({\n queryKey,\n fetchEntity: (signal) => getWorkspace(api, name, signal),\n select,\n enabled: Boolean(name),\n queryOptions,\n });\n\n return { ...query, queryKey };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AA0BA,IAAa,qBAA4C,EACrD,MACA,QACA,mBAC6C;CAC7C,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,WAAW,CAAC,aAAa,IAAI;CAUnC,OAAO;EAAE,GARK,eAAqC;GAC/C;GACA,cAAc,WAAW,aAAa,KAAK,MAAM,MAAM;GACvD;GACA,SAAS,QAAQ,IAAI;GACrB;EACJ,CAEY;EAAO;CAAS;AAChC"}
@@ -1,46 +1,26 @@
1
- import { type UseInfiniteQueryOptions, type QueryKey } from "@tanstack/react-query";
2
1
  import type { Workspace, WorkspaceListResponse } from "../../types/workspace.d.ts";
3
- type PageToken = string | null;
4
- type InfiniteOptions<TData> = Omit<UseInfiniteQueryOptions<WorkspaceListResponse, Error, TData, QueryKey, PageToken>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
5
- export type FetchInfiniteWorkspaceProps = {
6
- workspace?: string;
7
- pageSize?: number;
8
- queryOptions?: InfiniteOptions<Workspace[]>;
2
+ import type { FetchEntitiesProps, ListCache } from "../../types/entityQuery.d.ts";
3
+ /** The query cache of `useFetchWorkspaces`, for typing `setQueryData`. */
4
+ export type WorkspacesCache = ListCache<WorkspaceListResponse>;
5
+ export type FetchWorkspacesProps<TData = Workspace[]> = FetchEntitiesProps<Workspace, TData, WorkspaceListResponse> & {
6
+ /** A name prefix. */
7
+ search?: string;
9
8
  };
10
9
  /**
11
10
  * useFetchWorkspaces
12
11
  *
13
- * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
14
- * workspaces with cursor-based pagination.
12
+ * Lists workspaces with cursor pagination; `query.data` is every loaded page merged, or
13
+ * whatever `select` makes of it. `select` and `fetchAllPages` behave as in
14
+ * `useFetchDatastores`. This endpoint lists the account's workspaces: it takes a name `search`,
15
+ * and no workspace — the docs exempt it, and the endpoint ignores one, which this hook used to
16
+ * send.
15
17
  *
16
- * It also:
17
- * - flattens all pages into a single `Workspace[]` via `select`
18
- *
19
- * Important notes:
20
- * - `query.data` returns a flat `Workspace[]` (all pages merged).
21
- * - `workspace` is required by some API configurations to avoid being blocked.
22
- *
23
- * @param props - FetchInfiniteWorkspaceProps
24
- * - `workspace`: Current workspace name sent as a query param.
25
- * - `pageSize`: Number of workspaces to fetch per page.
26
- * - `queryOptions`: TanStack Query options passed through to `useInfiniteQuery`.
27
- *
28
- * Returns:
29
- * @returns {object}
30
- * - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
31
- * - `queryKey`: the cache key used by React Query
32
- *
33
- * Example:
34
- * ```ts
35
- * const { query } = useFetchWorkspaces({ workspace: "main", pageSize: 20 });
36
- *
37
- * // Flat list of all fetched workspaces
38
- * const workspaces = query.data ?? [];
39
- * ```
18
+ * @param {FetchWorkspacesProps} props - Search, page size, `select`, `fetchAllPages` and
19
+ * TanStack `queryOptions`.
20
+ * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.
40
21
  */
41
- export declare function useFetchWorkspaces({ workspace, pageSize, queryOptions }: FetchInfiniteWorkspaceProps): {
42
- query: import("@tanstack/react-query").UseInfiniteQueryResult<Workspace[], Error>;
43
- queryKey: readonly unknown[];
22
+ export declare function useFetchWorkspaces<TData = Workspace[]>({ search, pageSize, select, fetchAllPages, queryOptions, }: FetchWorkspacesProps<TData>): {
23
+ query: import("@tanstack/react-query").UseInfiniteQueryResult<TData, Error>;
24
+ queryKey: unknown[];
44
25
  };
45
- export {};
46
26
  //# sourceMappingURL=useFetchWorkspaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchWorkspaces.d.ts","sourceRoot":"","sources":["../../../src/hooks/workspace/useFetchWorkspaces.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,uBAAuB,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItG,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,KAAK,SAAS,GAAG,MAAM,GAAG,IAAI,CAAC;AAE/B,KAAK,eAAe,CAAC,KAAK,IAAI,IAAI,CAC9B,uBAAuB,CAAC,qBAAqB,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,EACjF,UAAU,GAAG,SAAS,GAAG,kBAAkB,GAAG,kBAAkB,CACnE,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC;CAC/C,CAAC;AAQF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,QAAa,EAAE,YAAY,EAAE,EAAE,2BAA2B;;;EA4BzG"}
1
+ {"version":3,"file":"useFetchWorkspaces.d.ts","sourceRoot":"","sources":["../../../src/hooks/workspace/useFetchWorkspaces.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEzE,0EAA0E;AAC1E,MAAM,MAAM,eAAe,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC;AAE/D,MAAM,MAAM,oBAAoB,CAAC,KAAK,GAAG,SAAS,EAAE,IAAI,kBAAkB,CACtE,SAAS,EACT,KAAK,EACL,qBAAqB,CACxB,GAAG;IACA,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,GAAG,SAAS,EAAE,EAAE,EACpD,MAAM,EACN,QAAa,EACb,MAAM,EACN,aAAqB,EACrB,YAAY,GACf,EAAE,oBAAoB,CAAC,KAAK,CAAC;;;EAgB7B"}
@@ -1,61 +1,39 @@
1
1
  import { useAxios } from "../useAxios.js";
2
+ import { useEntityInfiniteQuery } from "../useEntityInfiniteQuery.js";
3
+ import { buildQueryKey } from "../../api/entityQuery.js";
2
4
  import { listWorkspaces } from "../../api/workspace.js";
3
- import { useMemo } from "react";
4
- import { useInfiniteQuery } from "@tanstack/react-query";
5
5
  //#region src/hooks/workspace/useFetchWorkspaces.ts
6
- var defaultQueryOptions = {
7
- refetchOnMount: "always",
8
- staleTime: 0,
9
- gcTime: 0
10
- };
11
6
  /**
12
7
  * useFetchWorkspaces
13
8
  *
14
- * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
15
- * workspaces with cursor-based pagination.
9
+ * Lists workspaces with cursor pagination; `query.data` is every loaded page merged, or
10
+ * whatever `select` makes of it. `select` and `fetchAllPages` behave as in
11
+ * `useFetchDatastores`. This endpoint lists the account's workspaces: it takes a name `search`,
12
+ * and no workspace — the docs exempt it, and the endpoint ignores one, which this hook used to
13
+ * send.
16
14
  *
17
- * It also:
18
- * - flattens all pages into a single `Workspace[]` via `select`
19
- *
20
- * Important notes:
21
- * - `query.data` returns a flat `Workspace[]` (all pages merged).
22
- * - `workspace` is required by some API configurations to avoid being blocked.
23
- *
24
- * @param props - FetchInfiniteWorkspaceProps
25
- * - `workspace`: Current workspace name sent as a query param.
26
- * - `pageSize`: Number of workspaces to fetch per page.
27
- * - `queryOptions`: TanStack Query options passed through to `useInfiniteQuery`.
28
- *
29
- * Returns:
30
- * @returns {object}
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 } = useFetchWorkspaces({ workspace: "main", pageSize: 20 });
37
- *
38
- * // Flat list of all fetched workspaces
39
- * const workspaces = query.data ?? [];
40
- * ```
15
+ * @param {FetchWorkspacesProps} props - Search, page size, `select`, `fetchAllPages` and
16
+ * TanStack `queryOptions`.
17
+ * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.
41
18
  */
42
- function useFetchWorkspaces({ workspace, pageSize = 10, queryOptions }) {
19
+ function useFetchWorkspaces({ search, pageSize = 10, select, fetchAllPages = false, queryOptions }) {
43
20
  const { api } = useAxios();
44
- const queryKey = ["workspaces", workspace ?? null];
45
- const mergedQueryOptions = useMemo(() => ({
46
- ...defaultQueryOptions,
47
- ...queryOptions ?? {}
48
- }), [queryOptions]);
21
+ const queryKey = buildQueryKey(["workspaces", search ?? null], [], {
22
+ pageSize,
23
+ fetchAllPages
24
+ });
49
25
  return {
50
- query: useInfiniteQuery({
26
+ query: useEntityInfiniteQuery({
51
27
  queryKey,
52
- initialPageParam: null,
53
- getNextPageParam: (lastPage) => lastPage.next_page_token ?? void 0,
54
- queryFn: async ({ pageParam }) => {
55
- return await listWorkspaces(api, workspace, pageSize, pageParam ?? void 0);
56
- },
57
- select: (data) => data.pages.flatMap((p) => p.workspaces),
58
- ...mergedQueryOptions
28
+ itemsKey: "workspaces",
29
+ fetchPage: (pageToken, signal) => listWorkspaces(api, {
30
+ search,
31
+ pageSize,
32
+ pageToken: pageToken ?? void 0
33
+ }, signal),
34
+ select,
35
+ fetchAllPages,
36
+ queryOptions
59
37
  }),
60
38
  queryKey
61
39
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useFetchWorkspaces.js","names":[],"sources":["../../../src/hooks/workspace/useFetchWorkspaces.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useInfiniteQuery, type UseInfiniteQueryOptions, type QueryKey } from \"@tanstack/react-query\";\n\nimport { useAxios } from \"@/hooks/useAxios\";\nimport { listWorkspaces } from \"@/api/workspace\";\nimport type { Workspace, WorkspaceListResponse } from \"@/types/workspace\";\n\ntype PageToken = string | null;\n\ntype InfiniteOptions<TData> = Omit<\n UseInfiniteQueryOptions<WorkspaceListResponse, Error, TData, QueryKey, PageToken>,\n \"queryKey\" | \"queryFn\" | \"initialPageParam\" | \"getNextPageParam\"\n>;\n\nexport type FetchInfiniteWorkspaceProps = {\n workspace?: string;\n pageSize?: number;\n queryOptions?: InfiniteOptions<Workspace[]>;\n};\n\nconst defaultQueryOptions: InfiniteOptions<Workspace[]> = {\n refetchOnMount: \"always\",\n staleTime: 0,\n gcTime: 0,\n};\n\n/**\n * useFetchWorkspaces\n *\n * Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve\n * workspaces with cursor-based pagination.\n *\n * It also:\n * - flattens all pages into a single `Workspace[]` via `select`\n *\n * Important notes:\n * - `query.data` returns a flat `Workspace[]` (all pages merged).\n * - `workspace` is required by some API configurations to avoid being blocked.\n *\n * @param props - FetchInfiniteWorkspaceProps\n * - `workspace`: Current workspace name sent as a query param.\n * - `pageSize`: Number of workspaces to fetch per page.\n * - `queryOptions`: TanStack Query options passed through to `useInfiniteQuery`.\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 *\n * Example:\n * ```ts\n * const { query } = useFetchWorkspaces({ workspace: \"main\", pageSize: 20 });\n *\n * // Flat list of all fetched workspaces\n * const workspaces = query.data ?? [];\n * ```\n */\nexport function useFetchWorkspaces({ workspace, pageSize = 10, queryOptions }: FetchInfiniteWorkspaceProps) {\n const { api } = useAxios();\n\n const queryKey: QueryKey = [\"workspaces\", workspace ?? null];\n\n const mergedQueryOptions = useMemo<InfiniteOptions<Workspace[]>>(() => ({\n ...defaultQueryOptions,\n ...(queryOptions ?? {}),\n }), [queryOptions]);\n\n const query = useInfiniteQuery<WorkspaceListResponse, Error, Workspace[], QueryKey, PageToken>({\n queryKey,\n initialPageParam: null,\n getNextPageParam: (lastPage) => lastPage.next_page_token ?? undefined,\n\n queryFn: async ({ pageParam }) => {\n return await listWorkspaces(api, workspace, pageSize, pageParam ?? undefined);\n },\n\n select: (data) => data.pages.flatMap((p) => p.workspaces),\n\n ...mergedQueryOptions,\n });\n\n return {\n query,\n queryKey,\n };\n}\n"],"mappings":";;;;;AAoBA,IAAM,sBAAoD;CACtD,gBAAgB;CAChB,WAAW;CACX,QAAQ;AACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,mBAAmB,EAAE,WAAW,WAAW,IAAI,gBAA6C;CACxG,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,WAAqB,CAAC,cAAc,aAAa,IAAI;CAE3D,MAAM,qBAAqB,eAA6C;EACpE,GAAG;EACH,GAAI,gBAAgB,CAAC;CACzB,IAAI,CAAC,YAAY,CAAC;CAgBlB,OAAO;EACH,OAfU,iBAAiF;GAC3F;GACA,kBAAkB;GAClB,mBAAmB,aAAa,SAAS,mBAAmB,KAAA;GAE5D,SAAS,OAAO,EAAE,gBAAgB;IAC9B,OAAO,MAAM,eAAe,KAAK,WAAW,UAAU,aAAa,KAAA,CAAS;GAChF;GAEA,SAAS,SAAS,KAAK,MAAM,SAAS,MAAM,EAAE,UAAU;GAExD,GAAG;EACP,CAGI;EACA;CACJ;AACJ"}
1
+ {"version":3,"file":"useFetchWorkspaces.js","names":[],"sources":["../../../src/hooks/workspace/useFetchWorkspaces.ts"],"sourcesContent":["import { useAxios } from \"@/hooks/useAxios\";\nimport { useEntityInfiniteQuery } from \"@/hooks/useEntityInfiniteQuery\";\nimport { listWorkspaces } from \"@/api/workspace\";\nimport { buildQueryKey } from \"@/api/entityQuery\";\nimport type { Workspace, WorkspaceListResponse } from \"@/types/workspace\";\nimport type { FetchEntitiesProps, ListCache } from \"@/types/entityQuery\";\n\n/** The query cache of `useFetchWorkspaces`, for typing `setQueryData`. */\nexport type WorkspacesCache = ListCache<WorkspaceListResponse>;\n\nexport type FetchWorkspacesProps<TData = Workspace[]> = FetchEntitiesProps<\n Workspace,\n TData,\n WorkspaceListResponse\n> & {\n /** A name prefix. */\n search?: string;\n};\n\n/**\n * useFetchWorkspaces\n *\n * Lists workspaces with cursor pagination; `query.data` is every loaded page merged, or\n * whatever `select` makes of it. `select` and `fetchAllPages` behave as in\n * `useFetchDatastores`. This endpoint lists the account's workspaces: it takes a name `search`,\n * and no workspace — the docs exempt it, and the endpoint ignores one, which this hook used to\n * send.\n *\n * @param {FetchWorkspacesProps} props - Search, page size, `select`, `fetchAllPages` and\n * TanStack `queryOptions`.\n * @returns {object} `query` (the `useInfiniteQuery` result) and `queryKey`.\n */\nexport function useFetchWorkspaces<TData = Workspace[]>({\n search,\n pageSize = 10,\n select,\n fetchAllPages = false,\n queryOptions,\n}: FetchWorkspacesProps<TData>) {\n const { api } = useAxios();\n\n const queryKey = buildQueryKey([\"workspaces\", search ?? null], [], { pageSize, fetchAllPages });\n\n const query = useEntityInfiniteQuery<WorkspaceListResponse, \"workspaces\", TData>({\n queryKey,\n itemsKey: \"workspaces\",\n fetchPage: (pageToken, signal) =>\n listWorkspaces(api, { search, pageSize, pageToken: pageToken ?? undefined }, signal),\n select,\n fetchAllPages,\n queryOptions,\n });\n\n return { query, queryKey };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,SAAgB,mBAAwC,EACpD,QACA,WAAW,IACX,QACA,gBAAgB,OAChB,gBAC4B;CAC5B,MAAM,EAAE,QAAQ,SAAS;CAEzB,MAAM,WAAW,cAAc,CAAC,cAAc,UAAU,IAAI,GAAG,CAAC,GAAG;EAAE;EAAU;CAAc,CAAC;CAY9F,OAAO;EAAE,OAVK,uBAAmE;GAC7E;GACA,UAAU;GACV,YAAY,WAAW,WACnB,eAAe,KAAK;IAAE;IAAQ;IAAU,WAAW,aAAa,KAAA;GAAU,GAAG,MAAM;GACvF;GACA;GACA;EACJ,CAES;EAAO;CAAS;AAC7B"}
package/dist/index.d.ts CHANGED
@@ -1,18 +1,21 @@
1
- export { EveryskApp } from "./EveryskApp";
2
- export type { EveryskAppProps, ProviderComponent } from "./EveryskApp";
3
- export { AppConfigContext } from "./contexts/appConfigContext";
4
- export { AppConfigProvider } from "./contexts/appConfigContext/provider";
1
+ export { EveryskApp, withProps } from "./EveryskApp";
2
+ export type { ConfiguredProvider, EveryskAppProps, ProviderComponent, ProviderEntry, } from "./EveryskApp";
5
3
  export { useAppConfig } from "./contexts/appConfigContext/useAppConfig";
6
- export type { AppConfigContextType, AppConfigProviderProps, } from "./contexts/appConfigContext/types";
7
- export { AppAlertContext } from "./contexts/appAlertContext";
8
- export { AppAlertProvider } from "./contexts/appAlertContext/provider";
4
+ export type { AppConfigContextType } from "./contexts/appConfigContext/types";
9
5
  export { useAppAlert } from "./contexts/appAlertContext/useAppAlert";
10
6
  export type { AppAlertContextType, AppAlertState, ShowAlertOptions, } from "./contexts/appAlertContext/types";
11
7
  export { useAxios } from "./hooks/useAxios";
12
- export { toFilterTuple, buildQueryObject, buildQueryKey } from "./api/entityQuery";
13
- export { createQueryClient, getQueryFn } from "./lib/queryClient";
8
+ export { useEntityQuery } from "./hooks/useEntityQuery";
9
+ export type { EntityQueryProps } from "./hooks/useEntityQuery";
10
+ export { useEntityMutation } from "./hooks/useEntityMutation";
11
+ export type { EntityMutationProps } from "./hooks/useEntityMutation";
12
+ export { useEntityInfiniteQuery, FETCH_ALL_PAGES_LIMIT } from "./hooks/useEntityInfiniteQuery";
13
+ export type { EntityInfiniteQueryProps, ItemOf } from "./hooks/useEntityInfiniteQuery";
14
+ export { buildQueryObject, buildQueryKey, hasWorkspaceFilter, missingWorkspaceError, } from "./api/entityQuery";
15
+ export type { QueryKeyParams } from "./api/entityQuery";
16
+ export { createQueryClient } from "./lib/queryClient";
14
17
  export type { AnyRecord } from "./types/anyRecord";
15
- export type { BaseQueryParams, DeleteEntityDefaultResponse, DeleteEntityResponse, EntityDefaultResponse, EntityListResponse, EntityQueryOptions, EntityQueryParams, EntitySingleResponse, FetchEntitiesParams, FetchEntityParams, FilterClause, FilterExpression, FilterOperator, QueryObject, } from "./types/entityQuery";
18
+ export type { DeletedEntity, DeleteEntityResponse, EntityInfiniteQueryOptions, EntityListResponse, EntityQueryOptions, EntityQueryParams, EntitySingleResponse, FetchEntitiesProps, FetchEntityByIdProps, FetchEntityProps, FilterClause, FilterExpression, FilterOperator, ListCache, ListQueryProps, PagedResponse, PageToken, QueryObject, } from "./types/entityQuery";
16
19
  export * from "./portfolio";
17
20
  export * from "./datastore";
18
21
  export * from "./file";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,YAAY,EACR,oBAAoB,EACpB,sBAAsB,GACzB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,YAAY,EACR,mBAAmB,EACnB,aAAa,EACb,gBAAgB,GACnB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGnF,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGlE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EACR,eAAe,EACf,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,WAAW,GACd,MAAM,qBAAqB,CAAC;AAI7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EACR,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,GAChB,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,YAAY,EACR,mBAAmB,EACnB,aAAa,EACb,gBAAgB,GACnB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC/F,YAAY,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAGvF,OAAO,EACH,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EACR,aAAa,EACb,oBAAoB,EACpB,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,cAAc,EACd,aAAa,EACb,SAAS,EACT,WAAW,GACd,MAAM,qBAAqB,CAAC;AAI7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { components } from "./theme/overrides/index.js";
1
+ import { componentOverrides } from "./theme/overrides/index.js";
2
2
  import { DefaultLightTheme } from "./theme/themes/DefaultLight.js";
3
3
  import { DefaultDarkTheme } from "./theme/themes/DefaultDark.js";
4
4
  import { EveryskLightTheme } from "./theme/themes/EveryskLight.js";
@@ -6,39 +6,41 @@ import { EveryskDarkTheme } from "./theme/themes/EveryskDark.js";
6
6
  import { MidnightEmberTheme } from "./theme/themes/MidnightEmber.js";
7
7
  import { getBrandTheme, getDefaultTheme, getTheme } from "./theme/themes/index.js";
8
8
  import { ThemeProvider } from "./theme/ThemeProvider.js";
9
- import { AppConfigContext } from "./contexts/appConfigContext/index.js";
10
- import { AppConfigProvider } from "./contexts/appConfigContext/provider.js";
11
- import { AppAlertContext } from "./contexts/appAlertContext/index.js";
12
- import { AppAlertProvider } from "./contexts/appAlertContext/provider.js";
13
- import { createQueryClient, getQueryFn } from "./lib/queryClient.js";
14
- import { EveryskApp } from "./EveryskApp.js";
9
+ import { createQueryClient } from "./lib/queryClient.js";
10
+ import { EveryskApp, withProps } from "./EveryskApp.js";
15
11
  import { useAppConfig } from "./contexts/appConfigContext/useAppConfig.js";
16
12
  import { useAppAlert } from "./contexts/appAlertContext/useAppAlert.js";
17
13
  import { useAxios } from "./hooks/useAxios.js";
18
- import { buildQueryKey, buildQueryObject, toFilterTuple } from "./api/entityQuery.js";
14
+ import { FETCH_ALL_PAGES_LIMIT, useEntityInfiniteQuery } from "./hooks/useEntityInfiniteQuery.js";
15
+ import { useEntityQuery } from "./hooks/useEntityQuery.js";
16
+ import { useEntityMutation } from "./hooks/useEntityMutation.js";
17
+ import { buildQueryKey, buildQueryObject, hasWorkspaceFilter, missingWorkspaceError } from "./api/entityQuery.js";
19
18
  import { createPortfolio, deletePortfolio, getPortfolio, listPortfolios, updatePortfolio } from "./api/portfolio.js";
20
19
  import { useFetchPortfolio } from "./hooks/portfolio/useFetchPortfolio.js";
21
20
  import { useFetchPortfolios } from "./hooks/portfolio/useFetchPortfolios.js";
22
21
  import { usePortfolioMutations } from "./hooks/portfolio/usePortfolioMutations.js";
23
22
  import { createDatastore, deleteDatastore, getDatastore, listDatastores, updateDatastore } from "./api/datastore.js";
24
23
  import { useDatastoreMutations } from "./hooks/datastore/useDatastoreMutations.js";
25
- import { buildDatastoreProps, mergeDatastores, objectsToTable, tableToObjects } from "./lib/datastoreTable.js";
24
+ import { isTableDatastore, matrixToObjects, objectsToMatrix, parseDatastore, toDatastoreMatrix } from "./lib/datastoreTable.js";
26
25
  import { useFetchDatastore } from "./hooks/datastore/useFetchDatastore.js";
27
26
  import { useFetchDatastores } from "./hooks/datastore/useFetchDatastores.js";
28
27
  import { createFile, deleteFile, getFile, listFiles, updateFile } from "./api/file.js";
29
28
  import { useFetchFile } from "./hooks/file/useFetchFile.js";
30
29
  import { useFetchFiles } from "./hooks/file/useFetchFiles.js";
31
30
  import { useFileMutations } from "./hooks/file/useFileMutations.js";
31
+ import { base64ToBlob, fileToBase64 } from "./lib/file.js";
32
32
  import { DEV_PROFILE, getProfile } from "./api/profile.js";
33
33
  import { useFetchProfile } from "./hooks/profile/useFetchProfile.js";
34
- import { TERMINAL_RUN_STATUSES, getWorkerExecution, getWorkflow, getWorkflowExecution, listWorkerExecutions, listWorkflowExecutions, listWorkflows, pollWorkflowExecution, runWorkflow, runWorkflowAndGetResult } from "./api/workflow.js";
34
+ import { TERMINAL_RUN_STATUSES, getWorkerExecution, getWorkflow, getWorkflowExecution, isTerminalRunStatus, listWorkerExecutions, listWorkflowExecutions, listWorkflows, runWorkflow, terminalRunStatusOf } from "./api/workflow.js";
35
35
  import { useFetchWorkerExecution } from "./hooks/workflow/useFetchWorkerExecution.js";
36
36
  import { useFetchWorkerExecutions } from "./hooks/workflow/useFetchWorkerExecutions.js";
37
37
  import { useFetchWorkflow } from "./hooks/workflow/useFetchWorkflow.js";
38
38
  import { useFetchWorkflowExecution } from "./hooks/workflow/useFetchWorkflowExecution.js";
39
39
  import { useFetchWorkflowExecutions } from "./hooks/workflow/useFetchWorkflowExecutions.js";
40
40
  import { useFetchWorkflows } from "./hooks/workflow/useFetchWorkflows.js";
41
+ import { WorkflowRunAbortedError } from "./lib/workflowRun.js";
41
42
  import { useRunWorkflow } from "./hooks/workflow/useRunWorkflow.js";
43
+ import { useTriggerWorkflow } from "./hooks/workflow/useTriggerWorkflow.js";
42
44
  import { getWorkspace, listWorkspaces } from "./api/workspace.js";
43
45
  import { useFetchWorkspace } from "./hooks/workspace/useFetchWorkspace.js";
44
46
  import { useFetchWorkspaces } from "./hooks/workspace/useFetchWorkspaces.js";
@@ -47,4 +49,4 @@ import { Footer } from "./components/ui/Footer/index.js";
47
49
  import { GlobalLoading } from "./components/ui/GlobalLoading/index.js";
48
50
  import { PageContainer } from "./components/ui/PageContainer/index.js";
49
51
  import { Toolbar } from "./components/ui/Toolbar/index.js";
50
- export { AppAlertContext, AppAlertProvider, AppConfigContext, AppConfigProvider, DEV_PROFILE, DefaultDarkTheme, DefaultLightTheme, EveryskApp, EveryskDarkTheme, EveryskIcon, EveryskLightTheme, Footer, GlobalLoading, MidnightEmberTheme, PageContainer, TERMINAL_RUN_STATUSES, ThemeProvider, Toolbar, buildDatastoreProps, buildQueryKey, buildQueryObject, components, createDatastore, createFile, createPortfolio, createQueryClient, deleteDatastore, deleteFile, deletePortfolio, getBrandTheme, getDatastore, getDefaultTheme, getFile, getPortfolio, getProfile, getQueryFn, getTheme, getWorkerExecution, getWorkflow, getWorkflowExecution, getWorkspace, listDatastores, listFiles, listPortfolios, listWorkerExecutions, listWorkflowExecutions, listWorkflows, listWorkspaces, mergeDatastores, objectsToTable, pollWorkflowExecution, runWorkflow, runWorkflowAndGetResult, tableToObjects, toFilterTuple, updateDatastore, updateFile, updatePortfolio, useAppAlert, useAppConfig, useAxios, useDatastoreMutations, useFetchDatastore, useFetchDatastores, useFetchFile, useFetchFiles, useFetchPortfolio, useFetchPortfolios, useFetchProfile, useFetchWorkerExecution, useFetchWorkerExecutions, useFetchWorkflow, useFetchWorkflowExecution, useFetchWorkflowExecutions, useFetchWorkflows, useFetchWorkspace, useFetchWorkspaces, useFileMutations, usePortfolioMutations, useRunWorkflow };
52
+ export { DEV_PROFILE, DefaultDarkTheme, DefaultLightTheme, EveryskApp, EveryskDarkTheme, EveryskIcon, EveryskLightTheme, FETCH_ALL_PAGES_LIMIT, Footer, GlobalLoading, MidnightEmberTheme, PageContainer, TERMINAL_RUN_STATUSES, ThemeProvider, Toolbar, WorkflowRunAbortedError, base64ToBlob, buildQueryKey, buildQueryObject, componentOverrides, createDatastore, createFile, createPortfolio, createQueryClient, deleteDatastore, deleteFile, deletePortfolio, fileToBase64, getBrandTheme, getDatastore, getDefaultTheme, getFile, getPortfolio, getProfile, getTheme, getWorkerExecution, getWorkflow, getWorkflowExecution, getWorkspace, hasWorkspaceFilter, isTableDatastore, isTerminalRunStatus, listDatastores, listFiles, listPortfolios, listWorkerExecutions, listWorkflowExecutions, listWorkflows, listWorkspaces, matrixToObjects, missingWorkspaceError, objectsToMatrix, parseDatastore, runWorkflow, terminalRunStatusOf, toDatastoreMatrix, updateDatastore, updateFile, updatePortfolio, useAppAlert, useAppConfig, useAxios, useDatastoreMutations, useEntityInfiniteQuery, useEntityMutation, useEntityQuery, useFetchDatastore, useFetchDatastores, useFetchFile, useFetchFiles, useFetchPortfolio, useFetchPortfolios, useFetchProfile, useFetchWorkerExecution, useFetchWorkerExecutions, useFetchWorkflow, useFetchWorkflowExecution, useFetchWorkflowExecutions, useFetchWorkflows, useFetchWorkspace, useFetchWorkspaces, useFileMutations, usePortfolioMutations, useRunWorkflow, useTriggerWorkflow, withProps };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * abortable
3
+ *
4
+ * The one shape every abortable wait here takes: a promise that `start` settles, or that rejects
5
+ * with the signal's reason as soon as it aborts. `start` returns its cleanup, which runs either
6
+ * way, so a timer or a listener never outlives the promise.
7
+ *
8
+ * @param signal - Aborts the wait.
9
+ * @param start - Begins the work and returns what undoes it.
10
+ * @returns The work's result, unless the signal aborts first.
11
+ */
12
+ export declare const abortable: <T>(signal: AbortSignal, start: (resolve: (value: T) => void, reject: (error: unknown) => void) => () => void) => Promise<T>;
13
+ /**
14
+ * Settles as `promise` does, or rejects with the signal's reason once it aborts first — for work
15
+ * that may not honour the signal itself.
16
+ */
17
+ export declare const unlessAborted: <T>(promise: Promise<T>, signal: AbortSignal) => Promise<T>;
18
+ /**
19
+ * createDeadline
20
+ *
21
+ * A signal that aborts after `timeoutMs`, or as soon as `signal` does, each with its own error.
22
+ * `dispose` stops the timer and the listener once the work is done.
23
+ *
24
+ * @param options - The timeout, the outer signal, and the error each abort carries. The errors
25
+ * are built when the abort happens, so they can describe the state at that moment.
26
+ * @returns The signal, and `dispose`.
27
+ */
28
+ export declare const createDeadline: ({ timeoutMs, signal, timeoutError, abortError, }: {
29
+ timeoutMs: number;
30
+ signal?: AbortSignal;
31
+ timeoutError: () => Error;
32
+ abortError: () => Error;
33
+ }) => {
34
+ signal: AbortSignal;
35
+ dispose(): void;
36
+ };
37
+ /**
38
+ * anySignal
39
+ *
40
+ * A signal that aborts as soon as any of `signals` does, with that one's reason. It is
41
+ * `AbortSignal.any`, written out because that arrived in Chrome 116, Firefox 124 and Safari 17.4,
42
+ * after the browsers a Vite 8 app targets by default (Chrome 111, Firefox 114, Safari 16.4).
43
+ * What it uses instead — `abort(reason)`, `signal.reason` and `addEventListener`'s `once` —
44
+ * predates them all. Source: MDN browser-compat-data, `api/AbortSignal.json` and
45
+ * `api/AbortController.json` (2026-10-14).
46
+ *
47
+ * Missing signals are skipped, so an optional one can be passed as is. It stops listening to the
48
+ * others once one aborts, or when `dispose` is called: a run that ends normally aborts nothing,
49
+ * and a long-lived signal would otherwise keep one listener per run.
50
+ *
51
+ * @param signals - The signals to follow; `undefined` entries are ignored.
52
+ * @returns The signal that aborts with the first of them, and `dispose`.
53
+ */
54
+ export declare const anySignal: (signals: (AbortSignal | undefined)[]) => {
55
+ signal: AbortSignal;
56
+ dispose: () => void;
57
+ };
58
+ //# sourceMappingURL=abort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abort.d.ts","sourceRoot":"","sources":["../../src/lib/abort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EACvB,QAAQ,WAAW,EACnB,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI,KACrF,OAAO,CAAC,CAAC,CAyBN,CAAC;AAEP;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,WAAW,KAAG,OAAO,CAAC,CAAC,CAI/E,CAAC;AAEP;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,GAAI,kDAK5B;IACC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,MAAM,KAAK,CAAC;IAC1B,UAAU,EAAE,MAAM,KAAK,CAAC;CAC3B;;;CAeA,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS,GAClB,SAAS,CAAC,WAAW,GAAG,SAAS,CAAC,EAAE,KACrC;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAuB5C,CAAC"}
@@ -0,0 +1,112 @@
1
+ //#region src/lib/abort.ts
2
+ /**
3
+ * abortable
4
+ *
5
+ * The one shape every abortable wait here takes: a promise that `start` settles, or that rejects
6
+ * with the signal's reason as soon as it aborts. `start` returns its cleanup, which runs either
7
+ * way, so a timer or a listener never outlives the promise.
8
+ *
9
+ * @param signal - Aborts the wait.
10
+ * @param start - Begins the work and returns what undoes it.
11
+ * @returns The work's result, unless the signal aborts first.
12
+ */
13
+ var abortable = (signal, start) => new Promise((resolve, reject) => {
14
+ if (signal.aborted) return reject(signal.reason);
15
+ let cleanup = () => {};
16
+ const finish = () => {
17
+ cleanup();
18
+ signal.removeEventListener("abort", onAbort);
19
+ };
20
+ const onAbort = () => {
21
+ finish();
22
+ reject(signal.reason);
23
+ };
24
+ signal.addEventListener("abort", onAbort, { once: true });
25
+ cleanup = start((value) => {
26
+ finish();
27
+ resolve(value);
28
+ }, (error) => {
29
+ finish();
30
+ reject(error);
31
+ });
32
+ });
33
+ /**
34
+ * Settles as `promise` does, or rejects with the signal's reason once it aborts first — for work
35
+ * that may not honour the signal itself.
36
+ */
37
+ var unlessAborted = (promise, signal) => abortable(signal, (resolve, reject) => {
38
+ promise.then(resolve, reject);
39
+ return () => {};
40
+ });
41
+ /**
42
+ * createDeadline
43
+ *
44
+ * A signal that aborts after `timeoutMs`, or as soon as `signal` does, each with its own error.
45
+ * `dispose` stops the timer and the listener once the work is done.
46
+ *
47
+ * @param options - The timeout, the outer signal, and the error each abort carries. The errors
48
+ * are built when the abort happens, so they can describe the state at that moment.
49
+ * @returns The signal, and `dispose`.
50
+ */
51
+ var createDeadline = ({ timeoutMs, signal, timeoutError, abortError }) => {
52
+ const controller = new AbortController();
53
+ const timer = setTimeout(() => controller.abort(timeoutError()), timeoutMs);
54
+ const abort = () => controller.abort(abortError());
55
+ if (signal?.aborted) abort();
56
+ else signal?.addEventListener("abort", abort, { once: true });
57
+ return {
58
+ signal: controller.signal,
59
+ dispose() {
60
+ clearTimeout(timer);
61
+ signal?.removeEventListener("abort", abort);
62
+ }
63
+ };
64
+ };
65
+ /**
66
+ * anySignal
67
+ *
68
+ * A signal that aborts as soon as any of `signals` does, with that one's reason. It is
69
+ * `AbortSignal.any`, written out because that arrived in Chrome 116, Firefox 124 and Safari 17.4,
70
+ * after the browsers a Vite 8 app targets by default (Chrome 111, Firefox 114, Safari 16.4).
71
+ * What it uses instead — `abort(reason)`, `signal.reason` and `addEventListener`'s `once` —
72
+ * predates them all. Source: MDN browser-compat-data, `api/AbortSignal.json` and
73
+ * `api/AbortController.json` (2026-10-14).
74
+ *
75
+ * Missing signals are skipped, so an optional one can be passed as is. It stops listening to the
76
+ * others once one aborts, or when `dispose` is called: a run that ends normally aborts nothing,
77
+ * and a long-lived signal would otherwise keep one listener per run.
78
+ *
79
+ * @param signals - The signals to follow; `undefined` entries are ignored.
80
+ * @returns The signal that aborts with the first of them, and `dispose`.
81
+ */
82
+ var anySignal = (signals) => {
83
+ const controller = new AbortController();
84
+ const present = signals.filter((signal) => signal !== void 0);
85
+ const already = present.find((signal) => signal.aborted);
86
+ if (already) {
87
+ controller.abort(already.reason);
88
+ return {
89
+ signal: controller.signal,
90
+ dispose: () => {}
91
+ };
92
+ }
93
+ const dispose = () => {
94
+ for (const [signal, listener] of listeners) signal.removeEventListener("abort", listener);
95
+ };
96
+ const listeners = present.map((signal) => {
97
+ const listener = () => {
98
+ dispose();
99
+ controller.abort(signal.reason);
100
+ };
101
+ signal.addEventListener("abort", listener, { once: true });
102
+ return [signal, listener];
103
+ });
104
+ return {
105
+ signal: controller.signal,
106
+ dispose
107
+ };
108
+ };
109
+ //#endregion
110
+ export { abortable, anySignal, createDeadline, unlessAborted };
111
+
112
+ //# sourceMappingURL=abort.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abort.js","names":[],"sources":["../../src/lib/abort.ts"],"sourcesContent":["/**\n * abortable\n *\n * The one shape every abortable wait here takes: a promise that `start` settles, or that rejects\n * with the signal's reason as soon as it aborts. `start` returns its cleanup, which runs either\n * way, so a timer or a listener never outlives the promise.\n *\n * @param signal - Aborts the wait.\n * @param start - Begins the work and returns what undoes it.\n * @returns The work's result, unless the signal aborts first.\n */\nexport const abortable = <T>(\n signal: AbortSignal,\n start: (resolve: (value: T) => void, reject: (error: unknown) => void) => () => void,\n): Promise<T> =>\n new Promise<T>((resolve, reject) => {\n if (signal.aborted) return reject(signal.reason);\n\n let cleanup = () => {};\n const finish = () => {\n cleanup();\n signal.removeEventListener(\"abort\", onAbort);\n };\n const onAbort = () => {\n finish();\n reject(signal.reason);\n };\n\n signal.addEventListener(\"abort\", onAbort, { once: true });\n cleanup = start(\n (value) => {\n finish();\n resolve(value);\n },\n (error) => {\n finish();\n reject(error);\n },\n );\n });\n\n/**\n * Settles as `promise` does, or rejects with the signal's reason once it aborts first — for work\n * that may not honour the signal itself.\n */\nexport const unlessAborted = <T>(promise: Promise<T>, signal: AbortSignal): Promise<T> =>\n abortable(signal, (resolve, reject) => {\n promise.then(resolve, reject);\n return () => {};\n });\n\n/**\n * createDeadline\n *\n * A signal that aborts after `timeoutMs`, or as soon as `signal` does, each with its own error.\n * `dispose` stops the timer and the listener once the work is done.\n *\n * @param options - The timeout, the outer signal, and the error each abort carries. The errors\n * are built when the abort happens, so they can describe the state at that moment.\n * @returns The signal, and `dispose`.\n */\nexport const createDeadline = ({\n timeoutMs,\n signal,\n timeoutError,\n abortError,\n}: {\n timeoutMs: number;\n signal?: AbortSignal;\n timeoutError: () => Error;\n abortError: () => Error;\n}) => {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(timeoutError()), timeoutMs);\n const abort = () => controller.abort(abortError());\n\n if (signal?.aborted) abort();\n else signal?.addEventListener(\"abort\", abort, { once: true });\n\n return {\n signal: controller.signal,\n dispose() {\n clearTimeout(timer);\n signal?.removeEventListener(\"abort\", abort);\n },\n };\n};\n\n/**\n * anySignal\n *\n * A signal that aborts as soon as any of `signals` does, with that one's reason. It is\n * `AbortSignal.any`, written out because that arrived in Chrome 116, Firefox 124 and Safari 17.4,\n * after the browsers a Vite 8 app targets by default (Chrome 111, Firefox 114, Safari 16.4).\n * What it uses instead — `abort(reason)`, `signal.reason` and `addEventListener`'s `once` —\n * predates them all. Source: MDN browser-compat-data, `api/AbortSignal.json` and\n * `api/AbortController.json` (2026-10-14).\n *\n * Missing signals are skipped, so an optional one can be passed as is. It stops listening to the\n * others once one aborts, or when `dispose` is called: a run that ends normally aborts nothing,\n * and a long-lived signal would otherwise keep one listener per run.\n *\n * @param signals - The signals to follow; `undefined` entries are ignored.\n * @returns The signal that aborts with the first of them, and `dispose`.\n */\nexport const anySignal = (\n signals: (AbortSignal | undefined)[],\n): { signal: AbortSignal; dispose: () => void } => {\n const controller = new AbortController();\n const present = signals.filter((signal): signal is AbortSignal => signal !== undefined);\n\n const already = present.find((signal) => signal.aborted);\n if (already) {\n controller.abort(already.reason);\n return { signal: controller.signal, dispose: () => {} };\n }\n\n const dispose = () => {\n for (const [signal, listener] of listeners) signal.removeEventListener(\"abort\", listener);\n };\n const listeners = present.map((signal) => {\n const listener = () => {\n dispose();\n controller.abort(signal.reason);\n };\n signal.addEventListener(\"abort\", listener, { once: true });\n return [signal, listener] as const;\n });\n\n return { signal: controller.signal, dispose };\n};\n"],"mappings":";;;;;;;;;;;;AAWA,IAAa,aACT,QACA,UAEA,IAAI,SAAY,SAAS,WAAW;CAChC,IAAI,OAAO,SAAS,OAAO,OAAO,OAAO,MAAM;CAE/C,IAAI,gBAAgB,CAAC;CACrB,MAAM,eAAe;EACjB,QAAQ;EACR,OAAO,oBAAoB,SAAS,OAAO;CAC/C;CACA,MAAM,gBAAgB;EAClB,OAAO;EACP,OAAO,OAAO,MAAM;CACxB;CAEA,OAAO,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;CACxD,UAAU,OACL,UAAU;EACP,OAAO;EACP,QAAQ,KAAK;CACjB,IACC,UAAU;EACP,OAAO;EACP,OAAO,KAAK;CAChB,CACJ;AACJ,CAAC;;;;;AAML,IAAa,iBAAoB,SAAqB,WAClD,UAAU,SAAS,SAAS,WAAW;CACnC,QAAQ,KAAK,SAAS,MAAM;CAC5B,aAAa,CAAC;AAClB,CAAC;;;;;;;;;;;AAYL,IAAa,kBAAkB,EAC3B,WACA,QACA,cACA,iBAME;CACF,MAAM,aAAa,IAAI,gBAAgB;CACvC,MAAM,QAAQ,iBAAiB,WAAW,MAAM,aAAa,CAAC,GAAG,SAAS;CAC1E,MAAM,cAAc,WAAW,MAAM,WAAW,CAAC;CAEjD,IAAI,QAAQ,SAAS,MAAM;MACtB,QAAQ,iBAAiB,SAAS,OAAO,EAAE,MAAM,KAAK,CAAC;CAE5D,OAAO;EACH,QAAQ,WAAW;EACnB,UAAU;GACN,aAAa,KAAK;GAClB,QAAQ,oBAAoB,SAAS,KAAK;EAC9C;CACJ;AACJ;;;;;;;;;;;;;;;;;;AAmBA,IAAa,aACT,YAC+C;CAC/C,MAAM,aAAa,IAAI,gBAAgB;CACvC,MAAM,UAAU,QAAQ,QAAQ,WAAkC,WAAW,KAAA,CAAS;CAEtF,MAAM,UAAU,QAAQ,MAAM,WAAW,OAAO,OAAO;CACvD,IAAI,SAAS;EACT,WAAW,MAAM,QAAQ,MAAM;EAC/B,OAAO;GAAE,QAAQ,WAAW;GAAQ,eAAe,CAAC;EAAE;CAC1D;CAEA,MAAM,gBAAgB;EAClB,KAAK,MAAM,CAAC,QAAQ,aAAa,WAAW,OAAO,oBAAoB,SAAS,QAAQ;CAC5F;CACA,MAAM,YAAY,QAAQ,KAAK,WAAW;EACtC,MAAM,iBAAiB;GACnB,QAAQ;GACR,WAAW,MAAM,OAAO,MAAM;EAClC;EACA,OAAO,iBAAiB,SAAS,UAAU,EAAE,MAAM,KAAK,CAAC;EACzD,OAAO,CAAC,QAAQ,QAAQ;CAC5B,CAAC;CAED,OAAO;EAAE,QAAQ,WAAW;EAAQ;CAAQ;AAChD"}