From 6b2792fa50d066d9d7340e9e6843ba18232b1726 Mon Sep 17 00:00:00 2001 From: Jonathan Perchoc Date: Fri, 5 Jul 2024 11:02:50 +0200 Subject: [PATCH] feat: cleanup project Signed-off-by: Jonathan Perchoc --- .../{src => }/index.html | 2 +- .../public/assets/engines/cassandra.png | Bin .../public/assets/engines/grafana.png | Bin .../{src => }/public/assets/engines/kafka.png | Bin .../public/assets/engines/kafkaConnect.png | Bin .../assets/engines/kafkaMirrorMaker.png | Bin .../public/assets/engines/m3aggregator.png | Bin .../{src => }/public/assets/engines/m3db.png | Bin .../public/assets/engines/mongodb.png | Bin .../{src => }/public/assets/engines/mysql.png | Bin .../public/assets/engines/opensearch.png | Bin .../public/assets/engines/postgresql.png | Bin .../{src => }/public/assets/engines/redis.png | Bin .../public/assets/onboarding-image.png | Bin .../{src => }/public/assets/oops.png | Bin .../translations/bytes/Messages_de_DE.json | 0 .../translations/bytes/Messages_en_GB.json | 0 .../translations/bytes/Messages_es_ES.json | 0 .../translations/bytes/Messages_fr_CA.json | 0 .../translations/bytes/Messages_fr_FR.json | 0 .../translations/bytes/Messages_it_IT.json | 0 .../translations/bytes/Messages_pl_PL.json | 0 .../translations/bytes/Messages_pt_PT.json | 0 .../translations/error/Messages_de_DE.json | 0 .../translations/error/Messages_en_GB.json | 0 .../translations/error/Messages_es_ES.json | 0 .../translations/error/Messages_fr_CA.json | 0 .../translations/error/Messages_fr_FR.json | 0 .../translations/error/Messages_it_IT.json | 0 .../translations/error/Messages_pl_PL.json | 0 .../translations/error/Messages_pt_PT.json | 0 .../translations/guides/Messages_de_DE.json | 0 .../translations/guides/Messages_en_GB.json | 0 .../translations/guides/Messages_es_ES.json | 0 .../translations/guides/Messages_fr_CA.json | 0 .../translations/guides/Messages_fr_FR.json | 0 .../translations/guides/Messages_it_IT.json | 0 .../translations/guides/Messages_pl_PL.json | 0 .../translations/guides/Messages_pt_PT.json | 0 .../Messages_de_DE.json | 0 .../Messages_en_GB.json | 0 .../Messages_es_ES.json | 0 .../Messages_fr_CA.json | 0 .../Messages_fr_FR.json | 0 .../Messages_it_IT.json | 0 .../Messages_pl_PL.json | 0 .../Messages_pt_PT.json | 0 .../components/cluster/Messages_de_DE.json | 0 .../components/cluster/Messages_en_GB.json | 0 .../components/cluster/Messages_es_ES.json | 0 .../components/cluster/Messages_fr_CA.json | 0 .../components/cluster/Messages_fr_FR.json | 0 .../components/cluster/Messages_it_IT.json | 0 .../components/cluster/Messages_pl_PL.json | 0 .../components/cluster/Messages_pt_PT.json | 0 .../components/engine/Messages_de_DE.json | 0 .../components/engine/Messages_en_GB.json | 0 .../components/engine/Messages_es_ES.json | 0 .../components/engine/Messages_fr_CA.json | 0 .../components/engine/Messages_fr_FR.json | 0 .../components/engine/Messages_it_IT.json | 0 .../components/engine/Messages_pl_PL.json | 0 .../components/engine/Messages_pt_PT.json | 0 .../components/flavor/Messages_de_DE.json | 0 .../components/flavor/Messages_en_GB.json | 0 .../components/flavor/Messages_es_ES.json | 0 .../components/flavor/Messages_fr_CA.json | 0 .../components/flavor/Messages_fr_FR.json | 0 .../components/flavor/Messages_it_IT.json | 0 .../components/flavor/Messages_pl_PL.json | 0 .../components/flavor/Messages_pt_PT.json | 0 .../order-options/Messages_de_DE.json | 0 .../order-options/Messages_en_GB.json | 0 .../order-options/Messages_es_ES.json | 0 .../order-options/Messages_fr_CA.json | 0 .../order-options/Messages_fr_FR.json | 0 .../order-options/Messages_it_IT.json | 0 .../order-options/Messages_pl_PL.json | 0 .../order-options/Messages_pt_PT.json | 0 .../components/plan/Messages_de_DE.json | 0 .../components/plan/Messages_en_GB.json | 0 .../components/plan/Messages_es_ES.json | 0 .../components/plan/Messages_fr_CA.json | 0 .../components/plan/Messages_fr_FR.json | 0 .../components/plan/Messages_it_IT.json | 0 .../components/plan/Messages_pl_PL.json | 0 .../components/plan/Messages_pt_PT.json | 0 .../services/Messages_de_DE.json | 0 .../services/Messages_en_GB.json | 0 .../services/Messages_es_ES.json | 0 .../services/Messages_fr_CA.json | 0 .../services/Messages_fr_FR.json | 0 .../services/Messages_it_IT.json | 0 .../services/Messages_pl_PL.json | 0 .../services/Messages_pt_PT.json | 0 .../services/new/Messages_de_DE.json | 0 .../services/new/Messages_en_GB.json | 0 .../services/new/Messages_es_ES.json | 0 .../services/new/Messages_fr_CA.json | 0 .../services/new/Messages_fr_FR.json | 0 .../services/new/Messages_it_IT.json | 0 .../services/new/Messages_pl_PL.json | 0 .../services/new/Messages_pt_PT.json | 0 .../services/onboarding/Messages_de_DE.json | 0 .../services/onboarding/Messages_en_GB.json | 0 .../services/onboarding/Messages_es_ES.json | 0 .../services/onboarding/Messages_fr_CA.json | 0 .../services/onboarding/Messages_fr_FR.json | 0 .../services/onboarding/Messages_it_IT.json | 0 .../services/onboarding/Messages_pl_PL.json | 0 .../services/onboarding/Messages_pt_PT.json | 0 .../services/service/Messages_de_DE.json | 0 .../services/service/Messages_en_GB.json | 0 .../services/service/Messages_es_ES.json | 0 .../services/service/Messages_fr_CA.json | 0 .../services/service/Messages_fr_FR.json | 0 .../services/service/Messages_it_IT.json | 0 .../services/service/Messages_pl_PL.json | 0 .../services/service/Messages_pt_PT.json | 0 .../service/backups/Messages_de_DE.json | 0 .../service/backups/Messages_en_GB.json | 0 .../service/backups/Messages_es_ES.json | 0 .../service/backups/Messages_fr_CA.json | 0 .../service/backups/Messages_fr_FR.json | 0 .../service/backups/Messages_it_IT.json | 0 .../service/backups/Messages_pl_PL.json | 0 .../service/backups/Messages_pt_PT.json | 0 .../service/backups/fork/Messages_de_DE.json | 0 .../service/backups/fork/Messages_en_GB.json | 0 .../service/backups/fork/Messages_es_ES.json | 0 .../service/backups/fork/Messages_fr_CA.json | 0 .../service/backups/fork/Messages_fr_FR.json | 0 .../service/backups/fork/Messages_it_IT.json | 0 .../service/backups/fork/Messages_pl_PL.json | 0 .../service/backups/fork/Messages_pt_PT.json | 0 .../service/dashboard/Messages_de_DE.json | 0 .../service/dashboard/Messages_en_GB.json | 0 .../service/dashboard/Messages_es_ES.json | 0 .../service/dashboard/Messages_fr_CA.json | 0 .../service/dashboard/Messages_fr_FR.json | 0 .../service/dashboard/Messages_it_IT.json | 0 .../service/dashboard/Messages_pl_PL.json | 0 .../service/dashboard/Messages_pt_PT.json | 0 .../service/databases/Messages_de_DE.json | 0 .../service/databases/Messages_en_GB.json | 0 .../service/databases/Messages_es_ES.json | 0 .../service/databases/Messages_fr_CA.json | 0 .../service/databases/Messages_fr_FR.json | 0 .../service/databases/Messages_it_IT.json | 0 .../service/databases/Messages_pl_PL.json | 0 .../service/databases/Messages_pt_PT.json | 0 .../service/integrations/Messages_de_DE.json | 0 .../service/integrations/Messages_en_GB.json | 0 .../service/integrations/Messages_es_ES.json | 0 .../service/integrations/Messages_fr_CA.json | 0 .../service/integrations/Messages_fr_FR.json | 0 .../service/integrations/Messages_it_IT.json | 0 .../service/integrations/Messages_pl_PL.json | 0 .../service/integrations/Messages_pt_PT.json | 0 .../services/service/logs/Messages_de_DE.json | 0 .../services/service/logs/Messages_en_GB.json | 0 .../services/service/logs/Messages_es_ES.json | 0 .../services/service/logs/Messages_fr_CA.json | 0 .../services/service/logs/Messages_fr_FR.json | 0 .../services/service/logs/Messages_it_IT.json | 0 .../services/service/logs/Messages_pl_PL.json | 0 .../services/service/logs/Messages_pt_PT.json | 0 .../service/metrics/Messages_de_DE.json | 0 .../service/metrics/Messages_en_GB.json | 0 .../service/metrics/Messages_es_ES.json | 0 .../service/metrics/Messages_fr_CA.json | 0 .../service/metrics/Messages_fr_FR.json | 0 .../service/metrics/Messages_it_IT.json | 0 .../service/metrics/Messages_pl_PL.json | 0 .../service/metrics/Messages_pt_PT.json | 0 .../service/namespaces/Messages_de_DE.json | 0 .../service/namespaces/Messages_en_GB.json | 0 .../service/namespaces/Messages_es_ES.json | 0 .../service/namespaces/Messages_fr_CA.json | 0 .../service/namespaces/Messages_fr_FR.json | 0 .../service/namespaces/Messages_it_IT.json | 0 .../service/namespaces/Messages_pl_PL.json | 0 .../service/namespaces/Messages_pt_PT.json | 0 .../service/pools/Messages_de_DE.json | 0 .../service/pools/Messages_en_GB.json | 0 .../service/pools/Messages_es_ES.json | 0 .../service/pools/Messages_fr_CA.json | 0 .../service/pools/Messages_fr_FR.json | 0 .../service/pools/Messages_it_IT.json | 0 .../service/pools/Messages_pl_PL.json | 0 .../service/pools/Messages_pt_PT.json | 0 .../service/queries/Messages_de_DE.json | 0 .../service/queries/Messages_en_GB.json | 0 .../service/queries/Messages_es_ES.json | 0 .../service/queries/Messages_fr_CA.json | 0 .../service/queries/Messages_fr_FR.json | 0 .../service/queries/Messages_it_IT.json | 0 .../service/queries/Messages_pl_PL.json | 0 .../service/queries/Messages_pt_PT.json | 0 .../service/settings/Messages_de_DE.json | 0 .../service/settings/Messages_en_GB.json | 0 .../service/settings/Messages_es_ES.json | 0 .../service/settings/Messages_fr_CA.json | 0 .../service/settings/Messages_fr_FR.json | 0 .../service/settings/Messages_it_IT.json | 0 .../service/settings/Messages_pl_PL.json | 0 .../service/settings/Messages_pt_PT.json | 0 .../settings/update/Messages_de_DE.json | 0 .../settings/update/Messages_en_GB.json | 0 .../settings/update/Messages_es_ES.json | 0 .../settings/update/Messages_fr_CA.json | 0 .../settings/update/Messages_fr_FR.json | 0 .../settings/update/Messages_it_IT.json | 0 .../settings/update/Messages_pl_PL.json | 0 .../settings/update/Messages_pt_PT.json | 0 .../service/users/Messages_de_DE.json | 0 .../service/users/Messages_en_GB.json | 0 .../service/users/Messages_es_ES.json | 0 .../service/users/Messages_fr_CA.json | 0 .../service/users/Messages_fr_FR.json | 0 .../service/users/Messages_it_IT.json | 0 .../service/users/Messages_pl_PL.json | 0 .../service/users/Messages_pt_PT.json | 0 .../services/status/Messages_de_DE.json | 0 .../services/status/Messages_en_GB.json | 0 .../services/status/Messages_es_ES.json | 0 .../services/status/Messages_fr_CA.json | 0 .../services/status/Messages_fr_FR.json | 0 .../services/status/Messages_it_IT.json | 0 .../services/status/Messages_pl_PL.json | 0 .../services/status/Messages_pt_PT.json | 0 .../translations/pricing/Messages_de_DE.json | 0 .../translations/pricing/Messages_en_GB.json | 0 .../translations/pricing/Messages_es_ES.json | 0 .../translations/pricing/Messages_fr_CA.json | 0 .../translations/pricing/Messages_fr_FR.json | 0 .../translations/pricing/Messages_it_IT.json | 0 .../translations/pricing/Messages_pl_PL.json | 0 .../translations/pricing/Messages_pt_PT.json | 0 .../translations/regions/Messages_de_DE.json | 0 .../translations/regions/Messages_en_GB.json | 0 .../translations/regions/Messages_es_ES.json | 0 .../translations/regions/Messages_fr_CA.json | 0 .../translations/regions/Messages_fr_FR.json | 0 .../translations/regions/Messages_it_IT.json | 0 .../translations/regions/Messages_pl_PL.json | 0 .../translations/regions/Messages_pt_PT.json | 0 .../apps/pci-databases-analytics/src/App.tsx | 8 +- .../src/__tests__/components/links.test.tsx | 203 -- .../__tests__/helpers/mocks/availabilities.ts | 28 +- .../availabilitiesMock/availabilities.ts | 16 +- .../mocks}/availabilitiesMock/capabilities.ts | 12 +- .../mocks}/availabilitiesMock/catalog.ts | 2 +- .../src/__tests__/helpers/mocks/backup.ts | 3 +- .../src/__tests__/helpers/mocks/catalog.ts | 2 +- .../src/__tests__/helpers/mocks/cdbError.ts | 2 +- .../__tests__/helpers/mocks/connectionPool.ts | 4 +- .../__tests__/helpers/mocks/databaseUser.ts | 4 +- .../src/__tests__/helpers/mocks/databases.ts | 2 +- .../src/__tests__/helpers/mocks/guides.ts | 4 +- .../__tests__/helpers/mocks/integrations.ts | 2 +- .../src/__tests__/helpers/mocks/logs.ts | 2 +- .../__tests__/helpers/mocks/maintenances.ts | 2 +- .../src/__tests__/helpers/mocks/metrics.ts | 2 +- .../src/__tests__/helpers/mocks/namespaces.ts | 2 +- .../src/__tests__/helpers/mocks/network.ts | 4 +- .../src/__tests__/helpers/mocks/nodes.ts | 2 +- .../__tests__/helpers/mocks/order-funnel.ts | 20 +- .../__tests__/helpers/mocks/pciProjects.ts | 13 +- .../src/__tests__/helpers/mocks/queries.ts | 2 +- .../src/__tests__/helpers/mocks/services.ts | 12 +- .../src/__tests__/helpers/mocks/user.ts | 3 + .../helpers/wrappers/QueryClientWrapper.tsx | 4 +- .../wrappers/RouterWithLocationWrapper.tsx | 2 +- .../wrappers/RouterWithQueryClientWrapper.tsx | 4 +- .../api/advancedConfiguration.hook.test.tsx | 117 -- .../hooks/api/availabilities.hook.test.tsx | 167 -- .../hooks/api/connectionPool.hook.test.tsx | 161 -- .../hooks/api/databases.hook.test.tsx | 114 -- .../hooks/api/integrations.hook.test.tsx | 151 -- .../hooks/api/namespaces.hook.test.tsx | 153 -- .../__tests__/hooks/api/network.hook.test.tsx | 82 - .../src/api/projects.ts | 7 - .../Breadcrumb.component.tsx} | 5 +- .../breadcrumb/Breadcrumb.spec.tsx} | 6 +- .../BreadcrumbItem.component.tsx} | 0 .../breadcrumb/BreadcrumbItem.spec.tsx} | 2 +- .../ErrorBoundary.component.tsx} | 6 +- .../error-boundary/ErrorBoundary.spec.tsx} | 4 +- .../FormattedDate.component.tsx} | 0 .../formatted-date/FormattedDate.spec.tsx} | 2 +- .../Guides.component.tsx} | 12 +- .../guides/Guides.spec.tsx} | 11 +- .../src/components/links.tsx | 154 -- .../src/components/links/A.component.tsx | 38 + .../src/components/links/A.spec.tsx | 34 + .../src/components/links/Link.component.tsx | 39 + .../src/components/links/Link.spec.tsx | 85 + .../components/links/NavLink.component.tsx | 45 + .../src/components/links/NavLink.spec.tsx | 84 + .../components/links/OvhLink.component.tsx | 38 + .../src/components/links/OvhLink.spec.tsx | 27 + .../Loading.component.tsx} | 0 .../loading/Loading.spec.tsx} | 2 +- .../ProgressLoader.component.tsx} | 0 .../loading/ProgressLoader.spec.tsx} | 2 +- .../NodesConfig.component.tsx} | 0 .../NodesConfig.spec.tsx} | 2 +- .../StorageConfig.component.tsx} | 2 +- .../StorageConfig.spec.tsx} | 2 +- .../IpsRestricitonsForm.spec.tsx} | 4 +- .../IpsRestrictionsForm.component.tsx} | 2 +- .../NetworkOptions.components.tsx} | 9 +- .../cluster-options/NetworkOptions.spec.tsx} | 24 +- .../engine/EngineSelect.component.tsx} | 4 +- .../order/engine/EngineSelect.spec.tsx} | 4 +- .../engine/EngineTile.component.tsx} | 8 +- .../order/engine/EngineTile.spec.tsx} | 2 +- .../engine/EngineTileVersion.component.tsx} | 2 +- .../order/engine/EngineTileVersion.spec.tsx} | 2 +- .../error-list/ErrorList.component.tsx} | 0 .../order/error-list/ErrorList.spec.tsx} | 2 +- .../flavor/FlavorSelect.component.tsx} | 4 +- .../order/flavor/FlavorSelect.spec.tsx} | 4 +- .../plan/PlanSelect.component.tsx} | 4 +- .../order/plan/PlanSelect.spec.tsx} | 2 +- .../plan/PlanTile.component.tsx} | 8 +- .../order/plan/PlanTile.spec.tsx} | 4 +- .../price/OrderPrice.component.tsx} | 2 +- .../order/price/OrderPrice.spec.tsx} | 2 +- .../region/RegionSelect.component.tsx} | 4 +- .../order/region/RegionSelect.spec.tsx} | 2 +- .../PageLayout.component.tsx} | 0 .../page-layout/PageLayout.spec.tsx} | 2 +- .../PriceUnitSwitch.component.tsx} | 2 +- .../PriceUnitSwitch.spec.tsx} | 2 +- .../{price.tsx => price/Price.component.tsx} | 0 .../price/Price.spec.tsx} | 2 +- .../RadioTile.component.tsx} | 0 .../radio-tile/RadioTile.spec.tsx} | 2 +- .../TabsMenu.component.tsx} | 8 +- .../tabs-menu/TabsMenu.spec.tsx} | 4 +- .../TagsInput.component.tsx} | 12 +- .../tags-input/TagsInput.spec.tsx} | 2 +- .../{polling.ts => polling.constants.ts} | 0 .../{toast.ts => toast.constants.ts} | 0 .../{tracking.ts => tracking.constants.ts} | 2 +- ...ntext.tsx => LoadingIndicator.context.tsx} | 0 ...ityContext.tsx => UserActivityContext.tsx} | 0 .../api/catalog/catalog.api.ts} | 2 +- .../api/catalog/catalog.spec.tsx} | 2 +- .../database/advancedConfiguration.api.ts} | 8 +- .../database/advancedConfiguration.spec.tsx} | 8 +- .../api/database/availability.api.ts} | 23 +- .../api/database/availability.spec.tsx} | 31 +- .../api/database/backup.api.ts} | 6 +- .../api/database/backup.spec.tsx} | 7 +- .../src/data/api/database/capabilities.api.ts | 17 + .../data/api/database/capabilities.spec.tsx | 50 + .../api/database/certificate.api.ts} | 3 +- .../api/database/certificate.spec.tsx} | 4 +- .../api/database/connectionPool.api.ts} | 16 +- .../api/database/connectionPool.spec.tsx} | 4 +- .../api/database/database.api.ts} | 10 +- .../api/database/database.spec.tsx} | 4 +- .../databases => data/api/database}/index.tsx | 2 +- .../api/database/integration.api.ts} | 10 +- .../api/database/integration.spec.tsx} | 4 +- .../logs.ts => data/api/database/logs.api.ts} | 2 +- .../api/database/logs.spec.tsx} | 4 +- .../api/database/maintenance.api.ts} | 6 +- .../api/database/maintenance.spec.tsx} | 4 +- .../api/database/metric.api.ts} | 6 +- .../api/database/metric.spec.tsx} | 4 +- .../api/database/namespace.api.ts} | 14 +- .../api/database/namespace.spec.tsx} | 4 +- .../api/database/node.api.ts} | 12 +- .../api/database/node.spec.tsx} | 4 +- .../api/database/queries.api.ts} | 6 +- .../api/database/queries.spec.tsx} | 4 +- .../api/database/service.api.ts} | 14 +- .../api/database/service.spec.tsx} | 10 +- .../api/database/user.api.ts} | 18 +- .../api/database/user.spec.tsx} | 4 +- .../api/guides/guides.api.ts} | 2 +- .../api/network/network.api.ts} | 3 +- .../api/network/network.spec.tsx} | 2 +- .../src/data/api/project/project.api.ts | 7 + .../api/project/project.spec.tsx} | 2 +- .../api/advancedConfiguration.api.hook.tsx | 84 - .../hooks/api/availabilities.api.hooks.tsx | 131 -- .../src/hooks/api/backups.api.hooks.tsx | 48 - .../useGetCatalog.hook.tsx} | 8 +- .../api/catalog/useGetCatalog.spec.tsx} | 6 +- .../hooks/api/connectionPool.api.hooks.tsx | 101 - .../useEditAdvancedConfiguration.hook.tsx | 32 + .../useEditAdvancedConfiguration.spec.tsx | 48 + .../useGetAdvancedConfiguration.hook.tsx | 25 + .../useGetAdvancedConfiguration.spec.tsx | 36 + ...AdvancedConfigurationCapabilities.hook.tsx | 29 + ...AdvancedConfigurationCapabilities.spec.tsx | 47 + .../useGetAvailabilities.hook.tsx | 31 + .../useGetAvailabilities.spec.tsx | 36 + .../availability/useGetSuggestions.hook.tsx | 16 + .../availability/useGetSuggestions.spec.tsx | 31 + .../database/backup/useGetBackups.hook.tsx | 18 + .../database/backup/useGetBackups.spec.tsx | 37 + .../database/backup/useRestoreBackup.hook.tsx | 24 + .../backup/useRestoreBackup.spec.tsx} | 34 +- .../capabilities/useGetCapabilities.hook.tsx | 16 + .../capabilities/useGetCapabilities.spec.tsx | 31 + .../useGetEnginesCapabilities.hook.tsx | 16 + .../useGetEnginesCapabilities.spec.tsx | 33 + .../useGetFullCapabilities.hook.tsx | 54 + .../useGetFullCapabilities.spec.tsx | 48 + .../useGetRegionsCapabilities.hook.tsx | 16 + .../useGetRegionsCapabilities.spec.tsx | 33 + .../certificate/useGetCertificate.hook.tsx} | 6 +- .../certificate/useGetCertificate.spec.tsx} | 8 +- .../useAddConnectionPool.hook.tsx | 32 + .../useAddConnectionPool.spec.tsx | 52 + .../useDeleteConnectionPool.hook.tsx | 31 + .../useDeleteConnectionPool.spec.tsx | 47 + .../useEditConnectionPool.hook.tsx | 32 + .../useEditConnectionPool.spec.tsx | 52 + .../useGetConnectionPools.hook.tsx | 19 + .../useGetConnectionPools.spec.tsx | 39 + .../database/database/useAddDatabase.hook.tsx | 25 + .../database/database/useAddDatabase.spec.tsx | 46 + .../database/useDeleteDatabase.hook.tsx | 27 + .../database/useDeleteDatabase.spec.tsx | 48 + .../database/useGetDatabases.hook.tsx | 18 + .../database/useGetDatabases.spec.tsx | 40 + .../integration/useAddIntegration.hook.tsx | 28 + .../integration/useAddIntegration.spec.tsx | 53 + .../integration/useDeleteIntegration.hook.tsx | 30 + .../integration/useDeleteIntegration.spec.tsx | 50 + .../useGetCapabilitiesIntegrations.hook.tsx | 25 + .../useGetCapabilitiesIntegrations.spec.tsx | 44 + .../integration/useGetIntegrations.hook.tsx | 18 + .../integration/useGetIntegrations.spec.tsx | 42 + .../logs/useGetServiceLogs.hook.tsx} | 6 +- .../database/logs/useGetServiceLogs.spec.tsx} | 8 +- .../maintenance/useApplyMaintenance.hook.tsx | 33 + .../maintenance/useApplyMaintenance.spec.tsx} | 38 +- .../maintenance/useGetMaintenances.hook.tsx | 18 + .../maintenance/useGetMaintenances.spec.tsx | 39 + .../metric/useGetMetric.hook.tsx} | 20 +- .../database/metric/useGetMetric.spec.tsx} | 33 +- .../database/metric/useGetMetrics.hook.tsx | 18 + .../database/metric/useGetMetrics.spec.tsx | 36 + .../namespace/useAddNamespace.hook.tsx | 25 + .../namespace/useAddNamespace.spec.tsx | 51 + .../namespace/useDeleteNamespace.hook.tsx | 27 + .../namespace/useDeleteNamespace.spec.tsx | 50 + .../namespace/useEditNamepsace.spec.tsx | 53 + .../namespace/useEditNamespace.hook.tsx | 28 + .../namespace/useGetNamespaces.hook.tsx | 18 + .../namespace/useGetNamespaces.spec.tsx | 40 + .../api/database/node/useAddNode.hook.tsx | 25 + .../api/database/node/useAddNode.spec.tsx} | 41 +- .../api/database/node/useDeleteNode.hook.tsx | 25 + .../api/database/node/useDeleteNode.spec.tsx | 45 + .../query/useCancelCurrentQuery.hook.tsx | 33 + .../query/useCancelCurrentQuery.spec.tsx | 54 + .../query/useGetCurrentQueries.hook.tsx | 18 + .../query/useGetCurrentQueries.spec.tsx | 39 + .../query/useGetQueryStatistics.hook.tsx | 27 + .../query/useGetQueryStatistics.spec.tsx | 41 + .../query/useResetQueryStatistics.hook.tsx | 27 + .../query/useResetQueryStatistics.spec.tsx} | 70 +- .../database/service/useAddService.hook.tsx | 41 + .../database/service/useAddService.spec.tsx | 42 + .../service/useDeleteService.hook.tsx | 25 + .../service/useDeleteService.spec.tsx} | 78 +- .../database/service/useEditService.hook.tsx | 23 + .../database/service/useEditService.spec.tsx | 48 + .../database/service/useGetService.hook.tsx | 18 + .../database/service/useGetService.spec.tsx | 36 + .../database/service/useGetServices.hook.tsx | 16 + .../database/service/useGetServices.spec.tsx | 35 + .../api/database/user/useAddUser.hook.tsx | 24 + .../api/database/user/useAddUser.spec.tsx | 52 + .../api/database/user/useDeleteUser.hook.tsx | 24 + .../api/database/user/useDeleteUser.spec.tsx | 49 + .../api/database/user/useEditUser.hook.tsx | 24 + .../api/database/user/useEditUser.spec.tsx} | 100 +- .../api/database/user/useGetRoles.hook.tsx | 18 + .../api/database/user/useGetRoles.spec.tsx | 41 + .../api/database/user/useGetUsers.hook.tsx | 18 + .../api/database/user/useGetUsers.spec.tsx | 42 + .../user/useResetUserPassword.hook.tsx | 31 + .../user/useResetUserPassword.spec.tsx | 54 + .../src/hooks/api/databases.api.hook.tsx | 74 - .../useGetGuides.hook.tsx} | 6 +- .../src/hooks/api/integrations.api.hook.tsx | 99 - .../src/hooks/api/maintenances.api.hooks.tsx | 53 - .../src/hooks/api/namespaces.api.hooks.tsx | 96 - .../src/hooks/api/network.api.hooks.tsx | 41 - .../hooks/api/network/useGetNetwork.hook.tsx | 16 + .../hooks/api/network/useGetNetwork.spec.tsx | 34 + .../hooks/api/network/useGetSubnet.hook.tsx | 17 + .../hooks/api/network/useGetSubnet.spec.tsx | 36 + .../hooks/api/network/useGetVrack.hook.tsx | 16 + .../hooks/api/network/useGetVrack.spec.tsx | 32 + .../src/hooks/api/nodes.api.hooks.tsx | 51 - .../usePciProject.hook.tsx} | 5 +- .../api/project/usePciProject.spec.tsx} | 6 +- .../src/hooks/api/queries.api.hooks.tsx | 100 - .../src/hooks/api/services.api.hooks.tsx | 119 -- .../src/hooks/api/users.api.hooks.tsx | 132 -- .../useDateFnsLocale.hook.spec.tsx} | 0 .../useDownload.spec.tsx} | 0 .../useMeanMetric.spec.tsx} | 8 +- .../src/hooks/useMeanMetric.tsx | 4 +- .../useModale.spec.tsx} | 2 +- .../useQueryState.spec.tsx} | 2 +- .../src/hooks/useTracking.ts | 8 +- .../useUser.spec.tsx} | 0 .../useUserActivity.spec.tsx} | 0 .../useVrack.spec.tsx} | 9 +- .../src/hooks/useVrack.ts | 5 +- .../src/lib/apiHelper.ts | 11 + .../availabilitiesHelper.spec.tsx} | 6 +- .../src/lib/availabilitiesHelper.ts | 24 +- .../bytesHelper.spec.tsx} | 0 .../durationHelper.spec.tsx} | 0 .../engineNameHelper.spec.tsx} | 2 +- .../src/lib/engineNameHelper.ts | 2 +- .../nameGenerator.spec.tsx} | 0 .../pricingHelper.spec.tsx} | 4 +- .../src/lib/pricingHelper.ts | 4 +- .../tagsHelper.spec.tsx} | 14 +- .../src/lib/tagsHelper.ts | 12 +- .../src/{index.tsx => main.tsx} | 2 +- .../src/models/database.ts | 1774 ----------------- .../src/models/network.ts | 78 - .../src/models/project.ts | 14 - .../src/pages/{404.tsx => 404.page.tsx} | 0 .../404.test.tsx => pages/404.spec.tsx} | 2 +- .../Root.layout.spec.tsx} | 10 +- .../src/pages/{layout.tsx => Root.layout.tsx} | 25 +- .../src/pages/Root.page.tsx | 5 + .../home.test.tsx => pages/Root.spec.tsx} | 6 +- .../app.test.tsx => pages/_app.spec.tsx} | 0 ...ntions.tsx => LegalMentions.component.tsx} | 0 .../src/pages/index.tsx | 5 - .../services/{index.tsx => Services.page.tsx} | 25 +- .../services/Services.spec.tsx} | 14 +- .../services/[serviceId]/Service.context.tsx | 14 + .../[serviceId]/Service.layout.spec.tsx} | 10 +- .../{layout.tsx => Service.layout.tsx} | 37 +- ...ervice.tsx => DeleteService.component.tsx} | 16 +- ...ervice.tsx => RenameService.component.tsx} | 17 +- ...Header.tsx => ServiceHeader.component.tsx} | 4 +- ...viceTabs.tsx => ServiceTabs.component.tsx} | 22 +- .../backups/Backups.layout.spec.tsx} | 6 +- .../{layout.tsx => Backups.layout.tsx} | 4 +- .../backups/{index.tsx => Backups.page.tsx} | 20 +- .../[serviceId]/backups/Backups.spec.tsx} | 20 +- ....tsx => BackupsTableColumns.component.tsx} | 10 +- .../{restore.tsx => Restore.component.tsx} | 15 +- .../backups/fork/{index.tsx => Fork.page.tsx} | 28 +- .../[serviceId]/backups/fork/Fork.spec.tsx} | 27 +- .../{fork-form.tsx => ForkForm.component.tsx} | 43 +- ...-summary.tsx => ForkSummary.component.tsx} | 8 +- .../{useFork.tsx => useFork.hook.tsx} | 14 +- .../{index.tsx => Dashboard.page.tsx} | 35 +- .../[serviceId]/dashboard/Dashboard.spec.tsx} | 20 +- ...ls.tsx => ConnectionDetails.component.tsx} | 2 +- ...ntenance.tsx => Maintenance.component.tsx} | 12 +- ...eanMetric.tsx => MeanMetric.component.tsx} | 2 +- .../_components/meanMetric.spec.tsx} | 8 +- .../{index.tsx => Database.page.tsx} | 18 +- .../[serviceId]/databases/Databases.spec.tsx} | 18 +- ...Database.tsx => AddDatabase.component.tsx} | 7 +- ...sx => DatabasesTableColumns.component.tsx} | 4 +- ...abase.tsx => DeleteDatabase.component.tsx} | 8 +- .../{index.tsx => Integrations.page.tsx} | 24 +- .../integrations/Integrations.spec.tsx} | 20 +- ...ation.tsx => AddIntegration.component.tsx} | 13 +- .../_components/AddIntegrations.spec.tsx} | 12 +- ...on.tsx => DeleteIntegration.component.tsx} | 11 +- ...x => IntegrationListColumns.component.tsx} | 10 +- ...x => IntegrationServiceLink.component.tsx} | 6 +- ...ook.tsx => useAddIntegrationForm.hook.tsx} | 12 +- .../logs/{index.tsx => Logs.page.tsx} | 16 +- .../services/[serviceId]/logs/Logs.spec.tsx} | 20 +- .../metrics/{index.tsx => Metrics.page.tsx} | 16 +- .../[serviceId]/metrics/Metrics.spec.tsx} | 8 +- ...ricChart.tsx => MetricChart.component.tsx} | 10 +- .../{colors.ts => colors.constants.ts} | 0 .../{index.tsx => Namespace.page.tsx} | 21 +- .../namespaces/Namespaces.spec.tsx} | 18 +- ...ace.tsx => AddEditNamespace.component.tsx} | 21 +- ...pace.tsx => DeleteNamespace.component.tsx} | 7 +- ...x => NamespacesTableColumns.component.tsx} | 4 +- ...espace.const.ts => namespace.constants.ts} | 0 ...ace.hook.tsx => useNamespaceForm.hook.tsx} | 4 +- .../pools/{index.tsx => Pools.page.tsx} | 32 +- .../[serviceId]/pools/Pools.spec.tsx} | 26 +- ...sx => AddEditconnectionPool.component.tsx} | 29 +- ...tsx => DeleteConnectionPool.component.tsx} | 7 +- ...l.tsx => InfoConnectionPool.component.tsx} | 4 +- ...ns.tsx => PoolsTableColumns.component.tsx} | 6 +- ...l.const.ts => connectionPool.constants.ts} | 0 ...ook.tsx => useConnectionPoolForm.hook.tsx} | 4 +- .../queries/{index.tsx => Queries.page.tsx} | 14 +- .../[serviceId]/queries/Queries.spec.tsx} | 20 +- ...eries.tsx => CurrentQueries.component.tsx} | 19 +- ... CurrentQueriesTableColumns.component.tsx} | 6 +- ...y.tsx => ExpandableSqlQuery.component.tsx} | 0 ...tics.tsx => QueryStatistics.component.tsx} | 15 +- ...QueryStatisticsTableColumns.component.tsx} | 4 +- .../settings/Settings.layout.spec.tsx} | 6 +- .../{layout.tsx => Settings.layout.tsx} | 4 +- .../settings/{index.tsx => Settings.page.tsx} | 16 +- .../[serviceId]/settings/Settings.spec.tsx} | 23 +- ...AdvancedConfigurationUpdate.component.tsx} | 10 +- .../AdvancedConfigurationUpdate.spec.tsx} | 28 +- ...tsx => IpRestrictionsUpdate.component.tsx} | 15 +- .../IpsRestrictionsUpdate.spec.tsx} | 27 +- ...enances.tsx => Maintenances.component.tsx} | 15 +- .../_components/Maintenances.spec.tsx} | 21 +- ...tsx => ServiceConfiguration.component.tsx} | 25 +- .../ServiceConfiguration.spec.tsx} | 33 +- ...ateTable.tsx => UpdateTable.component.tsx} | 28 +- .../_components/UpdateTable.spec.tsx} | 39 +- ...> AdvancedConfigurationForm.component.tsx} | 13 +- ... => useAdvancedConfigurationForm.hook.tsx} | 2 +- ...imeUpdate.tsx => TimeUpdate.component.tsx} | 2 +- .../serviceConfiguration/TimeUpdate.spec.tsx} | 2 +- ...tails.tsx => PricingDetails.component.tsx} | 4 +- .../{addNode.tsx => AddNode.component.tsx} | 15 +- ...emoveNode.tsx => RemoveNode.component.tsx} | 13 +- ...eFlavor.tsx => UpdateFlavor.component.tsx} | 31 +- ...pdatePlan.tsx => UpdatePlan.component.tsx} | 29 +- ...ersion.tsx => UpdateVersion.component.tsx} | 23 +- .../users/{index.tsx => Users.page.tsx} | 23 +- .../[serviceId]/users/Users.spec.tsx} | 28 +- ...EditUser.tsx => AddEditUser.component.tsx} | 27 +- .../users/_components/AddUser.spec.tsx} | 10 +- ...eleteUser.tsx => DeleteUser.component.tsx} | 9 +- .../users/_components/DeleteUser.spec.tsx} | 10 +- .../users/_components/ResetPassword.spec.tsx} | 10 +- ...rd.tsx => ResetUserPassword.component.tsx} | 9 +- .../users/_components/UpdateUser.spec.tsx} | 10 +- ...adge.tsx => UserStatusBadge.component.tsx} | 2 +- ...ns.tsx => UsersTableActions.component.tsx} | 6 +- ...ns.tsx => UsersTableColumns.component.tsx} | 8 +- ...esSelect.tsx => RolesSelect.component.tsx} | 10 +- ...t.hook.tsx => useRolesSelectForm.hook.tsx} | 2 +- ...formUser.hook.tsx => useUserForm.hook.tsx} | 6 +- .../{user.const.ts => user.constants.ts} | 0 ...nboarding.tsx => Onboarding.component.tsx} | 12 +- .../services/_components/Onboarding.spec.tsx} | 4 +- ...gTile.tsx => OnboardingTile.component.tsx} | 2 +- ...s.tsx => ServiceListColumns.component.tsx} | 10 +- ...ble.tsx => ServiceListTable.component.tsx} | 10 +- ...e.tsx => ServiceStatusBadge.component.tsx} | 2 +- .../create/{index.tsx => Create.page.tsx} | 26 +- .../services/create/Create.spec.tsx} | 29 +- ...r-funnel.tsx => OrderFunnel.component.tsx} | 47 +- ...summary.tsx => OrderSummary.component.tsx} | 6 +- ...rderFunnel.tsx => useOrderFunnel.hook.tsx} | 12 +- .../src/{ => routes}/Router.tsx | 2 +- .../src/{ => routes}/routes.tsx | 45 +- .../pci-databases-analytics/src/types/Ip.ts | 2 + .../src/types/IpBlock.ts | 2 + .../pci-databases-analytics/src/types/Time.ts | 2 + .../src/{api/api.type.ts => types/api.ts} | 0 .../src/{models => types}/catalog.ts | 0 .../src/types/cloud/AccessTypeEnum.ts | 5 + .../src/types/cloud/Project.ts | 33 + .../src/types/cloud/Vrack.ts | 9 + .../src/types/cloud/network/IPPool.ts | 16 + .../src/types/cloud/network/Network.ts | 19 + .../src/types/cloud/network/NetworkRegion.ts | 11 + .../cloud/network/NetworkRegionStatusEnum.ts | 5 + .../types/cloud/network/NetworkStatusEnum.ts | 6 + .../types/cloud/network/NetworkTypeEnum.ts | 5 + .../cloud/network/NetworkVisibilityEnum.ts | 5 + .../src/types/cloud/network/Subnet.ts | 17 + .../src/types/cloud/network/index.ts | 8 + .../types/cloud/project/ProjectStatusEnum.ts | 8 + .../cloud/project/database/Availability.ts | 55 + .../types/cloud/project/database/Backup.ts | 24 + .../cloud/project/database/BackupTypeEnum.ts | 8 + .../cloud/project/database/Capabilities.ts | 20 + .../cloud/project/database/EngineEnum.ts | 15 + .../cloud/project/database/IpRestriction.ts | 12 + .../project/database/IpRestrictionCreation.ts | 9 + .../database/LogSubscriptionCreation.ts | 5 + .../cloud/project/database/NetworkTypeEnum.ts | 5 + .../types/cloud/project/database/Service.ts | 62 + .../cloud/project/database/ServiceCreation.ts | 40 + .../cloud/project/database/StatusEnum.ts | 14 + .../database/TemporaryWriteDeadline.ts | 5 + .../types/cloud/project/database/TypeEnum.ts | 8 + .../database/availability/ActionEnum.ts | 6 + .../project/database/availability/Backups.ts | 7 + .../database/availability/Lifecycle.ts | 13 + .../database/availability/Specifications.ts | 15 + .../database/availability/StatusEnum.ts | 9 + .../database/availability/Suggestion.ts | 8 + .../database/availability/TargetEnum.ts | 7 + .../project/database/availability/index.ts | 10 + .../availability/specifications/Nodes.ts | 7 + .../availability/specifications/Storage.ts | 11 + .../availability/specifications/index.ts | 2 + .../cloud/project/database/backup/Region.ts | 5 + .../cloud/project/database/backup/index.ts | 1 + .../project/database/capabilities/Engine.ts | 20 + .../capabilities/EngineCapabilities.ts | 22 + .../project/database/capabilities/Flavor.ts | 22 + .../database/capabilities/Integration.ts | 15 + .../project/database/capabilities/Option.ts | 9 + .../project/database/capabilities/Plan.ts | 17 + .../capabilities/RegionCapabilities.ts | 10 + .../project/database/capabilities/TagEnum.ts | 5 + .../advancedConfiguration/Property.ts | 17 + .../advancedConfiguration/index.ts | 4 + .../property/TypeEnum.ts | 7 + .../advancedConfiguration/property/index.ts | 1 + .../database/capabilities/engine/index.ts | 3 + .../engine/storage/StrategyEnum.ts | 6 + .../capabilities/engine/storage/index.ts | 1 + .../capabilities/flavor/Specifications.ts | 11 + .../database/capabilities/flavor/index.ts | 1 + .../project/database/capabilities/index.ts | 18 + .../capabilities/integration/Parameter.ts | 9 + .../capabilities/integration/index.ts | 4 + .../integration/parameter/TypeEnum.ts | 5 + .../integration/parameter/index.ts | 1 + .../project/database/engine/CategoryEnum.ts | 7 + .../cloud/project/database/engine/index.ts | 1 + .../src/types/cloud/project/database/index.ts | 39 + .../project/database/kafka/Permissions.ts | 9 + .../database/kafka/SchemaRegistryAcl.ts | 11 + .../cloud/project/database/kafka/Service.ts | 61 + .../cloud/project/database/kafka/Topic.ts | 17 + .../cloud/project/database/kafka/TopicAcl.ts | 11 + .../project/database/kafka/TopicCreation.ts | 17 + .../cloud/project/database/kafka/index.ts | 9 + .../project/database/kafka/user/Access.ts | 7 + .../project/database/kafka/user/index.ts | 1 + .../database/kafkaConnect/Connector.ts | 15 + .../kafkaConnect/ConnectorCreation.ts | 9 + .../kafkaConnect/capabilities/Connector.ts | 21 + .../capabilities/connector/Transform.ts | 19 + .../capabilities/connector/TypeEnum.ts | 5 + .../connector/configuration/Property.ts | 24 + .../connector/configuration/index.ts | 1 + .../capabilities/connector/index.ts | 7 + .../connector/property/ImportanceEnum.ts | 6 + .../capabilities/connector/property/index.ts | 1 + .../kafkaConnect/capabilities/index.ts | 4 + .../kafkaConnect/connector/StatusEnum.ts | 8 + .../database/kafkaConnect/connector/Task.ts | 11 + .../database/kafkaConnect/connector/index.ts | 7 + .../connector/property/TypeEnum.ts | 13 + .../kafkaConnect/connector/property/index.ts | 1 + .../kafkaConnect/connector/task/StatusEnum.ts | 6 + .../kafkaConnect/connector/task/index.ts | 1 + .../project/database/kafkaConnect/index.ts | 7 + .../cloud/project/database/m3db/Namespace.ts | 20 + .../database/m3db/NamespaceCreation.ts | 20 + .../types/cloud/project/database/m3db/User.ts | 15 + .../project/database/m3db/UserCreation.ts | 7 + .../project/database/m3db/UserWithPassword.ts | 17 + .../cloud/project/database/m3db/index.ts | 8 + .../database/m3db/namespace/Retention.ts | 13 + .../database/m3db/namespace/TypeEnum.ts | 5 + .../project/database/m3db/namespace/index.ts | 2 + .../project/database/mysql/QueryStatistics.ts | 7 + .../cloud/project/database/mysql/index.ts | 4 + .../database/mysql/querystatistics/Query.ts | 73 + .../database/mysql/querystatistics/index.ts | 1 + .../project/database/opensearch/Pattern.ts | 9 + .../database/opensearch/Permissions.ts | 5 + .../project/database/opensearch/Service.ts | 62 + .../cloud/project/database/opensearch/User.ts | 16 + .../project/database/opensearch/UserAcl.ts | 7 + .../database/opensearch/UserCreation.ts | 9 + .../database/opensearch/UserWithPassword.ts | 18 + .../project/database/opensearch/index.ts | 24 + .../database/postgresql/ConnectionPool.ts | 24 + .../postgresql/ConnectionPoolCreation.ts | 15 + .../database/postgresql/QueryStatistics.ts | 7 + .../postgresql/connectionpool/ModeEnum.ts | 6 + .../postgresql/connectionpool/SslModeEnum.ts | 4 + .../postgresql/connectionpool/index.ts | 2 + .../project/database/postgresql/index.ts | 8 + .../postgresql/querystatistics/Query.ts | 65 + .../postgresql/querystatistics/index.ts | 1 + .../cloud/project/database/redis/User.ts | 21 + .../project/database/redis/UserCreation.ts | 13 + .../database/redis/UserWithPassword.ts | 23 + .../cloud/project/database/redis/index.ts | 3 + .../cloud/project/database/service/Backup.ts | 13 + .../database/service/CapabilityActions.ts | 13 + .../database/service/CapabilityEnum.ts | 26 + .../project/database/service/Certificates.ts | 5 + .../database/service/CurrentQueries.ts | 7 + .../project/database/service/DataPoint.ts | 7 + .../project/database/service/Database.ts | 9 + .../cloud/project/database/service/Disk.ts | 7 + .../project/database/service/Endpoint.ts | 21 + .../project/database/service/HostMetric.ts | 9 + .../project/database/service/Integration.ts | 18 + .../project/database/service/IpRestriction.ts | 12 + .../project/database/service/LogEntry.ts | 9 + .../project/database/service/Maintenance.ts | 15 + .../cloud/project/database/service/Metric.ts | 12 + .../database/service/MetricPeriodEnum.ts | 8 + .../database/service/MetricUnitEnum.ts | 15 + .../cloud/project/database/service/Node.ts | 22 + .../project/database/service/NodeCreation.ts | 22 + .../project/database/service/NodePattern.ts | 9 + .../project/database/service/Replication.ts | 25 + .../database/service/ReplicationCreation.ts | 23 + .../cloud/project/database/service/Restore.ts | 5 + .../cloud/project/database/service/Storage.ts | 9 + .../cloud/project/database/service/User.ts | 13 + .../project/database/service/UserCreation.ts | 5 + .../database/service/UserWithPassword.ts | 15 + .../service/UserWithPasswordAndRoles.ts | 17 + .../project/database/service/UserWithRoles.ts | 15 + .../database/service/UserWithRolesCreation.ts | 7 + .../database/service/capability/StateEnum.ts | 5 + .../database/service/capability/index.ts | 1 + .../database/service/creation/BackupFork.ts | 9 + .../database/service/creation/ForkFrom.ts | 9 + .../database/service/creation/index.ts | 2 + .../database/service/currentqueries/Query.ts | 51 + .../service/currentqueries/StateEnum.ts | 9 + .../currentqueries/WaitEventTypeEnum.ts | 12 + .../database/service/currentqueries/index.ts | 6 + .../currentqueries/query/CancelRequest.ts | 7 + .../currentqueries/query/CancelResponse.ts | 5 + .../service/currentqueries/query/index.ts | 2 + .../service/endpoint/ComponentEnum.ts | 28 + .../database/service/endpoint/index.ts | 1 + .../cloud/project/database/service/index.ts | 47 + .../service/integration/StatusEnum.ts | 4 + .../database/service/integration/TypeEnum.ts | 12 + .../database/service/integration/index.ts | 2 + .../service/maintenance/StatusEnum.ts | 8 + .../database/service/maintenance/index.ts | 1 + .../project/database/service/node/RoleEnum.ts | 5 + .../project/database/service/node/index.ts | 1 + .../service/replication/PolicyClassEnum.ts | 5 + .../database/service/replication/index.ts | 1 + .../types/complexType/SafeKeyValueString.ts | 7 + .../types/complexType/UnitAndValueDouble.ts | 7 + .../src/types/complexType/UnitAndValueLong.ts | 7 + .../src/{models => types}/guide.ts | 0 .../orderFunnel/index.ts} | 20 +- .../pci-databases-analytics/vite.config.mjs | 1 + .../pci-databases-analytics/vitest.config.js | 1 + 860 files changed, 7154 insertions(+), 5956 deletions(-) rename packages/manager/apps/pci-databases-analytics/{src => }/index.html (92%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/cassandra.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/grafana.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/kafka.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/kafkaConnect.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/kafkaMirrorMaker.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/m3aggregator.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/m3db.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/mongodb.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/mysql.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/opensearch.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/postgresql.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/engines/redis.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/onboarding-image.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/assets/oops.png (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/bytes/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/bytes/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/bytes/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/bytes/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/bytes/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/bytes/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/bytes/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/bytes/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/error/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/error/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/error/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/error/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/error/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/error/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/error/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/error/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/guides/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/guides/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/guides/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/guides/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/guides/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/guides/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/guides/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/guides/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/cluster/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/cluster/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/cluster/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/cluster/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/cluster/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/cluster/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/cluster/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/cluster/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/engine/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/engine/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/engine/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/engine/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/engine/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/engine/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/engine/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/engine/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/flavor/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/flavor/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/flavor/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/flavor/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/flavor/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/flavor/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/flavor/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/flavor/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/order-options/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/order-options/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/order-options/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/order-options/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/order-options/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/order-options/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/order-options/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/order-options/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/plan/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/plan/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/plan/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/plan/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/plan/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/plan/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/plan/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/components/plan/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/new/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/new/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/new/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/new/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/new/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/new/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/new/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/new/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/onboarding/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/onboarding/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/onboarding/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/onboarding/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/onboarding/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/onboarding/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/dashboard/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/dashboard/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/dashboard/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/dashboard/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/databases/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/databases/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/databases/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/databases/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/databases/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/databases/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/integrations/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/integrations/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/integrations/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/integrations/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/integrations/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/integrations/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/logs/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/logs/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/logs/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/logs/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/logs/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/logs/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/metrics/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/metrics/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/metrics/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/metrics/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/metrics/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/metrics/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/namespaces/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/namespaces/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/namespaces/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/namespaces/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/pools/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/pools/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/pools/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/pools/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/pools/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/pools/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/queries/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/queries/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/queries/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/queries/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/queries/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/queries/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/update/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/update/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/update/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/update/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/users/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/users/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/users/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/users/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/users/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/users/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/users/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/service/users/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/status/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/status/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/status/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/status/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/status/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/status/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/status/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pci-databases-analytics/services/status/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pricing/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pricing/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pricing/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pricing/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pricing/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pricing/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pricing/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/pricing/Messages_pt_PT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/regions/Messages_de_DE.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/regions/Messages_en_GB.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/regions/Messages_es_ES.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/regions/Messages_fr_CA.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/regions/Messages_fr_FR.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/regions/Messages_it_IT.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/regions/Messages_pl_PL.json (100%) rename packages/manager/apps/pci-databases-analytics/{src => }/public/translations/regions/Messages_pt_PT.json (100%) delete mode 100644 packages/manager/apps/pci-databases-analytics/src/__tests__/components/links.test.tsx rename packages/manager/apps/pci-databases-analytics/src/__tests__/{lib => helpers/mocks}/availabilitiesMock/availabilities.ts (89%) rename packages/manager/apps/pci-databases-analytics/src/__tests__/{lib => helpers/mocks}/availabilitiesMock/capabilities.ts (87%) rename packages/manager/apps/pci-databases-analytics/src/__tests__/{lib => helpers/mocks}/availabilitiesMock/catalog.ts (97%) delete mode 100644 packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/advancedConfiguration.hook.test.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/availabilities.hook.test.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/connectionPool.hook.test.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/databases.hook.test.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/integrations.hook.test.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/namespaces.hook.test.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/network.hook.test.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/api/projects.ts rename packages/manager/apps/pci-databases-analytics/src/components/{Breadcrumb/Breadcrumb.tsx => breadcrumb/Breadcrumb.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/breadcrumb.test.tsx => components/breadcrumb/Breadcrumb.spec.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/components/{Breadcrumb/BreadcrumbItem.tsx => breadcrumb/BreadcrumbItem.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/breadcrumbItem.test.tsx => components/breadcrumb/BreadcrumbItem.spec.tsx} (88%) rename packages/manager/apps/pci-databases-analytics/src/components/{errorBoundary.tsx => error-boundary/ErrorBoundary.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/errorBoundary.test.tsx => components/error-boundary/ErrorBoundary.spec.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/components/{table-date.tsx => formatted-date/FormattedDate.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/table-date.test.tsx => components/formatted-date/FormattedDate.spec.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/components/{guides.tsx => guides/Guides.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/guides.test.tsx => components/guides/Guides.spec.tsx} (91%) delete mode 100644 packages/manager/apps/pci-databases-analytics/src/components/links.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/components/links/A.component.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/components/links/A.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/components/links/Link.component.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/components/links/Link.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/components/links/NavLink.component.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/components/links/NavLink.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/components/links/OvhLink.component.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/components/links/OvhLink.spec.tsx rename packages/manager/apps/pci-databases-analytics/src/components/{Loading/Loading.tsx => loading/Loading.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/loading.test.tsx => components/loading/Loading.spec.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/components/{Loading/ProgressLoader.tsx => loading/ProgressLoader.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/progressLoader.test.tsx => components/loading/ProgressLoader.spec.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/cluster-config/nodes-config.tsx => order/cluster-configuration/NodesConfig.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/nodes-config.test.tsx => components/order/cluster-configuration/NodesConfig.spec.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/cluster-config/storage-config.tsx => order/cluster-configuration/StorageConfig.component.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/storage-config.test.tsx => components/order/cluster-configuration/StorageConfig.spec.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/ips-restricitons-form.test.tsx => components/order/cluster-options/IpsRestricitonsForm.spec.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/cluster-options/ips-restrictions-form.tsx => order/cluster-options/IpsRestrictionsForm.component.tsx} (98%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/cluster-options/network-options.tsx => order/cluster-options/NetworkOptions.components.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/network-options.test.tsx => components/order/cluster-options/NetworkOptions.spec.tsx} (83%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/engine/engine-select.tsx => order/engine/EngineSelect.component.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/engine-select.test.tsx => components/order/engine/EngineSelect.spec.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/engine/engine-tile.tsx => order/engine/EngineTile.component.tsx} (90%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/engine-tile.test.tsx => components/order/engine/EngineTile.spec.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/engine/engine-tile-version.tsx => order/engine/EngineTileVersion.component.tsx} (98%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/engine-tile-version.test.tsx => components/order/engine/EngineTileVersion.spec.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/error-list.tsx => order/error-list/ErrorList.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/error-list.test.tsx => components/order/error-list/ErrorList.spec.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/flavor/flavor-select.tsx => order/flavor/FlavorSelect.component.tsx} (98%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/flavor-select.test.tsx => components/order/flavor/FlavorSelect.spec.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/plan/plan-select.tsx => order/plan/PlanSelect.component.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/plan-select.test.tsx => components/order/plan/PlanSelect.spec.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/plan/plan-tile.tsx => order/plan/PlanTile.component.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/plan-tile.test.tsx => components/order/plan/PlanTile.spec.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/order-price.tsx => order/price/OrderPrice.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/order-price.test.tsx => components/order/price/OrderPrice.spec.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/components/{Order/region/region-select.tsx => order/region/RegionSelect.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/Order/region-select.test.tsx => components/order/region/RegionSelect.spec.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/components/{PageLayout/PageLayout.tsx => page-layout/PageLayout.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/pageLayout.test.tsx => components/page-layout/PageLayout.spec.tsx} (82%) rename packages/manager/apps/pci-databases-analytics/src/components/{price-unit-switch.tsx => price-unit-switch/PriceUnitSwitch.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/price-unit-switch.test.tsx => components/price-unit-switch/PriceUnitSwitch.spec.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/components/{price.tsx => price/Price.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/price.test.tsx => components/price/Price.spec.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/components/{radio-tile.tsx => radio-tile/RadioTile.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/radio-tile.test.tsx => components/radio-tile/RadioTile.spec.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/components/{tabs-menu.tsx => tabs-menu/TabsMenu.component.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/tabs-menu.test.tsx => components/tabs-menu/TabsMenu.spec.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/components/{tags-input.tsx => tags-input/TagsInput.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/components/tags-input.test.tsx => components/tags-input/TagsInput.spec.tsx} (99%) rename packages/manager/apps/pci-databases-analytics/src/configuration/{polling.ts => polling.constants.ts} (100%) rename packages/manager/apps/pci-databases-analytics/src/configuration/{toast.ts => toast.constants.ts} (100%) rename packages/manager/apps/pci-databases-analytics/src/configuration/{tracking.ts => tracking.constants.ts} (97%) rename packages/manager/apps/pci-databases-analytics/src/contexts/{loadingIndicatorContext.tsx => LoadingIndicator.context.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/contexts/{userActivityContext.tsx => UserActivityContext.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{api/catalog.ts => data/api/catalog/catalog.api.ts} (89%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/catalog.test.tsx => data/api/catalog/catalog.spec.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/advancedConfiguration.ts => data/api/database/advancedConfiguration.api.ts} (84%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/advancedConfiguration.test.tsx => data/api/database/advancedConfiguration.spec.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/availabilities.ts => data/api/database/availability.api.ts} (64%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/availabilities.test.tsx => data/api/database/availability.spec.tsx} (75%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/backups.ts => data/api/database/backup.api.ts} (88%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/backups.test.tsx => data/api/database/backup.spec.tsx} (92%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/data/api/database/capabilities.api.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/data/api/database/capabilities.spec.tsx rename packages/manager/apps/pci-databases-analytics/src/{api/databases/certificates.ts => data/api/database/certificate.api.ts} (85%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/certificates.test.tsx => data/api/database/certificate.spec.tsx} (85%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/connectionPool.ts => data/api/database/connectionPool.api.ts} (80%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/connectionPool.test.tsx => data/api/database/connectionPool.spec.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/databases.ts => data/api/database/database.api.ts} (83%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/databases.test.tsx => data/api/database/database.spec.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases => data/api/database}/index.tsx (92%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/integrations.ts => data/api/database/integration.api.ts} (87%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/integrations.test.tsx => data/api/database/integration.spec.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/logs.ts => data/api/database/logs.api.ts} (84%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/logs.test.tsx => data/api/database/logs.spec.tsx} (86%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/maintenances.ts => data/api/database/maintenance.api.ts} (85%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/maintenances.test.tsx => data/api/database/maintenance.spec.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/metrics.ts => data/api/database/metric.api.ts} (85%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/metrics.test.tsx => data/api/database/metric.spec.tsx} (90%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/namespaces.ts => data/api/database/namespace.api.ts} (83%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/namespaces.test.tsx => data/api/database/namespace.spec.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/nodes.ts => data/api/database/node.api.ts} (69%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/nodes.test.tsx => data/api/database/node.spec.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/queries.ts => data/api/database/queries.api.ts} (91%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/queries.test.tsx => data/api/database/queries.spec.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/service.ts => data/api/database/service.api.ts} (84%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/services.test.tsx => data/api/database/service.spec.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/users.ts => data/api/database/user.api.ts} (90%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/databases/users.test.tsx => data/api/database/user.spec.tsx} (98%) rename packages/manager/apps/pci-databases-analytics/src/{api/databases/guides.ts => data/api/guides/guides.api.ts} (95%) rename packages/manager/apps/pci-databases-analytics/src/{api/network.ts => data/api/network/network.api.ts} (85%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/network.test.tsx => data/api/network/network.spec.tsx} (95%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/data/api/project/project.api.ts rename packages/manager/apps/pci-databases-analytics/src/{__tests__/api/projects.test.tsx => data/api/project/project.spec.tsx} (90%) delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/advancedConfiguration.api.hook.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/availabilities.api.hooks.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/backups.api.hooks.tsx rename packages/manager/apps/pci-databases-analytics/src/hooks/api/{catalog.api.hooks.tsx => catalog/useGetCatalog.hook.tsx} (70%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/catalog.hook.test.tsx => hooks/api/catalog/useGetCatalog.spec.tsx} (85%) delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/connectionPool.api.hooks.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useEditAdvancedConfiguration.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useEditAdvancedConfiguration.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfiguration.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfiguration.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfigurationCapabilities.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfigurationCapabilities.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetAvailabilities.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetAvailabilities.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetSuggestions.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetSuggestions.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useGetBackups.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useGetBackups.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useRestoreBackup.hook.tsx rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/backups.hook.test.tsx => hooks/api/database/backup/useRestoreBackup.spec.tsx} (69%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetCapabilities.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetCapabilities.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetEnginesCapabilities.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetEnginesCapabilities.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetFullCapabilities.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetFullCapabilities.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetRegionsCapabilities.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetRegionsCapabilities.spec.tsx rename packages/manager/apps/pci-databases-analytics/src/hooks/api/{certificates.api.hooks.tsx => database/certificate/useGetCertificate.hook.tsx} (71%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/certificates.hook.test.tsx => hooks/api/database/certificate/useGetCertificate.spec.tsx} (79%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useAddConnectionPool.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useAddConnectionPool.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useDeleteConnectionPool.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useDeleteConnectionPool.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useEditConnectionPool.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useEditConnectionPool.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useGetConnectionPools.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useGetConnectionPools.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useAddDatabase.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useAddDatabase.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useDeleteDatabase.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useDeleteDatabase.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useGetDatabases.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useGetDatabases.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useAddIntegration.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useAddIntegration.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useDeleteIntegration.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useDeleteIntegration.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetCapabilitiesIntegrations.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetCapabilitiesIntegrations.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetIntegrations.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetIntegrations.spec.tsx rename packages/manager/apps/pci-databases-analytics/src/hooks/api/{logs.api.hooks.tsx => database/logs/useGetServiceLogs.hook.tsx} (72%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/logs.hook.test.tsx => hooks/api/database/logs/useGetServiceLogs.spec.tsx} (79%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useApplyMaintenance.hook.tsx rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/maintenances.hook.test.tsx => hooks/api/database/maintenance/useApplyMaintenance.spec.tsx} (56%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useGetMaintenances.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useGetMaintenances.spec.tsx rename packages/manager/apps/pci-databases-analytics/src/hooks/api/{metrics.api.hooks.tsx => database/metric/useGetMetric.hook.tsx} (51%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/metrics.hook.test.tsx => hooks/api/database/metric/useGetMetric.spec.tsx} (54%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetrics.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetrics.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useAddNamespace.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useAddNamespace.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useDeleteNamespace.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useDeleteNamespace.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useEditNamepsace.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useEditNamespace.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useGetNamespaces.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useGetNamespaces.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useAddNode.hook.tsx rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/nodes.hook.test.tsx => hooks/api/database/node/useAddNode.spec.tsx} (51%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useDeleteNode.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useDeleteNode.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useCancelCurrentQuery.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useCancelCurrentQuery.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetCurrentQueries.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetCurrentQueries.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetQueryStatistics.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetQueryStatistics.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useResetQueryStatistics.hook.tsx rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/queries.hook.test.tsx => hooks/api/database/query/useResetQueryStatistics.spec.tsx} (55%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useAddService.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useAddService.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useDeleteService.hook.tsx rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/services.hook.test.tsx => hooks/api/database/service/useDeleteService.spec.tsx} (56%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useEditService.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useEditService.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetService.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetService.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetServices.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetServices.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useAddUser.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useAddUser.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useDeleteUser.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useDeleteUser.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useEditUser.hook.tsx rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/users.hook.test.tsx => hooks/api/database/user/useEditUser.spec.tsx} (55%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetRoles.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetRoles.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetUsers.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetUsers.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useResetUserPassword.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useResetUserPassword.spec.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/databases.api.hook.tsx rename packages/manager/apps/pci-databases-analytics/src/hooks/api/{guides.api.hooks.tsx => guides/useGetGuides.hook.tsx} (74%) delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/integrations.api.hook.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/maintenances.api.hooks.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/namespaces.api.hooks.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/network.api.hooks.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetNetwork.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetNetwork.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetSubnet.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetSubnet.spec.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetVrack.hook.tsx create mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetVrack.spec.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/nodes.api.hooks.tsx rename packages/manager/apps/pci-databases-analytics/src/hooks/api/{pciProjects.api.hooks.tsx => project/usePciProject.hook.tsx} (66%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/api/pciProjects.hook.test.tsx => hooks/api/project/usePciProject.spec.tsx} (79%) delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/queries.api.hooks.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/services.api.hooks.tsx delete mode 100644 packages/manager/apps/pci-databases-analytics/src/hooks/api/users.api.hooks.tsx rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/useDateFnsLocale.hook.test.tsx => hooks/useDateFnsLocale.hook.spec.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/useDownload.test.tsx => hooks/useDownload.spec.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/useMeanMetric.test.tsx => hooks/useMeanMetric.spec.tsx} (81%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/useModale.test.tsx => hooks/useModale.spec.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/useQueryState.test.tsx => hooks/useQueryState.spec.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/useUser.test.tsx => hooks/useUser.spec.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/useUserActivity.test.tsx => hooks/useUserActivity.spec.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/hooks/useVrack.test.tsx => hooks/useVrack.spec.tsx} (85%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/lib/apiHelper.ts rename packages/manager/apps/pci-databases-analytics/src/{__tests__/lib/availabilitiesHelper.test.tsx => lib/availabilitiesHelper.spec.tsx} (88%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/lib/bytesHelper.test.tsx => lib/bytesHelper.spec.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/lib/durationHelper.test.tsx => lib/durationHelper.spec.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/lib/engineNameHelper.test.tsx => lib/engineNameHelper.spec.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/lib/nameGenerator.test.tsx => lib/nameGenerator.spec.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/lib/pricingHelper.test.tsx => lib/pricingHelper.spec.tsx} (89%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/lib/tagsHelper.test.tsx => lib/tagsHelper.spec.tsx} (75%) rename packages/manager/apps/pci-databases-analytics/src/{index.tsx => main.tsx} (93%) delete mode 100644 packages/manager/apps/pci-databases-analytics/src/models/database.ts delete mode 100644 packages/manager/apps/pci-databases-analytics/src/models/network.ts delete mode 100644 packages/manager/apps/pci-databases-analytics/src/models/project.ts rename packages/manager/apps/pci-databases-analytics/src/pages/{404.tsx => 404.page.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/404.test.tsx => pages/404.spec.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/layout.test.tsx => pages/Root.layout.spec.tsx} (85%) rename packages/manager/apps/pci-databases-analytics/src/pages/{layout.tsx => Root.layout.tsx} (76%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/pages/Root.page.tsx rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/home.test.tsx => pages/Root.spec.tsx} (88%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/app.test.tsx => pages/_app.spec.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/pages/_components/{legalMentions.tsx => LegalMentions.component.tsx} (100%) delete mode 100644 packages/manager/apps/pci-databases-analytics/src/pages/index.tsx rename packages/manager/apps/pci-databases-analytics/src/pages/services/{index.tsx => Services.page.tsx} (72%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/services.test.tsx => pages/services/Services.spec.tsx} (93%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.context.tsx rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/layout.test.tsx => pages/services/[serviceId]/Service.layout.spec.tsx} (88%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/{layout.tsx => Service.layout.tsx} (65%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/{deleteService.tsx => DeleteService.component.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/{renameService.tsx => RenameService.component.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/{serviceHeader.tsx => ServiceHeader.component.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/{serviceTabs.tsx => ServiceTabs.component.tsx} (80%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/backups/layout.test.tsx => pages/services/[serviceId]/backups/Backups.layout.spec.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/{layout.tsx => Backups.layout.tsx} (73%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/{index.tsx => Backups.page.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/backups/backups.test.tsx => pages/services/[serviceId]/backups/Backups.spec.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/{backupsTableColumns.tsx => BackupsTableColumns.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/{restore.tsx => Restore.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/{index.tsx => Fork.page.tsx} (83%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/backups/fork/fork.test.tsx => pages/services/[serviceId]/backups/fork/Fork.spec.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/{fork-form.tsx => ForkForm.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/{fork-summary.tsx => ForkSummary.component.tsx} (98%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/{useFork.tsx => useFork.hook.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/{index.tsx => Dashboard.page.tsx} (89%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/dashboard/dashboard.test.tsx => pages/services/[serviceId]/dashboard/Dashboard.spec.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/{connectionDetails.tsx => ConnectionDetails.component.tsx} (98%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/{maintenance.tsx => Maintenance.component.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/{meanMetric.tsx => MeanMetric.component.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/dashboard/meanMetric.test.tsx => pages/services/[serviceId]/dashboard/_components/meanMetric.spec.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/{index.tsx => Database.page.tsx} (81%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/databases/databases.test.tsx => pages/services/[serviceId]/databases/Databases.spec.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/{addDatabase.tsx => AddDatabase.component.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/{databasesTableColumns.tsx => DatabasesTableColumns.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/{deleteDatabase.tsx => DeleteDatabase.component.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/{index.tsx => Integrations.page.tsx} (81%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/integrations/integrations.test.tsx => pages/services/[serviceId]/integrations/Integrations.spec.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/{addIntegration.tsx => AddIntegration.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/integrations/addIntegrations.test.tsx => pages/services/[serviceId]/integrations/_components/AddIntegrations.spec.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/{deleteIntegration.tsx => DeleteIntegration.component.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/{integrationListColumns.tsx => IntegrationListColumns.component.tsx} (90%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/{integrationServiceLink.tsx => IntegrationServiceLink.component.tsx} (81%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/{addIntegration.hook.tsx => useAddIntegrationForm.hook.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/{index.tsx => Logs.page.tsx} (85%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/logs/logs.test.tsx => pages/services/[serviceId]/logs/Logs.spec.tsx} (86%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/{index.tsx => Metrics.page.tsx} (84%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/metrics/metrics.test.tsx => pages/services/[serviceId]/metrics/Metrics.spec.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/{metricChart.tsx => MetricChart.component.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/{colors.ts => colors.constants.ts} (100%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/{index.tsx => Namespace.page.tsx} (85%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/namespaces/namespaces.test.tsx => pages/services/[serviceId]/namespaces/Namespaces.spec.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/{addEditNamespace.tsx => AddEditNamespace.component.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/{deleteNamespace.tsx => DeleteNamespace.component.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/{namespacesTableColumns.tsx => NamespacesTableColumns.component.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/{namespace.const.ts => namespace.constants.ts} (100%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/{formNamespace.hook.tsx => useNamespaceForm.hook.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/{index.tsx => Pools.page.tsx} (85%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/pools/pools.test.tsx => pages/services/[serviceId]/pools/Pools.spec.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/{addEditconnectionPool.tsx => AddEditconnectionPool.component.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/{deleteConnectionPool.tsx => DeleteConnectionPool.component.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/{infoConnectionPool.tsx => InfoConnectionPool.component.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/{poolsTableColumns.tsx => PoolsTableColumns.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/{connectionPool.const.ts => connectionPool.constants.ts} (100%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/{formConnectionPool.hook.tsx => useConnectionPoolForm.hook.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/{index.tsx => Queries.page.tsx} (66%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/queries/queries.test.tsx => pages/services/[serviceId]/queries/Queries.spec.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/{currentQueries.tsx => CurrentQueries.component.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/{currentQueriesTableColumns.tsx => CurrentQueriesTableColumns.component.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/{ExpandableSqlQuery.tsx => ExpandableSqlQuery.component.tsx} (100%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/{queryStatistics.tsx => QueryStatistics.component.tsx} (83%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/{queryStatisticsTableColumns.tsx => QueryStatisticsTableColumns.component.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/settings/layout.test.tsx => pages/services/[serviceId]/settings/Settings.layout.spec.tsx} (86%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/{layout.tsx => Settings.layout.tsx} (73%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/{index.tsx => Settings.page.tsx} (82%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/settings/settings.test.tsx => pages/services/[serviceId]/settings/Settings.spec.tsx} (89%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/{advancedConfiguration.tsx => AdvancedConfigurationUpdate.component.tsx} (77%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/settings/advancedConfiguration.test.tsx => pages/services/[serviceId]/settings/_components/AdvancedConfigurationUpdate.spec.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/{ipRestrictions.tsx => IpRestrictionsUpdate.component.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/settings/ipsRestrictionsUpdate.test.tsx => pages/services/[serviceId]/settings/_components/IpsRestrictionsUpdate.spec.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/{maintenances.tsx => Maintenances.component.tsx} (90%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/settings/maintenances.test.tsx => pages/services/[serviceId]/settings/_components/Maintenances.spec.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/{serviceConfiguration.tsx => ServiceConfiguration.component.tsx} (89%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/settings/serviceConfiguration.test.tsx => pages/services/[serviceId]/settings/_components/ServiceConfiguration.spec.tsx} (90%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/{updateTable.tsx => UpdateTable.component.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/settings/updateTable.test.tsx => pages/services/[serviceId]/settings/_components/UpdateTable.spec.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/{advancedConfigurationForm.tsx => AdvancedConfigurationForm.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/{advancedConfiguration.hook.tsx => useAdvancedConfigurationForm.hook.tsx} (99%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/{timeUpdate.tsx => TimeUpdate.component.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/settings/timeUpdate.test.tsx => pages/services/[serviceId]/settings/_components/serviceConfiguration/TimeUpdate.spec.tsx} (98%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/{pricingDetails.tsx => PricingDetails.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/{addNode.tsx => AddNode.component.tsx} (88%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/{removeNode.tsx => RemoveNode.component.tsx} (89%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/{updateFlavor.tsx => UpdateFlavor.component.tsx} (90%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/{updatePlan.tsx => UpdatePlan.component.tsx} (90%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/{updateVersion.tsx => UpdateVersion.component.tsx} (86%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/{index.tsx => Users.page.tsx} (83%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/users/users.test.tsx => pages/services/[serviceId]/users/Users.spec.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/{addEditUser.tsx => AddEditUser.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/users/addUser.test.tsx => pages/services/[serviceId]/users/_components/AddUser.spec.tsx} (98%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/{deleteUser.tsx => DeleteUser.component.tsx} (89%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/users/deleteUser.test.tsx => pages/services/[serviceId]/users/_components/DeleteUser.spec.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/users/resetPassword.test.tsx => pages/services/[serviceId]/users/_components/ResetPassword.spec.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/{resetUserPassword.tsx => ResetUserPassword.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/service/users/updateUser.test.tsx => pages/services/[serviceId]/users/_components/UpdateUser.spec.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/{userStatusBadge.tsx => UserStatusBadge.component.tsx} (92%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/{usersTableActions.tsx => UsersTableActions.component.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/{usersTableColumns.tsx => UsersTableColumns.component.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/{rolesSelect.tsx => RolesSelect.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/{rolesSelect.hook.tsx => useRolesSelectForm.hook.tsx} (97%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/{formUser.hook.tsx => useUserForm.hook.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/{user.const.ts => user.constants.ts} (100%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/_components/{onboarding.tsx => Onboarding.component.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/onboarding.test.tsx => pages/services/_components/Onboarding.spec.tsx} (93%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/_components/{onboardingTile.tsx => OnboardingTile.component.tsx} (95%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/_components/{serviceListColumns.tsx => ServiceListColumns.component.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/_components/{serviceListTable.tsx => ServiceListTable.component.tsx} (87%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/_components/{serviceStatusBadge.tsx => ServiceStatusBadge.component.tsx} (94%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/create/{index.tsx => Create.page.tsx} (79%) rename packages/manager/apps/pci-databases-analytics/src/{__tests__/pages/services/create/create.test.tsx => pages/services/create/Create.spec.tsx} (91%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/{order-funnel.tsx => OrderFunnel.component.tsx} (89%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/{order-summary.tsx => OrderSummary.component.tsx} (98%) rename packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/{useOrderFunnel.tsx => useOrderFunnel.hook.tsx} (96%) rename packages/manager/apps/pci-databases-analytics/src/{ => routes}/Router.tsx (82%) rename packages/manager/apps/pci-databases-analytics/src/{ => routes}/routes.tsx (67%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/Ip.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/IpBlock.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/Time.ts rename packages/manager/apps/pci-databases-analytics/src/{api/api.type.ts => types/api.ts} (100%) rename packages/manager/apps/pci-databases-analytics/src/{models => types}/catalog.ts (100%) create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/AccessTypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/Project.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/Vrack.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/network/IPPool.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/network/Network.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkRegion.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkRegionStatusEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkStatusEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkTypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkVisibilityEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/network/Subnet.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/network/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/ProjectStatusEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Availability.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Backup.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/BackupTypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Capabilities.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/EngineEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/IpRestriction.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/IpRestrictionCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/LogSubscriptionCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/NetworkTypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Service.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/ServiceCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/StatusEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/TemporaryWriteDeadline.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/TypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/ActionEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Backups.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Lifecycle.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Specifications.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/StatusEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Suggestion.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/TargetEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/Nodes.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/Storage.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/backup/Region.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/backup/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Engine.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/EngineCapabilities.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Flavor.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Integration.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Option.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Plan.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/RegionCapabilities.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/TagEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/Property.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/property/TypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/property/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/storage/StrategyEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/storage/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/flavor/Specifications.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/flavor/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/Parameter.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/parameter/TypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/parameter/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/engine/CategoryEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/engine/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Permissions.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/SchemaRegistryAcl.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Service.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Topic.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/TopicAcl.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/TopicCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/user/Access.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/user/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/Connector.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/ConnectorCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/Connector.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/Transform.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/TypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/configuration/Property.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/configuration/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/property/ImportanceEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/property/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/StatusEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/Task.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/property/TypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/property/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/task/StatusEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/task/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/Namespace.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/NamespaceCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/User.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/UserCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/UserWithPassword.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/Retention.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/TypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/QueryStatistics.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/querystatistics/Query.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/querystatistics/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Pattern.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Permissions.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Service.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/User.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserAcl.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserWithPassword.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/ConnectionPool.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/ConnectionPoolCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/QueryStatistics.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/ModeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/SslModeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/querystatistics/Query.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/querystatistics/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/User.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/UserCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/UserWithPassword.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Backup.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CapabilityActions.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CapabilityEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Certificates.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CurrentQueries.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/DataPoint.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Database.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Disk.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Endpoint.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/HostMetric.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Integration.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/IpRestriction.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/LogEntry.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Maintenance.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Metric.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/MetricPeriodEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/MetricUnitEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Node.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/NodeCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/NodePattern.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Replication.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/ReplicationCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Restore.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Storage.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/User.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithPassword.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithPasswordAndRoles.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithRoles.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithRolesCreation.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/capability/StateEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/capability/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/BackupFork.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/ForkFrom.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/Query.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/StateEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/WaitEventTypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/CancelRequest.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/CancelResponse.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/endpoint/ComponentEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/endpoint/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/StatusEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/TypeEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/maintenance/StatusEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/maintenance/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/node/RoleEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/node/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/replication/PolicyClassEnum.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/replication/index.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/complexType/SafeKeyValueString.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/complexType/UnitAndValueDouble.ts create mode 100644 packages/manager/apps/pci-databases-analytics/src/types/complexType/UnitAndValueLong.ts rename packages/manager/apps/pci-databases-analytics/src/{models => types}/guide.ts (100%) rename packages/manager/apps/pci-databases-analytics/src/{models/order-funnel.ts => types/orderFunnel/index.ts} (80%) diff --git a/packages/manager/apps/pci-databases-analytics/src/index.html b/packages/manager/apps/pci-databases-analytics/index.html similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/index.html rename to packages/manager/apps/pci-databases-analytics/index.html index 0b4eba6bb850..5a905c968d6e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/index.html +++ b/packages/manager/apps/pci-databases-analytics/index.html @@ -18,6 +18,6 @@
- + diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/cassandra.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/cassandra.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/cassandra.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/cassandra.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/grafana.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/grafana.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/grafana.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/grafana.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/kafka.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/kafka.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/kafka.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/kafka.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/kafkaConnect.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/kafkaConnect.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/kafkaConnect.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/kafkaConnect.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/kafkaMirrorMaker.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/kafkaMirrorMaker.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/kafkaMirrorMaker.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/kafkaMirrorMaker.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/m3aggregator.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/m3aggregator.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/m3aggregator.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/m3aggregator.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/m3db.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/m3db.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/m3db.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/m3db.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/mongodb.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/mongodb.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/mongodb.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/mongodb.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/mysql.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/mysql.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/mysql.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/mysql.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/opensearch.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/opensearch.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/opensearch.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/opensearch.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/postgresql.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/postgresql.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/postgresql.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/postgresql.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/engines/redis.png b/packages/manager/apps/pci-databases-analytics/public/assets/engines/redis.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/engines/redis.png rename to packages/manager/apps/pci-databases-analytics/public/assets/engines/redis.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/onboarding-image.png b/packages/manager/apps/pci-databases-analytics/public/assets/onboarding-image.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/onboarding-image.png rename to packages/manager/apps/pci-databases-analytics/public/assets/onboarding-image.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/assets/oops.png b/packages/manager/apps/pci-databases-analytics/public/assets/oops.png similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/assets/oops.png rename to packages/manager/apps/pci-databases-analytics/public/assets/oops.png diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/bytes/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/bytes/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/error/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/error/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/guides/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/guides/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/cluster/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/cluster/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/engine/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/engine/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/flavor/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/flavor/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/order-options/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/order-options/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/components/plan/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/components/plan/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/new/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/new/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/onboarding/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/onboarding/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/backups/fork/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/dashboard/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/databases/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/databases/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/integrations/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/integrations/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/logs/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/logs/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/metrics/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/metrics/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/namespaces/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/pools/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/pools/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/queries/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/queries/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/settings/update/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/service/users/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/service/users/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pci-databases-analytics/services/status/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pci-databases-analytics/services/status/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/pricing/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/pricing/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_de_DE.json b/packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_de_DE.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_de_DE.json rename to packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_de_DE.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_en_GB.json b/packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_en_GB.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_en_GB.json rename to packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_en_GB.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_es_ES.json b/packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_es_ES.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_es_ES.json rename to packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_es_ES.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_fr_CA.json b/packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_fr_CA.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_fr_CA.json rename to packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_fr_CA.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_fr_FR.json b/packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_fr_FR.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_fr_FR.json rename to packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_fr_FR.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_it_IT.json b/packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_it_IT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_it_IT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_it_IT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_pl_PL.json b/packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_pl_PL.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_pl_PL.json rename to packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_pl_PL.json diff --git a/packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_pt_PT.json b/packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_pt_PT.json similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/public/translations/regions/Messages_pt_PT.json rename to packages/manager/apps/pci-databases-analytics/public/translations/regions/Messages_pt_PT.json diff --git a/packages/manager/apps/pci-databases-analytics/src/App.tsx b/packages/manager/apps/pci-databases-analytics/src/App.tsx index 97e43af71df1..5f8fd6ad2f78 100644 --- a/packages/manager/apps/pci-databases-analytics/src/App.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/App.tsx @@ -7,10 +7,10 @@ import '@ovhcloud/ods-theme-blue-jeans'; import './global.css'; import queryClient from './query.client'; -import Router from './Router'; -import Loading from './components/Loading/Loading'; -import { useLoadingIndicatorContext } from './contexts/loadingIndicatorContext'; -import ProgressLoader from './components/Loading/ProgressLoader'; +import Router from './routes/Router'; +import Loading from './components/loading/Loading.component'; +import { useLoadingIndicatorContext } from './contexts/LoadingIndicator.context'; +import ProgressLoader from './components/loading/ProgressLoader.component'; odsSetup(); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/links.test.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/components/links.test.tsx deleted file mode 100644 index 2c7f225a516b..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/links.test.tsx +++ /dev/null @@ -1,203 +0,0 @@ -import { - act, - fireEvent, - render, - screen, - waitFor, -} from '@testing-library/react'; -import '@testing-library/jest-dom/vitest'; -import { vi } from 'vitest'; -import { BrowserRouter as Router } from 'react-router-dom'; -import { A, Link, OvhLink, NavLink } from '@/components/links'; -import * as useLoadingIndicator from '@/contexts/loadingIndicatorContext'; - -vi.mock('@ovh-ux/manager-react-shell-client', () => ({ - useNavigation: () => ({ - getURL: vi.fn((app: string, path: string) => `#mockedurl-${app}${path}`), - }), -})); - -describe('A', () => { - afterEach(() => { - vi.clearAllMocks(); - }); - it('renders anchor element correctly', () => { - const { container } = render(Link); - const anchor = container.querySelector('a'); - expect(anchor).toBeInTheDocument(); - expect(anchor).toHaveTextContent('Link'); - expect(anchor).toHaveAttribute('href', '#'); - }); - it('renders disabled anchor element correctly', () => { - const { container } = render( - - Link - , - ); - const anchor = container.querySelector('a'); - expect(anchor).toBeInTheDocument(); - expect(anchor).toHaveTextContent('Link'); - expect(anchor).not.toHaveAttribute('href'); - }); -}); - -describe('Link', () => { - const useLoadingIndicatorSpy = vi.spyOn( - useLoadingIndicator, - 'useLoadingIndicatorContext', - ); - afterEach(() => { - vi.clearAllMocks(); - }); - it('renders RouterLink element correctly', () => { - const { container } = render( - - - Link - - , - ); - const routerLink = container.querySelector('a'); - expect(routerLink).toBeInTheDocument(); - expect(routerLink).toHaveTextContent('Link'); - expect(routerLink).toHaveAttribute('href', '/route'); - }); - - it('should set loading indicator on click', async () => { - const mockLoading = vi.fn(); - useLoadingIndicatorSpy.mockImplementation(() => ({ - loading: false, - setLoading: mockLoading, - })); - const { container } = render( - - - Link - - , - ); - - const routerLink = container.querySelector('a'); - expect(mockLoading).not.toHaveBeenCalled(); - act(() => { - if (routerLink) { - fireEvent.click(routerLink); - } - }); - expect(mockLoading).toHaveBeenCalled(); - }); - - it('should not set loading indicator when clicked on disabled link', async () => { - const mockLoading = vi.fn(); - useLoadingIndicatorSpy.mockImplementation(() => ({ - loading: false, - setLoading: mockLoading, - })); - const { container } = render( - - - - Link - - - , - ); - - const routerLink = container.querySelector('a'); - expect(mockLoading).not.toHaveBeenCalled(); - act(() => { - if (routerLink) { - fireEvent.click(routerLink); - } - }); - expect(mockLoading).not.toHaveBeenCalled(); - }); -}); - -describe('NavLink', () => { - const useLoadingIndicatorSpy = vi.spyOn( - useLoadingIndicator, - 'useLoadingIndicatorContext', - ); - afterEach(() => { - vi.clearAllMocks(); - }); - it('renders NavLink element correctly', () => { - const { container } = render( - - - Link - - , - ); - const routerLink = container.querySelector('a'); - expect(routerLink).toBeInTheDocument(); - expect(routerLink).toHaveTextContent('Link'); - expect(routerLink).toHaveAttribute('href', '/route'); - }); - it('should set loading indicator on click', async () => { - const mockLoading = vi.fn(); - useLoadingIndicatorSpy.mockImplementation(() => ({ - loading: false, - setLoading: mockLoading, - })); - const { container } = render( - - - Link - - , - ); - - const routerLink = container.querySelector('a'); - expect(mockLoading).not.toHaveBeenCalled(); - act(() => { - if (routerLink) { - fireEvent.click(routerLink); - } - }); - expect(mockLoading).toHaveBeenCalled(); - }); - - it('should not set loading indicator when clicked on disabled link', async () => { - const mockLoading = vi.fn(); - useLoadingIndicatorSpy.mockImplementation(() => ({ - loading: false, - setLoading: mockLoading, - })); - const { container } = render( - - - - Link - - - , - ); - - const routerLink = container.querySelector('a'); - expect(mockLoading).not.toHaveBeenCalled(); - act(() => { - if (routerLink) { - fireEvent.click(routerLink); - } - }); - expect(mockLoading).not.toHaveBeenCalled(); - }); -}); -describe('OvhLink component', () => { - afterEach(() => { - vi.clearAllMocks(); - }); - it('should render anchor element with href fetched from navigation', async () => { - render( - - Link - , - ); - const anchorElement = screen.getByText('Link'); - await waitFor(() => { - expect(anchorElement).toHaveAttribute('href', '#mockedurl-app/some-path'); - }); - }); -}); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilities.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilities.ts index 9ce2ed275df7..132167d32436 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilities.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilities.ts @@ -1,5 +1,5 @@ -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; -import { database } from '@/models/database'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; +import * as database from '@/types/cloud/project/database'; export const mockedAvailabilities: database.Availability = { backup: database.BackupTypeEnum.automatic, @@ -8,7 +8,7 @@ export const mockedAvailabilities: database.Availability = { available: true, retentionDays: 2, }, - category: database.CategoryEnum.all, + category: database.engine.CategoryEnum.all, default: false, engine: database.EngineEnum.mongodb, flavor: 'flavor', @@ -51,7 +51,7 @@ export const mockedAvailabilities: database.Availability = { stepDiskSize: 10, }; -export const mockedSuggestions: database.Suggestion = { +export const mockedSuggestions: database.availability.Suggestion = { default: true, engine: database.EngineEnum.mongodb, flavor: 'flavor', @@ -61,7 +61,7 @@ export const mockedSuggestions: database.Suggestion = { }; export const mockedEngine: database.capabilities.Engine = { - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, defaultVersion: 'defaultVersion', description: 'description', name: database.EngineEnum.mongodb, @@ -91,7 +91,7 @@ export const mockedFlavor: database.capabilities.Flavor = { }, }, storage: 250, - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], }; export const mockedOption: database.capabilities.Option = { @@ -108,7 +108,7 @@ export const mockedPlan: database.capabilities.Plan = { }, name: 'plan', order: 3, - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], }; export const mockedCapabilities: database.Capabilities = { @@ -120,8 +120,8 @@ export const mockedCapabilities: database.Capabilities = { regions: ['Region1', 'Region2'], }; -export const mockedEngineCapabilities: database.EngineCapabilities = { - category: database.CategoryEnum.operational, +export const mockedEngineCapabilities: database.capabilities.EngineCapabilities = { + category: database.engine.CategoryEnum.operational, description: 'description', lifecycle: { startDate: 'startDate', @@ -131,7 +131,7 @@ export const mockedEngineCapabilities: database.EngineCapabilities = { order: 1, sslModes: ['sslModes'], storage: database.capabilities.engine.storage.StrategyEnum.distributed, - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], versions: [ { default: true, @@ -140,19 +140,19 @@ export const mockedEngineCapabilities: database.EngineCapabilities = { status: database.availability.StatusEnum.STABLE, }, name: 'version', - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], }, ], }; -export const mockedRegionCapabilities: database.RegionCapabilities = { +export const mockedRegionCapabilities: database.capabilities.RegionCapabilities = { lifecycle: { startDate: 'startDate', status: database.availability.StatusEnum.STABLE, }, name: 'region', order: 1, - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], }; export const mockedFullCapabilities: FullCapabilities = { @@ -171,7 +171,7 @@ export const mockedAvailabilitiesUpdate: database.Availability = { available: true, retentionDays: 2, }, - category: database.CategoryEnum.all, + category: database.engine.CategoryEnum.all, default: false, engine: database.EngineEnum.mongodb, flavor: 'flavor', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesMock/availabilities.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilitiesMock/availabilities.ts similarity index 89% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesMock/availabilities.ts rename to packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilitiesMock/availabilities.ts index 8909a4476b47..866c84b543c6 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesMock/availabilities.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilitiesMock/availabilities.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; const mockedLifecycle = { startDate: '', @@ -25,7 +25,7 @@ const mongo: database.Availability[] = [ backups: { available: false, }, - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, lifecycle: mockedLifecycle, region: 'GRA', default: false, @@ -51,7 +51,7 @@ const mongo: database.Availability[] = [ available: true, retentionDays: 3, }, - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, lifecycle: mockedLifecycle, region: 'GRA', default: false, @@ -77,7 +77,7 @@ const mongo: database.Availability[] = [ available: true, retentionDays: 3, }, - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, lifecycle: mockedLifecycle, region: 'GRA', default: false, @@ -103,7 +103,7 @@ const mongo: database.Availability[] = [ available: true, retentionDays: 3, }, - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, lifecycle: mockedLifecycle, region: 'GRA', default: false, @@ -132,7 +132,7 @@ const pg: database.Availability[] = [ available: true, retentionDays: 3, }, - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, lifecycle: mockedLifecycle, region: 'GRA', default: false, @@ -158,7 +158,7 @@ const pg: database.Availability[] = [ available: true, retentionDays: 3, }, - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, lifecycle: mockedLifecycle, region: 'GRA', default: false, @@ -182,7 +182,7 @@ const grafana = [ available: true, retentionDays: 3, }, - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, lifecycle: mockedLifecycle, region: 'GRA', default: false, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesMock/capabilities.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilitiesMock/capabilities.ts similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesMock/capabilities.ts rename to packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilitiesMock/capabilities.ts index 3c20c3eeb515..ad672cdfd52d 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesMock/capabilities.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilitiesMock/capabilities.ts @@ -1,5 +1,5 @@ -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; -import { database } from '@/models/database'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; +import * as database from '@/types/cloud/project/database'; const mockedLifecycle = { startDate: '', @@ -9,7 +9,7 @@ export const mockedCapabilities: FullCapabilities = { engines: [ { name: 'mongodb', - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, description: 'mongodb description', order: 0, storage: database.capabilities.engine.storage.StrategyEnum.distributed, @@ -22,7 +22,7 @@ export const mockedCapabilities: FullCapabilities = { }, { name: 'postgresql', - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, description: 'postgresql description', order: 1, storage: database.capabilities.engine.storage.StrategyEnum.distributed, @@ -35,7 +35,7 @@ export const mockedCapabilities: FullCapabilities = { }, { name: 'grafana', - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, description: 'grafana description', order: 2, storage: database.capabilities.engine.storage.StrategyEnum.distributed, @@ -105,7 +105,7 @@ export const mockedCapabilities: FullCapabilities = { name: 'discovery', description: 'discovery plan', lifecycle: mockedLifecycle, - tags: [database.capabilities.Tags.new], + tags: [database.capabilities.TagEnum.new], order: 0, backupRetention: '1', }, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesMock/catalog.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilitiesMock/catalog.ts similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesMock/catalog.ts rename to packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilitiesMock/catalog.ts index 72669dc1bd20..a09620da014c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesMock/catalog.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/availabilitiesMock/catalog.ts @@ -1,4 +1,4 @@ -import { nichandle, order } from '@/models/catalog'; +import { nichandle, order } from '@/types/catalog'; import { mockedAvailabilities } from './availabilities'; const planCodes = mockedAvailabilities.reduce((acc, curr) => { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/backup.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/backup.ts index 631502b7346b..62ed596a107d 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/backup.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/backup.ts @@ -1,5 +1,4 @@ -import { RestoreBackupProps } from '@/api/databases/backups'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const mockedBackup: database.Backup = { createdAt: '2024/04/08', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/catalog.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/catalog.ts index 93f535c3ca2f..dccaac7ac55c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/catalog.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/catalog.ts @@ -1,4 +1,4 @@ -import { nichandle, order } from '@/models/catalog'; +import { nichandle, order } from '@/types/catalog'; export const mockedCatalogPlan: order.publicOrder.Plan = { addonFamilies: [ diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/cdbError.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/cdbError.ts index 4ca86136c257..f7b809cc576d 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/cdbError.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/cdbError.ts @@ -1,4 +1,4 @@ -import { CdbError } from '@/api/databases'; +import { CdbError } from '@/data/api/database'; export const apiErrorMock = new CdbError( 'test', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/connectionPool.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/connectionPool.ts index 4d512d4cc738..2f47acf98393 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/connectionPool.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/connectionPool.ts @@ -1,5 +1,5 @@ -import { ConnectionPoolEdition } from '@/api/databases/connectionPool'; -import { database } from '@/models/database'; +import { ConnectionPoolEdition } from '@/data/api/database/connectionPool.api'; +import * as database from '@/types/cloud/project/database'; export const mockedConnectionPool: database.postgresql.ConnectionPool = { databaseId: 'databaseId', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/databaseUser.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/databaseUser.ts index 7ec4120509d4..be6a7ecc507a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/databaseUser.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/databaseUser.ts @@ -1,5 +1,5 @@ -import { UserEdition } from '@/api/databases/users'; -import { database } from '@/models/database'; +import { UserEdition } from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; export const mockedDatabaseUser: database.service.User = { createdAt: '2024-03-19T11:34:47.088723+01:00', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/databases.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/databases.ts index ecb0b25b54de..a7209489135a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/databases.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/databases.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const mockedDatabase: database.service.Database = { default: true, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/guides.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/guides.ts index 25eb21f90e4c..977f23a86b04 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/guides.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/guides.ts @@ -1,5 +1,5 @@ -import { database } from '@/models/database'; -import { Guide, GuideSections } from '@/models/guide'; +import * as database from '@/types/cloud/project/database'; +import { Guide, GuideSections } from '@/types/guide'; export const mockedGuide: Guide = { section: GuideSections.integrations, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/integrations.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/integrations.ts index d3fedd20d5b9..6f30be6ab050 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/integrations.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/integrations.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const mockedIntegrations: database.service.Integration = { destinationServiceId: 'destinationServiceId', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/logs.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/logs.ts index 747f67814ccd..cd87925ee994 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/logs.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/logs.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const mockedLogs: database.service.LogEntry = { hostname: 'hostName', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/maintenances.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/maintenances.ts index f71df331718c..31b94297fd17 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/maintenances.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/maintenances.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const mockedMaintenance: database.service.Maintenance = { description: 'maintenance description', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/metrics.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/metrics.ts index cd27f1c9db42..267731355161 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/metrics.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/metrics.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const mockMetric: database.service.Metric = { name: 'cpu_usage_percent', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/namespaces.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/namespaces.ts index fe77a07c4a83..4853eda9b575 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/namespaces.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/namespaces.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const mockedNamespaces: database.m3db.Namespace = { id: 'namespaceId', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/network.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/network.ts index afe8415eaf70..1801e2ad784c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/network.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/network.ts @@ -4,8 +4,8 @@ import { NetworkStatusEnum, NetworkTypeEnum, Subnet, - Vrack, -} from '@/models/network'; +} from '@/types/cloud/network'; +import { Vrack } from '@/types/cloud/Vrack'; export const mockedNetworks: Network[] = [ { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/nodes.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/nodes.ts index e54b41dad432..c245a9fc9476 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/nodes.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/nodes.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const mockedNode: database.service.Node = { createdAt: 'createdAt', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/order-funnel.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/order-funnel.ts index 7e7beca76ada..4334f1716036 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/order-funnel.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/order-funnel.ts @@ -1,6 +1,6 @@ -import { order } from '@/models/catalog'; -import { database } from '@/models/database'; -import { Engine, Flavor, Plan, Region, Version } from '@/models/order-funnel'; +import { order } from '@/types/catalog'; +import * as database from '@/types/cloud/project/database'; +import { Engine, Flavor, Plan, Region, Version } from '@/types/orderFunnel'; export const mockedBasicOrderFunnelFlavor: Flavor = { name: 'flavorName', @@ -8,7 +8,7 @@ export const mockedBasicOrderFunnelFlavor: Flavor = { default: true, vcores: 2, ram: { unit: 'GB', value: 40 }, - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], pricing: { hourly: { capacities: [order.cart.GenericProductPricingCapacitiesEnum.consumption], @@ -56,7 +56,7 @@ export const mockedBasicOrderFunnelFlavor: Flavor = { export const mockedOrderFunnelRegion: Region = { name: 'regionName', order: 1, - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], default: true, flavors: [mockedBasicOrderFunnelFlavor], }; @@ -64,7 +64,7 @@ export const mockedOrderFunnelRegion: Region = { export const mockedOrderFunnelRegionBis: Region = { name: 'region2Name', order: 2, - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], default: false, flavors: [mockedBasicOrderFunnelFlavor], }; @@ -123,13 +123,13 @@ export const mockedBasicOrderFunnelPlan: Plan = { default: false, networks: [database.NetworkTypeEnum.private], backups: true, - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], regions: [mockedOrderFunnelRegion], }; export const mockedEngineVersion: Version = { name: 'versionName', - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], default: true, order: 1, plans: [mockedBasicOrderFunnelPlan], @@ -138,9 +138,9 @@ export const mockedEngineVersion: Version = { export const mockedOrderFunnelEngine: Engine = { name: 'engineName', description: 'engineDescription', - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, order: 1, - tags: [database.capabilities.Tags.current], + tags: [database.capabilities.TagEnum.current], default: true, defaultVersion: 'versionName', storageMode: database.capabilities.engine.storage.StrategyEnum.distributed, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/pciProjects.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/pciProjects.ts index 3fffefd4624f..db719f64c18a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/pciProjects.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/pciProjects.ts @@ -1,12 +1,15 @@ -import { PciProject, PciProjectPlanCode } from '@/models/project'; +import { AccessTypeEnum } from '@/types/cloud/AccessTypeEnum'; +import { PlanCode, Project } from '@/types/cloud/Project'; +import { ProjectStatusEnum } from '@/types/cloud/project/ProjectStatusEnum'; -export const mockedPciProject: PciProject = { - access: 'access', +export const mockedPciProject: Project = { + access: AccessTypeEnum.full, creationDate: 'creationDate', description: 'description', projectName: 'projectName', project_id: 'projectId', - status: 'status', + status: ProjectStatusEnum.ok, unleash: true, - planCode: PciProjectPlanCode.STANDARD, + planCode: PlanCode.STANDARD, + manualQuota: false, }; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/queries.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/queries.ts index bdc03292f435..f13760f8f93e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/queries.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/queries.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const mockedQueries: database.service.currentqueries.Query = { applicationName: 'applicationName', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/services.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/services.ts index 200162e2c9ac..236a1b1d9239 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/services.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/services.ts @@ -1,6 +1,6 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { mockedNode } from './nodes'; -import { ServiceCreationWithEngine } from '@/hooks/api/services.api.hooks'; +import { ServiceCreationWithEngine } from '@/hooks/api/database/service/useAddService.hook'; export const mockedService: database.Service = { backupTime: '16:00:00', @@ -40,7 +40,7 @@ export const mockedService: database.Service = { update: database.service.capability.StateEnum.enabled, }, }, - category: database.CategoryEnum.all, + category: database.engine.CategoryEnum.all, createdAt: '12/12/2022', description: 'serviceDescription', disk: { @@ -96,6 +96,7 @@ export const mockedService: database.Service = { export const mockedServiceInte: database.Service = { backupTime: 'backupTime', + backups: null, capabilities: { [database.service.CapabilityEnum.backups]: { create: database.service.capability.StateEnum.enabled, @@ -125,7 +126,7 @@ export const mockedServiceInte: database.Service = { create: database.service.capability.StateEnum.enabled, }, }, - category: database.CategoryEnum.all, + category: database.engine.CategoryEnum.all, createdAt: 'createdAt', description: 'description', disk: { @@ -201,6 +202,7 @@ export const mockedServiceCreationWithEngine: ServiceCreationWithEngine = { /// / Used for Add integration test export const mockedServiceInteBase: database.Service = { + backups: null, backupTime: 'backupTime', capabilities: { [database.service.CapabilityEnum.integrations]: { @@ -210,7 +212,7 @@ export const mockedServiceInteBase: database.Service = { read: database.service.capability.StateEnum.enabled, }, }, - category: database.CategoryEnum.all, + category: database.engine.CategoryEnum.all, createdAt: 'createdAt', description: 'description', disk: { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/user.ts b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/user.ts index fb9749549564..5936b0a1c122 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/user.ts +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/mocks/user.ts @@ -9,6 +9,9 @@ export const mockedUser: User = { method: 'method', roles: [], user: 'user', + account: '', + allowedRoutes: [], + identities: [], }, birthCity: 'birthCity', birthDay: 'birthDay', diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/QueryClientWrapper.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/QueryClientWrapper.tsx index f34f51f6e096..1a3ce8980bdf 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/QueryClientWrapper.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/QueryClientWrapper.tsx @@ -1,6 +1,6 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import { USER_INACTIVITY_TIMEOUT } from '@/configuration/polling'; -import { UserActivityProvider } from '@/contexts/userActivityContext'; +import { USER_INACTIVITY_TIMEOUT } from '@/configuration/polling.constants'; +import { UserActivityProvider } from '@/contexts/UserActivityContext'; const queryClient = new QueryClient(); export const QueryClientWrapper = ({ diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/RouterWithLocationWrapper.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/RouterWithLocationWrapper.tsx index 0d310dca93fb..39e1752e38fd 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/RouterWithLocationWrapper.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/RouterWithLocationWrapper.tsx @@ -5,7 +5,7 @@ import { MemoryRouter, useLocation, } from 'react-router-dom'; -import * as useLoadingIndicator from '@/contexts/loadingIndicatorContext'; +import * as useLoadingIndicator from '@/contexts/LoadingIndicator.context'; /** * Displays the current location in order to test the syncing between the state of the hook and the url diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/RouterWithQueryClientWrapper.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/RouterWithQueryClientWrapper.tsx index 9819fd075280..4e02dfedf280 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/RouterWithQueryClientWrapper.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/__tests__/helpers/wrappers/RouterWithQueryClientWrapper.tsx @@ -5,8 +5,8 @@ import { ShellProvider } from '@ovh-ux/manager-react-shell-client'; import { HashRouterWithLocationWrapper } from './RouterWithLocationWrapper'; import { QueryClientWrapper } from './QueryClientWrapper'; import { mockedUser } from '../mocks/user'; -import { UserActivityProvider } from '@/contexts/userActivityContext'; -import { USER_INACTIVITY_TIMEOUT } from '@/configuration/polling'; +import { UserActivityProvider } from '@/contexts/UserActivityContext'; +import { USER_INACTIVITY_TIMEOUT } from '@/configuration/polling.constants'; export const RouterWithQueryClientWrapper = ({ children, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/advancedConfiguration.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/advancedConfiguration.hook.test.tsx deleted file mode 100644 index 2c9ec94a79c9..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/advancedConfiguration.hook.test.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import { renderHook, waitFor } from '@testing-library/react'; -import { vi } from 'vitest'; -import { - useGetAdvancedConfiguration, - useGetAdvancedConfigurationCapabilities, - useUpdateAdvancedConfiguration, -} from '@/hooks/api/advancedConfiguration.api.hook'; -import * as databaseAPI from '@/api/databases/advancedConfiguration'; -import { database } from '@/models/database'; -import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -// Mock the API functions -vi.mock('@/api/databases/advancedConfiguration', () => ({ - getAdvancedConfiguration: vi.fn(), - getAdvancedConfigurationCapabilities: vi.fn(), - updateAdvancedConfiguration: vi.fn(), -})); - -describe('useGetAdvancedConfiguration', () => { - it('should return advanced configuration data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const mockData = { key: 'value' }; - - vi.mocked(databaseAPI.getAdvancedConfiguration).mockResolvedValue(mockData); - - const { result } = renderHook( - () => useGetAdvancedConfiguration(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual(mockData); - expect(databaseAPI.getAdvancedConfiguration).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useGetAdvancedConfigurationCapabilities', () => { - it('should return advanced configuration capabilities', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const mockCapabilities: database.capabilities.advancedConfiguration.Property[] = [ - { - name: 'capability', - type: - database.capabilities.advancedConfiguration.property.TypeEnum.string, - description: '', - }, - ]; - - vi.mocked( - databaseAPI.getAdvancedConfigurationCapabilities, - ).mockResolvedValue(mockCapabilities); - - const { result } = renderHook( - () => - useGetAdvancedConfigurationCapabilities(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.data).toEqual(mockCapabilities); - expect( - databaseAPI.getAdvancedConfigurationCapabilities, - ).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useUpdateAdvancedConfiguration', () => { - it('should call updateAdvancedConfiguration on mutation', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const mockAdvancedConfiguration = { key: 'value' }; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.updateAdvancedConfiguration).mockResolvedValue( - mockAdvancedConfiguration, - ); - const { result } = renderHook( - () => useUpdateAdvancedConfiguration({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const updateProps = { - projectId, - engine, - serviceId, - advancedConfiguration: mockAdvancedConfiguration, - }; - result.current.updateAdvancedConfiguration(updateProps); - - await waitFor(() => { - expect(databaseAPI.updateAdvancedConfiguration).toHaveBeenCalledWith( - updateProps, - ); - expect(onSuccess).toHaveBeenCalledWith( - mockAdvancedConfiguration, - updateProps, - undefined, - ); - }); - }); -}); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/availabilities.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/availabilities.hook.test.tsx deleted file mode 100644 index 557bc8a52e1c..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/availabilities.hook.test.tsx +++ /dev/null @@ -1,167 +0,0 @@ -import { renderHook, waitFor } from '@testing-library/react'; -import { vi } from 'vitest'; -import * as databaseAPI from '@/api/databases/availabilities'; -import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { - useGetAvailabilities, - useGetCapabilities, - useGetEnginesCapabilities, - useGetFullCapabilities, - useGetRegionsCapabilities, - useGetSuggestions, -} from '@/hooks/api/availabilities.api.hooks'; -import { - mockedAvailabilities, - mockedCapabilities, - mockedEngineCapabilities, - mockedFullCapabilities, - mockedRegionCapabilities, - mockedSuggestions, -} from '@/__tests__/helpers/mocks/availabilities'; - -vi.mock('@/api/databases/availabilities', () => ({ - getAvailabilities: vi.fn(), - getSuggestions: vi.fn(), - getCapabilities: vi.fn(), - getEnginesCapabilities: vi.fn(), - getRegionsCapabilities: vi.fn(), -})); - -describe('useGetAvailabilities', () => { - it('should return Availabilities', async () => { - const projectId = 'projectId'; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getAvailabilities).mockResolvedValue([ - mockedAvailabilities, - ]); - - const { result } = renderHook( - () => useGetAvailabilities(projectId, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedAvailabilities]); - expect(databaseAPI.getAvailabilities).toHaveBeenCalledWith({ - projectId, - serviceId, - }); - }); - }); -}); - -describe('useGetSuggestions', () => { - it('should return Suggestions', async () => { - const projectId = 'projectId'; - - vi.mocked(databaseAPI.getSuggestions).mockResolvedValue([ - mockedSuggestions, - ]); - - const { result } = renderHook(() => useGetSuggestions(projectId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedSuggestions]); - expect(databaseAPI.getSuggestions).toHaveBeenCalledWith(projectId); - }); - }); -}); - -describe('useGetCapabilities', () => { - it('should return Capabilities', async () => { - const projectId = 'projectId'; - - vi.mocked(databaseAPI.getCapabilities).mockResolvedValue( - mockedCapabilities, - ); - - const { result } = renderHook(() => useGetCapabilities(projectId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual(mockedCapabilities); - expect(databaseAPI.getCapabilities).toHaveBeenCalledWith(projectId); - }); - }); -}); - -describe('useGetEnginesCapabilities', () => { - it('should return EnginesCapabilities', async () => { - const projectId = 'projectId'; - - vi.mocked(databaseAPI.getEnginesCapabilities).mockResolvedValue([ - mockedEngineCapabilities, - ]); - - const { result } = renderHook(() => useGetEnginesCapabilities(projectId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedEngineCapabilities]); - expect(databaseAPI.getEnginesCapabilities).toHaveBeenCalledWith( - projectId, - ); - }); - }); -}); - -describe('useGetRegionsCapabilities', () => { - it('should return RegionsCapabilities', async () => { - const projectId = 'projectId'; - - vi.mocked(databaseAPI.getRegionsCapabilities).mockResolvedValue([ - mockedRegionCapabilities, - ]); - - const { result } = renderHook(() => useGetRegionsCapabilities(projectId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedRegionCapabilities]); - expect(databaseAPI.getRegionsCapabilities).toHaveBeenCalledWith( - projectId, - ); - }); - }); -}); - -describe('useGetFullCapabilities', () => { - it('should return FullCapabilities', async () => { - const projectId = 'projectId'; - - vi.mocked(databaseAPI.getCapabilities).mockResolvedValue( - mockedCapabilities, - ); - - vi.mocked(databaseAPI.getEnginesCapabilities).mockResolvedValue([ - mockedEngineCapabilities, - ]); - - vi.mocked(databaseAPI.getRegionsCapabilities).mockResolvedValue([ - mockedRegionCapabilities, - ]); - - const { result } = renderHook(() => useGetFullCapabilities(projectId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual(mockedFullCapabilities); - expect(databaseAPI.getRegionsCapabilities).toHaveBeenCalledWith( - projectId, - ); - }); - }); -}); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/connectionPool.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/connectionPool.hook.test.tsx deleted file mode 100644 index 28c6961d6f12..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/connectionPool.hook.test.tsx +++ /dev/null @@ -1,161 +0,0 @@ -import { renderHook, waitFor } from '@testing-library/react'; -import { vi } from 'vitest'; -import { - useGetConnectionPools, - useAddConnectionPool, - useDeleteConnectionPool, - useEditConnectionPool, -} from '@/hooks/api/connectionPool.api.hooks'; - -import * as databaseAPI from '@/api/databases/connectionPool'; -import { database } from '@/models/database'; -import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { - mockedAddConnectionPool, - mockedConnectionPool, - mockedEditConnectionPool, -} from '@/__tests__/helpers/mocks/connectionPool'; - -vi.mock('@/api/databases/connectionPool', () => ({ - getConnectionPools: vi.fn(), - addConnectionPool: vi.fn(), - editConnectionPool: vi.fn(), - deleteConnectionPool: vi.fn(), -})); - -describe('useGetConnectionPool', () => { - it('should return connectionPool data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getConnectionPools).mockResolvedValue([ - mockedConnectionPool, - ]); - - const { result } = renderHook( - () => useGetConnectionPools(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedConnectionPool]); - expect(databaseAPI.getConnectionPools).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useAddConnectionPool', () => { - it('should call useAddConnectionPool on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.addConnectionPool).mockResolvedValue( - mockedConnectionPool, - ); - const { result } = renderHook( - () => useAddConnectionPool({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const addConnectionPoolProps = { - projectId, - engine, - serviceId, - connectionPool: mockedAddConnectionPool, - }; - result.current.addConnectionPool(addConnectionPoolProps); - - await waitFor(() => { - expect(databaseAPI.addConnectionPool).toHaveBeenCalledWith( - addConnectionPoolProps, - ); - expect(onSuccess).toHaveBeenCalledWith( - mockedConnectionPool, - addConnectionPoolProps, - undefined, - ); - }); - }); -}); - -describe('useEditConnectionPool', () => { - it('should call useEditConnectionPool on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.editConnectionPool).mockResolvedValue( - mockedConnectionPool, - ); - const { result } = renderHook( - () => useEditConnectionPool({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const editConnectionPoolProps = { - projectId, - engine, - serviceId, - connectionPool: mockedEditConnectionPool, - }; - result.current.editConnectionPool(editConnectionPoolProps); - - await waitFor(() => { - expect(databaseAPI.editConnectionPool).toHaveBeenCalledWith( - editConnectionPoolProps, - ); - expect(onSuccess).toHaveBeenCalledWith( - mockedConnectionPool, - editConnectionPoolProps, - undefined, - ); - }); - }); -}); - -describe('useDeleteConnectionPool', () => { - it('should call useDeleteConnectionPool on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.deleteConnectionPool).mockResolvedValue(undefined); - - const { result } = renderHook( - () => useDeleteConnectionPool({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const deleteConnectionPoolProps = { - projectId, - engine, - serviceId, - connectionPoolId: 'connectionPoolId', - }; - result.current.deleteConnectionPool(deleteConnectionPoolProps); - - await waitFor(() => { - expect(databaseAPI.deleteConnectionPool).toHaveBeenCalledWith( - deleteConnectionPoolProps, - ); - expect(onSuccess).toHaveBeenCalledWith( - undefined, - deleteConnectionPoolProps, - undefined, - ); - }); - }); -}); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/databases.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/databases.hook.test.tsx deleted file mode 100644 index f29302dfe9a5..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/databases.hook.test.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { renderHook, waitFor } from '@testing-library/react'; -import { vi } from 'vitest'; -import { - useGetDatabases, - useAddDatabase, - useDeleteDatabase, -} from '@/hooks/api/databases.api.hook'; - -import * as databaseAPI from '@/api/databases/databases'; -import { database } from '@/models/database'; -import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { mockedDatabase } from '@/__tests__/helpers/mocks/databases'; - -vi.mock('@/api/databases/databases', () => ({ - getServiceDatabases: vi.fn(), - addDatabase: vi.fn(), - deleteDatabase: vi.fn(), -})); - -describe('useGetServiceDatabases', () => { - it('should return service databases data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getServiceDatabases).mockResolvedValue([ - mockedDatabase, - ]); - - const { result } = renderHook( - () => useGetDatabases(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedDatabase]); - expect(databaseAPI.getServiceDatabases).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useAddDatabase', () => { - it('should call useAddDatabase on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.addDatabase).mockResolvedValue(mockedDatabase); - const { result } = renderHook( - () => useAddDatabase({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const addDatabaseProps = { - projectId, - engine, - serviceId, - name: 'databaseName', - }; - result.current.addDatabase(addDatabaseProps); - - await waitFor(() => { - expect(databaseAPI.addDatabase).toHaveBeenCalledWith(addDatabaseProps); - expect(onSuccess).toHaveBeenCalledWith( - mockedDatabase, - addDatabaseProps, - undefined, - ); - }); - }); -}); - -describe('useDeleteDatabase', () => { - it('should call useDeleteConnectionPool on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.deleteDatabase).mockResolvedValue(undefined); - - const { result } = renderHook( - () => useDeleteDatabase({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const deleteDatabaseProps = { - projectId, - engine, - serviceId, - databaseId: 'databaseId', - }; - result.current.deleteDatabase(deleteDatabaseProps); - - await waitFor(() => { - expect(databaseAPI.deleteDatabase).toHaveBeenCalledWith( - deleteDatabaseProps, - ); - expect(onSuccess).toHaveBeenCalledWith( - undefined, - deleteDatabaseProps, - undefined, - ); - }); - }); -}); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/integrations.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/integrations.hook.test.tsx deleted file mode 100644 index 2530980d21e8..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/integrations.hook.test.tsx +++ /dev/null @@ -1,151 +0,0 @@ -import { renderHook, waitFor } from '@testing-library/react'; -import { vi } from 'vitest'; -import { - useGetIntegrations, - useGetCapabilitiesIntegrations, - useAddIntegration, - UseDeleteIntegration, -} from '@/hooks/api/integrations.api.hook'; - -import * as databaseAPI from '@/api/databases/integrations'; -import { database } from '@/models/database'; -import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { - mockedAddIntegrations, - mockedCapabilitiesIntegrations, - mockedIntegrations, -} from '@/__tests__/helpers/mocks/integrations'; - -vi.mock('@/api/databases/integrations', () => ({ - getServiceIntegrations: vi.fn(), - getServiceCapabilitiesIntegrations: vi.fn(), - addIntegration: vi.fn(), - deleteIntegration: vi.fn(), -})); - -describe('useGetIntegrations', () => { - it('should return service integrations data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getServiceIntegrations).mockResolvedValue([ - mockedIntegrations, - ]); - - const { result } = renderHook( - () => useGetIntegrations(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedIntegrations]); - expect(databaseAPI.getServiceIntegrations).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useGetCapabilitiesIntegrations', () => { - it('should return integrations capabilities data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked( - databaseAPI.getServiceCapabilitiesIntegrations, - ).mockResolvedValue([mockedCapabilitiesIntegrations]); - - const { result } = renderHook( - () => useGetCapabilitiesIntegrations(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedCapabilitiesIntegrations]); - expect( - databaseAPI.getServiceCapabilitiesIntegrations, - ).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useAddIntegration', () => { - it('should call useAddIntegration on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.addIntegration).mockResolvedValue(mockedIntegrations); - const { result } = renderHook( - () => useAddIntegration({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const addIntegrationProps = { - projectId, - engine, - serviceId, - integration: mockedAddIntegrations, - }; - result.current.addIntegration(addIntegrationProps); - - await waitFor(() => { - expect(databaseAPI.addIntegration).toHaveBeenCalledWith( - addIntegrationProps, - ); - expect(onSuccess).toHaveBeenCalledWith( - mockedIntegrations, - addIntegrationProps, - undefined, - ); - }); - }); -}); - -describe('useDeleteIntegration', () => { - it('should call useDeleteIntegration on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.deleteIntegration).mockResolvedValue(undefined); - - const { result } = renderHook( - () => UseDeleteIntegration({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const deleteIntegrationProps = { - projectId, - engine, - serviceId, - integrationId: 'integrationId', - }; - result.current.deleteIntegration(deleteIntegrationProps); - - await waitFor(() => { - expect(databaseAPI.deleteIntegration).toHaveBeenCalledWith( - deleteIntegrationProps, - ); - expect(onSuccess).toHaveBeenCalledWith( - undefined, - deleteIntegrationProps, - undefined, - ); - }); - }); -}); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/namespaces.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/namespaces.hook.test.tsx deleted file mode 100644 index 9cb83549005a..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/namespaces.hook.test.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import { renderHook, waitFor } from '@testing-library/react'; -import { vi } from 'vitest'; - -import { - useGetNamespaces, - useAddNamespace, - useEditNamespace, - useDeleteNamespace, -} from '@/hooks/api/namespaces.api.hooks'; -import * as databaseAPI from '@/api/databases/namespaces'; -import { database } from '@/models/database'; -import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { - mockedAddNamespace, - mockedEditNamespace, - mockedNamespaces, -} from '@/__tests__/helpers/mocks/namespaces'; - -vi.mock('@/api/databases/namespaces', () => ({ - getNamespaces: vi.fn(), - addNamespace: vi.fn(), - editNamespace: vi.fn(), - deleteNamespace: vi.fn(), -})); - -describe('useGetNamespaces', () => { - it('should return Namespaces data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.m3db; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getNamespaces).mockResolvedValue([mockedNamespaces]); - - const { result } = renderHook( - () => useGetNamespaces(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedNamespaces]); - expect(databaseAPI.getNamespaces).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useAddConnectionPool', () => { - it('should call useAddConnectionPool on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.m3db; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.addNamespace).mockResolvedValue(mockedNamespaces); - const { result } = renderHook( - () => useAddNamespace({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const addNamespaceProps = { - projectId, - engine, - serviceId, - namespace: mockedAddNamespace, - }; - result.current.addNamespace(addNamespaceProps); - - await waitFor(() => { - expect(databaseAPI.addNamespace).toHaveBeenCalledWith(addNamespaceProps); - expect(onSuccess).toHaveBeenCalledWith( - mockedNamespaces, - addNamespaceProps, - undefined, - ); - }); - }); -}); - -describe('useEditNamepsace', () => { - it('should call useEditNamespace on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.m3db; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.editNamespace).mockResolvedValue(mockedNamespaces); - const { result } = renderHook( - () => useEditNamespace({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const editNamespaceProps = { - projectId, - engine, - serviceId, - namespace: mockedEditNamespace, - }; - result.current.editNamespace(editNamespaceProps); - - await waitFor(() => { - expect(databaseAPI.editNamespace).toHaveBeenCalledWith( - editNamespaceProps, - ); - expect(onSuccess).toHaveBeenCalledWith( - mockedNamespaces, - editNamespaceProps, - undefined, - ); - }); - }); -}); - -describe('useDeleteNamespace', () => { - it('should call useDeleteNamespace on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.m3db; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.deleteNamespace).mockResolvedValue(undefined); - - const { result } = renderHook( - () => useDeleteNamespace({ onError, onSuccess }), - { wrapper: QueryClientWrapper }, - ); - - const deleteNamespaceProps = { - projectId, - engine, - serviceId, - namespaceId: 'namespaceId', - }; - result.current.deleteNamespace(deleteNamespaceProps); - - await waitFor(() => { - expect(databaseAPI.deleteNamespace).toHaveBeenCalledWith( - deleteNamespaceProps, - ); - expect(onSuccess).toHaveBeenCalledWith( - undefined, - deleteNamespaceProps, - undefined, - ); - }); - }); -}); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/network.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/network.hook.test.tsx deleted file mode 100644 index 94cd4f7df4d1..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/network.hook.test.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { renderHook, waitFor } from '@testing-library/react'; -import { vi } from 'vitest'; -import * as API from '@/api/network'; -import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { - useGetVrack, - useGetNetwork, - useGetSubnet, -} from '@/hooks/api/network.api.hooks'; -import { - mockedNetworks, - mockedSubnets, - mockedVrack, -} from '@/__tests__/helpers/mocks/network'; - -vi.mock('@/api/network', () => ({ - networkApi: { - getPrivateNetworks: vi.fn(), - getSubnets: vi.fn(), - getVrack: vi.fn(), - }, -})); - -describe('useGetNetwork', () => { - it('should return network', async () => { - const projectId = 'projectId'; - - vi.mocked(API.networkApi.getPrivateNetworks).mockResolvedValue( - mockedNetworks, - ); - - const { result } = renderHook(() => useGetNetwork(projectId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual(mockedNetworks); - expect(API.networkApi.getPrivateNetworks).toHaveBeenCalledWith(projectId); - }); - }); -}); - -describe('useGetSubnet', () => { - it('should return subnet', async () => { - const projectId = 'projectId'; - const networkId = 'networkId'; - - vi.mocked(API.networkApi.getSubnets).mockResolvedValue(mockedSubnets); - - const { result } = renderHook(() => useGetSubnet(projectId, networkId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual(mockedSubnets); - expect(API.networkApi.getSubnets).toHaveBeenCalledWith( - projectId, - networkId, - ); - }); - }); -}); - -describe('useGetVrack', () => { - it('should return vrack', async () => { - const projectId = 'projectId'; - - vi.mocked(API.networkApi.getVrack).mockResolvedValue(mockedVrack); - - const { result } = renderHook(() => useGetVrack(projectId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual(mockedVrack); - expect(API.networkApi.getVrack).toHaveBeenCalledWith(projectId); - }); - }); -}); diff --git a/packages/manager/apps/pci-databases-analytics/src/api/projects.ts b/packages/manager/apps/pci-databases-analytics/src/api/projects.ts deleted file mode 100644 index 65cda1a58675..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/api/projects.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { apiClient } from '@ovh-ux/manager-core-api'; -import { PciProject } from '@/models/project'; - -export const getProject = async (projectId: string): Promise => { - const response = await apiClient.v6.get(`/cloud/project/${projectId}`); - return response.data as PciProject; -}; diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Breadcrumb/Breadcrumb.tsx b/packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/Breadcrumb.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/components/Breadcrumb/Breadcrumb.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/Breadcrumb.component.tsx index 1150044ab032..c1ec45111e9e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Breadcrumb/Breadcrumb.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/Breadcrumb.component.tsx @@ -1,9 +1,10 @@ import React, { useState } from 'react'; import { Params, useParams, useLocation, useMatches } from 'react-router-dom'; import { useNavigation } from '@ovh-ux/manager-react-shell-client'; -import usePciProject from '@/hooks/api/pciProjects.api.hooks'; +import usePciProject from '@/hooks/api/project/usePciProject.hook'; import { Skeleton } from '../ui/skeleton'; -import { Link, A } from '../links'; +import Link from '@/components/links/Link.component'; +import A from '@/components/links/A.component'; export type BreadcrumbHandleParams = { data: unknown; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/breadcrumb.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/Breadcrumb.spec.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/breadcrumb.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/Breadcrumb.spec.tsx index e9282e9f341c..9eba67a82652 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/breadcrumb.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/Breadcrumb.spec.tsx @@ -1,7 +1,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import Breadcrumb from '@/components/Breadcrumb/Breadcrumb'; -import { RouterWithQueryClientWrapper } from '../helpers/wrappers/RouterWithQueryClientWrapper'; +import Breadcrumb from '@/components/breadcrumb/Breadcrumb.component'; +import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; vi.mock('react-router-dom', async () => { const mod = await vi.importActual('react-router-dom'); @@ -31,7 +31,7 @@ vi.mock('react-router-dom', async () => { }; }); -vi.mock('@/api/projects', () => { +vi.mock('@/data/api/project/project.api', () => { return { getProject: vi.fn(() => ({ project_id: '123456', diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Breadcrumb/BreadcrumbItem.tsx b/packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/BreadcrumbItem.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/components/Breadcrumb/BreadcrumbItem.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/BreadcrumbItem.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/breadcrumbItem.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/BreadcrumbItem.spec.tsx similarity index 88% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/breadcrumbItem.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/BreadcrumbItem.spec.tsx index 5d4d3b3b5b3f..26c0cb50a235 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/breadcrumbItem.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/breadcrumb/BreadcrumbItem.spec.tsx @@ -1,6 +1,6 @@ import { render, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; vi.mock('react-i18next', () => ({ useTranslation: () => ({ diff --git a/packages/manager/apps/pci-databases-analytics/src/components/errorBoundary.tsx b/packages/manager/apps/pci-databases-analytics/src/components/error-boundary/ErrorBoundary.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/components/errorBoundary.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/error-boundary/ErrorBoundary.component.tsx index 66832b01741f..c51a6da30cf8 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/errorBoundary.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/error-boundary/ErrorBoundary.component.tsx @@ -1,9 +1,9 @@ import { useNavigation } from '@ovh-ux/manager-react-shell-client'; import { useRouteError } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import errorImgSrc from '@/public/assets/oops.png'; -import { Alert, AlertDescription } from './ui/alert'; -import { Button } from './ui/button'; +import errorImgSrc from '@/../public/assets/oops.png'; +import { Alert, AlertDescription } from '../ui/alert'; +import { Button } from '../ui/button'; const ErrorBoundary = () => { const error = useRouteError(); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/errorBoundary.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/error-boundary/ErrorBoundary.spec.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/errorBoundary.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/error-boundary/ErrorBoundary.spec.tsx index 085e33add6c6..6c60627a0fe6 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/errorBoundary.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/error-boundary/ErrorBoundary.spec.tsx @@ -8,8 +8,8 @@ import { import { describe, it, vi } from 'vitest'; import * as RouterDom from 'react-router-dom'; import { useNavigation } from '@ovh-ux/manager-react-shell-client'; -import ErrorBoundary from '@/components/errorBoundary'; -import { RouterWithQueryClientWrapper } from '../helpers/wrappers/RouterWithQueryClientWrapper'; +import ErrorBoundary from '@/components/error-boundary/ErrorBoundary.component'; +import { RouterWithQueryClientWrapper } from '../../__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; vi.mock('react-router-dom', async () => { const mod = await vi.importActual('react-router-dom'); diff --git a/packages/manager/apps/pci-databases-analytics/src/components/table-date.tsx b/packages/manager/apps/pci-databases-analytics/src/components/formatted-date/FormattedDate.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/components/table-date.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/formatted-date/FormattedDate.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/table-date.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/formatted-date/FormattedDate.spec.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/table-date.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/formatted-date/FormattedDate.spec.tsx index 7945a23615df..4bc90cde7770 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/table-date.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/formatted-date/FormattedDate.spec.tsx @@ -1,7 +1,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; import { useShell } from '@ovh-ux/manager-react-shell-client'; -import FormattedDate from '@/components/table-date'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; import { Locale } from '@/hooks/useLocale'; vi.mock('@ovh-ux/manager-react-shell-client', () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/guides.tsx b/packages/manager/apps/pci-databases-analytics/src/components/guides/Guides.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/components/guides.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/guides/Guides.component.tsx index 59a220ebfcc1..d7fdbbeced63 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/guides.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/guides/Guides.component.tsx @@ -1,8 +1,8 @@ import { useTranslation } from 'react-i18next'; import { useEffect, useState } from 'react'; import { BookOpen } from 'lucide-react'; -import { useGetGuides } from '@/hooks/api/guides.api.hooks'; -import { database } from '@/models/database'; +import { useGetGuides } from '@/hooks/api/guides/useGetGuides.hook'; +import * as database from '@/types/cloud/project/database'; import { CommandDialog, CommandEmpty, @@ -10,11 +10,11 @@ import { CommandInput, CommandItem, CommandList, -} from './ui/command'; +} from '../ui/command'; import { useLocale } from '@/hooks/useLocale'; -import { Button } from './ui/button'; -import { Guide } from '@/models/guide'; -import { Skeleton } from './ui/skeleton'; +import { Button } from '../ui/button'; +import { Guide } from '@/types/guide'; +import { Skeleton } from '../ui/skeleton'; interface GuidesProps { section?: string; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/guides.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/guides/Guides.spec.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/guides.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/guides/Guides.spec.tsx index 08aab1ce4976..d5c95eb86ed9 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/guides.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/guides/Guides.spec.tsx @@ -7,11 +7,14 @@ import { waitFor, } from '@testing-library/react'; -import Guides from '@/components/guides'; +import Guides from '@/components/guides/Guides.component'; import { Locale } from '@/hooks/useLocale'; -import { RouterWithQueryClientWrapper } from '../helpers/wrappers/RouterWithQueryClientWrapper'; -import { mockedGuide, mockedGuideOnboarding } from '../helpers/mocks/guides'; +import { RouterWithQueryClientWrapper } from '../../__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; +import { + mockedGuide, + mockedGuideOnboarding, +} from '../../__tests__/helpers/mocks/guides'; describe('Guides component', () => { beforeEach(() => { @@ -39,7 +42,7 @@ describe('Guides component', () => { }; }); - vi.mock('@/api/databases/guides', () => ({ + vi.mock('@/data/api/guides/guides.api', () => ({ getGuides: vi.fn(() => [mockedGuide, mockedGuideOnboarding]), })); diff --git a/packages/manager/apps/pci-databases-analytics/src/components/links.tsx b/packages/manager/apps/pci-databases-analytics/src/components/links.tsx deleted file mode 100644 index edca85019d07..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/components/links.tsx +++ /dev/null @@ -1,154 +0,0 @@ -import * as React from 'react'; -import { useNavigation } from '@ovh-ux/manager-react-shell-client'; -import { - LinkProps, - NavLink as RouterNavLink, - Link as RouterLink, - NavLinkProps, -} from 'react-router-dom'; -import { cn } from '@/lib/utils'; -import { useLoadingIndicatorContext } from '@/contexts/loadingIndicatorContext'; - -function A({ - className, - children, - disabled, - ...props -}: React.AnchorHTMLAttributes & { disabled?: boolean }) { - const baseClassName = - 'text-primary-500 font-semibold outiline-none cursor-pointer no-underline hover:text-primary-700 hover:underline'; - const disabledClass = 'opacity-50 cursor-not-allowed hover:text-primary-500'; - const combinedClassName = cn( - baseClassName, - className, - disabled && disabledClass, - ); - if (disabled) { - // eslint-disable-next-line no-unused-vars - const { href, onClick, tabIndex, ...otherProps } = props; - return ( - - {children} - - ); - } - - return ( - - {children} - - ); -} - -function Link({ - className, - disabled, - children, - to, - ...props -}: LinkProps & { disabled?: boolean }) { - const { setLoading } = useLoadingIndicatorContext(); - const baseClassName = - 'text-primary-500 font-semibold outiline-none cursor-pointer no-underline hover:text-primary-700 hover:underline'; - const disabledClass = 'opacity-50 cursor-not-allowed hover:text-primary-500'; - const combinedClassName = cn( - baseClassName, - className, - disabled && disabledClass, - ); - return ( - { - if (disabled) { - e.preventDefault(); - } else { - setLoading(true); - } - }} - > - {children} - - ); -} - -function NavLink({ - className, - disabled, - children, - to, - end, - ...props -}: NavLinkProps & { disabled?: boolean }) { - const { setLoading } = useLoadingIndicatorContext(); - const baseClassName = - 'whitespace-nowrap w-fit text-primary-500 text-base font-semibold m-0 py-2 hover:text-primary-700'; - const activeClass = 'border-b-2 border-primary-500'; - const disabledClass = 'cursor-not-allowed opacity-50 hover:text-primary-500'; - - return ( - - cn( - baseClassName, - isActive && activeClass, - className, - disabled && disabledClass, - ) - } - onClick={(e) => { - if (disabled) { - e.preventDefault(); - } else { - setLoading(true); - } - }} - {...props} - > - {children} - - ); -} - -interface OvhLinkProps { - application: string; - path: string; - params?: Record; -} -function OvhLink({ - application, - path, - params = {}, - children, - ...props -}: React.AnchorHTMLAttributes & - OvhLinkProps & { disabled?: boolean }) { - const navigation = useNavigation(); - const [url, setUrl] = React.useState(''); - React.useEffect(() => { - const fetchUrl = async (urlParams: OvhLinkProps) => { - const goTo = (await navigation.getURL( - urlParams.application, - urlParams.path, - urlParams.params, - )) as string; - setUrl(goTo); - }; - fetchUrl({ application, path, params }); - }, [application, path, params, navigation]); - return ( - - {children} - - ); -} -export { A, Link, NavLink, OvhLink }; diff --git a/packages/manager/apps/pci-databases-analytics/src/components/links/A.component.tsx b/packages/manager/apps/pci-databases-analytics/src/components/links/A.component.tsx new file mode 100644 index 000000000000..fadd9f43be6d --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/components/links/A.component.tsx @@ -0,0 +1,38 @@ +import { cn } from '@/lib/utils'; + +function A({ + className, + children, + disabled, + ...props +}: React.AnchorHTMLAttributes & { disabled?: boolean }) { + const baseClassName = + 'text-primary-500 font-semibold outiline-none cursor-pointer no-underline hover:text-primary-700 hover:underline'; + const disabledClass = 'opacity-50 cursor-not-allowed hover:text-primary-500'; + const combinedClassName = cn( + baseClassName, + className, + disabled && disabledClass, + ); + if (disabled) { + // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars + const { href, onClick, tabIndex, ...otherProps } = props; + return ( + + {children} + + ); + } + + return ( + + {children} + + ); +} +export default A; diff --git a/packages/manager/apps/pci-databases-analytics/src/components/links/A.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/components/links/A.spec.tsx new file mode 100644 index 000000000000..95a22c88888c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/components/links/A.spec.tsx @@ -0,0 +1,34 @@ +import { render } from '@testing-library/react'; +import '@testing-library/jest-dom/vitest'; +import { vi } from 'vitest'; +import A from '@/components/links/A.component'; + +vi.mock('@ovh-ux/manager-react-shell-client', () => ({ + useNavigation: () => ({ + getURL: vi.fn((app: string, path: string) => `#mockedurl-${app}${path}`), + }), +})); + +describe('A', () => { + afterEach(() => { + vi.clearAllMocks(); + }); + it('renders anchor element correctly', () => { + const { container } = render(Link); + const anchor = container.querySelector('a'); + expect(anchor).toBeInTheDocument(); + expect(anchor).toHaveTextContent('Link'); + expect(anchor).toHaveAttribute('href', '#'); + }); + it('renders disabled anchor element correctly', () => { + const { container } = render( + + Link + , + ); + const anchor = container.querySelector('a'); + expect(anchor).toBeInTheDocument(); + expect(anchor).toHaveTextContent('Link'); + expect(anchor).not.toHaveAttribute('href'); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/components/links/Link.component.tsx b/packages/manager/apps/pci-databases-analytics/src/components/links/Link.component.tsx new file mode 100644 index 000000000000..21ac9352e5b0 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/components/links/Link.component.tsx @@ -0,0 +1,39 @@ +import { LinkProps, Link as RouterLink } from 'react-router-dom'; +import { cn } from '@/lib/utils'; +import { useLoadingIndicatorContext } from '@/contexts/LoadingIndicator.context'; + +function Link({ + className, + disabled, + children, + to, + ...props +}: LinkProps & { disabled?: boolean }) { + const { setLoading } = useLoadingIndicatorContext(); + const baseClassName = + 'text-primary-500 font-semibold outiline-none cursor-pointer no-underline hover:text-primary-700 hover:underline'; + const disabledClass = 'opacity-50 cursor-not-allowed hover:text-primary-500'; + const combinedClassName = cn( + baseClassName, + className, + disabled && disabledClass, + ); + return ( + { + if (disabled) { + e.preventDefault(); + } else { + setLoading(true); + } + }} + > + {children} + + ); +} + +export default Link; diff --git a/packages/manager/apps/pci-databases-analytics/src/components/links/Link.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/components/links/Link.spec.tsx new file mode 100644 index 000000000000..bb32dd135da8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/components/links/Link.spec.tsx @@ -0,0 +1,85 @@ +import { act, fireEvent, render } from '@testing-library/react'; +import '@testing-library/jest-dom/vitest'; +import { vi } from 'vitest'; +import { BrowserRouter as Router } from 'react-router-dom'; +import * as useLoadingIndicator from '@/contexts/LoadingIndicator.context'; +import Link from './Link.component'; + +vi.mock('@ovh-ux/manager-react-shell-client', () => ({ + useNavigation: () => ({ + getURL: vi.fn((app: string, path: string) => `#mockedurl-${app}${path}`), + }), +})); + +describe('Link', () => { + const useLoadingIndicatorSpy = vi.spyOn( + useLoadingIndicator, + 'useLoadingIndicatorContext', + ); + afterEach(() => { + vi.clearAllMocks(); + }); + it('renders RouterLink element correctly', () => { + const { container } = render( + + + Link + + , + ); + const routerLink = container.querySelector('a'); + expect(routerLink).toBeInTheDocument(); + expect(routerLink).toHaveTextContent('Link'); + expect(routerLink).toHaveAttribute('href', '/route'); + }); + + it('should set loading indicator on click', async () => { + const mockLoading = vi.fn(); + useLoadingIndicatorSpy.mockImplementation(() => ({ + loading: false, + setLoading: mockLoading, + })); + const { container } = render( + + + Link + + , + ); + + const routerLink = container.querySelector('a'); + expect(mockLoading).not.toHaveBeenCalled(); + act(() => { + if (routerLink) { + fireEvent.click(routerLink); + } + }); + expect(mockLoading).toHaveBeenCalled(); + }); + + it('should not set loading indicator when clicked on disabled link', async () => { + const mockLoading = vi.fn(); + useLoadingIndicatorSpy.mockImplementation(() => ({ + loading: false, + setLoading: mockLoading, + })); + const { container } = render( + + + + Link + + + , + ); + + const routerLink = container.querySelector('a'); + expect(mockLoading).not.toHaveBeenCalled(); + act(() => { + if (routerLink) { + fireEvent.click(routerLink); + } + }); + expect(mockLoading).not.toHaveBeenCalled(); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/components/links/NavLink.component.tsx b/packages/manager/apps/pci-databases-analytics/src/components/links/NavLink.component.tsx new file mode 100644 index 000000000000..d094d9708f88 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/components/links/NavLink.component.tsx @@ -0,0 +1,45 @@ +import { NavLink as RouterNavLink, NavLinkProps } from 'react-router-dom'; +import { cn } from '@/lib/utils'; +import { useLoadingIndicatorContext } from '@/contexts/LoadingIndicator.context'; + +function NavLink({ + className, + disabled, + children, + to, + end, + ...props +}: NavLinkProps & { disabled?: boolean }) { + const { setLoading } = useLoadingIndicatorContext(); + const baseClassName = + 'whitespace-nowrap w-fit text-primary-500 text-base font-semibold m-0 py-2 hover:text-primary-700'; + const activeClass = 'border-b-2 border-primary-500'; + const disabledClass = 'cursor-not-allowed opacity-50 hover:text-primary-500'; + + return ( + + cn( + baseClassName, + isActive && activeClass, + className, + disabled && disabledClass, + ) + } + onClick={(e) => { + if (disabled) { + e.preventDefault(); + } else { + setLoading(true); + } + }} + {...props} + > + {children} + + ); +} + +export default NavLink; diff --git a/packages/manager/apps/pci-databases-analytics/src/components/links/NavLink.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/components/links/NavLink.spec.tsx new file mode 100644 index 000000000000..a800713bd98f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/components/links/NavLink.spec.tsx @@ -0,0 +1,84 @@ +import { act, fireEvent, render } from '@testing-library/react'; +import '@testing-library/jest-dom/vitest'; +import { vi } from 'vitest'; +import { BrowserRouter as Router } from 'react-router-dom'; +import NavLink from '@/components/links/NavLink.component'; +import * as useLoadingIndicator from '@/contexts/LoadingIndicator.context'; + +vi.mock('@ovh-ux/manager-react-shell-client', () => ({ + useNavigation: () => ({ + getURL: vi.fn((app: string, path: string) => `#mockedurl-${app}${path}`), + }), +})); + +describe('NavLink', () => { + const useLoadingIndicatorSpy = vi.spyOn( + useLoadingIndicator, + 'useLoadingIndicatorContext', + ); + afterEach(() => { + vi.clearAllMocks(); + }); + it('renders NavLink element correctly', () => { + const { container } = render( + + + Link + + , + ); + const routerLink = container.querySelector('a'); + expect(routerLink).toBeInTheDocument(); + expect(routerLink).toHaveTextContent('Link'); + expect(routerLink).toHaveAttribute('href', '/route'); + }); + it('should set loading indicator on click', async () => { + const mockLoading = vi.fn(); + useLoadingIndicatorSpy.mockImplementation(() => ({ + loading: false, + setLoading: mockLoading, + })); + const { container } = render( + + + Link + + , + ); + + const routerLink = container.querySelector('a'); + expect(mockLoading).not.toHaveBeenCalled(); + act(() => { + if (routerLink) { + fireEvent.click(routerLink); + } + }); + expect(mockLoading).toHaveBeenCalled(); + }); + + it('should not set loading indicator when clicked on disabled link', async () => { + const mockLoading = vi.fn(); + useLoadingIndicatorSpy.mockImplementation(() => ({ + loading: false, + setLoading: mockLoading, + })); + const { container } = render( + + + + Link + + + , + ); + + const routerLink = container.querySelector('a'); + expect(mockLoading).not.toHaveBeenCalled(); + act(() => { + if (routerLink) { + fireEvent.click(routerLink); + } + }); + expect(mockLoading).not.toHaveBeenCalled(); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/components/links/OvhLink.component.tsx b/packages/manager/apps/pci-databases-analytics/src/components/links/OvhLink.component.tsx new file mode 100644 index 000000000000..541426114437 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/components/links/OvhLink.component.tsx @@ -0,0 +1,38 @@ +import * as React from 'react'; +import { useNavigation } from '@ovh-ux/manager-react-shell-client'; +import A from './A.component'; + +interface OvhLinkProps { + application: string; + path: string; + params?: Record; +} +function OvhLink({ + application, + path, + params = {}, + children, + ...props +}: React.AnchorHTMLAttributes & + OvhLinkProps & { disabled?: boolean }) { + const navigation = useNavigation(); + const [url, setUrl] = React.useState(''); + React.useEffect(() => { + const fetchUrl = async (urlParams: OvhLinkProps) => { + const goTo = (await navigation.getURL( + urlParams.application, + urlParams.path, + urlParams.params, + )) as string; + setUrl(goTo); + }; + fetchUrl({ application, path, params }); + }, [application, path, params, navigation]); + return ( + + {children} + + ); +} + +export default OvhLink; diff --git a/packages/manager/apps/pci-databases-analytics/src/components/links/OvhLink.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/components/links/OvhLink.spec.tsx new file mode 100644 index 000000000000..3fc02db92261 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/components/links/OvhLink.spec.tsx @@ -0,0 +1,27 @@ +import { render, screen, waitFor } from '@testing-library/react'; +import '@testing-library/jest-dom/vitest'; +import { vi } from 'vitest'; +import OvhLink from './OvhLink.component'; + +vi.mock('@ovh-ux/manager-react-shell-client', () => ({ + useNavigation: () => ({ + getURL: vi.fn((app: string, path: string) => `#mockedurl-${app}${path}`), + }), +})); + +describe('OvhLink component', () => { + afterEach(() => { + vi.clearAllMocks(); + }); + it('should render anchor element with href fetched from navigation', async () => { + render( + + Link + , + ); + const anchorElement = screen.getByText('Link'); + await waitFor(() => { + expect(anchorElement).toHaveAttribute('href', '#mockedurl-app/some-path'); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Loading/Loading.tsx b/packages/manager/apps/pci-databases-analytics/src/components/loading/Loading.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/components/Loading/Loading.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/loading/Loading.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/loading.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/loading/Loading.spec.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/loading.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/loading/Loading.spec.tsx index a6d48a588165..a6a91d99c966 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/loading.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/loading/Loading.spec.tsx @@ -1,6 +1,6 @@ import { render, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import Loading from '@/components/Loading/Loading'; +import Loading from '@/components/loading/Loading.component'; describe('Loading component', () => { it('should display the loading component', async () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Loading/ProgressLoader.tsx b/packages/manager/apps/pci-databases-analytics/src/components/loading/ProgressLoader.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/components/Loading/ProgressLoader.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/loading/ProgressLoader.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/progressLoader.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/loading/ProgressLoader.spec.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/progressLoader.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/loading/ProgressLoader.spec.tsx index f1447cd68855..d68bbef047da 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/progressLoader.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/loading/ProgressLoader.spec.tsx @@ -1,6 +1,6 @@ import { act, render, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import ProgressLoader from '@/components/Loading/ProgressLoader'; +import ProgressLoader from '@/components/loading/ProgressLoader.component'; describe('ProgressLoader component', () => { beforeEach(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-config/nodes-config.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/NodesConfig.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-config/nodes-config.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/NodesConfig.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/nodes-config.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/NodesConfig.spec.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/nodes-config.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/NodesConfig.spec.tsx index 322e5549644d..0f7ae91832bb 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/nodes-config.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/NodesConfig.spec.tsx @@ -6,7 +6,7 @@ import { waitFor, } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import NodesConfig from '@/components/Order/cluster-config/nodes-config'; +import NodesConfig from '@/components/order/cluster-configuration/NodesConfig.component'; describe('NodesConfig component', () => { afterEach(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-config/storage-config.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/StorageConfig.component.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-config/storage-config.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/StorageConfig.component.tsx index d006b7103dc8..8c04e315fb6a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-config/storage-config.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/StorageConfig.component.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next'; import { Label } from '@/components/ui/label'; import { Slider } from '@/components/ui/slider'; import { formatStorage } from '@/lib/bytesHelper'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; interface StorageConfigProps { availability: database.Availability; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/storage-config.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/StorageConfig.spec.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/storage-config.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/StorageConfig.spec.tsx index d25396bc4467..4738df1a331c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/storage-config.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-configuration/StorageConfig.spec.tsx @@ -1,6 +1,6 @@ import { render, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import StorageConfig from '@/components/Order/cluster-config/storage-config'; +import StorageConfig from '@/components/order/cluster-configuration/StorageConfig.component'; import { mockedAvailabilities, mockedAvailabilitiesUpdate, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/ips-restricitons-form.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/IpsRestricitonsForm.spec.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/ips-restricitons-form.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/IpsRestricitonsForm.spec.tsx index 7b2d3889767a..540fd84c154f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/ips-restricitons-form.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/IpsRestricitonsForm.spec.tsx @@ -6,9 +6,9 @@ import { waitFor, } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import IpsRestrictionsForm from '@/components/Order/cluster-options/ips-restrictions-form'; +import IpsRestrictionsForm from '@/components/order/cluster-options/IpsRestrictionsForm.component'; import { mockedOrderFunnelIps } from '@/__tests__/helpers/mocks/order-funnel'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; describe('IpsRestrictionsForm component', () => { afterEach(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-options/ips-restrictions-form.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/IpsRestrictionsForm.component.tsx similarity index 98% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-options/ips-restrictions-form.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/IpsRestrictionsForm.component.tsx index 496bbfe3147d..e8ecb64b8d7d 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-options/ips-restrictions-form.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/IpsRestrictionsForm.component.tsx @@ -6,7 +6,7 @@ import { MinusCircle, PlusCircle } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { Input } from '@/components/ui/input'; import { Button } from '@/components/ui/button'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Form, FormControl, diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-options/network-options.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/NetworkOptions.components.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-options/network-options.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/NetworkOptions.components.tsx index a63ce97baaf6..68e7a14d1b4c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/cluster-options/network-options.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/NetworkOptions.components.tsx @@ -5,9 +5,9 @@ import { Trans, useTranslation } from 'react-i18next'; import { useParams } from 'react-router-dom'; import { Label } from '@/components/ui/label'; import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; -import { Network, NetworkTypeEnum, Subnet } from '@/models/network'; -import { NetworkOptionValue } from '@/models/order-funnel'; -import { database } from '@/models/database'; +import { Network, NetworkTypeEnum, Subnet } from '@/types/cloud/network'; +import { NetworkOptionValue } from '@/types/orderFunnel'; +import * as database from '@/types/cloud/project/database'; import { Skeleton } from '@/components/ui/skeleton'; import { Select, @@ -17,7 +17,8 @@ import { SelectValue, } from '@/components/ui/select'; import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'; -import { A, OvhLink } from '@/components/links'; +import A from '@/components/links/A.component'; +import OvhLink from '@/components/links/OvhLink.component'; import { Popover, PopoverContent, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/network-options.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/NetworkOptions.spec.tsx similarity index 83% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/network-options.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/NetworkOptions.spec.tsx index 23c9b5cfa9df..ced2264ace61 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/network-options.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/cluster-options/NetworkOptions.spec.tsx @@ -1,17 +1,28 @@ import { render, renderHook, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import * as API from '@/api/network'; -import NetworkOptions from '@/components/Order/cluster-options/network-options'; +import * as API from '@/data/api/network/network.api'; +import NetworkOptions from '@/components/order/cluster-options/NetworkOptions.components'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; import { mockedNetworks, mockedSubnets, } from '@/__tests__/helpers/mocks/network'; -import { NetworkOptionValue } from '@/models/order-funnel'; -import { database } from '@/models/database'; -import { useGetNetwork, useGetSubnet } from '@/hooks/api/network.api.hooks'; +import { NetworkOptionValue } from '@/types/orderFunnel'; +import * as database from '@/types/cloud/project/database'; +import { useGetNetwork } from '@/hooks/api/network/useGetNetwork.hook'; +import { useGetSubnet } from '@/hooks/api/network/useGetSubnet.hook'; -vi.mock('@/api/network', () => ({ +vi.mock('react-i18next', async (importOriginal) => { + const mod = await importOriginal(); + return { + ...mod, + useTranslation: () => ({ + t: (key: string) => key, + }), + }; +}); + +vi.mock('@/data/api/network/network.api', () => ({ networkApi: { getPrivateNetworks: vi.fn(), getSubnets: vi.fn(), @@ -61,7 +72,6 @@ describe('NetworkOptions component', () => { await waitFor(() => { expect(screen.getByRole('radiogroup')).toBeInTheDocument(); - expect(screen.getByTestId('network-placeholder')).toBeInTheDocument(); expect(screen.queryByText('noNetworkFoundTitle')).not.toBeInTheDocument(); }); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/engine/engine-select.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineSelect.component.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/engine/engine-select.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineSelect.component.tsx index ba2059fd6138..452bdcc044e4 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/engine/engine-select.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineSelect.component.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Engine, EngineWithVersion, Version } from '@/models/order-funnel'; -import EngineTile from './engine-tile'; +import { Engine, EngineWithVersion, Version } from '@/types/orderFunnel'; +import EngineTile from './EngineTile.component'; interface EngineSelectProps { engines: Engine[]; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/engine-select.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineSelect.spec.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/engine-select.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineSelect.spec.tsx index 93b4cd387ebd..0f51eda6aec9 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/engine-select.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineSelect.spec.tsx @@ -6,9 +6,9 @@ import { waitFor, } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import EngineSelect from '@/components/Order/engine/engine-select'; +import EngineSelect from '@/components/order/engine/EngineSelect.component'; import { mockedOrderFunnelEngine } from '@/__tests__/helpers/mocks/order-funnel'; -import { Engine } from '@/models/order-funnel'; +import { Engine } from '@/types/orderFunnel'; describe('EngineSelect component', () => { afterEach(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/engine/engine-tile.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTile.component.tsx similarity index 90% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/engine/engine-tile.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTile.component.tsx index acb56f6d0317..d1363d681519 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/engine/engine-tile.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTile.component.tsx @@ -1,10 +1,10 @@ import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import RadioTile from '@/components/radio-tile'; -import VersionSelector from './engine-tile-version'; -import { Engine, Version } from '@/models/order-funnel'; +import RadioTile from '@/components/radio-tile/RadioTile.component'; +import VersionSelector from './EngineTileVersion.component'; +import { Engine, Version } from '@/types/orderFunnel'; import { humanizeEngine } from '@/lib/engineNameHelper'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Badge } from '@/components/ui/badge'; import { getTagVariant } from '@/lib/tagsHelper'; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/engine-tile.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTile.spec.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/engine-tile.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTile.spec.tsx index be18fcfef624..0ffb3cabdf85 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/engine-tile.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTile.spec.tsx @@ -6,7 +6,7 @@ import { waitFor, } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import EngineTile from '@/components/Order/engine/engine-tile'; +import EngineTile from '@/components/order/engine/EngineTile.component'; import { mockedEngineVersion, mockedOrderFunnelEngine, diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/engine/engine-tile-version.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTileVersion.component.tsx similarity index 98% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/engine/engine-tile-version.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTileVersion.component.tsx index f577747a0014..268a09ff2d1a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/engine/engine-tile-version.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTileVersion.component.tsx @@ -16,7 +16,7 @@ import { } from '@/components/ui/command'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; -import { Version } from '@/models/order-funnel'; +import { Version } from '@/types/orderFunnel'; import { getTagVariant } from '@/lib/tagsHelper'; import { cn } from '@/lib/utils'; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/engine-tile-version.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTileVersion.spec.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/engine-tile-version.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTileVersion.spec.tsx index af3285340c8a..b4935d1d2b55 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/engine-tile-version.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/engine/EngineTileVersion.spec.tsx @@ -1,6 +1,6 @@ import { render, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import VersionSelector from '@/components/Order/engine/engine-tile-version'; +import VersionSelector from '@/components/order/engine/EngineTileVersion.component'; import { mockedEngineVersion } from '@/__tests__/helpers/mocks/order-funnel'; describe('VersionSelector component', () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/error-list.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/error-list/ErrorList.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/error-list.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/error-list/ErrorList.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/error-list.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/error-list/ErrorList.spec.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/error-list.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/error-list/ErrorList.spec.tsx index 75f6758516fb..d60c332b43dc 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/error-list.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/error-list/ErrorList.spec.tsx @@ -1,7 +1,7 @@ import { FieldErrors } from 'react-hook-form'; import { render, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import ErrorList from '@/components/Order/error-list'; +import ErrorList from '@/components/order/error-list/ErrorList.component'; describe('ErrorList component', () => { afterEach(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/flavor/flavor-select.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/flavor/FlavorSelect.component.tsx similarity index 98% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/flavor/flavor-select.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/flavor/FlavorSelect.component.tsx index fc9a490e6367..78f936a9ac8f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/flavor/flavor-select.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/flavor/FlavorSelect.component.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import Price from '@/components/price'; +import Price from '@/components/price/Price.component'; import { Table, TableBody, @@ -10,7 +10,7 @@ import { TableRow, } from '@/components/ui/table'; import { formatStorage } from '@/lib/bytesHelper'; -import { Flavor } from '@/models/order-funnel'; +import { Flavor } from '@/types/orderFunnel'; import { Badge } from '@/components/ui/badge'; import { getTagVariant } from '@/lib/tagsHelper'; import { cn } from '@/lib/utils'; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/flavor-select.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/flavor/FlavorSelect.spec.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/flavor-select.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/flavor/FlavorSelect.spec.tsx index 97aaafcd2240..644ed0e4bf65 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/flavor-select.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/flavor/FlavorSelect.spec.tsx @@ -6,9 +6,9 @@ import { waitFor, } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import FlavorsSelect from '@/components/Order/flavor/flavor-select'; +import FlavorsSelect from '@/components/order/flavor/FlavorSelect.component'; import { mockedBasicOrderFunnelFlavor } from '@/__tests__/helpers/mocks/order-funnel'; -import { Flavor } from '@/models/order-funnel'; +import { Flavor } from '@/types/orderFunnel'; describe('FlavorsSelect component', () => { afterEach(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/plan/plan-select.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanSelect.component.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/plan/plan-select.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanSelect.component.tsx index 2f5642a2f3db..84b530732c05 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/plan/plan-select.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanSelect.component.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Plan } from '@/models/order-funnel'; -import PlanTile from './plan-tile'; +import { Plan } from '@/types/orderFunnel'; +import PlanTile from './PlanTile.component'; import { cn } from '@/lib/utils'; interface PlansSelectProps { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/plan-select.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanSelect.spec.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/plan-select.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanSelect.spec.tsx index ca9f744886b4..841951ec2749 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/plan-select.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanSelect.spec.tsx @@ -6,7 +6,7 @@ import { waitFor, } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import PlansSelect from '@/components/Order/plan/plan-select'; +import PlansSelect from '@/components/order/plan/PlanSelect.component'; import { mockedBasicOrderFunnelPlan } from '@/__tests__/helpers/mocks/order-funnel'; describe('PlansSelect component', () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/plan/plan-tile.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanTile.component.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/plan/plan-tile.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanTile.component.tsx index 86fbb3ac6194..52f7b2d71ed9 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/plan/plan-tile.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanTile.component.tsx @@ -1,9 +1,9 @@ import { useTranslation } from 'react-i18next'; -import Price from '@/components/price'; -import RadioTile from '@/components/radio-tile'; +import Price from '@/components/price/Price.component'; +import RadioTile from '@/components/radio-tile/RadioTile.component'; import { compareStorage, formatStorage } from '@/lib/bytesHelper'; -import { database } from '@/models/database'; -import { Plan } from '@/models/order-funnel'; +import * as database from '@/types/cloud/project/database'; +import { Plan } from '@/types/orderFunnel'; import { Badge } from '@/components/ui/badge'; import { getTagVariant } from '@/lib/tagsHelper'; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/plan-tile.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanTile.spec.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/plan-tile.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanTile.spec.tsx index affd2ec88030..3bd17262bb70 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/plan-tile.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/plan/PlanTile.spec.tsx @@ -6,9 +6,9 @@ import { waitFor, } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import { PlanTile } from '@/components/Order/plan/plan-tile'; +import { PlanTile } from '@/components/order/plan/PlanTile.component'; import { mockedBasicOrderFunnelPlan } from '@/__tests__/helpers/mocks/order-funnel'; -import { Plan } from '@/models/order-funnel'; +import { Plan } from '@/types/orderFunnel'; describe('PlanTile component', () => { afterEach(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/order-price.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/price/OrderPrice.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/order-price.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/price/OrderPrice.component.tsx index fb832eab7f6a..8f2d8965f618 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/order-price.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/price/OrderPrice.component.tsx @@ -1,5 +1,5 @@ import { useTranslation } from 'react-i18next'; -import Price from '@/components/price'; +import Price from '@/components/price/Price.component'; import { Pricing } from '@/lib/pricingHelper'; interface OrderPriceProps { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/order-price.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/price/OrderPrice.spec.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/order-price.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/price/OrderPrice.spec.tsx index 2e50177ad19c..bfdb603074ad 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/order-price.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/price/OrderPrice.spec.tsx @@ -1,6 +1,6 @@ import { render, screen, waitFor } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import OrderPrice from '@/components/Order/order-price'; +import OrderPrice from '@/components/order/price/OrderPrice.component'; describe('OrderPrice component', () => { afterEach(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/Order/region/region-select.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/region/RegionSelect.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/components/Order/region/region-select.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/region/RegionSelect.component.tsx index 90b288ddc8bc..0161492521ae 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/Order/region/region-select.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/region/RegionSelect.component.tsx @@ -1,8 +1,8 @@ import { useTranslation } from 'react-i18next'; import React, { useState } from 'react'; -import RadioTile from '@/components/radio-tile'; +import RadioTile from '@/components/radio-tile/RadioTile.component'; import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'; -import { Region } from '@/models/order-funnel'; +import { Region } from '@/types/orderFunnel'; import { Badge } from '@/components/ui/badge'; import { getTagVariant } from '@/lib/tagsHelper'; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/region-select.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/order/region/RegionSelect.spec.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/region-select.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/order/region/RegionSelect.spec.tsx index 4d1d4c5ca4a7..8c5fe1553df4 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/Order/region-select.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/order/region/RegionSelect.spec.tsx @@ -7,7 +7,7 @@ import { } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import RegionSelect from '@/components/Order/region/region-select'; +import RegionSelect from '@/components/order/region/RegionSelect.component'; import { mockedOrderFunnelRegion } from '@/__tests__/helpers/mocks/order-funnel'; describe('RegionSelect component', () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/PageLayout/PageLayout.tsx b/packages/manager/apps/pci-databases-analytics/src/components/page-layout/PageLayout.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/components/PageLayout/PageLayout.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/page-layout/PageLayout.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/pageLayout.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/page-layout/PageLayout.spec.tsx similarity index 82% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/pageLayout.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/page-layout/PageLayout.spec.tsx index 16150d2beb5a..2f33ab59aeae 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/pageLayout.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/page-layout/PageLayout.spec.tsx @@ -1,6 +1,6 @@ import { render, screen, waitFor } from '@testing-library/react'; import { describe, it } from 'vitest'; -import PageLayout from '@/components/PageLayout/PageLayout'; +import PageLayout from '@/components/page-layout/PageLayout.component'; describe('PageLayout component', () => { it('should display the page layout', async () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/price-unit-switch.tsx b/packages/manager/apps/pci-databases-analytics/src/components/price-unit-switch/PriceUnitSwitch.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/components/price-unit-switch.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/price-unit-switch/PriceUnitSwitch.component.tsx index 5daa9169328a..56a214fc8be2 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/price-unit-switch.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/price-unit-switch/PriceUnitSwitch.component.tsx @@ -1,6 +1,6 @@ import { useTranslation } from 'react-i18next'; import { cn } from '@/lib/utils'; -import { Button } from './ui/button'; +import { Button } from '@/components/ui/button'; interface PriceUnitSwitch { showMonthly: boolean; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/price-unit-switch.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/price-unit-switch/PriceUnitSwitch.spec.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/price-unit-switch.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/price-unit-switch/PriceUnitSwitch.spec.tsx index 65ccfcc4e813..2b4c8367c643 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/price-unit-switch.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/price-unit-switch/PriceUnitSwitch.spec.tsx @@ -1,7 +1,7 @@ import { render, screen, fireEvent } from '@testing-library/react'; import { vi } from 'vitest'; import '@testing-library/jest-dom/vitest'; -import PriceUnitSwitch from '@/components/price-unit-switch'; +import PriceUnitSwitch from '@/components/price-unit-switch/PriceUnitSwitch.component'; vi.mock('react-i18next', () => ({ useTranslation: () => ({ diff --git a/packages/manager/apps/pci-databases-analytics/src/components/price.tsx b/packages/manager/apps/pci-databases-analytics/src/components/price/Price.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/components/price.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/price/Price.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/price.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/price/Price.spec.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/price.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/price/Price.spec.tsx index e36f8f44741d..41d92d024925 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/price.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/price/Price.spec.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; import { vi } from 'vitest'; -import Price from '@/components/price'; +import Price from '@/components/price/Price.component'; vi.mock('react-i18next', () => ({ useTranslation: () => ({ diff --git a/packages/manager/apps/pci-databases-analytics/src/components/radio-tile.tsx b/packages/manager/apps/pci-databases-analytics/src/components/radio-tile/RadioTile.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/components/radio-tile.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/radio-tile/RadioTile.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/radio-tile.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/radio-tile/RadioTile.spec.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/radio-tile.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/radio-tile/RadioTile.spec.tsx index cb5c8f787b59..8d0cbe0a0e5f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/radio-tile.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/radio-tile/RadioTile.spec.tsx @@ -6,7 +6,7 @@ import { waitFor, } from '@testing-library/react'; import { describe, it, vi } from 'vitest'; -import RadioTile from '@/components/radio-tile'; +import RadioTile from '@/components/radio-tile/RadioTile.component'; describe('RadioTile component', () => { it('should display the radio tile', async () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/tabs-menu.tsx b/packages/manager/apps/pci-databases-analytics/src/components/tabs-menu/TabsMenu.component.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/components/tabs-menu.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/tabs-menu/TabsMenu.component.tsx index 90ecea26b442..41277d3eb7ab 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/tabs-menu.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/tabs-menu/TabsMenu.component.tsx @@ -1,8 +1,8 @@ import { useRef } from 'react'; -import { Skeleton } from './ui/skeleton'; -import { ScrollArea, ScrollBar } from './ui/scroll-area'; -import { NavLink } from './links'; -import { Badge } from './ui/badge'; +import { Skeleton } from '../ui/skeleton'; +import { ScrollArea, ScrollBar } from '../ui/scroll-area'; +import NavLink from '@/components/links/NavLink.component'; +import { Badge } from '../ui/badge'; export interface Tab { href: string; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/tabs-menu.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/tabs-menu/TabsMenu.spec.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/tabs-menu.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/tabs-menu/TabsMenu.spec.tsx index 9b652800d8dc..a2e043de8e1a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/tabs-menu.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/tabs-menu/TabsMenu.spec.tsx @@ -1,8 +1,8 @@ import { describe, it, expect, vi } from 'vitest'; import { render, screen, fireEvent, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import TabsMenu, { Tab } from '@/components/tabs-menu'; -import { RouterWithQueryClientWrapper } from '../helpers/wrappers/RouterWithQueryClientWrapper'; +import TabsMenu, { Tab } from '@/components/tabs-menu/TabsMenu.component'; +import { RouterWithQueryClientWrapper } from '../../__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; function setup(tabs: Tab[] = []) { return render(, { diff --git a/packages/manager/apps/pci-databases-analytics/src/components/tags-input.tsx b/packages/manager/apps/pci-databases-analytics/src/components/tags-input/TagsInput.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/components/tags-input.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/tags-input/TagsInput.component.tsx index 62c53d7379c2..83d58e2e18ff 100644 --- a/packages/manager/apps/pci-databases-analytics/src/components/tags-input.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/tags-input/TagsInput.component.tsx @@ -3,9 +3,15 @@ import { z } from 'zod'; import { X, PlusCircle } from 'lucide-react'; import { useForm, SubmitHandler } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; -import { Input } from './ui/input'; -import { Form, FormControl, FormField, FormItem, FormMessage } from './ui/form'; -import { Button } from './ui/button'; +import { Input } from '../ui/input'; +import { + Form, + FormControl, + FormField, + FormItem, + FormMessage, +} from '../ui/form'; +import { Button } from '../ui/button'; interface TagsInputProps { value: string[]; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/tags-input.test.tsx b/packages/manager/apps/pci-databases-analytics/src/components/tags-input/TagsInput.spec.tsx similarity index 99% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/components/tags-input.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/components/tags-input/TagsInput.spec.tsx index a056e868faed..9fa4482246da 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/components/tags-input.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/components/tags-input/TagsInput.spec.tsx @@ -6,7 +6,7 @@ import { act, } from '@testing-library/react'; import { vi } from 'vitest'; -import TagsInput from '@/components/tags-input'; +import TagsInput from '@/components/tags-input/TagsInput.component'; describe('TagsInput component', () => { it('should render correctly with initial tags', () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/configuration/polling.ts b/packages/manager/apps/pci-databases-analytics/src/configuration/polling.constants.ts similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/configuration/polling.ts rename to packages/manager/apps/pci-databases-analytics/src/configuration/polling.constants.ts diff --git a/packages/manager/apps/pci-databases-analytics/src/configuration/toast.ts b/packages/manager/apps/pci-databases-analytics/src/configuration/toast.constants.ts similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/configuration/toast.ts rename to packages/manager/apps/pci-databases-analytics/src/configuration/toast.constants.ts diff --git a/packages/manager/apps/pci-databases-analytics/src/configuration/tracking.ts b/packages/manager/apps/pci-databases-analytics/src/configuration/tracking.constants.ts similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/configuration/tracking.ts rename to packages/manager/apps/pci-databases-analytics/src/configuration/tracking.constants.ts index 4f03bbbe6c4f..a80faf5fa378 100644 --- a/packages/manager/apps/pci-databases-analytics/src/configuration/tracking.ts +++ b/packages/manager/apps/pci-databases-analytics/src/configuration/tracking.constants.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; const APP_TRACKING_PREFIX = 'PublicCloud::databases_analytics::databases'; export const PCI_LEVEL2 = '86'; diff --git a/packages/manager/apps/pci-databases-analytics/src/contexts/loadingIndicatorContext.tsx b/packages/manager/apps/pci-databases-analytics/src/contexts/LoadingIndicator.context.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/contexts/loadingIndicatorContext.tsx rename to packages/manager/apps/pci-databases-analytics/src/contexts/LoadingIndicator.context.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/contexts/userActivityContext.tsx b/packages/manager/apps/pci-databases-analytics/src/contexts/UserActivityContext.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/contexts/userActivityContext.tsx rename to packages/manager/apps/pci-databases-analytics/src/contexts/UserActivityContext.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/api/catalog.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/catalog/catalog.api.ts similarity index 89% rename from packages/manager/apps/pci-databases-analytics/src/api/catalog.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/catalog/catalog.api.ts index 007a5cc15140..a8d137a62c65 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/catalog.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/catalog/catalog.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { order } from '@/models/catalog'; +import { order } from '@/types/catalog'; export const catalogApi = { getCatalog: async (subsidiary = 'FR', productName = 'cloud') => diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/catalog.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/catalog/catalog.spec.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/catalog.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/catalog/catalog.spec.tsx index 1759b0c5578d..e193a5214f30 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/catalog.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/catalog/catalog.spec.tsx @@ -1,6 +1,6 @@ import { describe, expect, vi } from 'vitest'; import { apiClient } from '@ovh-ux/manager-core-api'; -import { catalogApi } from '@/api/catalog'; +import { catalogApi } from '@/data/api/catalog/catalog.api'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/advancedConfiguration.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/advancedConfiguration.api.ts similarity index 84% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/advancedConfiguration.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/advancedConfiguration.api.ts index bc5b9150b919..7581f0719659 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/advancedConfiguration.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/advancedConfiguration.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; export const getAdvancedConfiguration = async ({ @@ -32,15 +32,15 @@ export const getAdvancedConfigurationCapabilities = async ({ res.data as database.capabilities.advancedConfiguration.Property[], ); -export interface UpdateAdvancedConfigurationProps extends ServiceData { +export interface EditAdvancedConfiguration extends ServiceData { advancedConfiguration: Record; } -export const updateAdvancedConfiguration = async ({ +export const editAdvancedConfiguration = async ({ projectId, engine, serviceId, advancedConfiguration, -}: UpdateAdvancedConfigurationProps) => +}: EditAdvancedConfiguration) => apiClient.v6 .put( `/cloud/project/${projectId}/database/${engine}/${serviceId}/advancedConfiguration`, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/advancedConfiguration.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/advancedConfiguration.spec.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/advancedConfiguration.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/advancedConfiguration.spec.tsx index d5484261c35c..c071bfd972b9 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/advancedConfiguration.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/advancedConfiguration.spec.tsx @@ -3,9 +3,9 @@ import { apiClient } from '@ovh-ux/manager-core-api'; import { getAdvancedConfiguration, getAdvancedConfigurationCapabilities, - updateAdvancedConfiguration, -} from '@/api/databases/advancedConfiguration'; -import { database } from '@/models/database'; + editAdvancedConfiguration, +} from '@/data/api/database/advancedConfiguration.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { @@ -59,7 +59,7 @@ describe('database api advanced configuration', () => { it('should call put advancedConfiguration', async () => { expect(apiClient.v6.put).not.toHaveBeenCalled(); - updateAdvancedConfiguration({ + editAdvancedConfiguration({ ...data, advancedConfiguration: { foo: 'bar', diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/availabilities.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/availability.api.ts similarity index 64% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/availabilities.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/availability.api.ts index b8f232ef3b30..7635061688aa 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/availabilities.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/availability.api.ts @@ -1,9 +1,9 @@ import { apiClient } from '@ovh-ux/manager-core-api'; import QueryString from 'qs'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { PCIData } from '.'; -interface GetAvailabilitiesProps extends PCIData { +interface GetAvailabilities extends PCIData { status?: database.availability.StatusEnum[]; serviceId?: string; action?: database.availability.ActionEnum; @@ -18,7 +18,7 @@ export const getAvailabilities = async ({ serviceId, action, target, -}: GetAvailabilitiesProps) => { +}: GetAvailabilities) => { const headers: Record = { 'X-Pagination-Mode': 'CachedObjectList-Pages', 'X-Pagination-Size': '50000', @@ -49,19 +49,4 @@ export const getAvailabilities = async ({ export const getSuggestions = async (projectId: string) => apiClient.v6 .get(`/cloud/project/${projectId}/database/availability/suggestion`) - .then((res) => res.data as database.Suggestion[]); - -export const getCapabilities = async (projectId: string) => - apiClient.v6 - .get(`/cloud/project/${projectId}/database/capabilities`) - .then((res) => res.data as database.Capabilities); - -export const getEnginesCapabilities = async (projectId: string) => - apiClient.v6 - .get(`/cloud/project/${projectId}/database/capabilities/engines`) - .then((res) => res.data as database.EngineCapabilities[]); - -export const getRegionsCapabilities = async (projectId: string) => - apiClient.v6 - .get(`/cloud/project/${projectId}/database/capabilities/regions`) - .then((res) => res.data as database.RegionCapabilities[]); + .then((res) => res.data as database.availability.Suggestion[]); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/availabilities.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/availability.spec.tsx similarity index 75% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/availabilities.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/availability.spec.tsx index 4148756c0fd7..581b8c468039 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/availabilities.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/availability.spec.tsx @@ -3,11 +3,8 @@ import { describe, expect, vi } from 'vitest'; import { getAvailabilities, getSuggestions, - getCapabilities, - getEnginesCapabilities, - getRegionsCapabilities, -} from '@/api/databases/availabilities'; -import { database } from '@/models/database'; +} from '@/data/api/database/availability.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { @@ -99,28 +96,4 @@ describe('availabilities api functions', () => { '/cloud/project/projectId/database/availability/suggestion', ); }); - - it('should call getCapabilities', async () => { - expect(apiClient.v6.get).not.toHaveBeenCalled(); - await getCapabilities('projectId'); - expect(apiClient.v6.get).toHaveBeenCalledWith( - '/cloud/project/projectId/database/capabilities', - ); - }); - - it('should call getEnginesCapabilities', async () => { - expect(apiClient.v6.get).not.toHaveBeenCalled(); - await getEnginesCapabilities('projectId'); - expect(apiClient.v6.get).toHaveBeenCalledWith( - '/cloud/project/projectId/database/capabilities/engines', - ); - }); - - it('should call getRegionsCapabilities', async () => { - expect(apiClient.v6.get).not.toHaveBeenCalled(); - await getRegionsCapabilities('projectId'); - expect(apiClient.v6.get).toHaveBeenCalledWith( - '/cloud/project/projectId/database/capabilities/regions', - ); - }); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/backups.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/backup.api.ts similarity index 88% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/backups.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/backup.api.ts index 7d2c2c479528..8cb0bfbaceeb 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/backups.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/backup.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; export const getServiceBackups = async ({ @@ -17,7 +17,7 @@ export const getServiceBackups = async ({ }) .then((res) => res.data as database.Backup[]); -export interface RestoreBackupProps extends ServiceData { +export interface RestoreBackup extends ServiceData { backupId?: string; restore?: database.service.Restore; } @@ -27,7 +27,7 @@ export const restoreBackup = async ({ serviceId, backupId, restore, -}: RestoreBackupProps) => { +}: RestoreBackup) => { if (backupId) { return apiClient.v6 .post( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/backups.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/backup.spec.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/backups.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/backup.spec.tsx index 08838dceb05d..4979d8e115ff 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/backups.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/backup.spec.tsx @@ -1,7 +1,10 @@ import { apiClient } from '@ovh-ux/manager-core-api'; import { describe, expect, vi } from 'vitest'; -import { getServiceBackups, restoreBackup } from '@/api/databases/backups'; -import { database } from '@/models/database'; +import { + getServiceBackups, + restoreBackup, +} from '@/data/api/database/backup.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/data/api/database/capabilities.api.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/capabilities.api.ts new file mode 100644 index 000000000000..8784826bfe13 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/capabilities.api.ts @@ -0,0 +1,17 @@ +import { apiClient } from '@ovh-ux/manager-core-api'; +import * as database from '@/types/cloud/project/database'; + +export const getCapabilities = async (projectId: string) => + apiClient.v6 + .get(`/cloud/project/${projectId}/database/capabilities`) + .then((res) => res.data as database.Capabilities); + +export const getEnginesCapabilities = async (projectId: string) => + apiClient.v6 + .get(`/cloud/project/${projectId}/database/capabilities/engines`) + .then((res) => res.data as database.capabilities.EngineCapabilities[]); + +export const getRegionsCapabilities = async (projectId: string) => + apiClient.v6 + .get(`/cloud/project/${projectId}/database/capabilities/regions`) + .then((res) => res.data as database.capabilities.RegionCapabilities[]); diff --git a/packages/manager/apps/pci-databases-analytics/src/data/api/database/capabilities.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/capabilities.spec.tsx new file mode 100644 index 000000000000..7ed02659f9b4 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/capabilities.spec.tsx @@ -0,0 +1,50 @@ +import { apiClient } from '@ovh-ux/manager-core-api'; +import { describe, expect, vi } from 'vitest'; +import { + getCapabilities, + getEnginesCapabilities, + getRegionsCapabilities, +} from './capabilities.api'; + +vi.mock('@ovh-ux/manager-core-api', () => { + const get = vi.fn(() => { + return Promise.resolve({ data: null }); + }); + return { + apiClient: { + v6: { + get, + }, + }, + }; +}); + +describe('capabilities api functions', () => { + afterEach(() => { + vi.clearAllMocks(); + }); + + it('should call getCapabilities', async () => { + expect(apiClient.v6.get).not.toHaveBeenCalled(); + await getCapabilities('projectId'); + expect(apiClient.v6.get).toHaveBeenCalledWith( + '/cloud/project/projectId/database/capabilities', + ); + }); + + it('should call getEnginesCapabilities', async () => { + expect(apiClient.v6.get).not.toHaveBeenCalled(); + await getEnginesCapabilities('projectId'); + expect(apiClient.v6.get).toHaveBeenCalledWith( + '/cloud/project/projectId/database/capabilities/engines', + ); + }); + + it('should call getRegionsCapabilities', async () => { + expect(apiClient.v6.get).not.toHaveBeenCalled(); + await getRegionsCapabilities('projectId'); + expect(apiClient.v6.get).toHaveBeenCalledWith( + '/cloud/project/projectId/database/capabilities/regions', + ); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/certificates.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/certificate.api.ts similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/certificates.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/certificate.api.ts index 0ffee94b9102..2291057b0695 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/certificates.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/certificate.api.ts @@ -1,7 +1,6 @@ import { apiClient } from '@ovh-ux/manager-core-api'; - import { ServiceData } from '.'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const getCertificate = async ({ projectId, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/certificates.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/certificate.spec.tsx similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/certificates.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/certificate.spec.tsx index dc832a294d4a..962e0140e15e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/certificates.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/certificate.spec.tsx @@ -1,7 +1,7 @@ import { apiClient } from '@ovh-ux/manager-core-api'; import { describe, expect, vi } from 'vitest'; -import { getCertificate } from '@/api/databases/certificates'; -import { database } from '@/models/database'; +import { getCertificate } from '@/data/api/database/certificate.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/connectionPool.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/connectionPool.api.ts similarity index 80% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/connectionPool.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/connectionPool.api.ts index 3489f41904e2..dec9ced768e0 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/connectionPool.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/connectionPool.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; export const getConnectionPools = async ({ @@ -20,8 +20,8 @@ export const getConnectionPools = async ({ ) .then((res) => res.data as database.postgresql.ConnectionPool[]); -export interface AddConnectionPoolProps extends ServiceData { - connectionPool: database.postgresql.ConnectionPoolCreation; +export interface AddConnectionPool extends ServiceData { + connectionPool: Partial; } export const addConnectionPool = async ({ @@ -29,7 +29,7 @@ export const addConnectionPool = async ({ engine, serviceId, connectionPool, -}: AddConnectionPoolProps) => +}: AddConnectionPool) => apiClient.v6 .post( `/cloud/project/${projectId}/database/${engine}/${serviceId}/connectionPool`, @@ -42,7 +42,7 @@ export type ConnectionPoolEdition = Omit< 'name' | 'port' | 'uri' >; -export interface EditConnectionPoolProps extends ServiceData { +export interface EditConnectionPool extends ServiceData { connectionPool: ConnectionPoolEdition; } @@ -51,7 +51,7 @@ export const editConnectionPool = async ({ engine, serviceId, connectionPool, -}: EditConnectionPoolProps) => { +}: EditConnectionPool) => { const { id, ...body } = connectionPool; return apiClient.v6 .put( @@ -61,7 +61,7 @@ export const editConnectionPool = async ({ .then((res) => res.data as database.postgresql.ConnectionPool); }; -export interface DeleteConnectionPoolProps extends ServiceData { +export interface DeleteConnectionPool extends ServiceData { connectionPoolId: string; } export const deleteConnectionPool = async ({ @@ -69,7 +69,7 @@ export const deleteConnectionPool = async ({ engine, serviceId, connectionPoolId, -}: DeleteConnectionPoolProps) => +}: DeleteConnectionPool) => apiClient.v6.delete( `/cloud/project/${projectId}/database/${engine}/${serviceId}/connectionPool/${connectionPoolId}`, ); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/connectionPool.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/connectionPool.spec.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/connectionPool.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/connectionPool.spec.tsx index f868afe93ae3..bf96886284c2 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/connectionPool.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/connectionPool.spec.tsx @@ -5,8 +5,8 @@ import { addConnectionPool, editConnectionPool, deleteConnectionPool, -} from '@/api/databases/connectionPool'; -import { database } from '@/models/database'; +} from '@/data/api/database/connectionPool.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/databases.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/database.api.ts similarity index 83% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/databases.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/database.api.ts index e46d385cb4cf..e838fd63989c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/databases.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/database.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; export const getServiceDatabases = async ({ @@ -20,7 +20,7 @@ export const getServiceDatabases = async ({ ) .then((res) => res.data as database.service.Database[]); -export interface AddDatabaseProps extends ServiceData { +export interface AddDatabase extends ServiceData { name: string; } export const addDatabase = async ({ @@ -28,7 +28,7 @@ export const addDatabase = async ({ engine, serviceId, name, -}: AddDatabaseProps) => +}: AddDatabase) => apiClient.v6 .post( `/cloud/project/${projectId}/database/${engine}/${serviceId}/database`, @@ -38,7 +38,7 @@ export const addDatabase = async ({ ) .then((res) => res.data as database.service.Database); -export interface DeleteDatabaseProps extends ServiceData { +export interface DeleteDatabase extends ServiceData { databaseId: string; } export const deleteDatabase = async ({ @@ -46,7 +46,7 @@ export const deleteDatabase = async ({ engine, projectId, serviceId, -}: DeleteDatabaseProps) => +}: DeleteDatabase) => apiClient.v6.delete( `/cloud/project/${projectId}/database/${engine}/${serviceId}/database/${databaseId}`, ); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/databases.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/database.spec.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/databases.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/database.spec.tsx index 9bc4853a7b69..cfd6d72c36d2 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/databases.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/database.spec.tsx @@ -4,8 +4,8 @@ import { getServiceDatabases, addDatabase, deleteDatabase, -} from '@/api/databases/databases'; -import { database } from '@/models/database'; +} from '@/data/api/database/database.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/index.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/index.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/index.tsx index 8bfa827bf71d..d5bcd78e1f87 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/index.tsx @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export interface PCIData { projectId: string; diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/integrations.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/integration.api.ts similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/integrations.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/integration.api.ts index 81a9ccff5e55..00009a43932a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/integrations.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/integration.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; export const getServiceIntegrations = async ({ @@ -38,7 +38,7 @@ export const getServiceCapabilitiesIntegrations = async ({ ) .then((res) => res.data as database.capabilities.Integration[]); -export interface AddIntegrationProps extends ServiceData { +export interface AddIntegration extends ServiceData { integration: Omit; } export const addIntegration = async ({ @@ -46,7 +46,7 @@ export const addIntegration = async ({ engine, serviceId, integration, -}: AddIntegrationProps) => +}: AddIntegration) => apiClient.v6 .post( `/cloud/project/${projectId}/database/${engine}/${serviceId}/integration`, @@ -54,7 +54,7 @@ export const addIntegration = async ({ ) .then((res) => res.data as database.service.Integration); -export interface DeleteIntegrationProps extends ServiceData { +export interface DeleteIntegration extends ServiceData { integrationId: string; } export const deleteIntegration = async ({ @@ -62,7 +62,7 @@ export const deleteIntegration = async ({ engine, projectId, serviceId, -}: DeleteIntegrationProps) => +}: DeleteIntegration) => apiClient.v6.delete( `/cloud/project/${projectId}/database/${engine}/${serviceId}/integration/${integrationId}`, ); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/integrations.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/integration.spec.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/integrations.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/integration.spec.tsx index c951626c0035..65f7035ecc55 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/integrations.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/integration.spec.tsx @@ -5,8 +5,8 @@ import { getServiceCapabilitiesIntegrations, addIntegration, deleteIntegration, -} from '@/api/databases/integrations'; -import { database } from '@/models/database'; +} from '@/data/api/database/integration.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/logs.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/logs.api.ts similarity index 84% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/logs.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/logs.api.ts index 6bab4a013109..1134edbf02dc 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/logs.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/logs.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; export const getServiceLogs = async ({ diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/logs.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/logs.spec.tsx similarity index 86% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/logs.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/logs.spec.tsx index f4ac0c2382d8..53564d59290e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/logs.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/logs.spec.tsx @@ -1,7 +1,7 @@ import { apiClient } from '@ovh-ux/manager-core-api'; import { describe, expect, vi } from 'vitest'; -import { getServiceLogs } from '@/api/databases/logs'; -import { database } from '@/models/database'; +import { getServiceLogs } from '@/data/api/database/logs.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/maintenances.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/maintenance.api.ts similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/maintenances.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/maintenance.api.ts index 63c47e607986..c0f7017ee158 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/maintenances.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/maintenance.api.ts @@ -1,6 +1,6 @@ import { apiClient } from '@ovh-ux/manager-core-api'; import { ServiceData } from '.'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const getMaintenances = async ({ projectId, @@ -20,7 +20,7 @@ export const getMaintenances = async ({ ) .then((res) => res.data as database.service.Maintenance[]); -export interface ApplyMaintenanceProps extends ServiceData { +export interface ApplyMaintenance extends ServiceData { maintenanceId: string; } @@ -29,7 +29,7 @@ export const applyMaintenance = async ({ engine, serviceId, maintenanceId, -}: ApplyMaintenanceProps) => +}: ApplyMaintenance) => apiClient.v6 .post( `/cloud/project/${projectId}/database/${engine}/${serviceId}/maintenance/${maintenanceId}/apply`, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/maintenances.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/maintenance.spec.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/maintenances.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/maintenance.spec.tsx index 073e6886098a..8d4a231cafa8 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/maintenances.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/maintenance.spec.tsx @@ -3,8 +3,8 @@ import { describe, expect, vi } from 'vitest'; import { getMaintenances, applyMaintenance, -} from '@/api/databases/maintenances'; -import { database } from '@/models/database'; +} from '@/data/api/database/maintenance.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/metrics.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/metric.api.ts similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/metrics.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/metric.api.ts index 906c21e2dbd7..d5f07b35f8b4 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/metrics.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/metric.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; export const getMetrics = async ({ @@ -13,7 +13,7 @@ export const getMetrics = async ({ ) .then((res) => res.data as string[]); -interface GetMetricProps extends ServiceData { +interface GetMetric extends ServiceData { metric: string; period: database.service.MetricPeriodEnum; } @@ -23,7 +23,7 @@ export const getMetric = async ({ serviceId, metric, period, -}: GetMetricProps) => +}: GetMetric) => apiClient.v6 .get( `/cloud/project/${projectId}/database/${engine}/${serviceId}/metric/${metric}?period=${period}`, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/metrics.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/metric.spec.tsx similarity index 90% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/metrics.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/metric.spec.tsx index f637d3b5401b..9a492bf14788 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/metrics.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/metric.spec.tsx @@ -1,7 +1,7 @@ import { apiClient } from '@ovh-ux/manager-core-api'; import { describe, expect, vi } from 'vitest'; -import { getMetrics, getMetric } from '@/api/databases/metrics'; -import { database } from '@/models/database'; +import { getMetrics, getMetric } from '@/data/api/database/metric.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/namespaces.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/namespace.api.ts similarity index 83% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/namespaces.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/namespace.api.ts index 9990f0d24a64..eda314a64f74 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/namespaces.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/namespace.api.ts @@ -1,6 +1,6 @@ import { apiClient } from '@ovh-ux/manager-core-api'; import { ServiceData } from '.'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const getNamespaces = async ({ projectId, @@ -20,7 +20,7 @@ export const getNamespaces = async ({ ) .then((res) => res.data as database.m3db.Namespace[]); -export interface AddNamespaceProps extends ServiceData { +export interface AddNamespace extends ServiceData { namespace: database.m3db.NamespaceCreation; } @@ -29,7 +29,7 @@ export const addNamespace = async ({ engine, serviceId, namespace, -}: AddNamespaceProps) => +}: AddNamespace) => apiClient.v6 .post( `/cloud/project/${projectId}/database/${engine}/${serviceId}/namespace`, @@ -38,7 +38,7 @@ export const addNamespace = async ({ .then((res) => res.data as database.m3db.Namespace); export type NamespaceEdition = Omit; -export interface EditNamespaceProps extends ServiceData { +export interface EditNamespace extends ServiceData { namespace: NamespaceEdition; } @@ -47,7 +47,7 @@ export const editNamespace = async ({ engine, serviceId, namespace, -}: EditNamespaceProps) => { +}: EditNamespace) => { const { id, ...body } = namespace; return apiClient.v6 .put( @@ -57,7 +57,7 @@ export const editNamespace = async ({ .then((res) => res.data as database.m3db.Namespace); }; -export interface DeleteNamespaceProps extends ServiceData { +export interface DeleteNamespace extends ServiceData { namespaceId: string; } @@ -66,7 +66,7 @@ export const deleteNamespace = async ({ engine, serviceId, namespaceId, -}: DeleteNamespaceProps) => +}: DeleteNamespace) => apiClient.v6.delete( `/cloud/project/${projectId}/database/${engine}/${serviceId}/namespace/${namespaceId}`, ); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/namespaces.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/namespace.spec.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/namespaces.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/namespace.spec.tsx index 3def77d0a474..6f5c70340167 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/namespaces.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/namespace.spec.tsx @@ -5,8 +5,8 @@ import { addNamespace, editNamespace, deleteNamespace, -} from '@/api/databases/namespaces'; -import { database } from '@/models/database'; +} from '@/data/api/database/namespace.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/nodes.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/node.api.ts similarity index 69% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/nodes.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/node.api.ts index eb0e0c2d3b2f..f022878a7c94 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/nodes.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/node.api.ts @@ -1,16 +1,16 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; -export interface AddNodeProps extends ServiceData { - node: database.service.NodeCreation; +export interface AddNode extends ServiceData { + node: Partial; } export const addNode = async ({ projectId, engine, serviceId, node, -}: AddNodeProps) => +}: AddNode) => apiClient.v6 .post( `/cloud/project/${projectId}/database/${engine}/${serviceId}/node`, @@ -18,7 +18,7 @@ export const addNode = async ({ ) .then((res) => res.data as database.service.Node); -export interface DeleteNodeProps extends ServiceData { +export interface DeleteNode extends ServiceData { nodeId: string; } export const deleteNode = async ({ @@ -26,7 +26,7 @@ export const deleteNode = async ({ engine, serviceId, nodeId, -}: DeleteNodeProps) => +}: DeleteNode) => apiClient.v6.delete( `/cloud/project/${projectId}/database/${engine}/${serviceId}/node/${nodeId}`, ); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/nodes.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/node.spec.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/nodes.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/node.spec.tsx index b21306d72089..065cddeb5b71 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/nodes.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/node.spec.tsx @@ -1,7 +1,7 @@ import { apiClient } from '@ovh-ux/manager-core-api'; import { describe, expect, vi } from 'vitest'; -import { addNode, deleteNode } from '@/api/databases/nodes'; -import { database } from '@/models/database'; +import { addNode, deleteNode } from '@/data/api/database/node.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const post = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/queries.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/queries.api.ts similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/queries.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/queries.api.ts index 1afb15ff6a53..93b1281a8b39 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/queries.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/queries.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; export const getCurrentQueries = async ({ @@ -13,7 +13,7 @@ export const getCurrentQueries = async ({ ) .then((res) => res.data.queries as database.service.currentqueries.Query[]); -export interface CancelQueryProps extends ServiceData { +export interface CancelQuery extends ServiceData { pid: number; terminate: boolean; } @@ -23,7 +23,7 @@ export const cancelCurrentQuery = async ({ serviceId, pid, terminate, -}: CancelQueryProps) => +}: CancelQuery) => apiClient.v6 .post( `/cloud/project/${projectId}/database/${engine}/${serviceId}/currentQueries/cancel`, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/queries.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/queries.spec.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/queries.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/queries.spec.tsx index 4d291c54deb5..2693fb4ec3dc 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/queries.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/queries.spec.tsx @@ -5,8 +5,8 @@ import { cancelCurrentQuery, getQueryStatistics, resetQueryStatistics, -} from '@/api/databases/queries'; -import { database } from '@/models/database'; +} from '@/data/api/database/queries.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/service.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/service.api.ts similarity index 84% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/service.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/service.api.ts index e54a93a455fb..1d9fd753b446 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/service.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/service.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { PCIData, ServiceData } from '.'; export const getServices = async ({ projectId }: PCIData) => @@ -21,20 +21,20 @@ export const getService = async ({ .get(`/cloud/project/${projectId}/database/service/${serviceId}`) .then((res) => res.data as database.Service); -interface AddServiceProps extends Omit { - serviceInfo: database.ServiceCreation; +interface AddService extends Omit { + serviceInfo: Partial; } export const addService = async ({ projectId, engine, serviceInfo, -}: AddServiceProps) => +}: AddService) => apiClient.v6 .post(`/cloud/project/${projectId}/database/${engine}`, serviceInfo) .then((res) => res.data as database.Service); // define which values can be updated in the update service endpoint -export interface UpdateServiceProps extends ServiceData { +export interface EditService extends ServiceData { data: Partial< Pick< database.Service, @@ -52,12 +52,12 @@ export interface UpdateServiceProps extends ServiceData { >; } -export const updateService = async ({ +export const editService = async ({ projectId, engine, serviceId, data, -}: UpdateServiceProps) => +}: EditService) => apiClient.v6 .put(`/cloud/project/${projectId}/database/${engine}/${serviceId}`, data) .then((res) => res.data as database.Service); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/services.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/service.spec.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/services.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/service.spec.tsx index d034200cb100..3c274bf406c5 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/services.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/service.spec.tsx @@ -4,10 +4,10 @@ import { getServices, getService, addService, - updateService, + editService, deleteService, -} from '@/api/databases/service'; -import { database } from '@/models/database'; +} from '@/data/api/database/service.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { @@ -88,9 +88,9 @@ describe('database service functions', () => { ); }); - it('should call updateService', async () => { + it('should call editService', async () => { expect(apiClient.v6.put).not.toHaveBeenCalled(); - await updateService({ + await editService({ projectId: 'projectId', engine: database.EngineEnum.mongodb, serviceId: 'serviceId', diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/users.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/database/user.api.ts similarity index 90% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/users.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/user.api.ts index f2d7d3d6c0ca..8a816f33eaf2 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/users.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/user.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { ServiceData } from '.'; export type GenericUser = @@ -57,7 +57,7 @@ export type UserCreation = | database.redis.UserCreation | database.opensearch.UserCreation | database.m3db.UserCreation; -export interface AddUserProps extends ServiceData { +export interface AddUser extends ServiceData { user: UserCreation; } export const addUser = async ({ @@ -65,7 +65,7 @@ export const addUser = async ({ engine, serviceId, user, -}: AddUserProps) => +}: AddUser) => apiClient.v6 .post( `/cloud/project/${projectId}/database/${engine}/${serviceId}/user`, @@ -73,7 +73,7 @@ export const addUser = async ({ ) .then((res) => res.data as GenericUser); -export interface DeleteUserProps extends ServiceData { +export interface DeleteUser extends ServiceData { userId: string; } export const deleteUser = async ({ @@ -81,12 +81,12 @@ export const deleteUser = async ({ engine, serviceId, userId, -}: DeleteUserProps) => +}: DeleteUser) => apiClient.v6.delete( `/cloud/project/${projectId}/database/${engine}/${serviceId}/user/${userId}`, ); -export interface ResetUserPasswordProps extends ServiceData { +export interface ResetUserPassword extends ServiceData { userId: string; } export const resetUserPassword = async ({ @@ -94,7 +94,7 @@ export const resetUserPassword = async ({ engine, serviceId, userId, -}: ResetUserPasswordProps) => +}: ResetUserPassword) => apiClient.v6 .post( `/cloud/project/${projectId}/database/${engine}/${serviceId}/user/${userId}/credentials/reset`, @@ -116,7 +116,7 @@ export const getRoles = async ({ export type UserEdition = Omit; -export interface EditUserProps extends ServiceData { +export interface EditUser extends ServiceData { user: UserEdition; } @@ -125,7 +125,7 @@ export const editUser = async ({ engine, serviceId, user, -}: EditUserProps) => { +}: EditUser) => { const { id, ...body } = user; return apiClient.v6 .put( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/users.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/database/user.spec.tsx similarity index 98% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/users.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/database/user.spec.tsx index 7f171c064cfb..1036f21d3b74 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/databases/users.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/database/user.spec.tsx @@ -7,8 +7,8 @@ import { resetUserPassword, getRoles, editUser, -} from '@/api/databases/users'; -import { database } from '@/models/database'; +} from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/api/databases/guides.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/guides/guides.api.ts similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/api/databases/guides.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/guides/guides.api.ts index 5328275fd523..287fe85bd280 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/databases/guides.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/guides/guides.api.ts @@ -1,5 +1,5 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { Guide } from '@/models/guide'; +import { Guide } from '@/types/guide'; interface GetGuidesProps { section?: string; diff --git a/packages/manager/apps/pci-databases-analytics/src/api/network.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/network/network.api.ts similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/api/network.ts rename to packages/manager/apps/pci-databases-analytics/src/data/api/network/network.api.ts index 0fbd3c540445..2d4bff2a3d46 100644 --- a/packages/manager/apps/pci-databases-analytics/src/api/network.ts +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/network/network.api.ts @@ -1,5 +1,6 @@ import { apiClient } from '@ovh-ux/manager-core-api'; -import { Network, Subnet, Vrack } from '@/models/network'; +import { Network, Subnet } from '@/types/cloud/network'; +import { Vrack } from '@/types/cloud/Vrack'; export const networkApi = { getPrivateNetworks: async (projectId: string) => diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/network.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/network/network.spec.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/network.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/network/network.spec.tsx index e206bdc82610..f70df656c009 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/network.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/network/network.spec.tsx @@ -1,6 +1,6 @@ import { describe, expect, vi } from 'vitest'; import { apiClient } from '@ovh-ux/manager-core-api'; -import { networkApi } from '@/api/network'; +import { networkApi } from '@/data/api/network/network.api'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/data/api/project/project.api.ts b/packages/manager/apps/pci-databases-analytics/src/data/api/project/project.api.ts new file mode 100644 index 000000000000..89cc6fb57cf3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/project/project.api.ts @@ -0,0 +1,7 @@ +import { apiClient } from '@ovh-ux/manager-core-api'; +import { Project } from '@/types/cloud/Project'; + +export const getProject = async (projectId: string): Promise => { + const response = await apiClient.v6.get(`/cloud/project/${projectId}`); + return response.data as Project; +}; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/projects.test.tsx b/packages/manager/apps/pci-databases-analytics/src/data/api/project/project.spec.tsx similarity index 90% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/api/projects.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/data/api/project/project.spec.tsx index 3645cb0e7ee8..c8f892373463 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/api/projects.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/data/api/project/project.spec.tsx @@ -1,6 +1,6 @@ import { describe, expect, vi } from 'vitest'; import { apiClient } from '@ovh-ux/manager-core-api'; -import { getProject } from '@/api/projects'; +import { getProject } from '@/data/api/project/project.api'; vi.mock('@ovh-ux/manager-core-api', () => { const get = vi.fn(() => { diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/advancedConfiguration.api.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/advancedConfiguration.api.hook.tsx deleted file mode 100644 index c765abeb8217..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/advancedConfiguration.api.hook.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, -} from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { - UpdateAdvancedConfigurationProps, - getAdvancedConfiguration, - getAdvancedConfigurationCapabilities, - updateAdvancedConfiguration, -} from '@/api/databases/advancedConfiguration'; -import { CdbError } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetAdvancedConfiguration( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [ - projectId, - 'database', - engine, - serviceId, - 'advancedConfiguration', - ]; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getAdvancedConfiguration({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult, CdbError>; -} - -export function useGetAdvancedConfigurationCapabilities( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [ - projectId, - 'database', - engine, - serviceId, - 'capabilities/advancedConfiguration', - ]; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => - getAdvancedConfigurationCapabilities({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult< - database.capabilities.advancedConfiguration.Property[], - CdbError - >; -} - -interface MutateAdvancedConfigurationProps { - onError: (cause: CdbError) => void; - onSuccess: (advancedConfiguration: Record) => void; -} -export function useUpdateAdvancedConfiguration({ - onError, - onSuccess, -}: MutateAdvancedConfigurationProps) { - const mutation = useMutation({ - mutationFn: (advancedConfiguration: UpdateAdvancedConfigurationProps) => { - return updateAdvancedConfiguration(advancedConfiguration); - }, - onError, - onSuccess, - }); - - return { - updateAdvancedConfiguration: ( - advancedConfiguration: UpdateAdvancedConfigurationProps, - ) => { - return mutation.mutate(advancedConfiguration); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/availabilities.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/availabilities.api.hooks.tsx deleted file mode 100644 index 9d8776d43bf9..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/availabilities.api.hooks.tsx +++ /dev/null @@ -1,131 +0,0 @@ -import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { - getAvailabilities, - getCapabilities, - getEnginesCapabilities, - getRegionsCapabilities, - getSuggestions, -} from '@/api/databases/availabilities'; -import { CdbError } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetAvailabilities( - projectId: string, - serviceId?: string, - action?: database.availability.ActionEnum, - target?: database.availability.TargetEnum, - options: Omit = {}, -) { - const queryKey = [ - projectId, - 'database/availability', - serviceId, - action, - target, - ].filter(Boolean); - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => - getAvailabilities({ - projectId, - ...(serviceId ? { serviceId } : {}), - ...(action ? { action } : {}), - ...(target ? { target } : {}), - }), - ...options, - }) as UseQueryResult; -} - -export function useGetSuggestions( - projectId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database/availability/suggestions']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getSuggestions(projectId), - ...options, - }) as UseQueryResult; -} - -export function useGetCapabilities( - projectId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database/capabilities']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getCapabilities(projectId), - ...options, - }) as UseQueryResult; -} - -export function useGetEnginesCapabilities( - projectId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database/capabilities/engines']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getEnginesCapabilities(projectId), - ...options, - }) as UseQueryResult; -} - -export function useGetRegionsCapabilities( - projectId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database/capabilities/regions']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getRegionsCapabilities(projectId), - ...options, - }) as UseQueryResult; -} - -export interface FullCapabilities { - /** Disks available */ - disks: string[]; - /** Database engines available */ - engines: database.EngineCapabilities[]; - /** Flavors available */ - flavors: database.capabilities.Flavor[]; - /** Options available */ - options: database.capabilities.Option[]; - /** Plans available */ - plans: database.capabilities.Plan[]; - /** Regions available */ - regions: database.RegionCapabilities[]; -} -export function useGetFullCapabilities( - projectId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database/full-capabilities']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: async () => { - const [ - capabilities, - engineCapabilities, - regionsCapabilities, - ] = await Promise.all([ - getCapabilities(projectId), - getEnginesCapabilities(projectId), - getRegionsCapabilities(projectId), - ]); - - return { - disks: capabilities.disks, - engines: engineCapabilities, - flavors: capabilities.flavors, - options: capabilities.options, - plans: capabilities.plans, - regions: regionsCapabilities, - }; - }, - ...options, - }) as UseQueryResult; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/backups.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/backups.api.hooks.tsx deleted file mode 100644 index a5eda13fdba6..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/backups.api.hooks.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, -} from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { - RestoreBackupProps, - getServiceBackups, - restoreBackup, -} from '@/api/databases/backups'; -import { CdbError } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetBackups( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'backup']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getServiceBackups({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -interface MutateBackupProps { - onError: (cause: CdbError) => void; - onSuccess: () => void; -} -export function useRestoreBackup({ onError, onSuccess }: MutateBackupProps) { - const mutation = useMutation({ - mutationFn: (backupInfo: RestoreBackupProps) => { - return restoreBackup(backupInfo); - }, - onError, - onSuccess, - }); - - return { - restoreBackup: (backupInfo: RestoreBackupProps) => { - return mutation.mutate(backupInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/catalog.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/catalog/useGetCatalog.hook.tsx similarity index 70% rename from packages/manager/apps/pci-databases-analytics/src/hooks/api/catalog.api.hooks.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/catalog/useGetCatalog.hook.tsx index 84306fae4070..1904b04c3ad5 100644 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/catalog.api.hooks.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/catalog/useGetCatalog.hook.tsx @@ -1,8 +1,8 @@ import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; -import { catalogApi } from '@/api/catalog'; -import { order } from '@/models/catalog'; -import { useUser } from '../useUser'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; +import { catalogApi } from '@/data/api/catalog/catalog.api'; +import { order } from '@/types/catalog'; +import { useUser } from '@/hooks/useUser'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; export function useGetCatalog( options: Omit = {}, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/catalog.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/catalog/useGetCatalog.spec.tsx similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/catalog.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/catalog/useGetCatalog.spec.tsx index e8ea6c087556..a5f21aaba297 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/catalog.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/catalog/useGetCatalog.spec.tsx @@ -1,13 +1,13 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import * as API from '@/api/catalog'; +import * as API from '@/data/api/catalog/catalog.api'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { useGetCatalog } from '@/hooks/api/catalog.api.hooks'; +import { useGetCatalog } from '@/hooks/api/catalog/useGetCatalog.hook'; import { mockedCatalog } from '@/__tests__/helpers/mocks/catalog'; import { mockedUser } from '@/__tests__/helpers/mocks/user'; -vi.mock('@/api/catalog', () => ({ +vi.mock('@/data/api/catalog/catalog.api', () => ({ catalogApi: { getCatalog: vi.fn(), }, diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/connectionPool.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/connectionPool.api.hooks.tsx deleted file mode 100644 index e4e87f4480da..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/connectionPool.api.hooks.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, -} from '@tanstack/react-query'; - -import { - AddConnectionPoolProps, - DeleteConnectionPoolProps, - EditConnectionPoolProps, - addConnectionPool, - deleteConnectionPool, - editConnectionPool, - getConnectionPools, -} from '@/api/databases/connectionPool'; -import { database } from '@/models/database'; -import { CdbError } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetConnectionPools( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'connectionPool']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getConnectionPools({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -export interface MutateConnectionPoolProps { - onError: (cause: CdbError) => void; - onSuccess: (connectionPool: database.postgresql.ConnectionPool) => void; -} -export function useAddConnectionPool({ - onError, - onSuccess, -}: MutateConnectionPoolProps) { - const mutation = useMutation({ - mutationFn: (cpInfo: AddConnectionPoolProps) => { - return addConnectionPool(cpInfo); - }, - onError, - onSuccess, - }); - - return { - addConnectionPool: (cpInfo: AddConnectionPoolProps) => { - return mutation.mutate(cpInfo); - }, - ...mutation, - }; -} - -export function useEditConnectionPool({ - onError, - onSuccess, -}: MutateConnectionPoolProps) { - const mutation = useMutation({ - mutationFn: (cpInfo: EditConnectionPoolProps) => { - return editConnectionPool(cpInfo); - }, - onError, - onSuccess, - }); - - return { - editConnectionPool: (cpInfo: EditConnectionPoolProps) => { - return mutation.mutate(cpInfo); - }, - ...mutation, - }; -} - -interface UseDeleteConnectionPoolProps { - onError: (cause: CdbError) => void; - onSuccess: () => void; -} - -export function useDeleteConnectionPool({ - onError, - onSuccess, -}: UseDeleteConnectionPoolProps) { - const mutation = useMutation({ - mutationFn: (connectionPoolInfo: DeleteConnectionPoolProps) => { - return deleteConnectionPool(connectionPoolInfo); - }, - onError, - onSuccess, - }); - - return { - deleteConnectionPool: (connectionPoolInfo: DeleteConnectionPoolProps) => { - return mutation.mutate(connectionPoolInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useEditAdvancedConfiguration.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useEditAdvancedConfiguration.hook.tsx new file mode 100644 index 000000000000..f95550cdbb3c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useEditAdvancedConfiguration.hook.tsx @@ -0,0 +1,32 @@ +import { useMutation } from '@tanstack/react-query'; +import { + EditAdvancedConfiguration, + editAdvancedConfiguration, +} from '@/data/api/database/advancedConfiguration.api'; +import { CdbError } from '@/data/api/database'; + +interface UseEditAdvancedConfigurationProps { + onError: (cause: CdbError) => void; + onSuccess: (advancedConfiguration: Record) => void; +} +export function useEditAdvancedConfiguration({ + onError, + onSuccess, +}: UseEditAdvancedConfigurationProps) { + const mutation = useMutation({ + mutationFn: (advancedConfiguration: EditAdvancedConfiguration) => { + return editAdvancedConfiguration(advancedConfiguration); + }, + onError, + onSuccess, + }); + + return { + updateAdvancedConfiguration: ( + advancedConfiguration: EditAdvancedConfiguration, + ) => { + return mutation.mutate(advancedConfiguration); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useEditAdvancedConfiguration.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useEditAdvancedConfiguration.spec.tsx new file mode 100644 index 000000000000..7980b74f0b0b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useEditAdvancedConfiguration.spec.tsx @@ -0,0 +1,48 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/advancedConfiguration.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useEditAdvancedConfiguration } from './useEditAdvancedConfiguration.hook'; +// Mock the API functions +vi.mock('@/data/api/database/advancedConfiguration.api', () => ({ + editAdvancedConfiguration: vi.fn(), +})); + +describe('useUpdateAdvancedConfiguration', () => { + it('should call updateAdvancedConfiguration on mutation', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const mockAdvancedConfiguration = { key: 'value' }; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.editAdvancedConfiguration).mockResolvedValue( + mockAdvancedConfiguration, + ); + const { result } = renderHook( + () => useEditAdvancedConfiguration({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const updateProps = { + projectId, + engine, + serviceId, + advancedConfiguration: mockAdvancedConfiguration, + }; + result.current.updateAdvancedConfiguration(updateProps); + + await waitFor(() => { + expect(databaseAPI.editAdvancedConfiguration).toHaveBeenCalledWith( + updateProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + mockAdvancedConfiguration, + updateProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfiguration.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfiguration.hook.tsx new file mode 100644 index 000000000000..243734ae11b6 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfiguration.hook.tsx @@ -0,0 +1,25 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getAdvancedConfiguration } from '@/data/api/database/advancedConfiguration.api'; +import { CdbError } from '@/data/api/database'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetAdvancedConfiguration( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [ + projectId, + 'database', + engine, + serviceId, + 'advancedConfiguration', + ]; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getAdvancedConfiguration({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult, CdbError>; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfiguration.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfiguration.spec.tsx new file mode 100644 index 000000000000..3cc5f5976dab --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfiguration.spec.tsx @@ -0,0 +1,36 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/advancedConfiguration.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useGetAdvancedConfiguration } from './useGetAdvancedConfiguration.hook'; +// Mock the API functions +vi.mock('@/data/api/database/advancedConfiguration.api', () => ({ + getAdvancedConfiguration: vi.fn(), +})); + +describe('useGetAdvancedConfiguration', () => { + it('should return advanced configuration data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const mockData = { key: 'value' }; + + vi.mocked(databaseAPI.getAdvancedConfiguration).mockResolvedValue(mockData); + + const { result } = renderHook( + () => useGetAdvancedConfiguration(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(mockData); + expect(databaseAPI.getAdvancedConfiguration).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfigurationCapabilities.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfigurationCapabilities.hook.tsx new file mode 100644 index 000000000000..5c570f816e8a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfigurationCapabilities.hook.tsx @@ -0,0 +1,29 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getAdvancedConfigurationCapabilities } from '@/data/api/database/advancedConfiguration.api'; +import { CdbError } from '@/data/api/database'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetAdvancedConfigurationCapabilities( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [ + projectId, + 'database', + engine, + serviceId, + 'capabilities/advancedConfiguration', + ]; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => + getAdvancedConfigurationCapabilities({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult< + database.capabilities.advancedConfiguration.Property[], + CdbError + >; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfigurationCapabilities.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfigurationCapabilities.spec.tsx new file mode 100644 index 000000000000..5ba581b682c8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/advancedConfiguration/useGetAdvancedConfigurationCapabilities.spec.tsx @@ -0,0 +1,47 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/advancedConfiguration.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useGetAdvancedConfigurationCapabilities } from './useGetAdvancedConfigurationCapabilities.hook'; +// Mock the API functions +vi.mock('@/data/api/database/advancedConfiguration.api', () => ({ + getAdvancedConfigurationCapabilities: vi.fn(), +})); + +describe('useGetAdvancedConfigurationCapabilities', () => { + it('should return advanced configuration capabilities', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const mockCapabilities: database.capabilities.advancedConfiguration.Property[] = [ + { + name: 'capability', + type: + database.capabilities.advancedConfiguration.property.TypeEnum.string, + description: '', + }, + ]; + + vi.mocked( + databaseAPI.getAdvancedConfigurationCapabilities, + ).mockResolvedValue(mockCapabilities); + + const { result } = renderHook( + () => + useGetAdvancedConfigurationCapabilities(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.data).toEqual(mockCapabilities); + expect( + databaseAPI.getAdvancedConfigurationCapabilities, + ).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetAvailabilities.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetAvailabilities.hook.tsx new file mode 100644 index 000000000000..4678cac5e8bc --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetAvailabilities.hook.tsx @@ -0,0 +1,31 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getAvailabilities } from '@/data/api/database/availability.api'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetAvailabilities( + projectId: string, + serviceId?: string, + action?: database.availability.ActionEnum, + target?: database.availability.TargetEnum, + options: Omit = {}, +) { + const queryKey = [ + projectId, + 'database/availability', + serviceId, + action, + target, + ].filter(Boolean); + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => + getAvailabilities({ + projectId, + ...(serviceId ? { serviceId } : {}), + ...(action ? { action } : {}), + ...(target ? { target } : {}), + }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetAvailabilities.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetAvailabilities.spec.tsx new file mode 100644 index 000000000000..7c0820f1443a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetAvailabilities.spec.tsx @@ -0,0 +1,36 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/availability.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; + +import { mockedAvailabilities } from '@/__tests__/helpers/mocks/availabilities'; +import { useGetAvailabilities } from './useGetAvailabilities.hook'; + +vi.mock('@/data/api/database/availability.api', () => ({ + getAvailabilities: vi.fn(), +})); + +describe('useGetAvailabilities', () => { + it('should return Availabilities', async () => { + const projectId = 'projectId'; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getAvailabilities).mockResolvedValue([ + mockedAvailabilities, + ]); + + const { result } = renderHook( + () => useGetAvailabilities(projectId, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedAvailabilities]); + expect(databaseAPI.getAvailabilities).toHaveBeenCalledWith({ + projectId, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetSuggestions.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetSuggestions.hook.tsx new file mode 100644 index 000000000000..d2eb3ef1d0ed --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetSuggestions.hook.tsx @@ -0,0 +1,16 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getSuggestions } from '@/data/api/database/availability.api'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetSuggestions( + projectId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database/availability/suggestions']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getSuggestions(projectId), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetSuggestions.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetSuggestions.spec.tsx new file mode 100644 index 000000000000..985c2836929e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/availability/useGetSuggestions.spec.tsx @@ -0,0 +1,31 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/availability.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; + +import { mockedSuggestions } from '@/__tests__/helpers/mocks/availabilities'; +import { useGetSuggestions } from './useGetSuggestions.hook'; + +vi.mock('@/data/api/database/availability.api', () => ({ + getSuggestions: vi.fn(), +})); + +describe('useGetSuggestions', () => { + it('should return Suggestions', async () => { + const projectId = 'projectId'; + + vi.mocked(databaseAPI.getSuggestions).mockResolvedValue([ + mockedSuggestions, + ]); + + const { result } = renderHook(() => useGetSuggestions(projectId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedSuggestions]); + expect(databaseAPI.getSuggestions).toHaveBeenCalledWith(projectId); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useGetBackups.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useGetBackups.hook.tsx new file mode 100644 index 000000000000..741f8772f160 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useGetBackups.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getServiceBackups } from '@/data/api/database/backup.api'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetBackups( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'backup']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getServiceBackups({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useGetBackups.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useGetBackups.spec.tsx new file mode 100644 index 000000000000..3ee82a45e7ea --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useGetBackups.spec.tsx @@ -0,0 +1,37 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/backup.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedBackup } from '@/__tests__/helpers/mocks/backup'; +import { useGetBackups } from './useGetBackups.hook'; + +vi.mock('@/data/api/database/backup.api', () => ({ + getServiceBackups: vi.fn(), +})); + +describe('useGetBackups', () => { + it('should return Services Backup', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getServiceBackups).mockResolvedValue([mockedBackup]); + + const { result } = renderHook( + () => useGetBackups(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedBackup]); + expect(databaseAPI.getServiceBackups).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useRestoreBackup.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useRestoreBackup.hook.tsx new file mode 100644 index 000000000000..abd190561a84 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useRestoreBackup.hook.tsx @@ -0,0 +1,24 @@ +import { useMutation } from '@tanstack/react-query'; +import { RestoreBackup, restoreBackup } from '@/data/api/database/backup.api'; +import { CdbError } from '@/data/api/database'; + +interface UseRestoreBackup { + onError: (cause: CdbError) => void; + onSuccess: () => void; +} +export function useRestoreBackup({ onError, onSuccess }: UseRestoreBackup) { + const mutation = useMutation({ + mutationFn: (backupInfo: RestoreBackup) => { + return restoreBackup(backupInfo); + }, + onError, + onSuccess, + }); + + return { + restoreBackup: (backupInfo: RestoreBackup) => { + return mutation.mutate(backupInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/backups.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useRestoreBackup.spec.tsx similarity index 69% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/backups.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useRestoreBackup.spec.tsx index 31abf09fce07..5fdcacf3d2c8 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/backups.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/backup/useRestoreBackup.spec.tsx @@ -1,42 +1,16 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import { useGetBackups, useRestoreBackup } from '@/hooks/api/backups.api.hooks'; -import * as databaseAPI from '@/api/databases/backups'; -import { database } from '@/models/database'; +import * as databaseAPI from '@/data/api/database/backup.api'; +import * as database from '@/types/cloud/project/database'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; import { mockedBackup } from '@/__tests__/helpers/mocks/backup'; +import { useRestoreBackup } from './useRestoreBackup.hook'; -vi.mock('@/api/databases/backups', () => ({ - getServiceBackups: vi.fn(), +vi.mock('@/data/api/database/backup.api', () => ({ restoreBackup: vi.fn(), })); -describe('useGetBackups', () => { - it('should return Services Backup', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getServiceBackups).mockResolvedValue([mockedBackup]); - - const { result } = renderHook( - () => useGetBackups(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedBackup]); - expect(databaseAPI.getServiceBackups).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - describe('useRestoreBackup', () => { it('should call useRestoreBackup on mutation with backUpId', async () => { const projectId = 'projectId'; diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetCapabilities.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetCapabilities.hook.tsx new file mode 100644 index 000000000000..0914a2643ff7 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetCapabilities.hook.tsx @@ -0,0 +1,16 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getCapabilities } from '@/data/api/database/capabilities.api'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetCapabilities( + projectId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database/capabilities']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getCapabilities(projectId), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetCapabilities.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetCapabilities.spec.tsx new file mode 100644 index 000000000000..4ac229fb4771 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetCapabilities.spec.tsx @@ -0,0 +1,31 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/capabilities.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; + +import { mockedCapabilities } from '@/__tests__/helpers/mocks/availabilities'; +import { useGetCapabilities } from './useGetCapabilities.hook'; + +vi.mock('@/data/api/database/capabilities.api', () => ({ + getCapabilities: vi.fn(), +})); + +describe('useGetCapabilities', () => { + it('should return Capabilities', async () => { + const projectId = 'projectId'; + + vi.mocked(databaseAPI.getCapabilities).mockResolvedValue( + mockedCapabilities, + ); + + const { result } = renderHook(() => useGetCapabilities(projectId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(mockedCapabilities); + expect(databaseAPI.getCapabilities).toHaveBeenCalledWith(projectId); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetEnginesCapabilities.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetEnginesCapabilities.hook.tsx new file mode 100644 index 000000000000..9a420a9c0fca --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetEnginesCapabilities.hook.tsx @@ -0,0 +1,16 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getEnginesCapabilities } from '@/data/api/database/capabilities.api'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetEnginesCapabilities( + projectId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database/capabilities/engines']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getEnginesCapabilities(projectId), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetEnginesCapabilities.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetEnginesCapabilities.spec.tsx new file mode 100644 index 000000000000..a45ebb5557f8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetEnginesCapabilities.spec.tsx @@ -0,0 +1,33 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/capabilities.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; + +import { mockedEngineCapabilities } from '@/__tests__/helpers/mocks/availabilities'; +import { useGetEnginesCapabilities } from './useGetEnginesCapabilities.hook'; + +vi.mock('@/data/api/database/capabilities.api', () => ({ + getEnginesCapabilities: vi.fn(), +})); + +describe('useGetEnginesCapabilities', () => { + it('should return EnginesCapabilities', async () => { + const projectId = 'projectId'; + + vi.mocked(databaseAPI.getEnginesCapabilities).mockResolvedValue([ + mockedEngineCapabilities, + ]); + + const { result } = renderHook(() => useGetEnginesCapabilities(projectId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedEngineCapabilities]); + expect(databaseAPI.getEnginesCapabilities).toHaveBeenCalledWith( + projectId, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetFullCapabilities.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetFullCapabilities.hook.tsx new file mode 100644 index 000000000000..6ebabc746e15 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetFullCapabilities.hook.tsx @@ -0,0 +1,54 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { + getCapabilities, + getEnginesCapabilities, + getRegionsCapabilities, +} from '@/data/api/database/capabilities.api'; +import { CdbError } from '@/data/api/database'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export interface FullCapabilities { + /** Disks available */ + disks: string[]; + /** Database engines available */ + engines: database.capabilities.EngineCapabilities[]; + /** Flavors available */ + flavors: database.capabilities.Flavor[]; + /** Options available */ + options: database.capabilities.Option[]; + /** Plans available */ + plans: database.capabilities.Plan[]; + /** Regions available */ + regions: database.capabilities.RegionCapabilities[]; +} +export function useGetFullCapabilities( + projectId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database/full-capabilities']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: async () => { + const [ + capabilities, + engineCapabilities, + regionsCapabilities, + ] = await Promise.all([ + getCapabilities(projectId), + getEnginesCapabilities(projectId), + getRegionsCapabilities(projectId), + ]); + + return { + disks: capabilities.disks, + engines: engineCapabilities, + flavors: capabilities.flavors, + options: capabilities.options, + plans: capabilities.plans, + regions: regionsCapabilities, + }; + }, + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetFullCapabilities.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetFullCapabilities.spec.tsx new file mode 100644 index 000000000000..b16b990dbb5e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetFullCapabilities.spec.tsx @@ -0,0 +1,48 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/capabilities.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; + +import { + mockedCapabilities, + mockedEngineCapabilities, + mockedFullCapabilities, + mockedRegionCapabilities, +} from '@/__tests__/helpers/mocks/availabilities'; +import { useGetFullCapabilities } from './useGetFullCapabilities.hook'; + +vi.mock('@/data/api/database/capabilities.api', () => ({ + getCapabilities: vi.fn(), + getEnginesCapabilities: vi.fn(), + getRegionsCapabilities: vi.fn(), +})); + +describe('useGetFullCapabilities', () => { + it('should return FullCapabilities', async () => { + const projectId = 'projectId'; + + vi.mocked(databaseAPI.getCapabilities).mockResolvedValue( + mockedCapabilities, + ); + + vi.mocked(databaseAPI.getEnginesCapabilities).mockResolvedValue([ + mockedEngineCapabilities, + ]); + + vi.mocked(databaseAPI.getRegionsCapabilities).mockResolvedValue([ + mockedRegionCapabilities, + ]); + + const { result } = renderHook(() => useGetFullCapabilities(projectId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(mockedFullCapabilities); + expect(databaseAPI.getRegionsCapabilities).toHaveBeenCalledWith( + projectId, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetRegionsCapabilities.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetRegionsCapabilities.hook.tsx new file mode 100644 index 000000000000..9070bffa0190 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetRegionsCapabilities.hook.tsx @@ -0,0 +1,16 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getRegionsCapabilities } from '@/data/api/database/capabilities.api'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetRegionsCapabilities( + projectId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database/capabilities/regions']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getRegionsCapabilities(projectId), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetRegionsCapabilities.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetRegionsCapabilities.spec.tsx new file mode 100644 index 000000000000..f9303c0f499c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/capabilities/useGetRegionsCapabilities.spec.tsx @@ -0,0 +1,33 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/capabilities.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; + +import { mockedRegionCapabilities } from '@/__tests__/helpers/mocks/availabilities'; +import { useGetRegionsCapabilities } from './useGetRegionsCapabilities.hook'; + +vi.mock('@/data/api/database/capabilities.api', () => ({ + getRegionsCapabilities: vi.fn(), +})); + +describe('useGetRegionsCapabilities', () => { + it('should return RegionsCapabilities', async () => { + const projectId = 'projectId'; + + vi.mocked(databaseAPI.getRegionsCapabilities).mockResolvedValue([ + mockedRegionCapabilities, + ]); + + const { result } = renderHook(() => useGetRegionsCapabilities(projectId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedRegionCapabilities]); + expect(databaseAPI.getRegionsCapabilities).toHaveBeenCalledWith( + projectId, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/certificates.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/certificate/useGetCertificate.hook.tsx similarity index 71% rename from packages/manager/apps/pci-databases-analytics/src/hooks/api/certificates.api.hooks.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/certificate/useGetCertificate.hook.tsx index a64e77c1f891..b0454a96d98f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/certificates.api.hooks.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/certificate/useGetCertificate.hook.tsx @@ -1,8 +1,8 @@ import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; -import { getCertificate } from '@/api/databases/certificates'; -import { database } from '@/models/database'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; +import { getCertificate } from '@/data/api/database/certificate.api'; +import * as database from '@/types/cloud/project/database'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; export function useGetCertificate( projectId: string, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/certificates.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/certificate/useGetCertificate.spec.tsx similarity index 79% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/certificates.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/certificate/useGetCertificate.spec.tsx index 10a657e8216a..981d5f36fc24 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/certificates.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/certificate/useGetCertificate.spec.tsx @@ -1,11 +1,11 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import { useGetCertificate } from '@/hooks/api/certificates.api.hooks'; -import * as databaseAPI from '@/api/databases/certificates'; -import { database } from '@/models/database'; +import { useGetCertificate } from './useGetCertificate.hook'; +import * as databaseAPI from '@/data/api/database/certificate.api'; +import * as database from '@/types/cloud/project/database'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -vi.mock('@/api/databases/certificates', () => ({ +vi.mock('@/data/api/database/certificate.api', () => ({ getCertificate: vi.fn(), })); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useAddConnectionPool.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useAddConnectionPool.hook.tsx new file mode 100644 index 000000000000..48f1416ec44a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useAddConnectionPool.hook.tsx @@ -0,0 +1,32 @@ +import { useMutation } from '@tanstack/react-query'; + +import { + AddConnectionPool, + addConnectionPool, +} from '@/data/api/database/connectionPool.api'; +import * as database from '@/types/cloud/project/database'; +import { CdbError } from '@/data/api/database'; + +export interface UseAddConnectionPool { + onError: (cause: CdbError) => void; + onSuccess: (connectionPool: database.postgresql.ConnectionPool) => void; +} +export function useAddConnectionPool({ + onError, + onSuccess, +}: UseAddConnectionPool) { + const mutation = useMutation({ + mutationFn: (cpInfo: AddConnectionPool) => { + return addConnectionPool(cpInfo); + }, + onError, + onSuccess, + }); + + return { + addConnectionPool: (cpInfo: AddConnectionPool) => { + return mutation.mutate(cpInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useAddConnectionPool.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useAddConnectionPool.spec.tsx new file mode 100644 index 000000000000..723b9bfe5f8a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useAddConnectionPool.spec.tsx @@ -0,0 +1,52 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/connectionPool.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { + mockedAddConnectionPool, + mockedConnectionPool, +} from '@/__tests__/helpers/mocks/connectionPool'; +import { useAddConnectionPool } from './useAddConnectionPool.hook'; + +vi.mock('@/data/api/database/connectionPool.api', () => ({ + addConnectionPool: vi.fn(), +})); + +describe('useAddConnectionPool', () => { + it('should call useAddConnectionPool on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.addConnectionPool).mockResolvedValue( + mockedConnectionPool, + ); + const { result } = renderHook( + () => useAddConnectionPool({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const addConnectionPoolProps = { + projectId, + engine, + serviceId, + connectionPool: mockedAddConnectionPool, + }; + result.current.addConnectionPool(addConnectionPoolProps); + + await waitFor(() => { + expect(databaseAPI.addConnectionPool).toHaveBeenCalledWith( + addConnectionPoolProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + mockedConnectionPool, + addConnectionPoolProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useDeleteConnectionPool.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useDeleteConnectionPool.hook.tsx new file mode 100644 index 000000000000..d3670245a8a3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useDeleteConnectionPool.hook.tsx @@ -0,0 +1,31 @@ +import { useMutation } from '@tanstack/react-query'; +import { + DeleteConnectionPool, + deleteConnectionPool, +} from '@/data/api/database/connectionPool.api'; +import { CdbError } from '@/data/api/database'; + +interface UseDeleteConnectionPool { + onError: (cause: CdbError) => void; + onSuccess: () => void; +} + +export function useDeleteConnectionPool({ + onError, + onSuccess, +}: UseDeleteConnectionPool) { + const mutation = useMutation({ + mutationFn: (connectionPoolInfo: DeleteConnectionPool) => { + return deleteConnectionPool(connectionPoolInfo); + }, + onError, + onSuccess, + }); + + return { + deleteConnectionPool: (connectionPoolInfo: DeleteConnectionPool) => { + return mutation.mutate(connectionPoolInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useDeleteConnectionPool.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useDeleteConnectionPool.spec.tsx new file mode 100644 index 000000000000..94d91d551181 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useDeleteConnectionPool.spec.tsx @@ -0,0 +1,47 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/connectionPool.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useDeleteConnectionPool } from './useDeleteConnectionPool.hook'; + +vi.mock('@/data/api/database/connectionPool.api', () => ({ + deleteConnectionPool: vi.fn(), +})); + +describe('useDeleteConnectionPool', () => { + it('should call useDeleteConnectionPool on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.deleteConnectionPool).mockResolvedValue(undefined); + + const { result } = renderHook( + () => useDeleteConnectionPool({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const deleteConnectionPoolProps = { + projectId, + engine, + serviceId, + connectionPoolId: 'connectionPoolId', + }; + result.current.deleteConnectionPool(deleteConnectionPoolProps); + + await waitFor(() => { + expect(databaseAPI.deleteConnectionPool).toHaveBeenCalledWith( + deleteConnectionPoolProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + undefined, + deleteConnectionPoolProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useEditConnectionPool.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useEditConnectionPool.hook.tsx new file mode 100644 index 000000000000..95f75349e453 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useEditConnectionPool.hook.tsx @@ -0,0 +1,32 @@ +import { useMutation } from '@tanstack/react-query'; + +import { + EditConnectionPool, + editConnectionPool, +} from '@/data/api/database/connectionPool.api'; +import * as database from '@/types/cloud/project/database'; +import { CdbError } from '@/data/api/database'; + +export interface UseEditConnectionPool { + onError: (cause: CdbError) => void; + onSuccess: (connectionPool: database.postgresql.ConnectionPool) => void; +} +export function useEditConnectionPool({ + onError, + onSuccess, +}: UseEditConnectionPool) { + const mutation = useMutation({ + mutationFn: (cpInfo: EditConnectionPool) => { + return editConnectionPool(cpInfo); + }, + onError, + onSuccess, + }); + + return { + editConnectionPool: (cpInfo: EditConnectionPool) => { + return mutation.mutate(cpInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useEditConnectionPool.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useEditConnectionPool.spec.tsx new file mode 100644 index 000000000000..1abcf51fb30d --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useEditConnectionPool.spec.tsx @@ -0,0 +1,52 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/connectionPool.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { + mockedConnectionPool, + mockedEditConnectionPool, +} from '@/__tests__/helpers/mocks/connectionPool'; +import { useEditConnectionPool } from './useEditConnectionPool.hook'; + +vi.mock('@/data/api/database/connectionPool.api', () => ({ + editConnectionPool: vi.fn(), +})); + +describe('useEditConnectionPool', () => { + it('should call useEditConnectionPool on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.editConnectionPool).mockResolvedValue( + mockedConnectionPool, + ); + const { result } = renderHook( + () => useEditConnectionPool({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const editConnectionPoolProps = { + projectId, + engine, + serviceId, + connectionPool: mockedEditConnectionPool, + }; + result.current.editConnectionPool(editConnectionPoolProps); + + await waitFor(() => { + expect(databaseAPI.editConnectionPool).toHaveBeenCalledWith( + editConnectionPoolProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + mockedConnectionPool, + editConnectionPoolProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useGetConnectionPools.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useGetConnectionPools.hook.tsx new file mode 100644 index 000000000000..b371b689e56f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useGetConnectionPools.hook.tsx @@ -0,0 +1,19 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; + +import { getConnectionPools } from '@/data/api/database/connectionPool.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; +import * as database from '@/types/cloud/project/database'; + +export function useGetConnectionPools( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'connectionPool']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getConnectionPools({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useGetConnectionPools.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useGetConnectionPools.spec.tsx new file mode 100644 index 000000000000..5f7a3a7ebbeb --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/connectionPool/useGetConnectionPools.spec.tsx @@ -0,0 +1,39 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/connectionPool.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedConnectionPool } from '@/__tests__/helpers/mocks/connectionPool'; +import { useGetConnectionPools } from './useGetConnectionPools.hook'; + +vi.mock('@/data/api/database/connectionPool.api', () => ({ + getConnectionPools: vi.fn(), +})); + +describe('useGetConnectionPool', () => { + it('should return connectionPool data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getConnectionPools).mockResolvedValue([ + mockedConnectionPool, + ]); + + const { result } = renderHook( + () => useGetConnectionPools(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedConnectionPool]); + expect(databaseAPI.getConnectionPools).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useAddDatabase.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useAddDatabase.hook.tsx new file mode 100644 index 000000000000..143d3baf8db2 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useAddDatabase.hook.tsx @@ -0,0 +1,25 @@ +import { useMutation } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { AddDatabase, addDatabase } from '@/data/api/database/database.api'; +import { CdbError } from '@/data/api/database'; + +interface UseAddDatabase { + onError: (cause: CdbError) => void; + onSuccess: (database: database.service.Database) => void; +} +export function useAddDatabase({ onError, onSuccess }: UseAddDatabase) { + const mutation = useMutation({ + mutationFn: (databaseInfo: AddDatabase) => { + return addDatabase(databaseInfo); + }, + onError, + onSuccess, + }); + + return { + addDatabase: (databaseInfo: AddDatabase) => { + return mutation.mutate(databaseInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useAddDatabase.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useAddDatabase.spec.tsx new file mode 100644 index 000000000000..f8c4e4f8c771 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useAddDatabase.spec.tsx @@ -0,0 +1,46 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/database.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedDatabase } from '@/__tests__/helpers/mocks/databases'; +import { useAddDatabase } from './useAddDatabase.hook'; + +vi.mock('@/data/api/database/database.api', () => ({ + getServiceDatabases: vi.fn(), + addDatabase: vi.fn(), + deleteDatabase: vi.fn(), +})); + +describe('useAddDatabase', () => { + it('should call useAddDatabase on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.addDatabase).mockResolvedValue(mockedDatabase); + const { result } = renderHook( + () => useAddDatabase({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const addDatabaseProps = { + projectId, + engine, + serviceId, + name: 'databaseName', + }; + result.current.addDatabase(addDatabaseProps); + + await waitFor(() => { + expect(databaseAPI.addDatabase).toHaveBeenCalledWith(addDatabaseProps); + expect(onSuccess).toHaveBeenCalledWith( + mockedDatabase, + addDatabaseProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useDeleteDatabase.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useDeleteDatabase.hook.tsx new file mode 100644 index 000000000000..694c5966a4c4 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useDeleteDatabase.hook.tsx @@ -0,0 +1,27 @@ +import { useMutation } from '@tanstack/react-query'; +import { + DeleteDatabase, + deleteDatabase, +} from '@/data/api/database/database.api'; +import { CdbError } from '@/data/api/database'; + +interface UseDeleteDatabase { + onError: (cause: CdbError) => void; + onSuccess: () => void; +} +export function useDeleteDatabase({ onError, onSuccess }: UseDeleteDatabase) { + const mutation = useMutation({ + mutationFn: (databaseInfo: DeleteDatabase) => { + return deleteDatabase(databaseInfo); + }, + onError, + onSuccess, + }); + + return { + deleteDatabase: (databaseInfo: DeleteDatabase) => { + return mutation.mutate(databaseInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useDeleteDatabase.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useDeleteDatabase.spec.tsx new file mode 100644 index 000000000000..5e6f1baefa06 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useDeleteDatabase.spec.tsx @@ -0,0 +1,48 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/database.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useDeleteDatabase } from './useDeleteDatabase.hook'; + +vi.mock('@/data/api/database/database.api', () => ({ + getServiceDatabases: vi.fn(), + addDatabase: vi.fn(), + deleteDatabase: vi.fn(), +})); + +describe('useDeleteDatabase', () => { + it('should call useDeleteConnectionPool on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.deleteDatabase).mockResolvedValue(undefined); + + const { result } = renderHook( + () => useDeleteDatabase({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const deleteDatabaseProps = { + projectId, + engine, + serviceId, + databaseId: 'databaseId', + }; + result.current.deleteDatabase(deleteDatabaseProps); + + await waitFor(() => { + expect(databaseAPI.deleteDatabase).toHaveBeenCalledWith( + deleteDatabaseProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + undefined, + deleteDatabaseProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useGetDatabases.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useGetDatabases.hook.tsx new file mode 100644 index 000000000000..ed3991c1248a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useGetDatabases.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getServiceDatabases } from '@/data/api/database/database.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; + +export function useGetDatabases( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'database']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getServiceDatabases({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useGetDatabases.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useGetDatabases.spec.tsx new file mode 100644 index 000000000000..3e43df15674f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/database/useGetDatabases.spec.tsx @@ -0,0 +1,40 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/database.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedDatabase } from '@/__tests__/helpers/mocks/databases'; +import { useGetDatabases } from './useGetDatabases.hook'; + +vi.mock('@/data/api/database/database.api', () => ({ + getServiceDatabases: vi.fn(), + addDatabase: vi.fn(), + deleteDatabase: vi.fn(), +})); + +describe('useGetDatabases', () => { + it('should return service databases data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getServiceDatabases).mockResolvedValue([ + mockedDatabase, + ]); + + const { result } = renderHook( + () => useGetDatabases(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedDatabase]); + expect(databaseAPI.getServiceDatabases).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useAddIntegration.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useAddIntegration.hook.tsx new file mode 100644 index 000000000000..d395daca8bc6 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useAddIntegration.hook.tsx @@ -0,0 +1,28 @@ +import { useMutation } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { + AddIntegration, + addIntegration, +} from '@/data/api/database/integration.api'; +import { CdbError } from '@/data/api/database'; + +interface UseAddIntegration { + onError: (cause: CdbError) => void; + onSuccess: (database: database.service.Integration) => void; +} +export function useAddIntegration({ onError, onSuccess }: UseAddIntegration) { + const mutation = useMutation({ + mutationFn: (integrationInfo: AddIntegration) => { + return addIntegration(integrationInfo); + }, + onError, + onSuccess, + }); + + return { + addIntegration: (integrationInfo: AddIntegration) => { + return mutation.mutate(integrationInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useAddIntegration.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useAddIntegration.spec.tsx new file mode 100644 index 000000000000..bb3f0ddd5e9d --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useAddIntegration.spec.tsx @@ -0,0 +1,53 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/integration.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { + mockedAddIntegrations, + mockedIntegrations, +} from '@/__tests__/helpers/mocks/integrations'; +import { useAddIntegration } from './useAddIntegration.hook'; + +vi.mock('@/data/api/database/integration.api', () => ({ + getServiceIntegrations: vi.fn(), + getServiceCapabilitiesIntegrations: vi.fn(), + addIntegration: vi.fn(), + deleteIntegration: vi.fn(), +})); + +describe('useAddIntegration', () => { + it('should call useAddIntegration on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.addIntegration).mockResolvedValue(mockedIntegrations); + const { result } = renderHook( + () => useAddIntegration({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const addIntegrationProps = { + projectId, + engine, + serviceId, + integration: mockedAddIntegrations, + }; + result.current.addIntegration(addIntegrationProps); + + await waitFor(() => { + expect(databaseAPI.addIntegration).toHaveBeenCalledWith( + addIntegrationProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + mockedIntegrations, + addIntegrationProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useDeleteIntegration.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useDeleteIntegration.hook.tsx new file mode 100644 index 000000000000..fc0a9402890b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useDeleteIntegration.hook.tsx @@ -0,0 +1,30 @@ +import { useMutation } from '@tanstack/react-query'; +import { + DeleteIntegration, + deleteIntegration, +} from '@/data/api/database/integration.api'; +import { CdbError } from '@/data/api/database'; + +interface UseDeleteIntegration { + onError: (cause: CdbError) => void; + onSuccess: () => void; +} +export function useDeleteIntegration({ + onError, + onSuccess, +}: UseDeleteIntegration) { + const mutation = useMutation({ + mutationFn: (integrationInfo: DeleteIntegration) => { + return deleteIntegration(integrationInfo); + }, + onError, + onSuccess, + }); + + return { + deleteIntegration: (integrationInfo: DeleteIntegration) => { + return mutation.mutate(integrationInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useDeleteIntegration.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useDeleteIntegration.spec.tsx new file mode 100644 index 000000000000..327ae19febd8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useDeleteIntegration.spec.tsx @@ -0,0 +1,50 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/integration.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useDeleteIntegration } from './useDeleteIntegration.hook'; + +vi.mock('@/data/api/database/integration.api', () => ({ + getServiceIntegrations: vi.fn(), + getServiceCapabilitiesIntegrations: vi.fn(), + addIntegration: vi.fn(), + deleteIntegration: vi.fn(), +})); + +describe('useDeleteIntegration', () => { + it('should call useDeleteIntegration on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.deleteIntegration).mockResolvedValue(undefined); + + const { result } = renderHook( + () => useDeleteIntegration({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const deleteIntegrationProps = { + projectId, + engine, + serviceId, + integrationId: 'integrationId', + }; + result.current.deleteIntegration(deleteIntegrationProps); + + await waitFor(() => { + expect(databaseAPI.deleteIntegration).toHaveBeenCalledWith( + deleteIntegrationProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + undefined, + deleteIntegrationProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetCapabilitiesIntegrations.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetCapabilitiesIntegrations.hook.tsx new file mode 100644 index 000000000000..c86676624dc9 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetCapabilitiesIntegrations.hook.tsx @@ -0,0 +1,25 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getServiceCapabilitiesIntegrations } from '@/data/api/database/integration.api'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetCapabilitiesIntegrations( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [ + projectId, + 'database', + engine, + serviceId, + 'capabilities/integration', + ]; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => + getServiceCapabilitiesIntegrations({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetCapabilitiesIntegrations.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetCapabilitiesIntegrations.spec.tsx new file mode 100644 index 000000000000..645e4fd50d06 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetCapabilitiesIntegrations.spec.tsx @@ -0,0 +1,44 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/integration.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedCapabilitiesIntegrations } from '@/__tests__/helpers/mocks/integrations'; +import { useGetCapabilitiesIntegrations } from './useGetCapabilitiesIntegrations.hook'; + +vi.mock('@/data/api/database/integration.api', () => ({ + getServiceIntegrations: vi.fn(), + getServiceCapabilitiesIntegrations: vi.fn(), + addIntegration: vi.fn(), + deleteIntegration: vi.fn(), +})); + +describe('useGetCapabilitiesIntegrations', () => { + it('should return integrations capabilities data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked( + databaseAPI.getServiceCapabilitiesIntegrations, + ).mockResolvedValue([mockedCapabilitiesIntegrations]); + + const { result } = renderHook( + () => useGetCapabilitiesIntegrations(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedCapabilitiesIntegrations]); + expect( + databaseAPI.getServiceCapabilitiesIntegrations, + ).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetIntegrations.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetIntegrations.hook.tsx new file mode 100644 index 000000000000..b3bb8fcfd36e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetIntegrations.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getServiceIntegrations } from '@/data/api/database/integration.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; + +export function useGetIntegrations( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'integration']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getServiceIntegrations({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetIntegrations.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetIntegrations.spec.tsx new file mode 100644 index 000000000000..2c158c0a1852 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/integration/useGetIntegrations.spec.tsx @@ -0,0 +1,42 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/integration.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedIntegrations } from '@/__tests__/helpers/mocks/integrations'; +import { useGetIntegrations } from './useGetIntegrations.hook'; + +vi.mock('@/data/api/database/integration.api', () => ({ + getServiceIntegrations: vi.fn(), + getServiceCapabilitiesIntegrations: vi.fn(), + addIntegration: vi.fn(), + deleteIntegration: vi.fn(), +})); + +describe('useGetIntegrations', () => { + it('should return service integrations data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getServiceIntegrations).mockResolvedValue([ + mockedIntegrations, + ]); + + const { result } = renderHook( + () => useGetIntegrations(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedIntegrations]); + expect(databaseAPI.getServiceIntegrations).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/logs.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/logs/useGetServiceLogs.hook.tsx similarity index 72% rename from packages/manager/apps/pci-databases-analytics/src/hooks/api/logs.api.hooks.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/logs/useGetServiceLogs.hook.tsx index 6dd8f433d50f..1d2560b5ffe6 100644 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/logs.api.hooks.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/logs/useGetServiceLogs.hook.tsx @@ -1,7 +1,7 @@ import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { getServiceLogs } from '@/api/databases/logs'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; +import * as database from '@/types/cloud/project/database'; +import { getServiceLogs } from '@/data/api/database/logs.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; export function useGetServiceLogs( projectId: string, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/logs.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/logs/useGetServiceLogs.spec.tsx similarity index 79% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/logs.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/logs/useGetServiceLogs.spec.tsx index 46060c5e08d9..a4ed364a9a6d 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/logs.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/logs/useGetServiceLogs.spec.tsx @@ -1,13 +1,13 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import { useGetServiceLogs } from '@/hooks/api/logs.api.hooks'; +import { useGetServiceLogs } from '@/hooks/api/database/logs/useGetServiceLogs.hook'; -import * as databaseAPI from '@/api/databases/logs'; -import { database } from '@/models/database'; +import * as databaseAPI from '@/data/api/database/logs.api'; +import * as database from '@/types/cloud/project/database'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; import { mockedLogs } from '@/__tests__/helpers/mocks/logs'; -vi.mock('@/api/databases/logs', () => ({ +vi.mock('@/data/api/database/logs.api', () => ({ getServiceLogs: vi.fn(), })); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useApplyMaintenance.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useApplyMaintenance.hook.tsx new file mode 100644 index 000000000000..98096db78899 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useApplyMaintenance.hook.tsx @@ -0,0 +1,33 @@ +import { useMutation } from '@tanstack/react-query'; + +import * as database from '@/types/cloud/project/database'; +import { CdbError } from '@/data/api/database'; +import { + ApplyMaintenance, + applyMaintenance, +} from '@/data/api/database/maintenance.api'; + +export interface MutateMaintenanceProps { + onError: (cause: CdbError) => void; + onSuccess: (maintenance: database.service.Maintenance) => void; +} + +export function useApplyMaintenance({ + onError, + onSuccess, +}: MutateMaintenanceProps) { + const mutation = useMutation({ + mutationFn: (mtInfo: ApplyMaintenance) => { + return applyMaintenance(mtInfo); + }, + onError, + onSuccess, + }); + + return { + applyMaintenance: (mtInfo: ApplyMaintenance) => { + return mutation.mutate(mtInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/maintenances.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useApplyMaintenance.spec.tsx similarity index 56% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/maintenances.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useApplyMaintenance.spec.tsx index 16ded756f0f8..b93f3144ee70 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/maintenances.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useApplyMaintenance.spec.tsx @@ -1,46 +1,16 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import { - useGetMaintenances, - useApplyMaintenance, -} from '@/hooks/api/maintenances.api.hooks'; -import * as databaseAPI from '@/api/databases/maintenances'; -import { database } from '@/models/database'; +import * as databaseAPI from '@/data/api/database/maintenance.api'; +import * as database from '@/types/cloud/project/database'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; import { mockedMaintenance } from '@/__tests__/helpers/mocks/maintenances'; +import { useApplyMaintenance } from './useApplyMaintenance.hook'; -vi.mock('@/api/databases/maintenances', () => ({ +vi.mock('@/data/api/database/maintenance.api', () => ({ getMaintenances: vi.fn(), applyMaintenance: vi.fn(), })); -describe('useGetMaintenances', () => { - it('should return service maintenances', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getMaintenances).mockResolvedValue([ - mockedMaintenance, - ]); - - const { result } = renderHook( - () => useGetMaintenances(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedMaintenance]); - expect(databaseAPI.getMaintenances).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - describe('useApplyMaintenance', () => { it('should call useApplyMaintenance on mutation with data', async () => { const projectId = 'projectId'; diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useGetMaintenances.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useGetMaintenances.hook.tsx new file mode 100644 index 000000000000..a421df6596e8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useGetMaintenances.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getMaintenances } from '@/data/api/database/maintenance.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; + +export function useGetMaintenances( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'maintenance']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getMaintenances({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useGetMaintenances.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useGetMaintenances.spec.tsx new file mode 100644 index 000000000000..197b7f551333 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/maintenance/useGetMaintenances.spec.tsx @@ -0,0 +1,39 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/maintenance.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedMaintenance } from '@/__tests__/helpers/mocks/maintenances'; +import { useGetMaintenances } from './useGetMaintenances.hook'; + +vi.mock('@/data/api/database/maintenance.api', () => ({ + getMaintenances: vi.fn(), + applyMaintenance: vi.fn(), +})); + +describe('useGetMaintenances', () => { + it('should return service maintenances', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getMaintenances).mockResolvedValue([ + mockedMaintenance, + ]); + + const { result } = renderHook( + () => useGetMaintenances(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedMaintenance]); + expect(databaseAPI.getMaintenances).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/metrics.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetric.hook.tsx similarity index 51% rename from packages/manager/apps/pci-databases-analytics/src/hooks/api/metrics.api.hooks.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetric.hook.tsx index ad140b83f25e..713a61f863bc 100644 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/metrics.api.hooks.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetric.hook.tsx @@ -1,21 +1,7 @@ import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { getMetric, getMetrics } from '@/api/databases/metrics'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetMetrics( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'metric']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getMetrics({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} +import * as database from '@/types/cloud/project/database'; +import { getMetric } from '@/data/api/database/metric.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; export function useGetMetric( projectId: string, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/metrics.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetric.spec.tsx similarity index 54% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/metrics.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetric.spec.tsx index 2585d20da6cd..b134e0929e55 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/metrics.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetric.spec.tsx @@ -1,41 +1,16 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import { useGetMetrics, useGetMetric } from '@/hooks/api/metrics.api.hooks'; -import * as databaseAPI from '@/api/databases/metrics'; -import { database } from '@/models/database'; +import * as databaseAPI from '@/data/api/database/metric.api'; +import * as database from '@/types/cloud/project/database'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; import { mockMetric } from '@/__tests__/helpers/mocks/metrics'; +import { useGetMetric } from './useGetMetric.hook'; -vi.mock('@/api/databases/metrics', () => ({ +vi.mock('@/data/api/database/metric.api', () => ({ getMetrics: vi.fn(), getMetric: vi.fn(), })); -describe('useGetMetrics', () => { - it('should return service Metrics', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getMetrics).mockResolvedValue(['metric1', 'metric2']); - - const { result } = renderHook( - () => useGetMetrics(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual(['metric1', 'metric2']); - expect(databaseAPI.getMetrics).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - describe('useGetMetric', () => { it('should return service Metric', async () => { const projectId = 'projectId'; diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetrics.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetrics.hook.tsx new file mode 100644 index 000000000000..548602c93f23 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetrics.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getMetrics } from '@/data/api/database/metric.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; + +export function useGetMetrics( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'metric']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getMetrics({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetrics.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetrics.spec.tsx new file mode 100644 index 000000000000..1f5bf5cf1a0e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/metric/useGetMetrics.spec.tsx @@ -0,0 +1,36 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/metric.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useGetMetrics } from './useGetMetrics.hook'; + +vi.mock('@/data/api/database/metric.api', () => ({ + getMetrics: vi.fn(), + getMetric: vi.fn(), +})); + +describe('useGetMetrics', () => { + it('should return service Metrics', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getMetrics).mockResolvedValue(['metric1', 'metric2']); + + const { result } = renderHook( + () => useGetMetrics(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(['metric1', 'metric2']); + expect(databaseAPI.getMetrics).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useAddNamespace.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useAddNamespace.hook.tsx new file mode 100644 index 000000000000..f400292b4b59 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useAddNamespace.hook.tsx @@ -0,0 +1,25 @@ +import { useMutation } from '@tanstack/react-query'; +import { CdbError } from '@/data/api/database'; +import * as database from '@/types/cloud/project/database'; +import { AddNamespace, addNamespace } from '@/data/api/database/namespace.api'; + +export interface UseAddNamespace { + onError: (cause: CdbError) => void; + onSuccess: (namespace: database.m3db.Namespace) => void; +} +export function useAddNamespace({ onError, onSuccess }: UseAddNamespace) { + const mutation = useMutation({ + mutationFn: (npInfo: AddNamespace) => { + return addNamespace(npInfo); + }, + onError, + onSuccess, + }); + + return { + addNamespace: (npInfo: AddNamespace) => { + return mutation.mutate(npInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useAddNamespace.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useAddNamespace.spec.tsx new file mode 100644 index 000000000000..233676b72586 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useAddNamespace.spec.tsx @@ -0,0 +1,51 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import { useAddNamespace } from './useAddNamespace.hook'; +import * as databaseAPI from '@/data/api/database/namespace.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { + mockedAddNamespace, + mockedNamespaces, +} from '@/__tests__/helpers/mocks/namespaces'; + +vi.mock('@/data/api/database/namespace.api', () => ({ + getNamespaces: vi.fn(), + addNamespace: vi.fn(), + editNamespace: vi.fn(), + deleteNamespace: vi.fn(), +})); + +describe('useAddNamespace', () => { + it('should call useAddConnectionPool on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.m3db; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.addNamespace).mockResolvedValue(mockedNamespaces); + const { result } = renderHook( + () => useAddNamespace({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const addNamespaceProps = { + projectId, + engine, + serviceId, + namespace: mockedAddNamespace, + }; + result.current.addNamespace(addNamespaceProps); + + await waitFor(() => { + expect(databaseAPI.addNamespace).toHaveBeenCalledWith(addNamespaceProps); + expect(onSuccess).toHaveBeenCalledWith( + mockedNamespaces, + addNamespaceProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useDeleteNamespace.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useDeleteNamespace.hook.tsx new file mode 100644 index 000000000000..8d5a4a9ed153 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useDeleteNamespace.hook.tsx @@ -0,0 +1,27 @@ +import { useMutation } from '@tanstack/react-query'; +import { + DeleteNamespace, + deleteNamespace, +} from '@/data/api/database/namespace.api'; +import { CdbError } from '@/data/api/database'; + +export interface UseDeleteNamespace { + onError: (cause: CdbError) => void; + onSuccess: () => void; +} +export function useDeleteNamespace({ onError, onSuccess }: UseDeleteNamespace) { + const mutation = useMutation({ + mutationFn: (npInfo: DeleteNamespace) => { + return deleteNamespace(npInfo); + }, + onError, + onSuccess, + }); + + return { + deleteNamespace: (npInfo: DeleteNamespace) => { + return mutation.mutate(npInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useDeleteNamespace.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useDeleteNamespace.spec.tsx new file mode 100644 index 000000000000..626048d03a87 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useDeleteNamespace.spec.tsx @@ -0,0 +1,50 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import { useDeleteNamespace } from './useDeleteNamespace.hook'; +import * as databaseAPI from '@/data/api/database/namespace.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; + +vi.mock('@/data/api/database/namespace.api', () => ({ + getNamespaces: vi.fn(), + addNamespace: vi.fn(), + editNamespace: vi.fn(), + deleteNamespace: vi.fn(), +})); + +describe('useDeleteNamespace', () => { + it('should call useDeleteNamespace on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.m3db; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.deleteNamespace).mockResolvedValue(undefined); + + const { result } = renderHook( + () => useDeleteNamespace({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const deleteNamespaceProps = { + projectId, + engine, + serviceId, + namespaceId: 'namespaceId', + }; + result.current.deleteNamespace(deleteNamespaceProps); + + await waitFor(() => { + expect(databaseAPI.deleteNamespace).toHaveBeenCalledWith( + deleteNamespaceProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + undefined, + deleteNamespaceProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useEditNamepsace.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useEditNamepsace.spec.tsx new file mode 100644 index 000000000000..584112f3420a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useEditNamepsace.spec.tsx @@ -0,0 +1,53 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import { useEditNamespace } from './useEditNamespace.hook'; +import * as databaseAPI from '@/data/api/database/namespace.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { + mockedEditNamespace, + mockedNamespaces, +} from '@/__tests__/helpers/mocks/namespaces'; + +vi.mock('@/data/api/database/namespace.api', () => ({ + getNamespaces: vi.fn(), + addNamespace: vi.fn(), + editNamespace: vi.fn(), + deleteNamespace: vi.fn(), +})); + +describe('useEditNamepsace', () => { + it('should call useEditNamespace on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.m3db; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.editNamespace).mockResolvedValue(mockedNamespaces); + const { result } = renderHook( + () => useEditNamespace({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const editNamespaceProps = { + projectId, + engine, + serviceId, + namespace: mockedEditNamespace, + }; + result.current.editNamespace(editNamespaceProps); + + await waitFor(() => { + expect(databaseAPI.editNamespace).toHaveBeenCalledWith( + editNamespaceProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + mockedNamespaces, + editNamespaceProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useEditNamespace.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useEditNamespace.hook.tsx new file mode 100644 index 000000000000..dda5fabbef2b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useEditNamespace.hook.tsx @@ -0,0 +1,28 @@ +import { useMutation } from '@tanstack/react-query'; +import { + EditNamespace, + editNamespace, +} from '@/data/api/database/namespace.api'; +import { CdbError } from '@/data/api/database'; +import * as database from '@/types/cloud/project/database'; + +export interface UsEditNamespace { + onError: (cause: CdbError) => void; + onSuccess: (namespace: database.m3db.Namespace) => void; +} +export function useEditNamespace({ onError, onSuccess }: UsEditNamespace) { + const mutation = useMutation({ + mutationFn: (npInfo: EditNamespace) => { + return editNamespace(npInfo); + }, + onError, + onSuccess, + }); + + return { + editNamespace: (npInfo: EditNamespace) => { + return mutation.mutate(npInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useGetNamespaces.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useGetNamespaces.hook.tsx new file mode 100644 index 000000000000..31292125b52f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useGetNamespaces.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getNamespaces } from '@/data/api/database/namespace.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; + +export function useGetNamespaces( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'namespace']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getNamespaces({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useGetNamespaces.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useGetNamespaces.spec.tsx new file mode 100644 index 000000000000..6cf384be342e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/namespace/useGetNamespaces.spec.tsx @@ -0,0 +1,40 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import { useGetNamespaces } from './useGetNamespaces.hook'; +import * as databaseAPI from '@/data/api/database/namespace.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedNamespaces } from '@/__tests__/helpers/mocks/namespaces'; + +vi.mock('@/data/api/database/namespace.api', () => ({ + getNamespaces: vi.fn(), + addNamespace: vi.fn(), + editNamespace: vi.fn(), + deleteNamespace: vi.fn(), +})); + +describe('useGetNamespaces', () => { + it('should return Namespaces data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.m3db; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getNamespaces).mockResolvedValue([mockedNamespaces]); + + const { result } = renderHook( + () => useGetNamespaces(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedNamespaces]); + expect(databaseAPI.getNamespaces).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useAddNode.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useAddNode.hook.tsx new file mode 100644 index 000000000000..16dfa7ffe896 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useAddNode.hook.tsx @@ -0,0 +1,25 @@ +import { useMutation } from '@tanstack/react-query'; +import { CdbError } from '@/data/api/database'; +import { AddNode, addNode } from '@/data/api/database/node.api'; +import * as database from '@/types/cloud/project/database'; + +interface UseAddNode { + onError: (cause: CdbError) => void; + onSuccess: (service: database.service.Node) => void; +} +export function useAddNode({ onError, onSuccess }: UseAddNode) { + const mutation = useMutation({ + mutationFn: (nodeInfo: AddNode) => { + return addNode(nodeInfo); + }, + onError, + onSuccess, + }); + + return { + addNode: (nodeInfo: AddNode) => { + return mutation.mutate(nodeInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/nodes.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useAddNode.spec.tsx similarity index 51% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/nodes.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useAddNode.spec.tsx index 521e421c4a31..c1f9ce09a243 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/nodes.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useAddNode.spec.tsx @@ -1,13 +1,13 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import * as databaseAPI from '@/api/databases/nodes'; -import { database } from '@/models/database'; +import * as databaseAPI from '@/data/api/database/node.api'; +import * as database from '@/types/cloud/project/database'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { useAddNode, useDeleteNode } from '@/hooks/api/nodes.api.hooks'; +import { useAddNode } from '@/hooks/api/database/node/useAddNode.hook'; import { mockedNode } from '@/__tests__/helpers/mocks/nodes'; -vi.mock('@/api/databases/nodes', () => ({ +vi.mock('@/data/api/database/node.api', () => ({ addNode: vi.fn(), deleteNode: vi.fn(), })); @@ -43,36 +43,3 @@ describe('useAddNode', () => { }); }); }); - -describe('useDeleteNode', () => { - it('should call useDeleteNode on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.deleteNode).mockResolvedValue(undefined); - - const { result } = renderHook(() => useDeleteNode({ onError, onSuccess }), { - wrapper: QueryClientWrapper, - }); - - const deleteNodeProps = { - projectId, - engine, - serviceId, - nodeId: 'nodeId', - }; - result.current.deleteNode(deleteNodeProps); - - await waitFor(() => { - expect(databaseAPI.deleteNode).toHaveBeenCalledWith(deleteNodeProps); - expect(onSuccess).toHaveBeenCalledWith( - undefined, - deleteNodeProps, - undefined, - ); - }); - }); -}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useDeleteNode.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useDeleteNode.hook.tsx new file mode 100644 index 000000000000..5d4418d18182 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useDeleteNode.hook.tsx @@ -0,0 +1,25 @@ +import { useMutation } from '@tanstack/react-query'; +import { DeleteNode, deleteNode } from '@/data/api/database/node.api'; +import { CdbError } from '@/data/api/database'; + +export interface UseDeleteNodeProps { + onError: (cause: CdbError) => void; + onSuccess: () => void; +} + +export function useDeleteNode({ onError, onSuccess }: UseDeleteNodeProps) { + const mutation = useMutation({ + mutationFn: (nodeInfo: DeleteNode) => { + return deleteNode(nodeInfo); + }, + onError, + onSuccess, + }); + + return { + deleteNode: (nodeInfo: DeleteNode) => { + return mutation.mutate(nodeInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useDeleteNode.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useDeleteNode.spec.tsx new file mode 100644 index 000000000000..024dc92a2183 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/node/useDeleteNode.spec.tsx @@ -0,0 +1,45 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/node.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useDeleteNode } from './useDeleteNode.hook'; + +vi.mock('@/data/api/database/node.api', () => ({ + addNode: vi.fn(), + deleteNode: vi.fn(), +})); + +describe('useDeleteNode', () => { + it('should call useDeleteNode on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.deleteNode).mockResolvedValue(undefined); + + const { result } = renderHook(() => useDeleteNode({ onError, onSuccess }), { + wrapper: QueryClientWrapper, + }); + + const deleteNodeProps = { + projectId, + engine, + serviceId, + nodeId: 'nodeId', + }; + result.current.deleteNode(deleteNodeProps); + + await waitFor(() => { + expect(databaseAPI.deleteNode).toHaveBeenCalledWith(deleteNodeProps); + expect(onSuccess).toHaveBeenCalledWith( + undefined, + deleteNodeProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useCancelCurrentQuery.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useCancelCurrentQuery.hook.tsx new file mode 100644 index 000000000000..99ada523d315 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useCancelCurrentQuery.hook.tsx @@ -0,0 +1,33 @@ +import { useMutation } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { + CancelQuery, + cancelCurrentQuery, +} from '@/data/api/database/queries.api'; +import { CdbError } from '@/data/api/database'; + +interface UseCancelCurrentQuery { + onError: (cause: CdbError) => void; + onSuccess: ( + database: database.service.currentqueries.query.CancelResponse, + ) => void; +} +export function useCancelCurrentQuery({ + onError, + onSuccess, +}: UseCancelCurrentQuery) { + const mutation = useMutation({ + mutationFn: (currentQueryInfo: CancelQuery) => { + return cancelCurrentQuery(currentQueryInfo); + }, + onError, + onSuccess, + }); + + return { + cancelCurrentQuery: (currentQueryInfo: CancelQuery) => { + return mutation.mutate(currentQueryInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useCancelCurrentQuery.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useCancelCurrentQuery.spec.tsx new file mode 100644 index 000000000000..895d3aa3a3a3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useCancelCurrentQuery.spec.tsx @@ -0,0 +1,54 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/queries.api'; +import * as database from '@/types/cloud/project/database'; +import { useCancelCurrentQuery } from './useCancelCurrentQuery.hook'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; + +vi.mock('@/data/api/database/queries.api', () => ({ + getCurrentQueries: vi.fn(), + cancelCurrentQuery: vi.fn(), + getQueryStatistics: vi.fn(), + resetQueryStatistics: vi.fn(), +})); + +describe('useCancelCurrentQuery', () => { + it('should call useCancelCurrentQuery on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const pid = 1; + const terminate = true; + const mockCancelResponse = { success: true }; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.cancelCurrentQuery).mockResolvedValue( + mockCancelResponse, + ); + const { result } = renderHook( + () => useCancelCurrentQuery({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const cancelCurrentQueryProps = { + projectId, + engine, + serviceId, + pid, + terminate, + }; + result.current.cancelCurrentQuery(cancelCurrentQueryProps); + + await waitFor(() => { + expect(databaseAPI.cancelCurrentQuery).toHaveBeenCalledWith( + cancelCurrentQueryProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + mockCancelResponse, + cancelCurrentQueryProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetCurrentQueries.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetCurrentQueries.hook.tsx new file mode 100644 index 000000000000..fe6559445ee3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetCurrentQueries.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getCurrentQueries } from '@/data/api/database/queries.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; + +export function useGetCurrentQueries( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'currentQueries']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getCurrentQueries({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetCurrentQueries.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetCurrentQueries.spec.tsx new file mode 100644 index 000000000000..70c6778da3ce --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetCurrentQueries.spec.tsx @@ -0,0 +1,39 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/queries.api'; +import * as database from '@/types/cloud/project/database'; +import { useGetCurrentQueries } from '@/hooks/api/database/query/useGetCurrentQueries.hook'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedQueries } from '@/__tests__/helpers/mocks/queries'; + +vi.mock('@/data/api/database/queries.api', () => ({ + getCurrentQueries: vi.fn(), + cancelCurrentQuery: vi.fn(), + getQueryStatistics: vi.fn(), + resetQueryStatistics: vi.fn(), +})); + +describe('useGetCurrentQueries', () => { + it('should return currentQuery data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getCurrentQueries).mockResolvedValue([mockedQueries]); + + const { result } = renderHook( + () => useGetCurrentQueries(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedQueries]); + expect(databaseAPI.getCurrentQueries).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetQueryStatistics.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetQueryStatistics.hook.tsx new file mode 100644 index 000000000000..9d6b1426fb57 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetQueryStatistics.hook.tsx @@ -0,0 +1,27 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { + QueryStatistics, + getQueryStatistics, +} from '@/data/api/database/queries.api'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetQueryStatistics( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [ + projectId, + 'database', + engine, + serviceId, + 'queryStatistics', + ]; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getQueryStatistics({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetQueryStatistics.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetQueryStatistics.spec.tsx new file mode 100644 index 000000000000..2d70bd00ac9c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useGetQueryStatistics.spec.tsx @@ -0,0 +1,41 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as databaseAPI from '@/data/api/database/queries.api'; +import * as database from '@/types/cloud/project/database'; +import { useGetQueryStatistics } from './useGetQueryStatistics.hook'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedQueryStatistics } from '@/__tests__/helpers/mocks/queries'; + +vi.mock('@/data/api/database/queries.api', () => ({ + getCurrentQueries: vi.fn(), + cancelCurrentQuery: vi.fn(), + getQueryStatistics: vi.fn(), + resetQueryStatistics: vi.fn(), +})); + +describe('useGetQueryStatistics', () => { + it('should return QueryStatistics data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getQueryStatistics).mockResolvedValue([ + mockedQueryStatistics, + ]); + + const { result } = renderHook( + () => useGetQueryStatistics(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedQueryStatistics]); + expect(databaseAPI.getQueryStatistics).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useResetQueryStatistics.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useResetQueryStatistics.hook.tsx new file mode 100644 index 000000000000..36daad16dbbd --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useResetQueryStatistics.hook.tsx @@ -0,0 +1,27 @@ +import { useMutation } from '@tanstack/react-query'; +import { resetQueryStatistics } from '@/data/api/database/queries.api'; +import { CdbError, ServiceData } from '@/data/api/database'; + +interface UseResetQueryStatistics { + onError: (cause: CdbError) => void; + onSuccess: () => void; +} +export function useResetQueryStatistics({ + onError, + onSuccess, +}: UseResetQueryStatistics) { + const mutation = useMutation({ + mutationFn: (serviceInfo: ServiceData) => { + return resetQueryStatistics(serviceInfo); + }, + onError, + onSuccess, + }); + + return { + resetQueryStatistics: (serviceInfo: ServiceData) => { + return mutation.mutate(serviceInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/queries.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useResetQueryStatistics.spec.tsx similarity index 55% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/queries.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useResetQueryStatistics.spec.tsx index a3b85fa41013..99b5b76382dd 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/queries.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/query/useResetQueryStatistics.spec.tsx @@ -1,78 +1,18 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import * as databaseAPI from '@/api/databases/queries'; -import { database } from '@/models/database'; -import { - useGetQueryStatistics, - useGetCurrentQueries, - useCancelCurrentQuery, - useResetQueryStatistics, -} from '@/hooks/api/queries.api.hooks'; +import * as databaseAPI from '@/data/api/database/queries.api'; +import * as database from '@/types/cloud/project/database'; +import { useCancelCurrentQuery } from './useCancelCurrentQuery.hook'; +import { useResetQueryStatistics } from './useResetQueryStatistics.hook'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { - mockedQueries, - mockedQueryStatistics, -} from '@/__tests__/helpers/mocks/queries'; -vi.mock('@/api/databases/queries', () => ({ +vi.mock('@/data/api/database/queries.api', () => ({ getCurrentQueries: vi.fn(), cancelCurrentQuery: vi.fn(), getQueryStatistics: vi.fn(), resetQueryStatistics: vi.fn(), })); -describe('useGetCurrentQueries', () => { - it('should return currentQuery data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getCurrentQueries).mockResolvedValue([mockedQueries]); - - const { result } = renderHook( - () => useGetCurrentQueries(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedQueries]); - expect(databaseAPI.getCurrentQueries).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useGetQueryStatistics', () => { - it('should return QueryStatistics data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getQueryStatistics).mockResolvedValue([ - mockedQueryStatistics, - ]); - - const { result } = renderHook( - () => useGetQueryStatistics(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedQueryStatistics]); - expect(databaseAPI.getQueryStatistics).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - describe('useCancelCurrentQuery', () => { it('should call useCancelCurrentQuery on mutation with data', async () => { const projectId = 'projectId'; diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useAddService.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useAddService.hook.tsx new file mode 100644 index 000000000000..83dd5db3bd0b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useAddService.hook.tsx @@ -0,0 +1,41 @@ +import { useMutation, useQueryClient } from '@tanstack/react-query'; +import { useParams } from 'react-router-dom'; +import * as database from '@/types/cloud/project/database'; +import { addService } from '@/data/api/database/service.api'; +import { CdbError } from '@/data/api/database'; + +interface UseAddService { + onError: (cause: CdbError) => void; + onSuccess: (service: database.Service) => void; +} +export interface ServiceCreationWithEngine + extends Partial { + engine: database.EngineEnum; +} +export function useAddService({ onError, onSuccess }: UseAddService) { + const queryClient = useQueryClient(); + const { projectId } = useParams(); + const mutation = useMutation({ + mutationFn: (serviceAndEngine: ServiceCreationWithEngine) => { + const { engine, ...serviceInfo } = serviceAndEngine; + return addService({ projectId, engine, serviceInfo }); + }, + onError, + onSuccess: (data) => { + // invalidate services list to avoid displaying + // old list + queryClient.invalidateQueries({ + queryKey: [projectId, 'database/service'], + refetchType: 'none', + }); + onSuccess(data); + }, + }); + + return { + addService: (serviceAndEngine: ServiceCreationWithEngine) => { + return mutation.mutate(serviceAndEngine); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useAddService.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useAddService.spec.tsx new file mode 100644 index 000000000000..8258b3db76eb --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useAddService.spec.tsx @@ -0,0 +1,42 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import { useAddService } from './useAddService.hook'; +import * as databaseAPI from '@/data/api/database/service.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { + mockedService, + mockedServiceCreation, + mockedServiceCreationWithEngine, +} from '@/__tests__/helpers/mocks/services'; + +vi.mock('@/data/api/database/service.api', () => ({ + getServices: vi.fn(), + getService: vi.fn(), + addService: vi.fn(), + editService: vi.fn(), + deleteService: vi.fn(), +})); + +describe('useAddService', () => { + it('should call useAddService on mutation with data', async () => { + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.addService).mockResolvedValue(mockedService); + const { result } = renderHook(() => useAddService({ onError, onSuccess }), { + wrapper: QueryClientWrapper, + }); + + result.current.addService(mockedServiceCreationWithEngine); + + await waitFor(() => { + expect(databaseAPI.addService).toHaveBeenCalledWith({ + projectId: undefined, + engine: database.EngineEnum.mongodb, + serviceInfo: mockedServiceCreation, + }); + expect(onSuccess).toHaveBeenCalledWith(mockedService); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useDeleteService.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useDeleteService.hook.tsx new file mode 100644 index 000000000000..d06e595e39a2 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useDeleteService.hook.tsx @@ -0,0 +1,25 @@ +import { useMutation } from '@tanstack/react-query'; +import { deleteService } from '@/data/api/database/service.api'; +import { CdbError, ServiceData } from '@/data/api/database'; + +interface UseDeleteService { + onError: (cause: CdbError) => void; + onSuccess: () => void; +} + +export function useDeleteService({ onError, onSuccess }: UseDeleteService) { + const mutation = useMutation({ + mutationFn: (serviceInfo: ServiceData) => { + return deleteService(serviceInfo); + }, + onError, + onSuccess, + }); + + return { + deleteService: (serviceInfo: ServiceData) => { + return mutation.mutate(serviceInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/services.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useDeleteService.spec.tsx similarity index 56% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/services.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useDeleteService.spec.tsx index 560bfd2bd59d..2764f233f815 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/services.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useDeleteService.spec.tsx @@ -1,15 +1,10 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; - -import { - useGetServices, - useGetService, - useAddService, - useUpdateService, - useDeleteService, -} from '@/hooks/api/services.api.hooks'; -import * as databaseAPI from '@/api/databases/service'; -import { database } from '@/models/database'; +import { useDeleteService } from './useDeleteService.hook'; +import { useEditService } from './useEditService.hook'; +import { useAddService } from './useAddService.hook'; +import * as databaseAPI from '@/data/api/database/service.api'; +import * as database from '@/types/cloud/project/database'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; import { mockedService, @@ -17,55 +12,14 @@ import { mockedServiceCreationWithEngine, } from '@/__tests__/helpers/mocks/services'; -vi.mock('@/api/databases/service', () => ({ +vi.mock('@/data/api/database/service.api', () => ({ getServices: vi.fn(), getService: vi.fn(), addService: vi.fn(), - updateService: vi.fn(), + editService: vi.fn(), deleteService: vi.fn(), })); -describe('useGetServices', () => { - it('should return services data', async () => { - const projectId = 'projectId'; - - vi.mocked(databaseAPI.getServices).mockResolvedValue([mockedService]); - - const { result } = renderHook(() => useGetServices(projectId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedService]); - expect(databaseAPI.getServices).toHaveBeenCalledWith({ - projectId, - }); - }); - }); -}); - -describe('useGetService', () => { - it('should return service data', async () => { - const projectId = 'projectId'; - const serviceId = 'serviceId'; - vi.mocked(databaseAPI.getService).mockResolvedValue(mockedService); - - const { result } = renderHook(() => useGetService(projectId, serviceId), { - wrapper: QueryClientWrapper, - }); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual(mockedService); - expect(databaseAPI.getService).toHaveBeenCalledWith({ - projectId, - serviceId, - }); - }); - }); -}); - describe('useAddService', () => { it('should call useAddService on mutation with data', async () => { const onSuccess = vi.fn(); @@ -89,35 +43,33 @@ describe('useAddService', () => { }); }); -describe('useUpdateService', () => { - it('should call useUpdateService on mutation with data', async () => { +describe('useEditService', () => { + it('should call useEditService on mutation with data', async () => { const projectId = 'projectId'; const engine = database.EngineEnum.mysql; const serviceId = 'serviceId'; const onSuccess = vi.fn(); const onError = vi.fn(); - vi.mocked(databaseAPI.updateService).mockResolvedValue(mockedService); + vi.mocked(databaseAPI.editService).mockResolvedValue(mockedService); const { result } = renderHook( - () => useUpdateService({ onError, onSuccess }), + () => useEditService({ onError, onSuccess }), { wrapper: QueryClientWrapper }, ); - const updateServiceProps: databaseAPI.UpdateServiceProps = { + const editServiceProps: databaseAPI.EditService = { projectId, engine, serviceId, data: mockedService, }; - result.current.updateService(updateServiceProps); + result.current.editService(editServiceProps); await waitFor(() => { - expect(databaseAPI.updateService).toHaveBeenCalledWith( - updateServiceProps, - ); + expect(databaseAPI.editService).toHaveBeenCalledWith(editServiceProps); expect(onSuccess).toHaveBeenCalledWith( mockedService, - updateServiceProps, + editServiceProps, undefined, ); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useEditService.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useEditService.hook.tsx new file mode 100644 index 000000000000..b7d7d9bd8b5b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useEditService.hook.tsx @@ -0,0 +1,23 @@ +import { useMutation } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { EditService, editService } from '@/data/api/database/service.api'; +import { CdbError } from '@/data/api/database'; + +interface UseEditService { + onError: (cause: CdbError) => void; + onSuccess: (service: database.Service) => void; +} +export function useEditService({ onError, onSuccess }: UseEditService) { + const mutation = useMutation({ + mutationFn: (serviceUpdate: EditService) => editService(serviceUpdate), + onError, + onSuccess, + }); + + return { + editService: (serviceAndEngine: EditService) => { + return mutation.mutate(serviceAndEngine); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useEditService.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useEditService.spec.tsx new file mode 100644 index 000000000000..ad465d60a0f0 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useEditService.spec.tsx @@ -0,0 +1,48 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import { useEditService } from './useEditService.hook'; +import * as databaseAPI from '@/data/api/database/service.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedService } from '@/__tests__/helpers/mocks/services'; + +vi.mock('@/data/api/database/service.api', () => ({ + getServices: vi.fn(), + getService: vi.fn(), + addService: vi.fn(), + editService: vi.fn(), + deleteService: vi.fn(), +})); + +describe('useEditService', () => { + it('should call useEditService on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.editService).mockResolvedValue(mockedService); + const { result } = renderHook( + () => useEditService({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const editServiceProps: databaseAPI.EditService = { + projectId, + engine, + serviceId, + data: mockedService, + }; + result.current.editService(editServiceProps); + + await waitFor(() => { + expect(databaseAPI.editService).toHaveBeenCalledWith(editServiceProps); + expect(onSuccess).toHaveBeenCalledWith( + mockedService, + editServiceProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetService.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetService.hook.tsx new file mode 100644 index 000000000000..2899b7fbad47 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetService.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getService } from '@/data/api/database/service.api'; +import { CdbError } from '@/data/api/database'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; + +export function useGetService( + projectId: string, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database/service', serviceId]; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getService({ projectId, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetService.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetService.spec.tsx new file mode 100644 index 000000000000..c443313de121 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetService.spec.tsx @@ -0,0 +1,36 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import { useGetService } from '@/hooks/api/database/service/useGetService.hook'; +import * as databaseAPI from '@/data/api/database/service.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedService } from '@/__tests__/helpers/mocks/services'; + +vi.mock('@/data/api/database/service.api', () => ({ + getServices: vi.fn(), + getService: vi.fn(), + addService: vi.fn(), + editService: vi.fn(), + deleteService: vi.fn(), +})); + +describe('useGetService', () => { + it('should return service data', async () => { + const projectId = 'projectId'; + const serviceId = 'serviceId'; + vi.mocked(databaseAPI.getService).mockResolvedValue(mockedService); + + const { result } = renderHook(() => useGetService(projectId, serviceId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(mockedService); + expect(databaseAPI.getService).toHaveBeenCalledWith({ + projectId, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetServices.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetServices.hook.tsx new file mode 100644 index 000000000000..80e0c5c2aefc --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetServices.hook.tsx @@ -0,0 +1,16 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getServices } from '@/data/api/database/service.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; + +export function useGetServices( + projectId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database/service']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getServices({ projectId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetServices.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetServices.spec.tsx new file mode 100644 index 000000000000..d9a4d92d741c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/service/useGetServices.spec.tsx @@ -0,0 +1,35 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import { useGetServices } from './useGetServices.hook'; +import * as databaseAPI from '@/data/api/database/service.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedService } from '@/__tests__/helpers/mocks/services'; + +vi.mock('@/data/api/database/service.api', () => ({ + getServices: vi.fn(), + getService: vi.fn(), + addService: vi.fn(), + editService: vi.fn(), + deleteService: vi.fn(), +})); + +describe('useGetServices', () => { + it('should return services data', async () => { + const projectId = 'projectId'; + + vi.mocked(databaseAPI.getServices).mockResolvedValue([mockedService]); + + const { result } = renderHook(() => useGetServices(projectId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedService]); + expect(databaseAPI.getServices).toHaveBeenCalledWith({ + projectId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useAddUser.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useAddUser.hook.tsx new file mode 100644 index 000000000000..7f5a8f91ff0b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useAddUser.hook.tsx @@ -0,0 +1,24 @@ +import { useMutation } from '@tanstack/react-query'; +import { AddUser, GenericUser, addUser } from '@/data/api/database/user.api'; +import { CdbError } from '@/data/api/database'; + +export interface UseAddUser { + onError: (cause: CdbError) => void; + onSuccess: (user: GenericUser) => void; +} +export function useAddUser({ onError, onSuccess }: UseAddUser) { + const mutation = useMutation({ + mutationFn: (userInfo: AddUser) => { + return addUser(userInfo); + }, + onError, + onSuccess, + }); + + return { + addUser: (userInfo: AddUser) => { + return mutation.mutate(userInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useAddUser.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useAddUser.spec.tsx new file mode 100644 index 000000000000..d433f85d1b98 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useAddUser.spec.tsx @@ -0,0 +1,52 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useAddUser } from './useAddUser.hook'; +import { + mockedDatabaseUser, + mockedDatabaseUserCreation, +} from '@/__tests__/helpers/mocks/databaseUser'; + +vi.mock('@/data/api/database/user.api', () => ({ + getUsers: vi.fn(), + addUser: vi.fn(), + deleteUser: vi.fn(), + resetUserPassword: vi.fn(), + getRoles: vi.fn(), + editUser: vi.fn(), +})); + +describe('useAddUser', () => { + it('should call useAddUser on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.addUser).mockResolvedValue(mockedDatabaseUser); + const { result } = renderHook(() => useAddUser({ onError, onSuccess }), { + wrapper: QueryClientWrapper, + }); + + const addUserProps = { + projectId, + engine, + serviceId, + user: mockedDatabaseUserCreation, + }; + result.current.addUser(addUserProps); + + await waitFor(() => { + expect(databaseAPI.addUser).toHaveBeenCalledWith(addUserProps); + expect(onSuccess).toHaveBeenCalledWith( + mockedDatabaseUser, + addUserProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useDeleteUser.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useDeleteUser.hook.tsx new file mode 100644 index 000000000000..1856c62f9544 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useDeleteUser.hook.tsx @@ -0,0 +1,24 @@ +import { useMutation } from '@tanstack/react-query'; +import { DeleteUser, deleteUser } from '@/data/api/database/user.api'; +import { CdbError } from '@/data/api/database'; + +interface UseDeleteUser { + onError: (cause: CdbError) => void; + onSuccess: () => void; +} +export function useDeleteUser({ onError, onSuccess }: UseDeleteUser) { + const mutation = useMutation({ + mutationFn: (userInfo: DeleteUser) => { + return deleteUser(userInfo); + }, + onError, + onSuccess, + }); + + return { + deleteUser: (userInfo: DeleteUser) => { + return mutation.mutate(userInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useDeleteUser.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useDeleteUser.spec.tsx new file mode 100644 index 000000000000..e0440a847e83 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useDeleteUser.spec.tsx @@ -0,0 +1,49 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useDeleteUser } from './useDeleteUser.hook'; + +vi.mock('@/data/api/database/user.api', () => ({ + getUsers: vi.fn(), + addUser: vi.fn(), + deleteUser: vi.fn(), + resetUserPassword: vi.fn(), + getRoles: vi.fn(), + editUser: vi.fn(), +})); + +describe('useDeleteUser', () => { + it('should call useDeleteUser on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.deleteUser).mockResolvedValue(undefined); + + const { result } = renderHook(() => useDeleteUser({ onError, onSuccess }), { + wrapper: QueryClientWrapper, + }); + + const deleteUserProps = { + projectId, + engine, + serviceId, + userId: 'userId', + }; + result.current.deleteUser(deleteUserProps); + + await waitFor(() => { + expect(databaseAPI.deleteUser).toHaveBeenCalledWith(deleteUserProps); + expect(onSuccess).toHaveBeenCalledWith( + undefined, + deleteUserProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useEditUser.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useEditUser.hook.tsx new file mode 100644 index 000000000000..b215283a231f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useEditUser.hook.tsx @@ -0,0 +1,24 @@ +import { useMutation } from '@tanstack/react-query'; +import { EditUser, GenericUser, editUser } from '@/data/api/database/user.api'; +import { CdbError } from '@/data/api/database'; + +export interface UseEditUser { + onError: (cause: CdbError) => void; + onSuccess: (user: GenericUser) => void; +} +export function useEditUser({ onError, onSuccess }: UseEditUser) { + const mutation = useMutation({ + mutationFn: (userInfo: EditUser) => { + return editUser(userInfo); + }, + onError, + onSuccess, + }); + + return { + editUser: (userInfo: EditUser) => { + return mutation.mutate(userInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/users.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useEditUser.spec.tsx similarity index 55% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/users.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useEditUser.spec.tsx index a9a578ae7482..3e4da59ab670 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/users.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useEditUser.spec.tsx @@ -1,25 +1,19 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import * as databaseAPI from '@/api/databases/users'; -import { database } from '@/models/database'; +import * as databaseAPI from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import { - useGetUsers, - useAddUser, - useEditUser, - useGetRoles, - useResetUserPassword, - useDeleteUser, -} from '@/hooks/api/users.api.hooks'; +import { useResetUserPassword } from './useResetUserPassword.hook'; +import { useDeleteUser } from './useDeleteUser.hook'; +import { useEditUser } from './useEditUser.hook'; import { mockedDatabaseUser, - mockedDatabaseUserCreation, mockedDatabaseUserEdition, mockedDatabaseUserWithPassword, } from '@/__tests__/helpers/mocks/databaseUser'; -vi.mock('@/api/databases/users', () => ({ +vi.mock('@/data/api/database/user.api', () => ({ getUsers: vi.fn(), addUser: vi.fn(), deleteUser: vi.fn(), @@ -28,88 +22,6 @@ vi.mock('@/api/databases/users', () => ({ editUser: vi.fn(), })); -describe('useGetUsers', () => { - it('should return users data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - - vi.mocked(databaseAPI.getUsers).mockResolvedValue([mockedDatabaseUser]); - - const { result } = renderHook( - () => useGetUsers(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual([mockedDatabaseUser]); - expect(databaseAPI.getUsers).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useGetRoles', () => { - it('should return roles data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const mockedRoles = ['Roles1', 'Roles2']; - vi.mocked(databaseAPI.getRoles).mockResolvedValue(mockedRoles); - - const { result } = renderHook( - () => useGetRoles(projectId, engine, serviceId), - { wrapper: QueryClientWrapper }, - ); - - await waitFor(() => { - expect(result.current.isSuccess).toBe(true); - expect(result.current.data).toEqual(mockedRoles); - expect(databaseAPI.getRoles).toHaveBeenCalledWith({ - projectId, - engine, - serviceId, - }); - }); - }); -}); - -describe('useAddUser', () => { - it('should call useAddUser on mutation with data', async () => { - const projectId = 'projectId'; - const engine = database.EngineEnum.mysql; - const serviceId = 'serviceId'; - const onSuccess = vi.fn(); - const onError = vi.fn(); - - vi.mocked(databaseAPI.addUser).mockResolvedValue(mockedDatabaseUser); - const { result } = renderHook(() => useAddUser({ onError, onSuccess }), { - wrapper: QueryClientWrapper, - }); - - const addUserProps = { - projectId, - engine, - serviceId, - user: mockedDatabaseUserCreation, - }; - result.current.addUser(addUserProps); - - await waitFor(() => { - expect(databaseAPI.addUser).toHaveBeenCalledWith(addUserProps); - expect(onSuccess).toHaveBeenCalledWith( - mockedDatabaseUser, - addUserProps, - undefined, - ); - }); - }); -}); - describe('useEditUser', () => { it('should call useEditUser on mutation with data', async () => { const projectId = 'projectId'; diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetRoles.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetRoles.hook.tsx new file mode 100644 index 000000000000..f345bf050ad3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetRoles.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { getRoles } from '@/data/api/database/user.api'; +import { useQueryImmediateRefetch } from '../../useImmediateRefetch'; + +export function useGetRoles( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'roles']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getRoles({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetRoles.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetRoles.spec.tsx new file mode 100644 index 000000000000..ff15d8250726 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetRoles.spec.tsx @@ -0,0 +1,41 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useGetRoles } from './useGetRoles.hook'; + +vi.mock('@/data/api/database/user.api', () => ({ + getUsers: vi.fn(), + addUser: vi.fn(), + deleteUser: vi.fn(), + resetUserPassword: vi.fn(), + getRoles: vi.fn(), + editUser: vi.fn(), +})); + +describe('useGetRoles', () => { + it('should return roles data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const mockedRoles = ['Roles1', 'Roles2']; + vi.mocked(databaseAPI.getRoles).mockResolvedValue(mockedRoles); + + const { result } = renderHook( + () => useGetRoles(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(mockedRoles); + expect(databaseAPI.getRoles).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetUsers.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetUsers.hook.tsx new file mode 100644 index 000000000000..5e2ab8c36d9e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetUsers.hook.tsx @@ -0,0 +1,18 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { GenericUser, getUsers } from '@/data/api/database/user.api'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; + +export function useGetUsers( + projectId: string, + engine: database.EngineEnum, + serviceId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'database', engine, serviceId, 'user']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => getUsers({ projectId, engine, serviceId }), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetUsers.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetUsers.spec.tsx new file mode 100644 index 000000000000..2746a77cc8f1 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useGetUsers.spec.tsx @@ -0,0 +1,42 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useGetUsers } from '@/hooks/api/database/user/useGetUsers.hook'; +import { mockedDatabaseUser } from '@/__tests__/helpers/mocks/databaseUser'; + +vi.mock('@/data/api/database/user.api', () => ({ + getUsers: vi.fn(), + addUser: vi.fn(), + deleteUser: vi.fn(), + resetUserPassword: vi.fn(), + getRoles: vi.fn(), + editUser: vi.fn(), +})); + +describe('useGetUsers', () => { + it('should return users data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + + vi.mocked(databaseAPI.getUsers).mockResolvedValue([mockedDatabaseUser]); + + const { result } = renderHook( + () => useGetUsers(projectId, engine, serviceId), + { wrapper: QueryClientWrapper }, + ); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual([mockedDatabaseUser]); + expect(databaseAPI.getUsers).toHaveBeenCalledWith({ + projectId, + engine, + serviceId, + }); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useResetUserPassword.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useResetUserPassword.hook.tsx new file mode 100644 index 000000000000..4507122d7888 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useResetUserPassword.hook.tsx @@ -0,0 +1,31 @@ +import { useMutation } from '@tanstack/react-query'; +import * as database from '@/types/cloud/project/database'; +import { + ResetUserPassword, + resetUserPassword, +} from '@/data/api/database/user.api'; +import { CdbError } from '@/data/api/database'; + +interface UseResetUserPassword { + onError: (cause: CdbError) => void; + onSuccess: (user: database.service.UserWithPassword) => void; +} +export function useResetUserPassword({ + onError, + onSuccess, +}: UseResetUserPassword) { + const mutation = useMutation({ + mutationFn: (userInfo: ResetUserPassword) => { + return resetUserPassword(userInfo); + }, + onError, + onSuccess, + }); + + return { + resetUserPassword: (userInfo: ResetUserPassword) => { + return mutation.mutate(userInfo); + }, + ...mutation, + }; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useResetUserPassword.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useResetUserPassword.spec.tsx new file mode 100644 index 000000000000..7a34cd8c0bce --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/database/user/useResetUserPassword.spec.tsx @@ -0,0 +1,54 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; + +import * as databaseAPI from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { useResetUserPassword } from './useResetUserPassword.hook'; +import { mockedDatabaseUserWithPassword } from '@/__tests__/helpers/mocks/databaseUser'; + +vi.mock('@/data/api/database/user.api', () => ({ + getUsers: vi.fn(), + addUser: vi.fn(), + deleteUser: vi.fn(), + resetUserPassword: vi.fn(), + getRoles: vi.fn(), + editUser: vi.fn(), +})); + +describe('useResetUserPassword', () => { + it('should call useResetUserPassword on mutation with data', async () => { + const projectId = 'projectId'; + const engine = database.EngineEnum.mysql; + const serviceId = 'serviceId'; + const onSuccess = vi.fn(); + const onError = vi.fn(); + + vi.mocked(databaseAPI.resetUserPassword).mockResolvedValue( + mockedDatabaseUserWithPassword, + ); + const { result } = renderHook( + () => useResetUserPassword({ onError, onSuccess }), + { wrapper: QueryClientWrapper }, + ); + + const resetPasswordUserProps = { + projectId, + engine, + serviceId, + userId: 'userId', + }; + result.current.resetUserPassword(resetPasswordUserProps); + + await waitFor(() => { + expect(databaseAPI.resetUserPassword).toHaveBeenCalledWith( + resetPasswordUserProps, + ); + expect(onSuccess).toHaveBeenCalledWith( + mockedDatabaseUserWithPassword, + resetPasswordUserProps, + undefined, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/databases.api.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/databases.api.hook.tsx deleted file mode 100644 index ccbf38c2a0e8..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/databases.api.hook.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, -} from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { - AddDatabaseProps, - DeleteDatabaseProps, - addDatabase, - deleteDatabase, - getServiceDatabases, -} from '@/api/databases/databases'; -import { CdbError } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetDatabases( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'database']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getServiceDatabases({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -interface MutateDatabaseProps { - onError: (cause: CdbError) => void; - onSuccess: (database: database.service.Database) => void; -} -export function useAddDatabase({ onError, onSuccess }: MutateDatabaseProps) { - const mutation = useMutation({ - mutationFn: (databaseInfo: AddDatabaseProps) => { - return addDatabase(databaseInfo); - }, - onError, - onSuccess, - }); - - return { - addDatabase: (databaseInfo: AddDatabaseProps) => { - return mutation.mutate(databaseInfo); - }, - ...mutation, - }; -} - -interface UseDeleteDatabaseProps { - onError: (cause: CdbError) => void; - onSuccess: () => void; -} -export function useDeleteDatabase({ - onError, - onSuccess, -}: UseDeleteDatabaseProps) { - const mutation = useMutation({ - mutationFn: (databaseInfo: DeleteDatabaseProps) => { - return deleteDatabase(databaseInfo); - }, - onError, - onSuccess, - }); - - return { - deleteDatabase: (databaseInfo: DeleteDatabaseProps) => { - return mutation.mutate(databaseInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/guides.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/guides/useGetGuides.hook.tsx similarity index 74% rename from packages/manager/apps/pci-databases-analytics/src/hooks/api/guides.api.hooks.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/guides/useGetGuides.hook.tsx index fd66e7434d6c..50d1ea03e066 100644 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/guides.api.hooks.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/guides/useGetGuides.hook.tsx @@ -1,7 +1,7 @@ import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; -import { getGuides } from '@/api/databases/guides'; -import { Guide } from '@/models/guide'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; +import { getGuides } from '@/data/api/guides/guides.api'; +import { Guide } from '@/types/guide'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; export function useGetGuides( section?: string, diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/integrations.api.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/integrations.api.hook.tsx deleted file mode 100644 index ee93e004c41c..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/integrations.api.hook.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, -} from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { - AddIntegrationProps, - DeleteIntegrationProps, - addIntegration, - deleteIntegration, - getServiceCapabilitiesIntegrations, - getServiceIntegrations, -} from '@/api/databases/integrations'; -import { CdbError } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetIntegrations( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'integration']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getServiceIntegrations({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -export function useGetCapabilitiesIntegrations( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [ - projectId, - 'database', - engine, - serviceId, - 'capabilities/integration', - ]; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => - getServiceCapabilitiesIntegrations({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -interface MutateIntegrationProps { - onError: (cause: CdbError) => void; - onSuccess: (database: database.service.Integration) => void; -} -export function useAddIntegration({ - onError, - onSuccess, -}: MutateIntegrationProps) { - const mutation = useMutation({ - mutationFn: (integrationInfo: AddIntegrationProps) => { - return addIntegration(integrationInfo); - }, - onError, - onSuccess, - }); - - return { - addIntegration: (integrationInfo: AddIntegrationProps) => { - return mutation.mutate(integrationInfo); - }, - ...mutation, - }; -} - -interface UseDeleteIntegrationProps { - onError: (cause: CdbError) => void; - onSuccess: () => void; -} -export function UseDeleteIntegration({ - onError, - onSuccess, -}: UseDeleteIntegrationProps) { - const mutation = useMutation({ - mutationFn: (integrationInfo: DeleteIntegrationProps) => { - return deleteIntegration(integrationInfo); - }, - onError, - onSuccess, - }); - - return { - deleteIntegration: (integrationInfo: DeleteIntegrationProps) => { - return mutation.mutate(integrationInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/maintenances.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/maintenances.api.hooks.tsx deleted file mode 100644 index d91aedaa7ace..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/maintenances.api.hooks.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, -} from '@tanstack/react-query'; - -import { database } from '@/models/database'; -import { CdbError } from '@/api/databases'; -import { - ApplyMaintenanceProps, - applyMaintenance, - getMaintenances, -} from '@/api/databases/maintenances'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetMaintenances( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'maintenance']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getMaintenances({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -export interface MutateMaintenanceProps { - onError: (cause: CdbError) => void; - onSuccess: (maintenance: database.service.Maintenance) => void; -} - -export function useApplyMaintenance({ - onError, - onSuccess, -}: MutateMaintenanceProps) { - const mutation = useMutation({ - mutationFn: (mtInfo: ApplyMaintenanceProps) => { - return applyMaintenance(mtInfo); - }, - onError, - onSuccess, - }); - - return { - applyMaintenance: (mtInfo: ApplyMaintenanceProps) => { - return mutation.mutate(mtInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/namespaces.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/namespaces.api.hooks.tsx deleted file mode 100644 index 484ff6d5f689..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/namespaces.api.hooks.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, -} from '@tanstack/react-query'; - -import { database } from '@/models/database'; -import { - AddNamespaceProps, - DeleteNamespaceProps, - EditNamespaceProps, - addNamespace, - deleteNamespace, - editNamespace, - getNamespaces, -} from '@/api/databases/namespaces'; -import { CdbError } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetNamespaces( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'namespace']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getNamespaces({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -export interface MutateNamespaceProps { - onError: (cause: CdbError) => void; - onSuccess: (namespace: database.m3db.Namespace) => void; -} - -export function useAddNamespace({ onError, onSuccess }: MutateNamespaceProps) { - const mutation = useMutation({ - mutationFn: (npInfo: AddNamespaceProps) => { - return addNamespace(npInfo); - }, - onError, - onSuccess, - }); - - return { - addNamespace: (npInfo: AddNamespaceProps) => { - return mutation.mutate(npInfo); - }, - ...mutation, - }; -} - -export function useEditNamespace({ onError, onSuccess }: MutateNamespaceProps) { - const mutation = useMutation({ - mutationFn: (npInfo: EditNamespaceProps) => { - return editNamespace(npInfo); - }, - onError, - onSuccess, - }); - - return { - editNamespace: (npInfo: EditNamespaceProps) => { - return mutation.mutate(npInfo); - }, - ...mutation, - }; -} - -interface UseDeleteNamespaceProps { - onError: (cause: CdbError) => void; - onSuccess: () => void; -} - -export function useDeleteNamespace({ - onError, - onSuccess, -}: UseDeleteNamespaceProps) { - const mutation = useMutation({ - mutationFn: (npInfo: DeleteNamespaceProps) => { - return deleteNamespace(npInfo); - }, - onError, - onSuccess, - }); - - return { - deleteNamespace: (npInfo: DeleteNamespaceProps) => { - return mutation.mutate(npInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/network.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network.api.hooks.tsx deleted file mode 100644 index da003903d901..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/network.api.hooks.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; -import { networkApi } from '@/api/network'; -import { Network, Subnet, Vrack } from '@/models/network'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetNetwork( - projectId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'network/private']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => networkApi.getPrivateNetworks(projectId), - ...options, - }) as UseQueryResult; -} - -export function useGetSubnet( - projectId: string, - networkId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'network/private', networkId]; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => networkApi.getSubnets(projectId, networkId), - ...options, - }) as UseQueryResult; -} - -export function useGetVrack( - projectId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'vrack']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => networkApi.getVrack(projectId), - ...options, - }) as UseQueryResult; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetNetwork.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetNetwork.hook.tsx new file mode 100644 index 000000000000..36a917d71549 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetNetwork.hook.tsx @@ -0,0 +1,16 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import { networkApi } from '@/data/api/network/network.api'; +import { Network } from '@/types/cloud/network'; +import { useQueryImmediateRefetch } from '../useImmediateRefetch'; + +export function useGetNetwork( + projectId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'network/private']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => networkApi.getPrivateNetworks(projectId), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetNetwork.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetNetwork.spec.tsx new file mode 100644 index 000000000000..72d23ef51da6 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetNetwork.spec.tsx @@ -0,0 +1,34 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as API from '@/data/api/network/network.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedNetworks } from '@/__tests__/helpers/mocks/network'; +import { useGetNetwork } from './useGetNetwork.hook'; + +vi.mock('@/data/api/network/network.api', () => ({ + networkApi: { + getPrivateNetworks: vi.fn(), + getSubnets: vi.fn(), + getVrack: vi.fn(), + }, +})); + +describe('useGetNetwork', () => { + it('should return network', async () => { + const projectId = 'projectId'; + + vi.mocked(API.networkApi.getPrivateNetworks).mockResolvedValue( + mockedNetworks, + ); + + const { result } = renderHook(() => useGetNetwork(projectId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(mockedNetworks); + expect(API.networkApi.getPrivateNetworks).toHaveBeenCalledWith(projectId); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetSubnet.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetSubnet.hook.tsx new file mode 100644 index 000000000000..d521b4f66a79 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetSubnet.hook.tsx @@ -0,0 +1,17 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import { networkApi } from '@/data/api/network/network.api'; +import { Subnet } from '@/types/cloud/network'; +import { useQueryImmediateRefetch } from '../useImmediateRefetch'; + +export function useGetSubnet( + projectId: string, + networkId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'network/private', networkId]; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => networkApi.getSubnets(projectId, networkId), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetSubnet.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetSubnet.spec.tsx new file mode 100644 index 000000000000..3781ad6b378b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetSubnet.spec.tsx @@ -0,0 +1,36 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as API from '@/data/api/network/network.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedSubnets } from '@/__tests__/helpers/mocks/network'; +import { useGetSubnet } from './useGetSubnet.hook'; + +vi.mock('@/data/api/network/network.api', () => ({ + networkApi: { + getPrivateNetworks: vi.fn(), + getSubnets: vi.fn(), + getVrack: vi.fn(), + }, +})); + +describe('useGetSubnet', () => { + it('should return subnet', async () => { + const projectId = 'projectId'; + const networkId = 'networkId'; + + vi.mocked(API.networkApi.getSubnets).mockResolvedValue(mockedSubnets); + + const { result } = renderHook(() => useGetSubnet(projectId, networkId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(mockedSubnets); + expect(API.networkApi.getSubnets).toHaveBeenCalledWith( + projectId, + networkId, + ); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetVrack.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetVrack.hook.tsx new file mode 100644 index 000000000000..50c600a31045 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetVrack.hook.tsx @@ -0,0 +1,16 @@ +import { QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'; +import { networkApi } from '@/data/api/network/network.api'; +import { Vrack } from '@/types/cloud/Vrack'; +import { useQueryImmediateRefetch } from '../useImmediateRefetch'; + +export function useGetVrack( + projectId: string, + options: Omit = {}, +) { + const queryKey = [projectId, 'vrack']; + return useQueryImmediateRefetch({ + queryKey, + queryFn: () => networkApi.getVrack(projectId), + ...options, + }) as UseQueryResult; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetVrack.spec.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetVrack.spec.tsx new file mode 100644 index 000000000000..ab0b9da576d8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/network/useGetVrack.spec.tsx @@ -0,0 +1,32 @@ +import { renderHook, waitFor } from '@testing-library/react'; +import { vi } from 'vitest'; +import * as API from '@/data/api/network/network.api'; +import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import { mockedVrack } from '@/__tests__/helpers/mocks/network'; +import { useGetVrack } from './useGetVrack.hook'; + +vi.mock('@/data/api/network/network.api', () => ({ + networkApi: { + getPrivateNetworks: vi.fn(), + getSubnets: vi.fn(), + getVrack: vi.fn(), + }, +})); + +describe('useGetVrack', () => { + it('should return vrack', async () => { + const projectId = 'projectId'; + + vi.mocked(API.networkApi.getVrack).mockResolvedValue(mockedVrack); + + const { result } = renderHook(() => useGetVrack(projectId), { + wrapper: QueryClientWrapper, + }); + + await waitFor(() => { + expect(result.current.isSuccess).toBe(true); + expect(result.current.data).toEqual(mockedVrack); + expect(API.networkApi.getVrack).toHaveBeenCalledWith(projectId); + }); + }); +}); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/nodes.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/nodes.api.hooks.tsx deleted file mode 100644 index 8459eb7fcdc6..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/nodes.api.hooks.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { useMutation } from '@tanstack/react-query'; -import { CdbError } from '@/api/databases'; -import { - AddNodeProps, - DeleteNodeProps, - addNode, - deleteNode, -} from '@/api/databases/nodes'; -import { database } from '@/models/database'; - -interface MutateNodeProps { - onError: (cause: CdbError) => void; - onSuccess: (service: database.service.Node) => void; -} -export function useAddNode({ onError, onSuccess }: MutateNodeProps) { - const mutation = useMutation({ - mutationFn: (nodeInfo: AddNodeProps) => { - return addNode(nodeInfo); - }, - onError, - onSuccess, - }); - - return { - addNode: (nodeInfo: AddNodeProps) => { - return mutation.mutate(nodeInfo); - }, - ...mutation, - }; -} -interface UseDeleteNodeProps { - onError: (cause: CdbError) => void; - onSuccess: () => void; -} - -export function useDeleteNode({ onError, onSuccess }: UseDeleteNodeProps) { - const mutation = useMutation({ - mutationFn: (nodeInfo: DeleteNodeProps) => { - return deleteNode(nodeInfo); - }, - onError, - onSuccess, - }); - - return { - deleteNode: (nodeInfo: DeleteNodeProps) => { - return mutation.mutate(nodeInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/pciProjects.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/project/usePciProject.hook.tsx similarity index 66% rename from packages/manager/apps/pci-databases-analytics/src/hooks/api/pciProjects.api.hooks.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/project/usePciProject.hook.tsx index 4fc1d5e40818..e59995c448e7 100644 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/pciProjects.api.hooks.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/project/usePciProject.hook.tsx @@ -1,7 +1,6 @@ import { useParams } from 'react-router-dom'; - -import { getProject } from '@/api/projects'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; +import { useQueryImmediateRefetch } from '@/hooks/api/useImmediateRefetch'; +import { getProject } from '@/data/api/project/project.api'; const usePciProject = () => { const { projectId } = useParams(); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/pciProjects.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/project/usePciProject.spec.tsx similarity index 79% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/pciProjects.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/api/project/usePciProject.spec.tsx index 38e7885cf276..a9582bef8cd5 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/api/pciProjects.hook.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/api/project/usePciProject.spec.tsx @@ -1,11 +1,11 @@ import { renderHook, waitFor } from '@testing-library/react'; import { vi } from 'vitest'; -import * as API from '@/api/projects'; +import * as API from '@/data/api/project/project.api'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; -import usePciProject from '@/hooks/api/pciProjects.api.hooks'; +import usePciProject from '@/hooks/api/project/usePciProject.hook'; import { mockedPciProject } from '@/__tests__/helpers/mocks/pciProjects'; -vi.mock('@/api/projects', () => ({ +vi.mock('@/data/api/project/project.api', () => ({ getProject: vi.fn(), })); diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/queries.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/queries.api.hooks.tsx deleted file mode 100644 index 41bae27d3b66..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/queries.api.hooks.tsx +++ /dev/null @@ -1,100 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, -} from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { - CancelQueryProps, - QueryStatistics, - cancelCurrentQuery, - getCurrentQueries, - getQueryStatistics, - resetQueryStatistics, -} from '@/api/databases/queries'; -import { CdbError, ServiceData } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetCurrentQueries( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'currentQueries']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getCurrentQueries({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -interface MutateCurrentQueryProps { - onError: (cause: CdbError) => void; - onSuccess: ( - database: database.service.currentqueries.query.CancelResponse, - ) => void; -} -export function useCancelCurrentQuery({ - onError, - onSuccess, -}: MutateCurrentQueryProps) { - const mutation = useMutation({ - mutationFn: (currentQueryInfo: CancelQueryProps) => { - return cancelCurrentQuery(currentQueryInfo); - }, - onError, - onSuccess, - }); - - return { - cancelCurrentQuery: (currentQueryInfo: CancelQueryProps) => { - return mutation.mutate(currentQueryInfo); - }, - ...mutation, - }; -} - -export function useGetQueryStatistics( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [ - projectId, - 'database', - engine, - serviceId, - 'queryStatistics', - ]; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getQueryStatistics({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -interface MutateQuerStatisticsyProps { - onError: (cause: CdbError) => void; - onSuccess: () => void; -} -export function useResetQueryStatistics({ - onError, - onSuccess, -}: MutateQuerStatisticsyProps) { - const mutation = useMutation({ - mutationFn: (serviceInfo: ServiceData) => { - return resetQueryStatistics(serviceInfo); - }, - onError, - onSuccess, - }); - - return { - resetQueryStatistics: (serviceInfo: ServiceData) => { - return mutation.mutate(serviceInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/services.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/services.api.hooks.tsx deleted file mode 100644 index d1b9c5953608..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/services.api.hooks.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, - useQueryClient, -} from '@tanstack/react-query'; -import { useParams } from 'react-router-dom'; -import { database } from '@/models/database'; -import { - UpdateServiceProps, - addService, - deleteService, - getService, - getServices, - updateService, -} from '@/api/databases/service'; -import { CdbError, ServiceData } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetService( - projectId: string, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database/service', serviceId]; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getService({ projectId, serviceId }), - ...options, - }) as UseQueryResult; -} - -export function useGetServices( - projectId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database/service']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getServices({ projectId }), - ...options, - }) as UseQueryResult; -} - -interface MutateServiceProps { - onError: (cause: CdbError) => void; - onSuccess: (service: database.Service) => void; -} -export interface ServiceCreationWithEngine extends database.ServiceCreation { - engine: database.EngineEnum; -} -export function useAddService({ onError, onSuccess }: MutateServiceProps) { - const queryClient = useQueryClient(); - const { projectId } = useParams(); - const mutation = useMutation({ - mutationFn: (serviceAndEngine: ServiceCreationWithEngine) => { - const { engine, ...serviceInfo } = serviceAndEngine; - return addService({ projectId, engine, serviceInfo }); - }, - onError, - onSuccess: (data) => { - // invalidate services list to avoid displaying - // old list - queryClient.invalidateQueries({ - queryKey: [projectId, 'database/service'], - refetchType: 'none', - }); - onSuccess(data); - }, - }); - - return { - addService: (serviceAndEngine: ServiceCreationWithEngine) => { - return mutation.mutate(serviceAndEngine); - }, - ...mutation, - }; -} - -export function useUpdateService({ onError, onSuccess }: MutateServiceProps) { - const mutation = useMutation({ - mutationFn: (serviceUpdate: UpdateServiceProps) => - updateService(serviceUpdate), - onError, - onSuccess, - }); - - return { - updateService: (serviceAndEngine: UpdateServiceProps) => { - return mutation.mutate(serviceAndEngine); - }, - ...mutation, - }; -} - -interface UseDeleteServiceProps { - onError: (cause: Error) => void; - onSuccess: () => void; -} - -export function useDeleteService({ - onError, - onSuccess, -}: UseDeleteServiceProps) { - const mutation = useMutation({ - mutationFn: (serviceInfo: ServiceData) => { - return deleteService(serviceInfo); - }, - onError, - onSuccess, - }); - - return { - deleteService: (serviceInfo: ServiceData) => { - return mutation.mutate(serviceInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/api/users.api.hooks.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/api/users.api.hooks.tsx deleted file mode 100644 index 481b68547fbd..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/api/users.api.hooks.tsx +++ /dev/null @@ -1,132 +0,0 @@ -import { - QueryObserverOptions, - UseQueryResult, - useMutation, -} from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { - AddUserProps, - DeleteUserProps, - EditUserProps, - GenericUser, - ResetUserPasswordProps, - addUser, - deleteUser, - editUser, - getRoles, - getUsers, - resetUserPassword, -} from '@/api/databases/users'; -import { CdbError } from '@/api/databases'; -import { useQueryImmediateRefetch } from './useImmediateRefetch'; - -export function useGetUsers( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'user']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getUsers({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -export function useGetRoles( - projectId: string, - engine: database.EngineEnum, - serviceId: string, - options: Omit = {}, -) { - const queryKey = [projectId, 'database', engine, serviceId, 'roles']; - return useQueryImmediateRefetch({ - queryKey, - queryFn: () => getRoles({ projectId, engine, serviceId }), - ...options, - }) as UseQueryResult; -} - -export interface MutateUserProps { - onError: (cause: CdbError) => void; - onSuccess: (user: GenericUser) => void; -} -export function useAddUser({ onError, onSuccess }: MutateUserProps) { - const mutation = useMutation({ - mutationFn: (userInfo: AddUserProps) => { - return addUser(userInfo); - }, - onError, - onSuccess, - }); - - return { - addUser: (userInfo: AddUserProps) => { - return mutation.mutate(userInfo); - }, - ...mutation, - }; -} - -interface MutateUserPasswordProps { - onError: (cause: CdbError) => void; - onSuccess: (user: database.service.UserWithPassword) => void; -} -export function useResetUserPassword({ - onError, - onSuccess, -}: MutateUserPasswordProps) { - const mutation = useMutation({ - mutationFn: (userInfo: ResetUserPasswordProps) => { - return resetUserPassword(userInfo); - }, - onError, - onSuccess, - }); - - return { - resetUserPassword: (userInfo: ResetUserPasswordProps) => { - return mutation.mutate(userInfo); - }, - ...mutation, - }; -} - -interface UseDeleteUserProps { - onError: (cause: CdbError) => void; - onSuccess: () => void; -} -export function useDeleteUser({ onError, onSuccess }: UseDeleteUserProps) { - const mutation = useMutation({ - mutationFn: (userInfo: DeleteUserProps) => { - return deleteUser(userInfo); - }, - onError, - onSuccess, - }); - - return { - deleteUser: (userInfo: DeleteUserProps) => { - return mutation.mutate(userInfo); - }, - ...mutation, - }; -} - -export function useEditUser({ onError, onSuccess }: MutateUserProps) { - const mutation = useMutation({ - mutationFn: (userInfo: EditUserProps) => { - return editUser(userInfo); - }, - onError, - onSuccess, - }); - - return { - editUser: (userInfo: EditUserProps) => { - return mutation.mutate(userInfo); - }, - ...mutation, - }; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useDateFnsLocale.hook.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/useDateFnsLocale.hook.spec.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useDateFnsLocale.hook.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/useDateFnsLocale.hook.spec.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useDownload.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/useDownload.spec.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useDownload.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/useDownload.spec.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useMeanMetric.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/useMeanMetric.spec.tsx similarity index 81% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useMeanMetric.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/useMeanMetric.spec.tsx index c62261703976..d64ca21c8234 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useMeanMetric.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/useMeanMetric.spec.tsx @@ -1,11 +1,11 @@ import { describe, it, vi } from 'vitest'; import { renderHook, waitFor } from '@testing-library/react'; -import { mockMetric } from '../helpers/mocks/metrics'; +import { mockMetric } from '../__tests__/helpers/mocks/metrics'; import { useMeanMetric } from '@/hooks/useMeanMetric'; -import { database } from '@/models/database'; -import { QueryClientWrapper } from '../helpers/wrappers/QueryClientWrapper'; +import * as database from '@/types/cloud/project/database'; +import { QueryClientWrapper } from '../__tests__/helpers/wrappers/QueryClientWrapper'; -vi.mock('@/api/databases/metrics', () => ({ +vi.mock('@/data/api/database/metric.api', () => ({ getMetric: vi.fn(() => mockMetric), })); describe('useMeanMetric', () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/useMeanMetric.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/useMeanMetric.tsx index c5e97718c4f7..68adebb47f1c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/useMeanMetric.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/useMeanMetric.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { QueryObserverOptions } from '@tanstack/react-query'; -import { database } from '@/models/database'; -import { useGetMetric } from '@/hooks/api/metrics.api.hooks'; +import * as database from '@/types/cloud/project/database'; +import { useGetMetric } from '@/hooks/api/database/metric/useGetMetric.hook'; interface UseMeanMetricProps { projectId: string; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useModale.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/useModale.spec.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useModale.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/useModale.spec.tsx index a7d4d22e5433..344f3bf3a05c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useModale.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/useModale.spec.tsx @@ -1,7 +1,7 @@ import { describe, it } from 'vitest'; import { act, renderHook, screen, waitFor } from '@testing-library/react'; import { DEFAULT_OPEN_VALUE, useModale } from '@/hooks/useModale'; -import { RouterWithLocationWrapper } from '../helpers/wrappers/RouterWithLocationWrapper'; +import { RouterWithLocationWrapper } from '../__tests__/helpers/wrappers/RouterWithLocationWrapper'; describe('useModale', () => { it('should init properly', async () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useQueryState.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/useQueryState.spec.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useQueryState.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/useQueryState.spec.tsx index 2450be4a0026..e91afe151e04 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useQueryState.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/useQueryState.spec.tsx @@ -2,7 +2,7 @@ import { vi } from 'vitest'; import { renderHook, act, waitFor, screen } from '@testing-library/react'; import * as ReactRouter from 'react-router-dom'; import { useQueryState } from '@/hooks/useQueryState'; -import { RouterWithLocationWrapper } from '../helpers/wrappers/RouterWithLocationWrapper'; +import { RouterWithLocationWrapper } from '../__tests__/helpers/wrappers/RouterWithLocationWrapper'; describe('useQueryState', () => { it('should set the state in the url', async () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/useTracking.ts b/packages/manager/apps/pci-databases-analytics/src/hooks/useTracking.ts index 809afc251727..f6a06548e3da 100644 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/useTracking.ts +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/useTracking.ts @@ -1,8 +1,8 @@ import { useContext, useEffect } from 'react'; import { ShellContext } from '@ovh-ux/manager-react-shell-client'; -import { PciProjectPlanCode } from '@/models/project'; -import usePciProject from './api/pciProjects.api.hooks'; -import { PCI_LEVEL2 } from '@/configuration/tracking'; +import usePciProject from './api/project/usePciProject.hook'; +import { PCI_LEVEL2 } from '@/configuration/tracking.constants'; +import { PlanCode } from '@/types/cloud/Project'; // Set the project mode, needed to track discovery actions function useProjectModeTracking() { @@ -13,7 +13,7 @@ function useProjectModeTracking() { if (project) { setPciProjectMode({ projectId: project.project_id, - isDiscoveryProject: project.planCode === PciProjectPlanCode.DISCOVERY, + isDiscoveryProject: project.planCode === PlanCode.DISCOVERY, }); } }, [project]); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useUser.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/useUser.spec.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useUser.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/useUser.spec.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useUserActivity.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/useUserActivity.spec.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useUserActivity.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/useUserActivity.spec.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useVrack.test.tsx b/packages/manager/apps/pci-databases-analytics/src/hooks/useVrack.spec.tsx similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useVrack.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/hooks/useVrack.spec.tsx index eeabfac609d2..4d3ea64631e8 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/hooks/useVrack.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/useVrack.spec.tsx @@ -1,10 +1,13 @@ import { expect, describe, it, vi } from 'vitest'; import { act, renderHook, waitFor } from '@testing-library/react'; import { useVrack } from '@/hooks/useVrack'; -import { QueryClientWrapper } from '../helpers/wrappers/QueryClientWrapper'; -import { mockedNetworks, mockedSubnets } from '../helpers/mocks/network'; +import { QueryClientWrapper } from '../__tests__/helpers/wrappers/QueryClientWrapper'; +import { + mockedNetworks, + mockedSubnets, +} from '../__tests__/helpers/mocks/network'; -vi.mock('@/api/network', () => ({ +vi.mock('@/data/api/network/network.api', () => ({ networkApi: { getPrivateNetworks: vi.fn(() => mockedNetworks), getSubnets: vi.fn(() => mockedSubnets), diff --git a/packages/manager/apps/pci-databases-analytics/src/hooks/useVrack.ts b/packages/manager/apps/pci-databases-analytics/src/hooks/useVrack.ts index 630e7768a3b2..04ae57f5f3cc 100644 --- a/packages/manager/apps/pci-databases-analytics/src/hooks/useVrack.ts +++ b/packages/manager/apps/pci-databases-analytics/src/hooks/useVrack.ts @@ -1,6 +1,7 @@ import { useEffect, useMemo } from 'react'; -import { NetworkTypeEnum } from '@/models/network'; -import { useGetNetwork, useGetSubnet } from './api/network.api.hooks'; +import { NetworkTypeEnum } from '@/types/cloud/network'; +import { useGetNetwork } from './api/network/useGetNetwork.hook'; +import { useGetSubnet } from './api/network/useGetSubnet.hook'; /** * Fetch networks and only return the ones that diff --git a/packages/manager/apps/pci-databases-analytics/src/lib/apiHelper.ts b/packages/manager/apps/pci-databases-analytics/src/lib/apiHelper.ts new file mode 100644 index 000000000000..6b64d2734958 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/lib/apiHelper.ts @@ -0,0 +1,11 @@ +import { CdbError } from '@/data/api/database'; + +export function getCdbApiErrorMessage(err: CdbError): string { + if (err.response.data.details?.message) { + return err.response.data.details.message; + } + if (err.response.data.message) { + return err.response.data.message; + } + return 'unknown error'; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesHelper.test.tsx b/packages/manager/apps/pci-databases-analytics/src/lib/availabilitiesHelper.spec.tsx similarity index 88% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesHelper.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/lib/availabilitiesHelper.spec.tsx index 26391fb5735c..8b8fd57785c3 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/availabilitiesHelper.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/lib/availabilitiesHelper.spec.tsx @@ -1,7 +1,7 @@ import { createTree } from '@/lib/availabilitiesHelper'; -import { mockedAvailabilities } from './availabilitiesMock/availabilities'; -import { mockedCatalog } from './availabilitiesMock/catalog'; -import { mockedCapabilities } from './availabilitiesMock/capabilities'; +import { mockedAvailabilities } from '../__tests__/helpers/mocks/availabilitiesMock/availabilities'; +import { mockedCatalog } from '../__tests__/helpers/mocks/availabilitiesMock/catalog'; +import { mockedCapabilities } from '../__tests__/helpers/mocks/availabilitiesMock/capabilities'; const mockedSuggestions = [ { diff --git a/packages/manager/apps/pci-databases-analytics/src/lib/availabilitiesHelper.ts b/packages/manager/apps/pci-databases-analytics/src/lib/availabilitiesHelper.ts index bf46339bb088..05f944eea29b 100644 --- a/packages/manager/apps/pci-databases-analytics/src/lib/availabilitiesHelper.ts +++ b/packages/manager/apps/pci-databases-analytics/src/lib/availabilitiesHelper.ts @@ -1,9 +1,9 @@ /* eslint-disable no-param-reassign */ -import { order } from '@/models/catalog'; -import { database } from '@/models/database'; -import { Engine, Flavor, Plan, Region, Version } from '@/models/order-funnel'; +import { order } from '@/types/catalog'; +import * as database from '@/types/cloud/project/database'; +import { Engine, Flavor, Plan, Region, Version } from '@/types/orderFunnel'; import { compareStorage } from './bytesHelper'; -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; function updatePlanStorage( availability: database.Availability, @@ -94,7 +94,7 @@ const mapEngine = ( tree: Engine[], availability: database.Availability, capabilities: FullCapabilities, - engineSuggestion: database.Suggestion, + engineSuggestion: database.availability.Suggestion, ) => { let treeEngine = tree.find((a) => a.name === availability.engine); if (!treeEngine) { @@ -121,7 +121,7 @@ const mapVersion = ( treeEngine: Engine, availability: database.Availability, capabilities: FullCapabilities, - engineSuggestion: database.Suggestion, + engineSuggestion: database.availability.Suggestion, ) => { let treeVersion = treeEngine.versions.find( (v) => v.name === availability.version, @@ -149,7 +149,7 @@ const mapPlan = ( treeVersion: Version, availability: database.Availability, capabilities: FullCapabilities, - engineSuggestion: database.Suggestion, + engineSuggestion: database.availability.Suggestion, ) => { let treePlan = treeVersion.plans.find((p) => p.name === availability.plan); if (!treePlan) { @@ -160,7 +160,7 @@ const mapPlan = ( name: availability.plan, networks: [availability.specifications.network], order: planCapability.order, - tags: planCapability.tags, + tags: planCapability.tags as database.capabilities.TagEnum[], default: engineSuggestion.plan === availability.plan, backups: availability.backups.available, nodes: { @@ -187,7 +187,7 @@ const mapRegion = ( treePlan: Plan, availability: database.Availability, capabilities: FullCapabilities, - engineSuggestion: database.Suggestion, + engineSuggestion: database.availability.Suggestion, ) => { let treeRegion = treePlan.regions.find((r) => r.name === availability.region); if (!treeRegion) { @@ -210,7 +210,7 @@ const mapFlavor = ( treeRegion: Region, availability: database.Availability, capabilities: FullCapabilities, - engineSuggestion: database.Suggestion, + engineSuggestion: database.availability.Suggestion, ) => { const flavorSpec = capabilities.flavors.find( (f) => f.name === availability.specifications.flavor, @@ -225,7 +225,7 @@ const mapFlavor = ( ram: flavorSpec?.specifications.memory, vcores: flavorSpec?.specifications.core, order: flavorSpec.order, - tags: flavorSpec.tags, + tags: flavorSpec.tags as database.capabilities.TagEnum[], default: engineSuggestion.flavor === availability.specifications.flavor, pricing: {}, }; @@ -283,7 +283,7 @@ const setPrices = ( export function createTree( availabilities: database.Availability[], capabilities: FullCapabilities, - suggestions: database.Suggestion[], + suggestions: database.availability.Suggestion[], catalog: order.publicOrder.Catalog, ) { return availabilities.reduce((acc, curr) => { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/bytesHelper.test.tsx b/packages/manager/apps/pci-databases-analytics/src/lib/bytesHelper.spec.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/bytesHelper.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/lib/bytesHelper.spec.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/durationHelper.test.tsx b/packages/manager/apps/pci-databases-analytics/src/lib/durationHelper.spec.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/durationHelper.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/lib/durationHelper.spec.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/engineNameHelper.test.tsx b/packages/manager/apps/pci-databases-analytics/src/lib/engineNameHelper.spec.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/engineNameHelper.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/lib/engineNameHelper.spec.tsx index fdd234d97067..212e004e3ef4 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/engineNameHelper.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/lib/engineNameHelper.spec.tsx @@ -1,5 +1,5 @@ import { describe, it, expect } from 'vitest'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { humanizeEngine } from '@/lib/engineNameHelper'; type EngineTestCase = [database.EngineEnum | string, string]; diff --git a/packages/manager/apps/pci-databases-analytics/src/lib/engineNameHelper.ts b/packages/manager/apps/pci-databases-analytics/src/lib/engineNameHelper.ts index 33d9ebe99c09..f50e92f01287 100644 --- a/packages/manager/apps/pci-databases-analytics/src/lib/engineNameHelper.ts +++ b/packages/manager/apps/pci-databases-analytics/src/lib/engineNameHelper.ts @@ -1,4 +1,4 @@ -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export function humanizeEngine(engine: database.EngineEnum) { switch (engine) { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/nameGenerator.test.tsx b/packages/manager/apps/pci-databases-analytics/src/lib/nameGenerator.spec.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/nameGenerator.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/lib/nameGenerator.spec.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/pricingHelper.test.tsx b/packages/manager/apps/pci-databases-analytics/src/lib/pricingHelper.spec.tsx similarity index 89% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/pricingHelper.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/lib/pricingHelper.spec.tsx index c91b443ae7a3..4e5fd7104910 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/pricingHelper.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/lib/pricingHelper.spec.tsx @@ -1,7 +1,7 @@ import { describe, vi } from 'vitest'; import { computeServicePrice } from '@/lib/pricingHelper'; -import { database } from '@/models/database'; -import { mockedPricing } from '../helpers/mocks/order-funnel'; +import * as database from '@/types/cloud/project/database'; +import { mockedPricing } from '../__tests__/helpers/mocks/order-funnel'; const mockedPricingHelper = { offerPricing: mockedPricing, diff --git a/packages/manager/apps/pci-databases-analytics/src/lib/pricingHelper.ts b/packages/manager/apps/pci-databases-analytics/src/lib/pricingHelper.ts index 98fc79b18a87..5de6a780e7a1 100644 --- a/packages/manager/apps/pci-databases-analytics/src/lib/pricingHelper.ts +++ b/packages/manager/apps/pci-databases-analytics/src/lib/pricingHelper.ts @@ -1,5 +1,5 @@ -import { order } from '@/models/catalog'; -import { database } from '@/models/database'; +import { order } from '@/types/catalog'; +import * as database from '@/types/cloud/project/database'; type Price = Pick; export interface Pricing { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/tagsHelper.test.tsx b/packages/manager/apps/pci-databases-analytics/src/lib/tagsHelper.spec.tsx similarity index 75% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/lib/tagsHelper.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/lib/tagsHelper.spec.tsx index d95e954c2d1c..d15064bfd114 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/lib/tagsHelper.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/lib/tagsHelper.spec.tsx @@ -1,27 +1,27 @@ import { describe, vi } from 'vitest'; import { getTagVariant, updateTags } from '@/lib/tagsHelper'; -import { database } from '@/models/database'; -import { mockedFlavor } from '../helpers/mocks/availabilities'; +import * as database from '@/types/cloud/project/database'; +import { mockedFlavor } from '../__tests__/helpers/mocks/availabilities'; describe('tagsHelper', () => { afterEach(() => { vi.clearAllMocks(); }); it('getTagVariant should be success', () => { - const mockedTags: database.capabilities.Tags = - database.capabilities.Tags.current; + const mockedTags: database.capabilities.TagEnum = + database.capabilities.TagEnum.current; const tagVariant = getTagVariant(mockedTags); expect(tagVariant).toBe('success'); }); it('getTagVariant should be warning', () => { - const mockedTags: database.capabilities.Tags = - database.capabilities.Tags.soonDeprecated; + const mockedTags: database.capabilities.TagEnum = + database.capabilities.TagEnum.soonDeprecated; const tagVariant = getTagVariant(mockedTags); expect(tagVariant).toBe('warning'); }); it('getTagVariant should be info', () => { - const tagVariant = getTagVariant('test' as database.capabilities.Tags); + const tagVariant = getTagVariant('test' as database.capabilities.TagEnum); expect(tagVariant).toBe('info'); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/lib/tagsHelper.ts b/packages/manager/apps/pci-databases-analytics/src/lib/tagsHelper.ts index 8e8510893046..fd65cefc2a66 100644 --- a/packages/manager/apps/pci-databases-analytics/src/lib/tagsHelper.ts +++ b/packages/manager/apps/pci-databases-analytics/src/lib/tagsHelper.ts @@ -1,8 +1,8 @@ import { BadgeProps } from '@/components/ui/badge'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export const getTagVariant = ( - tag: database.capabilities.Tags, + tag: database.capabilities.TagEnum, ): BadgeProps['variant'] => { switch (tag) { case 'new': @@ -23,17 +23,17 @@ export const updateTags = ( default: boolean; lifecycle: database.availability.Lifecycle; name: string; - tags: database.capabilities.Tags[]; + tags: database.capabilities.TagEnum[]; }[] - | database.RegionCapabilities[], + | database.capabilities.RegionCapabilities[], serviceValue: string, ) => items.map((item) => item.name === serviceValue && - !item.tags.includes(database.capabilities.Tags.current) + !item.tags.includes(database.capabilities.TagEnum.current) ? { ...item, - tags: [...item.tags, database.capabilities.Tags.current], + tags: [...item.tags, database.capabilities.TagEnum.current], } : item, ); diff --git a/packages/manager/apps/pci-databases-analytics/src/index.tsx b/packages/manager/apps/pci-databases-analytics/src/main.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/main.tsx index e4a02639e581..3c053170058f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/main.tsx @@ -8,7 +8,7 @@ import initI18n from './i18n'; import App from './App'; import '@/vite-hmr.ts'; -import { LoadingIndicatorProvider } from './contexts/loadingIndicatorContext'; +import { LoadingIndicatorProvider } from './contexts/LoadingIndicator.context'; const init = async ( appName: string, diff --git a/packages/manager/apps/pci-databases-analytics/src/models/database.ts b/packages/manager/apps/pci-databases-analytics/src/models/database.ts deleted file mode 100644 index c6f5bfca64a5..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/models/database.ts +++ /dev/null @@ -1,1774 +0,0 @@ -/* eslint-disable @typescript-eslint/no-shadow */ -/* eslint-disable @typescript-eslint/no-namespace */ -export namespace database { - export namespace availability { - export namespace specifications { - /** Specifications of the nodes for availabilities of databases engines on cloud projects */ - export interface Nodes { - /** Maximum number of nodes of the availability */ - maximum: number; - /** Minimum number of nodes of the availability */ - minimum: number; - } - /** Specifications of the storage for availabilities of databases engines on cloud projects */ - export interface Storage { - /** Maximum storage of the availability */ - maximum: { - unit: string; - value: number; - }; - /** Minimum storage of the availability */ - minimum: { - unit: string; - value: number; - }; - /** Memory step that can be added between minimum and maximum */ - step?: { - unit: string; - value: number; - }; - } - } - /** Possible action to restrict availabilities */ - export enum ActionEnum { - 'fork' = 'fork', - 'update' = 'update', - 'read' = 'read', - } - /** Possible target to restrict availabilities */ - export enum TargetEnum { - 'flavor' = 'flavor', - 'plan' = 'plan', - 'version' = 'version', - 'self' = 'self', - } - /** Backups availability of databases engines on cloud projects */ - export interface Backups { - /** Defines whether the backups are available for this offer */ - available: boolean; - /** Number of retention days for the backups */ - retentionDays?: number; - } - /** Availability of databases engines on cloud projects */ - export interface Lifecycle { - /** End of life of the product */ - endOfLife?: string; - /** End of sale of the product */ - endOfSale?: string; - /** Date of the release of the product */ - startDate: string; - /** Status of the availability */ - status: database.availability.StatusEnum; - } - /** Specifications of the availability of databases engines on cloud projects */ - export interface Specifications { - /** Flavor name */ - flavor: string; - /** Type of network */ - network: database.NetworkTypeEnum; - /** Specification of the nodes */ - nodes: database.availability.specifications.Nodes; - /** Specification of the storage */ - storage?: database.availability.specifications.Storage; - } - /** Possible status for the availability */ - export enum StatusEnum { - 'BETA' = 'BETA', - 'DEPRECATED' = 'DEPRECATED', - 'END_OF_LIFE' = 'END_OF_LIFE', - 'END_OF_SALE' = 'END_OF_SALE', - 'STABLE' = 'STABLE', - 'UNAVAILABLE' = 'UNAVAILABLE', - } - } - /** Possible target to restrict availabilities */ - export enum TargetEnum { - 'flavor' = 'flavor', - 'plan' = 'plan', - 'version' = 'version', - } - export namespace backup { - /** Cloud database backup region definition */ - export interface Region { - /** Name of the region where the backup is stored */ - name: string; - } - } - export namespace capabilities { - export enum Tags { - 'new' = 'new', - 'current' = 'current', - 'soonDeprecated' = 'soonDeprecated', - } - export namespace advancedConfiguration { - export namespace property { - /** Possible type of the advanced configuration properties */ - export enum TypeEnum { - 'boolean' = 'boolean', - 'double' = 'double', - 'long' = 'long', - 'string' = 'string', - } - } /** Specific database engine capability */ - export interface Property { - /** Description of the property */ - description: string; - /** Maximum value for the property if numeric and applicable */ - maximum?: number; - /** Minimum value for the property if numeric and applicable */ - minimum?: number; - /** Property name */ - name: string; - /** Data type of the property */ - type: database.capabilities.advancedConfiguration.property.TypeEnum; - /** Possible values for the property if string and applicable */ - values?: string[]; - } - } - export namespace engine { - export namespace storage { - /** Possible storage strategy for an engine */ - export enum StrategyEnum { - 'distributed' = 'distributed', - 'n/a' = 'n/a', - 'replicated' = 'replicated', - } - } - } - export namespace flavor { - /** Cloud Database flavor specifications definition */ - export interface Specifications { - /** Flavor core number */ - core: number; - /** Flavor ram size */ - memory: { - unit: string; - value: number; - }; - /** Flavor disk size */ - storage: { - unit: string; - value: number; - }; - } - } - export namespace integration { - export namespace parameter { - /** Possible type of an integration capability parameter */ - export enum TypeEnum { - 'integer' = 'integer', - 'string' = 'string', - } - } /** Integration capability parameter */ - export interface Parameter { - /** Name of the integration parameter */ - name: string; - /** Type of the integration parameter */ - type: database.capabilities.integration.parameter.TypeEnum; - } - } /** Specific database engine capability */ - export interface Engine { - /** Category of the engine */ - category: CategoryEnum; - /** Default version used for the engine */ - defaultVersion: string; - /** Description of the engine */ - description: string; - /** Engine name */ - name: string; - /** SSL modes for this engine */ - sslModes: string[]; - /** Storage strategy of the engine */ - storage: database.capabilities.engine.storage.StrategyEnum; - /** Versions available for this engine */ - versions: string[]; - } - /** Cloud Database flavor definition */ - export interface Flavor { - /** Flavor core number. @deprecated: use specifications.core */ - core?: number; - /** Defines the lifecycle of the flavor */ - lifecycle: availability.Lifecycle; - /** Flavor ram size in GB. @deprecated: use specifications.memory */ - memory?: number; - /** Name of the flavor */ - name: string; - /** Display order */ - order: number; - /** Technical specifications of the flavor */ - specifications: database.capabilities.flavor.Specifications; - /** Flavor disk size in GB. @deprecated: use specifications.storage */ - storage?: number; - /** Display tags */ - tags: Tags[]; - } - /** Integration capability between database engines */ - export interface Integration { - /** Destination engine for the integration */ - destinationEngine: database.EngineEnum; - /** Parameters for the integration capability */ - parameters?: database.capabilities.integration.Parameter[]; - /** Source engine for the integration */ - sourceEngine: database.EngineEnum; - /** Type of the integration */ - type: database.service.integration.TypeEnum; - } - /** Cloud Database option definition */ - export interface Option { - /** Name of the option */ - name: string; - /** Type of the option */ - type: database.TypeEnum; - } - /** Cloud Database plan definition */ - export interface Plan { - /** Automatic backup retention duration */ - backupRetention: string; - /** Description of the plan */ - description: string; - /** Defines the lifecycle of the availability */ - lifecycle: availability.Lifecycle; - /** Name of the plan */ - name: string; - /** Display order */ - order: number; - /** Display tags */ - tags: Tags[]; - } - } - export namespace kafka { - export namespace user { - /** Cloud databases kafka user access definition */ - export interface Access { - /** User cert */ - cert: string; - /** User key for the cert */ - key: string; - } - } /** Cloud databases kafka permissions definition */ - export interface Permissions { - /** Names of the topic permissions (@deprecated) */ - names: string[]; - /** Names of the schema registry permissions */ - schemaRegistry: string[]; - /** Names of the topic permissions */ - topic: string[]; - } - /** Cloud databases kafka schema registry acl definition */ - export interface SchemaRegistryAcl { - /** Acl ID */ - id: string; - /** Permission to give to this username on this resource. Permissions values can be retrieved using /cloud/project/{serviceName}/database/kafka/{clusterId}/permissions */ - permission: string; - /** Resource affected by this acl */ - resource: string; - /** Username affected by this acl */ - username: string; - } - /** Cloud database kafka service definition */ - export interface Service { - /** Time on which backups start every day */ - backupTime: string; - /** Capabilities of the services */ - capabilities: Record; - /** Category of the engine */ - category: CategoryEnum; - /** Date of the creation of the cluster */ - createdAt: string; - /** Description of the cluster */ - description: string; - /** Disk attributes of the cluster. @deprecated: use storage */ - disk: database.service.Disk; - /** List of all endpoints of the service */ - endpoints: database.service.Endpoint[]; - /** Name of the engine of the service */ - engine: database.EngineEnum; - /** The VM flavor used for this cluster */ - flavor: string; - /** Service ID */ - id: string; - /** IP Blocks authorized to access to the cluster */ - ipRestrictions: database.service.IpRestriction[]; - /** Time on which maintenances can start every day */ - maintenanceTime: string; - /** Private network ID in which the cluster is */ - networkId?: string; - /** Type of network of the cluster */ - networkType: database.NetworkTypeEnum; - /** Number of nodes in the cluster. @deprecated: useNodes */ - nodeNumber: number; - /** Nodes of the cluster */ - nodes: database.service.Node[]; - /** Plan of the cluster */ - plan: string; - /** Defines whether the REST API is enabled on the cluster */ - restApi: boolean; - /** Defines whether the schema registry is enabled on the cluster */ - schemaRegistry: boolean; - /** Current status of the cluster */ - status: database.StatusEnum; - /** Storage attributes of the cluster */ - storage?: database.service.Storage; - /** Private subnet ID in which the cluster is */ - subnetId?: string; - /** Version of the engine deployed on the cluster */ - version: string; - } - /** Cloud database kafka topic definition */ - export interface Topic { - /** Topic ID */ - id: string; - /** Minimum insync replica accepted for this topic */ - minInsyncReplicas: number; - /** Name of the topic */ - name: string; - /** Number of partitions for this topic */ - partitions: number; - /** Number of replication for this topic */ - replication: number; - /** Number of bytes for the retention of the data for this topic */ - retentionBytes: number; - /** Number of hours for the retention of the data for this topic */ - retentionHours: number; - } - /** Cloud databases kafka topic acl definition */ - export interface TopicAcl { - /** Acl ID */ - id: string; - /** Permission to give to this username on this topic. Permissions values can be retrieved using /cloud/project/{serviceName}/database/kafka/{clusterId}/permissions */ - permission: string; - /** Topic affected by this acl */ - topic: string; - /** Username affected by this acl */ - username: string; - } - /** Cloud database kafka topic creation definition */ - export interface TopicCreation { - /** Topic ID */ - id: string; - /** Minimum insync replica accepted for this topic */ - minInsyncReplicas: number; - /** Name of the topic */ - name: string; - /** Number of partitions for this topic */ - partitions: number; - /** Number of replication for this topic */ - replication: number; - /** Number of bytes for the retention of the data for this topic */ - retentionBytes: number; - /** Number of hours for the retention of the data for this topic */ - retentionHours: number; - } - } - export namespace kafkaConnect { - export namespace capabilities { - export namespace connector { - export namespace configuration { - /** KafkaConnect connector config property definition */ - export interface Property { - /** Defines the default value is exists */ - defaultValue?: string; - /** Description of the property */ - description: string; - /** Pretty name of the property */ - displayName: string; - /** Group to which belongs the property */ - group: string; - /** Importance of the property */ - importance: database.kafkaConnect.capabilities.connector.property.ImportanceEnum; - /** Name of the property */ - name: string; - /** Defines whether the property is required */ - required: boolean; - /** Type of data of the property */ - type: database.kafkaConnect.connector.property.TypeEnum; - /** Possible values for the property if string and applicable */ - values?: string[]; - } - } - export namespace property { - /** Possible importance for the kafka connectors properties */ - export enum ImportanceEnum { - 'high' = 'high', - 'low' = 'low', - 'medium' = 'medium', - } - } /** KafkaConnect connector transform definition */ - export interface Transform { - /** Description of the transform */ - description: string; - /** Pretty name of the transform */ - displayName: string; - /** Name of the transform */ - name: string; - /** Defines whether the transform is required */ - required: boolean; - /** Transform type this transform relates to */ - transformType: string; - /** Type of data of the transform */ - type: database.kafkaConnect.connector.property.TypeEnum; - /** Possible values for the transform if applicable */ - values?: string[]; - } - /** Possible types for the kafka connectors */ - export enum TypeEnum { - 'sink' = 'sink', - 'source' = 'source', - } - } /** KafkaConnect connector capability definition */ - export interface Connector { - /** Name of the connector's author */ - author: string; - /** URL of the official documentation of the connector */ - documentationUrl: string; - /** Connector ID */ - id: string; - /** Defines whether this connector and version is the latest available */ - latest: boolean; - /** Name of the connector */ - name: string; - /** Defines whether the connector is in preview */ - preview: boolean; - /** Type of connector */ - type: database.kafkaConnect.capabilities.connector.TypeEnum; - /** Version of the connector */ - version: string; - } - } - export namespace connector { - export namespace property { - /** Possible types for the kafka connectors properties */ - export enum TypeEnum { - 'boolean' = 'boolean', - 'class' = 'class', - 'double' = 'double', - 'int16' = 'int16', - 'int32' = 'int32', - 'int64' = 'int64', - 'list' = 'list', - 'password' = 'password', - 'string' = 'string', - 'transform' = 'transform', - } - } - export namespace task { - /** Possible state of connector task */ - export enum StatusEnum { - 'FAILED' = 'FAILED', - 'PAUSED' = 'PAUSED', - 'RUNNING' = 'RUNNING', - } - } /** Possible state of connector */ - export enum StatusEnum { - 'CREATING' = 'CREATING', - 'FAILED' = 'FAILED', - 'PAUSED' = 'PAUSED', - 'RUNNING' = 'RUNNING', - 'UNASSIGNED' = 'UNASSIGNED', - } - /** KafkaConnect connector definition */ - export interface Task { - /** Task ID */ - id: number; - /** Status of the task */ - status: database.kafkaConnect.connector.task.StatusEnum; - /** Trace of the task */ - trace: string; - } - } /** KafkaConnect connector definition */ - export interface Connector { - /** Configuration of the connector */ - configuration: Record; - /** Connector capability ID */ - connectorId: string; - /** Connector ID */ - id: string; - /** Name of the connector */ - name: string; - /** Status of the connector */ - status: database.kafkaConnect.connector.StatusEnum; - } - /** KafkaConnect connector definition */ - export interface ConnectorCreation { - /** Configuration of the connector */ - configuration: Record; - /** Connector capability ID */ - connectorId: string; - /** Name of the connector */ - name: string; - } - } - export namespace m3db { - export namespace namespace { - /** M3db namespace retention definition */ - export interface Retention { - /** Controls how long we wait before expiring stale data */ - blockDataExpirationDuration?: string; - /** Controls how long to keep a block in memory before flushing to a fileset on disk */ - blockSizeDuration?: string; - /** Controls how far into the future writes to the namespace will be accepted */ - bufferFutureDuration?: string; - /** Controls how far into the past writes to the namespace will be accepted */ - bufferPastDuration?: string; - /** Controls the duration of time that M3DB will retain data for the namespace */ - periodDuration: string; - } - /** Possible type of the service integration */ - export enum TypeEnum { - 'aggregated' = 'aggregated', - 'unaggregated' = 'unaggregated', - } - } /** M3db Namespace definition */ - export interface Namespace { - /** Namespace ID */ - id: string; - /** Name of the namespace */ - name: string; - /** Resolution for an aggregated namespace */ - resolution?: string; - /** Retention configuration */ - retention: database.m3db.namespace.Retention; - /** Defines whether M3db will create snapshot files for this namespace */ - snapshotEnabled: boolean; - /** Type of namespace */ - type: database.m3db.namespace.TypeEnum; - /** Defines whether M3db will include writes to this namespace in the commit log */ - writesToCommitLogEnabled: boolean; - } - /** M3db Namespace creation definition */ - export interface NamespaceCreation { - /** Namespace ID - id: string; */ - /** Name of the namespace */ - name: string; - /** Resolution for an aggregated namespace */ - resolution: string; - /** Retention configuration */ - retention: database.m3db.namespace.Retention; - /** Defines whether M3db will create snapshot files for this namespace */ - snapshotEnabled: boolean; - /** Type of namespace */ - type: database.m3db.namespace.TypeEnum; - /** Defines whether M3db will include writes to this namespace in the commit log */ - writesToCommitLogEnabled: boolean; - } - /** M3db User definition */ - export interface User { - /** Date of the creation of the user */ - createdAt: string; - /** Group of the user */ - group: string; - /** User ID */ - id: string; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - /** User creation definition */ - export interface UserCreation { - /** Group of the user */ - group: string; - /** Name of the user */ - name: string; - } - /** M3db User definition */ - export interface UserWithPassword { - /** Date of the creation of the user */ - createdAt: string; - /** Group of the user */ - group: string; - /** User ID */ - id: string; - /** Password of the user */ - password: string; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - } - export namespace mysql { - export namespace querystatistics { - /** Cloud database mysql single query statistic definition */ - export interface Query { - /** Average wait time of the summarized timed events, in milliseconds */ - avgTimerWait: number; - /** Number of summarized events. This value includes all events, whether timed or nontimed */ - countStar: number; - /** Digest of the summarized events */ - digest: string; - /** Text of the summarized digest events */ - digestText: string; - /** First appearance of the events */ - firstSeen: string; - /** Last appearance of the events */ - lastSeen: string; - /** Maximum wait time of the summarized timed events, in milliseconds */ - maxTimerWait: number; - /** Mininum wait time of the summarized timed events, in milliseconds */ - minTimerWait: number; - /** 95th percentile of the statement latency, in picoseconds */ - quantile95: number; - /** 99th percentile of the statement latency, in picoseconds */ - quantile99: number; - /** 99.9th percentile of the statement latency, in picoseconds */ - quantile999: number; - /** Datetime when the querySampleText column was seen */ - querySampleSeen: string; - /** Sample SQL statement that produces the digest value in the row */ - querySampleText: string; - /** Wait time for the sample statement in the querySampleText column, in milliseconds */ - querySampleTimerWait: number; - /** SchemaName of the summarized events */ - schemaName: string; - /** Number of internal on-disk temporary tables created */ - sumCreatedTmpDiskTables: number; - /** Number of internal temporary tables created */ - sumCreatedTmpTables: number; - /** Number of errors */ - sumErrors: number; - /** Sum of lock time of the summarized timed events, in milliseconds */ - sumLockTime: number; - /** Sum of not good indexes of the summarized timed events */ - sumNoGoodIndexUsed: number; - /** Sum of no indexes of the summarized timed events */ - sumNoIndexUsed: number; - /** Sum of rows affected of the summarized timed events */ - sumRowsAffected: number; - /** Sum of rows examined of the summarized timed events */ - sumRowsExamined: number; - /** Sum of rows sent of the summarized timed events */ - sumRowsSent: number; - /** Sum of select full join of the summarized timed events */ - sumSelectFullJoin: number; - /** Sum of select full range join of the summarized timed events */ - sumSelectFullRangeJoin: number; - /** Sum of select range of the summarized timed events */ - sumSelectRange: number; - /** Sum of select range check of the summarized timed events */ - sumSelectRangeCheck: number; - /** Sum of select scan of the summarized timed events */ - sumSelectScan: number; - /** Sum of sorted merge passes of the summarized timed events */ - sumSortMergePasses: number; - /** Sum of sorted range of the summarized timed events */ - sumSortRange: number; - /** Sum of sorted rows of the summarized timed events */ - sumSortRows: number; - /** Sum of sort scan of the summarized timed events */ - sumSortScan: number; - /** Sum of wait time of the summarized timed events, in milliseconds */ - sumTimerWait: number; - /** Number of warnings */ - sumWarnings: number; - } - } /** Cloud database mysql query statistics response body definition */ - export interface QueryStatistics { - /** Statistics of the queries */ - queries: database.mysql.querystatistics.Query[]; - } - } - export namespace opensearch { - /** Cloud database opensearch index definition */ - export interface Index { - /** Date of the creation of the index */ - createdAt: string; - /** Number of documents hold by the index */ - documents: number; - /** Index ID */ - id: string; - /** Name of the index */ - name: string; - /** Number of replicas of the index */ - replicasNumber: number; - /** Number of shards of the index */ - shardsNumber: number; - /** Size of the index */ - size: number; - } - /** Cloud database opensearch pattern definition */ - export interface Pattern { - /** Pattern ID */ - id: string; - /** Maximum number of index for this pattern */ - maxIndexCount: number; - /** Pattern format */ - pattern: string; - } - /** Cloud database opensearch permissions definition */ - export interface Permissions { - /** Possible values for the permissions */ - names: string[]; - } - /** Cloud database opensearch service definition */ - export interface Service { - /** Defines whether the acls are enabled on the cluster */ - aclsEnabled: boolean; - /** Time on which backups start every day. @deprecated: use backups.time */ - backupTime: string; - /** Information related to the backups, null if the engine does not support backups */ - backups?: database.service.Backup; - /** Capabilities of the services */ - capabilities: Record; - /** Category of the engine */ - category: CategoryEnum; - /** Date of the creation of the cluster */ - createdAt: string; - /** Description of the cluster */ - description: string; - /** Disk attributes of the cluster. @deprecated: use storage */ - disk: database.service.Disk; - /** List of all endpoints of the service */ - endpoints: database.service.Endpoint[]; - /** Name of the engine of the service */ - engine: database.EngineEnum; - /** The VM flavor used for this cluster */ - flavor: string; - /** Service ID */ - id: string; - /** IP Blocks authorized to access to the cluster */ - ipRestrictions: database.service.IpRestriction[]; - /** Time on which maintenances can start every day */ - maintenanceTime: string; - /** Private network ID in which the cluster is */ - networkId?: string; - /** Type of network of the cluster */ - networkType: database.NetworkTypeEnum; - /** Number of nodes in the cluster. @deprecated: use nodes */ - nodeNumber: number; - /** Nodes of the cluster */ - nodes: database.service.Node[]; - /** Plan of the cluster */ - plan: string; - /** Current status of the cluster */ - status: database.StatusEnum; - /** Storage attributes of the cluster */ - storage?: database.service.Storage; - /** Private subnet ID in which the cluster is */ - subnetId?: string; - /** Version of the engine deployed on the cluster */ - version: string; - } - /** Opensearch user definition */ - export interface User { - /** Acls of the user */ - acls: database.opensearch.UserAcl[]; - /** Date of the creation of the user */ - createdAt: string; - /** User ID */ - id: string; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - /** Opensearch user acl definition */ - export interface UserAcl { - /** Pattern of the ACL */ - pattern: string; - /** Permission of the ACL */ - permission: string; - } - /** Opensearch user creation definition */ - export interface UserCreation { - /** Acls of the user */ - acls: database.opensearch.UserAcl[]; - /** Name of the user */ - name: string; - } - /** Opensearch user definition */ - export interface UserWithPassword { - /** Acls of the user */ - acls: database.opensearch.UserAcl[]; - /** Date of the creation of the user */ - createdAt: string; - /** User ID */ - id: string; - /** Password of the user */ - password: string; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - } - export namespace postgresql { - export namespace connectionpool { - /** Possible modes for the connection pools */ - export enum ModeEnum { - 'session' = 'session', - 'statement' = 'statement', - 'transaction' = 'transaction', - } - /** Possible ssl modes for the connection pools */ - export enum SslModeEnum { - 'require' = 'require', - } - } - export namespace querystatistics { - /** Cloud database postgresql single query statistic definition */ - export interface Query { - /** Time spent reading data file blocks by backends in this database, in milliseconds */ - blkReadTime: number; - /** Time spent writing data file blocks by backends in this database, in milliseconds */ - blkWriteTime: number; - /** Number of times this function has been called */ - calls: number; - /** Name of the database */ - databaseName: string; - /** Total number of local blocks dirtied by the statement */ - localBlksDirtied: number; - /** Total number of local block cache hits by the statement */ - localBlksHit: number; - /** Total number of local blocks read by the statement */ - localBlksRead: number; - /** Total number of local blocks written by the statement */ - localBlksWritten: number; - /** Maximum time spent planning the statement, in milliseconds */ - maxPlanTime: number; - /** Maximum time spent for the statement, in milliseconds */ - maxTime: number; - /** Mean time spent planning the statement, in milliseconds */ - meanPlanTime: number; - /** Mean time spent for the statement, in milliseconds */ - meanTime: number; - /** Minimum time spent planning the statement, in milliseconds */ - minPlanTime: number; - /** Minimum time spent for the statement, in milliseconds */ - minTime: number; - /** Text of a representative statement */ - query: string; - /** Total number of rows retrieved or affected by the statement */ - rows: number; - /** Total number of shared blocks dirtied by the statement */ - sharedBlksDirtied: number; - /** Total number of shared block cache hits by the statement */ - sharedBlksHit: number; - /** Total number of shared blocks read by the statement */ - sharedBlksRead: number; - /** Total number of shared blocks written by the statement */ - sharedBlksWritten: number; - /** Population standard deviation of time spent planning the statement, in milliseconds */ - stddevPlanTime: number; - /** Population standard deviation of time spent for the statement, in milliseconds */ - stddevTime: number; - /** Total number of temp blocks read by the statement */ - tempBlksRead: number; - /** Total number of temp blocks written by the statement */ - tempBlksWritten: number; - /** Total time spent planning the statement, in milliseconds */ - totalPlanTime: number; - /** Total time spent for the statement, in milliseconds */ - totalTime: number; - /** Name of the user who executed the statement */ - username: string; - /** Total amount of WAL generated by the statement in bytes */ - walBytes: { - unit: string; - value: number; - }; - /** Total number of WAL full page images generated by the statement */ - walFpi: number; - /** Total number of WAL records generated by the statement */ - walRecords: number; - } - } /** Cloud database postgresql connection pool response body definition */ - export interface ConnectionPool { - /** Database used for the connection pool */ - databaseId: string; - /** ID of the connection pool */ - id: string; - /** Connection mode to the connection pool */ - mode: database.postgresql.connectionpool.ModeEnum; - /** Name of the connection pool */ - name: string; - /** Port of the connection pool */ - port: number; - /** Size of the connection pool */ - size: number; - /** Ssl connection mode for the pool */ - sslMode?: database.postgresql.connectionpool.SslModeEnum; - /** Connection URI to the pool */ - uri: string; - /** User authorized to connect to the pool, if none all the users are allowed */ - userId?: string; - } - /** Cloud database postgresql connection pool creation body definition */ - export interface ConnectionPoolCreation { - /** Database used for the connection pool */ - databaseId: string; - /** Connection mode to the connection pool */ - mode: database.postgresql.connectionpool.ModeEnum; - /** Name of the connection pool */ - name: string; - /** Size of the connection pool */ - size: number; - /** User authorized to connect to the pool, if none all the users are allowed */ - userId?: string; - } - /** Cloud database postgresql query statistics response body definition */ - export interface QueryStatistics { - /** Statistics of the queries */ - queries: database.postgresql.querystatistics.Query[]; - } - } - export namespace redis { - /** Redis user definition */ - export interface User { - /** Categories of the user */ - categories: string[]; - /** Channels of the user */ - channels: string[]; - /** Commands of the user */ - commands: string[]; - /** Date of the creation of the user */ - createdAt: string; - /** User ID */ - id: string; - /** Keys of the user */ - keys: string[]; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - /** Redis user definition */ - export interface UserCreation { - /** Categories of the user */ - categories: string[]; - /** Channels of the user */ - channels: string[]; - /** Commands of the user */ - commands: string[]; - /** Keys of the user */ - keys: string[]; - /** Name of the user */ - name: string; - } - /** Redis user with password definition */ - export interface UserWithPassword { - /** Categories of the user */ - categories: string[]; - /** Channels of the user */ - channels: string[]; - /** Commands of the user */ - commands: string[]; - /** Date of the creation of the user */ - createdAt: string; - /** User ID */ - id: string; - /** Keys of the user */ - keys: string[]; - /** Password of the user */ - password: string; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - } - export namespace service { - export namespace capability { - /** State of the service capability for the service */ - export enum StateEnum { - 'disabled' = 'disabled', - 'enabled' = 'enabled', - } - } - export namespace creation { - /** Defines the source to fork a cluster from a backup. @deprecated: use forkFrom */ - export interface BackupFork { - /** Backup ID (not compatible with pointInTime) */ - id: string; - /** Point in time to restore from (not compatible with id) */ - pointInTime: string; - /** Service ID to which the backups belong to */ - serviceId: string; - } - /** Defines the source to fork a cluster from a backup */ - export interface ForkFrom { - /** Backup ID (not compatible with pointInTime) */ - backupId?: string; - /** Point in time to restore from (not compatible with id) */ - pointInTime?: string; - /** Service ID to which the backups belong to */ - serviceId: string; - } - } - export namespace currentqueries { - export namespace query { - /** Cloud database service current queries query cancel request */ - export interface CancelRequest { - /** Database server connection ID */ - pid: number; - /** Request immediate termination instead of soft cancel */ - terminate: boolean; - } - /** Cloud database service current queries query cancel response */ - export interface CancelResponse { - /** Status reported by the database server */ - success: boolean; - } - } /** Cloud database service current queries query definition */ - export interface Query { - /** Application name */ - applicationName: string; - /** Backend start timestamp */ - backendStart?: string; - /** Backend type */ - backendType?: string; - /** XID for current backend */ - backendXid?: number; - /** Xmin for current backend */ - backendXmin?: number; - /** Client hostname */ - clientHostname?: string; - /** Client ip address */ - clientIp?: string; - /** Client port */ - clientPort?: number; - /** Database ID */ - databaseId?: number; - /** Database name */ - databaseName: string; - /** Leader process ID */ - leaderPid?: number; - /** Connection process ID */ - pid: number; - /** Current query running on this connection */ - query: string; - /** Duration of the query in seconds */ - queryDuration: number; - /** Query start timestamp */ - queryStart?: string; - /** Connection state */ - state: database.service.currentqueries.StateEnum; - /** Connection state change timestamp */ - stateChange?: string; - /** Transaction start timestamp */ - transactionStart?: string; - /** User ID */ - userId?: number; - /** User name */ - userName: string; - /** Connection wait event */ - waitEvent?: string; - /** Connection wait event type */ - waitEventType?: database.service.currentqueries.WaitEventTypeEnum; - } - /** Possible state of a query */ - export enum StateEnum { - 'ACTIVE' = 'ACTIVE', - 'DISABLED' = 'DISABLED', - 'FASTPATH_FUNCTION_CALL' = 'FASTPATH_FUNCTION_CALL', - 'IDLE' = 'IDLE', - 'IDLE_IN_TRANSACTION' = 'IDLE_IN_TRANSACTION', - 'IDLE_IN_TRANSACTION_ABORTED' = 'IDLE_IN_TRANSACTION_ABORTED', - } - /** Possible event type on which the backend is waiting */ - export enum WaitEventTypeEnum { - 'ACTIVITY' = 'ACTIVITY', - 'BUFFER_PIN' = 'BUFFER_PIN', - 'CLIENT' = 'CLIENT', - 'EXTENSION' = 'EXTENSION', - 'IO' = 'IO', - 'IPC' = 'IPC', - 'LOCK' = 'LOCK', - 'LWLOCK' = 'LWLOCK', - 'TIMEOUT' = 'TIMEOUT', - } - } - export namespace endpoint { - /** Defines all the values for the component in the service endpoints */ - export enum ComponentEnum { - 'cassandra' = 'cassandra', - 'grafana' = 'grafana', - 'graphite' = 'graphite', - 'influxdb' = 'influxdb', - 'kafka' = 'kafka', - 'kafkaConnect' = 'kafkaConnect', - 'kafkaRestApi' = 'kafkaRestApi', - 'kafkaSASL' = 'kafkaSASL', - 'kafkaSchemaRegistry' = 'kafkaSchemaRegistry', - 'kibana' = 'kibana', - 'm3coordinator' = 'm3coordinator', - 'mongodb' = 'mongodb', - 'mongodbAnalytics' = 'mongodbAnalytics', - 'mongodbSrv' = 'mongodbSrv', - 'mongodbSrvAnalytics' = 'mongodbSrvAnalytics', - 'mysql' = 'mysql', - 'mysqlRead' = 'mysqlRead', - 'mysqlx' = 'mysqlx', - 'opensearch' = 'opensearch', - 'postgresql' = 'postgresql', - 'postgresqlRead' = 'postgresqlRead', - 'postgresqlReadReplica' = 'postgresqlReadReplica', - 'prometheusRead' = 'prometheusRead', - 'prometheusWrite' = 'prometheusWrite', - 'redis' = 'redis', - } - } - export namespace integration { - /** Possible state of the integration */ - export enum StatusEnum { - 'READY' = 'READY', - } - /** Possible type of the service integration */ - export enum TypeEnum { - 'grafanaDashboard' = 'grafanaDashboard', - 'grafanaDatasource' = 'grafanaDatasource', - 'kafkaConnect' = 'kafkaConnect', - 'kafkaLogs' = 'kafkaLogs', - 'kafkaMirrorMaker' = 'kafkaMirrorMaker', - 'm3aggregator' = 'm3aggregator', - 'm3dbMetrics' = 'm3dbMetrics', - 'opensearchLogs' = 'opensearchLogs', - 'postgresqlMetrics' = 'postgresqlMetrics', - } - } - export namespace maintenance { - /** Possible status of a service maintenance */ - export enum StatusEnum { - 'APPLIED' = 'APPLIED', - 'APPLYING' = 'APPLYING', - 'ERROR' = 'ERROR', - 'PENDING' = 'PENDING', - 'SCHEDULED' = 'SCHEDULED', - } - } - export namespace node { - /** Node role values */ - export enum RoleEnum { - 'ANALYTICS' = 'ANALYTICS', - 'STANDARD' = 'STANDARD', - } - } - export namespace replication { - /** Possible type of the service integration */ - export enum PolicyClassEnum { - 'org.apache.kafka.connect.mirror.DefaultReplicationPolicy' = 'org.apache.kafka.connect.mirror.DefaultReplicationPolicy', - 'org.apache.kafka.connect.mirror.IdentityReplicationPolicy' = 'org.apache.kafka.connect.mirror.IdentityReplicationPolicy', - } - } /** Cloud database service backups definition */ - export interface Backup { - /** Date until PITR is available */ - pitr?: string; - /** Regions on which the backups are stored */ - regions: string[]; - /** Number of retention days for the backups */ - retentionDays?: number; - /** Time on which backups start every day */ - time: string; - } - /** Cloud database service capability actions definition */ - export interface CapabilityActions { - /** Defines if the capability can be created */ - create?: service.capability.StateEnum; - /** Defines if the capability can be deleted */ - delete?: service.capability.StateEnum; - /** Defines if the capability can be read */ - read?: service.capability.StateEnum; - /** Defines if the capability can be updated */ - update?: service.capability.StateEnum; - } - /** List of capabilities available for services */ - export enum CapabilityEnum { - 'advancedConfiguration' = 'advancedConfiguration', - 'backupTime' = 'backupTime', - 'backups' = 'backups', - 'backupRestore' = 'backupRestore', - 'certificates' = 'certificates', - 'connectionPools' = 'connectionPools', - 'currentQueries' = 'currentQueries', - 'currentQueriesCancel' = 'currentQueriesCancel', - 'databases' = 'databases', - 'enableWrites' = 'enableWrites', - 'fork' = 'fork', - 'integrations' = 'integrations', - 'ipRestrictions' = 'ipRestrictions', - 'maintenanceApply' = 'maintenanceApply', - 'maintenanceTime' = 'maintenanceTime', - 'maintenances' = 'maintenances', - 'namespaces' = 'namespaces', - 'nodes' = 'nodes', - 'queryStatistics' = 'queryStatistics', - 'queryStatisticsReset' = 'queryStatisticsReset', - 'service' = 'service', - 'userCredentialsReset' = 'userCredentialsReset', - 'users' = 'users', - } - /** Certificates definition for cloud project databases */ - export interface Certificates { - /** CA certificate used for the service */ - ca: string; - } - /** Cloud database current queries */ - export interface CurrentQueries { - /** Current queries list */ - queries: database.service.currentqueries.Query[]; - } - /** A single value from a metric */ - export interface DataPoint { - /** Timestamp in seconds since epoch time */ - timestamp: number; - /** Value of this datapoint */ - value: number; - } - /** Defines the database object in a cluster */ - export interface Database { - /** Defines if the database has been created by default */ - default: boolean; - /** Database ID */ - id: string; - /** Database name */ - name: string; - } - /** Defines the disk attributes of a service */ - export interface Disk { - /** Service disk size */ - size: number; - /** Service disk size */ - type?: string; - } - /** Defines the endpoint object in a cluster */ - export interface Endpoint { - /** Type of component the URI relates to */ - component: database.service.endpoint.ComponentEnum; - /** Domain of the cluster */ - domain: string; - /** Path of the endpoint */ - path?: string; - /** Connection port for the endpoint */ - port?: number; - /** Scheme used to generate the URI */ - scheme?: string; - /** Defines whether the endpoint uses SSL */ - ssl: boolean; - /** SSL mode used to connect to the service if the SSL is enabled */ - sslMode?: string; - /** URI of the endpoint */ - uri?: string; - } - /** Metrics datapoints from a specific host */ - export interface HostMetric { - /** List of metric's samples */ - dataPoints: database.service.DataPoint[]; - /** Name of the originating host */ - hostname: string; - } - /** Cloud database service integration definition */ - export interface Integration { - /** ID of the destination service */ - destinationServiceId: string; - /** Service ID */ - id: string; - /** Parameters for the integration */ - parameters?: Record; - /** ID of the source service */ - sourceServiceId: string; - /** Current status of the integration */ - status: database.service.integration.StatusEnum; - /** Type of the integration */ - type: database.service.integration.TypeEnum; - } - /** Ip Restriction definition for cloud project databases */ - export interface IpRestriction { - /** Description of the ip restriction */ - description: string; - /** Whitelisted IP */ - ip: string; - /** Current status of the ip restriction */ - status?: database.StatusEnum; - } - /** A single log entry */ - export interface LogEntry { - /** Host from which the log is coming from */ - hostname: string; - /** The log message */ - message: string; - /** Timestamp in seconds since epoch time */ - timestamp: number; - } - /** Cloud database service maintenance definition */ - export interface Maintenance { - /** Date of the application of the maintenance */ - appliedAt?: string; - /** Description of the maintenance */ - description: string; - /** ID of the maintenance */ - id: string; - /** Date of the planification of the maintenance */ - scheduledAt?: string; - /** Status of the maintenance */ - status: database.service.maintenance.StatusEnum; - } - /** Metric definition for cloud project databases */ - export interface Metric { - /** Metric values for each cluster's host */ - metrics: database.service.HostMetric[]; - /** Name of the metric */ - name: string; - /** Unit of the metric */ - units: database.service.MetricUnitEnum; - } - /** Supported metrics query period */ - export enum MetricPeriodEnum { - 'lastHour' = 'lastHour', - 'lastDay' = 'lastDay', - 'lastWeek' = 'lastWeek', - 'lastMonth' = 'lastMonth', - 'lastYear' = 'lastYear', - } - /** Supported unit types for metrics */ - export enum MetricUnitEnum { - 'BYTES' = 'BYTES', - 'BYTES_PER_SECOND' = 'BYTES_PER_SECOND', - 'GIGABYTES' = 'GIGABYTES', - 'GIGABYTES_PER_HOUR' = 'GIGABYTES_PER_HOUR', - 'MEGABYTES' = 'MEGABYTES', - 'MEGABYTES_PER_SECOND' = 'MEGABYTES_PER_SECOND', - 'MILLISECONDS' = 'MILLISECONDS', - 'PERCENT' = 'PERCENT', - 'SCALAR' = 'SCALAR', - 'SCALAR_PER_SECOND' = 'SCALAR_PER_SECOND', - 'SECONDS' = 'SECONDS', - 'UNKNOWN' = 'UNKNOWN', - } - /** Cloud databases cluster node definition */ - export interface Node { - /** Date of the creation of the node */ - createdAt: string; - /** Flavor of the node */ - flavor: string; - /** Node ID */ - id: string; - /** Name of the node */ - name: string; - /** Connection port for the node */ - port: number; - /** Region of the node */ - region: string; - /** Role of the node */ - role?: database.service.node.RoleEnum; - /** Current status of the node */ - status: database.StatusEnum; - } - /** Cloud databases cluster new node definition */ - export interface NodeCreation { - /** Flavor of the node */ - flavor: string; - /** Region of the node */ - region: string; - /** Role of the node */ - role?: database.service.node.RoleEnum; - } - /** Node pattern definition */ - export interface NodePattern { - /** Flavor of the nodes */ - flavor: string; - /** Number of nodes to create */ - number: number; - /** Region of the nodes */ - region: string; - } - /** Cloud database service replication definition */ - export interface Replication { - /** Defines whether heartbeats are emitted */ - emitHeartbeats: boolean; - /** Defines whether the replication is actived */ - enabled: boolean; - /** Service ID */ - id: string; - /** ReplicationPolicyClass used for the replication */ - replicationPolicyClass: database.service.replication.PolicyClassEnum; - /** ID of the integration source */ - sourceIntegration: string; - /** Defines whether the group offsets must be sync */ - syncGroupOffsets: boolean; - /** Defines the interval in second between 2 sync */ - syncInterval: number; - /** ID of the integration target */ - targetIntegration: string; - /** Patterns of the topics to exclude from the replication */ - topicExcludeList: string[]; - /** Patterns of the topics to replicate */ - topics: string[]; - } - /** Cloud database service replication definition */ - export interface ReplicationCreation { - /** Defines whether heartbeats are emitted */ - emitHeartbeats: boolean; - /** Defines whether the replication is actived */ - enabled: boolean; - /** ReplicationPolicyClass used for the replication */ - replicationPolicyClass: database.service.replication.PolicyClassEnum; - /** ID of the integration source */ - sourceIntegration: string; - /** Defines whether the group offsets must be sync */ - syncGroupOffsets: boolean; - /** Defines the interval in second between 2 sync */ - syncInterval: number; - /** ID of the integration target */ - targetIntegration: string; - /** Patterns of the topics to exclude from the replication */ - topicExcludeList: string[]; - /** Patterns of the topics to replicate */ - topics: string[]; - } - /** Cloud database service restore specification */ - export interface Restore { - /** point in time to restore from */ - pointInTime: string; - } - /** Defines the storage attributes of a service */ - export interface Storage { - /** Service storage size */ - size: { - unit: string; - value: number; - }; - /** Service storage type */ - type: string; - } - /** User definition */ - export interface User { - /** Date of the creation of the user */ - createdAt: string; - /** User ID */ - id: string; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - /** User creation definition */ - export interface UserCreation { - /** Name of the user */ - name: string; - } - /** User with password definition */ - export interface UserWithPassword { - /** Date of the creation of the user */ - createdAt: string; - /** User ID */ - id: string; - /** Password of the user */ - password: string; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - /** User with password definition */ - export interface UserWithPasswordAndRoles { - /** Date of the creation of the user */ - createdAt: string; - /** User ID */ - id: string; - /** Password of the user */ - password: string; - /** Roles the user belongs to */ - roles: string[]; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - /** User definition */ - export interface UserWithRoles { - /** Date of the creation of the user */ - createdAt: string; - /** User ID */ - id: string; - /** Roles the user belongs to */ - roles: string[]; - /** Current status of the user */ - status: database.StatusEnum; - /** Name of the user */ - username: string; - } - /** User creation definition */ - export interface UserWithRolesCreation { - /** Name of the user */ - name: string; - /** Roles the user belongs to */ - roles: string[]; - } - } /** Availability of databases engines on cloud projects */ - export interface Availability { - /** Defines the type of backup. @@deprecated: use backups.enable */ - backup?: database.BackupTypeEnum; - /** Backup retention time of the availability in days. @deprecated: use backups.retentionDays */ - backupRetentionDays?: number; - /** Defines backups strategy for the availability */ - backups: database.availability.Backups; - /** Category of the engine */ - category: CategoryEnum; - /** Whether this availability can be used by default */ - default: boolean; - /** End of life of the product. @deprecated: use lifecycle.endOfLife */ - endOfLife?: string; - /** Database engine name */ - engine: string; - /** Flavor name. @deprecated: use specifications.flavor */ - flavor?: string; - /** Defines the lifecycle of the availability */ - lifecycle: database.availability.Lifecycle; - /** Maximum possible disk size in GB. @deprecated: use specifications.storage.maximum */ - maxDiskSize?: number; - /** Maximum nodes of the cluster. @deprecated: use specifications.nodes.maximum */ - maxNodeNumber?: number; - /** Minimum possible disk size in GB. @deprecated: use specifications.storage.minimum */ - minDiskSize?: number; - /** Minimum nodes of the cluster. @deprecated: use specifications.nodes.minimum */ - minNodeNumber?: number; - /** Type of network. @deprecated: use specifications.network */ - network?: database.NetworkTypeEnum; - /** Plan name */ - plan: string; - /** Region name */ - region: string; - /** Defines the technical specifications of the availability */ - specifications: database.availability.Specifications; - /** Date of the release of the product. @deprecated: use lifecycle.startDate */ - startDate?: string; - /** Status of the availability. @deprecated: use lifecycle.status */ - status?: database.availability.StatusEnum; - /** Flex disk size step in GB. @deprecated: use specifications.storage.step */ - stepDiskSize?: number; - /** End of life of the upstream product. @deprecated: use lifecycle */ - upstreamEndOfLife?: string; - /** Version name */ - version: string; - } - /** Cloud database backup definition */ - export interface Backup { - /** Date of the creation of the backup */ - createdAt: string; - /** Description of the backup */ - description: string; - /** Backup ID */ - id: string; - /** Region where the backup is stored. @deprecated: use regions */ - region: string; - /** Regions where the backup are stored */ - regions: database.backup.Region[]; - /** Size of the backup */ - size: { - unit: string; - value: number; - }; - /** Current status of the backup */ - status: database.StatusEnum; - /** Type of backup */ - type: database.BackupTypeEnum; - } - /** Type of backup for the cluster */ - export enum BackupTypeEnum { - 'automatic' = 'automatic', - 'manual' = 'manual', - 'none' = 'none', - 'pitr' = 'pitr', - 'snapshot' = 'snapshot', - } - /** Capabilities available for the databases engines on cloud projects */ - export interface Capabilities { - /** Disks available */ - disks: string[]; - /** Database engines available */ - engines: database.capabilities.Engine[]; - /** Flavors available */ - flavors: database.capabilities.Flavor[]; - /** Options available */ - options: database.capabilities.Option[]; - /** Plans available */ - plans: database.capabilities.Plan[]; - /** Regions available */ - regions: string[]; - } - /** Possible names of the engines */ - export enum EngineEnum { - 'cassandra' = 'cassandra', - 'grafana' = 'grafana', - 'kafka' = 'kafka', - 'kafkaConnect' = 'kafkaConnect', - 'kafkaMirrorMaker' = 'kafkaMirrorMaker', - 'm3aggregator' = 'm3aggregator', - 'm3db' = 'm3db', - 'mongodb' = 'mongodb', - 'mysql' = 'mysql', - 'opensearch' = 'opensearch', - 'postgresql' = 'postgresql', - 'redis' = 'redis', - } - /** Ip Restriction definition for cloud project databases (@deprecated) */ - export interface IpRestriction { - /** Description of the ip restriction */ - description: string; - /** Whitelisted IP */ - ip: string; - /** Current status of the ip restriction */ - status: database.StatusEnum; - } - /** Ip Restriction creation definition for cloud project databases (@deprecated) */ - export interface IpRestrictionCreation { - /** Description of the ip restriction */ - description: string; - /** Whitelisted IP */ - ip: string; - } - /** Type of network in which the databases cluster are */ - export enum NetworkTypeEnum { - 'private' = 'private', - 'public' = 'public', - } - /** Cloud database service definition */ - export interface Service { - /** Time on which backups start every day. @deprecated: use backups.time */ - backupTime: string; - /** Information related to the backups, null if the engine does not support backups */ - backups?: database.service.Backup; - /** Capabilities of the services */ - capabilities: Partial< - Record - >; - /** Category of the engine */ - category: CategoryEnum; - /** Date of the creation of the cluster */ - createdAt: string; - /** Description of the cluster */ - description: string; - /** Disk attributes of the cluster. @deprecated: use storage */ - disk: database.service.Disk; - /** List of all endpoints of the service */ - endpoints: database.service.Endpoint[]; - /** Name of the engine of the service */ - engine: database.EngineEnum; - /** The VM flavor used for this cluster */ - flavor: string; - /** Service ID */ - id: string; - /** IP Blocks authorized to access to the cluster */ - ipRestrictions: database.service.IpRestriction[]; - /** Time on which maintenances can start every day */ - maintenanceTime: string; - /** Private network ID in which the cluster is */ - networkId?: string; - /** Type of network of the cluster */ - networkType: database.NetworkTypeEnum; - /** Number of nodes in the cluster. @deprecated: use nodes */ - nodeNumber: number; - /** Nodes of the cluster */ - nodes: database.service.Node[]; - /** Plan of the cluster */ - plan: string; - /** Region of the cluster */ - region?: string; - /** Current status of the cluster */ - status: database.StatusEnum; - /** Storage attributes of the cluster */ - storage?: database.service.Storage; - /** Private subnet ID in which the cluster is */ - subnetId?: string; - /** Version of the engine deployed on the cluster */ - version: string; - } - /** Cloud databases cluster definition */ - export interface ServiceCreation { - /** Backup from which the new service is created. @deprecated: use forkFrom */ - backup?: database.service.creation.BackupFork; - /** Time on which backups start every day. @deprecated: use backups.time */ - backupTime?: string; - /** Information related to the backups, null if the engine does not support backups */ - backups?: database.service.Backup; - /** Description of the cluster */ - description: string; - /** Disk attributes of the cluster */ - disk?: database.service.Disk; - /** Backup from which the new service is created */ - forkFrom?: database.service.creation.ForkFrom; - /** IP Blocks authorized to access to the cluster */ - ipRestrictions: database.service.IpRestriction[]; - /** Time on which maintenances can start every day */ - maintenanceTime?: string; - /** Private network ID in which the cluster is */ - networkId?: string; - /** List of nodes in the cluster, not compatible with nodesPattern */ - nodesList?: database.service.NodeCreation[]; - /** Pattern definition of the nodes in the cluster, not compatible with nodesList */ - nodesPattern?: database.service.NodePattern; - /** Plan of the cluster */ - plan: string; - /** Private subnet ID in which the cluster is */ - subnetId?: string; - /** Version of the engine deployed on the cluster */ - version: string; - } - /** Possible state of the job */ - export enum StatusEnum { - 'CREATING' = 'CREATING', - 'DELETING' = 'DELETING', - 'ERROR' = 'ERROR', - 'ERROR_INCONSISTENT_SPEC' = 'ERROR_INCONSISTENT_SPEC', - 'LOCKED' = 'LOCKED', - 'LOCKED_PENDING' = 'LOCKED_PENDING', - 'LOCKED_UPDATING' = 'LOCKED_UPDATING', - 'PENDING' = 'PENDING', - 'READY' = 'READY', - 'UPDATING' = 'UPDATING', - } - /** Cloud databases temporary write deadline definition */ - export interface TemporaryWriteDeadline { - /** Date on which the temporary write permissions would be lifted */ - until: string; - } - /** Type of data returned in the capabilities options */ - export enum TypeEnum { - 'boolean' = 'boolean', - 'double' = 'double', - 'duration' = 'duration', - 'long' = 'long', - 'string' = 'string', - } - /** Different categories of engines */ - export enum CategoryEnum { - all = 'all', - operational = 'operational', - analysis = 'analysis', - streaming = 'streaming', - } - /** Suggestion of availability selection */ - export interface Suggestion { - default: boolean; - engine: string; - flavor: string; - plan: string; - region: string; - version: string; - } - /** Engines Capabilites */ - export interface EngineCapabilities { - category: CategoryEnum; - description: string; - lifecycle: database.availability.Lifecycle; - name: string; - order: number; - sslModes: string[]; - storage: database.capabilities.engine.storage.StrategyEnum; - tags: database.capabilities.Tags[]; - versions: { - default: boolean; - lifecycle: database.availability.Lifecycle; - name: string; - tags: database.capabilities.Tags[]; - }[]; - } - /** Regions Capabilites */ - export interface RegionCapabilities { - lifecycle: database.availability.Lifecycle; - name: string; - order: number; - tags: database.capabilities.Tags[]; - } -} diff --git a/packages/manager/apps/pci-databases-analytics/src/models/network.ts b/packages/manager/apps/pci-databases-analytics/src/models/network.ts deleted file mode 100644 index 639209b0df05..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/models/network.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** Network */ -export interface Network { - /** Network id */ - id: string; - /** Network name */ - name: string; - /** Details about private network in region */ - regions: NetworkRegion[]; - /** Network status */ - status: NetworkStatusEnum; - /** Network type */ - type?: NetworkTypeEnum; - /** Network VLAN id */ - vlanId: number; -} -/** NetworkRegion */ -export interface NetworkRegion { - /** Network id on openstack region */ - openstackId?: string; - /** Network region */ - region: string; - /** Network region status */ - status: NetworkRegionStatusEnum; -} -/** NetworkRegionStatusEnum */ -export enum NetworkRegionStatusEnum { - 'ACTIVE' = 'ACTIVE', - 'BUILDING' = 'BUILDING', -} -/** NetworkStatusEnum */ -export enum NetworkStatusEnum { - 'ACTIVE' = 'ACTIVE', - 'BUILDING' = 'BUILDING', - 'DELETING' = 'DELETING', -} -/** NetworkTypeEnum */ -export enum NetworkTypeEnum { - 'private' = 'private', - 'public' = 'public', -} - -/** Subnet */ -export interface Subnet { - /** Subnet CIDR */ - cidr: string; - /** Is DHCP enabled for the subnet */ - dhcpEnabled: boolean; - /** Gateway IP in the subnet */ - gatewayIp?: string; - /** Subnet id */ - id: string; - /** List of ip pools allocated in subnet */ - ipPools: IPPool[]; -} - -/** IPPool */ -export interface IPPool { - /** Enable DHCP */ - dhcp: boolean; - /** Last IP for this region (eg: 192.168.1.24) */ - end: string; - /** Global network with cidr (eg: 192.168.1.0/24) */ - network: string; - /** Region where this subnet will be created */ - region: string; - /** First IP for this region (eg: 192.168.1.12) */ - start: string; -} - -/* Vrack */ -export interface Vrack { - /** Description of your vRack */ - description: string; - /** Name of your vRack */ - id: string; - /** Vrack ID */ - name: string; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/models/project.ts b/packages/manager/apps/pci-databases-analytics/src/models/project.ts deleted file mode 100644 index 5f0975113023..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/models/project.ts +++ /dev/null @@ -1,14 +0,0 @@ -export enum PciProjectPlanCode { - DISCOVERY = 'project.discovery', - STANDARD = 'project.2018', -} -export interface PciProject { - access: string; - creationDate: string; - description: string; - projectName: string; - project_id: string; - status: string; - unleash: boolean; - planCode: PciProjectPlanCode; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/404.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/404.page.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/pages/404.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/404.page.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/404.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/404.spec.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/404.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/404.spec.tsx index 61dbf2a84def..d15b759dad81 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/404.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/404.spec.tsx @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest'; import { render, screen, waitFor } from '@testing-library/react'; -import NotFound from '@/pages/404'; +import NotFound from '@/pages/404.page'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; describe('404 NotFound page', () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/layout.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/Root.layout.spec.tsx similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/layout.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/Root.layout.spec.tsx index 265acc1df4a8..c5f7be441efc 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/layout.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/Root.layout.spec.tsx @@ -1,15 +1,15 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, waitFor } from '@testing-library/react'; -import Layout, { breadcrumb as Breadcrumb, Loader } from '@/pages/layout'; +import Layout, { breadcrumb as Breadcrumb, Loader } from '@/pages/Root.layout'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; -import { database } from '@/models/database'; -import * as projectAPI from '@/api/projects'; +import * as database from '@/types/cloud/project/database'; +import * as projectAPI from '@/data/api/project/project.api'; const breadCrumbParam = { params: { projectId: 'projectId', - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, }, request: new Request('https://my-api.com/endpoint'), }; @@ -18,7 +18,7 @@ describe('Services Layout', () => { beforeEach(() => { vi.restoreAllMocks(); - vi.mock('@/api/projects', () => { + vi.mock('@/data/api/project/project.api', () => { return { getProject: vi.fn(() => ({ project_id: '123456', diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/layout.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/Root.layout.tsx similarity index 76% rename from packages/manager/apps/pci-databases-analytics/src/pages/layout.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/Root.layout.tsx index 63bad44eb41c..cca9aa4674fd 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/layout.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/Root.layout.tsx @@ -2,18 +2,18 @@ import { useEffect } from 'react'; import { Outlet, useLocation, redirect, useMatches } from 'react-router-dom'; import { useRouting, useShell } from '@ovh-ux/manager-react-shell-client'; import { defineCurrentPage } from '@ovh-ux/request-tagger'; -import PageLayout from '@/components/PageLayout/PageLayout'; +import PageLayout from '@/components/page-layout/PageLayout.component'; import Breadcrumb, { BreadcrumbHandleParams, -} from '@/components/Breadcrumb/Breadcrumb'; -import { database } from '@/models/database'; +} from '@/components/breadcrumb/Breadcrumb.component'; +import * as database from '@/types/cloud/project/database'; import { Toaster } from '@/components/ui/toaster'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; import queryClient from '@/query.client'; -import { getProject } from '@/api/projects'; -import { useLoadingIndicatorContext } from '@/contexts/loadingIndicatorContext'; -import { UserActivityProvider } from '@/contexts/userActivityContext'; -import { USER_INACTIVITY_TIMEOUT } from '@/configuration/polling'; +import { UserActivityProvider } from '@/contexts/UserActivityContext'; +import { getProject } from '@/data/api/project/project.api'; +import { useLoadingIndicatorContext } from '@/contexts/LoadingIndicator.context'; +import { USER_INACTIVITY_TIMEOUT } from '@/configuration/polling.constants'; export function breadcrumb({ params }: BreadcrumbHandleParams) { return ( @@ -36,11 +36,14 @@ export const Loader = ({ params, request }: ServiceCategoryLayoutProps) => { // check if we have a correct category const { category, projectId } = params; if ( - !Object.values(database.CategoryEnum).includes( - category as database.CategoryEnum, + !Object.values(database.engine.CategoryEnum).includes( + category as database.engine.CategoryEnum, ) ) { - const path = request.url.replace(category, database.CategoryEnum.all); + const path = request.url.replace( + category, + database.engine.CategoryEnum.all, + ); return redirect(path); } // check if we have a correct projectId diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/Root.page.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/Root.page.tsx new file mode 100644 index 000000000000..132c1fd3ad5f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/pages/Root.page.tsx @@ -0,0 +1,5 @@ +import Services from './services/Services.page'; + +export default function Root() { + return ; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/home.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/Root.spec.tsx similarity index 88% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/home.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/Root.spec.tsx index a7cd717ece86..e19d3fa75080 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/home.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/Root.spec.tsx @@ -1,6 +1,6 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, waitFor } from '@testing-library/react'; -import Home from '@/pages'; +import Root from '@/pages/Root.page'; import { Locale } from '@/hooks/useLocale'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; @@ -14,7 +14,7 @@ describe('Home page', () => { }), })); - vi.mock('@/api/databases/service', () => ({ + vi.mock('@/data/api/database/service.api', () => ({ getServices: vi.fn(() => []), })); @@ -36,7 +36,7 @@ describe('Home page', () => { }); it('should display onboarding pages', async () => { - render(, { wrapper: RouterWithQueryClientWrapper }); + render(, { wrapper: RouterWithQueryClientWrapper }); await waitFor(() => { expect(screen.getByTestId('onbaording-container')).toBeInTheDocument(); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/app.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/_app.spec.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/app.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/_app.spec.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/_components/legalMentions.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/_components/LegalMentions.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/pages/_components/legalMentions.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/_components/LegalMentions.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/index.tsx deleted file mode 100644 index 661388434168..000000000000 --- a/packages/manager/apps/pci-databases-analytics/src/pages/index.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import Services from './services'; - -export default function Home() { - return ; -} diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/Services.page.tsx similarity index 72% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/Services.page.tsx index 3b42576a8686..4d0d04c728bc 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/Services.page.tsx @@ -2,19 +2,19 @@ import { useMemo } from 'react'; import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Plus } from 'lucide-react'; -import { useGetServices } from '@/hooks/api/services.api.hooks'; -import { database } from '@/models/database'; -import ServicesList from './_components/serviceListTable'; -import Onboarding from './_components/onboarding'; -import LegalMentions from '../_components/legalMentions'; -import { POLLING } from '@/configuration/polling'; -import { Link } from '@/components/links'; +import { useGetServices } from '@/hooks/api/database/service/useGetServices.hook'; +import ServicesList from './_components/ServiceListTable.component'; +import Onboarding from './_components/Onboarding.component'; +import LegalMentions from '../_components/LegalMentions.component'; +import { POLLING } from '@/configuration/polling.constants'; +import Link from '@/components/links/Link.component'; import { Button } from '@/components/ui/button'; -import Guides from '@/components/guides'; -import { GuideSections } from '@/models/guide'; +import Guides from '@/components/guides/Guides.component'; +import { GuideSections } from '@/types/guide'; import { useTrackPage, useTrackAction } from '@/hooks/useTracking'; -import { TRACKING } from '@/configuration/tracking'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { TRACKING } from '@/configuration/tracking.constants'; +import * as database from '@/types/cloud/project/database'; const Services = () => { const { t } = useTranslation('pci-databases-analytics/services'); @@ -29,7 +29,8 @@ const Services = () => { if (!servicesQuery.data) return []; return servicesQuery.data.filter( (service) => - category === database.CategoryEnum.all || service.category === category, + category === database.engine.CategoryEnum.all || + service.category === category, ); }, [servicesQuery.data, category]); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/services.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/Services.spec.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/services.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/Services.spec.tsx index 4bd3dc3c077f..db1fb6225460 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/services.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/Services.spec.tsx @@ -6,10 +6,10 @@ import { screen, waitFor, } from '@testing-library/react'; -import Services from '@/pages/services'; -import { database } from '@/models/database'; +import Services from '@/pages/services/Services.page'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as serviceApi from '@/api/databases/service'; +import * as serviceApi from '@/data/api/database/service.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedUser } from '@/__tests__/helpers/mocks/user'; import { mockedService } from '@/__tests__/helpers/mocks/services'; @@ -46,9 +46,9 @@ describe('Services List page', () => { Trans: ({ children }: any) => children, })); - vi.mock('@/api/databases/service', () => ({ + vi.mock('@/data/api/database/service.api', () => ({ getServices: vi.fn(() => [mockedService]), - updateService: vi.fn((service) => service), + editService: vi.fn((service) => service), deleteService: vi.fn(), })); @@ -58,7 +58,7 @@ describe('Services List page', () => { ...mod, useParams: () => ({ projectId: 'projectId', - category: database.CategoryEnum.all, + category: database.engine.CategoryEnum.all, }), }; }); @@ -160,7 +160,7 @@ describe('Open modals', () => { expect( screen.queryByTestId('rename-service-modal'), ).not.toBeInTheDocument(); - expect(serviceApi.updateService).toHaveBeenCalled(); + expect(serviceApi.editService).toHaveBeenCalled(); }); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.context.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.context.tsx new file mode 100644 index 000000000000..5724f60bb57c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.context.tsx @@ -0,0 +1,14 @@ +import { UseQueryResult } from '@tanstack/react-query'; +import { useOutletContext, useParams } from 'react-router-dom'; +import * as database from '@/types/cloud/project/database'; + +// Share data with the child routes +export type ServiceLayoutContext = { + service: database.Service; + serviceQuery: UseQueryResult; +}; +export const useServiceData = () => { + const { projectId, category } = useParams(); + const { service, serviceQuery } = useOutletContext() as ServiceLayoutContext; + return { projectId, category, service, serviceQuery }; +}; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/layout.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.layout.spec.tsx similarity index 88% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/layout.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.layout.spec.tsx index fccb87bf8b60..7440d27c05d9 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/layout.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.layout.spec.tsx @@ -3,17 +3,17 @@ import { render, screen, waitFor } from '@testing-library/react'; import ServiceLayout, { breadcrumb as Breadcrumb, Loader, -} from '@/pages/services/[serviceId]/layout'; +} from '@/pages/services/[serviceId]/Service.layout'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService } from '@/__tests__/helpers/mocks/services'; -import { database } from '@/models/database'; -import * as serviceAPI from '@/api/databases/service'; +import * as database from '@/types/cloud/project/database'; +import * as serviceAPI from '@/data/api/database/service.api'; const loaderParam = { params: { projectId: 'projectId', serviceId: 'serviceId', - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, }, request: new Request('https://my-api.com/endpoint'), }; @@ -33,7 +33,7 @@ describe('Service Layout', () => { }; }); - vi.mock('@/api/databases/service', () => ({ + vi.mock('@/data/api/database/service.api', () => ({ getService: vi.fn(), })); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/layout.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.layout.tsx similarity index 65% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/layout.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.layout.tsx index f94e1e834c88..007c00185050 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/layout.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/Service.layout.tsx @@ -1,21 +1,15 @@ -import { - Outlet, - redirect, - useOutletContext, - useParams, -} from 'react-router-dom'; -import { UseQueryResult } from '@tanstack/react-query'; -import { useGetService } from '@/hooks/api/services.api.hooks'; +import { Outlet, redirect, useParams } from 'react-router-dom'; +import { useGetService } from '@/hooks/api/database/service/useGetService.hook'; import { Skeleton } from '@/components/ui/skeleton'; -import LegalMentions from '@/pages/_components/legalMentions'; -import { database } from '@/models/database'; -import { ServiceHeader } from './_components/serviceHeader'; -import TabsMenu from '@/components/tabs-menu'; -import { POLLING } from '@/configuration/polling'; -import { getService } from '@/api/databases/service'; +import LegalMentions from '@/pages/_components/LegalMentions.component'; +import { ServiceHeader } from './_components/ServiceHeader.component'; +import TabsMenu from '@/components/tabs-menu/TabsMenu.component'; +import { POLLING } from '@/configuration/polling.constants'; +import { getService } from '@/data/api/database/service.api'; import queryClient from '@/query.client'; -import ServiceTabs from './_components/serviceTabs'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import ServiceTabs from './_components/ServiceTabs.component'; +import { ServiceLayoutContext } from './Service.context'; interface ServiceLayoutProps { params: { @@ -57,17 +51,6 @@ export function breadcrumb() { return ; } -// Share data with the child routes -type ServiceLayoutContext = { - service: database.Service; - serviceQuery: UseQueryResult; -}; -export function useServiceData() { - const { projectId, category } = useParams(); - const { service, serviceQuery } = useOutletContext() as ServiceLayoutContext; - return { projectId, category, service, serviceQuery }; -} - export default function ServiceLayout() { const { isUserActive } = useUserActivityContext(); const { projectId, serviceId } = useParams(); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/deleteService.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/DeleteService.component.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/deleteService.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/DeleteService.component.tsx index c91e9365de67..5c84ed85ba11 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/deleteService.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/DeleteService.component.tsx @@ -1,6 +1,5 @@ import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; - import { useMemo } from 'react'; import { AlertTriangle } from 'lucide-react'; import { Button } from '@/components/ui/button'; @@ -16,15 +15,14 @@ import { useToast } from '@/components/ui/use-toast'; import { ModalController } from '@/hooks/useModale'; -import { database } from '@/models/database'; -import { - useDeleteService, - useGetServices, -} from '@/hooks/api/services.api.hooks'; -import { useGetIntegrations } from '@/hooks/api/integrations.api.hook'; +import * as database from '@/types/cloud/project/database'; +import { useDeleteService } from '@/hooks/api/database/service/useDeleteService.hook'; +import { useGetServices } from '@/hooks/api/database/service/useGetServices.hook'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { useTrackAction, useTrackPage } from '@/hooks/useTracking'; -import { TRACKING } from '@/configuration/tracking'; +import { TRACKING } from '@/configuration/tracking.constants'; +import { useGetIntegrations } from '@/hooks/api/database/integration/useGetIntegrations.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface DeleteServiceModalProps { service: database.Service; @@ -86,7 +84,7 @@ const DeleteService = ({ toast.toast({ title: t('deleteServiceToastErrorTitle'), variant: 'destructive', - description: err.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/renameService.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/RenameService.component.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/renameService.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/RenameService.component.tsx index 34dbef393642..150688d2d63e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/renameService.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/RenameService.component.tsx @@ -14,7 +14,7 @@ import { } from '@/components/ui/form'; import { Input } from '@/components/ui/input'; import { Button } from '@/components/ui/button'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Dialog, DialogClose, @@ -26,11 +26,12 @@ import { } from '@/components/ui/dialog'; import { ModalController } from '@/hooks/useModale'; import { useToast } from '@/components/ui/use-toast'; -import { useUpdateService } from '@/hooks/api/services.api.hooks'; +import { useEditService } from '@/hooks/api/database/service/useEditService.hook'; import { useTrackAction, useTrackPage } from '@/hooks/useTracking'; -import { TRACKING } from '@/configuration/tracking'; +import { TRACKING } from '@/configuration/tracking.constants'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; -interface UpdateServiceNameModalProps { +interface RenameServiceProps { service: database.Service; controller: ModalController; onSuccess?: (service: database.Service) => void; @@ -42,19 +43,19 @@ const RenameService = ({ controller, onError, onSuccess, -}: UpdateServiceNameModalProps) => { +}: RenameServiceProps) => { // import translations const { projectId } = useParams(); useTrackPage(TRACKING.renameService.page(service.engine)); const track = useTrackAction(); const { t } = useTranslation('pci-databases-analytics/services/service'); const toast = useToast(); - const { updateService, isPending } = useUpdateService({ + const { editService, isPending } = useEditService({ onError: (err) => { toast.toast({ title: t('renameServiceToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); @@ -98,7 +99,7 @@ const RenameService = ({ const onSubmit = form.handleSubmit((formValues) => { track(TRACKING.renameService.confirm(service.engine)); - updateService({ + editService({ serviceId: service.id, projectId, engine: service.engine, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/serviceHeader.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/ServiceHeader.component.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/serviceHeader.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/ServiceHeader.component.tsx index fa9620f4b4c9..996f36edc853 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/serviceHeader.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/ServiceHeader.component.tsx @@ -1,7 +1,7 @@ import { Database } from 'lucide-react'; import { useTranslation } from 'react-i18next'; -import { database } from '@/models/database'; -import ServiceStatusBadge from '../../_components/serviceStatusBadge'; +import * as database from '@/types/cloud/project/database'; +import ServiceStatusBadge from '../../_components/ServiceStatusBadge.component'; import { Badge } from '@/components/ui/badge'; import { Skeleton } from '@/components/ui/skeleton'; import { humanizeEngine } from '@/lib/engineNameHelper'; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/serviceTabs.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/ServiceTabs.component.tsx similarity index 80% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/serviceTabs.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/ServiceTabs.component.tsx index aa1960b25330..49e514de203b 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/serviceTabs.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/_components/ServiceTabs.component.tsx @@ -1,16 +1,16 @@ import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { database } from '@/models/database'; -import { useGetUsers } from '@/hooks/api/users.api.hooks'; -import { useGetBackups } from '@/hooks/api/backups.api.hooks'; -import { useGetDatabases } from '@/hooks/api/databases.api.hook'; -import { useGetConnectionPools } from '@/hooks/api/connectionPool.api.hooks'; -import { useGetCurrentQueries } from '@/hooks/api/queries.api.hooks'; -import { useGetIntegrations } from '@/hooks/api/integrations.api.hook'; -import { useGetNamespaces } from '@/hooks/api/namespaces.api.hooks'; -import { POLLING } from '@/configuration/polling'; -import TabsMenu from '@/components/tabs-menu'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import * as database from '@/types/cloud/project/database'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { POLLING } from '@/configuration/polling.constants'; +import TabsMenu from '@/components/tabs-menu/TabsMenu.component'; +import { useGetUsers } from '@/hooks/api/database/user/useGetUsers.hook'; +import { useGetBackups } from '@/hooks/api/database/backup/useGetBackups.hook'; +import { useGetDatabases } from '@/hooks/api/database/database/useGetDatabases.hook'; +import { useGetConnectionPools } from '@/hooks/api/database/connectionPool/useGetConnectionPools.hook'; +import { useGetIntegrations } from '@/hooks/api/database/integration/useGetIntegrations.hook'; +import { useGetNamespaces } from '@/hooks/api/database/namespace/useGetNamespaces.hook'; +import { useGetCurrentQueries } from '@/hooks/api/database/query/useGetCurrentQueries.hook'; interface ServiceTabsProps { service: database.Service; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/backups/layout.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.layout.spec.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/backups/layout.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.layout.spec.tsx index b789565cb2d7..71acc1515f84 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/backups/layout.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.layout.spec.tsx @@ -4,15 +4,15 @@ import { render, screen, waitFor } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; import BackupLayout, { breadcrumb as Breadcrumb, -} from '@/pages/services/[serviceId]/backups/layout'; +} from '@/pages/services/[serviceId]/backups/Backups.layout'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService } from '@/__tests__/helpers/mocks/services'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; describe('Service backups Layout', () => { beforeEach(() => { vi.restoreAllMocks(); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/layout.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.layout.tsx similarity index 73% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/layout.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.layout.tsx index c3ebbb15403e..d3bd0088271e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/layout.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.layout.tsx @@ -1,6 +1,6 @@ import { Outlet } from 'react-router-dom'; -import { useServiceData } from '../layout'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; +import { useServiceData } from '../Service.context'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; export function breadcrumb() { return ( diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.page.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.page.tsx index e9b5472d78fb..04a1a0d1b218 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.page.tsx @@ -2,20 +2,20 @@ import { useTranslation } from 'react-i18next'; import { add } from 'date-fns'; import { useNavigate } from 'react-router-dom'; import { Pen } from 'lucide-react'; -import { Link } from '@/components/links'; -import { database } from '@/models/database'; -import { useServiceData } from '../layout'; -import { getColumns } from './_components/backupsTableColumns'; +import Link from '@/components/links/Link.component'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '../Service.context'; +import { getColumns } from './_components/BackupsTableColumns.component'; import { DataTable } from '@/components/ui/data-table'; -import { useGetBackups } from '@/hooks/api/backups.api.hooks'; -import { POLLING } from '@/configuration/polling'; +import { POLLING } from '@/configuration/polling.constants'; import { Button } from '@/components/ui/button'; import { useModale } from '@/hooks/useModale'; -import RestoreServiceModal from './_components/restore'; +import RestoreServiceModal from './_components/Restore.component'; import { Table, TableBody, TableCell, TableRow } from '@/components/ui/table'; -import Guides from '@/components/guides'; -import { GuideSections } from '@/models/guide'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import Guides from '@/components/guides/Guides.component'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { GuideSections } from '@/types/guide'; +import { useGetBackups } from '@/hooks/api/database/backup/useGetBackups.hook'; export interface BackupWithExpiricyDate extends database.Backup { expiricyDate: Date; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/backups/backups.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.spec.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/backups/backups.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.spec.tsx index e293a232aaae..2d9c3354ddcb 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/backups/backups.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/Backups.spec.tsx @@ -7,11 +7,11 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; -import { breadcrumb as Breadcrumb } from '@/pages/services/[serviceId]/backups/layout'; -import Backups from '@/pages/services/[serviceId]/backups'; -import * as backupsApi from '@/api/databases/backups'; -import { database } from '@/models/database'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; +import { breadcrumb as Breadcrumb } from '@/pages/services/[serviceId]/backups/Backups.layout'; +import Backups from '@/pages/services/[serviceId]/backups/Backups.page'; +import * as backupsApi from '@/data/api/database/backup.api'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; @@ -41,12 +41,12 @@ describe('Backups page', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/backups', () => ({ + vi.mock('@/data/api/database/backup.api', () => ({ getServiceBackups: vi.fn(() => [mockedBackup]), restoreBackup: vi.fn((backup) => backup), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -100,7 +100,7 @@ describe('Backups page', () => { }); it('does not display restore button and fork button if capability is absent', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -115,7 +115,7 @@ describe('Backups page', () => { }); it('disable restore button and fork button if capability is disabled', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -168,7 +168,7 @@ describe('Open restore modals', () => { }); }; beforeEach(async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: mockedService, category: 'operational', diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/backupsTableColumns.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/BackupsTableColumns.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/backupsTableColumns.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/BackupsTableColumns.component.tsx index 991a12e356d3..a5a0b0c888d0 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/backupsTableColumns.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/BackupsTableColumns.component.tsx @@ -4,9 +4,9 @@ import { useTranslation } from 'react-i18next'; import { MoreHorizontal } from 'lucide-react'; import { SortableHeader } from '@/components/ui/data-table'; -import UserStatusBadge from '../../users/_components/userStatusBadge'; -import FormattedDate from '@/components/table-date'; -import { BackupWithExpiricyDate } from '..'; +import UserStatusBadge from '../../users/_components/UserStatusBadge.component'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; +import { BackupWithExpiricyDate } from '../Backups.page'; import { DropdownMenu, DropdownMenuContent, @@ -14,8 +14,8 @@ import { DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { Button } from '@/components/ui/button'; -import { useServiceData } from '../../layout'; -import { database } from '@/models/database'; +import { useServiceData } from '../../Service.context'; +import * as database from '@/types/cloud/project/database'; interface BackupsTableColumnsProps { onForkClick: (backup: BackupWithExpiricyDate) => void; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/restore.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/Restore.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/restore.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/Restore.component.tsx index 3c76a933b682..65e848a9d0b2 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/restore.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/_components/Restore.component.tsx @@ -14,7 +14,7 @@ import { FormMessage, } from '@/components/ui/form'; import { Button } from '@/components/ui/button'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Dialog, DialogContent, @@ -25,7 +25,7 @@ import { } from '@/components/ui/dialog'; import { ModalController } from '@/hooks/useModale'; import { useToast } from '@/components/ui/use-toast'; -import { ForkSourceType } from '@/models/order-funnel'; +import { ForkSourceType } from '@/types/orderFunnel'; import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; import { Select, @@ -35,8 +35,8 @@ import { SelectTrigger, SelectValue, } from '@/components/ui/select'; -import { useServiceData } from '../../layout'; -import FormattedDate from '@/components/table-date'; +import { useServiceData } from '../../Service.context'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; import { formatStorage } from '@/lib/bytesHelper'; import { Popover, @@ -47,8 +47,9 @@ import { cn } from '@/lib/utils'; import { Calendar } from '@/components/ui/calendar'; import { TimePicker } from '@/components/ui/time-picker'; import { useDateFnsLocale } from '@/hooks/useDateFnsLocale.hook'; -import { useRestoreBackup } from '@/hooks/api/backups.api.hooks'; -import { CdbError } from '@/api/databases'; +import { CdbError } from '@/data/api/database'; +import { useRestoreBackup } from '@/hooks/api/database/backup/useRestoreBackup.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface RestoreServiceModalProps { controller: ModalController; @@ -77,7 +78,7 @@ const RestoreServiceModal = ({ toast.toast({ title: t('restoreBackupToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/Fork.page.tsx similarity index 83% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/Fork.page.tsx index d1e343f3c05b..84dd49cdcd15 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/Fork.page.tsx @@ -1,22 +1,22 @@ import { useEffect, useMemo, useState } from 'react'; import { useLocation } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { - FullCapabilities, - useGetAvailabilities, - useGetFullCapabilities, -} from '@/hooks/api/availabilities.api.hooks'; -import { useServiceData } from '../../layout'; -import { database } from '@/models/database'; -import { useGetCatalog } from '@/hooks/api/catalog.api.hooks'; +import { useServiceData } from '../../Service.context'; +import * as database from '@/types/cloud/project/database'; import { Skeleton } from '@/components/ui/skeleton'; -import ForkForm from './_components/fork-form'; -import { useGetBackups } from '@/hooks/api/backups.api.hooks'; +import ForkForm from './_components/ForkForm.component'; import { useVrack } from '@/hooks/useVrack'; -import { Network } from '@/models/network'; -import { ForkSource, ForkSourceType } from '@/models/order-funnel'; +import { Network } from '@/types/cloud/network'; +import { ForkSource, ForkSourceType } from '@/types/orderFunnel'; import { updateTags } from '@/lib/tagsHelper'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import { useGetAvailabilities } from '@/hooks/api/database/availability/useGetAvailabilities.hook'; +import { + FullCapabilities, + useGetFullCapabilities, +} from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; +import { useGetBackups } from '@/hooks/api/database/backup/useGetBackups.hook'; +import { useGetCatalog } from '@/hooks/api/catalog/useGetCatalog.hook'; export function breadcrumb() { return ( @@ -27,7 +27,7 @@ export function breadcrumb() { ); } -export interface ForkInitialValue extends database.Suggestion { +export interface ForkInitialValue extends database.availability.Suggestion { source: ForkSource; networkType?: database.NetworkTypeEnum; networkId?: string; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/backups/fork/fork.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/Fork.spec.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/backups/fork/fork.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/Fork.spec.tsx index c3b8b8952a2b..d62975ddac33 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/backups/fork/fork.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/Fork.spec.tsx @@ -10,9 +10,9 @@ import { import { UseQueryResult } from '@tanstack/react-query'; import Fork, { breadcrumb as Breadcrumb, -} from '@/pages/services/[serviceId]/backups/fork/index'; +} from '@/pages/services/[serviceId]/backups/fork/Fork.page'; -import ForkSummary from '@/pages/services/[serviceId]/backups/fork/_components/fork-summary'; +import ForkSummary from '@/pages/services/[serviceId]/backups/fork/_components/ForkSummary.component'; import { Locale } from '@/hooks/useLocale'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; @@ -24,7 +24,7 @@ import { } from '@/__tests__/helpers/mocks/availabilities'; import { mockedUser } from '@/__tests__/helpers/mocks/user'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { mockedCatalog } from '@/__tests__/helpers/mocks/catalog'; import { mockedForkService } from '@/__tests__/helpers/mocks/services'; import { @@ -35,7 +35,7 @@ import { mockedNetworksFork, mockedSubnets, } from '@/__tests__/helpers/mocks/network'; -import { ForkSourceType } from '@/models/order-funnel'; +import { ForkSourceType } from '@/types/orderFunnel'; import { mockedBasicOrderFunnelFlavor, mockedBasicOrderFunnelPlan, @@ -47,9 +47,9 @@ import { NetworkRegionStatusEnum, NetworkStatusEnum, NetworkTypeEnum, -} from '@/models/network'; +} from '@/types/cloud/network'; import { apiErrorMock } from '@/__tests__/helpers/mocks/cdbError'; -import * as ServiceAPI from '@/api/databases/service'; +import * as ServiceAPI from '@/data/api/database/service.api'; import { useToast } from '@/components/ui/use-toast'; const mockedFork = { @@ -131,7 +131,7 @@ describe('Fork funnel page', () => { })); vi.stubGlobal('ResizeObserver', ResizeObserverMock); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedForkService, @@ -140,31 +140,34 @@ describe('Fork funnel page', () => { })), })); - vi.mock('@/api/databases/availabilities', () => ({ + vi.mock('@/data/api/database/availability.api', () => ({ getAvailabilities: vi.fn(() => [mockedAvailabilities]), + })); + + vi.mock('@/data/api/database/capabilities.api', () => ({ getEnginesCapabilities: vi.fn(() => [mockedEngineCapabilities]), getRegionsCapabilities: vi.fn(() => [mockedRegionCapabilities]), getCapabilities: vi.fn(() => mockedCapabilities), })); - vi.mock('@/api/databases/backups', () => ({ + vi.mock('@/data/api/database/backup.api', () => ({ getServiceBackups: vi.fn(() => [mockedBackup, mockedBackupBis]), })); - vi.mock('@/api/network', () => ({ + vi.mock('@/data/api/network/network.api', () => ({ networkApi: { getPrivateNetworks: vi.fn(() => mockedNetworksFork), getSubnets: vi.fn(() => mockedSubnets), }, })); - vi.mock('@/api/catalog', () => ({ + vi.mock('@/data/api/catalog/catalog.api', () => ({ catalogApi: { getCatalog: vi.fn(() => mockedCatalog), }, })); - vi.mock('@/api/databases/service', () => ({ + vi.mock('@/data/api/database/service.api', () => ({ addService: vi.fn((service) => service), })); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/fork-form.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/ForkForm.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/fork-form.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/ForkForm.component.tsx index 3b9c33f0d4f0..d045fea4d9ff 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/fork-form.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/ForkForm.component.tsx @@ -3,8 +3,8 @@ import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Calendar as CalendarIcon } from 'lucide-react'; import { Calendar } from '@/components/ui/calendar'; -import { order } from '@/models/catalog'; -import { database } from '@/models/database'; +import { order } from '@/types/catalog'; +import * as database from '@/types/cloud/project/database'; import { Button } from '@/components/ui/button'; import { Card, @@ -14,8 +14,8 @@ import { CardTitle, } from '@/components/ui/card'; import { useToast } from '@/components/ui/use-toast'; -import StorageConfig from '@/components/Order/cluster-config/storage-config'; -import NodesConfig from '@/components/Order/cluster-config/nodes-config'; +import StorageConfig from '@/components/order/cluster-configuration/StorageConfig.component'; +import NodesConfig from '@/components/order/cluster-configuration/NodesConfig.component'; import { Form, FormControl, @@ -29,16 +29,16 @@ import { cn } from '@/lib/utils'; import { ServiceCreationWithEngine, useAddService, -} from '@/hooks/api/services.api.hooks'; -import PriceUnitSwitch from '@/components/price-unit-switch'; -import PlansSelect from '@/components/Order/plan/plan-select'; -import FlavorsSelect from '@/components/Order/flavor/flavor-select'; -import NetworkOptions from '@/components/Order/cluster-options/network-options'; -import IpsRestrictionsForm from '@/components/Order/cluster-options/ips-restrictions-form'; -import RegionsSelect from '@/components/Order/region/region-select'; -import OrderPrice from '@/components/Order/order-price'; -import ForkSummary from './fork-summary'; -import { useFork } from './useFork'; +} from '@/hooks/api/database/service/useAddService.hook'; +import PriceUnitSwitch from '@/components/price-unit-switch/PriceUnitSwitch.component'; +import PlansSelect from '@/components/order/plan/PlanSelect.component'; +import FlavorsSelect from '@/components/order/flavor/FlavorSelect.component'; +import NetworkOptions from '@/components/order/cluster-options/NetworkOptions.components'; +import IpsRestrictionsForm from '@/components/order/cluster-options/IpsRestrictionsForm.component'; +import RegionsSelect from '@/components/order/region/RegionSelect.component'; +import OrderPrice from '@/components/order/price/OrderPrice.component'; +import ForkSummary from './ForkSummary.component'; +import { useFork } from './useFork.hook'; import { Select, SelectContent, @@ -47,12 +47,12 @@ import { SelectTrigger, SelectValue, } from '@/components/ui/select'; -import FormattedDate from '@/components/table-date'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; import { formatStorage } from '@/lib/bytesHelper'; import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; -import { useServiceData } from '../../../layout'; -import ErrorList from '@/components/Order/error-list'; -import { ForkSourceType } from '@/models/order-funnel'; +import { useServiceData } from '../../../Service.context'; +import ErrorList from '@/components/order/error-list/ErrorList.component'; +import { ForkSourceType } from '@/types/orderFunnel'; import { Popover, PopoverContent, @@ -60,8 +60,9 @@ import { } from '@/components/ui/popover'; import { TimePicker } from '@/components/ui/time-picker'; import { useDateFnsLocale } from '@/hooks/useDateFnsLocale.hook'; -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; -import { ForkInitialValue } from '..'; +import { ForkInitialValue } from '../Fork.page'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface ForkFormProps { availabilities: database.Availability[]; @@ -98,7 +99,7 @@ const ForkForm = ({ toast({ title: t('errorCreatingService'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); }, onSuccess: (fork) => { diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/fork-summary.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/ForkSummary.component.tsx similarity index 98% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/fork-summary.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/ForkSummary.component.tsx index 2c3952260c9a..800eead333bf 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/fork-summary.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/ForkSummary.component.tsx @@ -11,7 +11,7 @@ import { MemoryStick, } from 'lucide-react'; import { humanizeEngine } from '@/lib/engineNameHelper'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { addStorage, formatStorage } from '@/lib/bytesHelper'; import { Engine, @@ -21,16 +21,16 @@ import { Plan, Region, Version, -} from '@/models/order-funnel'; +} from '@/types/orderFunnel'; import { Skeleton } from '@/components/ui/skeleton'; -import { Network, Subnet } from '@/models/network'; +import { Network, Subnet } from '@/types/cloud/network'; import { Button } from '@/components/ui/button'; import { Popover, PopoverContent, PopoverTrigger, } from '@/components/ui/popover'; -import FormattedDate from '@/components/table-date'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; interface ForkSummaryProps { order: { diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/useFork.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/useFork.hook.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/useFork.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/useFork.hook.tsx index 690b0e67cd43..3fe6d80988c8 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/useFork.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/backups/fork/_components/useFork.hook.tsx @@ -3,7 +3,7 @@ import { z } from 'zod'; import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { useTranslation } from 'react-i18next'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Engine, Flavor, @@ -11,18 +11,18 @@ import { Plan, Region, Version, -} from '@/models/order-funnel'; -import { order } from '@/models/catalog'; +} from '@/types/orderFunnel'; +import { order } from '@/types/catalog'; import { createTree } from '@/lib/availabilitiesHelper'; import { generateName } from '@/lib/nameGenerator'; import { useVrack } from '@/hooks/useVrack'; -import { useServiceData } from '../../../layout'; -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; -import { ForkInitialValue } from '..'; +import { useServiceData } from '../../../Service.context'; +import { ForkInitialValue } from '../Fork.page'; import { Pricing, computeServicePrice } from '@/lib/pricingHelper'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; const getSuggestedItemOrDefault = ( - suggestion: database.Suggestion, + suggestion: database.availability.Suggestion, item: 'plan' | 'region' | 'flavor', listItems: Plan[] | Region[] | Flavor[], currentValue?: string, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/Dashboard.page.tsx similarity index 89% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/Dashboard.page.tsx index 7d9be5d6816e..7a5cf05889a5 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/Dashboard.page.tsx @@ -12,22 +12,23 @@ import { } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { useMemo } from 'react'; -import { useServiceData } from '../layout'; -import MetricChart from '../metrics/_components/metricChart'; -import { database } from '@/models/database'; -import { POLLING } from '@/configuration/polling'; +import { useServiceData } from '../Service.context'; +import MetricChart from '../metrics/_components/MetricChart.component'; +import * as database from '@/types/cloud/project/database'; +import { POLLING } from '@/configuration/polling.constants'; import { Card, CardContent, CardHeader } from '@/components/ui/card'; -import ConnectionDetails from './_components/connectionDetails'; +import ConnectionDetails from './_components/ConnectionDetails.component'; import { Button } from '@/components/ui/button'; import { useToast } from '@/components/ui/use-toast'; -import Maintenance from './_components/maintenance'; -import { Link, OvhLink } from '@/components/links'; +import Maintenance from './_components/Maintenance.component'; +import Link from '@/components/links/Link.component'; +import OvhLink from '@/components/links/OvhLink.component'; import { Alert, AlertDescription } from '@/components/ui/alert'; -import { useGetVrack } from '@/hooks/api/network.api.hooks'; -import { useGetMetrics } from '@/hooks/api/metrics.api.hooks'; import { Skeleton } from '@/components/ui/skeleton'; -import Guides from '@/components/guides'; -import { GuideSections } from '@/models/guide'; +import Guides from '@/components/guides/Guides.component'; +import { GuideSections } from '@/types/guide'; +import { useGetVrack } from '@/hooks/api/network/useGetVrack.hook'; +import { useGetMetrics } from '@/hooks/api/database/metric/useGetMetrics.hook'; interface MetricTile { name: string; @@ -147,13 +148,11 @@ const Dashboard = () => { )) ) : ( - <> -
- - - -
- +
+ + + +
)}
diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/dashboard/dashboard.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/Dashboard.spec.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/dashboard/dashboard.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/Dashboard.spec.tsx index 5b1545c22f4d..9436d5584615 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/dashboard/dashboard.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/Dashboard.spec.tsx @@ -7,11 +7,11 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import Dashboard from '@/pages/services/[serviceId]/dashboard'; -import * as metricApi from '@/api/databases/metrics'; -import { database } from '@/models/database'; +import Dashboard from '@/pages/services/[serviceId]/dashboard/Dashboard.page'; +import * as metricApi from '@/data/api/database/metric.api'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as maintenanceApi from '@/api/databases/maintenances'; +import * as maintenanceApi from '@/data/api/database/maintenance.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { apiErrorMock } from '@/__tests__/helpers/mocks/cdbError'; @@ -37,7 +37,7 @@ describe('Dashboard page', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/metrics', () => ({ + vi.mock('@/data/api/database/metric.api', () => ({ getMetrics: vi.fn(() => [ mockMetric.name, mockMetricCpu.name, @@ -46,11 +46,11 @@ describe('Dashboard page', () => { ]), })); - vi.mock('@/api/databases/maintenances', () => ({ + vi.mock('@/data/api/database/maintenance.api', () => ({ getMaintenances: vi.fn(() => [mockedMaintenance]), })); - vi.mock('@/api/network', () => ({ + vi.mock('@/data/api/network/network.api', () => ({ networkApi: { getVrack: vi.fn(() => [mockedVrack]), }, @@ -64,7 +64,7 @@ describe('Dashboard page', () => { Line: vi.fn(() => null), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedServiceOrig, @@ -174,7 +174,7 @@ describe('Maintenance section', () => { }), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedServiceOrig, @@ -245,7 +245,7 @@ describe('Connection details page', () => { }), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: { diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/connectionDetails.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/ConnectionDetails.component.tsx similarity index 98% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/connectionDetails.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/ConnectionDetails.component.tsx index 76587e3942d0..fb938383acad 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/connectionDetails.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/ConnectionDetails.component.tsx @@ -10,7 +10,7 @@ import { SelectValue, } from '@/components/ui/select'; import { Table, TableBody, TableCell, TableRow } from '@/components/ui/table'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { useToast } from '@/components/ui/use-toast'; interface ConnectionDetailsProps { diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/maintenance.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/Maintenance.component.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/maintenance.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/Maintenance.component.tsx index 2b2ccf3c6963..d93d47e79631 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/maintenance.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/Maintenance.component.tsx @@ -1,11 +1,11 @@ import { ArrowRight, Construction } from 'lucide-react'; import { useTranslation } from 'react-i18next'; -import { useGetMaintenances } from '@/hooks/api/maintenances.api.hooks'; -import { useServiceData } from '../../layout'; -import { POLLING } from '@/configuration/polling'; -import { database } from '@/models/database'; -import { Link } from '@/components/links'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { useServiceData } from '../../Service.context'; +import { POLLING } from '@/configuration/polling.constants'; +import * as database from '@/types/cloud/project/database'; +import Link from '@/components/links/Link.component'; +import { useGetMaintenances } from '@/hooks/api/database/maintenance/useGetMaintenances.hook'; const Maintenance = () => { const { projectId, service } = useServiceData(); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/meanMetric.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/MeanMetric.component.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/meanMetric.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/MeanMetric.component.tsx index e3c3f390710a..b248950a2f4f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/meanMetric.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/MeanMetric.component.tsx @@ -1,7 +1,7 @@ import { Skeleton } from '@/components/ui/skeleton'; import { useMeanMetric } from '@/hooks/useMeanMetric'; import { cn } from '@/lib/utils'; -import { useServiceData } from '../../layout'; +import { useServiceData } from '../../Service.context'; interface MeanMetricProps { value?: number; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/dashboard/meanMetric.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/meanMetric.spec.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/dashboard/meanMetric.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/meanMetric.spec.tsx index 0aa68958a81f..806e2239d6ad 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/dashboard/meanMetric.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/dashboard/_components/meanMetric.spec.tsx @@ -2,22 +2,22 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, waitFor } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import MeanMetric from '@/pages/services/[serviceId]/dashboard/_components/meanMetric'; +import MeanMetric from '@/pages/services/[serviceId]/dashboard/_components/MeanMetric.component'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockMetric } from '@/__tests__/helpers/mocks/metrics'; import { mockedService } from '@/__tests__/helpers/mocks/services'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; describe('Mean Metric component', () => { beforeEach(() => { vi.restoreAllMocks(); - vi.mock('@/api/databases/metrics', () => ({ + vi.mock('@/data/api/database/metric.api', () => ({ getMetric: vi.fn(() => mockMetric), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/Database.page.tsx similarity index 81% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/Database.page.tsx index 6d52037d8ca2..9ce5aca29a23 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/Database.page.tsx @@ -1,18 +1,18 @@ import { useTranslation } from 'react-i18next'; import { ColumnDef } from '@tanstack/react-table'; import { Plus } from 'lucide-react'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; -import { database } from '@/models/database'; -import { useServiceData } from '../layout'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '../Service.context'; import { DataTable } from '@/components/ui/data-table'; -import { getColumns } from './_components/databasesTableColumns'; -import { useGetDatabases } from '@/hooks/api/databases.api.hook'; +import { getColumns } from './_components/DatabasesTableColumns.component'; import { Button } from '@/components/ui/button'; import { useModale } from '@/hooks/useModale'; -import AddDatabase from './_components/addDatabase'; -import DeleteDatabase from './_components/deleteDatabase'; -import { POLLING } from '@/configuration/polling'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import AddDatabase from './_components/AddDatabase.component'; +import DeleteDatabase from './_components/DeleteDatabase.component'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { POLLING } from '@/configuration/polling.constants'; +import { useGetDatabases } from '@/hooks/api/database/database/useGetDatabases.hook'; export function breadcrumb() { return ( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/databases/databases.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/Databases.spec.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/databases/databases.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/Databases.spec.tsx index 8f5dd67e0e69..703626a4ab9e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/databases/databases.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/Databases.spec.tsx @@ -7,13 +7,13 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; import Databases, { breadcrumb as Breadcrumb, -} from '@/pages/services/[serviceId]/databases'; -import { database } from '@/models/database'; +} from '@/pages/services/[serviceId]/databases/Database.page'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as databasesApi from '@/api/databases/databases'; +import * as databasesApi from '@/data/api/database/database.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { apiErrorMock } from '@/__tests__/helpers/mocks/cdbError'; @@ -40,12 +40,12 @@ describe('Databases page', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/databases', () => ({ + vi.mock('@/data/api/database/database.api', () => ({ getServiceDatabases: vi.fn(() => [mockedDatabase]), addDatabase: vi.fn((user) => user), deleteDatabase: vi.fn(), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -93,7 +93,7 @@ describe('Databases page', () => { }); }); it('displays add user button if capability is present', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, @@ -110,7 +110,7 @@ describe('Databases page', () => { expect(screen.queryByTestId('add-button')).toBeInTheDocument(); }); it('does not display add database button if capability is absent', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, @@ -123,7 +123,7 @@ describe('Databases page', () => { expect(screen.queryByTestId('add-button')).toBeNull(); }); it('disable add database button if capability is disabled', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/addDatabase.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/AddDatabase.component.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/addDatabase.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/AddDatabase.component.tsx index 1918185a7bd3..a300696a2036 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/addDatabase.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/AddDatabase.component.tsx @@ -13,7 +13,7 @@ import { } from '@/components/ui/form'; import { Input } from '@/components/ui/input'; import { Button } from '@/components/ui/button'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Dialog, DialogClose, @@ -25,7 +25,8 @@ import { } from '@/components/ui/dialog'; import { ModalController } from '@/hooks/useModale'; import { useToast } from '@/components/ui/use-toast'; -import { useAddDatabase } from '@/hooks/api/databases.api.hook'; +import { useAddDatabase } from '@/hooks/api/database/database/useAddDatabase.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface AddDatabaseModalProps { service: database.Service; @@ -51,7 +52,7 @@ const AddDatabase = ({ toast.toast({ title: t('addDatabaseToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/databasesTableColumns.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/DatabasesTableColumns.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/databasesTableColumns.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/DatabasesTableColumns.component.tsx index 84076a325cb1..ce6a01dc0230 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/databasesTableColumns.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/DatabasesTableColumns.component.tsx @@ -15,8 +15,8 @@ import { TooltipProvider, TooltipTrigger, } from '@/components/ui/tooltip'; -import { database } from '@/models/database'; -import { useServiceData } from '../../layout'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '../../Service.context'; interface DatabasesTableColumnsProps { onDeleteClick: (db: database.service.Database) => void; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/deleteDatabase.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/DeleteDatabase.component.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/deleteDatabase.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/DeleteDatabase.component.tsx index 7fe44195c7f3..1bd3c1153d13 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/deleteDatabase.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/databases/_components/DeleteDatabase.component.tsx @@ -1,7 +1,8 @@ import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; -import { database as dbTypes } from '@/models/database'; +import * as dbTypes from '@/types/cloud/project/database'; + import { Dialog, DialogClose, @@ -13,7 +14,8 @@ import { } from '@/components/ui/dialog'; import { ModalController } from '@/hooks/useModale'; import { useToast } from '@/components/ui/use-toast'; -import { useDeleteDatabase } from '@/hooks/api/databases.api.hook'; +import { useDeleteDatabase } from '@/hooks/api/database/database/useDeleteDatabase.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface DeleteDatabaseModalProps { service: dbTypes.Service; @@ -41,7 +43,7 @@ const DeleteDatabase = ({ toast.toast({ title: t('deleteDatabaseToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/Integrations.page.tsx similarity index 81% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/Integrations.page.tsx index 9efaf1c8d7bf..c1dbcbb61915 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/Integrations.page.tsx @@ -1,21 +1,21 @@ import { useTranslation } from 'react-i18next'; import { ColumnDef } from '@tanstack/react-table'; import { Plus } from 'lucide-react'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; -import { database } from '@/models/database'; -import { useServiceData } from '../layout'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '../Service.context'; import { DataTable } from '@/components/ui/data-table'; import { Button } from '@/components/ui/button'; import { useModale } from '@/hooks/useModale'; -import { POLLING } from '@/configuration/polling'; -import { useGetIntegrations } from '@/hooks/api/integrations.api.hook'; -import { getColumns } from './_components/integrationListColumns'; -import { useGetServices } from '@/hooks/api/services.api.hooks'; -import DeleteIntegration from './_components/deleteIntegration'; -import AddIntegration from './_components/addIntegration'; -import { GuideSections } from '@/models/guide'; -import Guides from '@/components/guides'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import { POLLING } from '@/configuration/polling.constants'; +import { getColumns } from './_components/IntegrationListColumns.component'; +import { useGetServices } from '@/hooks/api/database/service/useGetServices.hook'; +import DeleteIntegration from './_components/DeleteIntegration.component'; +import AddIntegration from './_components/AddIntegration.component'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { GuideSections } from '@/types/guide'; +import Guides from '@/components/guides/Guides.component'; +import { useGetIntegrations } from '@/hooks/api/database/integration/useGetIntegrations.hook'; export function breadcrumb() { return ( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/integrations/integrations.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/Integrations.spec.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/integrations/integrations.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/Integrations.spec.tsx index 0eba2672abab..55563e5d69da 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/integrations/integrations.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/Integrations.spec.tsx @@ -7,13 +7,13 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; import Integrations, { breadcrumb as Breadcrumb, -} from '@/pages/services/[serviceId]/integrations'; -import { database } from '@/models/database'; +} from '@/pages/services/[serviceId]/integrations/Integrations.page'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as integrationApi from '@/api/databases/integrations'; +import * as integrationApi from '@/data/api/database/integration.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedServiceInte, @@ -44,17 +44,17 @@ describe('Integrations page', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/integrations', () => ({ + vi.mock('@/data/api/database/integration.api', () => ({ getServiceIntegrations: vi.fn(() => [mockedIntegrations]), addIntegration: vi.fn((integration) => integration), deleteIntegration: vi.fn(), })); - vi.mock('@/api/databases/service', () => ({ + vi.mock('@/data/api/database/service.api', () => ({ getServices: vi.fn(() => [mockedServiceOrig, mockedServiceInte]), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedNewService, @@ -113,7 +113,7 @@ describe('Integrations page', () => { }); }); it('displays add integrations button if capability is present', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedNewService, @@ -130,7 +130,7 @@ describe('Integrations page', () => { expect(screen.queryByTestId('integrations-add-button')).toBeInTheDocument(); }); it('does not display add integrations button if capability is absent', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedNewService, @@ -145,7 +145,7 @@ describe('Integrations page', () => { expect(screen.queryByTestId('integrations-add-button')).toBeNull(); }); it('disable add integrations button if capability is disabled', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedNewService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/addIntegration.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/AddIntegration.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/addIntegration.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/AddIntegration.component.tsx index 773537805ef8..f67957e8a271 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/addIntegration.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/AddIntegration.component.tsx @@ -9,7 +9,7 @@ import { FormMessage, } from '@/components/ui/form'; import { Button } from '@/components/ui/button'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Dialog, DialogContent, @@ -20,7 +20,6 @@ import { } from '@/components/ui/dialog'; import { ModalController } from '@/hooks/useModale'; import { useToast } from '@/components/ui/use-toast'; -import { useAddIntegration } from '@/hooks/api/integrations.api.hook'; import { Select, SelectContent, @@ -29,10 +28,12 @@ import { SelectValue, } from '@/components/ui/select'; import { Input } from '@/components/ui/input'; -import { useServiceData } from '../../layout'; -import { useAddIntegrationForm } from './addIntegration.hook'; -import { CdbError } from '@/api/databases'; +import { useServiceData } from '../../Service.context'; +import { useAddIntegrationForm } from './useAddIntegrationForm.hook'; +import { CdbError } from '@/data/api/database'; import { Alert, AlertTitle } from '@/components/ui/alert'; +import { useAddIntegration } from '@/hooks/api/database/integration/useAddIntegration.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface AddIntegrationModalProps { service: database.Service; @@ -59,7 +60,7 @@ const AddIntegration = ({ toast.toast({ title: t('addIntegrationToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/integrations/addIntegrations.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/AddIntegrations.spec.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/integrations/addIntegrations.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/AddIntegrations.spec.tsx index 9647df3c4395..4a30dd97ddff 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/integrations/addIntegrations.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/AddIntegrations.spec.tsx @@ -7,10 +7,10 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import Integrations from '@/pages/services/[serviceId]/integrations'; -import { database } from '@/models/database'; +import Integrations from '@/pages/services/[serviceId]/integrations/Integrations.page'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as integrationApi from '@/api/databases/integrations'; +import * as integrationApi from '@/data/api/database/integration.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { @@ -37,7 +37,7 @@ describe('Integrations page', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/integrations', () => ({ + vi.mock('@/data/api/database/integration.api', () => ({ getServiceIntegrations: vi.fn(() => []), getServiceCapabilitiesIntegrations: vi.fn(() => [ mockedCapaInteGrafDash, @@ -48,7 +48,7 @@ describe('Integrations page', () => { deleteIntegration: vi.fn(), })); - vi.mock('@/api/databases/service', () => ({ + vi.mock('@/data/api/database/service.api', () => ({ getServices: vi.fn(() => [ mockedServiceInteBase, mockedServiceInteGraf, @@ -57,7 +57,7 @@ describe('Integrations page', () => { ]), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedServiceInteBase, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/deleteIntegration.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/DeleteIntegration.component.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/deleteIntegration.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/DeleteIntegration.component.tsx index 226a01a90f92..ce64b25aa777 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/deleteIntegration.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/DeleteIntegration.component.tsx @@ -1,7 +1,7 @@ import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/button'; -import { database as dbTypes } from '@/models/database'; +import * as dbTypes from '@/types/cloud/project/database'; import { Dialog, DialogClose, @@ -13,8 +13,9 @@ import { } from '@/components/ui/dialog'; import { ModalController } from '@/hooks/useModale'; import { useToast } from '@/components/ui/use-toast'; -import { IntegrationWithServices } from '..'; -import { UseDeleteIntegration } from '@/hooks/api/integrations.api.hook'; +import { IntegrationWithServices } from '../Integrations.page'; +import { useDeleteIntegration } from '@/hooks/api/database/integration/useDeleteIntegration.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface DeleteIntegrationProps { service: dbTypes.Service; @@ -36,12 +37,12 @@ const DeleteIntegration = ({ 'pci-databases-analytics/services/service/integrations', ); const toast = useToast(); - const { deleteIntegration, isPending } = UseDeleteIntegration({ + const { deleteIntegration, isPending } = useDeleteIntegration({ onError: (err) => { toast.toast({ title: t('deleteIntegrationToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/integrationListColumns.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/IntegrationListColumns.component.tsx similarity index 90% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/integrationListColumns.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/IntegrationListColumns.component.tsx index 4e45e4b83ef5..46a93f440525 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/integrationListColumns.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/IntegrationListColumns.component.tsx @@ -9,11 +9,11 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; -import { database } from '@/models/database'; -import { useServiceData } from '../../layout'; -import UserStatusBadge from '../../users/_components/userStatusBadge'; -import { IntegrationWithServices } from '..'; -import IntegrationServiceLink from './integrationServiceLink'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '../../Service.context'; +import UserStatusBadge from '../../users/_components/UserStatusBadge.component'; +import { IntegrationWithServices } from '../Integrations.page'; +import IntegrationServiceLink from './IntegrationServiceLink.component'; interface IntegrationsTableColumnsProps { onDeleteClick: (db: database.service.Integration) => void; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/integrationServiceLink.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/IntegrationServiceLink.component.tsx similarity index 81% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/integrationServiceLink.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/IntegrationServiceLink.component.tsx index bca9bf61e051..ea5fe54a78a6 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/integrationServiceLink.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/IntegrationServiceLink.component.tsx @@ -1,7 +1,7 @@ import { ExternalLink } from 'lucide-react'; -import { database } from '@/models/database'; -import { useServiceData } from '../../layout'; -import { Link } from '@/components/links'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '../../Service.context'; +import Link from '@/components/links/Link.component'; interface IntegrationServiceLinkProps { service: database.Service; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/addIntegration.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/useAddIntegrationForm.hook.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/addIntegration.hook.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/useAddIntegrationForm.hook.tsx index 83d8f71ba25b..1e4d9c28ca96 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/addIntegration.hook.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/integrations/_components/useAddIntegrationForm.hook.tsx @@ -3,13 +3,11 @@ import { useEffect, useMemo, useState } from 'react'; import { ZodType, z } from 'zod'; import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; -import { useServiceData } from '../../layout'; -import { database } from '@/models/database'; -import { useGetServices } from '@/hooks/api/services.api.hooks'; -import { - useGetCapabilitiesIntegrations, - useGetIntegrations, -} from '@/hooks/api/integrations.api.hook'; +import { useServiceData } from '../../Service.context'; +import * as database from '@/types/cloud/project/database'; +import { useGetServices } from '@/hooks/api/database/service/useGetServices.hook'; +import { useGetCapabilitiesIntegrations } from '@/hooks/api/database/integration/useGetCapabilitiesIntegrations.hook'; +import { useGetIntegrations } from '@/hooks/api/database/integration/useGetIntegrations.hook'; const i18nNamespace = { ns: 'pci-databases-analytics/services/service/integrations', diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/Logs.page.tsx similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/Logs.page.tsx index 329d92b38275..5fd6708d8015 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/Logs.page.tsx @@ -1,17 +1,17 @@ import { useEffect, useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; -import FormattedDate from '@/components/table-date'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; import { Label } from '@/components/ui/label'; import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area'; import { Switch } from '@/components/ui/switch'; -import { useGetServiceLogs } from '@/hooks/api/logs.api.hooks'; -import { useServiceData } from '../layout'; +import { useServiceData } from '../Service.context'; import { Skeleton } from '@/components/ui/skeleton'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; -import { POLLING } from '@/configuration/polling'; -import { GuideSections } from '@/models/guide'; -import Guides from '@/components/guides'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { POLLING } from '@/configuration/polling.constants'; +import { GuideSections } from '@/types/guide'; +import Guides from '@/components/guides/Guides.component'; +import { useGetServiceLogs } from '@/hooks/api/database/logs/useGetServiceLogs.hook'; export function breadcrumb() { return ( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/logs/logs.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/Logs.spec.tsx similarity index 86% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/logs/logs.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/Logs.spec.tsx index 86c956a2c479..557833cc9bc7 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/logs/logs.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/logs/Logs.spec.tsx @@ -1,19 +1,19 @@ import { describe, it, expect, vi } from 'vitest'; import { render, screen, waitFor, fireEvent } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as logsHook from '@/hooks/api/logs.api.hooks'; import Logs, { breadcrumb as LogsBreadcrumb, -} from '@/pages/services/[serviceId]/logs'; -import { database } from '@/models/database'; +} from '@/pages/services/[serviceId]/logs/Logs.page'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; import { QueryClientWrapper } from '@/__tests__/helpers/wrappers/QueryClientWrapper'; +import * as logHook from '@/hooks/api/database/logs/useGetServiceLogs.hook'; const mockService: database.Service = { engine: database.EngineEnum.mongodb, id: 'serviceId', capabilities: {}, - category: database.CategoryEnum.operational, + category: database.engine.CategoryEnum.operational, createdAt: '', description: '', endpoints: [], @@ -30,6 +30,8 @@ const mockService: database.Service = { nodes: [], plan: '', status: database.StatusEnum.READY, + region: '', + storage: null, version: '', backups: { regions: [], @@ -44,14 +46,14 @@ vi.mock('react-i18next', () => ({ }), })); -vi.mock('@/hooks/api/logs.api.hooks', () => { +vi.mock('@/hooks/api/database/logs/useGetServiceLogs.hook', () => { const useGetServiceLogs = vi.fn(); return { useGetServiceLogs, }; }); -vi.mock('@/pages/services/[serviceId]/layout', () => { +vi.mock('@/pages/services/[serviceId]/Service.context', () => { const useServiceData = vi.fn(() => ({ projectId: 'projectId', service: mockService, @@ -79,7 +81,7 @@ describe('Logs page', () => { vi.clearAllMocks(); }); it('renders and shows skeletons while loading', async () => { - vi.mocked(logsHook.useGetServiceLogs).mockResolvedValue({ + vi.mocked(logHook.useGetServiceLogs).mockResolvedValue({ data: [], isSuccess: false, } as UseQueryResult); @@ -90,7 +92,7 @@ describe('Logs page', () => { it('displays logs after fetching', async () => { const mockScrollIntoView = vi.fn(); window.HTMLElement.prototype.scrollIntoView = mockScrollIntoView; - vi.mocked(logsHook.useGetServiceLogs).mockReturnValue({ + vi.mocked(logHook.useGetServiceLogs).mockReturnValue({ isSuccess: true, data: [ { timestamp: 1609459200, hostname: 'host1', message: 'Test log 1' }, @@ -109,7 +111,7 @@ describe('Logs page', () => { it('updates auto-refresh status when switch is toggled', async () => { const mockScrollIntoView = vi.fn(); window.HTMLElement.prototype.scrollIntoView = mockScrollIntoView; - vi.mocked(logsHook.useGetServiceLogs).mockReturnValue({ + vi.mocked(logHook.useGetServiceLogs).mockReturnValue({ isSuccess: true, data: [ { timestamp: 1609459200, hostname: 'host1', message: 'Test log 1' }, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/Metrics.page.tsx similarity index 84% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/Metrics.page.tsx index 3ecfe367acaa..c0c57466956f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/Metrics.page.tsx @@ -1,17 +1,17 @@ import { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; -import { useServiceData } from '../layout'; -import { database } from '@/models/database'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import { useServiceData } from '../Service.context'; +import * as database from '@/types/cloud/project/database'; import { Button } from '@/components/ui/button'; import { Label } from '@/components/ui/label'; import { Switch } from '@/components/ui/switch'; -import MetricChart from './_components/metricChart'; -import { useGetMetrics } from '@/hooks/api/metrics.api.hooks'; +import MetricChart from './_components/MetricChart.component'; import { cn } from '@/lib/utils'; -import { POLLING } from '@/configuration/polling'; -import Guides from '@/components/guides'; -import { GuideSections } from '@/models/guide'; +import { POLLING } from '@/configuration/polling.constants'; +import Guides from '@/components/guides/Guides.component'; +import { GuideSections } from '@/types/guide'; +import { useGetMetrics } from '@/hooks/api/database/metric/useGetMetrics.hook'; export function breadcrumb() { return ( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/metrics/metrics.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/Metrics.spec.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/metrics/metrics.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/Metrics.spec.tsx index 1ade587f3908..5a885d1e64c1 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/metrics/metrics.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/Metrics.spec.tsx @@ -3,8 +3,8 @@ import { render, screen, waitFor } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; import Metrics, { breadcrumb as Breadcrumb, -} from '@/pages/services/[serviceId]/metrics'; -import { database } from '@/models/database'; +} from '@/pages/services/[serviceId]/metrics/Metrics.page'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; @@ -26,7 +26,7 @@ describe('Metrics page', () => { }), })); - vi.mock('@/api/databases/metrics', () => ({ + vi.mock('@/data/api/database/metric.api', () => ({ getMetrics: vi.fn(() => [ mockMetric.name, mockMetricCpu.name, @@ -36,7 +36,7 @@ describe('Metrics page', () => { getMetric: vi.fn(() => mockMetric), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedServiceOrig, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/metricChart.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/MetricChart.component.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/metricChart.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/MetricChart.component.tsx index 05ef26167089..c22d14b36da2 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/metricChart.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/MetricChart.component.tsx @@ -18,13 +18,13 @@ import { import { Line } from 'react-chartjs-2'; import { Loader } from 'lucide-react'; import { useTranslation } from 'react-i18next'; -import { useGetMetric } from '@/hooks/api/metrics.api.hooks'; -import { database } from '@/models/database'; -import { colors } from './colors'; +import * as database from '@/types/cloud/project/database'; +import { colors } from './colors.constants'; import { useDateFnsLocale } from '@/hooks/useDateFnsLocale.hook'; -import { useServiceData } from '../../layout'; +import { useServiceData } from '../../Service.context'; import { cn } from '@/lib/utils'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { useGetMetric } from '@/hooks/api/database/metric/useGetMetric.hook'; ChartJS.register( CategoryScale, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/colors.ts b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/colors.constants.ts similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/colors.ts rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/metrics/_components/colors.constants.ts diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/Namespace.page.tsx similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/Namespace.page.tsx index 0d9c28820b0a..f9952f0c5cb4 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/Namespace.page.tsx @@ -2,21 +2,20 @@ import { useTranslation } from 'react-i18next'; import { ColumnDef } from '@tanstack/react-table'; import { Plus } from 'lucide-react'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Button } from '@/components/ui/button'; import { DataTable } from '@/components/ui/data-table'; import { useModale } from '@/hooks/useModale'; -import { useGetNamespaces } from '@/hooks/api/namespaces.api.hooks'; - -import { useServiceData } from '../layout'; -import { POLLING } from '@/configuration/polling'; -import { getColumns } from './_components/namespacesTableColumns'; -import DeleteNamespaceModal from './_components/deleteNamespace'; -import AddEditNamespace from './_components/addEditNamespace'; -import { NAMESPACES_CONFIG } from './_components/formNamespace/namespace.const'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { useServiceData } from '../Service.context'; +import { POLLING } from '@/configuration/polling.constants'; +import { getColumns } from './_components/NamespacesTableColumns.component'; +import DeleteNamespaceModal from './_components/DeleteNamespace.component'; +import AddEditNamespace from './_components/AddEditNamespace.component'; +import { NAMESPACES_CONFIG } from './_components/formNamespace/namespace.constants'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import { useGetNamespaces } from '@/hooks/api/database/namespace/useGetNamespaces.hook'; export function breadcrumb() { return ( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/namespaces/namespaces.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/Namespaces.spec.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/namespaces/namespaces.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/Namespaces.spec.tsx index 4cd8cd3b3332..27dc552f5301 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/namespaces/namespaces.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/Namespaces.spec.tsx @@ -7,13 +7,13 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; import Namespaces, { breadcrumb as Breadcrumb, -} from '@/pages/services/[serviceId]/namespaces'; -import { database } from '@/models/database'; +} from '@/pages/services/[serviceId]/namespaces/Namespace.page'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as namespaceApi from '@/api/databases/namespaces'; +import * as namespaceApi from '@/data/api/database/namespace.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { mockedNamespaces } from '@/__tests__/helpers/mocks/namespaces'; @@ -46,13 +46,13 @@ describe('Namespaces page', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/namespaces', () => ({ + vi.mock('@/data/api/database/namespace.api', () => ({ getNamespaces: vi.fn(() => [mockedNamespaces]), addNamespace: vi.fn((namespace) => namespace), deleteNamespace: vi.fn(), editNamespace: vi.fn((namespace) => namespace), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -102,7 +102,7 @@ describe('Namespaces page', () => { }); }); it('displays add namespace button if capability is present', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, @@ -119,7 +119,7 @@ describe('Namespaces page', () => { expect(screen.queryByTestId('namespaces-add-button')).toBeInTheDocument(); }); it('does not display namespaces button if capability is absent', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, @@ -134,7 +134,7 @@ describe('Namespaces page', () => { expect(screen.queryByTestId('namespaces-add-button')).toBeNull(); }); it('disable add namespaces button if capability is disabled', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/addEditNamespace.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/AddEditNamespace.component.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/addEditNamespace.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/AddEditNamespace.component.tsx index 84944824d3cc..cf9b054851ea 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/addEditNamespace.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/AddEditNamespace.component.tsx @@ -32,16 +32,17 @@ import { Switch } from '@/components/ui/switch'; import { useToast } from '@/components/ui/use-toast'; import { ModalController } from '@/hooks/useModale'; -import { useNamespaceForm } from './formNamespace/formNamespace.hook'; -import { - MutateNamespaceProps, - useAddNamespace, - useEditNamespace, -} from '@/hooks/api/namespaces.api.hooks'; +import { useNamespaceForm } from './formNamespace/useNamespaceForm.hook'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { convertDurationStringToISODuration } from '@/lib/durationHelper'; -import { TOAST } from '@/configuration/toast'; +import { TOAST } from '@/configuration/toast.constants'; +import { + UseAddNamespace, + useAddNamespace, +} from '@/hooks/api/database/namespace/useAddNamespace.hook'; +import { useEditNamespace } from '@/hooks/api/database/namespace/useEditNamespace.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface AddEditNamespaceModalProps { isEdition: boolean; @@ -87,12 +88,12 @@ const AddEditNamespace = ({ const prefix = isEdition ? 'edit' : 'add'; const toast = useToast(); - const NamespaceMutationProps: MutateNamespaceProps = { + const NamespaceMutationProps: UseAddNamespace = { onError(err) { toast.toast({ title: t(`${prefix}NamespaceToastErrorTitle`), variant: 'destructive', - description: err.response.data.details.message, + description: getCdbApiErrorMessage(err), duration: TOAST.ERROR_DURATION, }); if (onError) { diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/deleteNamespace.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/DeleteNamespace.component.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/deleteNamespace.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/DeleteNamespace.component.tsx index 680f4919f722..e0dd5c9f012f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/deleteNamespace.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/DeleteNamespace.component.tsx @@ -14,9 +14,10 @@ import { import { useToast } from '@/components/ui/use-toast'; import { ModalController } from '@/hooks/useModale'; -import { useDeleteNamespace } from '@/hooks/api/namespaces.api.hooks'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; +import { useDeleteNamespace } from '@/hooks/api/database/namespace/useDeleteNamespace.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface DeleteNamespaceModalProps { service: database.Service; @@ -43,7 +44,7 @@ const DeleteNamespaceModal = ({ toast.toast({ title: t('deleteNamespaceToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/namespacesTableColumns.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/NamespacesTableColumns.component.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/namespacesTableColumns.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/NamespacesTableColumns.component.tsx index 75ffcad5b444..46273bb983ea 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/namespacesTableColumns.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/NamespacesTableColumns.component.tsx @@ -19,9 +19,9 @@ import { Button } from '@/components/ui/button'; import { useDateFnsLocale } from '@/hooks/useDateFnsLocale.hook'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { durationStringToHuman } from '@/lib/durationHelper'; -import { useServiceData } from '../../layout'; +import { useServiceData } from '../../Service.context'; interface NamespacesTableColumnsProps { onEditClick: (namespace: database.m3db.Namespace) => void; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/namespace.const.ts b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/namespace.constants.ts similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/namespace.const.ts rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/namespace.constants.ts diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/formNamespace.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/useNamespaceForm.hook.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/formNamespace.hook.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/useNamespaceForm.hook.tsx index 57d499fbf090..9ceb04c11f9f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/formNamespace.hook.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/namespaces/_components/formNamespace/useNamespaceForm.hook.tsx @@ -3,8 +3,8 @@ import { useTranslation } from 'react-i18next'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; -import { database } from '@/models/database'; -import { NAMESPACES_CONFIG } from './namespace.const'; +import * as database from '@/types/cloud/project/database'; +import { NAMESPACES_CONFIG } from './namespace.constants'; import { durationISOStringToShortTime } from '@/lib/durationHelper'; export interface UseNamespaceFormProps { diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/Pools.page.tsx similarity index 85% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/Pools.page.tsx index bfa956bf0218..bf00669dbeca 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/Pools.page.tsx @@ -5,24 +5,24 @@ import { useEffect, useState } from 'react'; import { Plus } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { DataTable } from '@/components/ui/data-table'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; import { useModale } from '@/hooks/useModale'; -import { useGetConnectionPools } from '@/hooks/api/connectionPool.api.hooks'; -import { useGetDatabases } from '@/hooks/api/databases.api.hook'; -import { useGetUsers } from '@/hooks/api/users.api.hooks'; - -import { useServiceData } from '../layout'; -import { POLLING } from '@/configuration/polling'; -import { GenericUser } from '@/api/databases/users'; -import { database } from '@/models/database'; -import { getColumns } from './_components/poolsTableColumns'; -import InfoConnectionPool from './_components/infoConnectionPool'; -import AddEditConnectionPool from './_components/addEditconnectionPool'; -import DeleteConnectionPool from './_components/deleteConnectionPool'; -import Guides from '@/components/guides'; -import { GuideSections } from '@/models/guide'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; + +import { useServiceData } from '../Service.context'; +import { POLLING } from '@/configuration/polling.constants'; +import { GenericUser } from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; +import { getColumns } from './_components/PoolsTableColumns.component'; +import InfoConnectionPool from './_components/InfoConnectionPool.component'; +import AddEditConnectionPool from './_components/AddEditconnectionPool.component'; +import DeleteConnectionPool from './_components/DeleteConnectionPool.component'; +import Guides from '@/components/guides/Guides.component'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { GuideSections } from '@/types/guide'; +import { useGetDatabases } from '@/hooks/api/database/database/useGetDatabases.hook'; +import { useGetUsers } from '@/hooks/api/database/user/useGetUsers.hook'; +import { useGetConnectionPools } from '@/hooks/api/database/connectionPool/useGetConnectionPools.hook'; export function breadcrumb() { return ( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/pools/pools.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/Pools.spec.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/pools/pools.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/Pools.spec.tsx index 8994e787597e..c4adc8ac42b4 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/pools/pools.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/Pools.spec.tsx @@ -7,13 +7,13 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; import Pools, { breadcrumb as Breadcrumb, -} from '@/pages/services/[serviceId]/pools'; -import { database } from '@/models/database'; +} from '@/pages/services/[serviceId]/pools/Pools.page'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as connectionPoolApi from '@/api/databases/connectionPool'; +import * as connectionPoolApi from '@/data/api/database/connectionPool.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { mockedConnectionPool } from '@/__tests__/helpers/mocks/connectionPool'; @@ -45,27 +45,27 @@ describe('Connection pool page', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/connectionPool', () => ({ + vi.mock('@/data/api/database/connectionPool.api', () => ({ getConnectionPools: vi.fn(() => [mockedConnectionPool]), addConnectionPool: vi.fn((connectionPool) => connectionPool), deleteConnectionPool: vi.fn(), editConnectionPool: vi.fn((connectionPool) => connectionPool), })); - vi.mock('@/api/databases/databases', () => ({ + vi.mock('@/data/api/database/database.api', () => ({ getServiceDatabases: vi.fn(() => [mockedDatabase]), })); - vi.mock('@/api/databases/users', () => ({ + vi.mock('@/data/api/database/user.api', () => ({ getUsers: vi.fn(() => [mockedUser]), })); - vi.mock('@/api/databases/certificates', () => ({ + vi.mock('@/data/api/database/certificate.api', () => ({ getCertificate: vi.fn(() => mockCertificate), // test })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -115,7 +115,7 @@ describe('Connection pool page', () => { }); }); it('displays add connection pool button if capability is present', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -132,7 +132,7 @@ describe('Connection pool page', () => { expect(screen.queryByTestId('pools-add-button')).toBeInTheDocument(); }); it('does not display add connection pool button if capability is absent', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -146,7 +146,7 @@ describe('Connection pool page', () => { }); it('disable add connection pool button if capability is disabled', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -196,7 +196,7 @@ describe('Open modals', () => { })), }; }); - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: mockedService, category: 'operational', diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/addEditconnectionPool.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/AddEditconnectionPool.component.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/addEditconnectionPool.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/AddEditconnectionPool.component.tsx index 55af22f34472..79cdb0ec4e34 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/addEditconnectionPool.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/AddEditconnectionPool.component.tsx @@ -30,17 +30,18 @@ import { } from '@/components/ui/select'; import { useToast } from '@/components/ui/use-toast'; -import { useConnectionPoolForm } from './formPools/formConnectionPool.hook'; -import { - MutateConnectionPoolProps, - useAddConnectionPool, - useEditConnectionPool, -} from '@/hooks/api/connectionPool.api.hooks'; +import { useConnectionPoolForm } from './formPools/useConnectionPoolForm.hook'; import { ModalController } from '@/hooks/useModale'; -import { GenericUser } from '@/api/databases/users'; -import { database } from '@/models/database'; -import { ConnectionPoolEdition } from '@/api/databases/connectionPool'; +import { GenericUser } from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; +import { ConnectionPoolEdition } from '@/data/api/database/connectionPool.api'; +import { + UseAddConnectionPool, + useAddConnectionPool, +} from '@/hooks/api/database/connectionPool/useAddConnectionPool.hook'; +import { useEditConnectionPool } from '@/hooks/api/database/connectionPool/useEditConnectionPool.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface AddEditConnectionPoolModalProps { isEdition: boolean; @@ -81,12 +82,12 @@ const AddEditConnectionPool = ({ const prefix = isEdition ? 'edit' : 'add'; const toast = useToast(); - const ConnectionPoolMutationProps: MutateConnectionPoolProps = { + const connectionPoolMutationConfig: UseAddConnectionPool = { onError(err) { toast.toast({ title: t(`${prefix}ConnectionPoolToastErrorTitle`), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); @@ -109,12 +110,12 @@ const AddEditConnectionPool = ({ const { addConnectionPool, isPending: isPendingAddPool, - } = useAddConnectionPool(ConnectionPoolMutationProps); + } = useAddConnectionPool(connectionPoolMutationConfig); const { editConnectionPool, isPending: isPendingEditPool, - } = useEditConnectionPool(ConnectionPoolMutationProps); + } = useEditConnectionPool(connectionPoolMutationConfig); const onSubmit = form.handleSubmit((formValues) => { if (isEdition) { @@ -136,7 +137,7 @@ const AddEditConnectionPool = ({ connectionPool, }); } else { - const connectionPool: database.postgresql.ConnectionPoolCreation = { + const connectionPool: Partial = { databaseId: formValues.databaseId, mode: formValues.mode, name: formValues.name, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/deleteConnectionPool.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/DeleteConnectionPool.component.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/deleteConnectionPool.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/DeleteConnectionPool.component.tsx index 9974735e770e..1af7a43ba507 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/deleteConnectionPool.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/DeleteConnectionPool.component.tsx @@ -14,9 +14,10 @@ import { import { useToast } from '@/components/ui/use-toast'; import { ModalController } from '@/hooks/useModale'; -import { useDeleteConnectionPool } from '@/hooks/api/connectionPool.api.hooks'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; +import { useDeleteConnectionPool } from '@/hooks/api/database/connectionPool/useDeleteConnectionPool.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface DeleteConnectionPoolModalProps { service: database.Service; @@ -43,7 +44,7 @@ const DeleteConnectionPool = ({ toast.toast({ title: t('deleteConnectionPoolToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/infoConnectionPool.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/InfoConnectionPool.component.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/infoConnectionPool.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/InfoConnectionPool.component.tsx index 7f966e2b6335..56a21936cb4e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/infoConnectionPool.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/InfoConnectionPool.component.tsx @@ -13,10 +13,10 @@ import { Button } from '@/components/ui/button'; import { useToast } from '@/components/ui/use-toast'; import { ModalController } from '@/hooks/useModale'; -import { useGetCertificate } from '@/hooks/api/certificates.api.hooks'; import useDownload from '@/hooks/useDownload'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; +import { useGetCertificate } from '@/hooks/api/database/certificate/useGetCertificate.hook'; interface InfoConnectionPoolModalProps { service: database.Service; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/poolsTableColumns.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/PoolsTableColumns.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/poolsTableColumns.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/PoolsTableColumns.component.tsx index 12ea60bcb230..132d6487ea16 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/poolsTableColumns.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/PoolsTableColumns.component.tsx @@ -16,9 +16,9 @@ import { DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { Button } from '@/components/ui/button'; -import { ConnectionPoolWithData } from '..'; -import { useServiceData } from '../../layout'; -import { database } from '@/models/database'; +import { ConnectionPoolWithData } from '../Pools.page'; +import { useServiceData } from '../../Service.context'; +import * as database from '@/types/cloud/project/database'; interface ConnectionPoolsTableColumnsProps { onGetInformationClick: (connectionPool: ConnectionPoolWithData) => void; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/connectionPool.const.ts b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/connectionPool.constants.ts similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/connectionPool.const.ts rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/connectionPool.constants.ts diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/formConnectionPool.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/useConnectionPoolForm.hook.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/formConnectionPool.hook.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/useConnectionPoolForm.hook.tsx index 5598579a7099..cb5ef8dffc8b 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/formConnectionPool.hook.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/pools/_components/formPools/useConnectionPoolForm.hook.tsx @@ -3,8 +3,8 @@ import { useTranslation } from 'react-i18next'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; -import { database } from '@/models/database'; -import { POOL_CONFIG } from './connectionPool.const'; +import * as database from '@/types/cloud/project/database'; +import { POOL_CONFIG } from './connectionPool.constants'; export interface UseConnectionPoolFormProps { existingConnectionPools: database.postgresql.ConnectionPool[]; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/Queries.page.tsx similarity index 66% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/Queries.page.tsx index b2af271164a1..c454c22ce2c4 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/Queries.page.tsx @@ -1,11 +1,11 @@ import { useTranslation } from 'react-i18next'; -import { useServiceData } from '../layout'; -import { database } from '@/models/database'; -import CurrentQueries from './_components/currentQueries'; -import QueryStatistics from './_components/queryStatistics'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; -import Guides from '@/components/guides'; -import { GuideSections } from '@/models/guide'; +import { useServiceData } from '../Service.context'; +import * as database from '@/types/cloud/project/database'; +import CurrentQueries from './_components/CurrentQueries.component'; +import QueryStatistics from './_components/QueryStatistics.component'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import Guides from '@/components/guides/Guides.component'; +import { GuideSections } from '@/types/guide'; export function breadcrumb() { return ( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/queries/queries.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/Queries.spec.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/queries/queries.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/Queries.spec.tsx index d7a487fbc99d..070b42656a1f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/queries/queries.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/Queries.spec.tsx @@ -7,13 +7,13 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; import Queries, { breadcrumb as Breadcrumb, -} from '@/pages/services/[serviceId]/queries'; -import { database } from '@/models/database'; +} from '@/pages/services/[serviceId]/queries/Queries.page'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as queriesApi from '@/api/databases/queries'; +import * as queriesApi from '@/data/api/database/queries.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { @@ -52,13 +52,13 @@ describe('Queries page', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/queries', () => ({ + vi.mock('@/data/api/database/queries.api', () => ({ getCurrentQueries: vi.fn(() => [mockedQueries]), cancelCurrentQuery: vi.fn(() => mockCancelResponse), getQueryStatistics: vi.fn(() => [mockedQueryStatisticsPG]), resetQueryStatistics: vi.fn(), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -119,7 +119,7 @@ describe('Queries page', () => { }); it('no display if both read capabilities is disable', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, @@ -138,7 +138,7 @@ describe('Queries page', () => { }); it('does not display reset statistics button if capability is absent', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -163,7 +163,7 @@ describe('Queries page', () => { }); it('disable reset statistics button if capability is in disable', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -215,7 +215,7 @@ describe('Action of queries and statistics', () => { }; beforeEach(async () => { vi.restoreAllMocks(); - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: mockedService, category: 'operational', diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/currentQueries.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/CurrentQueries.component.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/currentQueries.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/CurrentQueries.component.tsx index 2c1a918eb466..63e809ee65a8 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/currentQueries.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/CurrentQueries.component.tsx @@ -1,19 +1,18 @@ import { ColumnDef } from '@tanstack/react-table'; import { useTranslation } from 'react-i18next'; import { useState } from 'react'; -import { - useCancelCurrentQuery, - useGetCurrentQueries, -} from '@/hooks/api/queries.api.hooks'; -import { useServiceData } from '../../layout'; +import { useServiceData } from '../../Service.context'; import { DataTable } from '@/components/ui/data-table'; -import { database } from '@/models/database'; -import { getColumns } from './currentQueriesTableColumns'; +import * as database from '@/types/cloud/project/database'; +import { getColumns } from './CurrentQueriesTableColumns.component'; import { useToast } from '@/components/ui/use-toast'; -import { POLLING } from '@/configuration/polling'; +import { POLLING } from '@/configuration/polling.constants'; import { Switch } from '@/components/ui/switch'; import { Label } from '@/components/ui/label'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { useGetCurrentQueries } from '@/hooks/api/database/query/useGetCurrentQueries.hook'; +import { useCancelCurrentQuery } from '@/hooks/api/database/query/useCancelCurrentQuery.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; const CurrentQueries = () => { const { t } = useTranslation( @@ -38,7 +37,7 @@ const CurrentQueries = () => { toast.toast({ title: t('currentQueryTerminateToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); }, onSuccess: (result) => { diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/currentQueriesTableColumns.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/CurrentQueriesTableColumns.component.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/currentQueriesTableColumns.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/CurrentQueriesTableColumns.component.tsx index e8bc3b1c0811..34eb6af2e968 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/currentQueriesTableColumns.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/CurrentQueriesTableColumns.component.tsx @@ -2,7 +2,7 @@ import { useTranslation } from 'react-i18next'; import { MoreHorizontal } from 'lucide-react'; import { ColumnDef } from '@tanstack/react-table'; import { SortableHeader } from '@/components/ui/data-table'; -import { ExpandableSqlQuery } from './ExpandableSqlQuery'; +import { ExpandableSqlQuery } from './ExpandableSqlQuery.component'; import { DropdownMenu, DropdownMenuContent, @@ -10,8 +10,8 @@ import { DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { Button } from '@/components/ui/button'; -import { database } from '@/models/database'; -import { useServiceData } from '../../layout'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '../../Service.context'; interface CurrentQueriesListColumnsProps { onCancelQueryClicked: (query: database.service.currentqueries.Query) => void; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/ExpandableSqlQuery.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/ExpandableSqlQuery.component.tsx similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/ExpandableSqlQuery.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/ExpandableSqlQuery.component.tsx diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/queryStatistics.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/QueryStatistics.component.tsx similarity index 83% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/queryStatistics.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/QueryStatistics.component.tsx index 8f530d476402..c1bd4fa9ff34 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/queryStatistics.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/QueryStatistics.component.tsx @@ -1,16 +1,15 @@ import { ColumnDef } from '@tanstack/react-table'; import { useTranslation } from 'react-i18next'; import { RotateCcw } from 'lucide-react'; -import { - useGetQueryStatistics, - useResetQueryStatistics, -} from '@/hooks/api/queries.api.hooks'; -import { useServiceData } from '../../layout'; +import { useServiceData } from '../../Service.context'; import { DataTable } from '@/components/ui/data-table'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Button } from '@/components/ui/button'; import { useToast } from '@/components/ui/use-toast'; -import { getColumns } from './queryStatisticsTableColumns'; +import { getColumns } from './QueryStatisticsTableColumns.component'; +import { useGetQueryStatistics } from '@/hooks/api/database/query/useGetQueryStatistics.hook'; +import { useResetQueryStatistics } from '@/hooks/api/database/query/useResetQueryStatistics.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; const QueryStatistics = () => { const { t } = useTranslation( @@ -28,7 +27,7 @@ const QueryStatistics = () => { toast.toast({ title: t('queryStatistcsResetToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); }, onSuccess: () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/queryStatisticsTableColumns.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/QueryStatisticsTableColumns.component.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/queryStatisticsTableColumns.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/QueryStatisticsTableColumns.component.tsx index 8965a61dcc8e..c4d4308895a1 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/queryStatisticsTableColumns.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/queries/_components/QueryStatisticsTableColumns.component.tsx @@ -1,8 +1,8 @@ import { useTranslation } from 'react-i18next'; import { ColumnDef } from '@tanstack/react-table'; import { SortableHeader } from '@/components/ui/data-table'; -import { ExpandableSqlQuery } from './ExpandableSqlQuery'; -import { database } from '@/models/database'; +import { ExpandableSqlQuery } from './ExpandableSqlQuery.component'; +import * as database from '@/types/cloud/project/database'; export const getColumns = () => { const { t } = useTranslation( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/layout.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.layout.spec.tsx similarity index 86% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/layout.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.layout.spec.tsx index 367e5a11ec60..c09ebf938cea 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/layout.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.layout.spec.tsx @@ -4,15 +4,15 @@ import { render, screen, waitFor } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; import BackupLayout, { breadcrumb as Breadcrumb, -} from '@/pages/services/[serviceId]/settings/layout'; +} from '@/pages/services/[serviceId]/settings/Settings.layout'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService } from '@/__tests__/helpers/mocks/services'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; describe('Service settings layout', () => { beforeEach(() => { vi.restoreAllMocks(); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/layout.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.layout.tsx similarity index 73% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/layout.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.layout.tsx index e15b552420e9..bed4f368461a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/layout.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.layout.tsx @@ -1,6 +1,6 @@ import { Outlet } from 'react-router-dom'; -import { useServiceData } from '../layout'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; +import { useServiceData } from '../Service.context'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; export function breadcrumb() { return ( diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.page.tsx similarity index 82% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.page.tsx index 2b3d904f1fd6..8fb50f09f610 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.page.tsx @@ -1,19 +1,19 @@ import { AccordionItem } from '@radix-ui/react-accordion'; import { useTranslation } from 'react-i18next'; import { Card, CardContent, CardHeader } from '@/components/ui/card'; -import { useServiceData } from '../layout'; -import Maintenances from './_components/maintenances'; -import IpsRestrictionsUpdate from './_components/ipRestrictions'; -import AdvancedConfigurationUpdate from './_components/advancedConfiguration'; +import { useServiceData } from '../Service.context'; +import Maintenances from './_components/Maintenances.component'; +import IpsRestrictionsUpdate from './_components/IpRestrictionsUpdate.component'; +import AdvancedConfigurationUpdate from './_components/AdvancedConfigurationUpdate.component'; import { Accordion, AccordionContent, AccordionTrigger, } from '@/components/ui/accordion'; -import UpdateTable from './_components/updateTable'; -import ServiceConfiguration from './_components/serviceConfiguration'; -import Guides from '@/components/guides'; -import { GuideSections } from '@/models/guide'; +import UpdateTable from './_components/UpdateTable.component'; +import ServiceConfiguration from './_components/ServiceConfiguration.component'; +import Guides from '@/components/guides/Guides.component'; +import { GuideSections } from '@/types/guide'; const Settings = () => { const { service } = useServiceData(); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/settings.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.spec.tsx similarity index 89% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/settings.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.spec.tsx index 70e6f0d25f9d..a8d225a40848 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/settings.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/Settings.spec.tsx @@ -7,9 +7,9 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; -import Settings from '@/pages/services/[serviceId]/settings'; -import { database } from '@/models/database'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; +import Settings from '@/pages/services/[serviceId]/settings/Settings.page'; +import * as database from '@/types/cloud/project/database'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { mockedCatalog } from '@/__tests__/helpers/mocks/catalog'; @@ -59,30 +59,33 @@ describe('Settings page', () => { }), })); - vi.mock('@/api/catalog', () => ({ + vi.mock('@/data/api/catalog/catalog.api', () => ({ catalogApi: { getCatalog: vi.fn(() => mockedCatalog), }, })); - vi.mock('@/api/databases/availabilities', () => ({ + vi.mock('@/data/api/database/availability.api', () => ({ + getAvailabilities: vi.fn(() => [mockedAvailabilities]), + })); + + vi.mock('@/data/api/database/capabilities.api', () => ({ getCapabilities: vi.fn(() => mockedCapabilities), getEnginesCapabilities: vi.fn(() => [mockedEngineCapabilities]), getRegionsCapabilities: vi.fn(() => [mockedRegionCapabilities]), - getAvailabilities: vi.fn(() => [mockedAvailabilities]), })); - vi.mock('@/api/databases/maintenances', () => ({ + vi.mock('@/data/api/database/maintenance.api', () => ({ getMaintenances: vi.fn(() => [mockedMaintenance]), applyMaintenance: vi.fn((maintenance) => maintenance), })); - vi.mock('@/api/databases/advancedConfiguration', () => ({ + vi.mock('@/data/api/database/advancedConfiguration.api', () => ({ getAdvancedConfiguration: vi.fn(() => mockAdvancedConfiguration), getAdvancedConfigurationCapabilities: vi.fn(() => mockCapabilities), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -167,7 +170,7 @@ describe('Settings page', () => { }); it('does not display advanced config if capability is absent', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/AdvancedConfigurationUpdate.component.tsx similarity index 77% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/AdvancedConfigurationUpdate.component.tsx index 87bc0a6c0a9b..c75282d774a0 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/AdvancedConfigurationUpdate.component.tsx @@ -1,12 +1,10 @@ import { useTranslation } from 'react-i18next'; -import { - useGetAdvancedConfiguration, - useGetAdvancedConfigurationCapabilities, -} from '@/hooks/api/advancedConfiguration.api.hook'; -import { useServiceData } from '../../layout'; +import { useServiceData } from '../../Service.context'; import { Alert, AlertDescription } from '@/components/ui/alert'; -import AdvancedConfigurationForm from './advancedConfiguration/advancedConfigurationForm'; +import AdvancedConfigurationForm from './advancedConfiguration/AdvancedConfigurationForm.component'; import { Skeleton } from '@/components/ui/skeleton'; +import { useGetAdvancedConfiguration } from '@/hooks/api/database/advancedConfiguration/useGetAdvancedConfiguration.hook'; +import { useGetAdvancedConfigurationCapabilities } from '@/hooks/api/database/advancedConfiguration/useGetAdvancedConfigurationCapabilities.hook'; const AdvancedConfigurationUpdate = () => { const { t } = useTranslation( diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/advancedConfiguration.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/AdvancedConfigurationUpdate.spec.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/advancedConfiguration.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/AdvancedConfigurationUpdate.spec.tsx index d91ca3b7f4b0..49981c6945c0 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/advancedConfiguration.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/AdvancedConfigurationUpdate.spec.tsx @@ -1,3 +1,4 @@ +import { ReactNode } from 'react'; import { describe, it, expect, vi, beforeEach } from 'vitest'; import { act, @@ -7,9 +8,9 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import Settings from '@/pages/services/[serviceId]/settings'; -import { database } from '@/models/database'; -import * as advancedConfigurationAPI from '@/api/databases/advancedConfiguration'; +import Settings from '@/pages/services/[serviceId]/settings/Settings.page'; +import * as database from '@/types/cloud/project/database'; +import * as advancedConfigurationAPI from '@/data/api/database/advancedConfiguration.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { mockedCatalog } from '@/__tests__/helpers/mocks/catalog'; @@ -74,31 +75,34 @@ describe('Advanced configuration in settings page', () => { }), })); - vi.mock('@/api/catalog', () => ({ + vi.mock('@/data/api/catalog/catalog.api', () => ({ catalogApi: { getCatalog: vi.fn(() => mockedCatalog), }, })); - vi.mock('@/api/databases/availabilities', () => ({ + vi.mock('@/data/api/database/availability.api', () => ({ + getAvailabilities: vi.fn(() => [mockedAvailabilities]), + })); + + vi.mock('@/data/api/database/capabilities.api', () => ({ getCapabilities: vi.fn(() => mockedCapabilities), getEnginesCapabilities: vi.fn(() => [mockedEngineCapabilities]), getRegionsCapabilities: vi.fn(() => [mockedRegionCapabilities]), - getAvailabilities: vi.fn(() => [mockedAvailabilities]), })); - vi.mock('@/api/databases/maintenances', () => ({ + vi.mock('@/data/api/database/maintenance.api', () => ({ getMaintenances: vi.fn(() => [mockedMaintenance]), applyMaintenance: vi.fn((maintenance) => maintenance), })); - vi.mock('@/api/databases/advancedConfiguration', () => ({ + vi.mock('@/data/api/database/advancedConfiguration.api', () => ({ getAdvancedConfiguration: vi.fn(() => mockAdvancedConfiguration), getAdvancedConfigurationCapabilities: vi.fn(() => mockCapabilities), - updateAdvancedConfiguration: vi.fn((advConfig) => advConfig), + editAdvancedConfiguration: vi.fn((advConfig) => advConfig), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -132,7 +136,7 @@ describe('Advanced configuration in settings page', () => { useTranslation: () => ({ t: (key: string) => key, }), - Trans: ({ children }: any) => children, + Trans: ({ children }: { children: ReactNode }) => children, })); const ResizeObserverMock = vi.fn(() => ({ @@ -335,7 +339,7 @@ describe('Advanced configuration in settings page', () => { }); await waitFor(() => { expect( - advancedConfigurationAPI.updateAdvancedConfiguration, + advancedConfigurationAPI.editAdvancedConfiguration, ).toHaveBeenCalled(); }); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/ipRestrictions.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/IpRestrictionsUpdate.component.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/ipRestrictions.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/IpRestrictionsUpdate.component.tsx index 147ca45514ac..d0d2aa6172e5 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/ipRestrictions.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/IpRestrictionsUpdate.component.tsx @@ -2,7 +2,7 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { useTranslation } from 'react-i18next'; -import IpsRestrictionsForm from '@/components/Order/cluster-options/ips-restrictions-form'; +import IpsRestrictionsForm from '@/components/order/cluster-options/IpsRestrictionsForm.component'; import { Button } from '@/components/ui/button'; import { Form, @@ -12,9 +12,10 @@ import { FormMessage, } from '@/components/ui/form'; import { useToast } from '@/components/ui/use-toast'; -import { useUpdateService } from '@/hooks/api/services.api.hooks'; -import { database } from '@/models/database'; -import { useServiceData } from '../../layout'; +import { useEditService } from '@/hooks/api/database/service/useEditService.hook'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '../../Service.context'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface IpsRestrictionsUpdateProps { initialValue: database.service.IpRestriction[]; @@ -42,12 +43,12 @@ const IpsRestrictionsUpdate = ({ ipRestrictions: initialValue, }, }); - const { updateService, isPending } = useUpdateService({ + const { editService, isPending } = useEditService({ onError: (err) => { toast.toast({ title: t('ipsUpdateErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); }, onSuccess: (updatedService) => { @@ -62,7 +63,7 @@ const IpsRestrictionsUpdate = ({ }, }); const onSubmit = form.handleSubmit((formValues) => { - updateService({ + editService({ serviceId: service.id, engine: service.engine, projectId, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/ipsRestrictionsUpdate.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/IpsRestrictionsUpdate.spec.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/ipsRestrictionsUpdate.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/IpsRestrictionsUpdate.spec.tsx index 4a889aa29ea2..8cfc889ce1b3 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/ipsRestrictionsUpdate.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/IpsRestrictionsUpdate.spec.tsx @@ -1,3 +1,4 @@ +import { ReactNode } from 'react'; import { describe, it, expect, vi, beforeEach } from 'vitest'; import { act, @@ -7,9 +8,9 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import Settings from '@/pages/services/[serviceId]/settings'; -import { database } from '@/models/database'; -import * as serviceApi from '@/api/databases/service'; +import Settings from '@/pages/services/[serviceId]/settings/Settings.page'; +import * as database from '@/types/cloud/project/database'; +import * as serviceApi from '@/data/api/database/service.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { mockedCatalog } from '@/__tests__/helpers/mocks/catalog'; @@ -70,13 +71,13 @@ describe('Ips restrictions update in settings page', () => { }), })); - vi.mock('@/api/catalog', () => ({ + vi.mock('@/data/api/catalog/catalog.api', () => ({ catalogApi: { getCatalog: vi.fn(() => mockedCatalog), }, })); - vi.mock('@/api/databases/availabilities', () => ({ + vi.mock('@/data/api/database/availability.api', () => ({ getCapabilities: vi.fn(() => mockedCapabilities), getEnginesCapabilities: vi.fn(() => [mockedEngineCapabilities]), getRegionsCapabilities: vi.fn(() => [mockedRegionCapabilities]), @@ -86,21 +87,21 @@ describe('Ips restrictions update in settings page', () => { ]), })); - vi.mock('@/api/databases/maintenances', () => ({ + vi.mock('@/data/api/database/maintenance.api', () => ({ getMaintenances: vi.fn(() => [mockedMaintenance]), applyMaintenance: vi.fn((maintenance) => maintenance), })); - vi.mock('@/api/databases/advancedConfiguration', () => ({ + vi.mock('@/data/api/database/advancedConfiguration.api', () => ({ getAdvancedConfiguration: vi.fn(() => mockAdvancedConfiguration), getAdvancedConfigurationCapabilities: vi.fn(() => mockCapabilities), })); - vi.mock('@/api/databases/service', () => ({ - updateService: vi.fn((service) => service), + vi.mock('@/data/api/database/service.api', () => ({ + editService: vi.fn((service) => service), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -134,7 +135,7 @@ describe('Ips restrictions update in settings page', () => { useTranslation: () => ({ t: (key: string) => key, }), - Trans: ({ children }: any) => children, + Trans: ({ children }: { children: ReactNode }) => children, })); }); @@ -170,7 +171,7 @@ describe('Ips restrictions update in settings page', () => { }); }); - it('call updateService on add ips success', async () => { + it('call editService on add ips success', async () => { render(, { wrapper: RouterWithQueryClientWrapper }); await waitFor(() => { expect( @@ -205,7 +206,7 @@ describe('Ips restrictions update in settings page', () => { fireEvent.click(screen.getByTestId('ips-update-submit-button')); }); await waitFor(() => { - expect(serviceApi.updateService).toHaveBeenCalled(); + expect(serviceApi.editService).toHaveBeenCalled(); }); }); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/maintenances.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/Maintenances.component.tsx similarity index 90% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/maintenances.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/Maintenances.component.tsx index 5849f018de4c..5b207b35d65c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/maintenances.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/Maintenances.component.tsx @@ -1,16 +1,15 @@ import { useTranslation } from 'react-i18next'; -import { - useApplyMaintenance, - useGetMaintenances, -} from '@/hooks/api/maintenances.api.hooks'; -import { useServiceData } from '../../layout'; +import { useServiceData } from '../../Service.context'; import { Skeleton } from '@/components/ui/skeleton'; import { Alert, AlertDescription } from '@/components/ui/alert'; -import FormattedDate from '@/components/table-date'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; import { Button } from '@/components/ui/button'; import { Badge, BadgeProps } from '@/components/ui/badge'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { useToast } from '@/components/ui/use-toast'; +import { useGetMaintenances } from '@/hooks/api/database/maintenance/useGetMaintenances.hook'; +import { useApplyMaintenance } from '@/hooks/api/database/maintenance/useApplyMaintenance.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; const Maintenances = () => { const { t } = useTranslation( @@ -28,7 +27,7 @@ const Maintenances = () => { toast.toast({ title: t('maintenanceApplyToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); }, onSuccess: () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/maintenances.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/Maintenances.spec.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/maintenances.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/Maintenances.spec.tsx index 5e7a250a0420..9980234ea14a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/maintenances.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/Maintenances.spec.tsx @@ -1,3 +1,4 @@ +import { ReactNode } from 'react'; import { describe, it, expect, vi, beforeEach } from 'vitest'; import { act, @@ -7,10 +8,10 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; -import Settings from '@/pages/services/[serviceId]/settings'; -import * as maintenanceApi from '@/api/databases/maintenances'; -import { database } from '@/models/database'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; +import Settings from '@/pages/services/[serviceId]/settings/Settings.page'; +import * as maintenanceApi from '@/data/api/database/maintenance.api'; +import * as database from '@/types/cloud/project/database'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { mockedCatalog } from '@/__tests__/helpers/mocks/catalog'; @@ -44,25 +45,25 @@ describe('Maintenance in settings page', () => { }), })); - vi.mock('@/api/catalog', () => ({ + vi.mock('@/data/api/catalog/catalog.api', () => ({ catalogApi: { getCatalog: vi.fn(() => mockedCatalog), }, })); - vi.mock('@/api/databases/availabilities', () => ({ + vi.mock('@/data/api/database/availability.api', () => ({ getCapabilities: vi.fn(() => mockedCapabilities), getEnginesCapabilities: vi.fn(() => [mockedEngineCapabilities]), getRegionsCapabilities: vi.fn(() => [mockedRegionCapabilities]), getAvailabilities: vi.fn(() => [mockedAvailabilities]), })); - vi.mock('@/api/databases/maintenances', () => ({ + vi.mock('@/data/api/database/maintenance.api', () => ({ getMaintenances: vi.fn(() => [mockedMaintenanceTer]), applyMaintenance: vi.fn((maintenance) => maintenance), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -96,7 +97,7 @@ describe('Maintenance in settings page', () => { useTranslation: () => ({ t: (key: string) => key, }), - Trans: ({ children }: any) => children, + Trans: ({ children }: { children: ReactNode }) => children, })); }); @@ -140,7 +141,7 @@ describe('Maintenance in settings page', () => { }); it('disable apply maintenance button if capability is absent', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/ServiceConfiguration.component.tsx similarity index 89% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/ServiceConfiguration.component.tsx index b4e11cd0c1ee..980c65532bc0 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/ServiceConfiguration.component.tsx @@ -2,18 +2,17 @@ import { Pen } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { Table, TableBody, TableCell, TableRow } from '@/components/ui/table'; -import { useServiceData } from '../../layout'; +import { useServiceData } from '../../Service.context'; import { Button } from '@/components/ui/button'; import { useModale } from '@/hooks/useModale'; -import RenameService from '../../_components/renameService'; -import { - useGetServices, - useUpdateService, -} from '@/hooks/api/services.api.hooks'; +import RenameService from '../../_components/RenameService.component'; +import { useEditService } from '@/hooks/api/database/service/useEditService.hook'; +import { useGetServices } from '@/hooks/api/database/service/useGetServices.hook'; import { useToast } from '@/components/ui/use-toast'; -import TimeUpdate from './serviceConfiguration/timeUpdate'; -import DeleteService from '../../_components/deleteService'; -import { database } from '@/models/database'; +import TimeUpdate from './serviceConfiguration/TimeUpdate.component'; +import DeleteService from '../../_components/DeleteService.component'; +import * as database from '@/types/cloud/project/database'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; const ServiceConfiguration = () => { const { t } = useTranslation( @@ -27,12 +26,12 @@ const ServiceConfiguration = () => { enabled: false, }); const toast = useToast(); - const { updateService } = useUpdateService({ + const { editService } = useEditService({ onError: (err) => { toast.toast({ title: t('serviceConfigurationUpdateToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); }, onSuccess: () => { @@ -58,7 +57,7 @@ const ServiceConfiguration = () => { } const onMaintenanceTimeSubmit = (maintenanceTime: Date) => { - updateService({ + editService({ engine: service.engine, projectId, serviceId: service.id, @@ -70,7 +69,7 @@ const ServiceConfiguration = () => { }); }; const onBackupTimeSubmit = (backupTime: Date) => { - updateService({ + editService({ engine: service.engine, projectId, serviceId: service.id, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/serviceConfiguration.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/ServiceConfiguration.spec.tsx similarity index 90% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/serviceConfiguration.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/ServiceConfiguration.spec.tsx index dddb4dd7856b..e9fefd949585 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/serviceConfiguration.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/ServiceConfiguration.spec.tsx @@ -1,3 +1,4 @@ +import { ReactNode } from 'react'; import { describe, it, expect, vi, beforeEach } from 'vitest'; import { act, @@ -7,10 +8,10 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; -import * as serviceApi from '@/api/databases/service'; -import Settings from '@/pages/services/[serviceId]/settings'; -import { database } from '@/models/database'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; +import * as serviceApi from '@/data/api/database/service.api'; +import Settings from '@/pages/services/[serviceId]/settings/Settings.page'; +import * as database from '@/types/cloud/project/database'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedServiceInte, @@ -67,17 +68,17 @@ describe('Service configuration page', () => { }), })); - vi.mock('@/api/catalog', () => ({ + vi.mock('@/data/api/catalog/catalog.api', () => ({ catalogApi: { getCatalog: vi.fn(() => mockedCatalog), }, })); - vi.mock('@/api/databases/integrations', () => ({ + vi.mock('@/data/api/database/integration.api', () => ({ getServiceIntegrations: vi.fn(() => [mockedIntegrations]), })); - vi.mock('@/api/databases/availabilities', () => ({ + vi.mock('@/data/api/database/availability.api', () => ({ getCapabilities: vi.fn(() => mockedCapabilities), getEnginesCapabilities: vi.fn(() => [mockedEngineCapabilities]), getRegionsCapabilities: vi.fn(() => [mockedRegionCapabilities]), @@ -87,17 +88,17 @@ describe('Service configuration page', () => { ]), })); - vi.mock('@/api/databases/maintenances', () => ({ + vi.mock('@/data/api/database/maintenance.api', () => ({ getMaintenances: vi.fn(() => [mockedMaintenance]), })); - vi.mock('@/api/databases/service', () => ({ - updateService: vi.fn((service) => service), + vi.mock('@/data/api/database/service.api', () => ({ + editService: vi.fn((service) => service), deleteService: vi.fn(), getServices: vi.fn(() => [mockedServiceOrig, mockedServiceInte]), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -131,7 +132,7 @@ describe('Service configuration page', () => { useTranslation: () => ({ t: (key: string) => key, }), - Trans: ({ children }: any) => children, + Trans: ({ children }: { children: ReactNode }) => children, })); }); @@ -163,7 +164,7 @@ describe('Service configuration page', () => { }); it('renders and shows service configuration without button', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -192,7 +193,7 @@ describe('Service configuration page', () => { }); it('renders and shows service configuration with button disabled', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -239,7 +240,7 @@ describe('Service configuration page', () => { describe('Open modals', () => { beforeEach(async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: mockedService, category: 'operational', @@ -293,7 +294,7 @@ describe('Open modals', () => { expect( screen.queryByTestId('rename-service-modal'), ).not.toBeInTheDocument(); - expect(serviceApi.updateService).toHaveBeenCalled(); + expect(serviceApi.editService).toHaveBeenCalled(); }); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/updateTable.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/UpdateTable.component.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/updateTable.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/UpdateTable.component.tsx index 7bbd577cf3cb..71264cdef366 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/updateTable.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/UpdateTable.component.tsx @@ -3,23 +3,23 @@ import { useEffect, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Table, TableBody, TableCell, TableRow } from '@/components/ui/table'; import { humanizeEngine } from '@/lib/engineNameHelper'; -import { database } from '@/models/database'; -import { useServiceData } from '../../layout'; -import { - FullCapabilities, - useGetAvailabilities, - useGetFullCapabilities, -} from '@/hooks/api/availabilities.api.hooks'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '../../Service.context'; import { Button } from '@/components/ui/button'; import { formatStorage } from '@/lib/bytesHelper'; import { useModale } from '@/hooks/useModale'; -import UpdateVersion from '../update/_components/modals/updateVersion'; -import UpdatePlan from '../update/_components/modals/updatePlan'; -import UpdateFlavor from '../update/_components/modals/updateFlavor'; -import AddNode from '../update/_components/modals/addNode'; -import DeleteNode from '../update/_components/modals/removeNode'; -import { useGetCatalog } from '@/hooks/api/catalog.api.hooks'; +import UpdateVersion from '../update/_components/modals/UpdateVersion.component'; +import UpdatePlan from '../update/_components/modals/UpdatePlan.component'; +import UpdateFlavor from '../update/_components/modals/UpdateFlavor.component'; +import AddNode from '../update/_components/modals/AddNode.component'; +import DeleteNode from '../update/_components/modals/RemoveNode.component'; import { updateTags } from '@/lib/tagsHelper'; +import { useGetCatalog } from '@/hooks/api/catalog/useGetCatalog.hook'; +import { + FullCapabilities, + useGetFullCapabilities, +} from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; +import { useGetAvailabilities } from '@/hooks/api/database/availability/useGetAvailabilities.hook'; const UpdateTable = () => { const { t } = useTranslation( @@ -83,7 +83,7 @@ const UpdateTable = () => { } as FullCapabilities; }, [capabilitiesQuery.data, service]); - const suggestions: database.Suggestion[] = [ + const suggestions: database.availability.Suggestion[] = [ { default: true, engine: service.engine, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/updateTable.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/UpdateTable.spec.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/updateTable.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/UpdateTable.spec.tsx index 499bfbe7a0a1..0b4163da3be2 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/updateTable.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/UpdateTable.spec.tsx @@ -1,3 +1,4 @@ +import { ReactNode } from 'react'; import { describe, it, expect, vi, beforeEach } from 'vitest'; import { act, @@ -7,10 +8,10 @@ import { waitFor, } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; -import * as LayoutContext from '@/pages/services/[serviceId]/layout'; -import Settings from '@/pages/services/[serviceId]/settings'; -import { database } from '@/models/database'; -import * as nodesApi from '@/api/databases/nodes'; +import * as ServiceContext from '@/pages/services/[serviceId]/Service.context'; +import Settings from '@/pages/services/[serviceId]/settings/Settings.page'; +import * as database from '@/types/cloud/project/database'; +import * as nodesApi from '@/data/api/database/node.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { mockedService as mockedServiceOrig } from '@/__tests__/helpers/mocks/services'; import { mockedCatalog } from '@/__tests__/helpers/mocks/catalog'; @@ -68,42 +69,44 @@ describe('Update table in settings page', () => { }), })); - vi.mock('@/api/catalog', () => ({ + vi.mock('@/data/api/catalog/catalog.api', () => ({ catalogApi: { getCatalog: vi.fn(() => mockedCatalog), }, })); - vi.mock('@/api/databases/availabilities', () => ({ - getCapabilities: vi.fn(() => mockedCapabilities), - getEnginesCapabilities: vi.fn(() => [mockedEngineCapabilities]), - getRegionsCapabilities: vi.fn(() => [mockedRegionCapabilities]), + vi.mock('@/data/api/database/availability.api', () => ({ getAvailabilities: vi.fn(() => [ mockedAvailabilities, mockedAvailabilitiesUpdate, ]), })); + vi.mock('@/data/api/database/capabilities.api', () => ({ + getCapabilities: vi.fn(() => mockedCapabilities), + getEnginesCapabilities: vi.fn(() => [mockedEngineCapabilities]), + getRegionsCapabilities: vi.fn(() => [mockedRegionCapabilities]), + })); - vi.mock('@/api/databases/maintenances', () => ({ + vi.mock('@/data/api/database/maintenance.api', () => ({ getMaintenances: vi.fn(() => [mockedMaintenance]), applyMaintenance: vi.fn((maintenance) => maintenance), })); - vi.mock('@/api/databases/advancedConfiguration', () => ({ + vi.mock('@/data/api/database/advancedConfiguration.api', () => ({ getAdvancedConfiguration: vi.fn(() => mockAdvancedConfiguration), getAdvancedConfigurationCapabilities: vi.fn(() => mockCapabilities), })); - vi.mock('@/api/databases/service', () => ({ - updateService: vi.fn((service) => service), + vi.mock('@/data/api/database/service.api', () => ({ + editService: vi.fn((service) => service), })); - vi.mock('@/api/databases/nodes', () => ({ + vi.mock('@/data/api/database/node.api', () => ({ addNode: vi.fn((node) => node), deleteNode: vi.fn(), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -137,7 +140,7 @@ describe('Update table in settings page', () => { useTranslation: () => ({ t: (key: string) => key, }), - Trans: ({ children }: any) => children, + Trans: ({ children }: { children: ReactNode }) => children, })); }); @@ -178,7 +181,7 @@ describe('Update table in settings page', () => { it('renders and shows update table with button disabled', async () => { render(, { wrapper: RouterWithQueryClientWrapper }); - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -226,7 +229,7 @@ describe('Update table in settings page', () => { describe('Open modals', () => { beforeEach(async () => { window.HTMLElement.prototype.scrollIntoView = vi.fn(); - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: mockedService, category: 'operational', diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/advancedConfigurationForm.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/AdvancedConfigurationForm.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/advancedConfigurationForm.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/AdvancedConfigurationForm.component.tsx index 382c3fb8fdfc..d117dd8174cf 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/advancedConfigurationForm.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/AdvancedConfigurationForm.component.tsx @@ -8,11 +8,11 @@ import { } from 'lucide-react'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { AdvancedConfigurationProperty, useAdvancedConfigurationForm, -} from './advancedConfiguration.hook'; +} from './useAdvancedConfigurationForm.hook'; import { Form, FormControl, @@ -24,9 +24,8 @@ import { } from '@/components/ui/form'; import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'; import { Input } from '@/components/ui/input'; -import { useServiceData } from '../../../layout'; +import { useServiceData } from '../../../Service.context'; import { useToast } from '@/components/ui/use-toast'; -import { useUpdateAdvancedConfiguration } from '@/hooks/api/advancedConfiguration.api.hook'; import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area'; import { Button } from '@/components/ui/button'; import { @@ -48,6 +47,8 @@ import { AccordionItem, AccordionTrigger, } from '@/components/ui/accordion'; +import { useEditAdvancedConfiguration } from '@/hooks/api/database/advancedConfiguration/useEditAdvancedConfiguration.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface AdvancedConfigurationFormProps { advancedConfiguration: Record; @@ -72,12 +73,12 @@ const AdvancedConfigurationForm = ({ const { updateAdvancedConfiguration, isPending, - } = useUpdateAdvancedConfiguration({ + } = useEditAdvancedConfiguration({ onError: (error) => { toast.toast({ variant: 'destructive', title: t('advancedConfigurationUpdateErrorTitle'), - description: error.response.data.details.message, + description: getCdbApiErrorMessage(error), }); }, onSuccess: () => { diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/advancedConfiguration.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/useAdvancedConfigurationForm.hook.tsx similarity index 99% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/advancedConfiguration.hook.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/useAdvancedConfigurationForm.hook.tsx index 7dcdc9a49fb2..597d2ae853bb 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/advancedConfiguration.hook.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/advancedConfiguration/useAdvancedConfigurationForm.hook.tsx @@ -3,7 +3,7 @@ import { useMemo, useState } from 'react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { useTranslation } from 'react-i18next'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; export interface UseAdvancedConfigurationFormProps { initialValue: Record; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/timeUpdate.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/TimeUpdate.component.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/timeUpdate.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/TimeUpdate.component.tsx index 6e9529341cf0..0093826abb6e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/timeUpdate.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/TimeUpdate.component.tsx @@ -3,7 +3,7 @@ import { Check, Pen, X } from 'lucide-react'; import { useState } from 'react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; -import FormattedDate from '@/components/table-date'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; import { Button } from '@/components/ui/button'; import { Form, FormField } from '@/components/ui/form'; import { TableCell } from '@/components/ui/table'; diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/timeUpdate.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/TimeUpdate.spec.tsx similarity index 98% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/timeUpdate.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/TimeUpdate.spec.tsx index 409d95d2e116..366d6ae972f5 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/settings/timeUpdate.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/_components/serviceConfiguration/TimeUpdate.spec.tsx @@ -2,7 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { act } from 'react-dom/test-utils'; -import TimeUpdate from '@/pages/services/[serviceId]/settings/_components/serviceConfiguration/timeUpdate'; +import TimeUpdate from '@/pages/services/[serviceId]/settings/_components/serviceConfiguration/TimeUpdate.component'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { Locale } from '@/hooks/useLocale'; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/pricingDetails.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/PricingDetails.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/pricingDetails.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/PricingDetails.component.tsx index f6f8e9e340b4..47e062a3611c 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/pricingDetails.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/PricingDetails.component.tsx @@ -6,8 +6,8 @@ import { PopoverTrigger, } from '@/components/ui/popover'; import { ServicePricing } from '@/lib/pricingHelper'; -import { database } from '@/models/database'; -import Price from '@/components/price'; +import * as database from '@/types/cloud/project/database'; +import Price from '@/components/price/Price.component'; interface PrincingDetailsProps { service: database.Service; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/addNode.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/AddNode.component.tsx similarity index 88% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/addNode.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/AddNode.component.tsx index ea4c285b11bb..e48b6831808e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/addNode.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/AddNode.component.tsx @@ -1,7 +1,7 @@ import { useMemo, useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; -import Price from '@/components/price'; -import PriceUnitSwitch from '@/components/price-unit-switch'; +import Price from '@/components/price/Price.component'; +import PriceUnitSwitch from '@/components/price-unit-switch/PriceUnitSwitch.component'; import { Button } from '@/components/ui/button'; import { Dialog, @@ -13,12 +13,13 @@ import { } from '@/components/ui/dialog'; import { Label } from '@/components/ui/label'; import { useToast } from '@/components/ui/use-toast'; -import { useAddNode } from '@/hooks/api/nodes.api.hooks'; +import { useAddNode } from '@/hooks/api/database/node/useAddNode.hook'; import { ModalController } from '@/hooks/useModale'; import { Pricing } from '@/lib/pricingHelper'; -import { order } from '@/models/catalog'; -import { database } from '@/models/database'; -import { useServiceData } from '@/pages/services/[serviceId]/layout'; +import { order } from '@/types/catalog'; +import * as database from '@/types/cloud/project/database'; +import { useServiceData } from '@/pages/services/[serviceId]/Service.context'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface AddNodeProps { controller: ModalController; @@ -40,7 +41,7 @@ const AddNode = ({ controller, catalog, onSuccess, onError }: AddNodeProps) => { toast.toast({ title: t('addNodeToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/removeNode.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/RemoveNode.component.tsx similarity index 89% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/removeNode.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/RemoveNode.component.tsx index 65033117603e..d447191ec7d0 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/removeNode.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/RemoveNode.component.tsx @@ -1,7 +1,7 @@ import { useMemo, useState } from 'react'; import { Trans, useTranslation } from 'react-i18next'; -import Price from '@/components/price'; -import PriceUnitSwitch from '@/components/price-unit-switch'; +import Price from '@/components/price/Price.component'; +import PriceUnitSwitch from '@/components/price-unit-switch/PriceUnitSwitch.component'; import { Button } from '@/components/ui/button'; import { Dialog, @@ -13,11 +13,12 @@ import { } from '@/components/ui/dialog'; import { Label } from '@/components/ui/label'; import { useToast } from '@/components/ui/use-toast'; -import { useDeleteNode } from '@/hooks/api/nodes.api.hooks'; import { ModalController } from '@/hooks/useModale'; import { Pricing } from '@/lib/pricingHelper'; -import { order } from '@/models/catalog'; -import { useServiceData } from '@/pages/services/[serviceId]/layout'; +import { order } from '@/types/catalog'; +import { useServiceData } from '@/pages/services/[serviceId]/Service.context'; +import { useDeleteNode } from '@/hooks/api/database/node/useDeleteNode.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface DeleteNodeProps { controller: ModalController; @@ -44,7 +45,7 @@ const DeleteNode = ({ toast.toast({ title: t('deleteNodeToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/updateFlavor.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/UpdateFlavor.component.tsx similarity index 90% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/updateFlavor.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/UpdateFlavor.component.tsx index d7f2536dce76..d601cc9b3f25 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/updateFlavor.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/UpdateFlavor.component.tsx @@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { useTranslation } from 'react-i18next'; import { ArrowRight } from 'lucide-react'; -import FlavorsSelect from '@/components/Order/flavor/flavor-select'; +import FlavorsSelect from '@/components/order/flavor/FlavorSelect.component'; import { Button } from '@/components/ui/button'; import { Dialog, @@ -15,13 +15,13 @@ import { DialogTitle, } from '@/components/ui/dialog'; import { ScrollArea, ScrollBar } from '@/components/ui/scroll-area'; -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; import { ModalController } from '@/hooks/useModale'; import { createTree } from '@/lib/availabilitiesHelper'; -import { order } from '@/models/catalog'; -import { database } from '@/models/database'; -import { Engine, Version, Plan, Region } from '@/models/order-funnel'; -import { useServiceData } from '@/pages/services/[serviceId]/layout'; +import { order } from '@/types/catalog'; +import * as database from '@/types/cloud/project/database'; +import { Engine, Version, Plan, Region } from '@/types/orderFunnel'; +import { useServiceData } from '@/pages/services/[serviceId]/Service.context'; import { Form, FormControl, @@ -31,18 +31,19 @@ import { FormMessage, } from '@/components/ui/form'; import { useToast } from '@/components/ui/use-toast'; -import { useUpdateService } from '@/hooks/api/services.api.hooks'; -import Price from '@/components/price'; +import { useEditService } from '@/hooks/api/database/service/useEditService.hook'; +import Price from '@/components/price/Price.component'; import { computeServicePrice } from '@/lib/pricingHelper'; -import StorageConfig from '@/components/Order/cluster-config/storage-config'; +import StorageConfig from '@/components/order/cluster-configuration/StorageConfig.component'; import { formatStorage } from '@/lib/bytesHelper'; -import PriceUnitSwitch from '@/components/price-unit-switch'; +import PriceUnitSwitch from '@/components/price-unit-switch/PriceUnitSwitch.component'; import { Label } from '@/components/ui/label'; -import PricingDetails from '../pricingDetails'; +import PricingDetails from '../PricingDetails.component'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface UpdateFlavorProps { controller: ModalController; - suggestions: database.Suggestion[]; + suggestions: database.availability.Suggestion[]; availabilities: database.Availability[]; capabilities: FullCapabilities; catalog: order.publicOrder.Catalog; @@ -67,12 +68,12 @@ const UpdateFlavorContent = ({ ); const hasStorage = service.storage?.size.value > 0 && service.storage.size.unit === 'GB'; - const { updateService, isPending } = useUpdateService({ + const { editService, isPending } = useEditService({ onError: (err) => { toast.toast({ title: t('updateFlavorToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); @@ -180,7 +181,7 @@ const UpdateFlavorContent = ({ }, [flavorObject, selectedStorage]); const onSubmit = form.handleSubmit((formValues) => { - updateService({ + editService({ serviceId: service.id, projectId, engine: service.engine, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/updatePlan.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/UpdatePlan.component.tsx similarity index 90% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/updatePlan.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/UpdatePlan.component.tsx index e37d5d529f80..336e83fcc6c1 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/updatePlan.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/UpdatePlan.component.tsx @@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { useTranslation } from 'react-i18next'; import { ArrowRight } from 'lucide-react'; -import PlansSelect from '@/components/Order/plan/plan-select'; +import PlansSelect from '@/components/order/plan/PlanSelect.component'; import { Button } from '@/components/ui/button'; import { Dialog, @@ -14,13 +14,13 @@ import { DialogHeader, DialogTitle, } from '@/components/ui/dialog'; -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; import { ModalController } from '@/hooks/useModale'; import { createTree } from '@/lib/availabilitiesHelper'; -import { order } from '@/models/catalog'; -import { database } from '@/models/database'; -import { Engine, Version } from '@/models/order-funnel'; -import { useServiceData } from '@/pages/services/[serviceId]/layout'; +import { order } from '@/types/catalog'; +import * as database from '@/types/cloud/project/database'; +import { Engine, Version } from '@/types/orderFunnel'; +import { useServiceData } from '@/pages/services/[serviceId]/Service.context'; import { ScrollArea } from '@/components/ui/scroll-area'; import { Form, @@ -31,16 +31,17 @@ import { FormMessage, } from '@/components/ui/form'; import { useToast } from '@/components/ui/use-toast'; -import { useUpdateService } from '@/hooks/api/services.api.hooks'; +import { useEditService } from '@/hooks/api/database/service/useEditService.hook'; import { computeServicePrice } from '@/lib/pricingHelper'; -import Price from '@/components/price'; -import PriceUnitSwitch from '@/components/price-unit-switch'; +import Price from '@/components/price/Price.component'; +import PriceUnitSwitch from '@/components/price-unit-switch/PriceUnitSwitch.component'; import { Label } from '@/components/ui/label'; -import PricingDetails from '../pricingDetails'; +import PricingDetails from '../PricingDetails.component'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface UpdatePlanProps { controller: ModalController; - suggestions: database.Suggestion[]; + suggestions: database.availability.Suggestion[]; availabilities: database.Availability[]; capabilities: FullCapabilities; catalog: order.publicOrder.Catalog; @@ -64,12 +65,12 @@ const UpdatePlanContent = ({ const { t } = useTranslation( 'pci-databases-analytics/services/service/settings/update', ); - const { updateService, isPending } = useUpdateService({ + const { editService, isPending } = useEditService({ onError: (err) => { toast.toast({ title: t('updatePlanToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); @@ -139,7 +140,7 @@ const UpdatePlanContent = ({ flavor: flavor.name, }), }; - updateService({ + editService({ serviceId: service.id, projectId, engine: service.engine, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/updateVersion.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/UpdateVersion.component.tsx similarity index 86% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/updateVersion.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/UpdateVersion.component.tsx index 9859c4dcc210..55de625b0b19 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/updateVersion.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/settings/update/_components/modals/UpdateVersion.component.tsx @@ -3,7 +3,7 @@ import { z } from 'zod'; import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { useTranslation } from 'react-i18next'; -import VersionSelector from '@/components/Order/engine/engine-tile-version'; +import VersionSelector from '@/components/order/engine/EngineTileVersion.component'; import { Button } from '@/components/ui/button'; import { Dialog, @@ -13,13 +13,12 @@ import { DialogHeader, DialogTitle, } from '@/components/ui/dialog'; -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; import { ModalController } from '@/hooks/useModale'; import { createTree } from '@/lib/availabilitiesHelper'; -import { order } from '@/models/catalog'; -import { database } from '@/models/database'; -import { Engine } from '@/models/order-funnel'; -import { useServiceData } from '@/pages/services/[serviceId]/layout'; +import { order } from '@/types/catalog'; +import * as database from '@/types/cloud/project/database'; +import { Engine } from '@/types/orderFunnel'; +import { useServiceData } from '@/pages/services/[serviceId]/Service.context'; import { Form, FormControl, @@ -28,12 +27,14 @@ import { FormLabel, FormMessage, } from '@/components/ui/form'; -import { useUpdateService } from '@/hooks/api/services.api.hooks'; +import { useEditService } from '@/hooks/api/database/service/useEditService.hook'; import { useToast } from '@/components/ui/use-toast'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface UpdateVersionProps { controller: ModalController; - suggestions: database.Suggestion[]; + suggestions: database.availability.Suggestion[]; availabilities: database.Availability[]; capabilities: FullCapabilities; catalog: order.publicOrder.Catalog; @@ -55,12 +56,12 @@ const UpdateVersionContent = ({ const { t } = useTranslation( 'pci-databases-analytics/services/service/settings/update', ); - const { updateService, isPending } = useUpdateService({ + const { editService, isPending } = useEditService({ onError: (err) => { toast.toast({ title: t('updateVersionToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); @@ -104,7 +105,7 @@ const UpdateVersionContent = ({ }, }); const onSubmit = form.handleSubmit((formValues) => { - updateService({ + editService({ serviceId: service.id, projectId, engine: service.engine, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/Users.page.tsx similarity index 83% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/Users.page.tsx index 55fa4a434602..9b2de61e58e6 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/Users.page.tsx @@ -1,20 +1,20 @@ import { ColumnDef } from '@tanstack/react-table'; import { useTranslation } from 'react-i18next'; import { Plus } from 'lucide-react'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; -import { useServiceData } from '../layout'; -import { useGetUsers } from '@/hooks/api/users.api.hooks'; -import { GenericUser } from '@/api/databases/users'; -import { database } from '@/models/database'; -import { getColumns } from './_components/usersTableColumns'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import { useServiceData } from '../Service.context'; +import { useGetUsers } from '@/hooks/api/database/user/useGetUsers.hook'; +import { GenericUser } from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; +import { getColumns } from './_components/UsersTableColumns.component'; import { Button } from '@/components/ui/button'; import { DataTable } from '@/components/ui/data-table'; import { useModale } from '@/hooks/useModale'; -import DeleteUser from './_components/deleteUser'; -import ResetUserPassword from './_components/resetUserPassword'; -import { POLLING } from '@/configuration/polling'; -import AddEditUserModal from './_components/addEditUser'; -import { useUserActivityContext } from '@/contexts/userActivityContext'; +import DeleteUser from './_components/DeleteUser.component'; +import ResetUserPassword from './_components/ResetUserPassword.component'; +import { useUserActivityContext } from '@/contexts/UserActivityContext'; +import { POLLING } from '@/configuration/polling.constants'; +import AddEditUserModal from './_components/AddEditUser.component'; export function breadcrumb() { return ( @@ -96,6 +96,7 @@ const Users = () => { )} { t: (key: string) => key, }), })); - vi.mock('@/api/databases/users', () => ({ + vi.mock('@/data/api/database/user.api', () => ({ getUsers: vi.fn(() => [mockedDatabaseUser]), addUser: vi.fn((user) => user), deleteUser: vi.fn(), @@ -51,7 +51,7 @@ describe('Users page', () => { getRoles: vi.fn(() => []), editUser: vi.fn((user) => user), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, @@ -111,7 +111,7 @@ describe('Users page', () => { }); }); it('renders redis columns', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -138,7 +138,7 @@ describe('Users page', () => { }); }); it('renders group column for m3db', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValue({ + vi.mocked(ServiceContext.useServiceData).mockReturnValue({ projectId: 'projectId', service: { ...mockedService, @@ -159,7 +159,7 @@ describe('Users page', () => { }); }); it('displays add user button if capability is present', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, @@ -176,7 +176,7 @@ describe('Users page', () => { expect(screen.queryByTestId('users-add-button')).toBeInTheDocument(); }); it('does not display add user button if capability is absent', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, @@ -189,7 +189,7 @@ describe('Users page', () => { expect(screen.queryByTestId('users-add-button')).toBeNull(); }); it('disable add user button if capability is disabled', async () => { - vi.mocked(LayoutContext.useServiceData).mockReturnValueOnce({ + vi.mocked(ServiceContext.useServiceData).mockReturnValueOnce({ projectId: 'projectId', service: { ...mockedService, @@ -305,7 +305,7 @@ describe('Open modals', () => { }); it('refetch data on delete user success', async () => { const mockedServiceData = vi - .mocked(LayoutContext.useServiceData) + .mocked(ServiceContext.useServiceData) .getMockImplementation(); mockedServiceData().serviceQuery.refetch = vi.fn(); await openButtonInMenu('user-action-delete-button'); @@ -343,7 +343,7 @@ describe('Open modals', () => { }); it('refetch data on edit user success', async () => { const mockedServiceData = vi - .mocked(LayoutContext.useServiceData) + .mocked(ServiceContext.useServiceData) .getMockImplementation(); mockedServiceData().serviceQuery.refetch = vi.fn(); await openButtonInMenu('user-action-edit-button'); @@ -369,7 +369,7 @@ describe('Open modals', () => { }); it('closes reset password user modal', async () => { const mockedServiceData = vi - .mocked(LayoutContext.useServiceData) + .mocked(ServiceContext.useServiceData) .getMockImplementation(); mockedServiceData().serviceQuery.refetch = vi.fn(); await openButtonInMenu('user-action-reset-password-button'); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/addEditUser.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/AddEditUser.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/addEditUser.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/AddEditUser.component.tsx index 96ea6f3dde8c..70e23f03bc3e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/addEditUser.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/AddEditUser.component.tsx @@ -12,8 +12,12 @@ import { DialogTitle, } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; -import { GenericUser, UserCreation, UserEdition } from '@/api/databases/users'; -import { database } from '@/models/database'; +import { + GenericUser, + UserCreation, + UserEdition, +} from '@/data/api/database/user.api'; +import * as database from '@/types/cloud/project/database'; import { Form, FormControl, @@ -23,17 +27,18 @@ import { FormMessage, } from '@/components/ui/form'; -import TagsInput from '@/components/tags-input'; +import TagsInput from '@/components/tags-input/TagsInput.component'; import { ModalController } from '@/hooks/useModale'; import { - MutateUserProps, + UseAddUser, useAddUser, - useEditUser, -} from '@/hooks/api/users.api.hooks'; +} from '@/hooks/api/database/user/useAddUser.hook'; +import { useEditUser } from '@/hooks/api/database/user/useEditUser.hook'; import { useToast } from '@/components/ui/use-toast'; -import { useUserForm } from './formUser/formUser.hook'; -import RolesSelect from './formUser/rolesSelect'; -import { useServiceData } from '../../layout'; +import { useUserForm } from './formUser/useUserForm.hook'; +import RolesSelect from './formUser/RolesSelect.component'; +import { useServiceData } from '../../Service.context'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface AddEditUserModalProps { isEdition: boolean; @@ -71,12 +76,12 @@ const AddEditUserModal = ({ const toast = useToast(); const prefix = isEdition ? 'edit' : 'add'; - const UserMutationProps: MutateUserProps = { + const UserMutationProps: UseAddUser = { onError: (err) => { toast.toast({ title: t(`${prefix}UserToastErrorTitle`), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/addUser.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/AddUser.spec.tsx similarity index 98% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/addUser.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/AddUser.spec.tsx index 486e726d7794..a2345297939e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/addUser.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/AddUser.spec.tsx @@ -8,12 +8,12 @@ import { } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; import { act } from 'react-dom/test-utils'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as usersApi from '@/api/databases/users'; +import * as usersApi from '@/data/api/database/user.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { useToast } from '@/components/ui/use-toast'; -import AddEditUserModal from '@/pages/services/[serviceId]/users/_components/addEditUser'; +import AddEditUserModal from '@/pages/services/[serviceId]/users/_components/AddEditUser.component'; import { mockedService } from '@/__tests__/helpers/mocks/services'; import { mockedDatabaseUser, @@ -28,7 +28,7 @@ describe('Add user modal', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/users', () => ({ + vi.mock('@/data/api/database/user.api', () => ({ getUsers: vi.fn(() => [mockedDatabaseUser]), addUser: vi.fn((user) => user), deleteUser: vi.fn(), @@ -36,7 +36,7 @@ describe('Add user modal', () => { getRoles: vi.fn(() => mockedUserRoles), editUser: vi.fn(), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/deleteUser.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/DeleteUser.component.tsx similarity index 89% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/deleteUser.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/DeleteUser.component.tsx index b881a5179997..978e1b6c60fc 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/deleteUser.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/DeleteUser.component.tsx @@ -12,9 +12,10 @@ import { } from '@/components/ui/dialog'; import { ModalController } from '@/hooks/useModale'; import { useToast } from '@/components/ui/use-toast'; -import { database } from '@/models/database'; -import { GenericUser } from '@/api/databases/users'; -import { useDeleteUser } from '@/hooks/api/users.api.hooks'; +import * as database from '@/types/cloud/project/database'; +import { GenericUser } from '@/data/api/database/user.api'; +import { useDeleteUser } from '@/hooks/api/database/user/useDeleteUser.hook'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface DeleteUserModalProps { service: database.Service; @@ -41,7 +42,7 @@ const DeleteUser = ({ toast.toast({ title: t('deleteUserToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/deleteUser.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/DeleteUser.spec.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/deleteUser.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/DeleteUser.spec.tsx index 085936090e83..49a2e108f5a3 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/deleteUser.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/DeleteUser.spec.tsx @@ -2,11 +2,11 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, waitFor, fireEvent } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; import { act } from 'react-dom/test-utils'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as usersApi from '@/api/databases/users'; +import * as usersApi from '@/data/api/database/user.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; -import DeleteUser from '@/pages/services/[serviceId]/users/_components/deleteUser'; +import DeleteUser from '@/pages/services/[serviceId]/users/_components/DeleteUser.component'; import { useToast } from '@/components/ui/use-toast'; import { mockedService } from '@/__tests__/helpers/mocks/services'; import { mockedDatabaseUser } from '@/__tests__/helpers/mocks/databaseUser'; @@ -19,7 +19,7 @@ describe('Delete user modal', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/users', () => ({ + vi.mock('@/data/api/database/user.api', () => ({ getUsers: vi.fn(() => [mockedDatabaseUser]), addUser: vi.fn(), deleteUser: vi.fn(), @@ -28,7 +28,7 @@ describe('Delete user modal', () => { editUser: vi.fn(), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/resetPassword.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/ResetPassword.spec.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/resetPassword.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/ResetPassword.spec.tsx index 89a7c0bbe549..585c8fa91f6a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/resetPassword.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/ResetPassword.spec.tsx @@ -2,12 +2,12 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, waitFor, fireEvent } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; import { act } from 'react-dom/test-utils'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as usersApi from '@/api/databases/users'; +import * as usersApi from '@/data/api/database/user.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { useToast } from '@/components/ui/use-toast'; -import ResetUserPassword from '@/pages/services/[serviceId]/users/_components/resetUserPassword'; +import ResetUserPassword from '@/pages/services/[serviceId]/users/_components/ResetUserPassword.component'; import { mockedService } from '@/__tests__/helpers/mocks/services'; import { mockedDatabaseUser, @@ -22,7 +22,7 @@ describe('Reset user password modal', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/users', () => ({ + vi.mock('@/data/api/database/user.api', () => ({ getUsers: vi.fn(() => [mockedDatabaseUser]), addUser: vi.fn(), deleteUser: vi.fn(), @@ -31,7 +31,7 @@ describe('Reset user password modal', () => { editUser: vi.fn(), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/resetUserPassword.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/ResetUserPassword.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/resetUserPassword.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/ResetUserPassword.component.tsx index 33e162ebf77a..ed69ab9439fd 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/resetUserPassword.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/ResetUserPassword.component.tsx @@ -14,10 +14,11 @@ import { } from '@/components/ui/dialog'; import { ModalController } from '@/hooks/useModale'; import { useToast } from '@/components/ui/use-toast'; -import { database } from '@/models/database'; -import { GenericUser } from '@/api/databases/users'; -import { useResetUserPassword } from '@/hooks/api/users.api.hooks'; +import * as database from '@/types/cloud/project/database'; +import { GenericUser } from '@/data/api/database/user.api'; +import { useResetUserPassword } from '@/hooks/api/database/user/useResetUserPassword.hook'; import { Alert } from '@/components/ui/alert'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface ResetUserPasswordModalProps { service: database.Service; @@ -48,7 +49,7 @@ const ResetUserPassword = ({ toast.toast({ title: t('resetUserPasswordToastErrorTitle'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); if (onError) { onError(err); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/updateUser.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UpdateUser.spec.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/updateUser.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UpdateUser.spec.tsx index 88c609d92f52..7288a17eae6e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/service/users/updateUser.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UpdateUser.spec.tsx @@ -2,15 +2,15 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, waitFor, fireEvent } from '@testing-library/react'; import { UseQueryResult } from '@tanstack/react-query'; import { act } from 'react-dom/test-utils'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Locale } from '@/hooks/useLocale'; -import * as usersApi from '@/api/databases/users'; +import * as usersApi from '@/data/api/database/user.api'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; import { useToast } from '@/components/ui/use-toast'; import { mockedService } from '@/__tests__/helpers/mocks/services'; import { mockedDatabaseUser } from '@/__tests__/helpers/mocks/databaseUser'; import { apiErrorMock } from '@/__tests__/helpers/mocks/cdbError'; -import AddEditUserModal from '@/pages/services/[serviceId]/users/_components/addEditUser'; +import AddEditUserModal from '@/pages/services/[serviceId]/users/_components/AddEditUser.component'; describe('Edit user modal', () => { beforeEach(() => { @@ -20,7 +20,7 @@ describe('Edit user modal', () => { t: (key: string) => key, }), })); - vi.mock('@/api/databases/users', () => ({ + vi.mock('@/data/api/database/user.api', () => ({ getUsers: vi.fn(() => [mockedDatabaseUser]), addUser: vi.fn(), deleteUser: vi.fn(), @@ -29,7 +29,7 @@ describe('Edit user modal', () => { editUser: vi.fn((user) => user), })); - vi.mock('@/pages/services/[serviceId]/layout', () => ({ + vi.mock('@/pages/services/[serviceId]/Service.context', () => ({ useServiceData: vi.fn(() => ({ projectId: 'projectId', service: mockedService, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/userStatusBadge.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UserStatusBadge.component.tsx similarity index 92% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/userStatusBadge.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UserStatusBadge.component.tsx index 56ce230c3adb..a8f43d81e16e 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/userStatusBadge.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UserStatusBadge.component.tsx @@ -1,5 +1,5 @@ import { Badge, badgeVariants } from '@/components/ui/badge'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; const UserStatusBadge = ({ status }: { status: database.StatusEnum }) => { let variant; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/usersTableActions.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UsersTableActions.component.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/usersTableActions.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UsersTableActions.component.tsx index 8137aba98ce7..36addacfaac7 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/usersTableActions.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UsersTableActions.component.tsx @@ -9,9 +9,9 @@ import { DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { Button } from '@/components/ui/button'; -import { GenericUser } from '@/api/databases/users'; -import { useServiceData } from '../../layout'; -import { database } from '@/models/database'; +import { GenericUser } from '@/data/api/database/user.api'; +import { useServiceData } from '../../Service.context'; +import * as database from '@/types/cloud/project/database'; interface UserActionsProps { user: GenericUser; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/usersTableColumns.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UsersTableColumns.component.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/usersTableColumns.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UsersTableColumns.component.tsx index 9fefb88b1735..45da0a54d588 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/usersTableColumns.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/UsersTableColumns.component.tsx @@ -1,11 +1,11 @@ import { ColumnDef } from '@tanstack/react-table'; import { useTranslation } from 'react-i18next'; import { Badge } from '@/components/ui/badge'; -import FormattedDate from '@/components/table-date'; -import { GenericUser } from '@/api/databases/users'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; +import { GenericUser } from '@/data/api/database/user.api'; import { SortableHeader } from '@/components/ui/data-table'; -import UserStatusBadge from './userStatusBadge'; -import UserActions from './usersTableActions'; +import UserStatusBadge from './UserStatusBadge.component'; +import UserActions from './UsersTableActions.component'; interface UserListColumnsProps { displayGroupCol: boolean; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/rolesSelect.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/RolesSelect.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/rolesSelect.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/RolesSelect.component.tsx index 718041bec749..e0a688489d5d 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/rolesSelect.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/RolesSelect.component.tsx @@ -22,12 +22,12 @@ import { FormItem, FormMessage, } from '@/components/ui/form'; -import { useRolesSelectForm } from './rolesSelect.hook'; -import { USER_CONFIG } from './user.const'; -import { useGetRoles } from '@/hooks/api/users.api.hooks'; -import { useServiceData } from '../../../layout'; +import { useRolesSelectForm } from './useRolesSelectForm.hook'; +import { USER_CONFIG } from './user.constants'; +import { useGetRoles } from '@/hooks/api/database/user/useGetRoles.hook'; +import { useServiceData } from '../../../Service.context'; import { Skeleton } from '@/components/ui/skeleton'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; interface RoleSelectProps { value: string[] | undefined; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/rolesSelect.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/useRolesSelectForm.hook.tsx similarity index 97% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/rolesSelect.hook.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/useRolesSelectForm.hook.tsx index 8e5dccfee9a3..200c88757409 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/rolesSelect.hook.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/useRolesSelectForm.hook.tsx @@ -3,7 +3,7 @@ import { useEffect } from 'react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { useTranslation } from 'react-i18next'; -import { USER_CONFIG } from './user.const'; +import { USER_CONFIG } from './user.constants'; interface UseRolesSelectFormProps { existingRoles: string[]; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/formUser.hook.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/useUserForm.hook.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/formUser.hook.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/useUserForm.hook.tsx index 1314e3d30afa..044fdc073dab 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/formUser.hook.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/useUserForm.hook.tsx @@ -4,9 +4,9 @@ import { zodResolver } from '@hookform/resolvers/zod'; import { useTranslation } from 'react-i18next'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; -import { USER_CONFIG } from './user.const'; -import { database } from '@/models/database'; -import { GenericUser } from '@/api/databases/users'; +import { USER_CONFIG } from './user.constants'; +import * as database from '@/types/cloud/project/database'; +import { GenericUser } from '@/data/api/database/user.api'; export interface UseUserFormProps { service: database.Service; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/user.const.ts b/packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/user.constants.ts similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/user.const.ts rename to packages/manager/apps/pci-databases-analytics/src/pages/services/[serviceId]/users/_components/formUser/user.constants.ts diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/onboarding.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/Onboarding.component.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/_components/onboarding.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/_components/Onboarding.component.tsx index 11393b6d05b2..3c1d15402b8f 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/onboarding.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/Onboarding.component.tsx @@ -1,12 +1,12 @@ import { useTranslation } from 'react-i18next'; -import onboardingImgSrc from '../../../public/assets/onboarding-image.png'; -import Guides from '@/components/guides'; -import { GuideSections } from '@/models/guide'; +import onboardingImgSrc from '@/../public/assets/onboarding-image.png'; +import Guides from '@/components/guides/Guides.component'; +import { GuideSections } from '@/types/guide'; import { Button } from '@/components/ui/button'; -import { Link } from '@/components/links'; +import Link from '@/components/links/Link.component'; import { useTrackPage, useTrackAction } from '@/hooks/useTracking'; -import { TRACKING } from '@/configuration/tracking'; -import OnboardingTile from './onboardingTile'; +import { TRACKING } from '@/configuration/tracking.constants'; +import OnboardingTile from './OnboardingTile.component'; const Onboarding = () => { const { t } = useTranslation('pci-databases-analytics/services/onboarding'); diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/onboarding.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/Onboarding.spec.tsx similarity index 93% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/onboarding.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/_components/Onboarding.spec.tsx index 578e2d237d60..256ae5fd6acf 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/onboarding.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/Onboarding.spec.tsx @@ -1,7 +1,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen, waitFor } from '@testing-library/react'; -import Onboarding from '@/pages/services/_components/onboarding'; +import Onboarding from '@/pages/services/_components/Onboarding.component'; import { Locale } from '@/hooks/useLocale'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; @@ -43,7 +43,7 @@ describe('Onboarding page', () => { })); vi.stubGlobal('ResizeObserver', ResizeObserverMock); - vi.mock('@/api/databases/guides', () => ({ + vi.mock('@/data/api/guides/guides.api', () => ({ getGuides: vi.fn(() => [mockedGuide, mockedGuideOnboarding]), })); }); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/onboardingTile.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/OnboardingTile.component.tsx similarity index 95% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/_components/onboardingTile.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/_components/OnboardingTile.component.tsx index 5fad21b1b772..2b046701e3a7 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/onboardingTile.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/OnboardingTile.component.tsx @@ -1,5 +1,5 @@ import { ExternalLink } from 'lucide-react'; -import { A } from '@/components/links'; +import A from '@/components/links/A.component'; import { Card, CardContent, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/serviceListColumns.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/ServiceListColumns.component.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/_components/serviceListColumns.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/_components/ServiceListColumns.component.tsx index c941c8cba7c7..627296e18944 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/serviceListColumns.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/ServiceListColumns.component.tsx @@ -3,9 +3,9 @@ import { MoreHorizontal } from 'lucide-react'; import { toast } from 'sonner'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Button } from '@/components/ui/button'; -import ServiceStatusBadge from './serviceStatusBadge'; +import ServiceStatusBadge from './ServiceStatusBadge.component'; import { DropdownMenu, DropdownMenuContent, @@ -15,11 +15,11 @@ import { DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { SortableHeader } from '@/components/ui/data-table'; -import FormattedDate from '@/components/table-date'; +import FormattedDate from '@/components/formatted-date/FormattedDate.component'; import { humanizeEngine } from '@/lib/engineNameHelper'; -import { Link } from '@/components/links'; +import Link from '@/components/links/Link.component'; import { useTrackAction } from '@/hooks/useTracking'; -import { TRACKING } from '@/configuration/tracking'; +import { TRACKING } from '@/configuration/tracking.constants'; interface ServiceListColumnsProps { onRenameClicked: (service: database.Service) => void; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/serviceListTable.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/ServiceListTable.component.tsx similarity index 87% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/_components/serviceListTable.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/_components/ServiceListTable.component.tsx index 51d9861d2d16..332ac43b1724 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/serviceListTable.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/ServiceListTable.component.tsx @@ -1,14 +1,14 @@ import { useMemo } from 'react'; import { ColumnDef } from '@tanstack/react-table'; import { DataTable } from '@/components/ui/data-table'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Skeleton } from '@/components/ui/skeleton'; -import { getColumns } from './serviceListColumns'; +import { getColumns } from './ServiceListColumns.component'; import { useModale } from '@/hooks/useModale'; -import RenameService from '../[serviceId]/_components/renameService'; -import DeleteService from '../[serviceId]/_components/deleteService'; +import RenameService from '../[serviceId]/_components/RenameService.component'; +import DeleteService from '../[serviceId]/_components/DeleteService.component'; import { useTrackAction } from '@/hooks/useTracking'; -import { TRACKING } from '@/configuration/tracking'; +import { TRACKING } from '@/configuration/tracking.constants'; interface ServicesListProps { services: database.Service[]; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/serviceStatusBadge.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/ServiceStatusBadge.component.tsx similarity index 94% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/_components/serviceStatusBadge.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/_components/ServiceStatusBadge.component.tsx index a059523757c4..99caa7f39daf 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/serviceStatusBadge.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/_components/ServiceStatusBadge.component.tsx @@ -1,6 +1,6 @@ import { useTranslation } from 'react-i18next'; import { Badge, badgeVariants } from '@/components/ui/badge'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; const ServiceStatusBadge = ({ status, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/create/index.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/Create.page.tsx similarity index 79% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/create/index.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/create/Create.page.tsx index 1ee1ce581b8e..165b0543dcd6 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/create/index.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/Create.page.tsx @@ -1,19 +1,17 @@ import { useSearchParams, useParams } from 'react-router-dom'; import { Trans, useTranslation } from 'react-i18next'; import { Skeleton } from '@/components/ui/skeleton'; -import { - useGetAvailabilities, - useGetFullCapabilities, - useGetSuggestions, -} from '@/hooks/api/availabilities.api.hooks'; -import { useGetCatalog } from '@/hooks/api/catalog.api.hooks'; -import LegalMentions from '@/pages/_components/legalMentions'; -import OrderFunnel from './_components/order-funnel'; -import { database } from '@/models/database'; -import BreadcrumbItem from '@/components/Breadcrumb/BreadcrumbItem'; -import { OvhLink } from '@/components/links'; -import Guides from '@/components/guides'; -import { GuideSections } from '@/models/guide'; +import LegalMentions from '@/pages/_components/LegalMentions.component'; +import OrderFunnel from './_components/OrderFunnel.component'; +import * as database from '@/types/cloud/project/database'; +import BreadcrumbItem from '@/components/breadcrumb/BreadcrumbItem.component'; +import OvhLink from '@/components/links/OvhLink.component'; +import Guides from '@/components/guides/Guides.component'; +import { GuideSections } from '@/types/guide'; +import { useGetAvailabilities } from '@/hooks/api/database/availability/useGetAvailabilities.hook'; +import { useGetSuggestions } from '@/hooks/api/database/availability/useGetSuggestions.hook'; +import { useGetFullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; +import { useGetCatalog } from '@/hooks/api/catalog/useGetCatalog.hook'; export function breadcrumb() { return ( @@ -107,7 +105,7 @@ const Service = () => { ) : ( - category === database.CategoryEnum.all + category === database.engine.CategoryEnum.all ? a : a.category === category, )} diff --git a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/create/create.test.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/Create.spec.tsx similarity index 91% rename from packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/create/create.test.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/create/Create.spec.tsx index 1a9ba3e4e5f5..f46e7820ffe2 100644 --- a/packages/manager/apps/pci-databases-analytics/src/__tests__/pages/services/create/create.test.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/Create.spec.tsx @@ -9,9 +9,9 @@ import { import Service, { breadcrumb as Breadcrumb, -} from '@/pages/services/create/index'; +} from '@/pages/services/create/Create.page'; -import OrderSummary from '@/pages/services/create/_components/order-summary'; +import OrderSummary from '@/pages/services/create/_components/OrderSummary.component'; import { Locale } from '@/hooks/useLocale'; import { RouterWithQueryClientWrapper } from '@/__tests__/helpers/wrappers/RouterWithQueryClientWrapper'; @@ -24,7 +24,7 @@ import { } from '@/__tests__/helpers/mocks/availabilities'; import { mockedUser } from '@/__tests__/helpers/mocks/user'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { mockedCatalog } from '@/__tests__/helpers/mocks/catalog'; import { mockedBasicOrderFunnelFlavor, @@ -37,13 +37,13 @@ import { NetworkRegionStatusEnum, NetworkStatusEnum, NetworkTypeEnum, -} from '@/models/network'; +} from '@/types/cloud/network'; import { mockedPciProject } from '@/__tests__/helpers/mocks/pciProjects'; -import * as ProjectAPI from '@/api/projects'; -import { PciProjectPlanCode } from '@/models/project'; -import * as ServiceAPI from '@/api/databases/service'; +import * as ProjectAPI from '@/data/api/project/project.api'; +import * as ServiceAPI from '@/data/api/database/service.api'; import { apiErrorMock } from '@/__tests__/helpers/mocks/cdbError'; import { useToast } from '@/components/ui/use-toast'; +import { PlanCode } from '@/types/cloud/Project'; const mockedOrder = { engine: mockedOrderFunnelEngine, @@ -124,32 +124,35 @@ describe('Order funnel page', () => { ...mod, useParams: () => ({ projectId: 'projectId', - category: database.CategoryEnum.all, + category: database.engine.CategoryEnum.all, }), }; }); - vi.mock('@/api/projects', () => { + vi.mock('@/data/api/project/project.api', () => { return { getProject: vi.fn(() => mockedPciProject), }; }); - vi.mock('@/api/databases/availabilities', () => ({ + vi.mock('@/data/api/database/availability.api', () => ({ getAvailabilities: vi.fn(() => [mockedAvailabilities]), getSuggestions: vi.fn(() => [mockedSuggestions]), + })); + + vi.mock('@/data/api/database/capabilities.api', () => ({ getEnginesCapabilities: vi.fn(() => [mockedEngineCapabilities]), getRegionsCapabilities: vi.fn(() => [mockedRegionCapabilities]), getCapabilities: vi.fn(() => mockedCapabilities), })); - vi.mock('@/api/catalog', () => ({ + vi.mock('@/data/api/catalog/catalog.api', () => ({ catalogApi: { getCatalog: vi.fn(() => mockedCatalog), }, })); - vi.mock('@/api/databases/service', () => ({ + vi.mock('@/data/api/database/service.api', () => ({ addService: vi.fn((service) => service), })); @@ -240,7 +243,7 @@ describe('Order funnel page', () => { it('renders Service with discovery banner', async () => { const mockedDiscoveryProject = { ...mockedPciProject, - planCode: PciProjectPlanCode.DISCOVERY, + planCode: PlanCode.DISCOVERY, }; vi.mocked(ProjectAPI.getProject).mockResolvedValue(mockedDiscoveryProject); render(, { wrapper: RouterWithQueryClientWrapper }); diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/order-funnel.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/OrderFunnel.component.tsx similarity index 89% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/order-funnel.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/OrderFunnel.component.tsx index fa98dfa16a8e..8b55338a7627 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/order-funnel.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/OrderFunnel.component.tsx @@ -2,9 +2,9 @@ import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { AlertCircle, ArrowRight } from 'lucide-react'; -import { useOrderFunnel } from './useOrderFunnel'; -import { order } from '@/models/catalog'; -import { database } from '@/models/database'; +import { useOrderFunnel } from './useOrderFunnel.hook'; +import { order } from '@/types/catalog'; +import * as database from '@/types/cloud/project/database'; import { Button } from '@/components/ui/button'; import { Card, @@ -14,8 +14,8 @@ import { CardTitle, } from '@/components/ui/card'; import { useToast } from '@/components/ui/use-toast'; -import StorageConfig from '@/components/Order/cluster-config/storage-config'; -import NodesConfig from '@/components/Order/cluster-config/nodes-config'; +import StorageConfig from '@/components/order/cluster-configuration/StorageConfig.component'; +import NodesConfig from '@/components/order/cluster-configuration/NodesConfig.component'; import { Form, FormControl, @@ -28,27 +28,28 @@ import { cn } from '@/lib/utils'; import { ServiceCreationWithEngine, useAddService, -} from '@/hooks/api/services.api.hooks'; -import PriceUnitSwitch from '@/components/price-unit-switch'; -import EnginesSelect from '@/components/Order/engine/engine-select'; -import PlansSelect from '@/components/Order/plan/plan-select'; -import FlavorsSelect from '@/components/Order/flavor/flavor-select'; -import NetworkOptions from '@/components/Order/cluster-options/network-options'; -import IpsRestrictionsForm from '@/components/Order/cluster-options/ips-restrictions-form'; -import RegionsSelect from '@/components/Order/region/region-select'; -import OrderPrice from '@/components/Order/order-price'; -import OrderSummary from './order-summary'; -import ErrorList from '@/components/Order/error-list'; -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; -import usePciProject from '@/hooks/api/pciProjects.api.hooks'; -import { PciProjectPlanCode } from '@/models/project'; +} from '@/hooks/api/database/service/useAddService.hook'; +import PriceUnitSwitch from '@/components/price-unit-switch/PriceUnitSwitch.component'; +import EnginesSelect from '@/components/order/engine/EngineSelect.component'; +import PlansSelect from '@/components/order/plan/PlanSelect.component'; +import FlavorsSelect from '@/components/order/flavor/FlavorSelect.component'; +import NetworkOptions from '@/components/order/cluster-options/NetworkOptions.components'; +import IpsRestrictionsForm from '@/components/order/cluster-options/IpsRestrictionsForm.component'; +import RegionsSelect from '@/components/order/region/RegionSelect.component'; +import OrderPrice from '@/components/order/price/OrderPrice.component'; +import OrderSummary from './OrderSummary.component'; +import ErrorList from '@/components/order/error-list/ErrorList.component'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; +import usePciProject from '@/hooks/api/project/usePciProject.hook'; import { Alert, AlertDescription } from '@/components/ui/alert'; -import { Link, OvhLink } from '@/components/links'; +import OvhLink from '@/components/links/OvhLink.component'; +import { PlanCode } from '@/types/cloud/Project'; +import { getCdbApiErrorMessage } from '@/lib/apiHelper'; interface OrderFunnelProps { availabilities: database.Availability[]; capabilities: FullCapabilities; - suggestions: database.Suggestion[]; + suggestions: database.availability.Suggestion[]; catalog: order.publicOrder.Catalog; } @@ -74,7 +75,7 @@ const OrderFunnel = ({ toast({ title: t('errorCreatingService'), variant: 'destructive', - description: err.response.data.message, + description: getCdbApiErrorMessage(err), }); }, onSuccess: (service) => { @@ -86,7 +87,7 @@ const OrderFunnel = ({ }); const isProjectDiscoveryMode = - projectData.data?.planCode === PciProjectPlanCode.DISCOVERY; + projectData.data?.planCode === PlanCode.DISCOVERY; const hasNodeSelection = model.result.plan && model.result.plan.nodes.minimum !== model.result.plan.nodes.maximum; diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/order-summary.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/OrderSummary.component.tsx similarity index 98% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/order-summary.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/OrderSummary.component.tsx index 6da8543bcbed..71b8ce3c2bd6 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/order-summary.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/OrderSummary.component.tsx @@ -10,11 +10,11 @@ import { MemoryStick, } from 'lucide-react'; import { humanizeEngine } from '@/lib/engineNameHelper'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { addStorage, formatStorage } from '@/lib/bytesHelper'; -import { Engine, Flavor, Plan, Region, Version } from '@/models/order-funnel'; +import { Engine, Flavor, Plan, Region, Version } from '@/types/orderFunnel'; import { Skeleton } from '@/components/ui/skeleton'; -import { Network, Subnet } from '@/models/network'; +import { Network, Subnet } from '@/types/cloud/network'; import { Button } from '@/components/ui/button'; import { Popover, diff --git a/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/useOrderFunnel.tsx b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/useOrderFunnel.hook.tsx similarity index 96% rename from packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/useOrderFunnel.tsx rename to packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/useOrderFunnel.hook.tsx index cce7b75b9278..61d96d6fc76d 100644 --- a/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/useOrderFunnel.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/pages/services/create/_components/useOrderFunnel.hook.tsx @@ -4,7 +4,7 @@ import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { useParams } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; -import { database } from '@/models/database'; +import * as database from '@/types/cloud/project/database'; import { Engine, Flavor, @@ -12,16 +12,16 @@ import { Plan, Region, Version, -} from '@/models/order-funnel'; -import { order } from '@/models/catalog'; +} from '@/types/orderFunnel'; +import { order } from '@/types/catalog'; import { createTree } from '@/lib/availabilitiesHelper'; import { generateName } from '@/lib/nameGenerator'; import { useVrack } from '@/hooks/useVrack'; -import { FullCapabilities } from '@/hooks/api/availabilities.api.hooks'; +import { FullCapabilities } from '@/hooks/api/database/capabilities/useGetFullCapabilities.hook'; import { Pricing, computeServicePrice } from '@/lib/pricingHelper'; const getSuggestedItemOrDefault = ( - suggestion: database.Suggestion, + suggestion: database.availability.Suggestion, item: 'plan' | 'region' | 'flavor', listItems: Plan[] | Region[] | Flavor[], currentValue?: string, @@ -41,7 +41,7 @@ const getSuggestedItemOrDefault = ( export function useOrderFunnel( availabilities: database.Availability[], capabilities: FullCapabilities, - suggestions: database.Suggestion[], + suggestions: database.availability.Suggestion[], catalog: order.publicOrder.Catalog, ) { const { t } = useTranslation('pci-databases-analytics/services/new'); diff --git a/packages/manager/apps/pci-databases-analytics/src/Router.tsx b/packages/manager/apps/pci-databases-analytics/src/routes/Router.tsx similarity index 82% rename from packages/manager/apps/pci-databases-analytics/src/Router.tsx rename to packages/manager/apps/pci-databases-analytics/src/routes/Router.tsx index c72391c14613..81afdd081376 100644 --- a/packages/manager/apps/pci-databases-analytics/src/Router.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/routes/Router.tsx @@ -1,5 +1,5 @@ import { RouterProvider, createHashRouter } from 'react-router-dom'; -import appRoutes from '@/routes'; +import appRoutes from '@/routes/routes'; const router = createHashRouter(appRoutes); diff --git a/packages/manager/apps/pci-databases-analytics/src/routes.tsx b/packages/manager/apps/pci-databases-analytics/src/routes/routes.tsx similarity index 67% rename from packages/manager/apps/pci-databases-analytics/src/routes.tsx rename to packages/manager/apps/pci-databases-analytics/src/routes/routes.tsx index d6a9cf09cf0f..9b8fe595c49a 100644 --- a/packages/manager/apps/pci-databases-analytics/src/routes.tsx +++ b/packages/manager/apps/pci-databases-analytics/src/routes/routes.tsx @@ -1,6 +1,5 @@ -import React from 'react'; -import NotFound from './pages/404'; -import ErrorBoundary from './components/errorBoundary'; +import NotFound from '../pages/404.page'; +import ErrorBoundary from '../components/error-boundary/ErrorBoundary.component'; const lazyRouteConfig = (importFn: CallableFunction) => { return { @@ -24,54 +23,56 @@ export const COMMON_PATH = '/pci/projects'; export default [ { path: '/pci/projects/:projectId/databases-analytics/:category/services', - ...lazyRouteConfig(() => import('@/pages/layout')), + ...lazyRouteConfig(() => import('@/pages/Root.layout')), children: [ { path: '', id: 'services', - ...lazyRouteConfig(() => import('@/pages')), + ...lazyRouteConfig(() => import('@/pages/Root.page')), }, { path: 'new', id: 'create', - ...lazyRouteConfig(() => import('@/pages/services/create')), + ...lazyRouteConfig(() => import('@/pages/services/create/Create.page')), }, { path: ':serviceId', - ...lazyRouteConfig(() => import('@/pages/services/[serviceId]/layout')), + ...lazyRouteConfig(() => + import('@/pages/services/[serviceId]/Service.layout'), + ), children: [ { path: '', id: 'service.dashboard', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/dashboard'), + import('@/pages/services/[serviceId]/dashboard/Dashboard.page'), ), }, { path: 'users', id: 'service.users', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/users'), + import('@/pages/services/[serviceId]/users/Users.page'), ), }, { path: 'backups', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/backups/layout'), + import('@/pages/services/[serviceId]/backups/Backups.layout'), ), children: [ { path: '', id: 'service.backups', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/backups'), + import('@/pages/services/[serviceId]/backups/Backups.page'), ), }, { path: 'fork', id: 'service.fork', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/backups/fork'), + import('@/pages/services/[serviceId]/backups/fork/Fork.page'), ), }, ], @@ -80,62 +81,64 @@ export default [ path: 'databases', id: 'service.databases', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/databases'), + import('@/pages/services/[serviceId]/databases/Database.page'), ), }, { path: 'namespaces', id: 'service.namespaces', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/namespaces'), + import('@/pages/services/[serviceId]/namespaces/Namespace.page'), ), }, { path: 'pools', id: 'service.pools', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/pools'), + import('@/pages/services/[serviceId]/pools/Pools.page'), ), }, { path: 'queries', id: 'service.queries', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/queries'), + import('@/pages/services/[serviceId]/queries/Queries.page'), ), }, { path: 'integrations', id: 'service.integrations', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/integrations'), + import( + '@/pages/services/[serviceId]/integrations/Integrations.page' + ), ), }, { path: 'metrics', id: 'service.metrics', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/metrics'), + import('@/pages/services/[serviceId]/metrics/Metrics.page'), ), }, { path: 'logs', id: 'service.logs', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/logs'), + import('@/pages/services/[serviceId]/logs/Logs.page'), ), }, { path: 'settings', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/settings/layout'), + import('@/pages/services/[serviceId]/settings/Settings.layout'), ), children: [ { path: '', id: 'service.settings', ...lazyRouteConfig(() => - import('@/pages/services/[serviceId]/settings'), + import('@/pages/services/[serviceId]/settings/Settings.page'), ), }, ], diff --git a/packages/manager/apps/pci-databases-analytics/src/types/Ip.ts b/packages/manager/apps/pci-databases-analytics/src/types/Ip.ts new file mode 100644 index 000000000000..c5432411f976 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/Ip.ts @@ -0,0 +1,2 @@ +/** IP address (e.g., 192.0.2.0) */ +export type Ip = string; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/IpBlock.ts b/packages/manager/apps/pci-databases-analytics/src/types/IpBlock.ts new file mode 100644 index 000000000000..7f7f6a3eab57 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/IpBlock.ts @@ -0,0 +1,2 @@ +/** IP (v4 or v6) CIDR notation (e.g., 192.0.2.0/24) */ +export type IpBlock = string; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/Time.ts b/packages/manager/apps/pci-databases-analytics/src/types/Time.ts new file mode 100644 index 000000000000..cf169e391278 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/Time.ts @@ -0,0 +1,2 @@ +/** Time (e.g., 15:04:05) */ +export type Time = string; diff --git a/packages/manager/apps/pci-databases-analytics/src/api/api.type.ts b/packages/manager/apps/pci-databases-analytics/src/types/api.ts similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/api/api.type.ts rename to packages/manager/apps/pci-databases-analytics/src/types/api.ts diff --git a/packages/manager/apps/pci-databases-analytics/src/models/catalog.ts b/packages/manager/apps/pci-databases-analytics/src/types/catalog.ts similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/models/catalog.ts rename to packages/manager/apps/pci-databases-analytics/src/types/catalog.ts diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/AccessTypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/AccessTypeEnum.ts new file mode 100644 index 000000000000..0f8a956a33c1 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/AccessTypeEnum.ts @@ -0,0 +1,5 @@ +/** Possible values for project access type */ +export enum AccessTypeEnum { + 'full' = 'full', + 'restricted' = 'restricted', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/Project.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/Project.ts new file mode 100644 index 000000000000..6fb36f2ecc95 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/Project.ts @@ -0,0 +1,33 @@ +import { AccessTypeEnum } from '@/types/cloud/AccessTypeEnum'; +import { ProjectStatusEnum } from '@/types/cloud/project/ProjectStatusEnum'; + +/** Project */ +export interface Project { + /** Project access */ + access?: AccessTypeEnum; + /** Project creation date */ + creationDate?: string; + /** Description of your project */ + description: string; + /** Expiration date of your project. After this date, your project will be deleted */ + expiration?: string; + /** Manual quota prevent automatic quota upgrade */ + manualQuota: boolean; + /** Project order id */ + orderId?: number; + /** Order plan code */ + planCode?: PlanCode; + /** Project name */ + projectName?: string; + /** Project id */ + project_id?: string; + /** Current status */ + status?: ProjectStatusEnum; + /** Project unleashed */ + unleash?: boolean; +} + +export enum PlanCode { + DISCOVERY = 'project.discovery', + STANDARD = 'project.2018', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/Vrack.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/Vrack.ts new file mode 100644 index 000000000000..eb37ff0481a4 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/Vrack.ts @@ -0,0 +1,9 @@ +/** A vRack allows to connect your OVH infrastructures accross products and datacenters */ +export interface Vrack { + /** Description of your vRack */ + description?: string; + /** Vrack ID */ + id?: string; + /** Name of your vRack */ + name?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/IPPool.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/IPPool.ts new file mode 100644 index 000000000000..30fbfb1e15e7 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/IPPool.ts @@ -0,0 +1,16 @@ +import { Ip } from '@/types/Ip'; +import { IpBlock } from '@/types/IpBlock'; + +/** IPPool */ +export interface IPPool { + /** Enable DHCP */ + dhcp?: boolean; + /** Last IP for this region (eg: 192.168.1.24) */ + end?: Ip; + /** Global network with cidr (eg: 192.168.1.0/24) */ + network?: IpBlock; + /** Region where this subnet will be created */ + region?: string; + /** First IP for this region (eg: 192.168.1.12) */ + start?: Ip; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/Network.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/Network.ts new file mode 100644 index 000000000000..fbeef80e37e7 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/Network.ts @@ -0,0 +1,19 @@ +import { NetworkRegion } from '@/types/cloud/network/NetworkRegion'; +import { NetworkStatusEnum } from '@/types/cloud/network/NetworkStatusEnum'; +import { NetworkTypeEnum } from '@/types/cloud/network/NetworkTypeEnum'; + +/** Network */ +export interface Network { + /** Network id */ + id?: string; + /** Network name */ + name?: string; + /** Details about private network in region */ + regions?: NetworkRegion[]; + /** Network status */ + status?: NetworkStatusEnum; + /** Network type */ + type?: NetworkTypeEnum; + /** Network VLAN id */ + vlanId?: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkRegion.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkRegion.ts new file mode 100644 index 000000000000..34813e064834 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkRegion.ts @@ -0,0 +1,11 @@ +import { NetworkRegionStatusEnum } from '@/types/cloud/network/NetworkRegionStatusEnum'; + +/** NetworkRegion */ +export interface NetworkRegion { + /** Network id on openstack region */ + openstackId?: string; + /** Network region */ + region?: string; + /** Network region status */ + status?: NetworkRegionStatusEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkRegionStatusEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkRegionStatusEnum.ts new file mode 100644 index 000000000000..45c27ef09c26 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkRegionStatusEnum.ts @@ -0,0 +1,5 @@ +/** NetworkRegionStatusEnum */ +export enum NetworkRegionStatusEnum { + 'ACTIVE' = 'ACTIVE', + 'BUILDING' = 'BUILDING', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkStatusEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkStatusEnum.ts new file mode 100644 index 000000000000..b612ea59c083 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkStatusEnum.ts @@ -0,0 +1,6 @@ +/** NetworkStatusEnum */ +export enum NetworkStatusEnum { + 'ACTIVE' = 'ACTIVE', + 'BUILDING' = 'BUILDING', + 'DELETING' = 'DELETING', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkTypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkTypeEnum.ts new file mode 100644 index 000000000000..b560e39b6105 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkTypeEnum.ts @@ -0,0 +1,5 @@ +/** NetworkTypeEnum */ +export enum NetworkTypeEnum { + 'private' = 'private', + 'public' = 'public', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkVisibilityEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkVisibilityEnum.ts new file mode 100644 index 000000000000..ac75ec989720 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/NetworkVisibilityEnum.ts @@ -0,0 +1,5 @@ +/** NetworkVisibilityEnum */ +export enum NetworkVisibilityEnum { + 'private' = 'private', + 'public' = 'public', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/Subnet.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/Subnet.ts new file mode 100644 index 000000000000..ee7977e98f53 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/Subnet.ts @@ -0,0 +1,17 @@ +import { IpBlock } from '@/types/IpBlock'; +import { Ip } from '@/types/Ip'; +import { IPPool } from '@/types/cloud/network/IPPool'; + +/** Subnet */ +export interface Subnet { + /** Subnet CIDR */ + cidr?: IpBlock; + /** Is DHCP enabled for the subnet */ + dhcpEnabled?: boolean; + /** Gateway IP in the subnet */ + gatewayIp?: Ip; + /** Subnet id */ + id?: string; + /** List of ip pools allocated in subnet */ + ipPools?: IPPool[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/index.ts new file mode 100644 index 000000000000..bb7b197c88dd --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/network/index.ts @@ -0,0 +1,8 @@ +export * from './IPPool'; +export * from './Network'; +export * from './NetworkRegion'; +export * from './NetworkRegionStatusEnum'; +export * from './NetworkStatusEnum'; +export * from './NetworkTypeEnum'; +export * from './NetworkVisibilityEnum'; +export * from './Subnet'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/ProjectStatusEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/ProjectStatusEnum.ts new file mode 100644 index 000000000000..c5e53b2b9577 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/ProjectStatusEnum.ts @@ -0,0 +1,8 @@ +/** Possible values for project status */ +export enum ProjectStatusEnum { + 'creating' = 'creating', + 'deleted' = 'deleted', + 'deleting' = 'deleting', + 'ok' = 'ok', + 'suspended' = 'suspended', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Availability.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Availability.ts new file mode 100644 index 000000000000..a1e1c1660792 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Availability.ts @@ -0,0 +1,55 @@ +import { BackupTypeEnum } from '@/types/cloud/project/database/BackupTypeEnum'; +import { Backups } from '@/types/cloud/project/database/availability/Backups'; +import { CategoryEnum } from '@/types/cloud/project/database/engine/CategoryEnum'; +import { Lifecycle } from '@/types/cloud/project/database/availability/Lifecycle'; +import { NetworkTypeEnum } from '@/types/cloud/project/database/NetworkTypeEnum'; +import { Specifications } from '@/types/cloud/project/database/availability/Specifications'; +import { StatusEnum } from '@/types/cloud/project/database/availability/StatusEnum'; + +/** Availability of databases engines on cloud projects */ +export interface Availability { + /** Defines the type of backup. DEPRECATED: use backups.enable */ + backup?: BackupTypeEnum; + /** Backup retention time of the availability in days. DEPRECATED: use backups.retentionDays */ + backupRetentionDays?: number; + /** Defines backups strategy for the availability */ + backups?: Backups; + /** Category of the engine */ + category?: CategoryEnum; + /** Whether this availability can be used by default */ + default?: boolean; + /** End of life of the product. DEPRECATED: use lifecycle.endOfLife */ + endOfLife?: string; + /** Database engine name */ + engine?: string; + /** Flavor name. DEPRECATED: use specifications.flavor */ + flavor?: string; + /** Defines the lifecycle of the availability */ + lifecycle?: Lifecycle; + /** Maximum possible disk size in GB. DEPRECATED: use specifications.storage.maximum */ + maxDiskSize?: number; + /** Maximum nodes of the cluster. DEPRECATED: use specifications.nodes.maximum */ + maxNodeNumber?: number; + /** Minimum possible disk size in GB. DEPRECATED: use specifications.storage.minimum */ + minDiskSize?: number; + /** Minimum nodes of the cluster. DEPRECATED: use specifications.nodes.minimum */ + minNodeNumber?: number; + /** Type of network. DEPRECATED: use specifications.network */ + network?: NetworkTypeEnum; + /** Plan name */ + plan?: string; + /** Region name */ + region?: string; + /** Defines the technical specifications of the availability */ + specifications?: Specifications; + /** Date of the release of the product. DEPRECATED: use lifecycle.startDate */ + startDate?: string; + /** Status of the availability. DEPRECATED: use lifecycle.status */ + status?: StatusEnum; + /** Flex disk size step in GB. DEPRECATED: use specifications.storage.step */ + stepDiskSize?: number; + /** End of life of the upstream product. DEPRECATED: use lifecycle */ + upstreamEndOfLife?: string; + /** Version name */ + version?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Backup.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Backup.ts new file mode 100644 index 000000000000..d4047290c465 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Backup.ts @@ -0,0 +1,24 @@ +import { Region } from '@/types/cloud/project/database/backup/Region'; +import { UnitAndValueLong } from '@/types/complexType/UnitAndValueLong'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; +import { BackupTypeEnum } from '@/types/cloud/project/database/BackupTypeEnum'; + +/** Cloud database backup definition */ +export interface Backup { + /** Date of the creation of the backup */ + createdAt?: string; + /** Description of the backup */ + description: string; + /** Backup ID */ + id?: string; + /** Region where the backup is stored. DEPRECATED: use regions */ + region?: string; + /** Regions where the backup are stored */ + regions?: Region[]; + /** Size of the backup */ + size?: UnitAndValueLong; + /** Current status of the backup */ + status?: StatusEnum; + /** Type of backup */ + type?: BackupTypeEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/BackupTypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/BackupTypeEnum.ts new file mode 100644 index 000000000000..b5b0e804f896 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/BackupTypeEnum.ts @@ -0,0 +1,8 @@ +/** Type of backup for the cluster */ +export enum BackupTypeEnum { + 'automatic' = 'automatic', + 'manual' = 'manual', + 'none' = 'none', + 'pitr' = 'pitr', + 'snapshot' = 'snapshot', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Capabilities.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Capabilities.ts new file mode 100644 index 000000000000..664cf8e993f1 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Capabilities.ts @@ -0,0 +1,20 @@ +import { Engine } from '@/types/cloud/project/database/capabilities/Engine'; +import { Flavor } from '@/types/cloud/project/database/capabilities/Flavor'; +import { Option } from '@/types/cloud/project/database/capabilities/Option'; +import { Plan } from '@/types/cloud/project/database/capabilities/Plan'; + +/** Capabilities available for the databases engines on cloud projects */ +export interface Capabilities { + /** Disks available */ + disks?: string[]; + /** Database engines available */ + engines?: Engine[]; + /** Flavors available */ + flavors?: Flavor[]; + /** Options available */ + options?: Option[]; + /** Plans available */ + plans?: Plan[]; + /** Regions available */ + regions?: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/EngineEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/EngineEnum.ts new file mode 100644 index 000000000000..4d9d0e7f00a5 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/EngineEnum.ts @@ -0,0 +1,15 @@ +/** Possible names of the engines */ +export enum EngineEnum { + 'cassandra' = 'cassandra', + 'grafana' = 'grafana', + 'kafka' = 'kafka', + 'kafkaConnect' = 'kafkaConnect', + 'kafkaMirrorMaker' = 'kafkaMirrorMaker', + 'm3aggregator' = 'm3aggregator', + 'm3db' = 'm3db', + 'mongodb' = 'mongodb', + 'mysql' = 'mysql', + 'opensearch' = 'opensearch', + 'postgresql' = 'postgresql', + 'redis' = 'redis', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/IpRestriction.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/IpRestriction.ts new file mode 100644 index 000000000000..6f660469bd3c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/IpRestriction.ts @@ -0,0 +1,12 @@ +import { IpBlock } from '@/types/IpBlock'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** Ip Restriction definition for cloud project databases (DEPRECATED) */ +export interface IpRestriction { + /** Description of the ip restriction */ + description: string; + /** Whitelisted IP */ + ip?: IpBlock; + /** Current status of the ip restriction */ + status?: StatusEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/IpRestrictionCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/IpRestrictionCreation.ts new file mode 100644 index 000000000000..45e69923ccbf --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/IpRestrictionCreation.ts @@ -0,0 +1,9 @@ +import { IpBlock } from '@/types/IpBlock'; + +/** Ip Restriction creation definition for cloud project databases (DEPRECATED) */ +export interface IpRestrictionCreation { + /** Description of the ip restriction */ + description: string; + /** Whitelisted IP */ + ip: IpBlock; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/LogSubscriptionCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/LogSubscriptionCreation.ts new file mode 100644 index 000000000000..141d0b2e7dbd --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/LogSubscriptionCreation.ts @@ -0,0 +1,5 @@ +/** Logs to customer subscription creation definition for cloud project databases */ +export interface LogSubscriptionCreation { + /** Target stream of the subscription */ + streamId: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/NetworkTypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/NetworkTypeEnum.ts new file mode 100644 index 000000000000..13b942a32e48 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/NetworkTypeEnum.ts @@ -0,0 +1,5 @@ +/** Type of network in which the databases cluster are */ +export enum NetworkTypeEnum { + 'private' = 'private', + 'public' = 'public', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Service.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Service.ts new file mode 100644 index 000000000000..4ae8f64307db --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/Service.ts @@ -0,0 +1,62 @@ +import { Time } from '@/types/Time'; +import { Backup } from '@/types/cloud/project/database/service/Backup'; +import { CapabilityActions } from '@/types/cloud/project/database/service/CapabilityActions'; +import { CategoryEnum } from '@/types/cloud/project/database/engine/CategoryEnum'; +import { Disk } from '@/types/cloud/project/database/service/Disk'; +import { Endpoint } from '@/types/cloud/project/database/service/Endpoint'; +import { EngineEnum } from '@/types/cloud/project/database/EngineEnum'; +import { IpRestriction } from '@/types/cloud/project/database/service/IpRestriction'; +import { NetworkTypeEnum } from '@/types/cloud/project/database/NetworkTypeEnum'; +import { Node } from '@/types/cloud/project/database/service/Node'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; +import { Storage } from '@/types/cloud/project/database/service/Storage'; + +/** Cloud database service definition */ +export interface Service { + /** Time on which backups start every day. DEPRECATED: use backups.time */ + backupTime: Time; + /** Information related to the backups, null if the engine does not support backups */ + backups: Backup; + /** Capabilities of the services */ + capabilities?: { [key: string]: CapabilityActions }; + /** Category of the engine */ + category?: CategoryEnum; + /** Date of the creation of the cluster */ + createdAt?: string; + /** Description of the cluster */ + description: string; + /** Disk attributes of the cluster. DEPRECATED: use storage */ + disk: Disk; + /** List of all endpoints of the service */ + endpoints?: Endpoint[]; + /** Name of the engine of the service */ + engine?: EngineEnum; + /** The VM flavor used for this cluster */ + flavor: string; + /** Service ID */ + id?: string; + /** IP Blocks authorized to access to the cluster */ + ipRestrictions: IpRestriction[]; + /** Time on which maintenances can start every day */ + maintenanceTime: Time; + /** Private network ID in which the cluster is */ + networkId?: string; + /** Type of network of the cluster */ + networkType?: NetworkTypeEnum; + /** Number of nodes in the cluster. DEPRECATED: use nodes */ + nodeNumber: number; + /** Nodes of the cluster */ + nodes?: Node[]; + /** Plan of the cluster */ + plan: string; + /** Region of the cluster */ + region: string; + /** Current status of the cluster */ + status?: StatusEnum; + /** Storage attributes of the cluster */ + storage: Storage; + /** Private subnet ID in which the cluster is */ + subnetId?: string; + /** Version of the engine deployed on the cluster */ + version: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/ServiceCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/ServiceCreation.ts new file mode 100644 index 000000000000..9255bc9eddd5 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/ServiceCreation.ts @@ -0,0 +1,40 @@ +import { BackupFork } from '@/types/cloud/project/database/service/creation/BackupFork'; +import { Time } from '@/types/Time'; +import { Backup } from '@/types/cloud/project/database/service/Backup'; +import { Disk } from '@/types/cloud/project/database/service/Disk'; +import { ForkFrom } from '@/types/cloud/project/database/service/creation/ForkFrom'; +import { IpRestriction } from '@/types/cloud/project/database/service/IpRestriction'; +import { NodeCreation } from '@/types/cloud/project/database/service/NodeCreation'; +import { NodePattern } from '@/types/cloud/project/database/service/NodePattern'; + +/** Cloud databases cluster definition */ +export interface ServiceCreation { + /** Backup from which the new service is created. DEPRECATED: use forkFrom */ + backup?: BackupFork; + /** Time on which backups start every day. DEPRECATED: use backups.time */ + backupTime?: Time; + /** Information related to the backups, null if the engine does not support backups */ + backups?: Backup; + /** Description of the cluster */ + description: string; + /** Disk attributes of the cluster */ + disk?: Disk; + /** Backup from which the new service is created */ + forkFrom?: ForkFrom; + /** IP Blocks authorized to access to the cluster */ + ipRestrictions: IpRestriction[]; + /** Time on which maintenances can start every day */ + maintenanceTime: Time; + /** Private network ID in which the cluster is */ + networkId: string; + /** List of nodes in the cluster, not compatible with nodesPattern */ + nodesList?: NodeCreation[]; + /** Pattern definition of the nodes in the cluster, not compatible with nodesList */ + nodesPattern?: NodePattern; + /** Plan of the cluster */ + plan: string; + /** Private subnet ID in which the cluster is */ + subnetId: string; + /** Version of the engine deployed on the cluster */ + version: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/StatusEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/StatusEnum.ts new file mode 100644 index 000000000000..4348b212ddaf --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/StatusEnum.ts @@ -0,0 +1,14 @@ +/** Possible state of the job */ +export enum StatusEnum { + 'CREATING' = 'CREATING', + 'DELETING' = 'DELETING', + 'ERROR' = 'ERROR', + 'ERROR_INCONSISTENT_SPEC' = 'ERROR_INCONSISTENT_SPEC', + 'LOCKED' = 'LOCKED', + 'LOCKED_PENDING' = 'LOCKED_PENDING', + 'LOCKED_UPDATING' = 'LOCKED_UPDATING', + 'PENDING' = 'PENDING', + 'READY' = 'READY', + 'SHELVED' = 'SHELVED', + 'UPDATING' = 'UPDATING', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/TemporaryWriteDeadline.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/TemporaryWriteDeadline.ts new file mode 100644 index 000000000000..bb20f0acdf52 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/TemporaryWriteDeadline.ts @@ -0,0 +1,5 @@ +/** Cloud databases temporary write deadline definition */ +export interface TemporaryWriteDeadline { + /** Date on which the temporary write permissions would be lifted */ + until?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/TypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/TypeEnum.ts new file mode 100644 index 000000000000..af9bd0da5e48 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/TypeEnum.ts @@ -0,0 +1,8 @@ +/** Type of data returned in the capabilities options */ +export enum TypeEnum { + 'boolean' = 'boolean', + 'double' = 'double', + 'duration' = 'duration', + 'long' = 'long', + 'string' = 'string', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/ActionEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/ActionEnum.ts new file mode 100644 index 000000000000..aced4824b31e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/ActionEnum.ts @@ -0,0 +1,6 @@ +/** Possible action to restrict availabilities */ +export enum ActionEnum { + 'fork' = 'fork', + 'read' = 'read', + 'update' = 'update', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Backups.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Backups.ts new file mode 100644 index 000000000000..4afb7c6a2ac2 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Backups.ts @@ -0,0 +1,7 @@ +/** Backups availability of databases engines on cloud projects */ +export interface Backups { + /** Defines whether the backups are available for this offer */ + available?: boolean; + /** Number of retention days for the backups */ + retentionDays?: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Lifecycle.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Lifecycle.ts new file mode 100644 index 000000000000..43ee27750bcc --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Lifecycle.ts @@ -0,0 +1,13 @@ +import { StatusEnum } from '@/types/cloud/project/database/availability/StatusEnum'; + +/** Availability of databases engines on cloud projects */ +export interface Lifecycle { + /** End of life of the product */ + endOfLife?: string; + /** End of sale of the product */ + endOfSale?: string; + /** Date of the release of the product */ + startDate?: string; + /** Status of the availability */ + status?: StatusEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Specifications.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Specifications.ts new file mode 100644 index 000000000000..77003aa40a14 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Specifications.ts @@ -0,0 +1,15 @@ +import { NetworkTypeEnum } from '@/types/cloud/project/database/NetworkTypeEnum'; +import { Nodes } from '@/types/cloud/project/database/availability/specifications/Nodes'; +import { Storage } from '@/types/cloud/project/database/availability/specifications/Storage'; + +/** Specifications of the availability of databases engines on cloud projects */ +export interface Specifications { + /** Flavor name */ + flavor?: string; + /** Type of network */ + network?: NetworkTypeEnum; + /** Specification of the nodes */ + nodes?: Nodes; + /** Specification of the storage */ + storage?: Storage; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/StatusEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/StatusEnum.ts new file mode 100644 index 000000000000..e9dda2d7324a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/StatusEnum.ts @@ -0,0 +1,9 @@ +/** Possible status for the availability */ +export enum StatusEnum { + 'BETA' = 'BETA', + 'DEPRECATED' = 'DEPRECATED', + 'END_OF_LIFE' = 'END_OF_LIFE', + 'END_OF_SALE' = 'END_OF_SALE', + 'STABLE' = 'STABLE', + 'UNAVAILABLE' = 'UNAVAILABLE', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Suggestion.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Suggestion.ts new file mode 100644 index 000000000000..15fdc56dfe5f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/Suggestion.ts @@ -0,0 +1,8 @@ +export interface Suggestion { + default: boolean; + engine: string; + flavor: string; + plan: string; + region: string; + version: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/TargetEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/TargetEnum.ts new file mode 100644 index 000000000000..2d03afbac4b9 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/TargetEnum.ts @@ -0,0 +1,7 @@ +/** Possible target to restrict availabilities */ +export enum TargetEnum { + 'flavor' = 'flavor', + 'plan' = 'plan', + 'self' = 'self', + 'version' = 'version', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/index.ts new file mode 100644 index 000000000000..48f47b64c7ca --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/index.ts @@ -0,0 +1,10 @@ +import * as specifications from './specifications/index'; + +export * from './ActionEnum'; +export * from './Backups'; +export * from './Lifecycle'; +export * from './Specifications'; +export * from './StatusEnum'; +export * from './TargetEnum'; +export * from './Suggestion'; +export { specifications }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/Nodes.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/Nodes.ts new file mode 100644 index 000000000000..1ddada533a05 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/Nodes.ts @@ -0,0 +1,7 @@ +/** Specifications of the nodes for availabilities of databases engines on cloud projects */ +export interface Nodes { + /** Maximum number of nodes of the availability */ + maximum?: number; + /** Minimum number of nodes of the availability */ + minimum?: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/Storage.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/Storage.ts new file mode 100644 index 000000000000..44ed91674086 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/Storage.ts @@ -0,0 +1,11 @@ +import { UnitAndValueLong } from '@/types/complexType/UnitAndValueLong'; + +/** Specifications of the storage for availabilities of databases engines on cloud projects */ +export interface Storage { + /** Maximum storage of the availability */ + maximum?: UnitAndValueLong; + /** Minimum storage of the availability */ + minimum?: UnitAndValueLong; + /** Memory step that can be added between minimum and maximum */ + step?: UnitAndValueLong; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/index.ts new file mode 100644 index 000000000000..c8614cb04e4d --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/availability/specifications/index.ts @@ -0,0 +1,2 @@ +export * from './Nodes'; +export * from './Storage'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/backup/Region.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/backup/Region.ts new file mode 100644 index 000000000000..bf2d8046252a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/backup/Region.ts @@ -0,0 +1,5 @@ +/** Cloud database backup region definition */ +export interface Region { + /** Name of the region where the backup is stored */ + name?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/backup/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/backup/index.ts new file mode 100644 index 000000000000..44a6d8f4b08e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/backup/index.ts @@ -0,0 +1 @@ +export * from './Region'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Engine.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Engine.ts new file mode 100644 index 000000000000..83c97e46f879 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Engine.ts @@ -0,0 +1,20 @@ +import { CategoryEnum } from '@/types/cloud/project/database/engine/CategoryEnum'; +import { StrategyEnum } from '@/types/cloud/project/database/capabilities/engine/storage/StrategyEnum'; + +/** Specific database engine capability */ +export interface Engine { + /** Category of the engine */ + category?: CategoryEnum; + /** Default version used for the engine */ + defaultVersion?: string; + /** Description of the engine */ + description?: string; + /** Engine name */ + name?: string; + /** SSL modes for this engine */ + sslModes?: string[]; + /** Storage strategy of the engine */ + storage?: StrategyEnum; + /** Versions available for this engine */ + versions?: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/EngineCapabilities.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/EngineCapabilities.ts new file mode 100644 index 000000000000..a2af54bb4338 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/EngineCapabilities.ts @@ -0,0 +1,22 @@ +import { CategoryEnum } from '@/types/cloud/project/database/engine/CategoryEnum'; +import { StrategyEnum } from '@/types/cloud/project/database/capabilities/engine/storage/StrategyEnum'; +import { Lifecycle } from '@/types/cloud/project/database/availability/Lifecycle'; +import { TagEnum } from '@/types/cloud/project/database/capabilities/TagEnum'; + +/** Engines Capabilites */ +export interface EngineCapabilities { + category: CategoryEnum; + description: string; + lifecycle: Lifecycle; + name: string; + order: number; + sslModes: string[]; + storage: StrategyEnum; + tags: TagEnum[]; + versions: { + default: boolean; + lifecycle: Lifecycle; + name: string; + tags: TagEnum[]; + }[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Flavor.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Flavor.ts new file mode 100644 index 000000000000..3b3018c13273 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Flavor.ts @@ -0,0 +1,22 @@ +import { Lifecycle } from '@/types/cloud/project/database/availability/Lifecycle'; +import { Specifications } from '@/types/cloud/project/database/capabilities/flavor/Specifications'; + +/** Cloud Database flavor definition */ +export interface Flavor { + /** Flavor core number. DEPRECATED: use specifications.core */ + core?: number; + /** Defines the lifecycle of the flavor */ + lifecycle?: Lifecycle; + /** Flavor ram size in GB. DEPRECATED: use specifications.memory */ + memory?: number; + /** Name of the flavor */ + name?: string; + /** Display order */ + order?: number; + /** Technical specifications of the flavor */ + specifications?: Specifications; + /** Flavor disk size in GB. DEPRECATED: use specifications.storage */ + storage?: number; + /** Display tags */ + tags?: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Integration.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Integration.ts new file mode 100644 index 000000000000..32b4ba3c0d02 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Integration.ts @@ -0,0 +1,15 @@ +import { EngineEnum } from '@/types/cloud/project/database/EngineEnum'; +import { Parameter } from '@/types/cloud/project/database/capabilities/integration/Parameter'; +import { TypeEnum } from '@/types/cloud/project/database/service/integration/TypeEnum'; + +/** Integration capability between database engines */ +export interface Integration { + /** Destination engine for the integration */ + destinationEngine?: EngineEnum; + /** Parameters for the integration capability */ + parameters?: Parameter[]; + /** Source engine for the integration */ + sourceEngine?: EngineEnum; + /** Type of the integration */ + type?: TypeEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Option.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Option.ts new file mode 100644 index 000000000000..5b8f8049047a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Option.ts @@ -0,0 +1,9 @@ +import { TypeEnum } from '@/types/cloud/project/database/TypeEnum'; + +/** Cloud Database option definition */ +export interface Option { + /** Name of the option */ + name?: string; + /** Type of the option */ + type?: TypeEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Plan.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Plan.ts new file mode 100644 index 000000000000..7560aa1cdc89 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/Plan.ts @@ -0,0 +1,17 @@ +import { Lifecycle } from '@/types/cloud/project/database/availability/Lifecycle'; + +/** Cloud Database plan definition */ +export interface Plan { + /** Automatic backup retention duration */ + backupRetention?: string; + /** Description of the plan */ + description?: string; + /** Defines the lifecycle of the availability */ + lifecycle?: Lifecycle; + /** Name of the plan */ + name?: string; + /** Display order */ + order?: number; + /** Display tags */ + tags?: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/RegionCapabilities.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/RegionCapabilities.ts new file mode 100644 index 000000000000..8391fc5221e6 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/RegionCapabilities.ts @@ -0,0 +1,10 @@ +import { Lifecycle } from '@/types/cloud/project/database/availability/Lifecycle'; +import { TagEnum } from '@/types/cloud/project/database/capabilities/TagEnum'; + +/** Regions Capabilites */ +export interface RegionCapabilities { + lifecycle: Lifecycle; + name: string; + order: number; + tags: TagEnum[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/TagEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/TagEnum.ts new file mode 100644 index 000000000000..7d3eb7a901a3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/TagEnum.ts @@ -0,0 +1,5 @@ +export enum TagEnum { + 'new' = 'new', + 'current' = 'current', + 'soonDeprecated' = 'soonDeprecated', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/Property.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/Property.ts new file mode 100644 index 000000000000..52a836c3aee7 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/Property.ts @@ -0,0 +1,17 @@ +import { TypeEnum } from '@/types/cloud/project/database/capabilities/advancedConfiguration/property/TypeEnum'; + +/** Specific database engine capability */ +export interface Property { + /** Description of the property */ + description?: string; + /** Maximum value for the property if numeric and applicable */ + maximum?: number; + /** Minimum value for the property if numeric and applicable */ + minimum?: number; + /** Property name */ + name?: string; + /** Data type of the property */ + type?: TypeEnum; + /** Possible values for the property if string and applicable */ + values?: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/index.ts new file mode 100644 index 000000000000..51b747b0807f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/index.ts @@ -0,0 +1,4 @@ +import * as property from './property/index'; + +export * from './Property'; +export { property }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/property/TypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/property/TypeEnum.ts new file mode 100644 index 000000000000..f20c51fdf164 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/property/TypeEnum.ts @@ -0,0 +1,7 @@ +/** Possible type of the advanced configuration properties */ +export enum TypeEnum { + 'boolean' = 'boolean', + 'double' = 'double', + 'long' = 'long', + 'string' = 'string', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/property/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/property/index.ts new file mode 100644 index 000000000000..333912f82871 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/advancedConfiguration/property/index.ts @@ -0,0 +1 @@ +export * from './TypeEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/index.ts new file mode 100644 index 000000000000..091deed39959 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/index.ts @@ -0,0 +1,3 @@ +import * as storage from './storage/index'; + +export { storage }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/storage/StrategyEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/storage/StrategyEnum.ts new file mode 100644 index 000000000000..e7bc443ba3fa --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/storage/StrategyEnum.ts @@ -0,0 +1,6 @@ +/** Possible storage strategy for an engine */ +export enum StrategyEnum { + 'distributed' = 'distributed', + 'n/a' = 'n/a', + 'replicated' = 'replicated', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/storage/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/storage/index.ts new file mode 100644 index 000000000000..7222b6682b54 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/engine/storage/index.ts @@ -0,0 +1 @@ +export * from './StrategyEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/flavor/Specifications.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/flavor/Specifications.ts new file mode 100644 index 000000000000..aaf793da4f82 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/flavor/Specifications.ts @@ -0,0 +1,11 @@ +import { UnitAndValueLong } from '@/types/complexType/UnitAndValueLong'; + +/** Cloud Database flavor specifications definition */ +export interface Specifications { + /** Flavor core number */ + core?: number; + /** Flavor ram size */ + memory?: UnitAndValueLong; + /** Flavor disk size */ + storage?: UnitAndValueLong; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/flavor/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/flavor/index.ts new file mode 100644 index 000000000000..ed545a2d137b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/flavor/index.ts @@ -0,0 +1 @@ +export * from './Specifications'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/index.ts new file mode 100644 index 000000000000..5173b4646a26 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/index.ts @@ -0,0 +1,18 @@ +import * as advancedConfiguration from './advancedConfiguration/index'; +import * as engine from './engine/index'; +import * as flavor from './flavor/index'; +import * as integration from './integration/index'; + +export * from './Engine'; +export * from './Flavor'; +export * from './Integration'; +export * from './Option'; +export * from './Plan'; +export * from './TagEnum'; +export * from './TagEnum'; +export * from './EngineCapabilities'; +export * from './RegionCapabilities'; +export { advancedConfiguration }; +export { engine }; +export { flavor }; +export { integration }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/Parameter.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/Parameter.ts new file mode 100644 index 000000000000..2e3b5769b1cb --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/Parameter.ts @@ -0,0 +1,9 @@ +import { TypeEnum } from '@/types/cloud/project/database/capabilities/integration/parameter/TypeEnum'; + +/** Integration capability parameter */ +export interface Parameter { + /** Name of the integration parameter */ + name?: string; + /** Type of the integration parameter */ + type?: TypeEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/index.ts new file mode 100644 index 000000000000..f2c4ee4886b9 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/index.ts @@ -0,0 +1,4 @@ +import * as parameter from './parameter/index'; + +export * from './Parameter'; +export { parameter }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/parameter/TypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/parameter/TypeEnum.ts new file mode 100644 index 000000000000..89517cab8ee8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/parameter/TypeEnum.ts @@ -0,0 +1,5 @@ +/** Possible type of an integration capability parameter */ +export enum TypeEnum { + 'integer' = 'integer', + 'string' = 'string', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/parameter/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/parameter/index.ts new file mode 100644 index 000000000000..333912f82871 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/capabilities/integration/parameter/index.ts @@ -0,0 +1 @@ +export * from './TypeEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/engine/CategoryEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/engine/CategoryEnum.ts new file mode 100644 index 000000000000..6ea96570edd0 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/engine/CategoryEnum.ts @@ -0,0 +1,7 @@ +/** Different categories of engines */ +export enum CategoryEnum { + 'analysis' = 'analysis', + 'operational' = 'operational', + 'streaming' = 'streaming', + 'all' = 'all', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/engine/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/engine/index.ts new file mode 100644 index 000000000000..191499c622f3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/engine/index.ts @@ -0,0 +1 @@ +export * from './CategoryEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/index.ts new file mode 100644 index 000000000000..0284366664a6 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/index.ts @@ -0,0 +1,39 @@ +import * as availability from './availability/index'; +import * as backup from './backup/index'; +import * as capabilities from './capabilities/index'; +import * as engine from './engine/index'; +import * as kafka from './kafka/index'; +import * as kafkaConnect from './kafkaConnect/index'; +import * as m3db from './m3db/index'; +import * as mysql from './mysql/index'; +import * as opensearch from './opensearch/index'; +import * as postgresql from './postgresql/index'; +import * as redis from './redis/index'; +import * as service from './service/index'; + +export * from './Availability'; +export * from './Backup'; +export * from './BackupTypeEnum'; +export * from './Capabilities'; +export * from './EngineEnum'; +export * from './IpRestriction'; +export * from './IpRestrictionCreation'; +export * from './LogSubscriptionCreation'; +export * from './NetworkTypeEnum'; +export * from './Service'; +export * from './ServiceCreation'; +export * from './StatusEnum'; +export * from './TemporaryWriteDeadline'; +export * from './TypeEnum'; +export { availability }; +export { backup }; +export { capabilities }; +export { engine }; +export { kafka }; +export { kafkaConnect }; +export { m3db }; +export { mysql }; +export { opensearch }; +export { postgresql }; +export { redis }; +export { service }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Permissions.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Permissions.ts new file mode 100644 index 000000000000..de38f7a4f72e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Permissions.ts @@ -0,0 +1,9 @@ +/** Cloud databases kafka permissions definition */ +export interface Permissions { + /** Names of the topic permissions (DEPRECATED) */ + names?: string[]; + /** Names of the schema registry permissions */ + schemaRegistry?: string[]; + /** Names of the topic permissions */ + topic?: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/SchemaRegistryAcl.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/SchemaRegistryAcl.ts new file mode 100644 index 000000000000..105a7e529fa4 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/SchemaRegistryAcl.ts @@ -0,0 +1,11 @@ +/** Cloud databases kafka schema registry acl definition */ +export interface SchemaRegistryAcl { + /** Acl ID */ + id?: string; + /** Permission to give to this username on this resource. Permissions values can be retrieved using /cloud/project/{serviceName}/database/kafka/{clusterId}/permissions */ + permission: string; + /** Resource affected by this acl */ + resource: string; + /** Username affected by this acl */ + username: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Service.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Service.ts new file mode 100644 index 000000000000..6460b16ece31 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Service.ts @@ -0,0 +1,61 @@ +import { Time } from '@/types/Time'; +import { CapabilityActions } from '@/types/cloud/project/database/service/CapabilityActions'; +import { CategoryEnum } from '@/types/cloud/project/database/engine/CategoryEnum'; +import { Disk } from '@/types/cloud/project/database/service/Disk'; +import { Endpoint } from '@/types/cloud/project/database/service/Endpoint'; +import { EngineEnum } from '@/types/cloud/project/database/EngineEnum'; +import { IpRestriction } from '@/types/cloud/project/database/service/IpRestriction'; +import { NetworkTypeEnum } from '@/types/cloud/project/database/NetworkTypeEnum'; +import { Node } from '@/types/cloud/project/database/service/Node'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; +import { Storage } from '@/types/cloud/project/database/service/Storage'; + +/** Cloud database kafka service definition */ +export interface Service { + /** Time on which backups start every day */ + backupTime: Time; + /** Capabilities of the services */ + capabilities?: { [key: string]: CapabilityActions }; + /** Category of the engine */ + category?: CategoryEnum; + /** Date of the creation of the cluster */ + createdAt?: string; + /** Description of the cluster */ + description: string; + /** Disk attributes of the cluster. DEPRECATED: use storage */ + disk: Disk; + /** List of all endpoints of the service */ + endpoints?: Endpoint[]; + /** Name of the engine of the service */ + engine?: EngineEnum; + /** The VM flavor used for this cluster */ + flavor: string; + /** Service ID */ + id?: string; + /** IP Blocks authorized to access to the cluster */ + ipRestrictions: IpRestriction[]; + /** Time on which maintenances can start every day */ + maintenanceTime: Time; + /** Private network ID in which the cluster is */ + networkId?: string; + /** Type of network of the cluster */ + networkType?: NetworkTypeEnum; + /** Number of nodes in the cluster. DEPRECATED: useNodes */ + nodeNumber: number; + /** Nodes of the cluster */ + nodes?: Node[]; + /** Plan of the cluster */ + plan: string; + /** Defines whether the REST API is enabled on the cluster */ + restApi: boolean; + /** Defines whether the schema registry is enabled on the cluster */ + schemaRegistry: boolean; + /** Current status of the cluster */ + status?: StatusEnum; + /** Storage attributes of the cluster */ + storage: Storage; + /** Private subnet ID in which the cluster is */ + subnetId?: string; + /** Version of the engine deployed on the cluster */ + version: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Topic.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Topic.ts new file mode 100644 index 000000000000..95010f3d74c8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/Topic.ts @@ -0,0 +1,17 @@ +/** Cloud database kafka topic definition */ +export interface Topic { + /** Topic ID */ + id?: string; + /** Minimum insync replica accepted for this topic */ + minInsyncReplicas: number; + /** Name of the topic */ + name?: string; + /** Number of partitions for this topic */ + partitions: number; + /** Number of replication for this topic */ + replication: number; + /** Number of bytes for the retention of the data for this topic */ + retentionBytes: number; + /** Number of hours for the retention of the data for this topic */ + retentionHours: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/TopicAcl.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/TopicAcl.ts new file mode 100644 index 000000000000..1f364051a22f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/TopicAcl.ts @@ -0,0 +1,11 @@ +/** Cloud databases kafka topic acl definition */ +export interface TopicAcl { + /** Acl ID */ + id?: string; + /** Permission to give to this username on this topic. Permissions values can be retrieved using /cloud/project/{serviceName}/database/kafka/{clusterId}/permissions */ + permission: string; + /** Topic affected by this acl */ + topic: string; + /** Username affected by this acl */ + username: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/TopicCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/TopicCreation.ts new file mode 100644 index 000000000000..3874c67544a8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/TopicCreation.ts @@ -0,0 +1,17 @@ +/** Cloud database kafka topic creation definition */ +export interface TopicCreation { + /** Topic ID */ + id?: string; + /** Minimum insync replica accepted for this topic */ + minInsyncReplicas: number; + /** Name of the topic */ + name: string; + /** Number of partitions for this topic */ + partitions: number; + /** Number of replication for this topic */ + replication: number; + /** Number of bytes for the retention of the data for this topic */ + retentionBytes: number; + /** Number of hours for the retention of the data for this topic */ + retentionHours: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/index.ts new file mode 100644 index 000000000000..f84594fa360d --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/index.ts @@ -0,0 +1,9 @@ +import * as user from './user/index'; + +export * from './Permissions'; +export * from './SchemaRegistryAcl'; +export * from './Service'; +export * from './Topic'; +export * from './TopicAcl'; +export * from './TopicCreation'; +export { user }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/user/Access.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/user/Access.ts new file mode 100644 index 000000000000..abc7eead6306 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/user/Access.ts @@ -0,0 +1,7 @@ +/** Cloud databases kafka user access definition */ +export interface Access { + /** User cert */ + cert?: string; + /** User key for the cert */ + key?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/user/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/user/index.ts new file mode 100644 index 000000000000..984b9aa739fe --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafka/user/index.ts @@ -0,0 +1 @@ +export * from './Access'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/Connector.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/Connector.ts new file mode 100644 index 000000000000..071254946c19 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/Connector.ts @@ -0,0 +1,15 @@ +import { StatusEnum } from '@/types/cloud/project/database/kafkaConnect/connector/StatusEnum'; + +/** KafkaConnect connector definition */ +export interface Connector { + /** Configuration of the connector */ + configuration: { [key: string]: string }; + /** Connector capability ID */ + connectorId?: string; + /** Connector ID */ + id?: string; + /** Name of the connector */ + name?: string; + /** Status of the connector */ + status?: StatusEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/ConnectorCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/ConnectorCreation.ts new file mode 100644 index 000000000000..cc1dc060670b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/ConnectorCreation.ts @@ -0,0 +1,9 @@ +/** KafkaConnect connector definition */ +export interface ConnectorCreation { + /** Configuration of the connector */ + configuration: { [key: string]: string }; + /** Connector capability ID */ + connectorId: string; + /** Name of the connector */ + name: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/Connector.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/Connector.ts new file mode 100644 index 000000000000..022acf8b031c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/Connector.ts @@ -0,0 +1,21 @@ +import { TypeEnum } from '@/types/cloud/project/database/kafkaConnect/capabilities/connector/TypeEnum'; + +/** KafkaConnect connector capability definition */ +export interface Connector { + /** Name of the connector's author */ + author?: string; + /** URL of the official documentation of the connector */ + documentationUrl?: string; + /** Connector ID */ + id?: string; + /** Defines whether this connector and version is the latest available */ + latest?: boolean; + /** Name of the connector */ + name?: string; + /** Defines whether the connector is in preview */ + preview?: boolean; + /** Type of connector */ + type?: TypeEnum; + /** Version of the connector */ + version?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/Transform.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/Transform.ts new file mode 100644 index 000000000000..d1c5c5ba84f0 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/Transform.ts @@ -0,0 +1,19 @@ +import { TypeEnum } from '@/types/cloud/project/database/kafkaConnect/connector/property/TypeEnum'; + +/** KafkaConnect connector transform definition */ +export interface Transform { + /** Description of the transform */ + description?: string; + /** Pretty name of the transform */ + displayName?: string; + /** Name of the transform */ + name?: string; + /** Defines whether the transform is required */ + required?: boolean; + /** Transform type this transform relates to */ + transformType?: string; + /** Type of data of the transform */ + type?: TypeEnum; + /** Possible values for the transform if applicable */ + values?: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/TypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/TypeEnum.ts new file mode 100644 index 000000000000..82b41100780c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/TypeEnum.ts @@ -0,0 +1,5 @@ +/** Possible types for the kafka connectors */ +export enum TypeEnum { + 'sink' = 'sink', + 'source' = 'source', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/configuration/Property.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/configuration/Property.ts new file mode 100644 index 000000000000..8116362ce206 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/configuration/Property.ts @@ -0,0 +1,24 @@ +import { ImportanceEnum } from '@/types/cloud/project/database/kafkaConnect/capabilities/connector/property/ImportanceEnum'; +import { TypeEnum } from '@/types/cloud/project/database/kafkaConnect/connector/property/TypeEnum'; + +/** KafkaConnect connector config property definition */ +export interface Property { + /** Defines the default value is exists */ + defaultValue?: string; + /** Description of the property */ + description?: string; + /** Pretty name of the property */ + displayName?: string; + /** Group to which belongs the property */ + group?: string; + /** Importance of the property */ + importance?: ImportanceEnum; + /** Name of the property */ + name?: string; + /** Defines whether the property is required */ + required?: boolean; + /** Type of data of the property */ + type?: TypeEnum; + /** Possible values for the property if string and applicable */ + values?: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/configuration/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/configuration/index.ts new file mode 100644 index 000000000000..1a4ad04e85cf --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/configuration/index.ts @@ -0,0 +1 @@ +export * from './Property'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/index.ts new file mode 100644 index 000000000000..e251135bc577 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/index.ts @@ -0,0 +1,7 @@ +import * as configuration from './configuration/index'; +import * as property from './property/index'; + +export * from './Transform'; +export * from './TypeEnum'; +export { configuration }; +export { property }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/property/ImportanceEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/property/ImportanceEnum.ts new file mode 100644 index 000000000000..57801806f491 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/property/ImportanceEnum.ts @@ -0,0 +1,6 @@ +/** Possible importance for the kafka connectors properties */ +export enum ImportanceEnum { + 'high' = 'high', + 'low' = 'low', + 'medium' = 'medium', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/property/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/property/index.ts new file mode 100644 index 000000000000..fb99ec4e5d94 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/connector/property/index.ts @@ -0,0 +1 @@ +export * from './ImportanceEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/index.ts new file mode 100644 index 000000000000..dbff178adfb2 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/capabilities/index.ts @@ -0,0 +1,4 @@ +import * as connector from './connector/index'; + +export * from './Connector'; +export { connector }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/StatusEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/StatusEnum.ts new file mode 100644 index 000000000000..3387df0f28ce --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/StatusEnum.ts @@ -0,0 +1,8 @@ +/** Possible state of connector */ +export enum StatusEnum { + 'CREATING' = 'CREATING', + 'FAILED' = 'FAILED', + 'PAUSED' = 'PAUSED', + 'RUNNING' = 'RUNNING', + 'UNASSIGNED' = 'UNASSIGNED', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/Task.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/Task.ts new file mode 100644 index 000000000000..551270b7b3e2 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/Task.ts @@ -0,0 +1,11 @@ +import { StatusEnum } from '@/types/cloud/project/database/kafkaConnect/connector/task/StatusEnum'; + +/** KafkaConnect connector definition */ +export interface Task { + /** Task ID */ + id?: number; + /** Status of the task */ + status?: StatusEnum; + /** Trace of the task */ + trace?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/index.ts new file mode 100644 index 000000000000..12fb7e3f0469 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/index.ts @@ -0,0 +1,7 @@ +import * as property from './property/index'; +import * as task from './task/index'; + +export * from './StatusEnum'; +export * from './Task'; +export { property }; +export { task }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/property/TypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/property/TypeEnum.ts new file mode 100644 index 000000000000..3bfe3ef5ba7c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/property/TypeEnum.ts @@ -0,0 +1,13 @@ +/** Possible types for the kafka connectors properties */ +export enum TypeEnum { + 'boolean' = 'boolean', + 'class' = 'class', + 'double' = 'double', + 'int16' = 'int16', + 'int32' = 'int32', + 'int64' = 'int64', + 'list' = 'list', + 'password' = 'password', + 'string' = 'string', + 'transform' = 'transform', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/property/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/property/index.ts new file mode 100644 index 000000000000..333912f82871 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/property/index.ts @@ -0,0 +1 @@ +export * from './TypeEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/task/StatusEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/task/StatusEnum.ts new file mode 100644 index 000000000000..bca60a8b0e31 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/task/StatusEnum.ts @@ -0,0 +1,6 @@ +/** Possible state of connector task */ +export enum StatusEnum { + 'FAILED' = 'FAILED', + 'PAUSED' = 'PAUSED', + 'RUNNING' = 'RUNNING', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/task/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/task/index.ts new file mode 100644 index 000000000000..8c73e9dd9135 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/connector/task/index.ts @@ -0,0 +1 @@ +export * from './StatusEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/index.ts new file mode 100644 index 000000000000..bf39937f0e8e --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/kafkaConnect/index.ts @@ -0,0 +1,7 @@ +import * as capabilities from './capabilities/index'; +import * as connector from './connector/index'; + +export * from './Connector'; +export * from './ConnectorCreation'; +export { capabilities }; +export { connector }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/Namespace.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/Namespace.ts new file mode 100644 index 000000000000..4bcd3db52acf --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/Namespace.ts @@ -0,0 +1,20 @@ +import { Retention } from '@/types/cloud/project/database/m3db/namespace/Retention'; +import { TypeEnum } from '@/types/cloud/project/database/m3db/namespace/TypeEnum'; + +/** M3db Namespace definition */ +export interface Namespace { + /** Namespace ID */ + id?: string; + /** Name of the namespace */ + name?: string; + /** Resolution for an aggregated namespace */ + resolution: string; + /** Retention configuration */ + retention: Retention; + /** Defines whether M3db will create snapshot files for this namespace */ + snapshotEnabled: boolean; + /** Type of namespace */ + type?: TypeEnum; + /** Defines whether M3db will include writes to this namespace in the commit log */ + writesToCommitLogEnabled: boolean; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/NamespaceCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/NamespaceCreation.ts new file mode 100644 index 000000000000..219618c8079d --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/NamespaceCreation.ts @@ -0,0 +1,20 @@ +import { Retention } from '@/types/cloud/project/database/m3db/namespace/Retention'; +import { TypeEnum } from '@/types/cloud/project/database/m3db/namespace/TypeEnum'; + +/** M3db Namespace creation definition */ +export interface NamespaceCreation { + /** Namespace ID */ + id?: string; + /** Name of the namespace */ + name: string; + /** Resolution for an aggregated namespace */ + resolution: string; + /** Retention configuration */ + retention: Retention; + /** Defines whether M3db will create snapshot files for this namespace */ + snapshotEnabled: boolean; + /** Type of namespace */ + type: TypeEnum; + /** Defines whether M3db will include writes to this namespace in the commit log */ + writesToCommitLogEnabled: boolean; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/User.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/User.ts new file mode 100644 index 000000000000..2495f010c05c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/User.ts @@ -0,0 +1,15 @@ +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** M3db User definition */ +export interface User { + /** Date of the creation of the user */ + createdAt?: string; + /** Group of the user */ + group: string; + /** User ID */ + id?: string; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/UserCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/UserCreation.ts new file mode 100644 index 000000000000..a152c8901a88 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/UserCreation.ts @@ -0,0 +1,7 @@ +/** User creation definition */ +export interface UserCreation { + /** Group of the user */ + group: string; + /** Name of the user */ + name: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/UserWithPassword.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/UserWithPassword.ts new file mode 100644 index 000000000000..8573e328cf6f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/UserWithPassword.ts @@ -0,0 +1,17 @@ +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** M3db User definition */ +export interface UserWithPassword { + /** Date of the creation of the user */ + createdAt?: string; + /** Group of the user */ + group?: string; + /** User ID */ + id?: string; + /** Password of the user */ + password?: string; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/index.ts new file mode 100644 index 000000000000..ebeb8437ba99 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/index.ts @@ -0,0 +1,8 @@ +import * as namespace from './namespace/index'; + +export * from './Namespace'; +export * from './NamespaceCreation'; +export * from './User'; +export * from './UserCreation'; +export * from './UserWithPassword'; +export { namespace }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/Retention.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/Retention.ts new file mode 100644 index 000000000000..4cceac0f5494 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/Retention.ts @@ -0,0 +1,13 @@ +/** M3db namespace retention definition */ +export interface Retention { + /** Controls how long we wait before expiring stale data */ + blockDataExpirationDuration?: string; + /** Controls how long to keep a block in memory before flushing to a fileset on disk */ + blockSizeDuration?: string; + /** Controls how far into the future writes to the namespace will be accepted */ + bufferFutureDuration?: string; + /** Controls how far into the past writes to the namespace will be accepted */ + bufferPastDuration?: string; + /** Controls the duration of time that M3DB will retain data for the namespace */ + periodDuration: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/TypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/TypeEnum.ts new file mode 100644 index 000000000000..8f96255079bf --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/TypeEnum.ts @@ -0,0 +1,5 @@ +/** Possible type of the service integration */ +export enum TypeEnum { + 'aggregated' = 'aggregated', + 'unaggregated' = 'unaggregated', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/index.ts new file mode 100644 index 000000000000..2337691fd7b4 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/m3db/namespace/index.ts @@ -0,0 +1,2 @@ +export * from './Retention'; +export * from './TypeEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/QueryStatistics.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/QueryStatistics.ts new file mode 100644 index 000000000000..ed8fa2f87cca --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/QueryStatistics.ts @@ -0,0 +1,7 @@ +import { Query } from '@/types/cloud/project/database/mysql/querystatistics/Query'; + +/** Cloud database mysql query statistics response body definition */ +export interface QueryStatistics { + /** Statistics of the queries */ + queries?: Query[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/index.ts new file mode 100644 index 000000000000..ce49141ffab7 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/index.ts @@ -0,0 +1,4 @@ +import * as querystatistics from './querystatistics/index'; + +export * from './QueryStatistics'; +export { querystatistics }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/querystatistics/Query.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/querystatistics/Query.ts new file mode 100644 index 000000000000..7494fe31b3db --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/querystatistics/Query.ts @@ -0,0 +1,73 @@ +/** Cloud database mysql single query statistic definition */ +export interface Query { + /** Average wait time of the summarized timed events, in milliseconds */ + avgTimerWait?: number; + /** Number of summarized events. This value includes all events, whether timed or nontimed */ + countStar?: number; + /** Digest of the summarized events */ + digest?: string; + /** Text of the summarized digest events */ + digestText?: string; + /** First appearance of the events */ + firstSeen?: string; + /** Last appearance of the events */ + lastSeen?: string; + /** Maximum wait time of the summarized timed events, in milliseconds */ + maxTimerWait?: number; + /** Mininum wait time of the summarized timed events, in milliseconds */ + minTimerWait?: number; + /** 95th percentile of the statement latency, in picoseconds */ + quantile95?: number; + /** 99th percentile of the statement latency, in picoseconds */ + quantile99?: number; + /** 99.9th percentile of the statement latency, in picoseconds */ + quantile999?: number; + /** Datetime when the querySampleText column was seen */ + querySampleSeen?: string; + /** Sample SQL statement that produces the digest value in the row */ + querySampleText?: string; + /** Wait time for the sample statement in the querySampleText column, in milliseconds */ + querySampleTimerWait?: number; + /** SchemaName of the summarized events */ + schemaName?: string; + /** Number of internal on-disk temporary tables created */ + sumCreatedTmpDiskTables?: number; + /** Number of internal temporary tables created */ + sumCreatedTmpTables?: number; + /** Number of errors */ + sumErrors?: number; + /** Sum of lock time of the summarized timed events, in milliseconds */ + sumLockTime?: number; + /** Sum of not good indexes of the summarized timed events */ + sumNoGoodIndexUsed?: number; + /** Sum of no indexes of the summarized timed events */ + sumNoIndexUsed?: number; + /** Sum of rows affected of the summarized timed events */ + sumRowsAffected?: number; + /** Sum of rows examined of the summarized timed events */ + sumRowsExamined?: number; + /** Sum of rows sent of the summarized timed events */ + sumRowsSent?: number; + /** Sum of select full join of the summarized timed events */ + sumSelectFullJoin?: number; + /** Sum of select full range join of the summarized timed events */ + sumSelectFullRangeJoin?: number; + /** Sum of select range of the summarized timed events */ + sumSelectRange?: number; + /** Sum of select range check of the summarized timed events */ + sumSelectRangeCheck?: number; + /** Sum of select scan of the summarized timed events */ + sumSelectScan?: number; + /** Sum of sorted merge passes of the summarized timed events */ + sumSortMergePasses?: number; + /** Sum of sorted range of the summarized timed events */ + sumSortRange?: number; + /** Sum of sorted rows of the summarized timed events */ + sumSortRows?: number; + /** Sum of sort scan of the summarized timed events */ + sumSortScan?: number; + /** Sum of wait time of the summarized timed events, in milliseconds */ + sumTimerWait?: number; + /** Number of warnings */ + sumWarnings?: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/querystatistics/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/querystatistics/index.ts new file mode 100644 index 000000000000..62cee3b1dc28 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/mysql/querystatistics/index.ts @@ -0,0 +1 @@ +export * from './Query'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Pattern.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Pattern.ts new file mode 100644 index 000000000000..5e9fbd2256f5 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Pattern.ts @@ -0,0 +1,9 @@ +/** Cloud database opensearch pattern definition */ +export interface Pattern { + /** Pattern ID */ + id?: string; + /** Maximum number of index for this pattern */ + maxIndexCount: number; + /** Pattern format */ + pattern: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Permissions.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Permissions.ts new file mode 100644 index 000000000000..5153454be39f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Permissions.ts @@ -0,0 +1,5 @@ +/** Cloud database opensearch permissions definition */ +export interface Permissions { + /** Possible values for the permissions */ + names?: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Service.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Service.ts new file mode 100644 index 000000000000..e8ceb45ab06a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/Service.ts @@ -0,0 +1,62 @@ +import { Time } from '@/types/Time'; +import { Backup } from '@/types/cloud/project/database/service/Backup'; +import { CapabilityActions } from '@/types/cloud/project/database/service/CapabilityActions'; +import { CategoryEnum } from '@/types/cloud/project/database/engine/CategoryEnum'; +import { Disk } from '@/types/cloud/project/database/service/Disk'; +import { Endpoint } from '@/types/cloud/project/database/service/Endpoint'; +import { EngineEnum } from '@/types/cloud/project/database/EngineEnum'; +import { IpRestriction } from '@/types/cloud/project/database/service/IpRestriction'; +import { NetworkTypeEnum } from '@/types/cloud/project/database/NetworkTypeEnum'; +import { Node } from '@/types/cloud/project/database/service/Node'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; +import { Storage } from '@/types/cloud/project/database/service/Storage'; + +/** Cloud database opensearch service definition */ +export interface Service { + /** Defines whether the acls are enabled on the cluster */ + aclsEnabled: boolean; + /** Time on which backups start every day. DEPRECATED: use backups.time */ + backupTime: Time; + /** Information related to the backups, null if the engine does not support backups */ + backups: Backup; + /** Capabilities of the services */ + capabilities?: { [key: string]: CapabilityActions }; + /** Category of the engine */ + category?: CategoryEnum; + /** Date of the creation of the cluster */ + createdAt?: string; + /** Description of the cluster */ + description: string; + /** Disk attributes of the cluster. DEPRECATED: use storage */ + disk: Disk; + /** List of all endpoints of the service */ + endpoints?: Endpoint[]; + /** Name of the engine of the service */ + engine?: EngineEnum; + /** The VM flavor used for this cluster */ + flavor: string; + /** Service ID */ + id?: string; + /** IP Blocks authorized to access to the cluster */ + ipRestrictions: IpRestriction[]; + /** Time on which maintenances can start every day */ + maintenanceTime: Time; + /** Private network ID in which the cluster is */ + networkId?: string; + /** Type of network of the cluster */ + networkType?: NetworkTypeEnum; + /** Number of nodes in the cluster. DEPRECATED: use nodes */ + nodeNumber: number; + /** Nodes of the cluster */ + nodes?: Node[]; + /** Plan of the cluster */ + plan: string; + /** Current status of the cluster */ + status?: StatusEnum; + /** Storage attributes of the cluster */ + storage: Storage; + /** Private subnet ID in which the cluster is */ + subnetId?: string; + /** Version of the engine deployed on the cluster */ + version: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/User.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/User.ts new file mode 100644 index 000000000000..d8d4c4ee26f1 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/User.ts @@ -0,0 +1,16 @@ +import { UserAcl } from '@/types/cloud/project/database/opensearch/UserAcl'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** Opensearch user definition */ +export interface User { + /** Acls of the user */ + acls: UserAcl[]; + /** Date of the creation of the user */ + createdAt?: string; + /** User ID */ + id?: string; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserAcl.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserAcl.ts new file mode 100644 index 000000000000..591aafe723b4 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserAcl.ts @@ -0,0 +1,7 @@ +/** Opensearch user acl definition */ +export interface UserAcl { + /** Pattern of the ACL */ + pattern: string; + /** Permission of the ACL */ + permission: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserCreation.ts new file mode 100644 index 000000000000..fdbcce041fca --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserCreation.ts @@ -0,0 +1,9 @@ +import { UserAcl } from '@/types/cloud/project/database/opensearch/UserAcl'; + +/** Opensearch user creation definition */ +export interface UserCreation { + /** Acls of the user */ + acls: UserAcl[]; + /** Name of the user */ + name: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserWithPassword.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserWithPassword.ts new file mode 100644 index 000000000000..f2512238d67f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/UserWithPassword.ts @@ -0,0 +1,18 @@ +import { UserAcl } from '@/types/cloud/project/database/opensearch/UserAcl'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** Opensearch user definition */ +export interface UserWithPassword { + /** Acls of the user */ + acls?: UserAcl[]; + /** Date of the creation of the user */ + createdAt?: string; + /** User ID */ + id?: string; + /** Password of the user */ + password?: string; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/index.ts new file mode 100644 index 000000000000..1780c1c08867 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/opensearch/index.ts @@ -0,0 +1,24 @@ +/** Cloud database opensearch index definition */ +export interface Index { + /** Date of the creation of the index */ + createdAt?: string; + /** Number of documents hold by the index */ + documents?: number; + /** Index ID */ + id?: string; + /** Name of the index */ + name?: string; + /** Number of replicas of the index */ + replicasNumber?: number; + /** Number of shards of the index */ + shardsNumber?: number; + /** Size of the index */ + size?: number; +} +export * from './Pattern'; +export * from './Permissions'; +export * from './Service'; +export * from './User'; +export * from './UserAcl'; +export * from './UserCreation'; +export * from './UserWithPassword'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/ConnectionPool.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/ConnectionPool.ts new file mode 100644 index 000000000000..8686430fcbc0 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/ConnectionPool.ts @@ -0,0 +1,24 @@ +import { ModeEnum } from '@/types/cloud/project/database/postgresql/connectionpool/ModeEnum'; +import { SslModeEnum } from '@/types/cloud/project/database/postgresql/connectionpool/SslModeEnum'; + +/** Cloud database postgresql connection pool response body definition */ +export interface ConnectionPool { + /** Database used for the connection pool */ + databaseId: string; + /** ID of the connection pool */ + id?: string; + /** Connection mode to the connection pool */ + mode: ModeEnum; + /** Name of the connection pool */ + name?: string; + /** Port of the connection pool */ + port?: number; + /** Size of the connection pool */ + size: number; + /** Ssl connection mode for the pool */ + sslMode?: SslModeEnum; + /** Connection URI to the pool */ + uri?: string; + /** User authorized to connect to the pool, if none all the users are allowed */ + userId?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/ConnectionPoolCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/ConnectionPoolCreation.ts new file mode 100644 index 000000000000..95ae44eb2da2 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/ConnectionPoolCreation.ts @@ -0,0 +1,15 @@ +import { ModeEnum } from '@/types/cloud/project/database/postgresql/connectionpool/ModeEnum'; + +/** Cloud database postgresql connection pool creation body definition */ +export interface ConnectionPoolCreation { + /** Database used for the connection pool */ + databaseId: string; + /** Connection mode to the connection pool */ + mode: ModeEnum; + /** Name of the connection pool */ + name: string; + /** Size of the connection pool */ + size: number; + /** User authorized to connect to the pool, if none all the users are allowed */ + userId: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/QueryStatistics.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/QueryStatistics.ts new file mode 100644 index 000000000000..7e58335a2003 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/QueryStatistics.ts @@ -0,0 +1,7 @@ +import { Query } from '@/types/cloud/project/database/postgresql/querystatistics/Query'; + +/** Cloud database postgresql query statistics response body definition */ +export interface QueryStatistics { + /** Statistics of the queries */ + queries?: Query[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/ModeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/ModeEnum.ts new file mode 100644 index 000000000000..d05c630104e5 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/ModeEnum.ts @@ -0,0 +1,6 @@ +/** Possible modes for the connection pools */ +export enum ModeEnum { + 'session' = 'session', + 'statement' = 'statement', + 'transaction' = 'transaction', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/SslModeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/SslModeEnum.ts new file mode 100644 index 000000000000..5a47723a8dcc --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/SslModeEnum.ts @@ -0,0 +1,4 @@ +/** Possible ssl modes for the connection pools */ +export enum SslModeEnum { + 'require' = 'require', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/index.ts new file mode 100644 index 000000000000..5de5acfeccbf --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/connectionpool/index.ts @@ -0,0 +1,2 @@ +export * from './ModeEnum'; +export * from './SslModeEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/index.ts new file mode 100644 index 000000000000..27124b91fb45 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/index.ts @@ -0,0 +1,8 @@ +import * as connectionpool from './connectionpool/index'; +import * as querystatistics from './querystatistics/index'; + +export * from './ConnectionPool'; +export * from './ConnectionPoolCreation'; +export * from './QueryStatistics'; +export { connectionpool }; +export { querystatistics }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/querystatistics/Query.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/querystatistics/Query.ts new file mode 100644 index 000000000000..257ddf5fe50f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/querystatistics/Query.ts @@ -0,0 +1,65 @@ +import { UnitAndValueLong } from '@/types/complexType/UnitAndValueLong'; + +/** Cloud database postgresql single query statistic definition */ +export interface Query { + /** Time spent reading data file blocks by backends in this database, in milliseconds */ + blkReadTime?: number; + /** Time spent writing data file blocks by backends in this database, in milliseconds */ + blkWriteTime?: number; + /** Number of times this function has been called */ + calls?: number; + /** Name of the database */ + databaseName?: string; + /** Total number of local blocks dirtied by the statement */ + localBlksDirtied?: number; + /** Total number of local block cache hits by the statement */ + localBlksHit?: number; + /** Total number of local blocks read by the statement */ + localBlksRead?: number; + /** Total number of local blocks written by the statement */ + localBlksWritten?: number; + /** Maximum time spent planning the statement, in milliseconds */ + maxPlanTime?: number; + /** Maximum time spent for the statement, in milliseconds */ + maxTime?: number; + /** Mean time spent planning the statement, in milliseconds */ + meanPlanTime?: number; + /** Mean time spent for the statement, in milliseconds */ + meanTime?: number; + /** Minimum time spent planning the statement, in milliseconds */ + minPlanTime?: number; + /** Minimum time spent for the statement, in milliseconds */ + minTime?: number; + /** Text of a representative statement */ + query?: string; + /** Total number of rows retrieved or affected by the statement */ + rows?: number; + /** Total number of shared blocks dirtied by the statement */ + sharedBlksDirtied?: number; + /** Total number of shared block cache hits by the statement */ + sharedBlksHit?: number; + /** Total number of shared blocks read by the statement */ + sharedBlksRead?: number; + /** Total number of shared blocks written by the statement */ + sharedBlksWritten?: number; + /** Population standard deviation of time spent planning the statement, in milliseconds */ + stddevPlanTime?: number; + /** Population standard deviation of time spent for the statement, in milliseconds */ + stddevTime?: number; + /** Total number of temp blocks read by the statement */ + tempBlksRead?: number; + /** Total number of temp blocks written by the statement */ + tempBlksWritten?: number; + /** Total time spent planning the statement, in milliseconds */ + totalPlanTime?: number; + /** Total time spent for the statement, in milliseconds */ + totalTime?: number; + /** Name of the user who executed the statement */ + username?: string; + /** Total amount of WAL generated by the statement in bytes */ + walBytes?: UnitAndValueLong; + /** Total number of WAL full page images generated by the statement */ + walFpi?: number; + /** Total number of WAL records generated by the statement */ + walRecords?: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/querystatistics/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/querystatistics/index.ts new file mode 100644 index 000000000000..62cee3b1dc28 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/postgresql/querystatistics/index.ts @@ -0,0 +1 @@ +export * from './Query'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/User.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/User.ts new file mode 100644 index 000000000000..e54ef6361591 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/User.ts @@ -0,0 +1,21 @@ +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** Redis user definition */ +export interface User { + /** Categories of the user */ + categories: string[]; + /** Channels of the user */ + channels: string[]; + /** Commands of the user */ + commands: string[]; + /** Date of the creation of the user */ + createdAt?: string; + /** User ID */ + id?: string; + /** Keys of the user */ + keys: string[]; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/UserCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/UserCreation.ts new file mode 100644 index 000000000000..6e03ead9ca83 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/UserCreation.ts @@ -0,0 +1,13 @@ +/** Redis user definition */ +export interface UserCreation { + /** Categories of the user */ + categories: string[]; + /** Channels of the user */ + channels: string[]; + /** Commands of the user */ + commands: string[]; + /** Keys of the user */ + keys: string[]; + /** Name of the user */ + name: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/UserWithPassword.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/UserWithPassword.ts new file mode 100644 index 000000000000..a125f7f63a55 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/UserWithPassword.ts @@ -0,0 +1,23 @@ +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** Redis user with password definition */ +export interface UserWithPassword { + /** Categories of the user */ + categories?: string[]; + /** Channels of the user */ + channels?: string[]; + /** Commands of the user */ + commands?: string[]; + /** Date of the creation of the user */ + createdAt?: string; + /** User ID */ + id?: string; + /** Keys of the user */ + keys?: string[]; + /** Password of the user */ + password?: string; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/index.ts new file mode 100644 index 000000000000..5381c756106d --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/redis/index.ts @@ -0,0 +1,3 @@ +export * from './User'; +export * from './UserCreation'; +export * from './UserWithPassword'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Backup.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Backup.ts new file mode 100644 index 000000000000..28430f248f08 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Backup.ts @@ -0,0 +1,13 @@ +import { Time } from '@/types/Time'; + +/** Cloud database service backups definition */ +export interface Backup { + /** Date until PITR is available */ + pitr?: string; + /** Regions on which the backups are stored */ + regions: string[]; + /** Number of retention days for the backups */ + retentionDays?: number; + /** Time on which backups start every day */ + time: Time; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CapabilityActions.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CapabilityActions.ts new file mode 100644 index 000000000000..bba10d676b35 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CapabilityActions.ts @@ -0,0 +1,13 @@ +import { StateEnum } from '@/types/cloud/project/database/service/capability/StateEnum'; + +/** Cloud database service capability actions definition */ +export interface CapabilityActions { + /** Defines if the capability can be created */ + create?: StateEnum; + /** Defines if the capability can be deleted */ + delete?: StateEnum; + /** Defines if the capability can be read */ + read?: StateEnum; + /** Defines if the capability can be updated */ + update?: StateEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CapabilityEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CapabilityEnum.ts new file mode 100644 index 000000000000..dc1015cd53fb --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CapabilityEnum.ts @@ -0,0 +1,26 @@ +/** List of capabilities available for services */ +export enum CapabilityEnum { + 'advancedConfiguration' = 'advancedConfiguration', + 'backupRestore' = 'backupRestore', + 'backupTime' = 'backupTime', + 'backups' = 'backups', + 'certificates' = 'certificates', + 'connectionPools' = 'connectionPools', + 'currentQueries' = 'currentQueries', + 'currentQueriesCancel' = 'currentQueriesCancel', + 'databases' = 'databases', + 'enableWrites' = 'enableWrites', + 'fork' = 'fork', + 'integrations' = 'integrations', + 'ipRestrictions' = 'ipRestrictions', + 'maintenanceApply' = 'maintenanceApply', + 'maintenanceTime' = 'maintenanceTime', + 'maintenances' = 'maintenances', + 'namespaces' = 'namespaces', + 'nodes' = 'nodes', + 'queryStatistics' = 'queryStatistics', + 'queryStatisticsReset' = 'queryStatisticsReset', + 'service' = 'service', + 'userCredentialsReset' = 'userCredentialsReset', + 'users' = 'users', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Certificates.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Certificates.ts new file mode 100644 index 000000000000..b044a80d1fdf --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Certificates.ts @@ -0,0 +1,5 @@ +/** Certificates definition for cloud project databases */ +export interface Certificates { + /** CA certificate used for the service */ + ca?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CurrentQueries.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CurrentQueries.ts new file mode 100644 index 000000000000..7eabcd827ffc --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/CurrentQueries.ts @@ -0,0 +1,7 @@ +import { Query } from '@/types/cloud/project/database/service/currentqueries/Query'; + +/** Cloud database current queries */ +export interface CurrentQueries { + /** Current queries list */ + queries?: Query[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/DataPoint.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/DataPoint.ts new file mode 100644 index 000000000000..fd47cafd2541 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/DataPoint.ts @@ -0,0 +1,7 @@ +/** A single value from a metric */ +export interface DataPoint { + /** Timestamp in seconds since epoch time */ + timestamp?: number; + /** Value of this datapoint */ + value?: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Database.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Database.ts new file mode 100644 index 000000000000..83549c1ced76 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Database.ts @@ -0,0 +1,9 @@ +/** Defines the database object in a cluster */ +export interface Database { + /** Defines if the database has been created by default */ + default?: boolean; + /** Database ID */ + id?: string; + /** Database name */ + name: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Disk.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Disk.ts new file mode 100644 index 000000000000..93a7c599cd2f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Disk.ts @@ -0,0 +1,7 @@ +/** Defines the disk attributes of a service */ +export interface Disk { + /** Service disk size */ + size: number; + /** Service disk size */ + type?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Endpoint.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Endpoint.ts new file mode 100644 index 000000000000..0bcf8ca649f8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Endpoint.ts @@ -0,0 +1,21 @@ +import { ComponentEnum } from '@/types/cloud/project/database/service/endpoint/ComponentEnum'; + +/** Defines the endpoint object in a cluster */ +export interface Endpoint { + /** Type of component the URI relates to */ + component?: ComponentEnum; + /** Domain of the cluster */ + domain?: string; + /** Path of the endpoint */ + path?: string; + /** Connection port for the endpoint */ + port?: number; + /** Scheme used to generate the URI */ + scheme?: string; + /** Defines whether the endpoint uses SSL */ + ssl?: boolean; + /** SSL mode used to connect to the service if the SSL is enabled */ + sslMode?: string; + /** URI of the endpoint */ + uri?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/HostMetric.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/HostMetric.ts new file mode 100644 index 000000000000..afff768ff0a0 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/HostMetric.ts @@ -0,0 +1,9 @@ +import { DataPoint } from '@/types/cloud/project/database/service/DataPoint'; + +/** Metrics datapoints from a specific host */ +export interface HostMetric { + /** List of metric's samples */ + dataPoints?: DataPoint[]; + /** Name of the originating host */ + hostname?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Integration.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Integration.ts new file mode 100644 index 000000000000..cb276cd61ae3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Integration.ts @@ -0,0 +1,18 @@ +import { StatusEnum } from '@/types/cloud/project/database/service/integration/StatusEnum'; +import { TypeEnum } from '@/types/cloud/project/database/service/integration/TypeEnum'; + +/** Cloud database service integration definition */ +export interface Integration { + /** ID of the destination service */ + destinationServiceId: string; + /** Service ID */ + id?: string; + /** Parameters for the integration */ + parameters?: { [key: string]: string }; + /** ID of the source service */ + sourceServiceId: string; + /** Current status of the integration */ + status?: StatusEnum; + /** Type of the integration */ + type: TypeEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/IpRestriction.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/IpRestriction.ts new file mode 100644 index 000000000000..4f1838c66f10 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/IpRestriction.ts @@ -0,0 +1,12 @@ +import { IpBlock } from '@/types/IpBlock'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** Ip Restriction definition for cloud project databases */ +export interface IpRestriction { + /** Description of the ip restriction */ + description: string; + /** Whitelisted IP */ + ip: IpBlock; + /** Current status of the ip restriction */ + status?: StatusEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/LogEntry.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/LogEntry.ts new file mode 100644 index 000000000000..64029447d2b4 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/LogEntry.ts @@ -0,0 +1,9 @@ +/** A single log entry */ +export interface LogEntry { + /** Host from which the log is coming from */ + hostname?: string; + /** The log message */ + message?: string; + /** Timestamp in seconds since epoch time */ + timestamp?: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Maintenance.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Maintenance.ts new file mode 100644 index 000000000000..ef04a3705773 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Maintenance.ts @@ -0,0 +1,15 @@ +import { StatusEnum } from '@/types/cloud/project/database/service/maintenance/StatusEnum'; + +/** Cloud database service maintenance definition */ +export interface Maintenance { + /** Date of the application of the maintenance */ + appliedAt?: string; + /** Description of the maintenance */ + description?: string; + /** ID of the maintenance */ + id?: string; + /** Date of the planification of the maintenance */ + scheduledAt?: string; + /** Status of the maintenance */ + status?: StatusEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Metric.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Metric.ts new file mode 100644 index 000000000000..8212bd5135ab --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Metric.ts @@ -0,0 +1,12 @@ +import { HostMetric } from '@/types/cloud/project/database/service/HostMetric'; +import { MetricUnitEnum } from '@/types/cloud/project/database/service/MetricUnitEnum'; + +/** Metric definition for cloud project databases */ +export interface Metric { + /** Metric values for each cluster's host */ + metrics?: HostMetric[]; + /** Name of the metric */ + name?: string; + /** Unit of the metric */ + units?: MetricUnitEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/MetricPeriodEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/MetricPeriodEnum.ts new file mode 100644 index 000000000000..4bc4e9e34ed4 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/MetricPeriodEnum.ts @@ -0,0 +1,8 @@ +/** Supported metrics query period */ +export enum MetricPeriodEnum { + 'lastDay' = 'lastDay', + 'lastHour' = 'lastHour', + 'lastMonth' = 'lastMonth', + 'lastWeek' = 'lastWeek', + 'lastYear' = 'lastYear', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/MetricUnitEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/MetricUnitEnum.ts new file mode 100644 index 000000000000..d2d130f66c0c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/MetricUnitEnum.ts @@ -0,0 +1,15 @@ +/** Supported unit types for metrics */ +export enum MetricUnitEnum { + 'BYTES' = 'BYTES', + 'BYTES_PER_SECOND' = 'BYTES_PER_SECOND', + 'GIGABYTES' = 'GIGABYTES', + 'GIGABYTES_PER_HOUR' = 'GIGABYTES_PER_HOUR', + 'MEGABYTES' = 'MEGABYTES', + 'MEGABYTES_PER_SECOND' = 'MEGABYTES_PER_SECOND', + 'MILLISECONDS' = 'MILLISECONDS', + 'PERCENT' = 'PERCENT', + 'SCALAR' = 'SCALAR', + 'SCALAR_PER_SECOND' = 'SCALAR_PER_SECOND', + 'SECONDS' = 'SECONDS', + 'UNKNOWN' = 'UNKNOWN', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Node.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Node.ts new file mode 100644 index 000000000000..645e9494238b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Node.ts @@ -0,0 +1,22 @@ +import { RoleEnum } from '@/types/cloud/project/database/service/node/RoleEnum'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** Cloud databases cluster node definition */ +export interface Node { + /** Date of the creation of the node */ + createdAt?: string; + /** Flavor of the node */ + flavor?: string; + /** Node ID */ + id?: string; + /** Name of the node */ + name?: string; + /** Connection port for the node */ + port?: number; + /** Region of the node */ + region?: string; + /** Role of the node */ + role: RoleEnum; + /** Current status of the node */ + status?: StatusEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/NodeCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/NodeCreation.ts new file mode 100644 index 000000000000..314b400c98cb --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/NodeCreation.ts @@ -0,0 +1,22 @@ +import { RoleEnum } from '@/types/cloud/project/database/service/node/RoleEnum'; +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** Cloud databases cluster new node definition */ +export interface NodeCreation { + /** Date of the creation of the node */ + createdAt?: string; + /** Flavor of the node */ + flavor: string; + /** Node ID */ + id?: string; + /** Name of the node */ + name?: string; + /** Connection port for the node */ + port?: number; + /** Region of the node */ + region: string; + /** Role of the node */ + role: RoleEnum; + /** Current status of the node */ + status?: StatusEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/NodePattern.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/NodePattern.ts new file mode 100644 index 000000000000..bc106208e4f3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/NodePattern.ts @@ -0,0 +1,9 @@ +/** Node pattern definition */ +export interface NodePattern { + /** Flavor of the nodes */ + flavor: string; + /** Number of nodes to create */ + number: number; + /** Region of the nodes */ + region: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Replication.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Replication.ts new file mode 100644 index 000000000000..e71bcc56d3a3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Replication.ts @@ -0,0 +1,25 @@ +import { PolicyClassEnum } from '@/types/cloud/project/database/service/replication/PolicyClassEnum'; + +/** Cloud database service replication definition */ +export interface Replication { + /** Defines whether heartbeats are emitted */ + emitHeartbeats: boolean; + /** Defines whether the replication is actived */ + enabled: boolean; + /** Service ID */ + id?: string; + /** ReplicationPolicyClass used for the replication */ + replicationPolicyClass: PolicyClassEnum; + /** ID of the integration source */ + sourceIntegration?: string; + /** Defines whether the group offsets must be sync */ + syncGroupOffsets: boolean; + /** Defines the interval in second between 2 sync */ + syncInterval: number; + /** ID of the integration target */ + targetIntegration?: string; + /** Patterns of the topics to exclude from the replication */ + topicExcludeList: string[]; + /** Patterns of the topics to replicate */ + topics: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/ReplicationCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/ReplicationCreation.ts new file mode 100644 index 000000000000..a53cc06f61cd --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/ReplicationCreation.ts @@ -0,0 +1,23 @@ +import { PolicyClassEnum } from '@/types/cloud/project/database/service/replication/PolicyClassEnum'; + +/** Cloud database service replication definition */ +export interface ReplicationCreation { + /** Defines whether heartbeats are emitted */ + emitHeartbeats: boolean; + /** Defines whether the replication is actived */ + enabled: boolean; + /** ReplicationPolicyClass used for the replication */ + replicationPolicyClass: PolicyClassEnum; + /** ID of the integration source */ + sourceIntegration: string; + /** Defines whether the group offsets must be sync */ + syncGroupOffsets: boolean; + /** Defines the interval in second between 2 sync */ + syncInterval: number; + /** ID of the integration target */ + targetIntegration: string; + /** Patterns of the topics to exclude from the replication */ + topicExcludeList: string[]; + /** Patterns of the topics to replicate */ + topics: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Restore.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Restore.ts new file mode 100644 index 000000000000..9cb7924171f1 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Restore.ts @@ -0,0 +1,5 @@ +/** Cloud database service restore specification */ +export interface Restore { + /** point in time to restore from */ + pointInTime: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Storage.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Storage.ts new file mode 100644 index 000000000000..83a35da4ca84 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/Storage.ts @@ -0,0 +1,9 @@ +import { UnitAndValueLong } from '@/types/complexType/UnitAndValueLong'; + +/** Defines the storage attributes of a service */ +export interface Storage { + /** Service storage size */ + size: UnitAndValueLong; + /** Service storage type */ + type?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/User.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/User.ts new file mode 100644 index 000000000000..1602c7ca3e63 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/User.ts @@ -0,0 +1,13 @@ +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** User definition */ +export interface User { + /** Date of the creation of the user */ + createdAt?: string; + /** User ID */ + id?: string; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserCreation.ts new file mode 100644 index 000000000000..4901f781e43b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserCreation.ts @@ -0,0 +1,5 @@ +/** User creation definition */ +export interface UserCreation { + /** Name of the user */ + name: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithPassword.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithPassword.ts new file mode 100644 index 000000000000..1970534f31da --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithPassword.ts @@ -0,0 +1,15 @@ +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** User with password definition */ +export interface UserWithPassword { + /** Date of the creation of the user */ + createdAt?: string; + /** User ID */ + id?: string; + /** Password of the user */ + password?: string; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithPasswordAndRoles.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithPasswordAndRoles.ts new file mode 100644 index 000000000000..866b0119064d --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithPasswordAndRoles.ts @@ -0,0 +1,17 @@ +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** User with password definition */ +export interface UserWithPasswordAndRoles { + /** Date of the creation of the user */ + createdAt?: string; + /** User ID */ + id?: string; + /** Password of the user */ + password: string; + /** Roles the user belongs to */ + roles: string[]; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithRoles.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithRoles.ts new file mode 100644 index 000000000000..434dbf9463f2 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithRoles.ts @@ -0,0 +1,15 @@ +import { StatusEnum } from '@/types/cloud/project/database/StatusEnum'; + +/** User definition */ +export interface UserWithRoles { + /** Date of the creation of the user */ + createdAt?: string; + /** User ID */ + id?: string; + /** Roles the user belongs to */ + roles: string[]; + /** Current status of the user */ + status?: StatusEnum; + /** Name of the user */ + username?: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithRolesCreation.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithRolesCreation.ts new file mode 100644 index 000000000000..e8672ee09c78 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/UserWithRolesCreation.ts @@ -0,0 +1,7 @@ +/** User creation definition */ +export interface UserWithRolesCreation { + /** Name of the user */ + name: string; + /** Roles the user belongs to */ + roles: string[]; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/capability/StateEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/capability/StateEnum.ts new file mode 100644 index 000000000000..57460255662f --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/capability/StateEnum.ts @@ -0,0 +1,5 @@ +/** State of the service capability for the service */ +export enum StateEnum { + 'disabled' = 'disabled', + 'enabled' = 'enabled', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/capability/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/capability/index.ts new file mode 100644 index 000000000000..84f7be68873a --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/capability/index.ts @@ -0,0 +1 @@ +export * from './StateEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/BackupFork.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/BackupFork.ts new file mode 100644 index 000000000000..8148408a8b93 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/BackupFork.ts @@ -0,0 +1,9 @@ +/** Defines the source to fork a cluster from a backup. DEPRECATED: use forkFrom */ +export interface BackupFork { + /** Backup ID (not compatible with pointInTime) */ + id: string; + /** Point in time to restore from (not compatible with id) */ + pointInTime: string; + /** Service ID to which the backups belong to */ + serviceId: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/ForkFrom.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/ForkFrom.ts new file mode 100644 index 000000000000..33d538f2ec9b --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/ForkFrom.ts @@ -0,0 +1,9 @@ +/** Defines the source to fork a cluster from a backup */ +export interface ForkFrom { + /** Backup ID (not compatible with pointInTime) */ + backupId?: string; + /** Point in time to restore from (not compatible with id) */ + pointInTime?: string; + /** Service ID to which the backups belong to */ + serviceId: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/index.ts new file mode 100644 index 000000000000..508151555742 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/creation/index.ts @@ -0,0 +1,2 @@ +export * from './BackupFork'; +export * from './ForkFrom'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/Query.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/Query.ts new file mode 100644 index 000000000000..eb2a4fff8484 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/Query.ts @@ -0,0 +1,51 @@ +import { Ip } from '@/types/Ip'; +import { StateEnum } from '@/types/cloud/project/database/service/currentqueries/StateEnum'; +import { WaitEventTypeEnum } from '@/types/cloud/project/database/service/currentqueries/WaitEventTypeEnum'; + +/** Cloud database service current queries query definition */ +export interface Query { + /** Application name */ + applicationName?: string; + /** Backend start timestamp */ + backendStart?: string; + /** Backend type */ + backendType?: string; + /** XID for current backend */ + backendXid?: number; + /** Xmin for current backend */ + backendXmin?: number; + /** Client hostname */ + clientHostname?: string; + /** Client ip address */ + clientIp?: Ip; + /** Client port */ + clientPort?: number; + /** Database ID */ + databaseId?: number; + /** Database name */ + databaseName?: string; + /** Leader process ID */ + leaderPid?: number; + /** Connection process ID */ + pid?: number; + /** Current query running on this connection */ + query?: string; + /** Duration of the query in seconds */ + queryDuration?: number; + /** Query start timestamp */ + queryStart?: string; + /** Connection state */ + state?: StateEnum; + /** Connection state change timestamp */ + stateChange?: string; + /** Transaction start timestamp */ + transactionStart?: string; + /** User ID */ + userId?: number; + /** User name */ + userName?: string; + /** Connection wait event */ + waitEvent?: string; + /** Connection wait event type */ + waitEventType?: WaitEventTypeEnum; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/StateEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/StateEnum.ts new file mode 100644 index 000000000000..f7502ad44630 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/StateEnum.ts @@ -0,0 +1,9 @@ +/** Possible state of a query */ +export enum StateEnum { + 'ACTIVE' = 'ACTIVE', + 'DISABLED' = 'DISABLED', + 'FASTPATH_FUNCTION_CALL' = 'FASTPATH_FUNCTION_CALL', + 'IDLE' = 'IDLE', + 'IDLE_IN_TRANSACTION' = 'IDLE_IN_TRANSACTION', + 'IDLE_IN_TRANSACTION_ABORTED' = 'IDLE_IN_TRANSACTION_ABORTED', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/WaitEventTypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/WaitEventTypeEnum.ts new file mode 100644 index 000000000000..cda6513815b3 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/WaitEventTypeEnum.ts @@ -0,0 +1,12 @@ +/** Possible event type on which the backend is waiting */ +export enum WaitEventTypeEnum { + 'ACTIVITY' = 'ACTIVITY', + 'BUFFER_PIN' = 'BUFFER_PIN', + 'CLIENT' = 'CLIENT', + 'EXTENSION' = 'EXTENSION', + 'IO' = 'IO', + 'IPC' = 'IPC', + 'LOCK' = 'LOCK', + 'LWLOCK' = 'LWLOCK', + 'TIMEOUT' = 'TIMEOUT', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/index.ts new file mode 100644 index 000000000000..931c4fc7a717 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/index.ts @@ -0,0 +1,6 @@ +import * as query from './query/index'; + +export * from './Query'; +export * from './StateEnum'; +export * from './WaitEventTypeEnum'; +export { query }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/CancelRequest.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/CancelRequest.ts new file mode 100644 index 000000000000..2b70a6496b02 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/CancelRequest.ts @@ -0,0 +1,7 @@ +/** Cloud database service current queries query cancel request */ +export interface CancelRequest { + /** Database server connection ID */ + pid: number; + /** Request immediate termination instead of soft cancel */ + terminate: boolean; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/CancelResponse.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/CancelResponse.ts new file mode 100644 index 000000000000..8d39f65e8960 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/CancelResponse.ts @@ -0,0 +1,5 @@ +/** Cloud database service current queries query cancel response */ +export interface CancelResponse { + /** Status reported by the database server */ + success?: boolean; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/index.ts new file mode 100644 index 000000000000..9ca289ded549 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/currentqueries/query/index.ts @@ -0,0 +1,2 @@ +export * from './CancelRequest'; +export * from './CancelResponse'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/endpoint/ComponentEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/endpoint/ComponentEnum.ts new file mode 100644 index 000000000000..9d00bab5caa2 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/endpoint/ComponentEnum.ts @@ -0,0 +1,28 @@ +/** Defines all the values for the component in the service endpoints */ +export enum ComponentEnum { + 'cassandra' = 'cassandra', + 'grafana' = 'grafana', + 'graphite' = 'graphite', + 'influxdb' = 'influxdb', + 'kafka' = 'kafka', + 'kafkaConnect' = 'kafkaConnect', + 'kafkaRestApi' = 'kafkaRestApi', + 'kafkaSASL' = 'kafkaSASL', + 'kafkaSchemaRegistry' = 'kafkaSchemaRegistry', + 'kibana' = 'kibana', + 'm3coordinator' = 'm3coordinator', + 'mongodb' = 'mongodb', + 'mongodbAnalytics' = 'mongodbAnalytics', + 'mongodbSrv' = 'mongodbSrv', + 'mongodbSrvAnalytics' = 'mongodbSrvAnalytics', + 'mysql' = 'mysql', + 'mysqlRead' = 'mysqlRead', + 'mysqlx' = 'mysqlx', + 'opensearch' = 'opensearch', + 'postgresql' = 'postgresql', + 'postgresqlRead' = 'postgresqlRead', + 'postgresqlReadReplica' = 'postgresqlReadReplica', + 'prometheusRead' = 'prometheusRead', + 'prometheusWrite' = 'prometheusWrite', + 'redis' = 'redis', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/endpoint/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/endpoint/index.ts new file mode 100644 index 000000000000..fa198b77c4f2 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/endpoint/index.ts @@ -0,0 +1 @@ +export * from './ComponentEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/index.ts new file mode 100644 index 000000000000..675d7a743d10 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/index.ts @@ -0,0 +1,47 @@ +import * as capability from './capability/index'; +import * as creation from './creation/index'; +import * as currentqueries from './currentqueries/index'; +import * as endpoint from './endpoint/index'; +import * as integration from './integration/index'; +import * as maintenance from './maintenance/index'; +import * as node from './node/index'; +import * as replication from './replication/index'; + +export * from './Backup'; +export * from './CapabilityActions'; +export * from './CapabilityEnum'; +export * from './Certificates'; +export * from './CurrentQueries'; +export * from './DataPoint'; +export * from './Database'; +export * from './Disk'; +export * from './Endpoint'; +export * from './HostMetric'; +export * from './Integration'; +export * from './IpRestriction'; +export * from './LogEntry'; +export * from './Maintenance'; +export * from './Metric'; +export * from './MetricPeriodEnum'; +export * from './MetricUnitEnum'; +export * from './Node'; +export * from './NodeCreation'; +export * from './NodePattern'; +export * from './Replication'; +export * from './ReplicationCreation'; +export * from './Restore'; +export * from './Storage'; +export * from './User'; +export * from './UserCreation'; +export * from './UserWithPassword'; +export * from './UserWithPasswordAndRoles'; +export * from './UserWithRoles'; +export * from './UserWithRolesCreation'; +export { capability }; +export { creation }; +export { currentqueries }; +export { endpoint }; +export { integration }; +export { maintenance }; +export { node }; +export { replication }; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/StatusEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/StatusEnum.ts new file mode 100644 index 000000000000..3e0d5ad19838 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/StatusEnum.ts @@ -0,0 +1,4 @@ +/** Possible state of the integration */ +export enum StatusEnum { + 'READY' = 'READY', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/TypeEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/TypeEnum.ts new file mode 100644 index 000000000000..5d477c15b147 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/TypeEnum.ts @@ -0,0 +1,12 @@ +/** Possible type of the service integration */ +export enum TypeEnum { + 'grafanaDashboard' = 'grafanaDashboard', + 'grafanaDatasource' = 'grafanaDatasource', + 'kafkaConnect' = 'kafkaConnect', + 'kafkaLogs' = 'kafkaLogs', + 'kafkaMirrorMaker' = 'kafkaMirrorMaker', + 'm3aggregator' = 'm3aggregator', + 'm3dbMetrics' = 'm3dbMetrics', + 'opensearchLogs' = 'opensearchLogs', + 'postgresqlMetrics' = 'postgresqlMetrics', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/index.ts new file mode 100644 index 000000000000..ae8641d25812 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/integration/index.ts @@ -0,0 +1,2 @@ +export * from './StatusEnum'; +export * from './TypeEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/maintenance/StatusEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/maintenance/StatusEnum.ts new file mode 100644 index 000000000000..a122ee1abcc0 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/maintenance/StatusEnum.ts @@ -0,0 +1,8 @@ +/** Possible status of a service maintenance */ +export enum StatusEnum { + 'APPLIED' = 'APPLIED', + 'APPLYING' = 'APPLYING', + 'ERROR' = 'ERROR', + 'PENDING' = 'PENDING', + 'SCHEDULED' = 'SCHEDULED', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/maintenance/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/maintenance/index.ts new file mode 100644 index 000000000000..8c73e9dd9135 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/maintenance/index.ts @@ -0,0 +1 @@ +export * from './StatusEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/node/RoleEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/node/RoleEnum.ts new file mode 100644 index 000000000000..34e0c73014f6 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/node/RoleEnum.ts @@ -0,0 +1,5 @@ +/** Node role values */ +export enum RoleEnum { + 'ANALYTICS' = 'ANALYTICS', + 'STANDARD' = 'STANDARD', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/node/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/node/index.ts new file mode 100644 index 000000000000..229df682e327 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/node/index.ts @@ -0,0 +1 @@ +export * from './RoleEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/replication/PolicyClassEnum.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/replication/PolicyClassEnum.ts new file mode 100644 index 000000000000..b4ac596395f8 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/replication/PolicyClassEnum.ts @@ -0,0 +1,5 @@ +/** Possible type of the service integration */ +export enum PolicyClassEnum { + 'org.apache.kafka.connect.mirror.DefaultReplicationPolicy' = 'org.apache.kafka.connect.mirror.DefaultReplicationPolicy', + 'org.apache.kafka.connect.mirror.IdentityReplicationPolicy' = 'org.apache.kafka.connect.mirror.IdentityReplicationPolicy', +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/replication/index.ts b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/replication/index.ts new file mode 100644 index 000000000000..599e2bdc2388 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/cloud/project/database/service/replication/index.ts @@ -0,0 +1 @@ +export * from './PolicyClassEnum'; diff --git a/packages/manager/apps/pci-databases-analytics/src/types/complexType/SafeKeyValueString.ts b/packages/manager/apps/pci-databases-analytics/src/types/complexType/SafeKeyValueString.ts new file mode 100644 index 000000000000..9841cb0e891c --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/complexType/SafeKeyValueString.ts @@ -0,0 +1,7 @@ +/** Key and value, with proper key strings */ +export interface SafeKeyValueString { + /** */ + key?: string; + /** */ + value: string; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/complexType/UnitAndValueDouble.ts b/packages/manager/apps/pci-databases-analytics/src/types/complexType/UnitAndValueDouble.ts new file mode 100644 index 000000000000..0e8ff5804df9 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/complexType/UnitAndValueDouble.ts @@ -0,0 +1,7 @@ +/** A numeric value tagged with its unit */ +export interface UnitAndValueDouble { + /** */ + unit: string; + /** */ + value: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/types/complexType/UnitAndValueLong.ts b/packages/manager/apps/pci-databases-analytics/src/types/complexType/UnitAndValueLong.ts new file mode 100644 index 000000000000..3c528f603036 --- /dev/null +++ b/packages/manager/apps/pci-databases-analytics/src/types/complexType/UnitAndValueLong.ts @@ -0,0 +1,7 @@ +/** A numeric value tagged with its unit */ +export interface UnitAndValueLong { + /** */ + unit: string; + /** */ + value: number; +} diff --git a/packages/manager/apps/pci-databases-analytics/src/models/guide.ts b/packages/manager/apps/pci-databases-analytics/src/types/guide.ts similarity index 100% rename from packages/manager/apps/pci-databases-analytics/src/models/guide.ts rename to packages/manager/apps/pci-databases-analytics/src/types/guide.ts diff --git a/packages/manager/apps/pci-databases-analytics/src/models/order-funnel.ts b/packages/manager/apps/pci-databases-analytics/src/types/orderFunnel/index.ts similarity index 80% rename from packages/manager/apps/pci-databases-analytics/src/models/order-funnel.ts rename to packages/manager/apps/pci-databases-analytics/src/types/orderFunnel/index.ts index 0f4ac7e37d2e..7f1b356f2530 100644 --- a/packages/manager/apps/pci-databases-analytics/src/models/order-funnel.ts +++ b/packages/manager/apps/pci-databases-analytics/src/types/orderFunnel/index.ts @@ -1,5 +1,5 @@ -import { order } from './catalog'; -import { database } from './database'; +import { order } from '../catalog'; +import * as database from '@/types/cloud/project/database'; export interface EngineWithVersion { engine: string; @@ -15,9 +15,9 @@ export interface NetworkOptionValue { export interface Engine { name: string; description: string; - category: database.CategoryEnum; + category: database.engine.CategoryEnum; order: number; - tags: database.capabilities.Tags[]; + tags: database.capabilities.TagEnum[]; default: boolean; defaultVersion: string; storageMode: database.capabilities.engine.storage.StrategyEnum; @@ -26,7 +26,7 @@ export interface Engine { export interface Version { name: string; - tags: database.capabilities.Tags[]; + tags: database.capabilities.TagEnum[]; default: boolean; order: number; plans: Plan[]; @@ -58,14 +58,14 @@ export interface Plan { default: boolean; networks: database.NetworkTypeEnum[]; backups: boolean; - tags: database.capabilities.Tags[]; + tags: database.capabilities.TagEnum[]; regions: Region[]; } export interface Region { name: string; order: number; - tags: database.capabilities.Tags[]; + tags: database.capabilities.TagEnum[]; default: boolean; flavors: Flavor[]; } @@ -75,8 +75,8 @@ export interface Flavor { vcores?: number; ram?: { unit: string; value: number }; storage?: { - minimum: { unit: string; value: number }; - maximum: { unit: string; value: number }; + minimum?: { unit: string; value: number }; + maximum?: { unit: string; value: number }; step?: { unit: string; value: number }; pricing?: { hourly?: order.publicOrder.Pricing; @@ -85,7 +85,7 @@ export interface Flavor { }; order: number; default: boolean; - tags: database.capabilities.Tags[]; + tags: database.capabilities.TagEnum[]; pricing: { hourly?: order.publicOrder.Pricing; monthly?: order.publicOrder.Pricing; diff --git a/packages/manager/apps/pci-databases-analytics/vite.config.mjs b/packages/manager/apps/pci-databases-analytics/vite.config.mjs index 5c317dcbab9d..8f7b7b166735 100644 --- a/packages/manager/apps/pci-databases-analytics/vite.config.mjs +++ b/packages/manager/apps/pci-databases-analytics/vite.config.mjs @@ -5,4 +5,5 @@ const baseConfig = getBaseConfig({}); export default defineConfig({ ...baseConfig, + root: '', }); diff --git a/packages/manager/apps/pci-databases-analytics/vitest.config.js b/packages/manager/apps/pci-databases-analytics/vitest.config.js index f517b6792927..cf67b72aa37d 100644 --- a/packages/manager/apps/pci-databases-analytics/vitest.config.js +++ b/packages/manager/apps/pci-databases-analytics/vitest.config.js @@ -23,6 +23,7 @@ export default defineConfig({ 'src/query.client.ts', 'src/components/ui', 'src/configuration', + 'src/**/*constants.ts', ], }, },