@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,126 @@
|
|
|
1
|
+
import type { Datastore } from "../types/datastore.d.ts";
|
|
2
|
+
import type { AnyRecord } from "../types/anyRecord.d.ts";
|
|
3
|
+
type Cell = string | number | null;
|
|
4
|
+
type DatastoreData = Cell[][];
|
|
5
|
+
/**
|
|
6
|
+
* Converts a datastore table (2D array) into an array of objects.
|
|
7
|
+
*
|
|
8
|
+
* The input `data` is expected to be a 2D array where:
|
|
9
|
+
* - Row 0 typically contains the headers (but headers are provided explicitly via `headers`)
|
|
10
|
+
* - Rows 1..N contain the data values
|
|
11
|
+
*
|
|
12
|
+
* Key behaviors:
|
|
13
|
+
* - Skips the first row of `data` (starts at index 1), assuming it is the header row.
|
|
14
|
+
* - Adds a `datastoreId` field to every generated object so each record can be traced
|
|
15
|
+
* back to its source datastore.
|
|
16
|
+
* - Maps each header to the corresponding cell value by column index.
|
|
17
|
+
*
|
|
18
|
+
* @template T A record type whose values are compatible with `Cell` (string | number | null).
|
|
19
|
+
*
|
|
20
|
+
* @param datastoreId The id of the datastore to attach to each row as `datastoreId`.
|
|
21
|
+
* @param headers The column names used as object keys (positionally aligned with row cells).
|
|
22
|
+
* @param data The datastore matrix (rows x columns). Row 0 is assumed to be headers.
|
|
23
|
+
*
|
|
24
|
+
* @returns An array of objects (one per data row), each containing:
|
|
25
|
+
* - `datastoreId`
|
|
26
|
+
* - one property per header (with the corresponding cell value)
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const headers = ["name", "age"];
|
|
30
|
+
* const data = [
|
|
31
|
+
* ["name", "age"],
|
|
32
|
+
* ["Alice", 30],
|
|
33
|
+
* ["Bob", null],
|
|
34
|
+
* ];
|
|
35
|
+
* const rows = tableToObjects("ds_123", headers, data);
|
|
36
|
+
* // [
|
|
37
|
+
* // { datastoreId: "ds_123", name: "Alice", age: 30 },
|
|
38
|
+
* // { datastoreId: "ds_123", name: "Bob", age: null }
|
|
39
|
+
* // ]
|
|
40
|
+
*/
|
|
41
|
+
export declare const tableToObjects: <T extends Record<string, Cell>>(datastoreId: string, headers: string[], data: DatastoreData) => T[];
|
|
42
|
+
/**
|
|
43
|
+
* Converts an array of objects into a datastore table (2D array).
|
|
44
|
+
*
|
|
45
|
+
* Key behaviors:
|
|
46
|
+
* - Produces a 2D array where the first row is the provided `headers`.
|
|
47
|
+
* - For each object in `data`, creates a row by mapping `headers` to values in the object.
|
|
48
|
+
* - If a header is missing in an object, the corresponding cell is set to `null`.
|
|
49
|
+
*
|
|
50
|
+
* @template T A record type whose values are compatible with `Cell` (string | number | null).
|
|
51
|
+
*
|
|
52
|
+
* @param headers Column names (and output table header row).
|
|
53
|
+
* @param data Array of objects to convert into rows.
|
|
54
|
+
*
|
|
55
|
+
* @returns A datastore matrix where:
|
|
56
|
+
* - Row 0 is `headers`
|
|
57
|
+
* - Rows 1..N contain cell values aligned with `headers`
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const headers = ["name", "age"];
|
|
61
|
+
* const rows = objectsToTable(headers, [
|
|
62
|
+
* { name: "Alice", age: 30 },
|
|
63
|
+
* { name: "Bob" }, // age missing -> null
|
|
64
|
+
* ]);
|
|
65
|
+
* // [
|
|
66
|
+
* // ["name", "age"],
|
|
67
|
+
* // ["Alice", 30],
|
|
68
|
+
* // ["Bob", null]
|
|
69
|
+
* // ]
|
|
70
|
+
*/
|
|
71
|
+
export declare const objectsToTable: <T extends Record<string, Cell>>(headers: string[], data: T[]) => DatastoreData;
|
|
72
|
+
/**
|
|
73
|
+
* Flattens multiple datastore row arrays into a single array.
|
|
74
|
+
*
|
|
75
|
+
* This is typically used after fetching multiple datastores, where each datastore is
|
|
76
|
+
* represented as `AnyRecord[]` (i.e., an array of row objects).
|
|
77
|
+
*
|
|
78
|
+
* @param datastores A list of datastores, each represented as an array of row objects.
|
|
79
|
+
*
|
|
80
|
+
* @returns A single array containing all rows from all datastores, in the same order.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* const merged = mergeDatastores([
|
|
84
|
+
* [{ datastoreId: "a", x: 1 }],
|
|
85
|
+
* [{ datastoreId: "b", x: 2 }, { datastoreId: "b", x: 3 }],
|
|
86
|
+
* ]);
|
|
87
|
+
* // [{...}, {...}, {...}]
|
|
88
|
+
*/
|
|
89
|
+
export declare const mergeDatastores: (datastores: AnyRecord[][]) => AnyRecord[];
|
|
90
|
+
/**
|
|
91
|
+
* buildDatastoreProps
|
|
92
|
+
*
|
|
93
|
+
* Extracts and maps the metadata properties of a `Datastore` into a plain object
|
|
94
|
+
* for UI usage, discarding raw data rows.
|
|
95
|
+
*
|
|
96
|
+
* - `header` is derived from `datastore.data?.[0]` (the first row of the data matrix),
|
|
97
|
+
* which is expected to contain the column names. Falls back to `[]` if not present.
|
|
98
|
+
*
|
|
99
|
+
* @param {Datastore} datastore - The source datastore object.
|
|
100
|
+
* @returns Metadata object with the datastore's descriptive properties and header.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* const meta = buildDatastoreProps(datastore);
|
|
104
|
+
* // {
|
|
105
|
+
* // name: "my-datastore",
|
|
106
|
+
* // workspace: "ws-1",
|
|
107
|
+
* // header: ["col1", "col2"],
|
|
108
|
+
* // ...
|
|
109
|
+
* // }
|
|
110
|
+
*/
|
|
111
|
+
export declare const buildDatastoreProps: (datastore: Datastore) => {
|
|
112
|
+
name: string;
|
|
113
|
+
date: string | undefined;
|
|
114
|
+
version: string | undefined;
|
|
115
|
+
description: string | undefined;
|
|
116
|
+
tags: string[] | undefined;
|
|
117
|
+
link_uid: string | undefined;
|
|
118
|
+
workspace: string;
|
|
119
|
+
date_time: string;
|
|
120
|
+
created: number | undefined;
|
|
121
|
+
updated: number | undefined;
|
|
122
|
+
level: string | undefined;
|
|
123
|
+
header: import("../types/datastore.d.ts").DatastoreRow[];
|
|
124
|
+
};
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=datastoreTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datastoreTable.d.ts","sourceRoot":"","sources":["../../src/lib/datastoreTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;AACnC,KAAK,aAAa,GAAG,IAAI,EAAE,EAAE,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,aAAa,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,aAAa,KAAG,CAAC,EAgB7H,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,KAAG,aAI7F,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,GAAI,YAAY,SAAS,EAAE,EAAE,KAAG,SAAS,EAQpE,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,GAAI,WAAW,SAAS;;;;;;;;;;;;;CAevD,CAAC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
//#region src/lib/datastoreTable.ts
|
|
2
|
+
/**
|
|
3
|
+
* Converts a datastore table (2D array) into an array of objects.
|
|
4
|
+
*
|
|
5
|
+
* The input `data` is expected to be a 2D array where:
|
|
6
|
+
* - Row 0 typically contains the headers (but headers are provided explicitly via `headers`)
|
|
7
|
+
* - Rows 1..N contain the data values
|
|
8
|
+
*
|
|
9
|
+
* Key behaviors:
|
|
10
|
+
* - Skips the first row of `data` (starts at index 1), assuming it is the header row.
|
|
11
|
+
* - Adds a `datastoreId` field to every generated object so each record can be traced
|
|
12
|
+
* back to its source datastore.
|
|
13
|
+
* - Maps each header to the corresponding cell value by column index.
|
|
14
|
+
*
|
|
15
|
+
* @template T A record type whose values are compatible with `Cell` (string | number | null).
|
|
16
|
+
*
|
|
17
|
+
* @param datastoreId The id of the datastore to attach to each row as `datastoreId`.
|
|
18
|
+
* @param headers The column names used as object keys (positionally aligned with row cells).
|
|
19
|
+
* @param data The datastore matrix (rows x columns). Row 0 is assumed to be headers.
|
|
20
|
+
*
|
|
21
|
+
* @returns An array of objects (one per data row), each containing:
|
|
22
|
+
* - `datastoreId`
|
|
23
|
+
* - one property per header (with the corresponding cell value)
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const headers = ["name", "age"];
|
|
27
|
+
* const data = [
|
|
28
|
+
* ["name", "age"],
|
|
29
|
+
* ["Alice", 30],
|
|
30
|
+
* ["Bob", null],
|
|
31
|
+
* ];
|
|
32
|
+
* const rows = tableToObjects("ds_123", headers, data);
|
|
33
|
+
* // [
|
|
34
|
+
* // { datastoreId: "ds_123", name: "Alice", age: 30 },
|
|
35
|
+
* // { datastoreId: "ds_123", name: "Bob", age: null }
|
|
36
|
+
* // ]
|
|
37
|
+
*/
|
|
38
|
+
var tableToObjects = (datastoreId, headers, data) => {
|
|
39
|
+
const result = [];
|
|
40
|
+
for (let i = 1; i < data?.length; i++) {
|
|
41
|
+
const item = {};
|
|
42
|
+
item.datastoreId = datastoreId;
|
|
43
|
+
headers.forEach((header, index) => {
|
|
44
|
+
item[header] = data[i][index];
|
|
45
|
+
});
|
|
46
|
+
result.push(item);
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Converts an array of objects into a datastore table (2D array).
|
|
52
|
+
*
|
|
53
|
+
* Key behaviors:
|
|
54
|
+
* - Produces a 2D array where the first row is the provided `headers`.
|
|
55
|
+
* - For each object in `data`, creates a row by mapping `headers` to values in the object.
|
|
56
|
+
* - If a header is missing in an object, the corresponding cell is set to `null`.
|
|
57
|
+
*
|
|
58
|
+
* @template T A record type whose values are compatible with `Cell` (string | number | null).
|
|
59
|
+
*
|
|
60
|
+
* @param headers Column names (and output table header row).
|
|
61
|
+
* @param data Array of objects to convert into rows.
|
|
62
|
+
*
|
|
63
|
+
* @returns A datastore matrix where:
|
|
64
|
+
* - Row 0 is `headers`
|
|
65
|
+
* - Rows 1..N contain cell values aligned with `headers`
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* const headers = ["name", "age"];
|
|
69
|
+
* const rows = objectsToTable(headers, [
|
|
70
|
+
* { name: "Alice", age: 30 },
|
|
71
|
+
* { name: "Bob" }, // age missing -> null
|
|
72
|
+
* ]);
|
|
73
|
+
* // [
|
|
74
|
+
* // ["name", "age"],
|
|
75
|
+
* // ["Alice", 30],
|
|
76
|
+
* // ["Bob", null]
|
|
77
|
+
* // ]
|
|
78
|
+
*/
|
|
79
|
+
var objectsToTable = (headers, data) => {
|
|
80
|
+
return [headers, ...data.map((d) => headers.map((h) => d[h] ?? null))];
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Flattens multiple datastore row arrays into a single array.
|
|
84
|
+
*
|
|
85
|
+
* This is typically used after fetching multiple datastores, where each datastore is
|
|
86
|
+
* represented as `AnyRecord[]` (i.e., an array of row objects).
|
|
87
|
+
*
|
|
88
|
+
* @param datastores A list of datastores, each represented as an array of row objects.
|
|
89
|
+
*
|
|
90
|
+
* @returns A single array containing all rows from all datastores, in the same order.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* const merged = mergeDatastores([
|
|
94
|
+
* [{ datastoreId: "a", x: 1 }],
|
|
95
|
+
* [{ datastoreId: "b", x: 2 }, { datastoreId: "b", x: 3 }],
|
|
96
|
+
* ]);
|
|
97
|
+
* // [{...}, {...}, {...}]
|
|
98
|
+
*/
|
|
99
|
+
var mergeDatastores = (datastores) => {
|
|
100
|
+
const result = [];
|
|
101
|
+
datastores.forEach((datastore) => {
|
|
102
|
+
result.push(...datastore);
|
|
103
|
+
});
|
|
104
|
+
return result;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* buildDatastoreProps
|
|
108
|
+
*
|
|
109
|
+
* Extracts and maps the metadata properties of a `Datastore` into a plain object
|
|
110
|
+
* for UI usage, discarding raw data rows.
|
|
111
|
+
*
|
|
112
|
+
* - `header` is derived from `datastore.data?.[0]` (the first row of the data matrix),
|
|
113
|
+
* which is expected to contain the column names. Falls back to `[]` if not present.
|
|
114
|
+
*
|
|
115
|
+
* @param {Datastore} datastore - The source datastore object.
|
|
116
|
+
* @returns Metadata object with the datastore's descriptive properties and header.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* const meta = buildDatastoreProps(datastore);
|
|
120
|
+
* // {
|
|
121
|
+
* // name: "my-datastore",
|
|
122
|
+
* // workspace: "ws-1",
|
|
123
|
+
* // header: ["col1", "col2"],
|
|
124
|
+
* // ...
|
|
125
|
+
* // }
|
|
126
|
+
*/
|
|
127
|
+
var buildDatastoreProps = (datastore) => {
|
|
128
|
+
return {
|
|
129
|
+
name: datastore.name,
|
|
130
|
+
date: datastore.date,
|
|
131
|
+
version: datastore.version,
|
|
132
|
+
description: datastore.description,
|
|
133
|
+
tags: datastore.tags,
|
|
134
|
+
link_uid: datastore.link_uid,
|
|
135
|
+
workspace: datastore.workspace,
|
|
136
|
+
date_time: datastore.date_time,
|
|
137
|
+
created: datastore.created,
|
|
138
|
+
updated: datastore.updated,
|
|
139
|
+
level: datastore.level,
|
|
140
|
+
header: datastore.data?.[0] || []
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
//#endregion
|
|
144
|
+
export { buildDatastoreProps, mergeDatastores, objectsToTable, tableToObjects };
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=datastoreTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datastoreTable.js","names":[],"sources":["../../src/lib/datastoreTable.ts"],"sourcesContent":["import type { Datastore } from \"@/types/datastore\";\nimport type { AnyRecord } from \"@/types/anyRecord\";\n\ntype Cell = string | number | null;\ntype DatastoreData = Cell[][];\n\n/**\n * Converts a datastore table (2D array) into an array of objects.\n *\n * The input `data` is expected to be a 2D array where:\n * - Row 0 typically contains the headers (but headers are provided explicitly via `headers`)\n * - Rows 1..N contain the data values\n *\n * Key behaviors:\n * - Skips the first row of `data` (starts at index 1), assuming it is the header row.\n * - Adds a `datastoreId` field to every generated object so each record can be traced\n * back to its source datastore.\n * - Maps each header to the corresponding cell value by column index.\n *\n * @template T A record type whose values are compatible with `Cell` (string | number | null).\n *\n * @param datastoreId The id of the datastore to attach to each row as `datastoreId`.\n * @param headers The column names used as object keys (positionally aligned with row cells).\n * @param data The datastore matrix (rows x columns). Row 0 is assumed to be headers.\n *\n * @returns An array of objects (one per data row), each containing:\n * - `datastoreId`\n * - one property per header (with the corresponding cell value)\n *\n * @example\n * const headers = [\"name\", \"age\"];\n * const data = [\n * [\"name\", \"age\"],\n * [\"Alice\", 30],\n * [\"Bob\", null],\n * ];\n * const rows = tableToObjects(\"ds_123\", headers, data);\n * // [\n * // { datastoreId: \"ds_123\", name: \"Alice\", age: 30 },\n * // { datastoreId: \"ds_123\", name: \"Bob\", age: null }\n * // ]\n */\nexport const tableToObjects = <T extends Record<string, Cell>>(datastoreId: string, headers: string[], data: DatastoreData): T[] => {\n const result: T[] = [];\n\n for (let i = 1; i < data?.length; i++) {\n const item: Record<string, Cell> = {};\n\n item.datastoreId = datastoreId;\n\n headers.forEach((header: string, index: number) => {\n item[header] = data[i][index];\n });\n\n result.push(item as T);\n }\n\n return result;\n};\n\n/**\n * Converts an array of objects into a datastore table (2D array).\n *\n * Key behaviors:\n * - Produces a 2D array where the first row is the provided `headers`.\n * - For each object in `data`, creates a row by mapping `headers` to values in the object.\n * - If a header is missing in an object, the corresponding cell is set to `null`.\n *\n * @template T A record type whose values are compatible with `Cell` (string | number | null).\n *\n * @param headers Column names (and output table header row).\n * @param data Array of objects to convert into rows.\n *\n * @returns A datastore matrix where:\n * - Row 0 is `headers`\n * - Rows 1..N contain cell values aligned with `headers`\n *\n * @example\n * const headers = [\"name\", \"age\"];\n * const rows = objectsToTable(headers, [\n * { name: \"Alice\", age: 30 },\n * { name: \"Bob\" }, // age missing -> null\n * ]);\n * // [\n * // [\"name\", \"age\"],\n * // [\"Alice\", 30],\n * // [\"Bob\", null]\n * // ]\n */\nexport const objectsToTable = <T extends Record<string, Cell>>(headers: string[] ,data: T[]): DatastoreData => {\n const rows: DatastoreData = data.map((d) => headers.map<Cell>((h) => d[h as string] ?? null));\n\n return [headers, ...rows];\n};\n\n/**\n * Flattens multiple datastore row arrays into a single array.\n *\n * This is typically used after fetching multiple datastores, where each datastore is\n * represented as `AnyRecord[]` (i.e., an array of row objects).\n *\n * @param datastores A list of datastores, each represented as an array of row objects.\n *\n * @returns A single array containing all rows from all datastores, in the same order.\n *\n * @example\n * const merged = mergeDatastores([\n * [{ datastoreId: \"a\", x: 1 }],\n * [{ datastoreId: \"b\", x: 2 }, { datastoreId: \"b\", x: 3 }],\n * ]);\n * // [{...}, {...}, {...}]\n */\nexport const mergeDatastores = (datastores: AnyRecord[][]): AnyRecord[] => {\n const result: AnyRecord[] = [];\n\n datastores.forEach((datastore: AnyRecord[]) => {\n result.push(...datastore);\n });\n\n return result;\n};\n\n/**\n * buildDatastoreProps\n *\n * Extracts and maps the metadata properties of a `Datastore` into a plain object\n * for UI usage, discarding raw data rows.\n *\n * - `header` is derived from `datastore.data?.[0]` (the first row of the data matrix),\n * which is expected to contain the column names. Falls back to `[]` if not present.\n *\n * @param {Datastore} datastore - The source datastore object.\n * @returns Metadata object with the datastore's descriptive properties and header.\n *\n * @example\n * const meta = buildDatastoreProps(datastore);\n * // {\n * // name: \"my-datastore\",\n * // workspace: \"ws-1\",\n * // header: [\"col1\", \"col2\"],\n * // ...\n * // }\n */\nexport const buildDatastoreProps = (datastore: Datastore) => {\n return {\n name: datastore.name,\n date: datastore.date,\n version: datastore.version,\n description: datastore.description,\n tags: datastore.tags,\n link_uid: datastore.link_uid,\n workspace: datastore.workspace,\n date_time: datastore.date_time,\n created: datastore.created,\n updated: datastore.updated,\n level: datastore.level,\n header: datastore.data?.[0] || [],\n };\n};"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,IAAa,kBAAkD,aAAqB,SAAmB,SAA6B;CAClI,MAAM,SAAc,CAAC;CAErB,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;EACrC,MAAM,OAA6B,CAAC;EAEpC,KAAK,cAAc;EAEnB,QAAQ,SAAS,QAAgB,UAAkB;GACjD,KAAK,UAAU,KAAK,EAAE,CAAC;EACzB,CAAC;EAED,OAAO,KAAK,IAAS;CACvB;CAEA,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAa,kBAAkD,SAAmB,SAA6B;CAG7G,OAAO,CAAC,SAAS,GAFW,KAAK,KAAK,MAAM,QAAQ,KAAW,MAAM,EAAE,MAAgB,IAAI,CAEvE,CAAI;AAC1B;;;;;;;;;;;;;;;;;;AAmBA,IAAa,mBAAmB,eAA2C;CACzE,MAAM,SAAsB,CAAC;CAE7B,WAAW,SAAS,cAA2B;EAC7C,OAAO,KAAK,GAAG,SAAS;CAC1B,CAAC;CAED,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;AAuBA,IAAa,uBAAuB,cAAyB;CACzD,OAAO;EACH,MAAM,UAAU;EAChB,MAAM,UAAU;EAChB,SAAS,UAAU;EACnB,aAAa,UAAU;EACvB,MAAM,UAAU;EAChB,UAAU,UAAU;EACpB,WAAW,UAAU;EACrB,WAAW,UAAU;EACrB,SAAS,UAAU;EACnB,SAAS,UAAU;EACnB,OAAO,UAAU;EACjB,QAAQ,UAAU,OAAO,MAAM,CAAC;CACpC;AACJ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { QueryClient, type QueryClientConfig, type QueryFunction } from "@tanstack/react-query";
|
|
2
|
+
type UnauthorizedBehavior = "returnNull" | "throw";
|
|
3
|
+
export declare const getQueryFn: <T>(options: {
|
|
4
|
+
on401: UnauthorizedBehavior;
|
|
5
|
+
}) => QueryFunction<T>;
|
|
6
|
+
/**
|
|
7
|
+
* createQueryClient
|
|
8
|
+
*
|
|
9
|
+
* Builds a `QueryClient` carrying the defaults every Everysk app shares: the fetch-based
|
|
10
|
+
* `queryFn` above, no retries, no refetch on focus or interval, and `staleTime: Infinity`.
|
|
11
|
+
*
|
|
12
|
+
* This is a factory rather than the shared instance the template exported. A module-level
|
|
13
|
+
* `new QueryClient()` inside a published package is a single cache shared by every consumer
|
|
14
|
+
* of that copy of the module: it cannot be configured per app, it cannot be reset, and in
|
|
15
|
+
* tests it leaks state from one case into the next. The app owns the instance and passes it
|
|
16
|
+
* to `QueryClientProvider` — `EveryskApp` does this for you when you don't pass one.
|
|
17
|
+
*
|
|
18
|
+
* @param {QueryClientConfig} [config] - Merged over the defaults, one level deep, so passing
|
|
19
|
+
* `defaultOptions.queries` replaces the whole `queries` object rather than merging into it.
|
|
20
|
+
* @returns {QueryClient} A fresh client.
|
|
21
|
+
*/
|
|
22
|
+
export declare const createQueryClient: (config?: QueryClientConfig) => QueryClient;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=queryClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryClient.d.ts","sourceRoot":"","sources":["../../src/lib/queryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAShG,KAAK,oBAAoB,GAAG,YAAY,GAAG,OAAO,CAAC;AACnD,eAAO,MAAM,UAAU,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE;IAClC,KAAK,EAAE,oBAAoB,CAAC;CAC/B,KAAK,aAAa,CAAC,CAAC,CAaZ,CAAC;AAEV;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,iBAAiB,KAAG,WAgBzD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { QueryClient } from "@tanstack/react-query";
|
|
2
|
+
//#region src/lib/queryClient.ts
|
|
3
|
+
async function throwIfResNotOk(res) {
|
|
4
|
+
if (!res.ok) {
|
|
5
|
+
const text = await res.text() || res.statusText;
|
|
6
|
+
throw new Error(`${res.status}: ${text}`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
var getQueryFn = ({ on401: unauthorizedBehavior }) => async ({ queryKey }) => {
|
|
10
|
+
const res = await fetch(queryKey.join("/"), { credentials: "include" });
|
|
11
|
+
if (unauthorizedBehavior === "returnNull" && res.status === 401) return null;
|
|
12
|
+
await throwIfResNotOk(res);
|
|
13
|
+
return await res.json();
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* createQueryClient
|
|
17
|
+
*
|
|
18
|
+
* Builds a `QueryClient` carrying the defaults every Everysk app shares: the fetch-based
|
|
19
|
+
* `queryFn` above, no retries, no refetch on focus or interval, and `staleTime: Infinity`.
|
|
20
|
+
*
|
|
21
|
+
* This is a factory rather than the shared instance the template exported. A module-level
|
|
22
|
+
* `new QueryClient()` inside a published package is a single cache shared by every consumer
|
|
23
|
+
* of that copy of the module: it cannot be configured per app, it cannot be reset, and in
|
|
24
|
+
* tests it leaks state from one case into the next. The app owns the instance and passes it
|
|
25
|
+
* to `QueryClientProvider` — `EveryskApp` does this for you when you don't pass one.
|
|
26
|
+
*
|
|
27
|
+
* @param {QueryClientConfig} [config] - Merged over the defaults, one level deep, so passing
|
|
28
|
+
* `defaultOptions.queries` replaces the whole `queries` object rather than merging into it.
|
|
29
|
+
* @returns {QueryClient} A fresh client.
|
|
30
|
+
*/
|
|
31
|
+
var createQueryClient = (config) => new QueryClient({
|
|
32
|
+
...config,
|
|
33
|
+
defaultOptions: {
|
|
34
|
+
queries: {
|
|
35
|
+
queryFn: getQueryFn({ on401: "throw" }),
|
|
36
|
+
refetchInterval: false,
|
|
37
|
+
refetchOnWindowFocus: false,
|
|
38
|
+
staleTime: Infinity,
|
|
39
|
+
retry: false
|
|
40
|
+
},
|
|
41
|
+
mutations: { retry: false },
|
|
42
|
+
...config?.defaultOptions
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
//#endregion
|
|
46
|
+
export { createQueryClient, getQueryFn };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=queryClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryClient.js","names":[],"sources":["../../src/lib/queryClient.ts"],"sourcesContent":["import { QueryClient, type QueryClientConfig, type QueryFunction } from \"@tanstack/react-query\";\n\nasync function throwIfResNotOk(res: Response) {\n if (!res.ok) {\n const text = (await res.text()) || res.statusText;\n throw new Error(`${res.status}: ${text}`);\n }\n}\n\ntype UnauthorizedBehavior = \"returnNull\" | \"throw\";\nexport const getQueryFn: <T>(options: {\n on401: UnauthorizedBehavior;\n}) => QueryFunction<T> =\n ({ on401: unauthorizedBehavior }) =>\n async ({ queryKey }) => {\n const res = await fetch(queryKey.join(\"/\") as string, {\n credentials: \"include\",\n });\n\n if (unauthorizedBehavior === \"returnNull\" && res.status === 401) {\n return null;\n }\n\n await throwIfResNotOk(res);\n return await res.json();\n };\n\n/**\n * createQueryClient\n *\n * Builds a `QueryClient` carrying the defaults every Everysk app shares: the fetch-based\n * `queryFn` above, no retries, no refetch on focus or interval, and `staleTime: Infinity`.\n *\n * This is a factory rather than the shared instance the template exported. A module-level\n * `new QueryClient()` inside a published package is a single cache shared by every consumer\n * of that copy of the module: it cannot be configured per app, it cannot be reset, and in\n * tests it leaks state from one case into the next. The app owns the instance and passes it\n * to `QueryClientProvider` — `EveryskApp` does this for you when you don't pass one.\n *\n * @param {QueryClientConfig} [config] - Merged over the defaults, one level deep, so passing\n * `defaultOptions.queries` replaces the whole `queries` object rather than merging into it.\n * @returns {QueryClient} A fresh client.\n */\nexport const createQueryClient = (config?: QueryClientConfig): QueryClient =>\n new QueryClient({\n ...config,\n defaultOptions: {\n queries: {\n queryFn: getQueryFn({ on401: \"throw\" }),\n refetchInterval: false,\n refetchOnWindowFocus: false,\n staleTime: Infinity,\n retry: false,\n },\n mutations: {\n retry: false,\n },\n ...config?.defaultOptions,\n },\n });\n"],"mappings":";;AAEA,eAAe,gBAAgB,KAAe;CAC1C,IAAI,CAAC,IAAI,IAAI;EACT,MAAM,OAAQ,MAAM,IAAI,KAAK,KAAM,IAAI;EACvC,MAAM,IAAI,MAAM,GAAG,IAAI,OAAO,IAAI,MAAM;CAC5C;AACJ;AAGA,IAAa,cAGR,EAAE,OAAO,2BACN,OAAO,EAAE,eAAe;CACpB,MAAM,MAAM,MAAM,MAAM,SAAS,KAAK,GAAG,GAAa,EAClD,aAAa,UACjB,CAAC;CAED,IAAI,yBAAyB,gBAAgB,IAAI,WAAW,KACxD,OAAO;CAGX,MAAM,gBAAgB,GAAG;CACzB,OAAO,MAAM,IAAI,KAAK;AAC1B;;;;;;;;;;;;;;;;;AAkBR,IAAa,qBAAqB,WAC9B,IAAI,YAAY;CACZ,GAAG;CACH,gBAAgB;EACZ,SAAS;GACL,SAAS,WAAW,EAAE,OAAO,QAAQ,CAAC;GACtC,iBAAiB;GACjB,sBAAsB;GACtB,WAAW;GACX,OAAO;EACX;EACA,WAAW,EACP,OAAO,MACX;EACA,GAAG,QAAQ;CACf;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "../api/portfolio.js";
|
|
2
|
+
export * from "../types/portfolio.d.ts";
|
|
3
|
+
export * from "../hooks/portfolio/useFetchPortfolio.js";
|
|
4
|
+
export * from "../hooks/portfolio/useFetchPortfolios.js";
|
|
5
|
+
export * from "../hooks/portfolio/usePortfolioMutations.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/portfolio/index.ts"],"names":[],"mappings":"AAQA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profile/index.ts"],"names":[],"mappings":"AAQA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "../contexts/webSocketContext/index.js";
|
|
2
|
+
export * from "../contexts/webSocketContext/provider.js";
|
|
3
|
+
export * from "../contexts/webSocketContext/types.d.ts";
|
|
4
|
+
export * from "../contexts/webSocketContext/constants.js";
|
|
5
|
+
export * from "../contexts/webSocketContext/handler.js";
|
|
6
|
+
export * from "../contexts/webSocketContext/hooks/useWebSocket/index.js";
|
|
7
|
+
export * from "../contexts/webSocketContext/hooks/useWebSocketSubscription/index.js";
|
|
8
|
+
export * from "../contexts/webSocketContext/hooks/useAppNotificationSubscription/index.js";
|
|
9
|
+
export * from "../api/websocketsConfig.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/socket/index.ts"],"names":[],"mappings":"AAUA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,kEAAkE,CAAC;AACjF,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WebSocketContext } from "../contexts/webSocketContext/index.js";
|
|
2
|
+
import { getWebsocketsConfig } from "../api/websocketsConfig.js";
|
|
3
|
+
import { APP_NOTIFICATION_EVENT_TYPE, JOIN_EVENT, NOTIFICATION_EVENT } from "../contexts/webSocketContext/constants.js";
|
|
4
|
+
import { WebSocketHandler } from "../contexts/webSocketContext/handler.js";
|
|
5
|
+
import { WebSocketProvider } from "../contexts/webSocketContext/provider.js";
|
|
6
|
+
import { useWebSocket } from "../contexts/webSocketContext/hooks/useWebSocket/index.js";
|
|
7
|
+
import { useWebSocketSubscription } from "../contexts/webSocketContext/hooks/useWebSocketSubscription/index.js";
|
|
8
|
+
import { useAppNotificationSubscription } from "../contexts/webSocketContext/hooks/useAppNotificationSubscription/index.js";
|
|
9
|
+
export { APP_NOTIFICATION_EVENT_TYPE, JOIN_EVENT, NOTIFICATION_EVENT, WebSocketContext, WebSocketHandler, WebSocketProvider, getWebsocketsConfig, useAppNotificationSubscription, useWebSocket, useWebSocketSubscription };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,GACxB,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agGridEnterpriseMock
|
|
3
|
+
*
|
|
4
|
+
* A stand-in for `ag-grid-enterprise`, for a test that renders something registering the AG Grid
|
|
5
|
+
* licence. The real `LicenseManager` validates the key and warns on the console when it does not
|
|
6
|
+
* like it, which is noise a test neither needs nor should depend on.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { getAgGridLicenseKey } from "@everysk/apps-sdk/test/mocks";
|
|
10
|
+
*
|
|
11
|
+
* vi.mock("ag-grid-enterprise", async () =>
|
|
12
|
+
* (await import("@everysk/apps-sdk/test/mocks")).agGridEnterpriseMock(),
|
|
13
|
+
* );
|
|
14
|
+
*
|
|
15
|
+
* it("registers the licence the app passes", () => {
|
|
16
|
+
* render(<App />);
|
|
17
|
+
* expect(getAgGridLicenseKey()).toBe("test-key");
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* `setLicenseKey` is a plain function rather than a `vi.fn`, and the key is captured at module
|
|
22
|
+
* level, for the same reason the socket double is built that way: a config with `restoreMocks`
|
|
23
|
+
* wipes a `vi.fn`'s implementation between tests, so a spy created inside the factory stops
|
|
24
|
+
* recording after the first case. Reading the captured key works whatever the config does.
|
|
25
|
+
*
|
|
26
|
+
* Opt-in, never applied from the shared setup file — `ag-grid-enterprise` is an OPTIONAL peer,
|
|
27
|
+
* and `vi.mock` on a module that cannot be resolved fails the whole test file at transform time.
|
|
28
|
+
*/
|
|
29
|
+
export declare const agGridEnterpriseMock: () => {
|
|
30
|
+
LicenseManager: {
|
|
31
|
+
setLicenseKey: (key: string) => void;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** The licence key last registered, or null when nothing registered one. */
|
|
35
|
+
export declare const getAgGridLicenseKey: () => string | null;
|
|
36
|
+
/** Drops the captured key between tests. */
|
|
37
|
+
export declare const resetAgGridLicense: () => void;
|
|
38
|
+
//# sourceMappingURL=agGridEnterprise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agGridEnterprise.d.ts","sourceRoot":"","sources":["../../../src/test/mocks/agGridEnterprise.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,oBAAoB;;6BAEJ,MAAM;;CAIjC,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,QAAO,MAAM,GAAG,IAAe,CAAC;AAEhE,4CAA4C;AAC5C,eAAO,MAAM,kBAAkB,QAAO,IAErC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/test/mocks/agGridEnterprise.ts
|
|
2
|
+
var lastKey = null;
|
|
3
|
+
/**
|
|
4
|
+
* agGridEnterpriseMock
|
|
5
|
+
*
|
|
6
|
+
* A stand-in for `ag-grid-enterprise`, for a test that renders something registering the AG Grid
|
|
7
|
+
* licence. The real `LicenseManager` validates the key and warns on the console when it does not
|
|
8
|
+
* like it, which is noise a test neither needs nor should depend on.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { getAgGridLicenseKey } from "@everysk/apps-sdk/test/mocks";
|
|
12
|
+
*
|
|
13
|
+
* vi.mock("ag-grid-enterprise", async () =>
|
|
14
|
+
* (await import("@everysk/apps-sdk/test/mocks")).agGridEnterpriseMock(),
|
|
15
|
+
* );
|
|
16
|
+
*
|
|
17
|
+
* it("registers the licence the app passes", () => {
|
|
18
|
+
* render(<App />);
|
|
19
|
+
* expect(getAgGridLicenseKey()).toBe("test-key");
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* `setLicenseKey` is a plain function rather than a `vi.fn`, and the key is captured at module
|
|
24
|
+
* level, for the same reason the socket double is built that way: a config with `restoreMocks`
|
|
25
|
+
* wipes a `vi.fn`'s implementation between tests, so a spy created inside the factory stops
|
|
26
|
+
* recording after the first case. Reading the captured key works whatever the config does.
|
|
27
|
+
*
|
|
28
|
+
* Opt-in, never applied from the shared setup file — `ag-grid-enterprise` is an OPTIONAL peer,
|
|
29
|
+
* and `vi.mock` on a module that cannot be resolved fails the whole test file at transform time.
|
|
30
|
+
*/
|
|
31
|
+
var agGridEnterpriseMock = () => ({ LicenseManager: { setLicenseKey: (key) => {
|
|
32
|
+
lastKey = key;
|
|
33
|
+
} } });
|
|
34
|
+
/** The licence key last registered, or null when nothing registered one. */
|
|
35
|
+
var getAgGridLicenseKey = () => lastKey;
|
|
36
|
+
/** Drops the captured key between tests. */
|
|
37
|
+
var resetAgGridLicense = () => {
|
|
38
|
+
lastKey = null;
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { agGridEnterpriseMock, getAgGridLicenseKey, resetAgGridLicense };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=agGridEnterprise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agGridEnterprise.js","names":[],"sources":["../../../src/test/mocks/agGridEnterprise.ts"],"sourcesContent":["let lastKey: string | null = null;\n\n/**\n * agGridEnterpriseMock\n *\n * A stand-in for `ag-grid-enterprise`, for a test that renders something registering the AG Grid\n * licence. The real `LicenseManager` validates the key and warns on the console when it does not\n * like it, which is noise a test neither needs nor should depend on.\n *\n * ```ts\n * import { getAgGridLicenseKey } from \"@everysk/apps-sdk/test/mocks\";\n *\n * vi.mock(\"ag-grid-enterprise\", async () =>\n * (await import(\"@everysk/apps-sdk/test/mocks\")).agGridEnterpriseMock(),\n * );\n *\n * it(\"registers the licence the app passes\", () => {\n * render(<App />);\n * expect(getAgGridLicenseKey()).toBe(\"test-key\");\n * });\n * ```\n *\n * `setLicenseKey` is a plain function rather than a `vi.fn`, and the key is captured at module\n * level, for the same reason the socket double is built that way: a config with `restoreMocks`\n * wipes a `vi.fn`'s implementation between tests, so a spy created inside the factory stops\n * recording after the first case. Reading the captured key works whatever the config does.\n *\n * Opt-in, never applied from the shared setup file — `ag-grid-enterprise` is an OPTIONAL peer,\n * and `vi.mock` on a module that cannot be resolved fails the whole test file at transform time.\n */\nexport const agGridEnterpriseMock = () => ({\n LicenseManager: {\n setLicenseKey: (key: string) => {\n lastKey = key;\n },\n },\n});\n\n/** The licence key last registered, or null when nothing registered one. */\nexport const getAgGridLicenseKey = (): string | null => lastKey;\n\n/** Drops the captured key between tests. */\nexport const resetAgGridLicense = (): void => {\n lastKey = null;\n};\n"],"mappings":";AAAA,IAAI,UAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8B7B,IAAa,8BAA8B,EACvC,gBAAgB,EACZ,gBAAgB,QAAgB;CAC5B,UAAU;AACd,EACJ,EACJ;;AAGA,IAAa,4BAA2C;;AAGxD,IAAa,2BAAiC;CAC1C,UAAU;AACd"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
type ColumnDef = {
|
|
3
|
+
field?: string;
|
|
4
|
+
headerName?: string;
|
|
5
|
+
};
|
|
6
|
+
type Row = Record<string, unknown>;
|
|
7
|
+
type AgGridReactProps = {
|
|
8
|
+
rowData?: Row[] | null;
|
|
9
|
+
columnDefs?: ColumnDef[] | null;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* agGridReactMock
|
|
14
|
+
*
|
|
15
|
+
* A stand-in for `ag-grid-react` that renders the data as plain DOM instead of running AG
|
|
16
|
+
* Grid's layout, virtualisation and ResizeObserver work — which is what makes grid tests slow
|
|
17
|
+
* under jsdom.
|
|
18
|
+
*
|
|
19
|
+
* It is deliberately not a black box: rows and cells are rendered with test ids, so
|
|
20
|
+
* assertions about *what the grid was given* keep working. Only the rendering engine is gone.
|
|
21
|
+
*
|
|
22
|
+
* ```tsx
|
|
23
|
+
* import { agGridReactMock } from "@everysk/apps-sdk/test/mocks";
|
|
24
|
+
*
|
|
25
|
+
* vi.mock("ag-grid-react", agGridReactMock);
|
|
26
|
+
*
|
|
27
|
+
* it("lists the portfolios", () => {
|
|
28
|
+
* renderWithProviders(<PortfolioGrid />);
|
|
29
|
+
* expect(screen.getAllByTestId("ag-grid-row")).toHaveLength(3);
|
|
30
|
+
* expect(screen.getByTestId("ag-grid-cell-name")).toHaveTextContent("Fund A");
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* Opt-in on purpose. Applying this from the shared setup file would mock `ag-grid-react` for
|
|
35
|
+
* every app — including apps that never installed it, since it is an *optional* peer, and
|
|
36
|
+
* `vi.mock` on a module that cannot be resolved fails the whole test file at transform time.
|
|
37
|
+
*/
|
|
38
|
+
export declare const agGridReactMock: () => {
|
|
39
|
+
AgGridReact: ({ rowData, columnDefs, children }: AgGridReactProps) => import("react").JSX.Element;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=agGridReact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agGridReact.d.ts","sourceRoot":"","sources":["../../../src/test/mocks/agGridReact.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,KAAK,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACzD,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC,KAAK,gBAAgB,GAAG;IACpB,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,eAAe;qDACyB,gBAAgB;CAsBnE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/test/mocks/agGridReact.tsx
|
|
3
|
+
/**
|
|
4
|
+
* agGridReactMock
|
|
5
|
+
*
|
|
6
|
+
* A stand-in for `ag-grid-react` that renders the data as plain DOM instead of running AG
|
|
7
|
+
* Grid's layout, virtualisation and ResizeObserver work — which is what makes grid tests slow
|
|
8
|
+
* under jsdom.
|
|
9
|
+
*
|
|
10
|
+
* It is deliberately not a black box: rows and cells are rendered with test ids, so
|
|
11
|
+
* assertions about *what the grid was given* keep working. Only the rendering engine is gone.
|
|
12
|
+
*
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { agGridReactMock } from "@everysk/apps-sdk/test/mocks";
|
|
15
|
+
*
|
|
16
|
+
* vi.mock("ag-grid-react", agGridReactMock);
|
|
17
|
+
*
|
|
18
|
+
* it("lists the portfolios", () => {
|
|
19
|
+
* renderWithProviders(<PortfolioGrid />);
|
|
20
|
+
* expect(screen.getAllByTestId("ag-grid-row")).toHaveLength(3);
|
|
21
|
+
* expect(screen.getByTestId("ag-grid-cell-name")).toHaveTextContent("Fund A");
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* Opt-in on purpose. Applying this from the shared setup file would mock `ag-grid-react` for
|
|
26
|
+
* every app — including apps that never installed it, since it is an *optional* peer, and
|
|
27
|
+
* `vi.mock` on a module that cannot be resolved fails the whole test file at transform time.
|
|
28
|
+
*/
|
|
29
|
+
var agGridReactMock = () => ({ AgGridReact: ({ rowData, columnDefs, children }) => {
|
|
30
|
+
const rows = rowData ?? [];
|
|
31
|
+
const columns = columnDefs ?? [];
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
"data-testid": "ag-grid",
|
|
34
|
+
"data-row-count": rows.length,
|
|
35
|
+
children: [rows.map((row, index) => /* @__PURE__ */ jsx("div", {
|
|
36
|
+
"data-testid": "ag-grid-row",
|
|
37
|
+
children: columns.map((column) => /* @__PURE__ */ jsx("span", {
|
|
38
|
+
"data-testid": `ag-grid-cell-${column.field ?? ""}`,
|
|
39
|
+
children: String(row[column.field ?? ""] ?? "")
|
|
40
|
+
}, column.field ?? column.headerName))
|
|
41
|
+
}, index)), children]
|
|
42
|
+
});
|
|
43
|
+
} });
|
|
44
|
+
//#endregion
|
|
45
|
+
export { agGridReactMock };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=agGridReact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agGridReact.js","names":[],"sources":["../../../src/test/mocks/agGridReact.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\n\ntype ColumnDef = { field?: string; headerName?: string };\ntype Row = Record<string, unknown>;\n\ntype AgGridReactProps = {\n rowData?: Row[] | null;\n columnDefs?: ColumnDef[] | null;\n children?: ReactNode;\n};\n\n/**\n * agGridReactMock\n *\n * A stand-in for `ag-grid-react` that renders the data as plain DOM instead of running AG\n * Grid's layout, virtualisation and ResizeObserver work — which is what makes grid tests slow\n * under jsdom.\n *\n * It is deliberately not a black box: rows and cells are rendered with test ids, so\n * assertions about *what the grid was given* keep working. Only the rendering engine is gone.\n *\n * ```tsx\n * import { agGridReactMock } from \"@everysk/apps-sdk/test/mocks\";\n *\n * vi.mock(\"ag-grid-react\", agGridReactMock);\n *\n * it(\"lists the portfolios\", () => {\n * renderWithProviders(<PortfolioGrid />);\n * expect(screen.getAllByTestId(\"ag-grid-row\")).toHaveLength(3);\n * expect(screen.getByTestId(\"ag-grid-cell-name\")).toHaveTextContent(\"Fund A\");\n * });\n * ```\n *\n * Opt-in on purpose. Applying this from the shared setup file would mock `ag-grid-react` for\n * every app — including apps that never installed it, since it is an *optional* peer, and\n * `vi.mock` on a module that cannot be resolved fails the whole test file at transform time.\n */\nexport const agGridReactMock = () => ({\n AgGridReact: ({ rowData, columnDefs, children }: AgGridReactProps) => {\n const rows = rowData ?? [];\n const columns = columnDefs ?? [];\n\n return (\n <div data-testid=\"ag-grid\" data-row-count={rows.length}>\n {rows.map((row, index) => (\n <div key={index} data-testid=\"ag-grid-row\">\n {columns.map((column) => (\n <span\n key={column.field ?? column.headerName}\n data-testid={`ag-grid-cell-${column.field ?? \"\"}`}\n >\n {String(row[column.field ?? \"\"] ?? \"\")}\n </span>\n ))}\n </div>\n ))}\n {children}\n </div>\n );\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAa,yBAAyB,EAClC,cAAc,EAAE,SAAS,YAAY,eAAiC;CAClE,MAAM,OAAO,WAAW,CAAC;CACzB,MAAM,UAAU,cAAc,CAAC;CAE/B,OACI,qBAAC,OAAD;EAAK,eAAY;EAAU,kBAAgB,KAAK;EAAhD,UAAA,CACK,KAAK,KAAK,KAAK,UACZ,oBAAC,OAAD;GAAiB,eAAY;GACxB,UAAA,QAAQ,KAAK,WACV,oBAAC,QAAD;IAEI,eAAa,gBAAgB,OAAO,SAAS;IAE5C,UAAA,OAAO,IAAI,OAAO,SAAS,OAAO,EAAE;GACnC,GAJG,OAAO,SAAS,OAAO,UAI1B,CACT;EACA,GATK,KASL,CACR,GACA,QACA;;AAEb,EACJ"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { agGridReactMock } from "./agGridReact";
|
|
2
|
+
export { agGridEnterpriseMock, getAgGridLicenseKey, resetAgGridLicense, } from "./agGridEnterprise";
|
|
3
|
+
export { socketIoClientMock, createMockSocket, getMockSocket, resetMockSocket, } from "./socketIoClient";
|
|
4
|
+
export type { MockSocket, SocketEventHandler } from "./socketIoClient";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/mocks/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACH,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,eAAe,GAClB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|