@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,15 @@
|
|
|
1
|
+
// `@everysk/apps-sdk/ag-grid` — the grid layer: license registration and the grid theme.
|
|
2
|
+
//
|
|
3
|
+
// `ag-grid-community` and `ag-grid-enterprise` are OPTIONAL peers: an app that never imports
|
|
4
|
+
// this subpath does not install them, which keeps the grid out of the lockfile, out of CI
|
|
5
|
+
// install time and out of the license perimeter. That is also why the grid theme lives here
|
|
6
|
+
// rather than next to the MUI theme in `/theme` — importing it there would put an AG Grid
|
|
7
|
+
// import in the path every app loads.
|
|
8
|
+
//
|
|
9
|
+
// The license key is a parameter, never read from the environment by this package — see
|
|
10
|
+
// `setAgGridLicense` for why that distinction is load-bearing once the code is published.
|
|
11
|
+
|
|
12
|
+
export { setAgGridLicense, AgGridLicenseProvider } from "@/contexts/agGridLicenseContext/provider";
|
|
13
|
+
export type { AgGridLicenseProviderProps } from "@/contexts/agGridLicenseContext/provider";
|
|
14
|
+
|
|
15
|
+
export { getAgGridTheme, useAgGridTheme, agGridThemeParams } from "./agGridTheme";
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { isAxiosError, type AxiosInstance, type AxiosResponse } from "axios";
|
|
2
|
+
|
|
3
|
+
import type { AnyRecord } from "@/types/anyRecord";
|
|
4
|
+
import type { DeleteEntityDefaultResponse, FilterExpression, QueryObject } from "@/types/entityQuery";
|
|
5
|
+
import type { Datastore, DatastoreSingleResponse, DatastoreListResponse, DeleteDatastoreResponse } from "@/types/datastore";
|
|
6
|
+
|
|
7
|
+
const baseUrl = "datastores";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* getDatastore
|
|
11
|
+
*
|
|
12
|
+
* Fetches a single datastore by ID.
|
|
13
|
+
*
|
|
14
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
15
|
+
* @param {string} id - Datastore identifier.
|
|
16
|
+
* @param {string} workspace - Workspace the datastore belongs to.
|
|
17
|
+
* @returns {Promise<Datastore>} The fetched datastore.
|
|
18
|
+
*
|
|
19
|
+
* @throws {Error} If the request fails.
|
|
20
|
+
*/
|
|
21
|
+
export const getDatastore = async (api: AxiosInstance, id: string, workspace: string): Promise<Datastore> => {
|
|
22
|
+
const params: AnyRecord = { workspace };
|
|
23
|
+
|
|
24
|
+
if (!workspace) throw new Error("Workspace filter is required to fetch a datastore");
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
const response: AxiosResponse<DatastoreSingleResponse> = await api.get(`${baseUrl}/${id}`, { params });
|
|
28
|
+
return response.data.datastore;
|
|
29
|
+
} catch (error: unknown) {
|
|
30
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
31
|
+
throw new Error(error.message || "Error fetching datastore");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (error instanceof Error) {
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
throw new Error("Error fetching datastore");
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* listDatastores
|
|
44
|
+
*
|
|
45
|
+
* Fetches a list of datastores using a query object (filters, order, pagination, etc.).
|
|
46
|
+
*
|
|
47
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
48
|
+
* @param {AnyRecord} query - Query object built via `buildQueryObject`.
|
|
49
|
+
* @returns {Promise<DatastoreListResponse>} Paginated list of datastores.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error} If workspace filter is missing.
|
|
52
|
+
* @throws {Error} If the request fails.
|
|
53
|
+
*/
|
|
54
|
+
export const listDatastores = async (api: AxiosInstance, query: QueryObject): Promise<DatastoreListResponse> => {
|
|
55
|
+
const workspaceFilter = query.filters.find((filter: FilterExpression) => filter[0] === "workspace");
|
|
56
|
+
const workspace = workspaceFilter?.[workspaceFilter.length - 1];
|
|
57
|
+
|
|
58
|
+
if (!workspace) throw new Error("Workspace filter is required to list datastores");
|
|
59
|
+
|
|
60
|
+
const params: AnyRecord = {
|
|
61
|
+
workspace,
|
|
62
|
+
...(query ? { query: JSON.stringify(query) } : {}),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
const response: AxiosResponse<DatastoreListResponse> = await api.get(baseUrl, { params });
|
|
67
|
+
return response.data;
|
|
68
|
+
} catch (error: unknown) {
|
|
69
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
70
|
+
throw new Error(error.message || "Error listing datastores");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (error instanceof Error) {
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
throw new Error("Error listing datastores");
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* createDatastore
|
|
83
|
+
*
|
|
84
|
+
* Creates a new datastore.
|
|
85
|
+
*
|
|
86
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
87
|
+
* @param {Partial<Datastore>} data - Datastore payload.
|
|
88
|
+
* @returns {Promise<Datastore>} The created datastore.
|
|
89
|
+
*
|
|
90
|
+
* @throws {Error} If the request fails.
|
|
91
|
+
*/
|
|
92
|
+
export const createDatastore = async (api: AxiosInstance, data: Partial<Datastore>): Promise<Datastore> => {
|
|
93
|
+
|
|
94
|
+
const { workspace } = data;
|
|
95
|
+
if (!workspace) throw new Error("Workspace filter is required to create a datastore");
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const response: AxiosResponse<DatastoreSingleResponse> = await api.post(baseUrl, data);
|
|
99
|
+
return response.data.datastore;
|
|
100
|
+
} catch (error: unknown) {
|
|
101
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
102
|
+
throw new Error(error.message || "Error creating datastore");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (error instanceof Error) {
|
|
106
|
+
throw error;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
throw new Error("Error creating datastore");
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* updateDatastore
|
|
115
|
+
*
|
|
116
|
+
* Updates an existing datastore by ID.
|
|
117
|
+
*
|
|
118
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
119
|
+
* @param {string} id - Datastore identifier.
|
|
120
|
+
* @param {Partial<Datastore>} data - Fields to update.
|
|
121
|
+
* @returns {Promise<Datastore>} The updated datastore.
|
|
122
|
+
*
|
|
123
|
+
* @throws {Error} If the request fails.
|
|
124
|
+
*/
|
|
125
|
+
export const updateDatastore = async (api: AxiosInstance, id: string, data: Partial<Datastore>): Promise<Datastore> => {
|
|
126
|
+
|
|
127
|
+
const { workspace } = data;
|
|
128
|
+
if (!workspace) throw new Error("Workspace filter is required to update a datastore");
|
|
129
|
+
|
|
130
|
+
try {
|
|
131
|
+
const response: AxiosResponse<DatastoreSingleResponse> = await api.put(`${baseUrl}/${id}`, data);
|
|
132
|
+
return response.data.datastore;
|
|
133
|
+
} catch (error: unknown) {
|
|
134
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
135
|
+
throw new Error(error.message || "Error updating datastore");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (error instanceof Error) {
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
throw new Error("Error updating datastore");
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* deleteDatastore
|
|
148
|
+
*
|
|
149
|
+
* Deletes a datastore by ID.
|
|
150
|
+
*
|
|
151
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
152
|
+
* @param {string} id - Datastore identifier.
|
|
153
|
+
* @param {string} workspace - Workspace the datastore belongs to.
|
|
154
|
+
* @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.
|
|
155
|
+
*
|
|
156
|
+
* @throws {Error} If the request fails.
|
|
157
|
+
*/
|
|
158
|
+
export const deleteDatastore = async (api: AxiosInstance, id: string, workspace: string): Promise<DeleteEntityDefaultResponse[]> => {
|
|
159
|
+
const params: AnyRecord = { workspace };
|
|
160
|
+
|
|
161
|
+
try {
|
|
162
|
+
const response: AxiosResponse<DeleteDatastoreResponse> = await api.delete(`${baseUrl}/${id}`, { params });
|
|
163
|
+
return response.data.datastores;
|
|
164
|
+
} catch (error: unknown) {
|
|
165
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
166
|
+
throw new Error(error.message || "Error removing datastore");
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (error instanceof Error) {
|
|
170
|
+
throw error;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
throw new Error("Error removing datastore");
|
|
174
|
+
}
|
|
175
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { FilterClause, FilterExpression, EntityQueryParams, QueryObject } from "@/types/entityQuery";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* toFilterTuple
|
|
5
|
+
*
|
|
6
|
+
* Converts a `FilterClause` object into a `FilterExpression` tuple
|
|
7
|
+
* compatible with the API query format.
|
|
8
|
+
*
|
|
9
|
+
* - If no operator is provided or operator is `"="`, returns a 2-tuple `[field, value]`.
|
|
10
|
+
* - Otherwise, returns a 3-tuple `[field, op, value]`.
|
|
11
|
+
*
|
|
12
|
+
* @param {FilterClause} filter - Filter clause to convert.
|
|
13
|
+
* @returns {FilterExpression} Tuple representation of the filter.
|
|
14
|
+
*
|
|
15
|
+
* Examples:
|
|
16
|
+
* ```ts
|
|
17
|
+
* toFilterTuple({ field: "workspace", value: "ws-1" })
|
|
18
|
+
* // -> ["workspace", "ws-1"]
|
|
19
|
+
*
|
|
20
|
+
* toFilterTuple({ field: "age", op: ">=", value: 18 })
|
|
21
|
+
* // -> ["age", ">=", 18]
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export const toFilterTuple = (filter: FilterClause): FilterExpression => {
|
|
25
|
+
const { field, op, value } = filter;
|
|
26
|
+
if (!op || op === '=') {
|
|
27
|
+
return [field, value];
|
|
28
|
+
}
|
|
29
|
+
return [field, op, value];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* buildQueryObject
|
|
34
|
+
*
|
|
35
|
+
* Builds the query payload object to be sent to the API,
|
|
36
|
+
* converting filters, ordering, pagination, and projection into the expected format.
|
|
37
|
+
*
|
|
38
|
+
* @param {EntityQueryParams} params - Query parameters.
|
|
39
|
+
* @param {FilterClause[]} params.filters - Filters to apply (converted via `toFilterTuple`).
|
|
40
|
+
* @param {string[]} params.order - Sorting fields.
|
|
41
|
+
* @param {number} [params.pageSize] - Number of items per page.
|
|
42
|
+
* @param {string} [params.pageToken] - Cursor token for the next page.
|
|
43
|
+
* @param {string} [params.projection] - Single field to project. `"field"` returns only that
|
|
44
|
+
* field (every other field comes back null); `"-field"` returns all fields except that one.
|
|
45
|
+
* One field only — comma/space lists return a 500. Omitted from payload if empty.
|
|
46
|
+
* @returns {QueryObject} Query payload ready to be passed to the API.
|
|
47
|
+
*
|
|
48
|
+
* Example:
|
|
49
|
+
* ```ts
|
|
50
|
+
* buildQueryObject({
|
|
51
|
+
* filters: [{ field: "workspace", value: "ws-1" }],
|
|
52
|
+
* order: ["name"], // plain field name(s) only — no "asc"/"desc" suffix
|
|
53
|
+
* pageSize: 10,
|
|
54
|
+
* pageToken: "token-abc",
|
|
55
|
+
* projection: "name",
|
|
56
|
+
* });
|
|
57
|
+
* // -> {
|
|
58
|
+
* // filters: [["workspace", "ws-1"]],
|
|
59
|
+
* // order: ["name"],
|
|
60
|
+
* // projection: "name",
|
|
61
|
+
* // page_size: 10,
|
|
62
|
+
* // page_token: "token-abc",
|
|
63
|
+
* // }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export const buildQueryObject = (params: EntityQueryParams): QueryObject => {
|
|
67
|
+
const { filters, pageSize, pageToken, order, projection } = params;
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
filters: filters.map(toFilterTuple),
|
|
71
|
+
order,
|
|
72
|
+
...(!!projection && { projection }),
|
|
73
|
+
page_size: pageSize,
|
|
74
|
+
page_token: pageToken,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* buildQueryKey
|
|
80
|
+
*
|
|
81
|
+
* Builds a stable React Query cache key by combining a base key array
|
|
82
|
+
* with the values of the provided filters.
|
|
83
|
+
*
|
|
84
|
+
* This ensures the query is re-executed whenever filter values change.
|
|
85
|
+
*
|
|
86
|
+
* @param {(string | number)[]} keys - Base keys (e.g. entity name, id).
|
|
87
|
+
* @param {FilterClause[]} filters - Filters whose values are appended to the key.
|
|
88
|
+
* @returns {unknown[]} Cache key array for use in `queryKey`.
|
|
89
|
+
*
|
|
90
|
+
* Example:
|
|
91
|
+
* ```ts
|
|
92
|
+
* buildQueryKey(["datastores"], [{ field: "workspace", value: "ws-1" }]);
|
|
93
|
+
* // -> ["datastores", "ws-1"]
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export const buildQueryKey = (keys: (string | number)[], filters: FilterClause[]): unknown[] => {
|
|
97
|
+
return [
|
|
98
|
+
...keys,
|
|
99
|
+
...filters.flatMap((filter) => filter.value)
|
|
100
|
+
];
|
|
101
|
+
}
|
package/src/api/file.ts
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { isAxiosError, type AxiosInstance, type AxiosResponse } from "axios";
|
|
2
|
+
|
|
3
|
+
import type { AnyRecord } from "@/types/anyRecord";
|
|
4
|
+
import type { DeleteFileResponse, EveryskFile, FileListResponse, FileSingleResponse } from "@/types/file";
|
|
5
|
+
import type { DeleteEntityDefaultResponse, FilterExpression, QueryObject } from "@/types/entityQuery";
|
|
6
|
+
|
|
7
|
+
const baseUrl = "files";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* getFile
|
|
11
|
+
*
|
|
12
|
+
* Fetches a single file by ID.
|
|
13
|
+
*
|
|
14
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
15
|
+
* @param {string} id - EveryskFile identifier.
|
|
16
|
+
* @param {string} workspace - Workspace the file belongs to.
|
|
17
|
+
* @returns {Promise<EveryskFile>} The fetched file.
|
|
18
|
+
*
|
|
19
|
+
* @throws {Error} If the request fails.
|
|
20
|
+
*/
|
|
21
|
+
export const getFile = async (api: AxiosInstance, id: string, workspace: string): Promise<EveryskFile> => {
|
|
22
|
+
const params: AnyRecord = { workspace };
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const response: AxiosResponse<FileSingleResponse> = await api.get(`${baseUrl}/${id}`, { params });
|
|
26
|
+
return response.data.file;
|
|
27
|
+
} catch (error: unknown) {
|
|
28
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
29
|
+
throw new Error(error.message || "Error while fetching file");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (error instanceof Error) {
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
throw new Error("Error while fetching file");
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* listFiles
|
|
42
|
+
*
|
|
43
|
+
* Fetches a list of files using a query object (filters, order, pagination, etc.).
|
|
44
|
+
*
|
|
45
|
+
* Note: `workspace` is extracted from the query filters and sent as a separate
|
|
46
|
+
* query param alongside the serialized query object.
|
|
47
|
+
*
|
|
48
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
49
|
+
* @param {QueryObject} query - Query object built via `buildQueryObject`.
|
|
50
|
+
* @returns {Promise<EveryskFile[]>} List of files. Returns an empty array if none found.
|
|
51
|
+
*
|
|
52
|
+
* @throws {Error} If the request fails.
|
|
53
|
+
*/
|
|
54
|
+
export const listFiles = async (api: AxiosInstance, query: QueryObject): Promise<FileListResponse> => {
|
|
55
|
+
const workspaceFilter = query.filters.find((filter: FilterExpression) => filter[0] === "workspace");
|
|
56
|
+
const workspace = workspaceFilter?.[workspaceFilter.length - 1];
|
|
57
|
+
|
|
58
|
+
if (!workspace) throw new Error("Workspace filter is required to list files");
|
|
59
|
+
|
|
60
|
+
const params: AnyRecord = {
|
|
61
|
+
workspace,
|
|
62
|
+
...(query ? { query: JSON.stringify(query) } : {}),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
const response: AxiosResponse<FileListResponse> = await api.get(baseUrl, { params });
|
|
67
|
+
return response.data;
|
|
68
|
+
} catch (error: unknown) {
|
|
69
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
70
|
+
throw new Error(error.message || "Error while fetching files");
|
|
71
|
+
}
|
|
72
|
+
if (error instanceof Error) {
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
throw new Error("Error while fetching files");
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* createFile
|
|
82
|
+
*
|
|
83
|
+
* Creates a new file.
|
|
84
|
+
*
|
|
85
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
86
|
+
* @param {Partial<EveryskFile>} data - EveryskFile payload.
|
|
87
|
+
* @returns {Promise<EveryskFile>} The created file.
|
|
88
|
+
*
|
|
89
|
+
* @throws {Error} If the request fails.
|
|
90
|
+
*/
|
|
91
|
+
export const createFile = async (api: AxiosInstance, data: Partial<EveryskFile>): Promise<EveryskFile> => {
|
|
92
|
+
|
|
93
|
+
const { workspace } = data;
|
|
94
|
+
if (!workspace) throw new Error("Workspace filter is required to create a file");
|
|
95
|
+
|
|
96
|
+
try {
|
|
97
|
+
const response: AxiosResponse<FileSingleResponse> = await api.post(baseUrl, data);
|
|
98
|
+
return response.data.file;
|
|
99
|
+
} catch (error: unknown) {
|
|
100
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
101
|
+
throw new Error(error.message || "Error while creating file");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (error instanceof Error) {
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
throw new Error("Error while creating file");
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* updateFile
|
|
114
|
+
*
|
|
115
|
+
* Updates an existing file by ID.
|
|
116
|
+
*
|
|
117
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
118
|
+
* @param {string} id - EveryskFile identifier.
|
|
119
|
+
* @param {Partial<EveryskFile>} data - Fields to update.
|
|
120
|
+
* @returns {Promise<EveryskFile>} The updated file.
|
|
121
|
+
*
|
|
122
|
+
* @throws {Error} If the request fails.
|
|
123
|
+
*/
|
|
124
|
+
export const updateFile = async (api: AxiosInstance, id: string, data: Partial<EveryskFile>): Promise<EveryskFile> => {
|
|
125
|
+
|
|
126
|
+
const { workspace } = data;
|
|
127
|
+
if (!workspace) throw new Error("Workspace filter is required to update a file");
|
|
128
|
+
|
|
129
|
+
try {
|
|
130
|
+
const response: AxiosResponse<FileSingleResponse> = await api.put(`${baseUrl}/${id}`, data);
|
|
131
|
+
return response.data.file;
|
|
132
|
+
} catch (error: unknown) {
|
|
133
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
134
|
+
throw new Error(error.message || "Error while updating file");
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (error instanceof Error) {
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
throw new Error("Error while updating file");
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* deleteFile
|
|
147
|
+
*
|
|
148
|
+
* Deletes a file by ID.
|
|
149
|
+
*
|
|
150
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
151
|
+
* @param {string} id - EveryskFile identifier.
|
|
152
|
+
* @param {string} workspace - Workspace the file belongs to.
|
|
153
|
+
* @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.
|
|
154
|
+
*
|
|
155
|
+
* @throws {Error} If the request fails.
|
|
156
|
+
*/
|
|
157
|
+
export const deleteFile = async (api: AxiosInstance, id: string, workspace: string): Promise<DeleteEntityDefaultResponse[]> => {
|
|
158
|
+
const params: AnyRecord = { workspace };
|
|
159
|
+
|
|
160
|
+
try {
|
|
161
|
+
const response: AxiosResponse<DeleteFileResponse> = await api.delete(`${baseUrl}/${id}`, { params });
|
|
162
|
+
return response.data.files;
|
|
163
|
+
} catch (error: unknown) {
|
|
164
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
165
|
+
throw new Error(error.message || "Error while deleting file");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (error instanceof Error) {
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
throw new Error("Error while deleting file");
|
|
173
|
+
}
|
|
174
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { isAxiosError, type AxiosInstance, type AxiosResponse } from "axios";
|
|
2
|
+
|
|
3
|
+
import type { QueryObject } from "@/types/entityQuery";
|
|
4
|
+
import type { AnyRecord } from "@/types/anyRecord";
|
|
5
|
+
import type { FilterExpression } from "@/types/entityQuery";
|
|
6
|
+
import type { Portfolio, PortfolioListResponse, PortfolioSingleResponse } from "@/types/portfolio";
|
|
7
|
+
|
|
8
|
+
const baseUrl = "portfolios";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* getPortfolio
|
|
12
|
+
*
|
|
13
|
+
* Fetches a single portfolio by ID.
|
|
14
|
+
*
|
|
15
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
16
|
+
* @param {string} id - Portfolio identifier.
|
|
17
|
+
* @param {string} workspace - Workspace the portfolio belongs to.
|
|
18
|
+
* @returns {Promise<PortfolioSingleResponse>} The fetched portfolio response.
|
|
19
|
+
*
|
|
20
|
+
* @throws {Error} If the request fails.
|
|
21
|
+
*/
|
|
22
|
+
export const getPortfolio = async (api: AxiosInstance, id: string, workspace: string): Promise<PortfolioSingleResponse> => {
|
|
23
|
+
const params: AnyRecord = { workspace };
|
|
24
|
+
|
|
25
|
+
if(!workspace){
|
|
26
|
+
throw new Error("Workspace is required to fetch a portfolio");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
const response: AxiosResponse<PortfolioSingleResponse> = await api.get(`${baseUrl}/${id}`, { params });
|
|
31
|
+
return response.data;
|
|
32
|
+
} catch (error: unknown) {
|
|
33
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
34
|
+
throw new Error(error.message || "Error while fetching portfolio");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (error instanceof Error) {
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
throw new Error("Error while fetching portfolio");
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* listPortfolios
|
|
47
|
+
*
|
|
48
|
+
* Fetches a list of portfolios using a query object (filters, order, pagination, etc.).
|
|
49
|
+
*
|
|
50
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
51
|
+
* @param {QueryObject} query - Query object built via `buildQueryObject`.
|
|
52
|
+
* @returns {Promise<PortfolioListResponse>} List of portfolios.
|
|
53
|
+
*
|
|
54
|
+
* @throws {Error} If the request fails.
|
|
55
|
+
*/
|
|
56
|
+
export const listPortfolios = async (api: AxiosInstance, query: QueryObject): Promise<PortfolioListResponse> => {
|
|
57
|
+
const workspaceFilter = query.filters.find((filter: FilterExpression) => filter[0] === "workspace");
|
|
58
|
+
const workspace = workspaceFilter?.[workspaceFilter.length - 1];
|
|
59
|
+
|
|
60
|
+
if (!workspace) {
|
|
61
|
+
throw new Error("Workspace is required to fetch portfolios");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const params: AnyRecord = {
|
|
65
|
+
workspace,
|
|
66
|
+
...(query ? { query: JSON.stringify(query) } : {}),
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
const response: AxiosResponse<PortfolioListResponse> = await api.get(baseUrl, { params });
|
|
71
|
+
return response.data;
|
|
72
|
+
} catch (error: unknown) {
|
|
73
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
74
|
+
throw new Error(error.message || "Error while fetching portfolios");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (error instanceof Error) {
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
throw new Error("Error while fetching portfolios");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* createPortfolio
|
|
87
|
+
*
|
|
88
|
+
* Creates a new portfolio.
|
|
89
|
+
*
|
|
90
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
91
|
+
* @param {Partial<Portfolio>} data - Portfolio payload.
|
|
92
|
+
* @returns {Promise<Portfolio>} The created portfolio.
|
|
93
|
+
*
|
|
94
|
+
* @throws {Error} If the request fails.
|
|
95
|
+
*/
|
|
96
|
+
export const createPortfolio = async (api: AxiosInstance, data: Partial<Portfolio>): Promise<Portfolio> => {
|
|
97
|
+
|
|
98
|
+
const { workspace } = data;
|
|
99
|
+
|
|
100
|
+
if (!workspace) {
|
|
101
|
+
throw new Error("Workspace is required to post a portfolio");
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const response: AxiosResponse<Portfolio> = await api.post(baseUrl, data);
|
|
106
|
+
return response.data;
|
|
107
|
+
} catch (error: unknown) {
|
|
108
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
109
|
+
throw new Error(error.message || "Error while creating portfolio");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (error instanceof Error) {
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
throw new Error("Error while creating portfolio");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* updatePortfolio
|
|
122
|
+
*
|
|
123
|
+
* Updates an existing portfolio by ID.
|
|
124
|
+
*
|
|
125
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
126
|
+
* @param {string} id - Portfolio identifier.
|
|
127
|
+
* @param {Partial<Portfolio>} data - Fields to update.
|
|
128
|
+
* @returns {Promise<Portfolio>} The updated portfolio.
|
|
129
|
+
*
|
|
130
|
+
* @throws {Error} If the request fails.
|
|
131
|
+
*/
|
|
132
|
+
export const updatePortfolio = async (api: AxiosInstance, id: string, data: Partial<Portfolio>): Promise<Portfolio> => {
|
|
133
|
+
|
|
134
|
+
const { workspace } = data;
|
|
135
|
+
|
|
136
|
+
if(!workspace) {
|
|
137
|
+
throw new Error("Workspace is required to delete a portfolio");
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
const response: AxiosResponse<Portfolio> = await api.put(`${baseUrl}/${id}`, data);
|
|
142
|
+
return response.data;
|
|
143
|
+
} catch (error: unknown) {
|
|
144
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
145
|
+
throw new Error(error.message || "Error while updating portfolio");
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (error instanceof Error) {
|
|
149
|
+
throw error;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
throw new Error("Error while updating portfolio");
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* deletePortfolio
|
|
158
|
+
*
|
|
159
|
+
* Deletes a portfolio by ID.
|
|
160
|
+
*
|
|
161
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
162
|
+
* @param {string} id - Portfolio identifier.
|
|
163
|
+
* @param {string} workspace - Workspace the portfolio belongs to.
|
|
164
|
+
* @returns {Promise<Portfolio>} The deleted portfolio.
|
|
165
|
+
*
|
|
166
|
+
* @throws {Error} If the request fails.
|
|
167
|
+
*/
|
|
168
|
+
export const deletePortfolio = async (api: AxiosInstance, id: string, workspace: string): Promise<Portfolio> => {
|
|
169
|
+
|
|
170
|
+
if(!workspace) {
|
|
171
|
+
throw new Error("Workspace is required to delete a portfolio");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const params: AnyRecord = { workspace };
|
|
175
|
+
|
|
176
|
+
try {
|
|
177
|
+
const response: AxiosResponse<Portfolio> = await api.delete(`${baseUrl}/${id}`, { params });
|
|
178
|
+
return response.data;
|
|
179
|
+
} catch (error: unknown) {
|
|
180
|
+
if (isAxiosError<AnyRecord>(error)) {
|
|
181
|
+
throw new Error(error.message || "Error while deleting portfolio");
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (error instanceof Error) {
|
|
185
|
+
throw error;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
throw new Error("Error while deleting portfolio");
|
|
189
|
+
}
|
|
190
|
+
}
|