@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,125 @@
|
|
|
1
|
+
import { isAxiosError } from "axios";
|
|
2
|
+
//#region src/api/datastore.ts
|
|
3
|
+
var baseUrl = "datastores";
|
|
4
|
+
/**
|
|
5
|
+
* getDatastore
|
|
6
|
+
*
|
|
7
|
+
* Fetches a single datastore by ID.
|
|
8
|
+
*
|
|
9
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
10
|
+
* @param {string} id - Datastore identifier.
|
|
11
|
+
* @param {string} workspace - Workspace the datastore belongs to.
|
|
12
|
+
* @returns {Promise<Datastore>} The fetched datastore.
|
|
13
|
+
*
|
|
14
|
+
* @throws {Error} If the request fails.
|
|
15
|
+
*/
|
|
16
|
+
var getDatastore = async (api, id, workspace) => {
|
|
17
|
+
const params = { workspace };
|
|
18
|
+
if (!workspace) throw new Error("Workspace filter is required to fetch a datastore");
|
|
19
|
+
try {
|
|
20
|
+
return (await api.get(`${baseUrl}/${id}`, { params })).data.datastore;
|
|
21
|
+
} catch (error) {
|
|
22
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error fetching datastore");
|
|
23
|
+
if (error instanceof Error) throw error;
|
|
24
|
+
throw new Error("Error fetching datastore");
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* listDatastores
|
|
29
|
+
*
|
|
30
|
+
* Fetches a list of datastores using a query object (filters, order, pagination, etc.).
|
|
31
|
+
*
|
|
32
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
33
|
+
* @param {AnyRecord} query - Query object built via `buildQueryObject`.
|
|
34
|
+
* @returns {Promise<DatastoreListResponse>} Paginated list of datastores.
|
|
35
|
+
*
|
|
36
|
+
* @throws {Error} If workspace filter is missing.
|
|
37
|
+
* @throws {Error} If the request fails.
|
|
38
|
+
*/
|
|
39
|
+
var listDatastores = async (api, query) => {
|
|
40
|
+
const workspaceFilter = query.filters.find((filter) => filter[0] === "workspace");
|
|
41
|
+
const workspace = workspaceFilter?.[workspaceFilter.length - 1];
|
|
42
|
+
if (!workspace) throw new Error("Workspace filter is required to list datastores");
|
|
43
|
+
const params = {
|
|
44
|
+
workspace,
|
|
45
|
+
...query ? { query: JSON.stringify(query) } : {}
|
|
46
|
+
};
|
|
47
|
+
try {
|
|
48
|
+
return (await api.get(baseUrl, { params })).data;
|
|
49
|
+
} catch (error) {
|
|
50
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error listing datastores");
|
|
51
|
+
if (error instanceof Error) throw error;
|
|
52
|
+
throw new Error("Error listing datastores");
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* createDatastore
|
|
57
|
+
*
|
|
58
|
+
* Creates a new datastore.
|
|
59
|
+
*
|
|
60
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
61
|
+
* @param {Partial<Datastore>} data - Datastore payload.
|
|
62
|
+
* @returns {Promise<Datastore>} The created datastore.
|
|
63
|
+
*
|
|
64
|
+
* @throws {Error} If the request fails.
|
|
65
|
+
*/
|
|
66
|
+
var createDatastore = async (api, data) => {
|
|
67
|
+
const { workspace } = data;
|
|
68
|
+
if (!workspace) throw new Error("Workspace filter is required to create a datastore");
|
|
69
|
+
try {
|
|
70
|
+
return (await api.post(baseUrl, data)).data.datastore;
|
|
71
|
+
} catch (error) {
|
|
72
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error creating datastore");
|
|
73
|
+
if (error instanceof Error) throw error;
|
|
74
|
+
throw new Error("Error creating datastore");
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* updateDatastore
|
|
79
|
+
*
|
|
80
|
+
* Updates an existing datastore by ID.
|
|
81
|
+
*
|
|
82
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
83
|
+
* @param {string} id - Datastore identifier.
|
|
84
|
+
* @param {Partial<Datastore>} data - Fields to update.
|
|
85
|
+
* @returns {Promise<Datastore>} The updated datastore.
|
|
86
|
+
*
|
|
87
|
+
* @throws {Error} If the request fails.
|
|
88
|
+
*/
|
|
89
|
+
var updateDatastore = async (api, id, data) => {
|
|
90
|
+
const { workspace } = data;
|
|
91
|
+
if (!workspace) throw new Error("Workspace filter is required to update a datastore");
|
|
92
|
+
try {
|
|
93
|
+
return (await api.put(`${baseUrl}/${id}`, data)).data.datastore;
|
|
94
|
+
} catch (error) {
|
|
95
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error updating datastore");
|
|
96
|
+
if (error instanceof Error) throw error;
|
|
97
|
+
throw new Error("Error updating datastore");
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* deleteDatastore
|
|
102
|
+
*
|
|
103
|
+
* Deletes a datastore by ID.
|
|
104
|
+
*
|
|
105
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
106
|
+
* @param {string} id - Datastore identifier.
|
|
107
|
+
* @param {string} workspace - Workspace the datastore belongs to.
|
|
108
|
+
* @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.
|
|
109
|
+
*
|
|
110
|
+
* @throws {Error} If the request fails.
|
|
111
|
+
*/
|
|
112
|
+
var deleteDatastore = async (api, id, workspace) => {
|
|
113
|
+
const params = { workspace };
|
|
114
|
+
try {
|
|
115
|
+
return (await api.delete(`${baseUrl}/${id}`, { params })).data.datastores;
|
|
116
|
+
} catch (error) {
|
|
117
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error removing datastore");
|
|
118
|
+
if (error instanceof Error) throw error;
|
|
119
|
+
throw new Error("Error removing datastore");
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
//#endregion
|
|
123
|
+
export { createDatastore, deleteDatastore, getDatastore, listDatastores, updateDatastore };
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=datastore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datastore.js","names":[],"sources":["../../src/api/datastore.ts"],"sourcesContent":["import { isAxiosError, type AxiosInstance, type AxiosResponse } from \"axios\";\n\nimport type { AnyRecord } from \"@/types/anyRecord\";\nimport type { DeleteEntityDefaultResponse, FilterExpression, QueryObject } from \"@/types/entityQuery\";\nimport type { Datastore, DatastoreSingleResponse, DatastoreListResponse, DeleteDatastoreResponse } from \"@/types/datastore\";\n\nconst baseUrl = \"datastores\";\n\n/**\n * getDatastore\n *\n * Fetches a single datastore by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - Datastore identifier.\n * @param {string} workspace - Workspace the datastore belongs to.\n * @returns {Promise<Datastore>} The fetched datastore.\n *\n * @throws {Error} If the request fails.\n */\nexport const getDatastore = async (api: AxiosInstance, id: string, workspace: string): Promise<Datastore> => {\n const params: AnyRecord = { workspace };\n\n if (!workspace) throw new Error(\"Workspace filter is required to fetch a datastore\");\n\n try {\n const response: AxiosResponse<DatastoreSingleResponse> = await api.get(`${baseUrl}/${id}`, { params });\n return response.data.datastore;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error fetching datastore\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error fetching datastore\");\n }\n};\n\n/**\n * listDatastores\n *\n * Fetches a list of datastores using a query object (filters, order, pagination, etc.).\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {AnyRecord} query - Query object built via `buildQueryObject`.\n * @returns {Promise<DatastoreListResponse>} Paginated list of datastores.\n *\n * @throws {Error} If workspace filter is missing.\n * @throws {Error} If the request fails.\n */\nexport const listDatastores = async (api: AxiosInstance, query: QueryObject): Promise<DatastoreListResponse> => {\n const workspaceFilter = query.filters.find((filter: FilterExpression) => filter[0] === \"workspace\");\n const workspace = workspaceFilter?.[workspaceFilter.length - 1];\n\n if (!workspace) throw new Error(\"Workspace filter is required to list datastores\");\n\n const params: AnyRecord = {\n workspace,\n ...(query ? { query: JSON.stringify(query) } : {}),\n };\n\n try {\n const response: AxiosResponse<DatastoreListResponse> = await api.get(baseUrl, { params });\n return response.data;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error listing datastores\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error listing datastores\");\n }\n};\n\n/**\n * createDatastore\n *\n * Creates a new datastore.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {Partial<Datastore>} data - Datastore payload.\n * @returns {Promise<Datastore>} The created datastore.\n *\n * @throws {Error} If the request fails.\n */\nexport const createDatastore = async (api: AxiosInstance, data: Partial<Datastore>): Promise<Datastore> => {\n\n const { workspace } = data;\n if (!workspace) throw new Error(\"Workspace filter is required to create a datastore\");\n\n try {\n const response: AxiosResponse<DatastoreSingleResponse> = await api.post(baseUrl, data);\n return response.data.datastore;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error creating datastore\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error creating datastore\");\n }\n};\n\n/**\n * updateDatastore\n *\n * Updates an existing datastore by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - Datastore identifier.\n * @param {Partial<Datastore>} data - Fields to update.\n * @returns {Promise<Datastore>} The updated datastore.\n *\n * @throws {Error} If the request fails.\n */\nexport const updateDatastore = async (api: AxiosInstance, id: string, data: Partial<Datastore>): Promise<Datastore> => {\n\n const { workspace } = data;\n if (!workspace) throw new Error(\"Workspace filter is required to update a datastore\");\n\n try {\n const response: AxiosResponse<DatastoreSingleResponse> = await api.put(`${baseUrl}/${id}`, data);\n return response.data.datastore;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error updating datastore\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error updating datastore\");\n }\n};\n\n/**\n * deleteDatastore\n *\n * Deletes a datastore by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - Datastore identifier.\n * @param {string} workspace - Workspace the datastore belongs to.\n * @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.\n *\n * @throws {Error} If the request fails.\n */\nexport const deleteDatastore = async (api: AxiosInstance, id: string, workspace: string): Promise<DeleteEntityDefaultResponse[]> => {\n const params: AnyRecord = { workspace };\n\n try {\n const response: AxiosResponse<DeleteDatastoreResponse> = await api.delete(`${baseUrl}/${id}`, { params });\n return response.data.datastores;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error removing datastore\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error removing datastore\");\n }\n};"],"mappings":";;AAMA,IAAM,UAAU;;;;;;;;;;;;;AAchB,IAAa,eAAe,OAAO,KAAoB,IAAY,cAA0C;CAC3G,MAAM,SAAoB,EAAE,UAAU;CAEtC,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,mDAAmD;CAEnF,IAAI;EAEF,QAAO,MADwD,IAAI,IAAI,GAAG,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,EAAA,CACrF,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF;;;;;;;;;;;;;AAcA,IAAa,iBAAiB,OAAO,KAAoB,UAAuD;CAC9G,MAAM,kBAAkB,MAAM,QAAQ,MAAM,WAA6B,OAAO,OAAO,WAAW;CAClG,MAAM,YAAY,kBAAkB,gBAAgB,SAAS;CAE7D,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,iDAAiD;CAEjF,MAAM,SAAoB;EACxB;EACA,GAAI,QAAQ,EAAE,OAAO,KAAK,UAAU,KAAK,EAAE,IAAI,CAAC;CAClD;CAEA,IAAI;EAEF,QAAO,MADsD,IAAI,IAAI,SAAS,EAAE,OAAO,CAAC,EAAA,CACxE;CAClB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF;;;;;;;;;;;;AAaA,IAAa,kBAAkB,OAAO,KAAoB,SAAiD;CAEzG,MAAM,EAAE,cAAc;CACtB,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,oDAAoD;CAEpF,IAAI;EAEF,QAAO,MADwD,IAAI,KAAK,SAAS,IAAI,EAAA,CACrE,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF;;;;;;;;;;;;;AAcA,IAAa,kBAAkB,OAAO,KAAoB,IAAY,SAAiD;CAErH,MAAM,EAAE,cAAc;CACtB,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,oDAAoD;CAEpF,IAAI;EAEF,QAAO,MADwD,IAAI,IAAI,GAAG,QAAQ,GAAG,MAAM,IAAI,EAAA,CAC/E,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF;;;;;;;;;;;;;AAcA,IAAa,kBAAkB,OAAO,KAAoB,IAAY,cAA8D;CAClI,MAAM,SAAoB,EAAE,UAAU;CAEtC,IAAI;EAEF,QAAO,MADwD,IAAI,OAAO,GAAG,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,EAAA,CACxF,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,0BAA0B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,0BAA0B;CAC5C;AACF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { FilterClause, FilterExpression, EntityQueryParams, QueryObject } from "../types/entityQuery.d.ts";
|
|
2
|
+
/**
|
|
3
|
+
* toFilterTuple
|
|
4
|
+
*
|
|
5
|
+
* Converts a `FilterClause` object into a `FilterExpression` tuple
|
|
6
|
+
* compatible with the API query format.
|
|
7
|
+
*
|
|
8
|
+
* - If no operator is provided or operator is `"="`, returns a 2-tuple `[field, value]`.
|
|
9
|
+
* - Otherwise, returns a 3-tuple `[field, op, value]`.
|
|
10
|
+
*
|
|
11
|
+
* @param {FilterClause} filter - Filter clause to convert.
|
|
12
|
+
* @returns {FilterExpression} Tuple representation of the filter.
|
|
13
|
+
*
|
|
14
|
+
* Examples:
|
|
15
|
+
* ```ts
|
|
16
|
+
* toFilterTuple({ field: "workspace", value: "ws-1" })
|
|
17
|
+
* // -> ["workspace", "ws-1"]
|
|
18
|
+
*
|
|
19
|
+
* toFilterTuple({ field: "age", op: ">=", value: 18 })
|
|
20
|
+
* // -> ["age", ">=", 18]
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const toFilterTuple: (filter: FilterClause) => FilterExpression;
|
|
24
|
+
/**
|
|
25
|
+
* buildQueryObject
|
|
26
|
+
*
|
|
27
|
+
* Builds the query payload object to be sent to the API,
|
|
28
|
+
* converting filters, ordering, pagination, and projection into the expected format.
|
|
29
|
+
*
|
|
30
|
+
* @param {EntityQueryParams} params - Query parameters.
|
|
31
|
+
* @param {FilterClause[]} params.filters - Filters to apply (converted via `toFilterTuple`).
|
|
32
|
+
* @param {string[]} params.order - Sorting fields.
|
|
33
|
+
* @param {number} [params.pageSize] - Number of items per page.
|
|
34
|
+
* @param {string} [params.pageToken] - Cursor token for the next page.
|
|
35
|
+
* @param {string} [params.projection] - Single field to project. `"field"` returns only that
|
|
36
|
+
* field (every other field comes back null); `"-field"` returns all fields except that one.
|
|
37
|
+
* One field only — comma/space lists return a 500. Omitted from payload if empty.
|
|
38
|
+
* @returns {QueryObject} Query payload ready to be passed to the API.
|
|
39
|
+
*
|
|
40
|
+
* Example:
|
|
41
|
+
* ```ts
|
|
42
|
+
* buildQueryObject({
|
|
43
|
+
* filters: [{ field: "workspace", value: "ws-1" }],
|
|
44
|
+
* order: ["name"], // plain field name(s) only — no "asc"/"desc" suffix
|
|
45
|
+
* pageSize: 10,
|
|
46
|
+
* pageToken: "token-abc",
|
|
47
|
+
* projection: "name",
|
|
48
|
+
* });
|
|
49
|
+
* // -> {
|
|
50
|
+
* // filters: [["workspace", "ws-1"]],
|
|
51
|
+
* // order: ["name"],
|
|
52
|
+
* // projection: "name",
|
|
53
|
+
* // page_size: 10,
|
|
54
|
+
* // page_token: "token-abc",
|
|
55
|
+
* // }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare const buildQueryObject: (params: EntityQueryParams) => QueryObject;
|
|
59
|
+
/**
|
|
60
|
+
* buildQueryKey
|
|
61
|
+
*
|
|
62
|
+
* Builds a stable React Query cache key by combining a base key array
|
|
63
|
+
* with the values of the provided filters.
|
|
64
|
+
*
|
|
65
|
+
* This ensures the query is re-executed whenever filter values change.
|
|
66
|
+
*
|
|
67
|
+
* @param {(string | number)[]} keys - Base keys (e.g. entity name, id).
|
|
68
|
+
* @param {FilterClause[]} filters - Filters whose values are appended to the key.
|
|
69
|
+
* @returns {unknown[]} Cache key array for use in `queryKey`.
|
|
70
|
+
*
|
|
71
|
+
* Example:
|
|
72
|
+
* ```ts
|
|
73
|
+
* buildQueryKey(["datastores"], [{ field: "workspace", value: "ws-1" }]);
|
|
74
|
+
* // -> ["datastores", "ws-1"]
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare const buildQueryKey: (keys: (string | number)[], filters: FilterClause[]) => unknown[];
|
|
78
|
+
//# sourceMappingURL=entityQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityQuery.d.ts","sourceRoot":"","sources":["../../src/api/entityQuery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE1G;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,YAAY,KAAG,gBAMpD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,iBAAiB,KAAG,WAU5D,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa,GAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,EAAE,SAAS,YAAY,EAAE,KAAG,OAAO,EAKzF,CAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
//#region src/api/entityQuery.ts
|
|
2
|
+
/**
|
|
3
|
+
* toFilterTuple
|
|
4
|
+
*
|
|
5
|
+
* Converts a `FilterClause` object into a `FilterExpression` tuple
|
|
6
|
+
* compatible with the API query format.
|
|
7
|
+
*
|
|
8
|
+
* - If no operator is provided or operator is `"="`, returns a 2-tuple `[field, value]`.
|
|
9
|
+
* - Otherwise, returns a 3-tuple `[field, op, value]`.
|
|
10
|
+
*
|
|
11
|
+
* @param {FilterClause} filter - Filter clause to convert.
|
|
12
|
+
* @returns {FilterExpression} Tuple representation of the filter.
|
|
13
|
+
*
|
|
14
|
+
* Examples:
|
|
15
|
+
* ```ts
|
|
16
|
+
* toFilterTuple({ field: "workspace", value: "ws-1" })
|
|
17
|
+
* // -> ["workspace", "ws-1"]
|
|
18
|
+
*
|
|
19
|
+
* toFilterTuple({ field: "age", op: ">=", value: 18 })
|
|
20
|
+
* // -> ["age", ">=", 18]
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
var toFilterTuple = (filter) => {
|
|
24
|
+
const { field, op, value } = filter;
|
|
25
|
+
if (!op || op === "=") return [field, value];
|
|
26
|
+
return [
|
|
27
|
+
field,
|
|
28
|
+
op,
|
|
29
|
+
value
|
|
30
|
+
];
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* buildQueryObject
|
|
34
|
+
*
|
|
35
|
+
* Builds the query payload object to be sent to the API,
|
|
36
|
+
* converting filters, ordering, pagination, and projection into the expected format.
|
|
37
|
+
*
|
|
38
|
+
* @param {EntityQueryParams} params - Query parameters.
|
|
39
|
+
* @param {FilterClause[]} params.filters - Filters to apply (converted via `toFilterTuple`).
|
|
40
|
+
* @param {string[]} params.order - Sorting fields.
|
|
41
|
+
* @param {number} [params.pageSize] - Number of items per page.
|
|
42
|
+
* @param {string} [params.pageToken] - Cursor token for the next page.
|
|
43
|
+
* @param {string} [params.projection] - Single field to project. `"field"` returns only that
|
|
44
|
+
* field (every other field comes back null); `"-field"` returns all fields except that one.
|
|
45
|
+
* One field only — comma/space lists return a 500. Omitted from payload if empty.
|
|
46
|
+
* @returns {QueryObject} Query payload ready to be passed to the API.
|
|
47
|
+
*
|
|
48
|
+
* Example:
|
|
49
|
+
* ```ts
|
|
50
|
+
* buildQueryObject({
|
|
51
|
+
* filters: [{ field: "workspace", value: "ws-1" }],
|
|
52
|
+
* order: ["name"], // plain field name(s) only — no "asc"/"desc" suffix
|
|
53
|
+
* pageSize: 10,
|
|
54
|
+
* pageToken: "token-abc",
|
|
55
|
+
* projection: "name",
|
|
56
|
+
* });
|
|
57
|
+
* // -> {
|
|
58
|
+
* // filters: [["workspace", "ws-1"]],
|
|
59
|
+
* // order: ["name"],
|
|
60
|
+
* // projection: "name",
|
|
61
|
+
* // page_size: 10,
|
|
62
|
+
* // page_token: "token-abc",
|
|
63
|
+
* // }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
var buildQueryObject = (params) => {
|
|
67
|
+
const { filters, pageSize, pageToken, order, projection } = params;
|
|
68
|
+
return {
|
|
69
|
+
filters: filters.map(toFilterTuple),
|
|
70
|
+
order,
|
|
71
|
+
...!!projection && { projection },
|
|
72
|
+
page_size: pageSize,
|
|
73
|
+
page_token: pageToken
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* buildQueryKey
|
|
78
|
+
*
|
|
79
|
+
* Builds a stable React Query cache key by combining a base key array
|
|
80
|
+
* with the values of the provided filters.
|
|
81
|
+
*
|
|
82
|
+
* This ensures the query is re-executed whenever filter values change.
|
|
83
|
+
*
|
|
84
|
+
* @param {(string | number)[]} keys - Base keys (e.g. entity name, id).
|
|
85
|
+
* @param {FilterClause[]} filters - Filters whose values are appended to the key.
|
|
86
|
+
* @returns {unknown[]} Cache key array for use in `queryKey`.
|
|
87
|
+
*
|
|
88
|
+
* Example:
|
|
89
|
+
* ```ts
|
|
90
|
+
* buildQueryKey(["datastores"], [{ field: "workspace", value: "ws-1" }]);
|
|
91
|
+
* // -> ["datastores", "ws-1"]
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
var buildQueryKey = (keys, filters) => {
|
|
95
|
+
return [...keys, ...filters.flatMap((filter) => filter.value)];
|
|
96
|
+
};
|
|
97
|
+
//#endregion
|
|
98
|
+
export { buildQueryKey, buildQueryObject, toFilterTuple };
|
|
99
|
+
|
|
100
|
+
//# sourceMappingURL=entityQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityQuery.js","names":[],"sources":["../../src/api/entityQuery.ts"],"sourcesContent":["import type { FilterClause, FilterExpression, EntityQueryParams, QueryObject } from \"@/types/entityQuery\";\n\n/**\n * toFilterTuple\n *\n * Converts a `FilterClause` object into a `FilterExpression` tuple\n * compatible with the API query format.\n *\n * - If no operator is provided or operator is `\"=\"`, returns a 2-tuple `[field, value]`.\n * - Otherwise, returns a 3-tuple `[field, op, value]`.\n *\n * @param {FilterClause} filter - Filter clause to convert.\n * @returns {FilterExpression} Tuple representation of the filter.\n *\n * Examples:\n * ```ts\n * toFilterTuple({ field: \"workspace\", value: \"ws-1\" })\n * // -> [\"workspace\", \"ws-1\"]\n *\n * toFilterTuple({ field: \"age\", op: \">=\", value: 18 })\n * // -> [\"age\", \">=\", 18]\n * ```\n */\nexport const toFilterTuple = (filter: FilterClause): FilterExpression => {\n const { field, op, value } = filter;\n if (!op || op === '=') {\n return [field, value];\n }\n return [field, op, value];\n};\n\n/**\n * buildQueryObject\n *\n * Builds the query payload object to be sent to the API,\n * converting filters, ordering, pagination, and projection into the expected format.\n *\n * @param {EntityQueryParams} params - Query parameters.\n * @param {FilterClause[]} params.filters - Filters to apply (converted via `toFilterTuple`).\n * @param {string[]} params.order - Sorting fields.\n * @param {number} [params.pageSize] - Number of items per page.\n * @param {string} [params.pageToken] - Cursor token for the next page.\n * @param {string} [params.projection] - Single field to project. `\"field\"` returns only that\n * field (every other field comes back null); `\"-field\"` returns all fields except that one.\n * One field only — comma/space lists return a 500. Omitted from payload if empty.\n * @returns {QueryObject} Query payload ready to be passed to the API.\n *\n * Example:\n * ```ts\n * buildQueryObject({\n * filters: [{ field: \"workspace\", value: \"ws-1\" }],\n * order: [\"name\"], // plain field name(s) only — no \"asc\"/\"desc\" suffix\n * pageSize: 10,\n * pageToken: \"token-abc\",\n * projection: \"name\",\n * });\n * // -> {\n * // filters: [[\"workspace\", \"ws-1\"]],\n * // order: [\"name\"],\n * // projection: \"name\",\n * // page_size: 10,\n * // page_token: \"token-abc\",\n * // }\n * ```\n */\nexport const buildQueryObject = (params: EntityQueryParams): QueryObject => {\n const { filters, pageSize, pageToken, order, projection } = params;\n\n return {\n filters: filters.map(toFilterTuple),\n order,\n ...(!!projection && { projection }),\n page_size: pageSize,\n page_token: pageToken,\n };\n}\n\n/**\n * buildQueryKey\n *\n * Builds a stable React Query cache key by combining a base key array\n * with the values of the provided filters.\n *\n * This ensures the query is re-executed whenever filter values change.\n *\n * @param {(string | number)[]} keys - Base keys (e.g. entity name, id).\n * @param {FilterClause[]} filters - Filters whose values are appended to the key.\n * @returns {unknown[]} Cache key array for use in `queryKey`.\n *\n * Example:\n * ```ts\n * buildQueryKey([\"datastores\"], [{ field: \"workspace\", value: \"ws-1\" }]);\n * // -> [\"datastores\", \"ws-1\"]\n * ```\n */\nexport const buildQueryKey = (keys: (string | number)[], filters: FilterClause[]): unknown[] => {\n return [\n ...keys,\n ...filters.flatMap((filter) => filter.value)\n ];\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,iBAAiB,WAA2C;CACrE,MAAM,EAAE,OAAO,IAAI,UAAU;CAC7B,IAAI,CAAC,MAAM,OAAO,KACd,OAAO,CAAC,OAAO,KAAK;CAExB,OAAO;EAAC;EAAO;EAAI;CAAK;AAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,IAAa,oBAAoB,WAA2C;CACxE,MAAM,EAAE,SAAS,UAAU,WAAW,OAAO,eAAe;CAE5D,OAAO;EACH,SAAS,QAAQ,IAAI,aAAa;EAClC;EACA,GAAI,CAAC,CAAC,cAAc,EAAE,WAAW;EACjC,WAAW;EACX,YAAY;CAChB;AACJ;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,iBAAiB,MAA2B,YAAuC;CAC5F,OAAO,CACH,GAAG,MACH,GAAG,QAAQ,SAAS,WAAW,OAAO,KAAK,CAC/C;AACJ"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type AxiosInstance } from "axios";
|
|
2
|
+
import type { EveryskFile, FileListResponse } from "../types/file.d.ts";
|
|
3
|
+
import type { DeleteEntityDefaultResponse, QueryObject } from "../types/entityQuery.d.ts";
|
|
4
|
+
/**
|
|
5
|
+
* getFile
|
|
6
|
+
*
|
|
7
|
+
* Fetches a single file by ID.
|
|
8
|
+
*
|
|
9
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
10
|
+
* @param {string} id - EveryskFile identifier.
|
|
11
|
+
* @param {string} workspace - Workspace the file belongs to.
|
|
12
|
+
* @returns {Promise<EveryskFile>} The fetched file.
|
|
13
|
+
*
|
|
14
|
+
* @throws {Error} If the request fails.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getFile: (api: AxiosInstance, id: string, workspace: string) => Promise<EveryskFile>;
|
|
17
|
+
/**
|
|
18
|
+
* listFiles
|
|
19
|
+
*
|
|
20
|
+
* Fetches a list of files using a query object (filters, order, pagination, etc.).
|
|
21
|
+
*
|
|
22
|
+
* Note: `workspace` is extracted from the query filters and sent as a separate
|
|
23
|
+
* query param alongside the serialized query object.
|
|
24
|
+
*
|
|
25
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
26
|
+
* @param {QueryObject} query - Query object built via `buildQueryObject`.
|
|
27
|
+
* @returns {Promise<EveryskFile[]>} List of files. Returns an empty array if none found.
|
|
28
|
+
*
|
|
29
|
+
* @throws {Error} If the request fails.
|
|
30
|
+
*/
|
|
31
|
+
export declare const listFiles: (api: AxiosInstance, query: QueryObject) => Promise<FileListResponse>;
|
|
32
|
+
/**
|
|
33
|
+
* createFile
|
|
34
|
+
*
|
|
35
|
+
* Creates a new file.
|
|
36
|
+
*
|
|
37
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
38
|
+
* @param {Partial<EveryskFile>} data - EveryskFile payload.
|
|
39
|
+
* @returns {Promise<EveryskFile>} The created file.
|
|
40
|
+
*
|
|
41
|
+
* @throws {Error} If the request fails.
|
|
42
|
+
*/
|
|
43
|
+
export declare const createFile: (api: AxiosInstance, data: Partial<EveryskFile>) => Promise<EveryskFile>;
|
|
44
|
+
/**
|
|
45
|
+
* updateFile
|
|
46
|
+
*
|
|
47
|
+
* Updates an existing file by ID.
|
|
48
|
+
*
|
|
49
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
50
|
+
* @param {string} id - EveryskFile identifier.
|
|
51
|
+
* @param {Partial<EveryskFile>} data - Fields to update.
|
|
52
|
+
* @returns {Promise<EveryskFile>} The updated file.
|
|
53
|
+
*
|
|
54
|
+
* @throws {Error} If the request fails.
|
|
55
|
+
*/
|
|
56
|
+
export declare const updateFile: (api: AxiosInstance, id: string, data: Partial<EveryskFile>) => Promise<EveryskFile>;
|
|
57
|
+
/**
|
|
58
|
+
* deleteFile
|
|
59
|
+
*
|
|
60
|
+
* Deletes a file by ID.
|
|
61
|
+
*
|
|
62
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
63
|
+
* @param {string} id - EveryskFile identifier.
|
|
64
|
+
* @param {string} workspace - Workspace the file belongs to.
|
|
65
|
+
* @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.
|
|
66
|
+
*
|
|
67
|
+
* @throws {Error} If the request fails.
|
|
68
|
+
*/
|
|
69
|
+
export declare const deleteFile: (api: AxiosInstance, id: string, workspace: string) => Promise<DeleteEntityDefaultResponse[]>;
|
|
70
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/api/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,aAAa,EAAsB,MAAM,OAAO,CAAC;AAG7E,OAAO,KAAK,EAAsB,WAAW,EAAE,gBAAgB,EAAsB,MAAM,cAAc,CAAC;AAC1G,OAAO,KAAK,EAAE,2BAA2B,EAAoB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAItG;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,WAAW,CAiBpG,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,GAAU,KAAK,aAAa,EAAE,OAAO,WAAW,KAAG,OAAO,CAAC,gBAAgB,CAwBhG,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAU,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,KAAG,OAAO,CAAC,WAAW,CAmBpG,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,KAAG,OAAO,CAAC,WAAW,CAmBhH,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,2BAA2B,EAAE,CAiBzH,CAAC"}
|
package/dist/api/file.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { isAxiosError } from "axios";
|
|
2
|
+
//#region src/api/file.ts
|
|
3
|
+
var baseUrl = "files";
|
|
4
|
+
/**
|
|
5
|
+
* getFile
|
|
6
|
+
*
|
|
7
|
+
* Fetches a single file by ID.
|
|
8
|
+
*
|
|
9
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
10
|
+
* @param {string} id - EveryskFile identifier.
|
|
11
|
+
* @param {string} workspace - Workspace the file belongs to.
|
|
12
|
+
* @returns {Promise<EveryskFile>} The fetched file.
|
|
13
|
+
*
|
|
14
|
+
* @throws {Error} If the request fails.
|
|
15
|
+
*/
|
|
16
|
+
var getFile = async (api, id, workspace) => {
|
|
17
|
+
const params = { workspace };
|
|
18
|
+
try {
|
|
19
|
+
return (await api.get(`${baseUrl}/${id}`, { params })).data.file;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error while fetching file");
|
|
22
|
+
if (error instanceof Error) throw error;
|
|
23
|
+
throw new Error("Error while fetching file");
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* listFiles
|
|
28
|
+
*
|
|
29
|
+
* Fetches a list of files using a query object (filters, order, pagination, etc.).
|
|
30
|
+
*
|
|
31
|
+
* Note: `workspace` is extracted from the query filters and sent as a separate
|
|
32
|
+
* query param alongside the serialized query object.
|
|
33
|
+
*
|
|
34
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
35
|
+
* @param {QueryObject} query - Query object built via `buildQueryObject`.
|
|
36
|
+
* @returns {Promise<EveryskFile[]>} List of files. Returns an empty array if none found.
|
|
37
|
+
*
|
|
38
|
+
* @throws {Error} If the request fails.
|
|
39
|
+
*/
|
|
40
|
+
var listFiles = async (api, query) => {
|
|
41
|
+
const workspaceFilter = query.filters.find((filter) => filter[0] === "workspace");
|
|
42
|
+
const workspace = workspaceFilter?.[workspaceFilter.length - 1];
|
|
43
|
+
if (!workspace) throw new Error("Workspace filter is required to list files");
|
|
44
|
+
const params = {
|
|
45
|
+
workspace,
|
|
46
|
+
...query ? { query: JSON.stringify(query) } : {}
|
|
47
|
+
};
|
|
48
|
+
try {
|
|
49
|
+
return (await api.get(baseUrl, { params })).data;
|
|
50
|
+
} catch (error) {
|
|
51
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error while fetching files");
|
|
52
|
+
if (error instanceof Error) throw error;
|
|
53
|
+
throw new Error("Error while fetching files");
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* createFile
|
|
58
|
+
*
|
|
59
|
+
* Creates a new file.
|
|
60
|
+
*
|
|
61
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
62
|
+
* @param {Partial<EveryskFile>} data - EveryskFile payload.
|
|
63
|
+
* @returns {Promise<EveryskFile>} The created file.
|
|
64
|
+
*
|
|
65
|
+
* @throws {Error} If the request fails.
|
|
66
|
+
*/
|
|
67
|
+
var createFile = async (api, data) => {
|
|
68
|
+
const { workspace } = data;
|
|
69
|
+
if (!workspace) throw new Error("Workspace filter is required to create a file");
|
|
70
|
+
try {
|
|
71
|
+
return (await api.post(baseUrl, data)).data.file;
|
|
72
|
+
} catch (error) {
|
|
73
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error while creating file");
|
|
74
|
+
if (error instanceof Error) throw error;
|
|
75
|
+
throw new Error("Error while creating file");
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* updateFile
|
|
80
|
+
*
|
|
81
|
+
* Updates an existing file by ID.
|
|
82
|
+
*
|
|
83
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
84
|
+
* @param {string} id - EveryskFile identifier.
|
|
85
|
+
* @param {Partial<EveryskFile>} data - Fields to update.
|
|
86
|
+
* @returns {Promise<EveryskFile>} The updated file.
|
|
87
|
+
*
|
|
88
|
+
* @throws {Error} If the request fails.
|
|
89
|
+
*/
|
|
90
|
+
var updateFile = async (api, id, data) => {
|
|
91
|
+
const { workspace } = data;
|
|
92
|
+
if (!workspace) throw new Error("Workspace filter is required to update a file");
|
|
93
|
+
try {
|
|
94
|
+
return (await api.put(`${baseUrl}/${id}`, data)).data.file;
|
|
95
|
+
} catch (error) {
|
|
96
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error while updating file");
|
|
97
|
+
if (error instanceof Error) throw error;
|
|
98
|
+
throw new Error("Error while updating file");
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* deleteFile
|
|
103
|
+
*
|
|
104
|
+
* Deletes a file by ID.
|
|
105
|
+
*
|
|
106
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
107
|
+
* @param {string} id - EveryskFile identifier.
|
|
108
|
+
* @param {string} workspace - Workspace the file belongs to.
|
|
109
|
+
* @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.
|
|
110
|
+
*
|
|
111
|
+
* @throws {Error} If the request fails.
|
|
112
|
+
*/
|
|
113
|
+
var deleteFile = async (api, id, workspace) => {
|
|
114
|
+
const params = { workspace };
|
|
115
|
+
try {
|
|
116
|
+
return (await api.delete(`${baseUrl}/${id}`, { params })).data.files;
|
|
117
|
+
} catch (error) {
|
|
118
|
+
if (isAxiosError(error)) throw new Error(error.message || "Error while deleting file");
|
|
119
|
+
if (error instanceof Error) throw error;
|
|
120
|
+
throw new Error("Error while deleting file");
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
//#endregion
|
|
124
|
+
export { createFile, deleteFile, getFile, listFiles, updateFile };
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.js","names":[],"sources":["../../src/api/file.ts"],"sourcesContent":["import { isAxiosError, type AxiosInstance, type AxiosResponse } from \"axios\";\n\nimport type { AnyRecord } from \"@/types/anyRecord\";\nimport type { DeleteFileResponse, EveryskFile, FileListResponse, FileSingleResponse } from \"@/types/file\";\nimport type { DeleteEntityDefaultResponse, FilterExpression, QueryObject } from \"@/types/entityQuery\";\n\nconst baseUrl = \"files\";\n\n/**\n * getFile\n *\n * Fetches a single file by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - EveryskFile identifier.\n * @param {string} workspace - Workspace the file belongs to.\n * @returns {Promise<EveryskFile>} The fetched file.\n *\n * @throws {Error} If the request fails.\n */\nexport const getFile = async (api: AxiosInstance, id: string, workspace: string): Promise<EveryskFile> => {\n const params: AnyRecord = { workspace };\n\n try {\n const response: AxiosResponse<FileSingleResponse> = await api.get(`${baseUrl}/${id}`, { params });\n return response.data.file;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while fetching file\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while fetching file\");\n }\n};\n\n/**\n * listFiles\n *\n * Fetches a list of files using a query object (filters, order, pagination, etc.).\n *\n * Note: `workspace` is extracted from the query filters and sent as a separate\n * query param alongside the serialized query object.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {QueryObject} query - Query object built via `buildQueryObject`.\n * @returns {Promise<EveryskFile[]>} List of files. Returns an empty array if none found.\n *\n * @throws {Error} If the request fails.\n */\nexport const listFiles = async (api: AxiosInstance, query: QueryObject): Promise<FileListResponse> => {\n const workspaceFilter = query.filters.find((filter: FilterExpression) => filter[0] === \"workspace\");\n const workspace = workspaceFilter?.[workspaceFilter.length - 1];\n \n if (!workspace) throw new Error(\"Workspace filter is required to list files\");\n\n const params: AnyRecord = {\n workspace,\n ...(query ? { query: JSON.stringify(query) } : {}),\n };\n\n try {\n const response: AxiosResponse<FileListResponse> = await api.get(baseUrl, { params });\n return response.data;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while fetching files\");\n } \n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while fetching files\");\n }\n};\n\n/**\n * createFile\n *\n * Creates a new file.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {Partial<EveryskFile>} data - EveryskFile payload.\n * @returns {Promise<EveryskFile>} The created file.\n *\n * @throws {Error} If the request fails.\n */\nexport const createFile = async (api: AxiosInstance, data: Partial<EveryskFile>): Promise<EveryskFile> => {\n\n const { workspace } = data;\n if (!workspace) throw new Error(\"Workspace filter is required to create a file\");\n\n try {\n const response: AxiosResponse<FileSingleResponse> = await api.post(baseUrl, data);\n return response.data.file;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while creating file\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while creating file\");\n }\n};\n\n/**\n * updateFile\n *\n * Updates an existing file by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - EveryskFile identifier.\n * @param {Partial<EveryskFile>} data - Fields to update.\n * @returns {Promise<EveryskFile>} The updated file.\n *\n * @throws {Error} If the request fails.\n */\nexport const updateFile = async (api: AxiosInstance, id: string, data: Partial<EveryskFile>): Promise<EveryskFile> => {\n\n const { workspace } = data;\n if (!workspace) throw new Error(\"Workspace filter is required to update a file\");\n\n try {\n const response: AxiosResponse<FileSingleResponse> = await api.put(`${baseUrl}/${id}`, data);\n return response.data.file;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while updating file\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while updating file\");\n }\n};\n\n/**\n * deleteFile\n *\n * Deletes a file by ID.\n *\n * @param {AxiosInstance} api - Axios instance.\n * @param {string} id - EveryskFile identifier.\n * @param {string} workspace - Workspace the file belongs to.\n * @returns {Promise<DeleteEntityDefaultResponse[]>} List of deleted entity records.\n *\n * @throws {Error} If the request fails.\n */\nexport const deleteFile = async (api: AxiosInstance, id: string, workspace: string): Promise<DeleteEntityDefaultResponse[]> => {\n const params: AnyRecord = { workspace };\n\n try {\n const response: AxiosResponse<DeleteFileResponse> = await api.delete(`${baseUrl}/${id}`, { params });\n return response.data.files;\n } catch (error: unknown) {\n if (isAxiosError<AnyRecord>(error)) {\n throw new Error(error.message || \"Error while deleting file\");\n }\n\n if (error instanceof Error) {\n throw error;\n }\n\n throw new Error(\"Error while deleting file\");\n }\n};"],"mappings":";;AAMA,IAAM,UAAU;;;;;;;;;;;;;AAchB,IAAa,UAAU,OAAO,KAAoB,IAAY,cAA4C;CACxG,MAAM,SAAoB,EAAE,UAAU;CAEtC,IAAI;EAEF,QAAO,MADmD,IAAI,IAAI,GAAG,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,EAAA,CAChF,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAChC,MAAM,IAAI,MAAM,MAAM,WAAW,2BAA2B;EAG7D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,2BAA2B;CAC7C;AACF;;;;;;;;;;;;;;;AAgBA,IAAa,YAAY,OAAO,KAAoB,UAAkD;CACpG,MAAM,kBAAkB,MAAM,QAAQ,MAAM,WAA6B,OAAO,OAAO,WAAW;CAClG,MAAM,YAAY,kBAAkB,gBAAgB,SAAS;CAE7D,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,4CAA4C;CAE5E,MAAM,SAAoB;EACxB;EACA,GAAI,QAAQ,EAAE,OAAO,KAAK,UAAU,KAAK,EAAE,IAAI,CAAC;CAClD;CAEA,IAAI;EAEF,QAAO,MADiD,IAAI,IAAI,SAAS,EAAE,OAAO,CAAC,EAAA,CACnE;CAClB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,4BAA4B;EAE/D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,4BAA4B;CAC9C;AACF;;;;;;;;;;;;AAaA,IAAa,aAAa,OAAO,KAAoB,SAAqD;CAExG,MAAM,EAAE,cAAc;CACtB,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,+CAA+C;CAE/E,IAAI;EAEF,QAAO,MADmD,IAAI,KAAK,SAAS,IAAI,EAAA,CAChE,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,2BAA2B;EAG9D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,2BAA2B;CAC7C;AACF;;;;;;;;;;;;;AAcA,IAAa,aAAa,OAAO,KAAoB,IAAY,SAAqD;CAElH,MAAM,EAAE,cAAc;CACtB,IAAI,CAAC,WAAW,MAAM,IAAI,MAAM,+CAA+C;CAE/E,IAAI;EAEA,QAAO,MADmD,IAAI,IAAI,GAAG,QAAQ,GAAG,MAAM,IAAI,EAAA,CAC1E,KAAK;CACzB,SAAS,OAAgB;EACrB,IAAI,aAAwB,KAAK,GAC7B,MAAM,IAAI,MAAM,MAAM,WAAW,2BAA2B;EAGhE,IAAI,iBAAiB,OACjB,MAAM;EAGV,MAAM,IAAI,MAAM,2BAA2B;CAC/C;AACJ;;;;;;;;;;;;;AAcA,IAAa,aAAa,OAAO,KAAoB,IAAY,cAA8D;CAC7H,MAAM,SAAoB,EAAE,UAAU;CAEtC,IAAI;EAEF,QAAO,MADmD,IAAI,OAAO,GAAG,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC,EAAA,CACnF,KAAK;CACvB,SAAS,OAAgB;EACvB,IAAI,aAAwB,KAAK,GAC/B,MAAM,IAAI,MAAM,MAAM,WAAW,2BAA2B;EAG9D,IAAI,iBAAiB,OACnB,MAAM;EAGR,MAAM,IAAI,MAAM,2BAA2B;CAC7C;AACF"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type AxiosInstance } from "axios";
|
|
2
|
+
import type { QueryObject } from "../types/entityQuery.d.ts";
|
|
3
|
+
import type { Portfolio, PortfolioListResponse, PortfolioSingleResponse } from "../types/portfolio.d.ts";
|
|
4
|
+
/**
|
|
5
|
+
* getPortfolio
|
|
6
|
+
*
|
|
7
|
+
* Fetches a single portfolio by ID.
|
|
8
|
+
*
|
|
9
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
10
|
+
* @param {string} id - Portfolio identifier.
|
|
11
|
+
* @param {string} workspace - Workspace the portfolio belongs to.
|
|
12
|
+
* @returns {Promise<PortfolioSingleResponse>} The fetched portfolio response.
|
|
13
|
+
*
|
|
14
|
+
* @throws {Error} If the request fails.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getPortfolio: (api: AxiosInstance, id: string, workspace: string) => Promise<PortfolioSingleResponse>;
|
|
17
|
+
/**
|
|
18
|
+
* listPortfolios
|
|
19
|
+
*
|
|
20
|
+
* Fetches a list of portfolios using a query object (filters, order, pagination, etc.).
|
|
21
|
+
*
|
|
22
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
23
|
+
* @param {QueryObject} query - Query object built via `buildQueryObject`.
|
|
24
|
+
* @returns {Promise<PortfolioListResponse>} List of portfolios.
|
|
25
|
+
*
|
|
26
|
+
* @throws {Error} If the request fails.
|
|
27
|
+
*/
|
|
28
|
+
export declare const listPortfolios: (api: AxiosInstance, query: QueryObject) => Promise<PortfolioListResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* createPortfolio
|
|
31
|
+
*
|
|
32
|
+
* Creates a new portfolio.
|
|
33
|
+
*
|
|
34
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
35
|
+
* @param {Partial<Portfolio>} data - Portfolio payload.
|
|
36
|
+
* @returns {Promise<Portfolio>} The created portfolio.
|
|
37
|
+
*
|
|
38
|
+
* @throws {Error} If the request fails.
|
|
39
|
+
*/
|
|
40
|
+
export declare const createPortfolio: (api: AxiosInstance, data: Partial<Portfolio>) => Promise<Portfolio>;
|
|
41
|
+
/**
|
|
42
|
+
* updatePortfolio
|
|
43
|
+
*
|
|
44
|
+
* Updates an existing portfolio by ID.
|
|
45
|
+
*
|
|
46
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
47
|
+
* @param {string} id - Portfolio identifier.
|
|
48
|
+
* @param {Partial<Portfolio>} data - Fields to update.
|
|
49
|
+
* @returns {Promise<Portfolio>} The updated portfolio.
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error} If the request fails.
|
|
52
|
+
*/
|
|
53
|
+
export declare const updatePortfolio: (api: AxiosInstance, id: string, data: Partial<Portfolio>) => Promise<Portfolio>;
|
|
54
|
+
/**
|
|
55
|
+
* deletePortfolio
|
|
56
|
+
*
|
|
57
|
+
* Deletes a portfolio by ID.
|
|
58
|
+
*
|
|
59
|
+
* @param {AxiosInstance} api - Axios instance.
|
|
60
|
+
* @param {string} id - Portfolio identifier.
|
|
61
|
+
* @param {string} workspace - Workspace the portfolio belongs to.
|
|
62
|
+
* @returns {Promise<Portfolio>} The deleted portfolio.
|
|
63
|
+
*
|
|
64
|
+
* @throws {Error} If the request fails.
|
|
65
|
+
*/
|
|
66
|
+
export declare const deletePortfolio: (api: AxiosInstance, id: string, workspace: string) => Promise<Portfolio>;
|
|
67
|
+
//# sourceMappingURL=portfolio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portfolio.d.ts","sourceRoot":"","sources":["../../src/api/portfolio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,aAAa,EAAsB,MAAM,OAAO,CAAC;AAE7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAInG;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,uBAAuB,CAqBrH,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAU,KAAK,aAAa,EAAE,OAAO,WAAW,KAAG,OAAO,CAAC,qBAAqB,CA2B1G,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,KAAG,OAAO,CAAC,SAAS,CAsBrG,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,MAAM,OAAO,CAAC,SAAS,CAAC,KAAG,OAAO,CAAC,SAAS,CAsBjH,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,GAAU,KAAK,aAAa,EAAE,IAAI,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,SAAS,CAsB1G,CAAA"}
|