@everysk/apps-sdk 0.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -0
  3. package/dist/EveryskApp.d.ts +73 -0
  4. package/dist/EveryskApp.d.ts.map +1 -0
  5. package/dist/EveryskApp.js +66 -0
  6. package/dist/EveryskApp.js.map +1 -0
  7. package/dist/agGrid/agGridTheme.d.ts +77 -0
  8. package/dist/agGrid/agGridTheme.d.ts.map +1 -0
  9. package/dist/agGrid/agGridTheme.js +88 -0
  10. package/dist/agGrid/agGridTheme.js.map +1 -0
  11. package/dist/agGrid/index.d.ts +4 -0
  12. package/dist/agGrid/index.d.ts.map +1 -0
  13. package/dist/agGrid/index.js +3 -0
  14. package/dist/api/datastore.d.ts +68 -0
  15. package/dist/api/datastore.d.ts.map +1 -0
  16. package/dist/api/datastore.js +125 -0
  17. package/dist/api/datastore.js.map +1 -0
  18. package/dist/api/entityQuery.d.ts +78 -0
  19. package/dist/api/entityQuery.d.ts.map +1 -0
  20. package/dist/api/entityQuery.js +100 -0
  21. package/dist/api/entityQuery.js.map +1 -0
  22. package/dist/api/file.d.ts +70 -0
  23. package/dist/api/file.d.ts.map +1 -0
  24. package/dist/api/file.js +126 -0
  25. package/dist/api/file.js.map +1 -0
  26. package/dist/api/portfolio.d.ts +67 -0
  27. package/dist/api/portfolio.d.ts.map +1 -0
  28. package/dist/api/portfolio.js +125 -0
  29. package/dist/api/portfolio.js.map +1 -0
  30. package/dist/api/profile.d.ts +40 -0
  31. package/dist/api/profile.d.ts.map +1 -0
  32. package/dist/api/profile.js +71 -0
  33. package/dist/api/profile.js.map +1 -0
  34. package/dist/api/websocketsConfig.d.ts +13 -0
  35. package/dist/api/websocketsConfig.d.ts.map +1 -0
  36. package/dist/api/websocketsConfig.js +25 -0
  37. package/dist/api/websocketsConfig.js.map +1 -0
  38. package/dist/api/workflow.d.ts +154 -0
  39. package/dist/api/workflow.d.ts.map +1 -0
  40. package/dist/api/workflow.js +289 -0
  41. package/dist/api/workflow.js.map +1 -0
  42. package/dist/api/workspace.d.ts +29 -0
  43. package/dist/api/workspace.d.ts.map +1 -0
  44. package/dist/api/workspace.js +54 -0
  45. package/dist/api/workspace.js.map +1 -0
  46. package/dist/components/ui/EveryskIcon/index.d.ts +5 -0
  47. package/dist/components/ui/EveryskIcon/index.d.ts.map +1 -0
  48. package/dist/components/ui/EveryskIcon/index.js +25 -0
  49. package/dist/components/ui/EveryskIcon/index.js.map +1 -0
  50. package/dist/components/ui/Footer/index.d.ts +5 -0
  51. package/dist/components/ui/Footer/index.d.ts.map +1 -0
  52. package/dist/components/ui/Footer/index.js +23 -0
  53. package/dist/components/ui/Footer/index.js.map +1 -0
  54. package/dist/components/ui/GlobalLoading/index.d.ts +8 -0
  55. package/dist/components/ui/GlobalLoading/index.d.ts.map +1 -0
  56. package/dist/components/ui/GlobalLoading/index.js +42 -0
  57. package/dist/components/ui/GlobalLoading/index.js.map +1 -0
  58. package/dist/components/ui/PageContainer/index.d.ts +7 -0
  59. package/dist/components/ui/PageContainer/index.d.ts.map +1 -0
  60. package/dist/components/ui/PageContainer/index.js +20 -0
  61. package/dist/components/ui/PageContainer/index.js.map +1 -0
  62. package/dist/components/ui/Toolbar/index.d.ts +5 -0
  63. package/dist/components/ui/Toolbar/index.d.ts.map +1 -0
  64. package/dist/components/ui/Toolbar/index.js +32 -0
  65. package/dist/components/ui/Toolbar/index.js.map +1 -0
  66. package/dist/contexts/agGridLicenseContext/provider.d.ts +51 -0
  67. package/dist/contexts/agGridLicenseContext/provider.d.ts.map +1 -0
  68. package/dist/contexts/agGridLicenseContext/provider.js +58 -0
  69. package/dist/contexts/agGridLicenseContext/provider.js.map +1 -0
  70. package/dist/contexts/appAlertContext/index.d.ts +3 -0
  71. package/dist/contexts/appAlertContext/index.d.ts.map +1 -0
  72. package/dist/contexts/appAlertContext/index.js +7 -0
  73. package/dist/contexts/appAlertContext/index.js.map +1 -0
  74. package/dist/contexts/appAlertContext/provider.d.ts +40 -0
  75. package/dist/contexts/appAlertContext/provider.d.ts.map +1 -0
  76. package/dist/contexts/appAlertContext/provider.js +96 -0
  77. package/dist/contexts/appAlertContext/provider.js.map +1 -0
  78. package/dist/contexts/appAlertContext/types.d.ts +15 -0
  79. package/dist/contexts/appAlertContext/types.d.ts.map +1 -0
  80. package/dist/contexts/appAlertContext/useAppAlert.d.ts +30 -0
  81. package/dist/contexts/appAlertContext/useAppAlert.d.ts.map +1 -0
  82. package/dist/contexts/appAlertContext/useAppAlert.js +40 -0
  83. package/dist/contexts/appAlertContext/useAppAlert.js.map +1 -0
  84. package/dist/contexts/appConfigContext/index.d.ts +3 -0
  85. package/dist/contexts/appConfigContext/index.d.ts.map +1 -0
  86. package/dist/contexts/appConfigContext/index.js +7 -0
  87. package/dist/contexts/appConfigContext/index.js.map +1 -0
  88. package/dist/contexts/appConfigContext/provider.d.ts +45 -0
  89. package/dist/contexts/appConfigContext/provider.d.ts.map +1 -0
  90. package/dist/contexts/appConfigContext/provider.js +63 -0
  91. package/dist/contexts/appConfigContext/provider.js.map +1 -0
  92. package/dist/contexts/appConfigContext/types.d.ts +28 -0
  93. package/dist/contexts/appConfigContext/types.d.ts.map +1 -0
  94. package/dist/contexts/appConfigContext/useAppConfig.d.ts +20 -0
  95. package/dist/contexts/appConfigContext/useAppConfig.d.ts.map +1 -0
  96. package/dist/contexts/appConfigContext/useAppConfig.js +30 -0
  97. package/dist/contexts/appConfigContext/useAppConfig.js.map +1 -0
  98. package/dist/contexts/webSocketContext/constants.d.ts +4 -0
  99. package/dist/contexts/webSocketContext/constants.d.ts.map +1 -0
  100. package/dist/contexts/webSocketContext/constants.js +8 -0
  101. package/dist/contexts/webSocketContext/constants.js.map +1 -0
  102. package/dist/contexts/webSocketContext/handler.d.ts +43 -0
  103. package/dist/contexts/webSocketContext/handler.d.ts.map +1 -0
  104. package/dist/contexts/webSocketContext/handler.js +87 -0
  105. package/dist/contexts/webSocketContext/handler.js.map +1 -0
  106. package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.d.ts +19 -0
  107. package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.d.ts.map +1 -0
  108. package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.js +31 -0
  109. package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.js.map +1 -0
  110. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.d.ts +11 -0
  111. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.d.ts.map +1 -0
  112. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js +21 -0
  113. package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js.map +1 -0
  114. package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.d.ts +30 -0
  115. package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.d.ts.map +1 -0
  116. package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.js +44 -0
  117. package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.js.map +1 -0
  118. package/dist/contexts/webSocketContext/index.d.ts +3 -0
  119. package/dist/contexts/webSocketContext/index.d.ts.map +1 -0
  120. package/dist/contexts/webSocketContext/index.js +7 -0
  121. package/dist/contexts/webSocketContext/index.js.map +1 -0
  122. package/dist/contexts/webSocketContext/provider.d.ts +39 -0
  123. package/dist/contexts/webSocketContext/provider.d.ts.map +1 -0
  124. package/dist/contexts/webSocketContext/provider.js +121 -0
  125. package/dist/contexts/webSocketContext/provider.js.map +1 -0
  126. package/dist/contexts/webSocketContext/types.d.ts +41 -0
  127. package/dist/contexts/webSocketContext/types.d.ts.map +1 -0
  128. package/dist/datastore/index.d.ts +7 -0
  129. package/dist/datastore/index.d.ts.map +1 -0
  130. package/dist/file/index.d.ts +6 -0
  131. package/dist/file/index.d.ts.map +1 -0
  132. package/dist/hooks/datastore/useDatastoreMutations.d.ts +151 -0
  133. package/dist/hooks/datastore/useDatastoreMutations.d.ts.map +1 -0
  134. package/dist/hooks/datastore/useDatastoreMutations.js +198 -0
  135. package/dist/hooks/datastore/useDatastoreMutations.js.map +1 -0
  136. package/dist/hooks/datastore/useFetchDatastore.d.ts +205 -0
  137. package/dist/hooks/datastore/useFetchDatastore.d.ts.map +1 -0
  138. package/dist/hooks/datastore/useFetchDatastore.js +85 -0
  139. package/dist/hooks/datastore/useFetchDatastore.js.map +1 -0
  140. package/dist/hooks/datastore/useFetchDatastores.d.ts +70 -0
  141. package/dist/hooks/datastore/useFetchDatastores.d.ts.map +1 -0
  142. package/dist/hooks/datastore/useFetchDatastores.js +105 -0
  143. package/dist/hooks/datastore/useFetchDatastores.js.map +1 -0
  144. package/dist/hooks/file/useFetchFile.d.ts +212 -0
  145. package/dist/hooks/file/useFetchFile.d.ts.map +1 -0
  146. package/dist/hooks/file/useFetchFile.js +87 -0
  147. package/dist/hooks/file/useFetchFile.js.map +1 -0
  148. package/dist/hooks/file/useFetchFiles.d.ts +60 -0
  149. package/dist/hooks/file/useFetchFiles.d.ts.map +1 -0
  150. package/dist/hooks/file/useFetchFiles.js +89 -0
  151. package/dist/hooks/file/useFetchFiles.js.map +1 -0
  152. package/dist/hooks/file/useFileMutations.d.ts +161 -0
  153. package/dist/hooks/file/useFileMutations.d.ts.map +1 -0
  154. package/dist/hooks/file/useFileMutations.js +208 -0
  155. package/dist/hooks/file/useFileMutations.js.map +1 -0
  156. package/dist/hooks/portfolio/useFetchPortfolio.d.ts +210 -0
  157. package/dist/hooks/portfolio/useFetchPortfolio.d.ts.map +1 -0
  158. package/dist/hooks/portfolio/useFetchPortfolio.js +85 -0
  159. package/dist/hooks/portfolio/useFetchPortfolio.js.map +1 -0
  160. package/dist/hooks/portfolio/useFetchPortfolios.d.ts +60 -0
  161. package/dist/hooks/portfolio/useFetchPortfolios.d.ts.map +1 -0
  162. package/dist/hooks/portfolio/useFetchPortfolios.js +89 -0
  163. package/dist/hooks/portfolio/useFetchPortfolios.js.map +1 -0
  164. package/dist/hooks/portfolio/usePortfolioMutations.d.ts +171 -0
  165. package/dist/hooks/portfolio/usePortfolioMutations.d.ts.map +1 -0
  166. package/dist/hooks/portfolio/usePortfolioMutations.js +218 -0
  167. package/dist/hooks/portfolio/usePortfolioMutations.js.map +1 -0
  168. package/dist/hooks/profile/useFetchProfile.d.ts +206 -0
  169. package/dist/hooks/profile/useFetchProfile.d.ts.map +1 -0
  170. package/dist/hooks/profile/useFetchProfile.js +70 -0
  171. package/dist/hooks/profile/useFetchProfile.js.map +1 -0
  172. package/dist/hooks/useAxios.d.ts +40 -0
  173. package/dist/hooks/useAxios.d.ts.map +1 -0
  174. package/dist/hooks/useAxios.js +76 -0
  175. package/dist/hooks/useAxios.js.map +1 -0
  176. package/dist/hooks/workflow/useFetchWorkerExecution.d.ts +198 -0
  177. package/dist/hooks/workflow/useFetchWorkerExecution.d.ts.map +1 -0
  178. package/dist/hooks/workflow/useFetchWorkerExecution.js +69 -0
  179. package/dist/hooks/workflow/useFetchWorkerExecution.js.map +1 -0
  180. package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts +52 -0
  181. package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts.map +1 -0
  182. package/dist/hooks/workflow/useFetchWorkerExecutions.js +83 -0
  183. package/dist/hooks/workflow/useFetchWorkerExecutions.js.map +1 -0
  184. package/dist/hooks/workflow/useFetchWorkflow.d.ts +195 -0
  185. package/dist/hooks/workflow/useFetchWorkflow.d.ts.map +1 -0
  186. package/dist/hooks/workflow/useFetchWorkflow.js +70 -0
  187. package/dist/hooks/workflow/useFetchWorkflow.js.map +1 -0
  188. package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts +198 -0
  189. package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts.map +1 -0
  190. package/dist/hooks/workflow/useFetchWorkflowExecution.js +69 -0
  191. package/dist/hooks/workflow/useFetchWorkflowExecution.js.map +1 -0
  192. package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts +49 -0
  193. package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts.map +1 -0
  194. package/dist/hooks/workflow/useFetchWorkflowExecutions.js +77 -0
  195. package/dist/hooks/workflow/useFetchWorkflowExecutions.js.map +1 -0
  196. package/dist/hooks/workflow/useFetchWorkflows.d.ts +47 -0
  197. package/dist/hooks/workflow/useFetchWorkflows.d.ts.map +1 -0
  198. package/dist/hooks/workflow/useFetchWorkflows.js +67 -0
  199. package/dist/hooks/workflow/useFetchWorkflows.js.map +1 -0
  200. package/dist/hooks/workflow/useRunWorkflow.d.ts +30 -0
  201. package/dist/hooks/workflow/useRunWorkflow.d.ts.map +1 -0
  202. package/dist/hooks/workflow/useRunWorkflow.js +50 -0
  203. package/dist/hooks/workflow/useRunWorkflow.js.map +1 -0
  204. package/dist/hooks/workspace/useFetchWorkspace.d.ts +197 -0
  205. package/dist/hooks/workspace/useFetchWorkspace.d.ts.map +1 -0
  206. package/dist/hooks/workspace/useFetchWorkspace.js +65 -0
  207. package/dist/hooks/workspace/useFetchWorkspace.js.map +1 -0
  208. package/dist/hooks/workspace/useFetchWorkspaces.d.ts +46 -0
  209. package/dist/hooks/workspace/useFetchWorkspaces.d.ts.map +1 -0
  210. package/dist/hooks/workspace/useFetchWorkspaces.js +66 -0
  211. package/dist/hooks/workspace/useFetchWorkspaces.js.map +1 -0
  212. package/dist/index.d.ts +24 -0
  213. package/dist/index.d.ts.map +1 -0
  214. package/dist/index.js +50 -0
  215. package/dist/lib/datastoreTable.d.ts +126 -0
  216. package/dist/lib/datastoreTable.d.ts.map +1 -0
  217. package/dist/lib/datastoreTable.js +146 -0
  218. package/dist/lib/datastoreTable.js.map +1 -0
  219. package/dist/lib/queryClient.d.ts +24 -0
  220. package/dist/lib/queryClient.d.ts.map +1 -0
  221. package/dist/lib/queryClient.js +48 -0
  222. package/dist/lib/queryClient.js.map +1 -0
  223. package/dist/portfolio/index.d.ts +6 -0
  224. package/dist/portfolio/index.d.ts.map +1 -0
  225. package/dist/profile/index.d.ts +4 -0
  226. package/dist/profile/index.d.ts.map +1 -0
  227. package/dist/socket/index.d.ts +10 -0
  228. package/dist/socket/index.d.ts.map +1 -0
  229. package/dist/socket/index.js +9 -0
  230. package/dist/test/index.d.ts +2 -0
  231. package/dist/test/index.d.ts.map +1 -0
  232. package/dist/test/index.js +2 -0
  233. package/dist/test/mocks/agGridEnterprise.d.ts +38 -0
  234. package/dist/test/mocks/agGridEnterprise.d.ts.map +1 -0
  235. package/dist/test/mocks/agGridEnterprise.js +43 -0
  236. package/dist/test/mocks/agGridEnterprise.js.map +1 -0
  237. package/dist/test/mocks/agGridReact.d.ts +42 -0
  238. package/dist/test/mocks/agGridReact.d.ts.map +1 -0
  239. package/dist/test/mocks/agGridReact.js +47 -0
  240. package/dist/test/mocks/agGridReact.js.map +1 -0
  241. package/dist/test/mocks/index.d.ts +5 -0
  242. package/dist/test/mocks/index.d.ts.map +1 -0
  243. package/dist/test/mocks/index.js +4 -0
  244. package/dist/test/mocks/socketIoClient.d.ts +45 -0
  245. package/dist/test/mocks/socketIoClient.d.ts.map +1 -0
  246. package/dist/test/mocks/socketIoClient.js +54 -0
  247. package/dist/test/mocks/socketIoClient.js.map +1 -0
  248. package/dist/test/renderWithProviders.d.ts +107 -0
  249. package/dist/test/renderWithProviders.d.ts.map +1 -0
  250. package/dist/test/renderWithProviders.js +85 -0
  251. package/dist/test/renderWithProviders.js.map +1 -0
  252. package/dist/test/setup.d.ts +2 -0
  253. package/dist/test/setup.d.ts.map +1 -0
  254. package/dist/test/setup.js +25 -0
  255. package/dist/test/setup.js.map +1 -0
  256. package/dist/theme/ThemeProvider.d.ts +12 -0
  257. package/dist/theme/ThemeProvider.d.ts.map +1 -0
  258. package/dist/theme/ThemeProvider.js +22 -0
  259. package/dist/theme/ThemeProvider.js.map +1 -0
  260. package/dist/theme/index.d.ts +9 -0
  261. package/dist/theme/index.d.ts.map +1 -0
  262. package/dist/theme/overrides/index.d.ts +7 -0
  263. package/dist/theme/overrides/index.d.ts.map +1 -0
  264. package/dist/theme/overrides/index.js +31 -0
  265. package/dist/theme/overrides/index.js.map +1 -0
  266. package/dist/theme/overrides/muiButton.d.ts +3 -0
  267. package/dist/theme/overrides/muiButton.d.ts.map +1 -0
  268. package/dist/theme/overrides/muiButton.js +6 -0
  269. package/dist/theme/overrides/muiButton.js.map +1 -0
  270. package/dist/theme/overrides/muiCssBaseline.d.ts +31 -0
  271. package/dist/theme/overrides/muiCssBaseline.d.ts.map +1 -0
  272. package/dist/theme/overrides/muiCssBaseline.js +27 -0
  273. package/dist/theme/overrides/muiCssBaseline.js.map +1 -0
  274. package/dist/theme/overrides/muiDatePicker.d.ts +10 -0
  275. package/dist/theme/overrides/muiDatePicker.d.ts.map +1 -0
  276. package/dist/theme/overrides/muiDatePicker.js +6 -0
  277. package/dist/theme/overrides/muiDatePicker.js.map +1 -0
  278. package/dist/theme/overrides/muiFormControl.d.ts +3 -0
  279. package/dist/theme/overrides/muiFormControl.d.ts.map +1 -0
  280. package/dist/theme/overrides/muiFormControl.js +6 -0
  281. package/dist/theme/overrides/muiFormControl.js.map +1 -0
  282. package/dist/theme/overrides/muiIconButton.d.ts +3 -0
  283. package/dist/theme/overrides/muiIconButton.d.ts.map +1 -0
  284. package/dist/theme/overrides/muiIconButton.js +6 -0
  285. package/dist/theme/overrides/muiIconButton.js.map +1 -0
  286. package/dist/theme/overrides/muiSelect.d.ts +3 -0
  287. package/dist/theme/overrides/muiSelect.d.ts.map +1 -0
  288. package/dist/theme/overrides/muiSelect.js +6 -0
  289. package/dist/theme/overrides/muiSelect.js.map +1 -0
  290. package/dist/theme/overrides/muiSvgIcon.d.ts +3 -0
  291. package/dist/theme/overrides/muiSvgIcon.d.ts.map +1 -0
  292. package/dist/theme/overrides/muiSvgIcon.js +6 -0
  293. package/dist/theme/overrides/muiSvgIcon.js.map +1 -0
  294. package/dist/theme/overrides/muiTextField.d.ts +3 -0
  295. package/dist/theme/overrides/muiTextField.d.ts.map +1 -0
  296. package/dist/theme/overrides/muiTextField.js +6 -0
  297. package/dist/theme/overrides/muiTextField.js.map +1 -0
  298. package/dist/theme/overrides/muiToggleButton.d.ts +3 -0
  299. package/dist/theme/overrides/muiToggleButton.d.ts.map +1 -0
  300. package/dist/theme/overrides/muiToggleButton.js +6 -0
  301. package/dist/theme/overrides/muiToggleButton.js.map +1 -0
  302. package/dist/theme/overrides/muiToggleButtonGroup.d.ts +3 -0
  303. package/dist/theme/overrides/muiToggleButtonGroup.d.ts.map +1 -0
  304. package/dist/theme/overrides/muiToggleButtonGroup.js +6 -0
  305. package/dist/theme/overrides/muiToggleButtonGroup.js.map +1 -0
  306. package/dist/theme/themes/DefaultDark.d.ts +7 -0
  307. package/dist/theme/themes/DefaultDark.d.ts.map +1 -0
  308. package/dist/theme/themes/DefaultDark.js +15 -0
  309. package/dist/theme/themes/DefaultDark.js.map +1 -0
  310. package/dist/theme/themes/DefaultLight.d.ts +7 -0
  311. package/dist/theme/themes/DefaultLight.d.ts.map +1 -0
  312. package/dist/theme/themes/DefaultLight.js +15 -0
  313. package/dist/theme/themes/DefaultLight.js.map +1 -0
  314. package/dist/theme/themes/EveryskDark.d.ts +15 -0
  315. package/dist/theme/themes/EveryskDark.d.ts.map +1 -0
  316. package/dist/theme/themes/EveryskDark.js +63 -0
  317. package/dist/theme/themes/EveryskDark.js.map +1 -0
  318. package/dist/theme/themes/EveryskLight.d.ts +21 -0
  319. package/dist/theme/themes/EveryskLight.d.ts.map +1 -0
  320. package/dist/theme/themes/EveryskLight.js +69 -0
  321. package/dist/theme/themes/EveryskLight.js.map +1 -0
  322. package/dist/theme/themes/MidnightEmber.d.ts +3 -0
  323. package/dist/theme/themes/MidnightEmber.d.ts.map +1 -0
  324. package/dist/theme/themes/MidnightEmber.js +31 -0
  325. package/dist/theme/themes/MidnightEmber.js.map +1 -0
  326. package/dist/theme/themes/index.d.ts +17 -0
  327. package/dist/theme/themes/index.d.ts.map +1 -0
  328. package/dist/theme/themes/index.js +32 -0
  329. package/dist/theme/themes/index.js.map +1 -0
  330. package/dist/types/anyRecord.d.ts +4 -0
  331. package/dist/types/anyRecord.d.ts.map +1 -0
  332. package/dist/types/datastore.d.ts +26 -0
  333. package/dist/types/datastore.d.ts.map +1 -0
  334. package/dist/types/entityQuery.d.ts +47 -0
  335. package/dist/types/entityQuery.d.ts.map +1 -0
  336. package/dist/types/file.d.ts +29 -0
  337. package/dist/types/file.d.ts.map +1 -0
  338. package/dist/types/portfolio.d.ts +77 -0
  339. package/dist/types/portfolio.d.ts.map +1 -0
  340. package/dist/types/profile.d.ts +37 -0
  341. package/dist/types/profile.d.ts.map +1 -0
  342. package/dist/types/workflow.d.ts +68 -0
  343. package/dist/types/workflow.d.ts.map +1 -0
  344. package/dist/types/workspace.d.ts +13 -0
  345. package/dist/types/workspace.d.ts.map +1 -0
  346. package/dist/ui/index.d.ts +6 -0
  347. package/dist/ui/index.d.ts.map +1 -0
  348. package/dist/workflow/index.d.ts +10 -0
  349. package/dist/workflow/index.d.ts.map +1 -0
  350. package/dist/workspace/index.d.ts +5 -0
  351. package/dist/workspace/index.d.ts.map +1 -0
  352. package/package.json +148 -0
  353. package/src/EveryskApp.tsx +108 -0
  354. package/src/agGrid/agGridTheme.ts +113 -0
  355. package/src/agGrid/index.ts +15 -0
  356. package/src/api/datastore.ts +175 -0
  357. package/src/api/entityQuery.ts +101 -0
  358. package/src/api/file.ts +174 -0
  359. package/src/api/portfolio.ts +190 -0
  360. package/src/api/profile.ts +80 -0
  361. package/src/api/websocketsConfig.ts +32 -0
  362. package/src/api/workflow.ts +427 -0
  363. package/src/api/workspace.ts +72 -0
  364. package/src/components/ui/EveryskIcon/index.tsx +24 -0
  365. package/src/components/ui/Footer/index.tsx +30 -0
  366. package/src/components/ui/GlobalLoading/index.tsx +38 -0
  367. package/src/components/ui/PageContainer/index.tsx +14 -0
  368. package/src/components/ui/Toolbar/index.tsx +44 -0
  369. package/src/contexts/agGridLicenseContext/provider.tsx +63 -0
  370. package/src/contexts/appAlertContext/index.tsx +4 -0
  371. package/src/contexts/appAlertContext/provider.tsx +92 -0
  372. package/src/contexts/appAlertContext/types.ts +17 -0
  373. package/src/contexts/appAlertContext/useAppAlert.ts +39 -0
  374. package/src/contexts/appConfigContext/index.tsx +4 -0
  375. package/src/contexts/appConfigContext/provider.tsx +67 -0
  376. package/src/contexts/appConfigContext/types.ts +28 -0
  377. package/src/contexts/appConfigContext/useAppConfig.ts +30 -0
  378. package/src/contexts/webSocketContext/constants.ts +3 -0
  379. package/src/contexts/webSocketContext/handler.ts +108 -0
  380. package/src/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.ts +36 -0
  381. package/src/contexts/webSocketContext/hooks/useWebSocket/index.ts +18 -0
  382. package/src/contexts/webSocketContext/hooks/useWebSocketSubscription/index.ts +45 -0
  383. package/src/contexts/webSocketContext/index.tsx +5 -0
  384. package/src/contexts/webSocketContext/provider.tsx +125 -0
  385. package/src/contexts/webSocketContext/types.ts +50 -0
  386. package/src/datastore/index.ts +14 -0
  387. package/src/file/index.ts +13 -0
  388. package/src/hooks/datastore/useDatastoreMutations.ts +221 -0
  389. package/src/hooks/datastore/useFetchDatastore.ts +95 -0
  390. package/src/hooks/datastore/useFetchDatastores.ts +162 -0
  391. package/src/hooks/file/useFetchFile.ts +93 -0
  392. package/src/hooks/file/useFetchFiles.ts +109 -0
  393. package/src/hooks/file/useFileMutations.ts +240 -0
  394. package/src/hooks/portfolio/useFetchPortfolio.ts +94 -0
  395. package/src/hooks/portfolio/useFetchPortfolios.ts +109 -0
  396. package/src/hooks/portfolio/usePortfolioMutations.ts +250 -0
  397. package/src/hooks/profile/useFetchProfile.ts +93 -0
  398. package/src/hooks/useAxios.ts +98 -0
  399. package/src/hooks/workflow/useFetchWorkerExecution.ts +78 -0
  400. package/src/hooks/workflow/useFetchWorkerExecutions.ts +98 -0
  401. package/src/hooks/workflow/useFetchWorkflow.ts +76 -0
  402. package/src/hooks/workflow/useFetchWorkflowExecution.ts +79 -0
  403. package/src/hooks/workflow/useFetchWorkflowExecutions.ts +95 -0
  404. package/src/hooks/workflow/useFetchWorkflows.ts +84 -0
  405. package/src/hooks/workflow/useRunWorkflow.ts +62 -0
  406. package/src/hooks/workspace/useFetchWorkspace.ts +78 -0
  407. package/src/hooks/workspace/useFetchWorkspaces.ts +86 -0
  408. package/src/index.ts +72 -0
  409. package/src/lib/datastoreTable.ts +159 -0
  410. package/src/lib/queryClient.ts +60 -0
  411. package/src/portfolio/index.ts +13 -0
  412. package/src/profile/index.ts +11 -0
  413. package/src/socket/index.ts +19 -0
  414. package/src/test/index.ts +10 -0
  415. package/src/test/mocks/agGridEnterprise.ts +45 -0
  416. package/src/test/mocks/agGridReact.tsx +61 -0
  417. package/src/test/mocks/index.ts +22 -0
  418. package/src/test/mocks/socketIoClient.ts +78 -0
  419. package/src/test/renderWithProviders.tsx +114 -0
  420. package/src/test/setup.ts +46 -0
  421. package/src/theme/ThemeProvider.tsx +33 -0
  422. package/src/theme/index.ts +15 -0
  423. package/src/theme/overrides/index.ts +31 -0
  424. package/src/theme/overrides/muiButton.ts +7 -0
  425. package/src/theme/overrides/muiCssBaseline.ts +35 -0
  426. package/src/theme/overrides/muiDatePicker.ts +5 -0
  427. package/src/theme/overrides/muiFormControl.ts +7 -0
  428. package/src/theme/overrides/muiIconButton.ts +7 -0
  429. package/src/theme/overrides/muiSelect.ts +7 -0
  430. package/src/theme/overrides/muiSvgIcon.ts +7 -0
  431. package/src/theme/overrides/muiTextField.ts +7 -0
  432. package/src/theme/overrides/muiToggleButton.ts +7 -0
  433. package/src/theme/overrides/muiToggleButtonGroup.ts +7 -0
  434. package/src/theme/themes/DefaultDark.ts +14 -0
  435. package/src/theme/themes/DefaultLight.ts +14 -0
  436. package/src/theme/themes/EveryskDark.ts +62 -0
  437. package/src/theme/themes/EveryskLight.ts +68 -0
  438. package/src/theme/themes/MidnightEmber.ts +30 -0
  439. package/src/theme/themes/index.ts +35 -0
  440. package/src/types/anyRecord.ts +4 -0
  441. package/src/types/datastore.ts +33 -0
  442. package/src/types/entityQuery.ts +64 -0
  443. package/src/types/file.ts +32 -0
  444. package/src/types/portfolio.ts +81 -0
  445. package/src/types/profile.ts +39 -0
  446. package/src/types/workflow.ts +76 -0
  447. package/src/types/workspace.ts +15 -0
  448. package/src/ui/index.ts +14 -0
  449. package/src/workflow/index.ts +17 -0
  450. package/src/workspace/index.ts +12 -0
@@ -0,0 +1,125 @@
1
+ import { isAxiosError } from "axios";
2
+ //#region src/api/datastore.ts
3
+ var baseUrl = "datastores";
4
+ /**
5
+ * getDatastore
6
+ *
7
+ * Fetches a single datastore by ID.
8
+ *
9
+ * @param {AxiosInstance} api - Axios instance.
10
+ * @param {string} id - Datastore identifier.
11
+ * @param {string} workspace - Workspace the datastore belongs to.
12
+ * @returns {Promise<Datastore>} The fetched datastore.
13
+ *
14
+ * @throws {Error} If the request fails.
15
+ */
16
+ var getDatastore = async (api, id, workspace) => {
17
+ const params = { workspace };
18
+ if (!workspace) throw new Error("Workspace filter is required to fetch a datastore");
19
+ try {
20
+ return (await api.get(`${baseUrl}/${id}`, { params })).data.datastore;
21
+ } catch (error) {
22
+ if (isAxiosError(error)) throw new Error(error.message || "Error fetching datastore");
23
+ if (error instanceof Error) throw error;
24
+ throw new Error("Error fetching datastore");
25
+ }
26
+ };
27
+ /**
28
+ * listDatastores
29
+ *
30
+ * Fetches a list of datastores using a query object (filters, order, pagination, etc.).
31
+ *
32
+ * @param {AxiosInstance} api - Axios instance.
33
+ * @param {AnyRecord} query - Query object built via `buildQueryObject`.
34
+ * @returns {Promise<DatastoreListResponse>} Paginated list of datastores.
35
+ *
36
+ * @throws {Error} If workspace filter is missing.
37
+ * @throws {Error} If the request fails.
38
+ */
39
+ var listDatastores = async (api, query) => {
40
+ const workspaceFilter = query.filters.find((filter) => filter[0] === "workspace");
41
+ const workspace = workspaceFilter?.[workspaceFilter.length - 1];
42
+ if (!workspace) throw new Error("Workspace filter is required to list datastores");
43
+ const params = {
44
+ workspace,
45
+ ...query ? { query: JSON.stringify(query) } : {}
46
+ };
47
+ try {
48
+ return (await api.get(baseUrl, { params })).data;
49
+ } catch (error) {
50
+ if (isAxiosError(error)) throw new Error(error.message || "Error listing datastores");
51
+ if (error instanceof Error) throw error;
52
+ throw new Error("Error listing datastores");
53
+ }
54
+ };
55
+ /**
56
+ * createDatastore
57
+ *
58
+ * Creates a new datastore.
59
+ *
60
+ * @param {AxiosInstance} api - Axios instance.
61
+ * @param {Partial<Datastore>} data - Datastore payload.
62
+ * @returns {Promise<Datastore>} The created datastore.
63
+ *
64
+ * @throws {Error} If the request fails.
65
+ */
66
+ var createDatastore = async (api, data) => {
67
+ const { workspace } = data;
68
+ if (!workspace) throw new Error("Workspace filter is required to create a datastore");
69
+ try {
70
+ return (await api.post(baseUrl, data)).data.datastore;
71
+ } catch (error) {
72
+ if (isAxiosError(error)) throw new Error(error.message || "Error creating datastore");
73
+ if (error instanceof Error) throw error;
74
+ throw new Error("Error creating datastore");
75
+ }
76
+ };
77
+ /**
78
+ * updateDatastore
79
+ *
80
+ * Updates an existing datastore by ID.
81
+ *
82
+ * @param {AxiosInstance} api - Axios instance.
83
+ * @param {string} id - Datastore identifier.
84
+ * @param {Partial<Datastore>} data - Fields to update.
85
+ * @returns {Promise<Datastore>} The updated datastore.
86
+ *
87
+ * @throws {Error} If the request fails.
88
+ */
89
+ var updateDatastore = async (api, id, data) => {
90
+ const { workspace } = data;
91
+ if (!workspace) throw new Error("Workspace filter is required to update a datastore");
92
+ try {
93
+ return (await api.put(`${baseUrl}/${id}`, data)).data.datastore;
94
+ } catch (error) {
95
+ if (isAxiosError(error)) throw new Error(error.message || "Error updating datastore");
96
+ if (error instanceof Error) throw error;
97
+ throw new Error("Error updating datastore");
98
+ }
99
+ };
100
+ /**
101
+ * deleteDatastore
102
+ *
103
+ * Deletes a datastore by ID.
104
+ *
105
+ * @param {AxiosInstance} api - Axios instance.
106
+ * @param {string} id - Datastore identifier.
107
+ * @param {string} workspace - Workspace the datastore belongs to.
108
+ * @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.
109
+ *
110
+ * @throws {Error} If the request fails.
111
+ */
112
+ var deleteDatastore = async (api, id, workspace) => {
113
+ const params = { workspace };
114
+ try {
115
+ return (await api.delete(`${baseUrl}/${id}`, { params })).data.datastores;
116
+ } catch (error) {
117
+ if (isAxiosError(error)) throw new Error(error.message || "Error removing datastore");
118
+ if (error instanceof Error) throw error;
119
+ throw new Error("Error removing datastore");
120
+ }
121
+ };
122
+ //#endregion
123
+ export { createDatastore, deleteDatastore, getDatastore, listDatastores, updateDatastore };
124
+
125
+ //# sourceMappingURL=datastore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datastore.js","names":[],"sources":["../../src/api/datastore.ts"],"sourcesContent":["import { isAxiosError, type AxiosInstance, type AxiosResponse } from \"axios\";\n\nimport type { AnyRecord } from \"@/types/anyRecord\";\nimport type { DeleteEntityDefaultResponse, FilterExpression, QueryObject } from \"@/types/entityQuery\";\nimport type { Datastore, DatastoreSingleResponse, DatastoreListResponse, DeleteDatastoreResponse } from \"@/types/datastore\";\n\nconst baseUrl = \"datastores\";\n\n/**\n * getDatastore\n *\n * Fetches a single datastore by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - Datastore identifier.\n * @param {string} workspace - Workspace the datastore belongs to.\n * @returns {Promise<Datastore>} The fetched datastore.\n *\n * @throws {Error} If the request fails.\n */\nexport const getDatastore = async (api: AxiosInstance, id: string, workspace: string): Promise<Datastore> => {\n const params: AnyRecord = { workspace };\n\n if (!workspace) throw new Error(\"Workspace filter is required to fetch a datastore\");\n\n try {\n const response: AxiosResponse<DatastoreSingleResponse> = await api.get(`${baseUrl}/${id}`, { params });\n return response.data.datastore;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error fetching datastore\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error fetching datastore\");\n }\n};\n\n/**\n * listDatastores\n *\n * Fetches a list of datastores using a query object (filters, order, pagination, etc.).\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {AnyRecord} query - Query object built via `buildQueryObject`.\n * @returns {Promise<DatastoreListResponse>} Paginated list of datastores.\n *\n * @throws {Error} If workspace filter is missing.\n * @throws {Error} If the request fails.\n */\nexport const listDatastores = async (api: AxiosInstance, query: QueryObject): Promise<DatastoreListResponse> => {\n const workspaceFilter = query.filters.find((filter: FilterExpression) => filter[0] === \"workspace\");\n const workspace = workspaceFilter?.[workspaceFilter.length - 1];\n\n if (!workspace) throw new Error(\"Workspace filter is required to list datastores\");\n\n const params: AnyRecord = {\n workspace,\n ...(query ? { query: JSON.stringify(query) } : {}),\n };\n\n try {\n const response: AxiosResponse<DatastoreListResponse> = await api.get(baseUrl, { params });\n return response.data;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error listing datastores\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error listing datastores\");\n }\n};\n\n/**\n * createDatastore\n *\n * Creates a new datastore.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {Partial<Datastore>} data - Datastore payload.\n * @returns {Promise<Datastore>} The created datastore.\n *\n * @throws {Error} If the request fails.\n */\nexport const createDatastore = async (api: AxiosInstance, data: Partial<Datastore>): Promise<Datastore> => {\n\n const { workspace } = data;\n if (!workspace) throw new Error(\"Workspace filter is required to create a datastore\");\n\n try {\n const response: AxiosResponse<DatastoreSingleResponse> = await api.post(baseUrl, data);\n return response.data.datastore;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error creating datastore\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error creating datastore\");\n }\n};\n\n/**\n * updateDatastore\n *\n * Updates an existing datastore by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - Datastore identifier.\n * @param {Partial<Datastore>} data - Fields to update.\n * @returns {Promise<Datastore>} The updated datastore.\n *\n * @throws {Error} If the request fails.\n */\nexport const updateDatastore = async (api: AxiosInstance, id: string, data: Partial<Datastore>): Promise<Datastore> => {\n\n const { workspace } = data;\n if (!workspace) throw new Error(\"Workspace filter is required to update a datastore\");\n\n try {\n const response: AxiosResponse<DatastoreSingleResponse> = await api.put(`${baseUrl}/${id}`, data);\n return response.data.datastore;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error updating datastore\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error updating datastore\");\n }\n};\n\n/**\n * deleteDatastore\n *\n * Deletes a datastore by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - Datastore identifier.\n * @param {string} workspace - Workspace the datastore belongs to.\n * @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.\n *\n * @throws {Error} If the request fails.\n */\nexport const deleteDatastore = async (api: AxiosInstance, id: string, workspace: string): Promise<DeleteEntityDefaultResponse[]> => {\n const params: AnyRecord = { workspace };\n\n try {\n const response: AxiosResponse<DeleteDatastoreResponse> = await api.delete(`${baseUrl}/${id}`, { params });\n return response.data.datastores;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error removing datastore\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error removing datastore\");\n }\n};"],"mappings":";;AAMA,IAAM,UAAU;;;;;;;;;;;;;AAchB,IAAa,eAAe,OAAO,KAAoB,IAAY,cAA0C;CAC3G,MAAM,SAAoB,EAAE,UAAU;CAEtC,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,mDAAmD;CAEnF,IAAI;EAEF,QAAO,MADwD,IAAI,IAAI,GAAG,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,EAAA,CACrF,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF;;;;;;;;;;;;;AAcA,IAAa,iBAAiB,OAAO,KAAoB,UAAuD;CAC9G,MAAM,kBAAkB,MAAM,QAAQ,MAAM,WAA6B,OAAO,OAAO,WAAW;CAClG,MAAM,YAAY,kBAAkB,gBAAgB,SAAS;CAE7D,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,iDAAiD;CAEjF,MAAM,SAAoB;EACxB;EACA,GAAI,QAAQ,EAAE,OAAO,KAAK,UAAU,KAAK,EAAE,IAAI,CAAC;CAClD;CAEA,IAAI;EAEF,QAAO,MADsD,IAAI,IAAI,SAAS,EAAE,OAAO,CAAC,EAAA,CACxE;CAClB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF;;;;;;;;;;;;AAaA,IAAa,kBAAkB,OAAO,KAAoB,SAAiD;CAEzG,MAAM,EAAE,cAAc;CACtB,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,oDAAoD;CAEpF,IAAI;EAEF,QAAO,MADwD,IAAI,KAAK,SAAS,IAAI,EAAA,CACrE,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF;;;;;;;;;;;;;AAcA,IAAa,kBAAkB,OAAO,KAAoB,IAAY,SAAiD;CAErH,MAAM,EAAE,cAAc;CACtB,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,oDAAoD;CAEpF,IAAI;EAEF,QAAO,MADwD,IAAI,IAAI,GAAG,QAAQ,GAAG,MAAM,IAAI,EAAA,CAC/E,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF;;;;;;;;;;;;;AAcA,IAAa,kBAAkB,OAAO,KAAoB,IAAY,cAA8D;CAClI,MAAM,SAAoB,EAAE,UAAU;CAEtC,IAAI;EAEF,QAAO,MADwD,IAAI,OAAO,GAAG,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,EAAA,CACxF,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF"}
@@ -0,0 +1,78 @@
1
+ import type { FilterClause, FilterExpression, EntityQueryParams, QueryObject } from "../types/entityQuery.d.ts";
2
+ /**
3
+ * toFilterTuple
4
+ *
5
+ * Converts a `FilterClause` object into a `FilterExpression` tuple
6
+ * compatible with the API query format.
7
+ *
8
+ * - If no operator is provided or operator is `"="`, returns a 2-tuple `[field, value]`.
9
+ * - Otherwise, returns a 3-tuple `[field, op, value]`.
10
+ *
11
+ * @param {FilterClause} filter - Filter clause to convert.
12
+ * @returns {FilterExpression} Tuple representation of the filter.
13
+ *
14
+ * Examples:
15
+ * ```ts
16
+ * toFilterTuple({ field: "workspace", value: "ws-1" })
17
+ * // -> ["workspace", "ws-1"]
18
+ *
19
+ * toFilterTuple({ field: "age", op: ">=", value: 18 })
20
+ * // -> ["age", ">=", 18]
21
+ * ```
22
+ */
23
+ export declare const toFilterTuple: (filter: FilterClause) => FilterExpression;
24
+ /**
25
+ * buildQueryObject
26
+ *
27
+ * Builds the query payload object to be sent to the API,
28
+ * converting filters, ordering, pagination, and projection into the expected format.
29
+ *
30
+ * @param {EntityQueryParams} params - Query parameters.
31
+ * @param {FilterClause[]} params.filters - Filters to apply (converted via `toFilterTuple`).
32
+ * @param {string[]} params.order - Sorting fields.
33
+ * @param {number} [params.pageSize] - Number of items per page.
34
+ * @param {string} [params.pageToken] - Cursor token for the next page.
35
+ * @param {string} [params.projection] - Single field to project. `"field"` returns only that
36
+ * field (every other field comes back null); `"-field"` returns all fields except that one.
37
+ * One field only — comma/space lists return a 500. Omitted from payload if empty.
38
+ * @returns {QueryObject} Query payload ready to be passed to the API.
39
+ *
40
+ * Example:
41
+ * ```ts
42
+ * buildQueryObject({
43
+ * filters: [{ field: "workspace", value: "ws-1" }],
44
+ * order: ["name"], // plain field name(s) only — no "asc"/"desc" suffix
45
+ * pageSize: 10,
46
+ * pageToken: "token-abc",
47
+ * projection: "name",
48
+ * });
49
+ * // -> {
50
+ * // filters: [["workspace", "ws-1"]],
51
+ * // order: ["name"],
52
+ * // projection: "name",
53
+ * // page_size: 10,
54
+ * // page_token: "token-abc",
55
+ * // }
56
+ * ```
57
+ */
58
+ export declare const buildQueryObject: (params: EntityQueryParams) => QueryObject;
59
+ /**
60
+ * buildQueryKey
61
+ *
62
+ * Builds a stable React Query cache key by combining a base key array
63
+ * with the values of the provided filters.
64
+ *
65
+ * This ensures the query is re-executed whenever filter values change.
66
+ *
67
+ * @param {(string | number)[]} keys - Base keys (e.g. entity name, id).
68
+ * @param {FilterClause[]} filters - Filters whose values are appended to the key.
69
+ * @returns {unknown[]} Cache key array for use in `queryKey`.
70
+ *
71
+ * Example:
72
+ * ```ts
73
+ * buildQueryKey(["datastores"], [{ field: "workspace", value: "ws-1" }]);
74
+ * // -> ["datastores", "ws-1"]
75
+ * ```
76
+ */
77
+ export declare const buildQueryKey: (keys: (string | number)[], filters: FilterClause[]) => unknown[];
78
+ //# sourceMappingURL=entityQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entityQuery.d.ts","sourceRoot":"","sources":["../../src/api/entityQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE1G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,YAAY,KAAG,gBAMpD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,iBAAiB,KAAG,WAU5D,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,SAAS,YAAY,EAAE,KAAG,OAAO,EAKzF,CAAA"}
@@ -0,0 +1,100 @@
1
+ //#region src/api/entityQuery.ts
2
+ /**
3
+ * toFilterTuple
4
+ *
5
+ * Converts a `FilterClause` object into a `FilterExpression` tuple
6
+ * compatible with the API query format.
7
+ *
8
+ * - If no operator is provided or operator is `"="`, returns a 2-tuple `[field, value]`.
9
+ * - Otherwise, returns a 3-tuple `[field, op, value]`.
10
+ *
11
+ * @param {FilterClause} filter - Filter clause to convert.
12
+ * @returns {FilterExpression} Tuple representation of the filter.
13
+ *
14
+ * Examples:
15
+ * ```ts
16
+ * toFilterTuple({ field: "workspace", value: "ws-1" })
17
+ * // -> ["workspace", "ws-1"]
18
+ *
19
+ * toFilterTuple({ field: "age", op: ">=", value: 18 })
20
+ * // -> ["age", ">=", 18]
21
+ * ```
22
+ */
23
+ var toFilterTuple = (filter) => {
24
+ const { field, op, value } = filter;
25
+ if (!op || op === "=") return [field, value];
26
+ return [
27
+ field,
28
+ op,
29
+ value
30
+ ];
31
+ };
32
+ /**
33
+ * buildQueryObject
34
+ *
35
+ * Builds the query payload object to be sent to the API,
36
+ * converting filters, ordering, pagination, and projection into the expected format.
37
+ *
38
+ * @param {EntityQueryParams} params - Query parameters.
39
+ * @param {FilterClause[]} params.filters - Filters to apply (converted via `toFilterTuple`).
40
+ * @param {string[]} params.order - Sorting fields.
41
+ * @param {number} [params.pageSize] - Number of items per page.
42
+ * @param {string} [params.pageToken] - Cursor token for the next page.
43
+ * @param {string} [params.projection] - Single field to project. `"field"` returns only that
44
+ * field (every other field comes back null); `"-field"` returns all fields except that one.
45
+ * One field only — comma/space lists return a 500. Omitted from payload if empty.
46
+ * @returns {QueryObject} Query payload ready to be passed to the API.
47
+ *
48
+ * Example:
49
+ * ```ts
50
+ * buildQueryObject({
51
+ * filters: [{ field: "workspace", value: "ws-1" }],
52
+ * order: ["name"], // plain field name(s) only — no "asc"/"desc" suffix
53
+ * pageSize: 10,
54
+ * pageToken: "token-abc",
55
+ * projection: "name",
56
+ * });
57
+ * // -> {
58
+ * // filters: [["workspace", "ws-1"]],
59
+ * // order: ["name"],
60
+ * // projection: "name",
61
+ * // page_size: 10,
62
+ * // page_token: "token-abc",
63
+ * // }
64
+ * ```
65
+ */
66
+ var buildQueryObject = (params) => {
67
+ const { filters, pageSize, pageToken, order, projection } = params;
68
+ return {
69
+ filters: filters.map(toFilterTuple),
70
+ order,
71
+ ...!!projection && { projection },
72
+ page_size: pageSize,
73
+ page_token: pageToken
74
+ };
75
+ };
76
+ /**
77
+ * buildQueryKey
78
+ *
79
+ * Builds a stable React Query cache key by combining a base key array
80
+ * with the values of the provided filters.
81
+ *
82
+ * This ensures the query is re-executed whenever filter values change.
83
+ *
84
+ * @param {(string | number)[]} keys - Base keys (e.g. entity name, id).
85
+ * @param {FilterClause[]} filters - Filters whose values are appended to the key.
86
+ * @returns {unknown[]} Cache key array for use in `queryKey`.
87
+ *
88
+ * Example:
89
+ * ```ts
90
+ * buildQueryKey(["datastores"], [{ field: "workspace", value: "ws-1" }]);
91
+ * // -> ["datastores", "ws-1"]
92
+ * ```
93
+ */
94
+ var buildQueryKey = (keys, filters) => {
95
+ return [...keys, ...filters.flatMap((filter) => filter.value)];
96
+ };
97
+ //#endregion
98
+ export { buildQueryKey, buildQueryObject, toFilterTuple };
99
+
100
+ //# sourceMappingURL=entityQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entityQuery.js","names":[],"sources":["../../src/api/entityQuery.ts"],"sourcesContent":["import type { FilterClause, FilterExpression, EntityQueryParams, QueryObject } from \"@/types/entityQuery\";\n\n/**\n * toFilterTuple\n *\n * Converts a `FilterClause` object into a `FilterExpression` tuple\n * compatible with the API query format.\n *\n * - If no operator is provided or operator is `\"=\"`, returns a 2-tuple `[field, value]`.\n * - Otherwise, returns a 3-tuple `[field, op, value]`.\n *\n * @param {FilterClause} filter - Filter clause to convert.\n * @returns {FilterExpression} Tuple representation of the filter.\n *\n * Examples:\n * ```ts\n * toFilterTuple({ field: \"workspace\", value: \"ws-1\" })\n * // -> [\"workspace\", \"ws-1\"]\n *\n * toFilterTuple({ field: \"age\", op: \">=\", value: 18 })\n * // -> [\"age\", \">=\", 18]\n * ```\n */\nexport const toFilterTuple = (filter: FilterClause): FilterExpression => {\n const { field, op, value } = filter;\n if (!op || op === '=') {\n return [field, value];\n }\n return [field, op, value];\n};\n\n/**\n * buildQueryObject\n *\n * Builds the query payload object to be sent to the API,\n * converting filters, ordering, pagination, and projection into the expected format.\n *\n * @param {EntityQueryParams} params - Query parameters.\n * @param {FilterClause[]} params.filters - Filters to apply (converted via `toFilterTuple`).\n * @param {string[]} params.order - Sorting fields.\n * @param {number} [params.pageSize] - Number of items per page.\n * @param {string} [params.pageToken] - Cursor token for the next page.\n * @param {string} [params.projection] - Single field to project. `\"field\"` returns only that\n * field (every other field comes back null); `\"-field\"` returns all fields except that one.\n * One field only — comma/space lists return a 500. Omitted from payload if empty.\n * @returns {QueryObject} Query payload ready to be passed to the API.\n *\n * Example:\n * ```ts\n * buildQueryObject({\n * filters: [{ field: \"workspace\", value: \"ws-1\" }],\n * order: [\"name\"], // plain field name(s) only — no \"asc\"/\"desc\" suffix\n * pageSize: 10,\n * pageToken: \"token-abc\",\n * projection: \"name\",\n * });\n * // -> {\n * // filters: [[\"workspace\", \"ws-1\"]],\n * // order: [\"name\"],\n * // projection: \"name\",\n * // page_size: 10,\n * // page_token: \"token-abc\",\n * // }\n * ```\n */\nexport const buildQueryObject = (params: EntityQueryParams): QueryObject => {\n const { filters, pageSize, pageToken, order, projection } = params;\n\n return {\n filters: filters.map(toFilterTuple),\n order,\n ...(!!projection && { projection }),\n page_size: pageSize,\n page_token: pageToken,\n };\n}\n\n/**\n * buildQueryKey\n *\n * Builds a stable React Query cache key by combining a base key array\n * with the values of the provided filters.\n *\n * This ensures the query is re-executed whenever filter values change.\n *\n * @param {(string | number)[]} keys - Base keys (e.g. entity name, id).\n * @param {FilterClause[]} filters - Filters whose values are appended to the key.\n * @returns {unknown[]} Cache key array for use in `queryKey`.\n *\n * Example:\n * ```ts\n * buildQueryKey([\"datastores\"], [{ field: \"workspace\", value: \"ws-1\" }]);\n * // -> [\"datastores\", \"ws-1\"]\n * ```\n */\nexport const buildQueryKey = (keys: (string | number)[], filters: FilterClause[]): unknown[] => {\n return [\n ...keys,\n ...filters.flatMap((filter) => filter.value)\n ];\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,iBAAiB,WAA2C;CACrE,MAAM,EAAE,OAAO,IAAI,UAAU;CAC7B,IAAI,CAAC,MAAM,OAAO,KACd,OAAO,CAAC,OAAO,KAAK;CAExB,OAAO;EAAC;EAAO;EAAI;CAAK;AAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,oBAAoB,WAA2C;CACxE,MAAM,EAAE,SAAS,UAAU,WAAW,OAAO,eAAe;CAE5D,OAAO;EACH,SAAS,QAAQ,IAAI,aAAa;EAClC;EACA,GAAI,CAAC,CAAC,cAAc,EAAE,WAAW;EACjC,WAAW;EACX,YAAY;CAChB;AACJ;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,iBAAiB,MAA2B,YAAuC;CAC5F,OAAO,CACH,GAAG,MACH,GAAG,QAAQ,SAAS,WAAW,OAAO,KAAK,CAC/C;AACJ"}
@@ -0,0 +1,70 @@
1
+ import { type AxiosInstance } from "axios";
2
+ import type { EveryskFile, FileListResponse } from "../types/file.d.ts";
3
+ import type { DeleteEntityDefaultResponse, QueryObject } from "../types/entityQuery.d.ts";
4
+ /**
5
+ * getFile
6
+ *
7
+ * Fetches a single file by ID.
8
+ *
9
+ * @param {AxiosInstance} api - Axios instance.
10
+ * @param {string} id - EveryskFile identifier.
11
+ * @param {string} workspace - Workspace the file belongs to.
12
+ * @returns {Promise<EveryskFile>} The fetched file.
13
+ *
14
+ * @throws {Error} If the request fails.
15
+ */
16
+ export declare const getFile: (api: AxiosInstance, id: string, workspace: string) => Promise<EveryskFile>;
17
+ /**
18
+ * listFiles
19
+ *
20
+ * Fetches a list of files using a query object (filters, order, pagination, etc.).
21
+ *
22
+ * Note: `workspace` is extracted from the query filters and sent as a separate
23
+ * query param alongside the serialized query object.
24
+ *
25
+ * @param {AxiosInstance} api - Axios instance.
26
+ * @param {QueryObject} query - Query object built via `buildQueryObject`.
27
+ * @returns {Promise<EveryskFile[]>} List of files. Returns an empty array if none found.
28
+ *
29
+ * @throws {Error} If the request fails.
30
+ */
31
+ export declare const listFiles: (api: AxiosInstance, query: QueryObject) => Promise<FileListResponse>;
32
+ /**
33
+ * createFile
34
+ *
35
+ * Creates a new file.
36
+ *
37
+ * @param {AxiosInstance} api - Axios instance.
38
+ * @param {Partial<EveryskFile>} data - EveryskFile payload.
39
+ * @returns {Promise<EveryskFile>} The created file.
40
+ *
41
+ * @throws {Error} If the request fails.
42
+ */
43
+ export declare const createFile: (api: AxiosInstance, data: Partial<EveryskFile>) => Promise<EveryskFile>;
44
+ /**
45
+ * updateFile
46
+ *
47
+ * Updates an existing file by ID.
48
+ *
49
+ * @param {AxiosInstance} api - Axios instance.
50
+ * @param {string} id - EveryskFile identifier.
51
+ * @param {Partial<EveryskFile>} data - Fields to update.
52
+ * @returns {Promise<EveryskFile>} The updated file.
53
+ *
54
+ * @throws {Error} If the request fails.
55
+ */
56
+ export declare const updateFile: (api: AxiosInstance, id: string, data: Partial<EveryskFile>) => Promise<EveryskFile>;
57
+ /**
58
+ * deleteFile
59
+ *
60
+ * Deletes a file by ID.
61
+ *
62
+ * @param {AxiosInstance} api - Axios instance.
63
+ * @param {string} id - EveryskFile identifier.
64
+ * @param {string} workspace - Workspace the file belongs to.
65
+ * @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.
66
+ *
67
+ * @throws {Error} If the request fails.
68
+ */
69
+ export declare const deleteFile: (api: AxiosInstance, id: string, workspace: string) => Promise<DeleteEntityDefaultResponse[]>;
70
+ //# sourceMappingURL=file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/api/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,aAAa,EAAsB,MAAM,OAAO,CAAC;AAG7E,OAAO,KAAK,EAAsB,WAAW,EAAE,gBAAgB,EAAsB,MAAM,cAAc,CAAC;AAC1G,OAAO,KAAK,EAAE,2BAA2B,EAAoB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAItG;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,WAAW,CAiBpG,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,GAAU,KAAK,aAAa,EAAE,OAAO,WAAW,KAAG,OAAO,CAAC,gBAAgB,CAwBhG,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAU,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,KAAG,OAAO,CAAC,WAAW,CAmBpG,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,KAAG,OAAO,CAAC,WAAW,CAmBhH,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,2BAA2B,EAAE,CAiBzH,CAAC"}
@@ -0,0 +1,126 @@
1
+ import { isAxiosError } from "axios";
2
+ //#region src/api/file.ts
3
+ var baseUrl = "files";
4
+ /**
5
+ * getFile
6
+ *
7
+ * Fetches a single file by ID.
8
+ *
9
+ * @param {AxiosInstance} api - Axios instance.
10
+ * @param {string} id - EveryskFile identifier.
11
+ * @param {string} workspace - Workspace the file belongs to.
12
+ * @returns {Promise<EveryskFile>} The fetched file.
13
+ *
14
+ * @throws {Error} If the request fails.
15
+ */
16
+ var getFile = async (api, id, workspace) => {
17
+ const params = { workspace };
18
+ try {
19
+ return (await api.get(`${baseUrl}/${id}`, { params })).data.file;
20
+ } catch (error) {
21
+ if (isAxiosError(error)) throw new Error(error.message || "Error while fetching file");
22
+ if (error instanceof Error) throw error;
23
+ throw new Error("Error while fetching file");
24
+ }
25
+ };
26
+ /**
27
+ * listFiles
28
+ *
29
+ * Fetches a list of files using a query object (filters, order, pagination, etc.).
30
+ *
31
+ * Note: `workspace` is extracted from the query filters and sent as a separate
32
+ * query param alongside the serialized query object.
33
+ *
34
+ * @param {AxiosInstance} api - Axios instance.
35
+ * @param {QueryObject} query - Query object built via `buildQueryObject`.
36
+ * @returns {Promise<EveryskFile[]>} List of files. Returns an empty array if none found.
37
+ *
38
+ * @throws {Error} If the request fails.
39
+ */
40
+ var listFiles = async (api, query) => {
41
+ const workspaceFilter = query.filters.find((filter) => filter[0] === "workspace");
42
+ const workspace = workspaceFilter?.[workspaceFilter.length - 1];
43
+ if (!workspace) throw new Error("Workspace filter is required to list files");
44
+ const params = {
45
+ workspace,
46
+ ...query ? { query: JSON.stringify(query) } : {}
47
+ };
48
+ try {
49
+ return (await api.get(baseUrl, { params })).data;
50
+ } catch (error) {
51
+ if (isAxiosError(error)) throw new Error(error.message || "Error while fetching files");
52
+ if (error instanceof Error) throw error;
53
+ throw new Error("Error while fetching files");
54
+ }
55
+ };
56
+ /**
57
+ * createFile
58
+ *
59
+ * Creates a new file.
60
+ *
61
+ * @param {AxiosInstance} api - Axios instance.
62
+ * @param {Partial<EveryskFile>} data - EveryskFile payload.
63
+ * @returns {Promise<EveryskFile>} The created file.
64
+ *
65
+ * @throws {Error} If the request fails.
66
+ */
67
+ var createFile = async (api, data) => {
68
+ const { workspace } = data;
69
+ if (!workspace) throw new Error("Workspace filter is required to create a file");
70
+ try {
71
+ return (await api.post(baseUrl, data)).data.file;
72
+ } catch (error) {
73
+ if (isAxiosError(error)) throw new Error(error.message || "Error while creating file");
74
+ if (error instanceof Error) throw error;
75
+ throw new Error("Error while creating file");
76
+ }
77
+ };
78
+ /**
79
+ * updateFile
80
+ *
81
+ * Updates an existing file by ID.
82
+ *
83
+ * @param {AxiosInstance} api - Axios instance.
84
+ * @param {string} id - EveryskFile identifier.
85
+ * @param {Partial<EveryskFile>} data - Fields to update.
86
+ * @returns {Promise<EveryskFile>} The updated file.
87
+ *
88
+ * @throws {Error} If the request fails.
89
+ */
90
+ var updateFile = async (api, id, data) => {
91
+ const { workspace } = data;
92
+ if (!workspace) throw new Error("Workspace filter is required to update a file");
93
+ try {
94
+ return (await api.put(`${baseUrl}/${id}`, data)).data.file;
95
+ } catch (error) {
96
+ if (isAxiosError(error)) throw new Error(error.message || "Error while updating file");
97
+ if (error instanceof Error) throw error;
98
+ throw new Error("Error while updating file");
99
+ }
100
+ };
101
+ /**
102
+ * deleteFile
103
+ *
104
+ * Deletes a file by ID.
105
+ *
106
+ * @param {AxiosInstance} api - Axios instance.
107
+ * @param {string} id - EveryskFile identifier.
108
+ * @param {string} workspace - Workspace the file belongs to.
109
+ * @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.
110
+ *
111
+ * @throws {Error} If the request fails.
112
+ */
113
+ var deleteFile = async (api, id, workspace) => {
114
+ const params = { workspace };
115
+ try {
116
+ return (await api.delete(`${baseUrl}/${id}`, { params })).data.files;
117
+ } catch (error) {
118
+ if (isAxiosError(error)) throw new Error(error.message || "Error while deleting file");
119
+ if (error instanceof Error) throw error;
120
+ throw new Error("Error while deleting file");
121
+ }
122
+ };
123
+ //#endregion
124
+ export { createFile, deleteFile, getFile, listFiles, updateFile };
125
+
126
+ //# sourceMappingURL=file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.js","names":[],"sources":["../../src/api/file.ts"],"sourcesContent":["import { isAxiosError, type AxiosInstance, type AxiosResponse } from \"axios\";\n\nimport type { AnyRecord } from \"@/types/anyRecord\";\nimport type { DeleteFileResponse, EveryskFile, FileListResponse, FileSingleResponse } from \"@/types/file\";\nimport type { DeleteEntityDefaultResponse, FilterExpression, QueryObject } from \"@/types/entityQuery\";\n\nconst baseUrl = \"files\";\n\n/**\n * getFile\n *\n * Fetches a single file by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - EveryskFile identifier.\n * @param {string} workspace - Workspace the file belongs to.\n * @returns {Promise<EveryskFile>} The fetched file.\n *\n * @throws {Error} If the request fails.\n */\nexport const getFile = async (api: AxiosInstance, id: string, workspace: string): Promise<EveryskFile> => {\n const params: AnyRecord = { workspace };\n\n try {\n const response: AxiosResponse<FileSingleResponse> = await api.get(`${baseUrl}/${id}`, { params });\n return response.data.file;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while fetching file\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while fetching file\");\n }\n};\n\n/**\n * listFiles\n *\n * Fetches a list of files using a query object (filters, order, pagination, etc.).\n *\n * Note: `workspace` is extracted from the query filters and sent as a separate\n * query param alongside the serialized query object.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {QueryObject} query - Query object built via `buildQueryObject`.\n * @returns {Promise<EveryskFile[]>} List of files. Returns an empty array if none found.\n *\n * @throws {Error} If the request fails.\n */\nexport const listFiles = async (api: AxiosInstance, query: QueryObject): Promise<FileListResponse> => {\n const workspaceFilter = query.filters.find((filter: FilterExpression) => filter[0] === \"workspace\");\n const workspace = workspaceFilter?.[workspaceFilter.length - 1];\n \n if (!workspace) throw new Error(\"Workspace filter is required to list files\");\n\n const params: AnyRecord = {\n workspace,\n ...(query ? { query: JSON.stringify(query) } : {}),\n };\n\n try {\n const response: AxiosResponse<FileListResponse> = await api.get(baseUrl, { params });\n return response.data;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while fetching files\");\n } \n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while fetching files\");\n }\n};\n\n/**\n * createFile\n *\n * Creates a new file.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {Partial<EveryskFile>} data - EveryskFile payload.\n * @returns {Promise<EveryskFile>} The created file.\n *\n * @throws {Error} If the request fails.\n */\nexport const createFile = async (api: AxiosInstance, data: Partial<EveryskFile>): Promise<EveryskFile> => {\n\n const { workspace } = data;\n if (!workspace) throw new Error(\"Workspace filter is required to create a file\");\n\n try {\n const response: AxiosResponse<FileSingleResponse> = await api.post(baseUrl, data);\n return response.data.file;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while creating file\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while creating file\");\n }\n};\n\n/**\n * updateFile\n *\n * Updates an existing file by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - EveryskFile identifier.\n * @param {Partial<EveryskFile>} data - Fields to update.\n * @returns {Promise<EveryskFile>} The updated file.\n *\n * @throws {Error} If the request fails.\n */\nexport const updateFile = async (api: AxiosInstance, id: string, data: Partial<EveryskFile>): Promise<EveryskFile> => {\n\n const { workspace } = data;\n if (!workspace) throw new Error(\"Workspace filter is required to update a file\");\n\n try {\n const response: AxiosResponse<FileSingleResponse> = await api.put(`${baseUrl}/${id}`, data);\n return response.data.file;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while updating file\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while updating file\");\n }\n};\n\n/**\n * deleteFile\n *\n * Deletes a file by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - EveryskFile identifier.\n * @param {string} workspace - Workspace the file belongs to.\n * @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.\n *\n * @throws {Error} If the request fails.\n */\nexport const deleteFile = async (api: AxiosInstance, id: string, workspace: string): Promise<DeleteEntityDefaultResponse[]> => {\n const params: AnyRecord = { workspace };\n\n try {\n const response: AxiosResponse<DeleteFileResponse> = await api.delete(`${baseUrl}/${id}`, { params });\n return response.data.files;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while deleting file\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while deleting file\");\n }\n};"],"mappings":";;AAMA,IAAM,UAAU;;;;;;;;;;;;;AAchB,IAAa,UAAU,OAAO,KAAoB,IAAY,cAA4C;CACxG,MAAM,SAAoB,EAAE,UAAU;CAEtC,IAAI;EAEF,QAAO,MADmD,IAAI,IAAI,GAAG,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,EAAA,CAChF,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAChC,MAAM,IAAI,MAAM,MAAM,WAAW,2BAA2B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,2BAA2B;CAC7C;AACF;;;;;;;;;;;;;;;AAgBA,IAAa,YAAY,OAAO,KAAoB,UAAkD;CACpG,MAAM,kBAAkB,MAAM,QAAQ,MAAM,WAA6B,OAAO,OAAO,WAAW;CAClG,MAAM,YAAY,kBAAkB,gBAAgB,SAAS;CAE7D,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,4CAA4C;CAE5E,MAAM,SAAoB;EACxB;EACA,GAAI,QAAQ,EAAE,OAAO,KAAK,UAAU,KAAK,EAAE,IAAI,CAAC;CAClD;CAEA,IAAI;EAEF,QAAO,MADiD,IAAI,IAAI,SAAS,EAAE,OAAO,CAAC,EAAA,CACnE;CAClB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,4BAA4B;EAE/D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,4BAA4B;CAC9C;AACF;;;;;;;;;;;;AAaA,IAAa,aAAa,OAAO,KAAoB,SAAqD;CAExG,MAAM,EAAE,cAAc;CACtB,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,+CAA+C;CAE/E,IAAI;EAEF,QAAO,MADmD,IAAI,KAAK,SAAS,IAAI,EAAA,CAChE,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,2BAA2B;EAG9D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,2BAA2B;CAC7C;AACF;;;;;;;;;;;;;AAcA,IAAa,aAAa,OAAO,KAAoB,IAAY,SAAqD;CAElH,MAAM,EAAE,cAAc;CACtB,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,+CAA+C;CAE/E,IAAI;EAEA,QAAO,MADmD,IAAI,IAAI,GAAG,QAAQ,GAAG,MAAM,IAAI,EAAA,CAC1E,KAAK;CACzB,SAAS,OAAgB;EACrB,IAAI,aAAwB,KAAK,GAC7B,MAAM,IAAI,MAAM,MAAM,WAAW,2BAA2B;EAGhE,IAAI,iBAAiB,OACjB,MAAM;EAGV,MAAM,IAAI,MAAM,2BAA2B;CAC/C;AACJ;;;;;;;;;;;;;AAcA,IAAa,aAAa,OAAO,KAAoB,IAAY,cAA8D;CAC7H,MAAM,SAAoB,EAAE,UAAU;CAEtC,IAAI;EAEF,QAAO,MADmD,IAAI,OAAO,GAAG,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,EAAA,CACnF,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,2BAA2B;EAG9D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,2BAA2B;CAC7C;AACF"}
@@ -0,0 +1,67 @@
1
+ import { type AxiosInstance } from "axios";
2
+ import type { QueryObject } from "../types/entityQuery.d.ts";
3
+ import type { Portfolio, PortfolioListResponse, PortfolioSingleResponse } from "../types/portfolio.d.ts";
4
+ /**
5
+ * getPortfolio
6
+ *
7
+ * Fetches a single portfolio by ID.
8
+ *
9
+ * @param {AxiosInstance} api - Axios instance.
10
+ * @param {string} id - Portfolio identifier.
11
+ * @param {string} workspace - Workspace the portfolio belongs to.
12
+ * @returns {Promise<PortfolioSingleResponse>} The fetched portfolio response.
13
+ *
14
+ * @throws {Error} If the request fails.
15
+ */
16
+ export declare const getPortfolio: (api: AxiosInstance, id: string, workspace: string) => Promise<PortfolioSingleResponse>;
17
+ /**
18
+ * listPortfolios
19
+ *
20
+ * Fetches a list of portfolios using a query object (filters, order, pagination, etc.).
21
+ *
22
+ * @param {AxiosInstance} api - Axios instance.
23
+ * @param {QueryObject} query - Query object built via `buildQueryObject`.
24
+ * @returns {Promise<PortfolioListResponse>} List of portfolios.
25
+ *
26
+ * @throws {Error} If the request fails.
27
+ */
28
+ export declare const listPortfolios: (api: AxiosInstance, query: QueryObject) => Promise<PortfolioListResponse>;
29
+ /**
30
+ * createPortfolio
31
+ *
32
+ * Creates a new portfolio.
33
+ *
34
+ * @param {AxiosInstance} api - Axios instance.
35
+ * @param {Partial<Portfolio>} data - Portfolio payload.
36
+ * @returns {Promise<Portfolio>} The created portfolio.
37
+ *
38
+ * @throws {Error} If the request fails.
39
+ */
40
+ export declare const createPortfolio: (api: AxiosInstance, data: Partial<Portfolio>) => Promise<Portfolio>;
41
+ /**
42
+ * updatePortfolio
43
+ *
44
+ * Updates an existing portfolio by ID.
45
+ *
46
+ * @param {AxiosInstance} api - Axios instance.
47
+ * @param {string} id - Portfolio identifier.
48
+ * @param {Partial<Portfolio>} data - Fields to update.
49
+ * @returns {Promise<Portfolio>} The updated portfolio.
50
+ *
51
+ * @throws {Error} If the request fails.
52
+ */
53
+ export declare const updatePortfolio: (api: AxiosInstance, id: string, data: Partial<Portfolio>) => Promise<Portfolio>;
54
+ /**
55
+ * deletePortfolio
56
+ *
57
+ * Deletes a portfolio by ID.
58
+ *
59
+ * @param {AxiosInstance} api - Axios instance.
60
+ * @param {string} id - Portfolio identifier.
61
+ * @param {string} workspace - Workspace the portfolio belongs to.
62
+ * @returns {Promise<Portfolio>} The deleted portfolio.
63
+ *
64
+ * @throws {Error} If the request fails.
65
+ */
66
+ export declare const deletePortfolio: (api: AxiosInstance, id: string, workspace: string) => Promise<Portfolio>;
67
+ //# sourceMappingURL=portfolio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portfolio.d.ts","sourceRoot":"","sources":["../../src/api/portfolio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,aAAa,EAAsB,MAAM,OAAO,CAAC;AAE7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAInG;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,uBAAuB,CAqBrH,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAU,KAAK,aAAa,EAAE,OAAO,WAAW,KAAG,OAAO,CAAC,qBAAqB,CA2B1G,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,KAAG,OAAO,CAAC,SAAS,CAsBrG,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,KAAG,OAAO,CAAC,SAAS,CAsBjH,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,SAAS,CAsB1G,CAAA"}