@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,38 @@
1
+ import Backdrop from "@mui/material/Backdrop";
2
+ import Box from "@mui/material/Box";
3
+ import CircularProgress from "@mui/material/CircularProgress";
4
+ import Typography from "@mui/material/Typography";
5
+
6
+ interface GlobalLoadingProps {
7
+ isLoading: boolean;
8
+ backdrop?: boolean;
9
+ message?: string;
10
+ }
11
+
12
+ export const GlobalLoading = ({ isLoading, backdrop = true, message }: GlobalLoadingProps) => {
13
+ if (!isLoading) return null;
14
+
15
+ const content = (
16
+ <Box sx={{ display: "flex", flexDirection: "column", alignItems: "center", gap: 2 }}>
17
+ <CircularProgress color="primary" />
18
+ {message && <Typography color="text.secondary">{message}</Typography>}
19
+ </Box>
20
+ );
21
+
22
+ if (!backdrop) {
23
+ return (
24
+ <Box sx={{ display: "flex", justifyContent: "center", alignItems: "center", height: "100%" }}>
25
+ {content}
26
+ </Box>
27
+ );
28
+ }
29
+
30
+ return (
31
+ <Backdrop
32
+ open
33
+ sx={{ zIndex: (theme) => theme.zIndex.modal + 1, backgroundColor: "rgba(0, 0, 0, 0.3)" }}
34
+ >
35
+ {content}
36
+ </Backdrop>
37
+ );
38
+ }
@@ -0,0 +1,14 @@
1
+ import clsx from "clsx";
2
+ import type { PropsWithChildren, ReactNode } from "react";
3
+
4
+ export const PageContainer = ({ header, footer, contentClassName, children }: PropsWithChildren<{ header?: ReactNode, footer?: ReactNode, contentClassName?: string }>) => {
5
+ return (
6
+ <div className="flex flex-col w-full h-full overflow-hidden">
7
+ {header}
8
+ <div className={clsx("flex shrink-1 grow-1 basis-auto overflow-auto", contentClassName)}>
9
+ {children}
10
+ </div>
11
+ {footer}
12
+ </div>
13
+ );
14
+ };
@@ -0,0 +1,44 @@
1
+ import type { PropsWithChildren } from 'react';
2
+
3
+ import AppBar from '@mui/material/AppBar';
4
+ import { useTheme, type Theme } from '@mui/material/styles';
5
+ import MuiToolbar from '@mui/material/Toolbar';
6
+
7
+ import clsx from 'clsx';
8
+
9
+ import { EveryskIcon } from '@/components/ui/EveryskIcon';
10
+
11
+ import type { AnyRecord } from '@/types/anyRecord';
12
+
13
+ export const Toolbar = ({ children, className }: PropsWithChildren<{ className?: string }>) => {
14
+ const theme: Theme = useTheme();
15
+
16
+ const styles: AnyRecord = {
17
+ light: {
18
+ color: 'transparent',
19
+ elevation: 0,
20
+ sx: {
21
+ border: "1px solid rgba(0, 0, 0, 0.12)"
22
+ }
23
+ },
24
+ dark: {
25
+ // 'default', not ''. An empty string is not a value the AppBar API takes — it
26
+ // produced the class `MuiAppBar-color` with no variant suffix, which rendered the
27
+ // same only because the brand theme overrides AppBar anyway. This is the explicit
28
+ // spelling of what already happens, and it survives a theme that does not.
29
+ color: 'default',
30
+ elevation: 1
31
+ }
32
+ };
33
+
34
+ return (
35
+ <AppBar position='relative' {...styles?.[theme.palette.mode]}>
36
+ <MuiToolbar >
37
+ <div className={clsx("flex items-center gap-4", className)}>
38
+ <EveryskIcon />
39
+ {children}
40
+ </div>
41
+ </MuiToolbar>
42
+ </AppBar>
43
+ );
44
+ }
@@ -0,0 +1,63 @@
1
+ import { type PropsWithChildren } from "react";
2
+
3
+ import { LicenseManager } from "ag-grid-enterprise";
4
+
5
+ /**
6
+ * setAgGridLicense
7
+ *
8
+ * Registers the AG Grid Enterprise license. A no-op when the key is missing or empty, so an
9
+ * app that has not configured one degrades to the watermark instead of throwing.
10
+ *
11
+ * The key is a **parameter**, not something this package reads from the environment. The
12
+ * template read `import.meta.env.VITE_AG_GRID_LICENSE_KEY` at module scope, which works
13
+ * inside an app and silently breaks inside a published package: Vite replaces
14
+ * `import.meta.env.VITE_*` with a literal at the build of whoever compiles the file, so the
15
+ * value would freeze to whatever the SDK's own CI had — nothing — and the consuming app's
16
+ * environment would never reach it. No build error, no runtime error, just the watermark.
17
+ *
18
+ * The app keeps ownership of its own environment:
19
+ *
20
+ * ```ts
21
+ * // src/main.tsx
22
+ * setAgGridLicense(import.meta.env.VITE_AG_GRID_LICENSE_KEY);
23
+ * ```
24
+ *
25
+ * @param {string} [licenseKey] - The license key, typically from the app's build environment.
26
+ */
27
+ export const setAgGridLicense = (licenseKey?: string): void => {
28
+ if (typeof licenseKey === "string" && licenseKey) {
29
+ LicenseManager.setLicenseKey(licenseKey);
30
+ }
31
+ };
32
+
33
+ export type AgGridLicenseProviderProps = PropsWithChildren<{
34
+ /** The license key. Omitted or empty, the provider only renders its children. */
35
+ licenseKey?: string;
36
+ }>;
37
+
38
+ /**
39
+ * AgGridLicenseProvider
40
+ *
41
+ * Provider form of `setAgGridLicense`, for apps that would rather configure the license in
42
+ * the component tree than at bootstrap. It holds no context — it registers the key and
43
+ * renders its children.
44
+ *
45
+ * The registration happens in the render body rather than in an effect on purpose: AG Grid
46
+ * reads the license when a grid first renders, and an effect runs *after* that commit, so a
47
+ * grid mounted in the same commit would flash the watermark. React renders a parent's body
48
+ * before its children, which is exactly the ordering needed here. `setLicenseKey` is an
49
+ * idempotent setter on a module global, so StrictMode's double render is harmless.
50
+ *
51
+ * ```tsx
52
+ * <EveryskApp>
53
+ * <AgGridLicenseProvider licenseKey={import.meta.env.VITE_AG_GRID_LICENSE_KEY}>
54
+ * <Routes />
55
+ * </AgGridLicenseProvider>
56
+ * </EveryskApp>
57
+ * ```
58
+ */
59
+ export const AgGridLicenseProvider = ({ children, licenseKey }: AgGridLicenseProviderProps) => {
60
+ setAgGridLicense(licenseKey);
61
+
62
+ return <>{children}</>;
63
+ };
@@ -0,0 +1,4 @@
1
+ import { createContext } from "react";
2
+ import type { AppAlertContextType } from "./types";
3
+
4
+ export const AppAlertContext = createContext<AppAlertContextType | null>(null);
@@ -0,0 +1,92 @@
1
+ import { useCallback, useMemo, useState, type PropsWithChildren } from "react";
2
+ import Alert from "@mui/material/Alert";
3
+ import Snackbar, { type SnackbarCloseReason } from "@mui/material/Snackbar";
4
+
5
+ import { AppAlertContext } from ".";
6
+ import type { AppAlertContextType, AppAlertState, ShowAlertOptions } from "./types";
7
+
8
+ /**
9
+ * AppAlertProvider
10
+ *
11
+ * React context provider responsible for exposing a global application alert API and rendering
12
+ * a Material UI `Snackbar` + `Alert` pair anchored to the viewport.
13
+ *
14
+ * What this provider does:
15
+ * - Maintains an internal `AppAlertState` that controls:
16
+ * - visibility (`open`)
17
+ * - displayed text (`message`)
18
+ * - alert tone (`severity`)
19
+ * - auto-dismiss timing (`autoHideDuration`)
20
+ * - screen position (`anchorOrigin`)
21
+ * - Exposes an imperative API via context:
22
+ * - `showAlert(options)` to open/update the alert
23
+ * - `hideAlert()` to close the alert
24
+ * - Renders the `Snackbar`/`Alert` components once (at the provider level), so any descendant can
25
+ * trigger alerts without needing to manage UI state locally.
26
+ *
27
+ * Behavior:
28
+ * - `showAlert(options)` performs a shallow merge of the provided options into the current state
29
+ * and forces `open: true`.
30
+ * - `hideAlert()` sets `open: false` (preserving the remaining state).
31
+ * - Snackbar `onClose` ignores the `"clickaway"` reason to prevent accidental dismissals when the user
32
+ * clicks outside the toast.
33
+ *
34
+ * Performance / stability:
35
+ * - `showAlert` and `hideAlert` should be stable (e.g., created with `useCallback`) so the context value
36
+ * does not change on every render, avoiding unnecessary re-renders in consumers.
37
+ *
38
+ * Usage:
39
+ * ```ts
40
+ * <AppAlertProvider>
41
+ * <App />
42
+ * </AppAlertProvider>
43
+ * ```
44
+ */
45
+
46
+ export const AppAlertProvider = ({ children }: PropsWithChildren) => {
47
+ const [state, setState] = useState<AppAlertState>({
48
+ open: false,
49
+ message: "",
50
+ severity: "info",
51
+ autoHideDuration: 4000,
52
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
53
+ });
54
+
55
+ const hideAlert = useCallback(() => {
56
+ setState((prev) => ({ ...prev, open: false }));
57
+ }, []);
58
+
59
+ const showAlert = useCallback((options: ShowAlertOptions) => {
60
+ setState((prev) => ({
61
+ ...prev,
62
+ ...options,
63
+ open: true,
64
+ }));
65
+ }, []);
66
+
67
+ const value: AppAlertContextType = useMemo(
68
+ () => ({ showAlert, hideAlert }),
69
+ [showAlert, hideAlert]
70
+ );
71
+
72
+ return (
73
+ <AppAlertContext.Provider value={value}>
74
+ {children}
75
+
76
+ <Snackbar
77
+ open={state.open}
78
+ message={state.message}
79
+ autoHideDuration={state.autoHideDuration}
80
+ anchorOrigin={state.anchorOrigin}
81
+ onClose={(_, reason: SnackbarCloseReason) => {
82
+ if (reason === "clickaway") return;
83
+ hideAlert();
84
+ }}
85
+ >
86
+ <Alert onClose={hideAlert} severity={state.severity} variant="filled" elevation={6}>
87
+ {state.message}
88
+ </Alert>
89
+ </Snackbar>
90
+ </AppAlertContext.Provider>
91
+ );
92
+ };
@@ -0,0 +1,17 @@
1
+ import type { AlertColor } from "@mui/material/Alert";
2
+ import type { SnackbarProps } from "@mui/material/Snackbar";
3
+
4
+ export type AppAlertState = Omit<SnackbarProps, "open" | "onClose" | "message"> & {
5
+ open: boolean;
6
+ message: string;
7
+ severity: AlertColor;
8
+ };
9
+
10
+ export type ShowAlertOptions = Partial<Omit<AppAlertState, "open">> & {
11
+ message: string;
12
+ };
13
+
14
+ export type AppAlertContextType = {
15
+ showAlert: (options: ShowAlertOptions) => void;
16
+ hideAlert: () => void;
17
+ };
@@ -0,0 +1,39 @@
1
+ import { useContext } from "react";
2
+ import { AppAlertContext } from ".";
3
+
4
+ /**
5
+ * useAppAlert
6
+ *
7
+ * Convenience hook that reads the alert API from `AppAlertContext`.
8
+ *
9
+ * Behavior:
10
+ * - Returns the functions exposed by `<AppAlertProvider>`, typically:
11
+ * - `showAlert(options)` to display an alert
12
+ * - `hideAlert()` to close the current alert
13
+ *
14
+ * Error handling:
15
+ * - Throws a descriptive error if called outside of an `<AppAlertProvider>` scope, to fail fast
16
+ * and prevent silent no-op alert calls.
17
+ *
18
+ * Usage:
19
+ * ```ts
20
+ * const { showAlert } = useAppAlert();
21
+ *
22
+ * showAlert({
23
+ * message: "Saved successfully.",
24
+ * severity: "success",
25
+ * autoHideDuration: 3000,
26
+ * });
27
+ * ```
28
+ *
29
+ * @throws {Error}
30
+ * Throws if the hook is used outside of `<AppAlertProvider>`.
31
+ */
32
+
33
+ export const useAppAlert = () => {
34
+ const ctx = useContext(AppAlertContext);
35
+ if (!ctx) {
36
+ throw new Error("useAppAlert must be used within <AppAlertProvider>.");
37
+ }
38
+ return ctx;
39
+ };
@@ -0,0 +1,4 @@
1
+ import { createContext } from "react";
2
+ import type { AppConfigContextType } from "./types";
3
+
4
+ export const AppConfigContext = createContext<AppConfigContextType | null>(null)
@@ -0,0 +1,67 @@
1
+ import { useMemo } from "react";
2
+
3
+ import { AppConfigContext } from ".";
4
+ import type { AppConfigContextType, AppConfigProviderProps } from "./types";
5
+
6
+ /**
7
+ * AppConfigProvider
8
+ *
9
+ * React context provider responsible for exposing the application's runtime configuration
10
+ * (`AppConfigContextType`) to the component tree.
11
+ *
12
+ * Configuration sources, in order of precedence:
13
+ *
14
+ * 1. The `appId` / `appEnvironmentVar` props.
15
+ * Explicit injection, for tests and for hosts that resolve configuration themselves rather
16
+ * than through the page globals. A prop wins over the corresponding global; passing
17
+ * `appId={null}` forces "no app id" instead of falling through to `window.APP_ID`.
18
+ *
19
+ * 2. `window.APP_ID` and `window.APP_CONFIG`.
20
+ * Injected into the page by the platform (from the app's `config.json` `env_vars`) before
21
+ * the bundle executes.
22
+ *
23
+ * In dev there is no platform to inject them, so the app's dev server serves the `env_vars` at
24
+ * `/app-config.json` and the app merges them into `window.APP_CONFIG` during bootstrap, before
25
+ * React mounts. That merge is shallow and belongs to the app, not to this provider: nested
26
+ * objects are replaced whole, not deep-merged.
27
+ *
28
+ * Lifecycle notes:
29
+ * - This provider performs no network request and does not update its value after mount.
30
+ * - Because configuration is resolved before `createRoot(...).render(...)`, the tree receives a
31
+ * consistent configuration from the first render.
32
+ *
33
+ * Example:
34
+ * ```tsx
35
+ * <AppConfigProvider>
36
+ * <App />
37
+ * </AppConfigProvider>
38
+ *
39
+ * // In a test, with no page globals:
40
+ * <AppConfigProvider appId="app_42" appEnvironmentVar={{ API_URL: "/api" }}>
41
+ * <ComponentUnderTest />
42
+ * </AppConfigProvider>
43
+ *
44
+ * // Consumer hook usage
45
+ * const { appId, appEnvironmentVar } = useAppConfig();
46
+ * ```
47
+ */
48
+ export const AppConfigProvider = ({
49
+ children,
50
+ appId,
51
+ appEnvironmentVar,
52
+ }: AppConfigProviderProps) => {
53
+ const value: AppConfigContextType = useMemo(() => {
54
+ const globalConfig = (globalThis.window?.APP_CONFIG ?? {}) as Record<string, unknown>;
55
+
56
+ return {
57
+ appId: appId !== undefined ? appId : (globalThis.window?.APP_ID ?? null),
58
+ appEnvironmentVar: appEnvironmentVar ?? globalConfig,
59
+ };
60
+ }, [appId, appEnvironmentVar]);
61
+
62
+ return (
63
+ <AppConfigContext.Provider value={value}>
64
+ {children}
65
+ </AppConfigContext.Provider>
66
+ );
67
+ };
@@ -0,0 +1,28 @@
1
+ import type { ReactNode } from "react";
2
+ import type { AnyRecord } from "@/types/anyRecord";
3
+
4
+ /**
5
+ * The platform injects these into the host page before the bundle runs. Both are optional:
6
+ * this augmentation reaches every consumer of the package, and declaring them as required
7
+ * would be a lie in dev, where nothing injects them — `AppConfigProvider` itself has always
8
+ * read `window.APP_ID ?? null`.
9
+ */
10
+ declare global {
11
+ interface Window {
12
+ APP_ID?: string;
13
+ APP_CONFIG?: { [key: string]: unknown };
14
+ }
15
+ }
16
+
17
+ export type AppConfigContextType = {
18
+ appId: string | null;
19
+ appEnvironmentVar: AnyRecord;
20
+ };
21
+
22
+ export type AppConfigProviderProps = {
23
+ children?: ReactNode;
24
+ /** Overrides `window.APP_ID`. Pass `null` to force "no app id". */
25
+ appId?: string | null;
26
+ /** Overrides `window.APP_CONFIG` wholesale (not merged into it). */
27
+ appEnvironmentVar?: AnyRecord;
28
+ };
@@ -0,0 +1,30 @@
1
+ import { useContext } from "react";
2
+
3
+ import { AppConfigContext } from ".";
4
+
5
+ /**
6
+ * useAppConfig
7
+ *
8
+ * Convenience hook that reads the current application configuration from `AppConfigContext`.
9
+ *
10
+ * Behavior:
11
+ * - Returns the `AppConfigContextType` value provided by `<AppConfigProvider>`.
12
+ * - Throws a descriptive error if called outside of an `<AppConfigProvider>` scope, to fail fast and
13
+ * avoid undefined configuration usage throughout the app.
14
+ *
15
+ * Usage:
16
+ * ```ts
17
+ * const { appId, appEnvironmentVar } = useAppConfig();
18
+ * ```
19
+ *
20
+ * @throws {Error}
21
+ * Throws if the hook is used outside of `<AppConfigProvider>`.
22
+ */
23
+
24
+ export const useAppConfig = () => {
25
+ const context = useContext(AppConfigContext);
26
+ if (!context) {
27
+ throw new Error("useAppConfig must be used within <AppConfigProvider>.");
28
+ }
29
+ return context;
30
+ };
@@ -0,0 +1,3 @@
1
+ export const NOTIFICATION_EVENT = "notification";
2
+ export const JOIN_EVENT = "join";
3
+ export const APP_NOTIFICATION_EVENT_TYPE = "USER_APP_NOTIFICATION";
@@ -0,0 +1,108 @@
1
+ import { io, type Socket } from "socket.io-client";
2
+
3
+ import type { WebSocketNotification, WebSocketStatus, WebsocketsConfig } from "./types";
4
+
5
+ function isWebSocketNotification(value: unknown): value is WebSocketNotification {
6
+ return (
7
+ typeof value === "object" &&
8
+ value !== null &&
9
+ typeof (value as Record<string, unknown>)["event_type"] === "string"
10
+ );
11
+ }
12
+ import { JOIN_EVENT, NOTIFICATION_EVENT } from "./constants";
13
+
14
+ type StatusListener = (status: Exclude<WebSocketStatus, "idle">) => void;
15
+
16
+ type WebSocketHandlerConfig = WebsocketsConfig & {
17
+ onStatusChange?: StatusListener;
18
+ };
19
+
20
+ /**
21
+ * WebSocketHandler
22
+ *
23
+ * Low-level Socket.IO wrapper with a pub/sub layer.
24
+ *
25
+ * - Connects to the notification server.
26
+ * - Joins the per-user channel.
27
+ * - Forwards notifications to registered listeners.
28
+ *
29
+ * API:
30
+ * - `listen(callback)`: register a notification listener; returns an unsubscribe function.
31
+ * - `close()`: disconnect the socket and clear all listeners.
32
+ */
33
+ export class WebSocketHandler {
34
+ private _socket: Socket;
35
+ private _everyskUID: string;
36
+ private _listeners: Set<(msg: WebSocketNotification) => void> = new Set();
37
+
38
+ constructor({ appConnectionURL, appChannelID, everyskUID, onStatusChange }: WebSocketHandlerConfig) {
39
+ this._everyskUID = everyskUID;
40
+
41
+ this._socket = io(appConnectionURL, {
42
+ auth: { appChannelID, everyskUID },
43
+ transports: ["websocket"],
44
+ });
45
+
46
+ this._socket.on("connect", () => {
47
+ this._socket.emit(JOIN_EVENT, appChannelID);
48
+ onStatusChange?.("connected");
49
+ });
50
+
51
+ this._socket.on("connect_error", (error) => {
52
+ console.error("Socket.IO connection error:", error);
53
+ onStatusChange?.("error");
54
+ });
55
+
56
+ this._socket.on("disconnect", (reason: string) => {
57
+ console.error("Socket.IO disconnected:", reason);
58
+ onStatusChange?.(reason === "io server disconnect" ? "error" : "connecting");
59
+ });
60
+
61
+ this._socket.on(NOTIFICATION_EVENT, (msg: unknown) => {
62
+ if (!isWebSocketNotification(msg)) return;
63
+ if (this._isEcho(msg)) return;
64
+ this._listeners.forEach((callback) => {
65
+ try {
66
+ callback(msg);
67
+ } catch (error) {
68
+ console.error("Socket.IO notification listener threw:", error);
69
+ }
70
+ });
71
+ });
72
+ }
73
+
74
+ private _isEcho(msg: WebSocketNotification): boolean {
75
+ // Echo-cancellation is disabled by default.
76
+ // Set ECHO_UID_FIELD to the message field that carries the originating uid
77
+ // once the server team confirms the field name.
78
+ const ECHO_UID_FIELD: string | null = null;
79
+ if (!ECHO_UID_FIELD) return false;
80
+ const originating = (msg as Record<string, unknown>)[ECHO_UID_FIELD];
81
+ return originating === this._everyskUID;
82
+ }
83
+
84
+ /**
85
+ * listen
86
+ *
87
+ * Registers a listener that receives every incoming notification.
88
+ *
89
+ * @param {(msg: WebSocketNotification) => void} callback - Invoked for each notification.
90
+ * @returns {() => void} Unsubscribe function.
91
+ */
92
+ listen(callback: (msg: WebSocketNotification) => void): () => void {
93
+ this._listeners.add(callback);
94
+ return () => this._listeners.delete(callback);
95
+ }
96
+
97
+ /**
98
+ * close
99
+ *
100
+ * Clears all listeners and disconnects the socket.
101
+ * After calling this, the handler should be considered unusable.
102
+ */
103
+ close(): void {
104
+ this._listeners.clear();
105
+ this._socket.removeAllListeners();
106
+ this._socket.disconnect();
107
+ }
108
+ }
@@ -0,0 +1,36 @@
1
+ import { useWebSocketSubscription } from "../useWebSocketSubscription";
2
+ import { APP_NOTIFICATION_EVENT_TYPE } from "../../constants";
3
+ import type { AppNotification, WebSocketNotification } from "../../types";
4
+
5
+ function isAppNotification(msg: WebSocketNotification): msg is AppNotification {
6
+ return (
7
+ msg.event_type === APP_NOTIFICATION_EVENT_TYPE &&
8
+ typeof msg["user_app_id"] === "string" &&
9
+ typeof msg["payload"] === "object" &&
10
+ msg["payload"] !== null
11
+ );
12
+ }
13
+
14
+ /**
15
+ * useAppNotificationSubscription
16
+ *
17
+ * Convenience wrapper around `useWebSocketSubscription` that only invokes the handler
18
+ * for `event_type === "USER_APP_NOTIFICATION"` messages. All other WebSocket events are ignored.
19
+ *
20
+ * @param {(msg: AppNotification) => void} handler
21
+ * Callback invoked for each app-targeted notification.
22
+ *
23
+ * Example:
24
+ * ```ts
25
+ * useAppNotificationSubscription((msg) => {
26
+ * queryClient.invalidateQueries({ queryKey: ["portfolios"] });
27
+ * });
28
+ * ```
29
+ */
30
+ export const useAppNotificationSubscription = (handler: (msg: AppNotification) => void) => {
31
+ useWebSocketSubscription((msg: WebSocketNotification) => {
32
+ if (isAppNotification(msg)) {
33
+ handler(msg);
34
+ }
35
+ });
36
+ };
@@ -0,0 +1,18 @@
1
+ import { useContext } from "react";
2
+
3
+ import { WebSocketContext } from "../..";
4
+
5
+ /**
6
+ * useWebSocket
7
+ *
8
+ * Convenience hook that reads the WebSocket API from `WebSocketContext`.
9
+ *
10
+ * Returns: `{ subscribe, lastMessage, status }` (see `WebSocketContextType`).
11
+ *
12
+ * @throws {Error} If used outside of `<WebSocketProvider>`.
13
+ */
14
+ export const useWebSocket = () => {
15
+ const context = useContext(WebSocketContext);
16
+ if (!context) throw new Error("useWebSocket must be used within <WebSocketProvider>.");
17
+ return context;
18
+ };
@@ -0,0 +1,45 @@
1
+ import { useEffect, useRef } from "react";
2
+
3
+ import { useWebSocket } from "../useWebSocket";
4
+ import type { WebSocketNotification } from "../../types";
5
+
6
+ /**
7
+ * useWebSocketSubscription
8
+ *
9
+ * High-level helper hook that subscribes to all WebSocket notifications on mount
10
+ * and unsubscribes on unmount.
11
+ *
12
+ * Why this exists:
13
+ * - Enforces the correct subscription pattern (`useEffect` + cleanup).
14
+ * - Prevents accidental duplicate subscriptions from re-renders.
15
+ * - Uses a ref-backed handler so the subscription is not recreated when the callback
16
+ * identity changes — the latest handler is always called without re-subscribing.
17
+ *
18
+ * Filtering (e.g. by `msg.event_type`) is intentionally left to the consumer.
19
+ * See `useAppNotificationSubscription` for a typed convenience wrapper.
20
+ *
21
+ * @param {(msg: WebSocketNotification) => void} handler
22
+ * Callback invoked for every received notification.
23
+ *
24
+ * Example:
25
+ * ```ts
26
+ * useWebSocketSubscription((msg) => {
27
+ * if (msg.event_type === "WORKFLOW_EXECUTION_COMPLETED") {
28
+ * queryClient.invalidateQueries({ queryKey: ["workflows"] });
29
+ * }
30
+ * });
31
+ * ```
32
+ */
33
+ export const useWebSocketSubscription = (handler: (msg: WebSocketNotification) => void) => {
34
+ const { subscribe } = useWebSocket();
35
+ const handlerRef = useRef(handler);
36
+
37
+ useEffect(() => {
38
+ handlerRef.current = handler;
39
+ });
40
+
41
+ useEffect(() => {
42
+ const unsubscribe = subscribe((msg: WebSocketNotification) => handlerRef.current(msg));
43
+ return unsubscribe;
44
+ }, [subscribe]);
45
+ };
@@ -0,0 +1,5 @@
1
+ import { createContext } from "react";
2
+
3
+ import type { WebSocketContextType } from "./types";
4
+
5
+ export const WebSocketContext = createContext<WebSocketContextType | null>(null);