@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.
- package/LICENSE +21 -0
- package/README.md +128 -0
- package/dist/EveryskApp.d.ts +73 -0
- package/dist/EveryskApp.d.ts.map +1 -0
- package/dist/EveryskApp.js +66 -0
- package/dist/EveryskApp.js.map +1 -0
- package/dist/agGrid/agGridTheme.d.ts +77 -0
- package/dist/agGrid/agGridTheme.d.ts.map +1 -0
- package/dist/agGrid/agGridTheme.js +88 -0
- package/dist/agGrid/agGridTheme.js.map +1 -0
- package/dist/agGrid/index.d.ts +4 -0
- package/dist/agGrid/index.d.ts.map +1 -0
- package/dist/agGrid/index.js +3 -0
- package/dist/api/datastore.d.ts +68 -0
- package/dist/api/datastore.d.ts.map +1 -0
- package/dist/api/datastore.js +125 -0
- package/dist/api/datastore.js.map +1 -0
- package/dist/api/entityQuery.d.ts +78 -0
- package/dist/api/entityQuery.d.ts.map +1 -0
- package/dist/api/entityQuery.js +100 -0
- package/dist/api/entityQuery.js.map +1 -0
- package/dist/api/file.d.ts +70 -0
- package/dist/api/file.d.ts.map +1 -0
- package/dist/api/file.js +126 -0
- package/dist/api/file.js.map +1 -0
- package/dist/api/portfolio.d.ts +67 -0
- package/dist/api/portfolio.d.ts.map +1 -0
- package/dist/api/portfolio.js +125 -0
- package/dist/api/portfolio.js.map +1 -0
- package/dist/api/profile.d.ts +40 -0
- package/dist/api/profile.d.ts.map +1 -0
- package/dist/api/profile.js +71 -0
- package/dist/api/profile.js.map +1 -0
- package/dist/api/websocketsConfig.d.ts +13 -0
- package/dist/api/websocketsConfig.d.ts.map +1 -0
- package/dist/api/websocketsConfig.js +25 -0
- package/dist/api/websocketsConfig.js.map +1 -0
- package/dist/api/workflow.d.ts +154 -0
- package/dist/api/workflow.d.ts.map +1 -0
- package/dist/api/workflow.js +289 -0
- package/dist/api/workflow.js.map +1 -0
- package/dist/api/workspace.d.ts +29 -0
- package/dist/api/workspace.d.ts.map +1 -0
- package/dist/api/workspace.js +54 -0
- package/dist/api/workspace.js.map +1 -0
- package/dist/components/ui/EveryskIcon/index.d.ts +5 -0
- package/dist/components/ui/EveryskIcon/index.d.ts.map +1 -0
- package/dist/components/ui/EveryskIcon/index.js +25 -0
- package/dist/components/ui/EveryskIcon/index.js.map +1 -0
- package/dist/components/ui/Footer/index.d.ts +5 -0
- package/dist/components/ui/Footer/index.d.ts.map +1 -0
- package/dist/components/ui/Footer/index.js +23 -0
- package/dist/components/ui/Footer/index.js.map +1 -0
- package/dist/components/ui/GlobalLoading/index.d.ts +8 -0
- package/dist/components/ui/GlobalLoading/index.d.ts.map +1 -0
- package/dist/components/ui/GlobalLoading/index.js +42 -0
- package/dist/components/ui/GlobalLoading/index.js.map +1 -0
- package/dist/components/ui/PageContainer/index.d.ts +7 -0
- package/dist/components/ui/PageContainer/index.d.ts.map +1 -0
- package/dist/components/ui/PageContainer/index.js +20 -0
- package/dist/components/ui/PageContainer/index.js.map +1 -0
- package/dist/components/ui/Toolbar/index.d.ts +5 -0
- package/dist/components/ui/Toolbar/index.d.ts.map +1 -0
- package/dist/components/ui/Toolbar/index.js +32 -0
- package/dist/components/ui/Toolbar/index.js.map +1 -0
- package/dist/contexts/agGridLicenseContext/provider.d.ts +51 -0
- package/dist/contexts/agGridLicenseContext/provider.d.ts.map +1 -0
- package/dist/contexts/agGridLicenseContext/provider.js +58 -0
- package/dist/contexts/agGridLicenseContext/provider.js.map +1 -0
- package/dist/contexts/appAlertContext/index.d.ts +3 -0
- package/dist/contexts/appAlertContext/index.d.ts.map +1 -0
- package/dist/contexts/appAlertContext/index.js +7 -0
- package/dist/contexts/appAlertContext/index.js.map +1 -0
- package/dist/contexts/appAlertContext/provider.d.ts +40 -0
- package/dist/contexts/appAlertContext/provider.d.ts.map +1 -0
- package/dist/contexts/appAlertContext/provider.js +96 -0
- package/dist/contexts/appAlertContext/provider.js.map +1 -0
- package/dist/contexts/appAlertContext/types.d.ts +15 -0
- package/dist/contexts/appAlertContext/types.d.ts.map +1 -0
- package/dist/contexts/appAlertContext/useAppAlert.d.ts +30 -0
- package/dist/contexts/appAlertContext/useAppAlert.d.ts.map +1 -0
- package/dist/contexts/appAlertContext/useAppAlert.js +40 -0
- package/dist/contexts/appAlertContext/useAppAlert.js.map +1 -0
- package/dist/contexts/appConfigContext/index.d.ts +3 -0
- package/dist/contexts/appConfigContext/index.d.ts.map +1 -0
- package/dist/contexts/appConfigContext/index.js +7 -0
- package/dist/contexts/appConfigContext/index.js.map +1 -0
- package/dist/contexts/appConfigContext/provider.d.ts +45 -0
- package/dist/contexts/appConfigContext/provider.d.ts.map +1 -0
- package/dist/contexts/appConfigContext/provider.js +63 -0
- package/dist/contexts/appConfigContext/provider.js.map +1 -0
- package/dist/contexts/appConfigContext/types.d.ts +28 -0
- package/dist/contexts/appConfigContext/types.d.ts.map +1 -0
- package/dist/contexts/appConfigContext/useAppConfig.d.ts +20 -0
- package/dist/contexts/appConfigContext/useAppConfig.d.ts.map +1 -0
- package/dist/contexts/appConfigContext/useAppConfig.js +30 -0
- package/dist/contexts/appConfigContext/useAppConfig.js.map +1 -0
- package/dist/contexts/webSocketContext/constants.d.ts +4 -0
- package/dist/contexts/webSocketContext/constants.d.ts.map +1 -0
- package/dist/contexts/webSocketContext/constants.js +8 -0
- package/dist/contexts/webSocketContext/constants.js.map +1 -0
- package/dist/contexts/webSocketContext/handler.d.ts +43 -0
- package/dist/contexts/webSocketContext/handler.d.ts.map +1 -0
- package/dist/contexts/webSocketContext/handler.js +87 -0
- package/dist/contexts/webSocketContext/handler.js.map +1 -0
- package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.d.ts +19 -0
- package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.d.ts.map +1 -0
- package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.js +31 -0
- package/dist/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.js.map +1 -0
- package/dist/contexts/webSocketContext/hooks/useWebSocket/index.d.ts +11 -0
- package/dist/contexts/webSocketContext/hooks/useWebSocket/index.d.ts.map +1 -0
- package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js +21 -0
- package/dist/contexts/webSocketContext/hooks/useWebSocket/index.js.map +1 -0
- package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.d.ts +30 -0
- package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.d.ts.map +1 -0
- package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.js +44 -0
- package/dist/contexts/webSocketContext/hooks/useWebSocketSubscription/index.js.map +1 -0
- package/dist/contexts/webSocketContext/index.d.ts +3 -0
- package/dist/contexts/webSocketContext/index.d.ts.map +1 -0
- package/dist/contexts/webSocketContext/index.js +7 -0
- package/dist/contexts/webSocketContext/index.js.map +1 -0
- package/dist/contexts/webSocketContext/provider.d.ts +39 -0
- package/dist/contexts/webSocketContext/provider.d.ts.map +1 -0
- package/dist/contexts/webSocketContext/provider.js +121 -0
- package/dist/contexts/webSocketContext/provider.js.map +1 -0
- package/dist/contexts/webSocketContext/types.d.ts +41 -0
- package/dist/contexts/webSocketContext/types.d.ts.map +1 -0
- package/dist/datastore/index.d.ts +7 -0
- package/dist/datastore/index.d.ts.map +1 -0
- package/dist/file/index.d.ts +6 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/hooks/datastore/useDatastoreMutations.d.ts +151 -0
- package/dist/hooks/datastore/useDatastoreMutations.d.ts.map +1 -0
- package/dist/hooks/datastore/useDatastoreMutations.js +198 -0
- package/dist/hooks/datastore/useDatastoreMutations.js.map +1 -0
- package/dist/hooks/datastore/useFetchDatastore.d.ts +205 -0
- package/dist/hooks/datastore/useFetchDatastore.d.ts.map +1 -0
- package/dist/hooks/datastore/useFetchDatastore.js +85 -0
- package/dist/hooks/datastore/useFetchDatastore.js.map +1 -0
- package/dist/hooks/datastore/useFetchDatastores.d.ts +70 -0
- package/dist/hooks/datastore/useFetchDatastores.d.ts.map +1 -0
- package/dist/hooks/datastore/useFetchDatastores.js +105 -0
- package/dist/hooks/datastore/useFetchDatastores.js.map +1 -0
- package/dist/hooks/file/useFetchFile.d.ts +212 -0
- package/dist/hooks/file/useFetchFile.d.ts.map +1 -0
- package/dist/hooks/file/useFetchFile.js +87 -0
- package/dist/hooks/file/useFetchFile.js.map +1 -0
- package/dist/hooks/file/useFetchFiles.d.ts +60 -0
- package/dist/hooks/file/useFetchFiles.d.ts.map +1 -0
- package/dist/hooks/file/useFetchFiles.js +89 -0
- package/dist/hooks/file/useFetchFiles.js.map +1 -0
- package/dist/hooks/file/useFileMutations.d.ts +161 -0
- package/dist/hooks/file/useFileMutations.d.ts.map +1 -0
- package/dist/hooks/file/useFileMutations.js +208 -0
- package/dist/hooks/file/useFileMutations.js.map +1 -0
- package/dist/hooks/portfolio/useFetchPortfolio.d.ts +210 -0
- package/dist/hooks/portfolio/useFetchPortfolio.d.ts.map +1 -0
- package/dist/hooks/portfolio/useFetchPortfolio.js +85 -0
- package/dist/hooks/portfolio/useFetchPortfolio.js.map +1 -0
- package/dist/hooks/portfolio/useFetchPortfolios.d.ts +60 -0
- package/dist/hooks/portfolio/useFetchPortfolios.d.ts.map +1 -0
- package/dist/hooks/portfolio/useFetchPortfolios.js +89 -0
- package/dist/hooks/portfolio/useFetchPortfolios.js.map +1 -0
- package/dist/hooks/portfolio/usePortfolioMutations.d.ts +171 -0
- package/dist/hooks/portfolio/usePortfolioMutations.d.ts.map +1 -0
- package/dist/hooks/portfolio/usePortfolioMutations.js +218 -0
- package/dist/hooks/portfolio/usePortfolioMutations.js.map +1 -0
- package/dist/hooks/profile/useFetchProfile.d.ts +206 -0
- package/dist/hooks/profile/useFetchProfile.d.ts.map +1 -0
- package/dist/hooks/profile/useFetchProfile.js +70 -0
- package/dist/hooks/profile/useFetchProfile.js.map +1 -0
- package/dist/hooks/useAxios.d.ts +40 -0
- package/dist/hooks/useAxios.d.ts.map +1 -0
- package/dist/hooks/useAxios.js +76 -0
- package/dist/hooks/useAxios.js.map +1 -0
- package/dist/hooks/workflow/useFetchWorkerExecution.d.ts +198 -0
- package/dist/hooks/workflow/useFetchWorkerExecution.d.ts.map +1 -0
- package/dist/hooks/workflow/useFetchWorkerExecution.js +69 -0
- package/dist/hooks/workflow/useFetchWorkerExecution.js.map +1 -0
- package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts +52 -0
- package/dist/hooks/workflow/useFetchWorkerExecutions.d.ts.map +1 -0
- package/dist/hooks/workflow/useFetchWorkerExecutions.js +83 -0
- package/dist/hooks/workflow/useFetchWorkerExecutions.js.map +1 -0
- package/dist/hooks/workflow/useFetchWorkflow.d.ts +195 -0
- package/dist/hooks/workflow/useFetchWorkflow.d.ts.map +1 -0
- package/dist/hooks/workflow/useFetchWorkflow.js +70 -0
- package/dist/hooks/workflow/useFetchWorkflow.js.map +1 -0
- package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts +198 -0
- package/dist/hooks/workflow/useFetchWorkflowExecution.d.ts.map +1 -0
- package/dist/hooks/workflow/useFetchWorkflowExecution.js +69 -0
- package/dist/hooks/workflow/useFetchWorkflowExecution.js.map +1 -0
- package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts +49 -0
- package/dist/hooks/workflow/useFetchWorkflowExecutions.d.ts.map +1 -0
- package/dist/hooks/workflow/useFetchWorkflowExecutions.js +77 -0
- package/dist/hooks/workflow/useFetchWorkflowExecutions.js.map +1 -0
- package/dist/hooks/workflow/useFetchWorkflows.d.ts +47 -0
- package/dist/hooks/workflow/useFetchWorkflows.d.ts.map +1 -0
- package/dist/hooks/workflow/useFetchWorkflows.js +67 -0
- package/dist/hooks/workflow/useFetchWorkflows.js.map +1 -0
- package/dist/hooks/workflow/useRunWorkflow.d.ts +30 -0
- package/dist/hooks/workflow/useRunWorkflow.d.ts.map +1 -0
- package/dist/hooks/workflow/useRunWorkflow.js +50 -0
- package/dist/hooks/workflow/useRunWorkflow.js.map +1 -0
- package/dist/hooks/workspace/useFetchWorkspace.d.ts +197 -0
- package/dist/hooks/workspace/useFetchWorkspace.d.ts.map +1 -0
- package/dist/hooks/workspace/useFetchWorkspace.js +65 -0
- package/dist/hooks/workspace/useFetchWorkspace.js.map +1 -0
- package/dist/hooks/workspace/useFetchWorkspaces.d.ts +46 -0
- package/dist/hooks/workspace/useFetchWorkspaces.d.ts.map +1 -0
- package/dist/hooks/workspace/useFetchWorkspaces.js +66 -0
- package/dist/hooks/workspace/useFetchWorkspaces.js.map +1 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +50 -0
- package/dist/lib/datastoreTable.d.ts +126 -0
- package/dist/lib/datastoreTable.d.ts.map +1 -0
- package/dist/lib/datastoreTable.js +146 -0
- package/dist/lib/datastoreTable.js.map +1 -0
- package/dist/lib/queryClient.d.ts +24 -0
- package/dist/lib/queryClient.d.ts.map +1 -0
- package/dist/lib/queryClient.js +48 -0
- package/dist/lib/queryClient.js.map +1 -0
- package/dist/portfolio/index.d.ts +6 -0
- package/dist/portfolio/index.d.ts.map +1 -0
- package/dist/profile/index.d.ts +4 -0
- package/dist/profile/index.d.ts.map +1 -0
- package/dist/socket/index.d.ts +10 -0
- package/dist/socket/index.d.ts.map +1 -0
- package/dist/socket/index.js +9 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +2 -0
- package/dist/test/mocks/agGridEnterprise.d.ts +38 -0
- package/dist/test/mocks/agGridEnterprise.d.ts.map +1 -0
- package/dist/test/mocks/agGridEnterprise.js +43 -0
- package/dist/test/mocks/agGridEnterprise.js.map +1 -0
- package/dist/test/mocks/agGridReact.d.ts +42 -0
- package/dist/test/mocks/agGridReact.d.ts.map +1 -0
- package/dist/test/mocks/agGridReact.js +47 -0
- package/dist/test/mocks/agGridReact.js.map +1 -0
- package/dist/test/mocks/index.d.ts +5 -0
- package/dist/test/mocks/index.d.ts.map +1 -0
- package/dist/test/mocks/index.js +4 -0
- package/dist/test/mocks/socketIoClient.d.ts +45 -0
- package/dist/test/mocks/socketIoClient.d.ts.map +1 -0
- package/dist/test/mocks/socketIoClient.js +54 -0
- package/dist/test/mocks/socketIoClient.js.map +1 -0
- package/dist/test/renderWithProviders.d.ts +107 -0
- package/dist/test/renderWithProviders.d.ts.map +1 -0
- package/dist/test/renderWithProviders.js +85 -0
- package/dist/test/renderWithProviders.js.map +1 -0
- package/dist/test/setup.d.ts +2 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +25 -0
- package/dist/test/setup.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +12 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +22 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/index.d.ts +9 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/overrides/index.d.ts +7 -0
- package/dist/theme/overrides/index.d.ts.map +1 -0
- package/dist/theme/overrides/index.js +31 -0
- package/dist/theme/overrides/index.js.map +1 -0
- package/dist/theme/overrides/muiButton.d.ts +3 -0
- package/dist/theme/overrides/muiButton.d.ts.map +1 -0
- package/dist/theme/overrides/muiButton.js +6 -0
- package/dist/theme/overrides/muiButton.js.map +1 -0
- package/dist/theme/overrides/muiCssBaseline.d.ts +31 -0
- package/dist/theme/overrides/muiCssBaseline.d.ts.map +1 -0
- package/dist/theme/overrides/muiCssBaseline.js +27 -0
- package/dist/theme/overrides/muiCssBaseline.js.map +1 -0
- package/dist/theme/overrides/muiDatePicker.d.ts +10 -0
- package/dist/theme/overrides/muiDatePicker.d.ts.map +1 -0
- package/dist/theme/overrides/muiDatePicker.js +6 -0
- package/dist/theme/overrides/muiDatePicker.js.map +1 -0
- package/dist/theme/overrides/muiFormControl.d.ts +3 -0
- package/dist/theme/overrides/muiFormControl.d.ts.map +1 -0
- package/dist/theme/overrides/muiFormControl.js +6 -0
- package/dist/theme/overrides/muiFormControl.js.map +1 -0
- package/dist/theme/overrides/muiIconButton.d.ts +3 -0
- package/dist/theme/overrides/muiIconButton.d.ts.map +1 -0
- package/dist/theme/overrides/muiIconButton.js +6 -0
- package/dist/theme/overrides/muiIconButton.js.map +1 -0
- package/dist/theme/overrides/muiSelect.d.ts +3 -0
- package/dist/theme/overrides/muiSelect.d.ts.map +1 -0
- package/dist/theme/overrides/muiSelect.js +6 -0
- package/dist/theme/overrides/muiSelect.js.map +1 -0
- package/dist/theme/overrides/muiSvgIcon.d.ts +3 -0
- package/dist/theme/overrides/muiSvgIcon.d.ts.map +1 -0
- package/dist/theme/overrides/muiSvgIcon.js +6 -0
- package/dist/theme/overrides/muiSvgIcon.js.map +1 -0
- package/dist/theme/overrides/muiTextField.d.ts +3 -0
- package/dist/theme/overrides/muiTextField.d.ts.map +1 -0
- package/dist/theme/overrides/muiTextField.js +6 -0
- package/dist/theme/overrides/muiTextField.js.map +1 -0
- package/dist/theme/overrides/muiToggleButton.d.ts +3 -0
- package/dist/theme/overrides/muiToggleButton.d.ts.map +1 -0
- package/dist/theme/overrides/muiToggleButton.js +6 -0
- package/dist/theme/overrides/muiToggleButton.js.map +1 -0
- package/dist/theme/overrides/muiToggleButtonGroup.d.ts +3 -0
- package/dist/theme/overrides/muiToggleButtonGroup.d.ts.map +1 -0
- package/dist/theme/overrides/muiToggleButtonGroup.js +6 -0
- package/dist/theme/overrides/muiToggleButtonGroup.js.map +1 -0
- package/dist/theme/themes/DefaultDark.d.ts +7 -0
- package/dist/theme/themes/DefaultDark.d.ts.map +1 -0
- package/dist/theme/themes/DefaultDark.js +15 -0
- package/dist/theme/themes/DefaultDark.js.map +1 -0
- package/dist/theme/themes/DefaultLight.d.ts +7 -0
- package/dist/theme/themes/DefaultLight.d.ts.map +1 -0
- package/dist/theme/themes/DefaultLight.js +15 -0
- package/dist/theme/themes/DefaultLight.js.map +1 -0
- package/dist/theme/themes/EveryskDark.d.ts +15 -0
- package/dist/theme/themes/EveryskDark.d.ts.map +1 -0
- package/dist/theme/themes/EveryskDark.js +63 -0
- package/dist/theme/themes/EveryskDark.js.map +1 -0
- package/dist/theme/themes/EveryskLight.d.ts +21 -0
- package/dist/theme/themes/EveryskLight.d.ts.map +1 -0
- package/dist/theme/themes/EveryskLight.js +69 -0
- package/dist/theme/themes/EveryskLight.js.map +1 -0
- package/dist/theme/themes/MidnightEmber.d.ts +3 -0
- package/dist/theme/themes/MidnightEmber.d.ts.map +1 -0
- package/dist/theme/themes/MidnightEmber.js +31 -0
- package/dist/theme/themes/MidnightEmber.js.map +1 -0
- package/dist/theme/themes/index.d.ts +17 -0
- package/dist/theme/themes/index.d.ts.map +1 -0
- package/dist/theme/themes/index.js +32 -0
- package/dist/theme/themes/index.js.map +1 -0
- package/dist/types/anyRecord.d.ts +4 -0
- package/dist/types/anyRecord.d.ts.map +1 -0
- package/dist/types/datastore.d.ts +26 -0
- package/dist/types/datastore.d.ts.map +1 -0
- package/dist/types/entityQuery.d.ts +47 -0
- package/dist/types/entityQuery.d.ts.map +1 -0
- package/dist/types/file.d.ts +29 -0
- package/dist/types/file.d.ts.map +1 -0
- package/dist/types/portfolio.d.ts +77 -0
- package/dist/types/portfolio.d.ts.map +1 -0
- package/dist/types/profile.d.ts +37 -0
- package/dist/types/profile.d.ts.map +1 -0
- package/dist/types/workflow.d.ts +68 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workspace.d.ts +13 -0
- package/dist/types/workspace.d.ts.map +1 -0
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/workflow/index.d.ts +10 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workspace/index.d.ts +5 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/package.json +148 -0
- package/src/EveryskApp.tsx +108 -0
- package/src/agGrid/agGridTheme.ts +113 -0
- package/src/agGrid/index.ts +15 -0
- package/src/api/datastore.ts +175 -0
- package/src/api/entityQuery.ts +101 -0
- package/src/api/file.ts +174 -0
- package/src/api/portfolio.ts +190 -0
- package/src/api/profile.ts +80 -0
- package/src/api/websocketsConfig.ts +32 -0
- package/src/api/workflow.ts +427 -0
- package/src/api/workspace.ts +72 -0
- package/src/components/ui/EveryskIcon/index.tsx +24 -0
- package/src/components/ui/Footer/index.tsx +30 -0
- package/src/components/ui/GlobalLoading/index.tsx +38 -0
- package/src/components/ui/PageContainer/index.tsx +14 -0
- package/src/components/ui/Toolbar/index.tsx +44 -0
- package/src/contexts/agGridLicenseContext/provider.tsx +63 -0
- package/src/contexts/appAlertContext/index.tsx +4 -0
- package/src/contexts/appAlertContext/provider.tsx +92 -0
- package/src/contexts/appAlertContext/types.ts +17 -0
- package/src/contexts/appAlertContext/useAppAlert.ts +39 -0
- package/src/contexts/appConfigContext/index.tsx +4 -0
- package/src/contexts/appConfigContext/provider.tsx +67 -0
- package/src/contexts/appConfigContext/types.ts +28 -0
- package/src/contexts/appConfigContext/useAppConfig.ts +30 -0
- package/src/contexts/webSocketContext/constants.ts +3 -0
- package/src/contexts/webSocketContext/handler.ts +108 -0
- package/src/contexts/webSocketContext/hooks/useAppNotificationSubscription/index.ts +36 -0
- package/src/contexts/webSocketContext/hooks/useWebSocket/index.ts +18 -0
- package/src/contexts/webSocketContext/hooks/useWebSocketSubscription/index.ts +45 -0
- package/src/contexts/webSocketContext/index.tsx +5 -0
- package/src/contexts/webSocketContext/provider.tsx +125 -0
- package/src/contexts/webSocketContext/types.ts +50 -0
- package/src/datastore/index.ts +14 -0
- package/src/file/index.ts +13 -0
- package/src/hooks/datastore/useDatastoreMutations.ts +221 -0
- package/src/hooks/datastore/useFetchDatastore.ts +95 -0
- package/src/hooks/datastore/useFetchDatastores.ts +162 -0
- package/src/hooks/file/useFetchFile.ts +93 -0
- package/src/hooks/file/useFetchFiles.ts +109 -0
- package/src/hooks/file/useFileMutations.ts +240 -0
- package/src/hooks/portfolio/useFetchPortfolio.ts +94 -0
- package/src/hooks/portfolio/useFetchPortfolios.ts +109 -0
- package/src/hooks/portfolio/usePortfolioMutations.ts +250 -0
- package/src/hooks/profile/useFetchProfile.ts +93 -0
- package/src/hooks/useAxios.ts +98 -0
- package/src/hooks/workflow/useFetchWorkerExecution.ts +78 -0
- package/src/hooks/workflow/useFetchWorkerExecutions.ts +98 -0
- package/src/hooks/workflow/useFetchWorkflow.ts +76 -0
- package/src/hooks/workflow/useFetchWorkflowExecution.ts +79 -0
- package/src/hooks/workflow/useFetchWorkflowExecutions.ts +95 -0
- package/src/hooks/workflow/useFetchWorkflows.ts +84 -0
- package/src/hooks/workflow/useRunWorkflow.ts +62 -0
- package/src/hooks/workspace/useFetchWorkspace.ts +78 -0
- package/src/hooks/workspace/useFetchWorkspaces.ts +86 -0
- package/src/index.ts +72 -0
- package/src/lib/datastoreTable.ts +159 -0
- package/src/lib/queryClient.ts +60 -0
- package/src/portfolio/index.ts +13 -0
- package/src/profile/index.ts +11 -0
- package/src/socket/index.ts +19 -0
- package/src/test/index.ts +10 -0
- package/src/test/mocks/agGridEnterprise.ts +45 -0
- package/src/test/mocks/agGridReact.tsx +61 -0
- package/src/test/mocks/index.ts +22 -0
- package/src/test/mocks/socketIoClient.ts +78 -0
- package/src/test/renderWithProviders.tsx +114 -0
- package/src/test/setup.ts +46 -0
- package/src/theme/ThemeProvider.tsx +33 -0
- package/src/theme/index.ts +15 -0
- package/src/theme/overrides/index.ts +31 -0
- package/src/theme/overrides/muiButton.ts +7 -0
- package/src/theme/overrides/muiCssBaseline.ts +35 -0
- package/src/theme/overrides/muiDatePicker.ts +5 -0
- package/src/theme/overrides/muiFormControl.ts +7 -0
- package/src/theme/overrides/muiIconButton.ts +7 -0
- package/src/theme/overrides/muiSelect.ts +7 -0
- package/src/theme/overrides/muiSvgIcon.ts +7 -0
- package/src/theme/overrides/muiTextField.ts +7 -0
- package/src/theme/overrides/muiToggleButton.ts +7 -0
- package/src/theme/overrides/muiToggleButtonGroup.ts +7 -0
- package/src/theme/themes/DefaultDark.ts +14 -0
- package/src/theme/themes/DefaultLight.ts +14 -0
- package/src/theme/themes/EveryskDark.ts +62 -0
- package/src/theme/themes/EveryskLight.ts +68 -0
- package/src/theme/themes/MidnightEmber.ts +30 -0
- package/src/theme/themes/index.ts +35 -0
- package/src/types/anyRecord.ts +4 -0
- package/src/types/datastore.ts +33 -0
- package/src/types/entityQuery.ts +64 -0
- package/src/types/file.ts +32 -0
- package/src/types/portfolio.ts +81 -0
- package/src/types/profile.ts +39 -0
- package/src/types/workflow.ts +76 -0
- package/src/types/workspace.ts +15 -0
- package/src/ui/index.ts +14 -0
- package/src/workflow/index.ts +17 -0
- package/src/workspace/index.ts +12 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
|
|
5
|
+
import { useAxios } from "@/hooks/useAxios";
|
|
6
|
+
import { useAppAlert } from "@/contexts/appAlertContext/useAppAlert";
|
|
7
|
+
import { getWorkflowExecution } from "@/api/workflow";
|
|
8
|
+
import type { WorkflowExecution } from "@/types/workflow";
|
|
9
|
+
import type { EntityQueryOptions } from "@/types/entityQuery";
|
|
10
|
+
|
|
11
|
+
export type FetchWorkflowExecutionProps<TData = WorkflowExecution, TSelected = TData> = {
|
|
12
|
+
workflowId: string;
|
|
13
|
+
workflowExecutionId: string;
|
|
14
|
+
workspace: string;
|
|
15
|
+
queryOptions?: EntityQueryOptions<TData, TSelected>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const defaultQueryOptions: EntityQueryOptions<WorkflowExecution> = {
|
|
19
|
+
refetchOnMount: "always",
|
|
20
|
+
staleTime: 0,
|
|
21
|
+
gcTime: 0,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* useFetchWorkflowExecution
|
|
26
|
+
*
|
|
27
|
+
* Data-fetching hook built on TanStack Query to retrieve a single workflow execution.
|
|
28
|
+
*
|
|
29
|
+
* It also:
|
|
30
|
+
* - builds a stable React Query `queryKey` that can be reused by mutation hooks for cache invalidation
|
|
31
|
+
* - triggers an error alert via `useAppAlert` whenever `query.error` is present
|
|
32
|
+
*
|
|
33
|
+
* @param workflowId - Workflow identifier the execution belongs to (required).
|
|
34
|
+
* @param workflowExecutionId - Workflow execution identifier (required).
|
|
35
|
+
* @param workspace - Workspace the workflow belongs to (required).
|
|
36
|
+
* @param queryOptions - TanStack Query options passed through to `useQuery` (e.g., enabled, staleTime, gcTime, etc.).
|
|
37
|
+
*
|
|
38
|
+
* @returns TanStack Query result extended with `queryKey`.
|
|
39
|
+
*
|
|
40
|
+
* Example:
|
|
41
|
+
* ```ts
|
|
42
|
+
* const { data, isLoading } = useFetchWorkflowExecution({
|
|
43
|
+
* workflowId: "wf-123",
|
|
44
|
+
* workflowExecutionId: "exec-456",
|
|
45
|
+
* workspace: "main",
|
|
46
|
+
* });
|
|
47
|
+
* // data -> WorkflowExecution
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export const useFetchWorkflowExecution = ({ workflowId, workflowExecutionId, workspace, queryOptions = defaultQueryOptions }: FetchWorkflowExecutionProps) => {
|
|
51
|
+
|
|
52
|
+
const { api } = useAxios();
|
|
53
|
+
const { showAlert } = useAppAlert();
|
|
54
|
+
|
|
55
|
+
const queryKey = ["workflow_execution", workflowId, workflowExecutionId, workspace];
|
|
56
|
+
|
|
57
|
+
const query = useQuery<WorkflowExecution>({
|
|
58
|
+
queryKey,
|
|
59
|
+
queryFn: async () => {
|
|
60
|
+
const execution = await getWorkflowExecution(api, workflowId, workflowExecutionId, workspace);
|
|
61
|
+
return execution;
|
|
62
|
+
},
|
|
63
|
+
...queryOptions ?? {}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (!query.error) return;
|
|
68
|
+
|
|
69
|
+
showAlert({
|
|
70
|
+
severity: "error",
|
|
71
|
+
message: query.error.message,
|
|
72
|
+
});
|
|
73
|
+
}, [query.error, showAlert]);
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
...query,
|
|
77
|
+
queryKey,
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useInfiniteQuery, type UseInfiniteQueryOptions, type QueryKey } from "@tanstack/react-query";
|
|
3
|
+
|
|
4
|
+
import { useAxios } from "@/hooks/useAxios";
|
|
5
|
+
import { listWorkflowExecutions } from "@/api/workflow";
|
|
6
|
+
import type { FetchEntitiesParams } from "@/types/entityQuery";
|
|
7
|
+
import { buildQueryKey, buildQueryObject } from "@/api/entityQuery";
|
|
8
|
+
import type { WorkflowExecution, WorkflowExecutionListResponse } from "@/types/workflow";
|
|
9
|
+
|
|
10
|
+
type PageToken = string | null;
|
|
11
|
+
|
|
12
|
+
type InfiniteOptions<TData> = Omit<UseInfiniteQueryOptions<WorkflowExecutionListResponse, Error, TData, QueryKey, PageToken>, "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
13
|
+
|
|
14
|
+
export type FetchInfiniteWorkflowExecutionProps = FetchEntitiesParams<WorkflowExecution[], InfiniteOptions<WorkflowExecution[]>> & {
|
|
15
|
+
workflowId: string;
|
|
16
|
+
pageSize?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const defaultQueryOptions: InfiniteOptions<WorkflowExecution[]> = {
|
|
20
|
+
refetchOnMount: "always",
|
|
21
|
+
staleTime: 0,
|
|
22
|
+
gcTime: 0,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* useFetchWorkflowExecutions
|
|
27
|
+
*
|
|
28
|
+
* Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
|
|
29
|
+
* workflow executions for a given workflow with cursor-based pagination.
|
|
30
|
+
*
|
|
31
|
+
* Automatically flattens all pages into a single `WorkflowExecution[]` via `select`.
|
|
32
|
+
*
|
|
33
|
+
* Note: `query.data` returns a flat `WorkflowExecution[]` with all fetched items merged across pages.
|
|
34
|
+
*
|
|
35
|
+
* @param workflowId - Workflow identifier whose executions to fetch (required).
|
|
36
|
+
* @param filters - Filters applied to every page request. Must include a `workspace` filter.
|
|
37
|
+
* @param order - Sorting applied to every page request.
|
|
38
|
+
* @param projection - Single field to project: `"field"` returns only that field (others come
|
|
39
|
+
* back null), `"-field"` returns every field except that one. One field only — lists 500. Omitted when empty.
|
|
40
|
+
* @param pageSize - Number of executions to fetch per page. Defaults to `10`.
|
|
41
|
+
* @param queryOptions - TanStack Query options passed through to `useInfiniteQuery`.
|
|
42
|
+
*
|
|
43
|
+
* @returns
|
|
44
|
+
* - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
|
|
45
|
+
* - `queryKey`: the cache key used by React Query
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const { query } = useFetchWorkflowExecutions({
|
|
50
|
+
* workflowId: "wf-123",
|
|
51
|
+
* filters: [{ field: "workspace", value: "main" }],
|
|
52
|
+
* pageSize: 20,
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* // Flat list of all fetched executions
|
|
56
|
+
* const executions = query.data ?? [];
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export function useFetchWorkflowExecutions({ workflowId, filters = [], order = [], projection = "", pageSize = 10, queryOptions }: FetchInfiniteWorkflowExecutionProps) {
|
|
60
|
+
const { api } = useAxios();
|
|
61
|
+
|
|
62
|
+
const queryKey = buildQueryKey(["workflow_executions", workflowId], filters);
|
|
63
|
+
|
|
64
|
+
const mergedQueryOptions = useMemo<InfiniteOptions<WorkflowExecution[]>>(() => ({
|
|
65
|
+
...defaultQueryOptions,
|
|
66
|
+
...(queryOptions ?? {}),
|
|
67
|
+
}), [queryOptions]);
|
|
68
|
+
|
|
69
|
+
const query = useInfiniteQuery<WorkflowExecutionListResponse, Error, WorkflowExecution[], QueryKey, PageToken>({
|
|
70
|
+
queryKey,
|
|
71
|
+
initialPageParam: null,
|
|
72
|
+
getNextPageParam: (lastPage) => lastPage.next_page_token ?? undefined,
|
|
73
|
+
|
|
74
|
+
queryFn: async ({ pageParam }) => {
|
|
75
|
+
const queryFilter = buildQueryObject({
|
|
76
|
+
filters,
|
|
77
|
+
order,
|
|
78
|
+
projection,
|
|
79
|
+
pageSize,
|
|
80
|
+
pageToken: pageParam ?? undefined,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return await listWorkflowExecutions(api, workflowId, queryFilter);
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
select: (data) => data.pages.flatMap((p) => p.workflow_executions),
|
|
87
|
+
|
|
88
|
+
...mergedQueryOptions,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
query,
|
|
93
|
+
queryKey,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useInfiniteQuery, type UseInfiniteQueryOptions, type QueryKey } from "@tanstack/react-query";
|
|
3
|
+
|
|
4
|
+
import { useAxios } from "@/hooks/useAxios";
|
|
5
|
+
import { listWorkflows } from "@/api/workflow";
|
|
6
|
+
import type { Workflow, WorkflowListResponse } from "@/types/workflow";
|
|
7
|
+
|
|
8
|
+
type PageToken = string | null;
|
|
9
|
+
|
|
10
|
+
type InfiniteOptions<TData> = Omit<UseInfiniteQueryOptions<WorkflowListResponse, Error, TData, QueryKey, PageToken>,"queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">;
|
|
11
|
+
|
|
12
|
+
export type FetchInfiniteWorkflowProps = {
|
|
13
|
+
workspace?: string;
|
|
14
|
+
pageSize?: number;
|
|
15
|
+
queryOptions?: InfiniteOptions<Workflow[]>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const defaultQueryOptions: InfiniteOptions<Workflow[]> = {
|
|
19
|
+
refetchOnMount: "always",
|
|
20
|
+
staleTime: 0,
|
|
21
|
+
gcTime: 0,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* useFetchWorkflows
|
|
26
|
+
*
|
|
27
|
+
* Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
|
|
28
|
+
* workflows with cursor-based pagination using the legacy method (workspace as query param).
|
|
29
|
+
*
|
|
30
|
+
* Automatically flattens all pages into a single `Workflow[]` via `select`.
|
|
31
|
+
*
|
|
32
|
+
* Note: `query.data` returns a flat `Workflow[]` with all fetched items merged across pages.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} [workspace]
|
|
35
|
+
* Current workspace name. Sent as a query param via the legacy method, required by some API configurations.
|
|
36
|
+
*
|
|
37
|
+
* @param {number} [pageSize=10]
|
|
38
|
+
* Number of workflows to fetch per page.
|
|
39
|
+
*
|
|
40
|
+
* @param {InfiniteOptions<Workflow[]>} [queryOptions]
|
|
41
|
+
* TanStack Query options passed through to `useInfiniteQuery`
|
|
42
|
+
* (e.g., enabled, staleTime, gcTime, etc.).
|
|
43
|
+
*
|
|
44
|
+
* @returns {{ query, queryKey }}
|
|
45
|
+
* - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
|
|
46
|
+
* - `queryKey`: the cache key used by React Query
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const { query } = useFetchWorkflows({ workspace: "ws-1", pageSize: 20 });
|
|
51
|
+
*
|
|
52
|
+
* // Flat list of all fetched workflows
|
|
53
|
+
* const workflows = query.data ?? [];
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export function useFetchWorkflows({ workspace, pageSize = 10, queryOptions }: FetchInfiniteWorkflowProps) {
|
|
57
|
+
const { api } = useAxios();
|
|
58
|
+
|
|
59
|
+
const queryKey: QueryKey = ["workflows", workspace ?? null];
|
|
60
|
+
|
|
61
|
+
const mergedQueryOptions = useMemo<InfiniteOptions<Workflow[]>>(() => ({
|
|
62
|
+
...defaultQueryOptions,
|
|
63
|
+
...(queryOptions ?? {}),
|
|
64
|
+
}), [queryOptions]);
|
|
65
|
+
|
|
66
|
+
const query = useInfiniteQuery<WorkflowListResponse, Error, Workflow[], QueryKey, PageToken>({
|
|
67
|
+
queryKey,
|
|
68
|
+
initialPageParam: null,
|
|
69
|
+
getNextPageParam: (lastPage) => lastPage.next_page_token ?? undefined,
|
|
70
|
+
|
|
71
|
+
queryFn: async ({ pageParam }) => {
|
|
72
|
+
return await listWorkflows(api, workspace, pageSize, pageParam ?? undefined);
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
select: (data) => data.pages.flatMap((p) => p.workflows),
|
|
76
|
+
|
|
77
|
+
...mergedQueryOptions,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
query,
|
|
82
|
+
queryKey,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useMutation } from "@tanstack/react-query";
|
|
2
|
+
|
|
3
|
+
import { useAxios } from "@/hooks/useAxios";
|
|
4
|
+
import { useAppAlert } from "@/contexts/appAlertContext/useAppAlert";
|
|
5
|
+
import type { AnyRecord } from "@/types/anyRecord";
|
|
6
|
+
import type { PollWorkflowExecutionOptions } from "@/api/workflow";
|
|
7
|
+
import { runWorkflow, runWorkflowAndGetResult } from "@/api/workflow";
|
|
8
|
+
|
|
9
|
+
type RunWorkflowProps = {
|
|
10
|
+
id: string;
|
|
11
|
+
workspace: string;
|
|
12
|
+
parameters: AnyRecord;
|
|
13
|
+
pollOptions?: PollWorkflowExecutionOptions;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const getErrorMessage = (err: unknown, fallback: string) =>
|
|
17
|
+
err instanceof Error && err.message ? err.message : fallback;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* useRunWorkflow
|
|
21
|
+
*
|
|
22
|
+
* TanStack Query mutations to run a workflow. Synchronous execution (`synchronous: true`) is
|
|
23
|
+
* intentionally not used; instead the workflow is started asynchronously and, when the result
|
|
24
|
+
* is needed, its execution is polled until it reaches a terminal state.
|
|
25
|
+
*
|
|
26
|
+
* - `runAsync`: starts the workflow and returns immediately (fire-and-forget). Use when you do
|
|
27
|
+
* not need to wait for completion or consume the output.
|
|
28
|
+
* - `runAndGetResult`: starts the workflow, polls until it finishes, then fetches the output of
|
|
29
|
+
* the ender worker. Resolves with `{ execution, workerExecution, result }`; `result` is `null`
|
|
30
|
+
* when the workflow produces no output. This is the replacement for the old synchronous flow.
|
|
31
|
+
*
|
|
32
|
+
* Both surface the standard mutation helpers (`mutate`, `mutateAsync`, `isPending`, `data`, ...)
|
|
33
|
+
* and report failures through `useAppAlert`.
|
|
34
|
+
*/
|
|
35
|
+
export const useRunWorkflow = () => {
|
|
36
|
+
const { api } = useAxios();
|
|
37
|
+
const { showAlert } = useAppAlert();
|
|
38
|
+
|
|
39
|
+
const runAsync = useMutation({
|
|
40
|
+
mutationFn: ({ id, workspace, parameters }: RunWorkflowProps) =>
|
|
41
|
+
runWorkflow(api, id, workspace, parameters),
|
|
42
|
+
onError: (err) => {
|
|
43
|
+
showAlert({
|
|
44
|
+
severity: "error",
|
|
45
|
+
message: getErrorMessage(err, "Unable to run the workflow. Please try again."),
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const runAndGetResult = useMutation({
|
|
51
|
+
mutationFn: ({ id, workspace, parameters, pollOptions }: RunWorkflowProps) =>
|
|
52
|
+
runWorkflowAndGetResult(api, id, workspace, parameters, pollOptions),
|
|
53
|
+
onError: (err) => {
|
|
54
|
+
showAlert({
|
|
55
|
+
severity: "error",
|
|
56
|
+
message: getErrorMessage(err, "Unable to run the workflow. Please try again."),
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return { runAsync, runAndGetResult };
|
|
62
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
4
|
+
|
|
5
|
+
import { useAxios } from "@/hooks/useAxios";
|
|
6
|
+
import { useAppAlert } from "@/contexts/appAlertContext/useAppAlert";
|
|
7
|
+
import type { Workspace } from "@/types/workspace";
|
|
8
|
+
import { getWorkspace } from "@/api/workspace";
|
|
9
|
+
import type { EntityQueryOptions } from "@/types/entityQuery";
|
|
10
|
+
|
|
11
|
+
export type FetchWorkspaceProps<TData = Workspace, TSelected = TData> = {
|
|
12
|
+
name: string;
|
|
13
|
+
queryOptions?: EntityQueryOptions<TData, TSelected>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const defaultQueryOptions: EntityQueryOptions<Workspace> = {
|
|
17
|
+
refetchOnMount: "always",
|
|
18
|
+
staleTime: 0,
|
|
19
|
+
gcTime: 0,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* useFetchWorkspace
|
|
24
|
+
*
|
|
25
|
+
* Data-fetching hook built on TanStack Query to retrieve a single workspace by name.
|
|
26
|
+
*
|
|
27
|
+
* It also:
|
|
28
|
+
* - builds a stable React Query `queryKey` that can be reused by mutation hooks for cache invalidation
|
|
29
|
+
* - triggers an error alert via `useAppAlert` whenever `query.error` is present
|
|
30
|
+
*
|
|
31
|
+
* Parameters (FetchWorkspaceProps):
|
|
32
|
+
* @param {string} name
|
|
33
|
+
* Workspace name (required).
|
|
34
|
+
*
|
|
35
|
+
* @param queryOptions
|
|
36
|
+
* TanStack Query options passed through to `useQuery` (e.g., enabled, staleTime, gcTime, etc.).
|
|
37
|
+
*
|
|
38
|
+
* Returns:
|
|
39
|
+
* @returns {object}
|
|
40
|
+
* TanStack Query's `query` object extended with:
|
|
41
|
+
* - `queryKey`: the cache key used by React Query
|
|
42
|
+
*
|
|
43
|
+
* Example:
|
|
44
|
+
* ```ts
|
|
45
|
+
* const { data, isLoading } = useFetchWorkspace({ name: "main" });
|
|
46
|
+
* // data -> Workspace
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export const useFetchWorkspace = ({ name, queryOptions = defaultQueryOptions }: FetchWorkspaceProps) => {
|
|
50
|
+
|
|
51
|
+
const { api } = useAxios();
|
|
52
|
+
const { showAlert } = useAppAlert();
|
|
53
|
+
|
|
54
|
+
const queryKey = ["workspace", name];
|
|
55
|
+
|
|
56
|
+
const query = useQuery<Workspace>({
|
|
57
|
+
queryKey,
|
|
58
|
+
queryFn: async () => {
|
|
59
|
+
const workspace = await getWorkspace(api, name);
|
|
60
|
+
return workspace;
|
|
61
|
+
},
|
|
62
|
+
...queryOptions ?? {}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!query.error) return;
|
|
67
|
+
|
|
68
|
+
showAlert({
|
|
69
|
+
severity: "error",
|
|
70
|
+
message: query.error.message,
|
|
71
|
+
});
|
|
72
|
+
}, [query.error, showAlert]);
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
...query,
|
|
76
|
+
queryKey,
|
|
77
|
+
};
|
|
78
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useInfiniteQuery, type UseInfiniteQueryOptions, type QueryKey } from "@tanstack/react-query";
|
|
3
|
+
|
|
4
|
+
import { useAxios } from "@/hooks/useAxios";
|
|
5
|
+
import { listWorkspaces } from "@/api/workspace";
|
|
6
|
+
import type { Workspace, WorkspaceListResponse } from "@/types/workspace";
|
|
7
|
+
|
|
8
|
+
type PageToken = string | null;
|
|
9
|
+
|
|
10
|
+
type InfiniteOptions<TData> = Omit<
|
|
11
|
+
UseInfiniteQueryOptions<WorkspaceListResponse, Error, TData, QueryKey, PageToken>,
|
|
12
|
+
"queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam"
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
export type FetchInfiniteWorkspaceProps = {
|
|
16
|
+
workspace?: string;
|
|
17
|
+
pageSize?: number;
|
|
18
|
+
queryOptions?: InfiniteOptions<Workspace[]>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const defaultQueryOptions: InfiniteOptions<Workspace[]> = {
|
|
22
|
+
refetchOnMount: "always",
|
|
23
|
+
staleTime: 0,
|
|
24
|
+
gcTime: 0,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* useFetchWorkspaces
|
|
29
|
+
*
|
|
30
|
+
* Data-fetching hook built on TanStack Query's `useInfiniteQuery` to retrieve
|
|
31
|
+
* workspaces with cursor-based pagination.
|
|
32
|
+
*
|
|
33
|
+
* It also:
|
|
34
|
+
* - flattens all pages into a single `Workspace[]` via `select`
|
|
35
|
+
*
|
|
36
|
+
* Important notes:
|
|
37
|
+
* - `query.data` returns a flat `Workspace[]` (all pages merged).
|
|
38
|
+
* - `workspace` is required by some API configurations to avoid being blocked.
|
|
39
|
+
*
|
|
40
|
+
* @param props - FetchInfiniteWorkspaceProps
|
|
41
|
+
* - `workspace`: Current workspace name sent as a query param.
|
|
42
|
+
* - `pageSize`: Number of workspaces to fetch per page.
|
|
43
|
+
* - `queryOptions`: TanStack Query options passed through to `useInfiniteQuery`.
|
|
44
|
+
*
|
|
45
|
+
* Returns:
|
|
46
|
+
* @returns {object}
|
|
47
|
+
* - `query`: the full `useInfiniteQuery` result (data, isLoading, hasNextPage, fetchNextPage, etc.)
|
|
48
|
+
* - `queryKey`: the cache key used by React Query
|
|
49
|
+
*
|
|
50
|
+
* Example:
|
|
51
|
+
* ```ts
|
|
52
|
+
* const { query } = useFetchWorkspaces({ workspace: "main", pageSize: 20 });
|
|
53
|
+
*
|
|
54
|
+
* // Flat list of all fetched workspaces
|
|
55
|
+
* const workspaces = query.data ?? [];
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export function useFetchWorkspaces({ workspace, pageSize = 10, queryOptions }: FetchInfiniteWorkspaceProps) {
|
|
59
|
+
const { api } = useAxios();
|
|
60
|
+
|
|
61
|
+
const queryKey: QueryKey = ["workspaces", workspace ?? null];
|
|
62
|
+
|
|
63
|
+
const mergedQueryOptions = useMemo<InfiniteOptions<Workspace[]>>(() => ({
|
|
64
|
+
...defaultQueryOptions,
|
|
65
|
+
...(queryOptions ?? {}),
|
|
66
|
+
}), [queryOptions]);
|
|
67
|
+
|
|
68
|
+
const query = useInfiniteQuery<WorkspaceListResponse, Error, Workspace[], QueryKey, PageToken>({
|
|
69
|
+
queryKey,
|
|
70
|
+
initialPageParam: null,
|
|
71
|
+
getNextPageParam: (lastPage) => lastPage.next_page_token ?? undefined,
|
|
72
|
+
|
|
73
|
+
queryFn: async ({ pageParam }) => {
|
|
74
|
+
return await listWorkspaces(api, workspace, pageSize, pageParam ?? undefined);
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
select: (data) => data.pages.flatMap((p) => p.workspaces),
|
|
78
|
+
|
|
79
|
+
...mergedQueryOptions,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
query,
|
|
84
|
+
queryKey,
|
|
85
|
+
};
|
|
86
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// `@everysk/apps-sdk` — the entry point.
|
|
2
|
+
//
|
|
3
|
+
// One entry for everything whose dependencies are required peers, which npm installs with the
|
|
4
|
+
// SDK: the providers, the entity slices, the UI components and the theme. A bundler drops what
|
|
5
|
+
// an app does not import — measured, importing one function through this barrel produces the
|
|
6
|
+
// same bytes as importing it from a dedicated subpath, so splitting these apart bought nothing.
|
|
7
|
+
//
|
|
8
|
+
// What stays behind its own subpath is only what carries an OPTIONAL peer: `/ag-grid`,
|
|
9
|
+
// `/socket` and the `/test` helpers. That is not a style choice. A bundler resolves a module
|
|
10
|
+
// before it can tree-shake it, so re-exporting the AG Grid layer from here would fail to build
|
|
11
|
+
// in an app that never installed ag-grid — even one importing nothing but createQueryClient.
|
|
12
|
+
|
|
13
|
+
export { EveryskApp } from "./EveryskApp";
|
|
14
|
+
export type { EveryskAppProps, ProviderComponent } from "./EveryskApp";
|
|
15
|
+
|
|
16
|
+
// Contexts — app configuration
|
|
17
|
+
export { AppConfigContext } from "./contexts/appConfigContext";
|
|
18
|
+
export { AppConfigProvider } from "./contexts/appConfigContext/provider";
|
|
19
|
+
export { useAppConfig } from "./contexts/appConfigContext/useAppConfig";
|
|
20
|
+
export type {
|
|
21
|
+
AppConfigContextType,
|
|
22
|
+
AppConfigProviderProps,
|
|
23
|
+
} from "./contexts/appConfigContext/types";
|
|
24
|
+
|
|
25
|
+
// Contexts — alerts
|
|
26
|
+
export { AppAlertContext } from "./contexts/appAlertContext";
|
|
27
|
+
export { AppAlertProvider } from "./contexts/appAlertContext/provider";
|
|
28
|
+
export { useAppAlert } from "./contexts/appAlertContext/useAppAlert";
|
|
29
|
+
export type {
|
|
30
|
+
AppAlertContextType,
|
|
31
|
+
AppAlertState,
|
|
32
|
+
ShowAlertOptions,
|
|
33
|
+
} from "./contexts/appAlertContext/types";
|
|
34
|
+
|
|
35
|
+
// Hooks
|
|
36
|
+
export { useAxios } from "./hooks/useAxios";
|
|
37
|
+
|
|
38
|
+
// API helpers
|
|
39
|
+
export { toFilterTuple, buildQueryObject, buildQueryKey } from "./api/entityQuery";
|
|
40
|
+
|
|
41
|
+
// Query client
|
|
42
|
+
export { createQueryClient, getQueryFn } from "./lib/queryClient";
|
|
43
|
+
|
|
44
|
+
// Types
|
|
45
|
+
export type { AnyRecord } from "./types/anyRecord";
|
|
46
|
+
export type {
|
|
47
|
+
BaseQueryParams,
|
|
48
|
+
DeleteEntityDefaultResponse,
|
|
49
|
+
DeleteEntityResponse,
|
|
50
|
+
EntityDefaultResponse,
|
|
51
|
+
EntityListResponse,
|
|
52
|
+
EntityQueryOptions,
|
|
53
|
+
EntityQueryParams,
|
|
54
|
+
EntitySingleResponse,
|
|
55
|
+
FetchEntitiesParams,
|
|
56
|
+
FetchEntityParams,
|
|
57
|
+
FilterClause,
|
|
58
|
+
FilterExpression,
|
|
59
|
+
FilterOperator,
|
|
60
|
+
QueryObject,
|
|
61
|
+
} from "./types/entityQuery";
|
|
62
|
+
|
|
63
|
+
// Entity slices, UI and theme. `export *` because each is exactly "everything these modules
|
|
64
|
+
// expose"; the names are collision-free across all of them, checked before merging.
|
|
65
|
+
export * from "./portfolio";
|
|
66
|
+
export * from "./datastore";
|
|
67
|
+
export * from "./file";
|
|
68
|
+
export * from "./profile";
|
|
69
|
+
export * from "./workflow";
|
|
70
|
+
export * from "./workspace";
|
|
71
|
+
export * from "./ui";
|
|
72
|
+
export * from "./theme";
|