diff --git a/frontend/src/api/admin/dataManagement.ts b/frontend/src/api/admin/dataManagement.ts deleted file mode 100644 index 0f5dd58a..00000000 --- a/frontend/src/api/admin/dataManagement.ts +++ /dev/null @@ -1,332 +0,0 @@ -import { apiClient } from '../client' - -export type BackupType = 'postgres' | 'redis' | 'full' -export type BackupJobStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'partial_succeeded' - -export interface BackupAgentInfo { - status: string - version: string - uptime_seconds: number -} - -export interface BackupAgentHealth { - enabled: boolean - reason: string - socket_path: string - agent?: BackupAgentInfo -} - -export interface DataManagementPostgresConfig { - host: string - port: number - user: string - password?: string - password_configured?: boolean - database: string - ssl_mode: string - container_name: string -} - -export interface DataManagementRedisConfig { - addr: string - username: string - password?: string - password_configured?: boolean - db: number - container_name: string -} - -export interface DataManagementS3Config { - enabled: boolean - endpoint: string - region: string - bucket: string - access_key_id: string - secret_access_key?: string - secret_access_key_configured?: boolean - prefix: string - force_path_style: boolean - use_ssl: boolean -} - -export interface DataManagementConfig { - source_mode: 'direct' | 'docker_exec' - backup_root: string - sqlite_path?: string - retention_days: number - keep_last: number - active_postgres_profile_id?: string - active_redis_profile_id?: string - active_s3_profile_id?: string - postgres: DataManagementPostgresConfig - redis: DataManagementRedisConfig - s3: DataManagementS3Config -} - -export type SourceType = 'postgres' | 'redis' - -export interface DataManagementSourceConfig { - host: string - port: number - user: string - password?: string - database: string - ssl_mode: string - addr: string - username: string - db: number - container_name: string -} - -export interface DataManagementSourceProfile { - source_type: SourceType - profile_id: string - name: string - is_active: boolean - password_configured?: boolean - config: DataManagementSourceConfig - created_at?: string - updated_at?: string -} - -export interface TestS3Request { - endpoint: string - region: string - bucket: string - access_key_id: string - secret_access_key?: string - prefix?: string - force_path_style?: boolean - use_ssl?: boolean -} - -export interface TestS3Response { - ok: boolean - message: string -} - -export interface CreateBackupJobRequest { - backup_type: BackupType - upload_to_s3?: boolean - s3_profile_id?: string - postgres_profile_id?: string - redis_profile_id?: string - idempotency_key?: string -} - -export interface CreateBackupJobResponse { - job_id: string - status: BackupJobStatus -} - -export interface BackupArtifactInfo { - local_path: string - size_bytes: number - sha256: string -} - -export interface BackupS3Info { - bucket: string - key: string - etag: string -} - -export interface BackupJob { - job_id: string - backup_type: BackupType - status: BackupJobStatus - triggered_by: string - s3_profile_id?: string - postgres_profile_id?: string - redis_profile_id?: string - started_at?: string - finished_at?: string - error_message?: string - artifact?: BackupArtifactInfo - s3?: BackupS3Info -} - -export interface ListSourceProfilesResponse { - items: DataManagementSourceProfile[] -} - -export interface CreateSourceProfileRequest { - profile_id: string - name: string - config: DataManagementSourceConfig - set_active?: boolean -} - -export interface UpdateSourceProfileRequest { - name: string - config: DataManagementSourceConfig -} - -export interface DataManagementS3Profile { - profile_id: string - name: string - is_active: boolean - s3: DataManagementS3Config - secret_access_key_configured?: boolean - created_at?: string - updated_at?: string -} - -export interface ListS3ProfilesResponse { - items: DataManagementS3Profile[] -} - -export interface CreateS3ProfileRequest { - profile_id: string - name: string - enabled: boolean - endpoint: string - region: string - bucket: string - access_key_id: string - secret_access_key?: string - prefix?: string - force_path_style?: boolean - use_ssl?: boolean - set_active?: boolean -} - -export interface UpdateS3ProfileRequest { - name: string - enabled: boolean - endpoint: string - region: string - bucket: string - access_key_id: string - secret_access_key?: string - prefix?: string - force_path_style?: boolean - use_ssl?: boolean -} - -export interface ListBackupJobsRequest { - page_size?: number - page_token?: string - status?: BackupJobStatus - backup_type?: BackupType -} - -export interface ListBackupJobsResponse { - items: BackupJob[] - next_page_token?: string -} - -export async function getAgentHealth(): Promise { - const { data } = await apiClient.get('/admin/data-management/agent/health') - return data -} - -export async function getConfig(): Promise { - const { data } = await apiClient.get('/admin/data-management/config') - return data -} - -export async function updateConfig(request: DataManagementConfig): Promise { - const { data } = await apiClient.put('/admin/data-management/config', request) - return data -} - -export async function testS3(request: TestS3Request): Promise { - const { data } = await apiClient.post('/admin/data-management/s3/test', request) - return data -} - -export async function listSourceProfiles(sourceType: SourceType): Promise { - const { data } = await apiClient.get(`/admin/data-management/sources/${sourceType}/profiles`) - return data -} - -export async function createSourceProfile(sourceType: SourceType, request: CreateSourceProfileRequest): Promise { - const { data } = await apiClient.post(`/admin/data-management/sources/${sourceType}/profiles`, request) - return data -} - -export async function updateSourceProfile(sourceType: SourceType, profileID: string, request: UpdateSourceProfileRequest): Promise { - const { data } = await apiClient.put(`/admin/data-management/sources/${sourceType}/profiles/${profileID}`, request) - return data -} - -export async function deleteSourceProfile(sourceType: SourceType, profileID: string): Promise { - await apiClient.delete(`/admin/data-management/sources/${sourceType}/profiles/${profileID}`) -} - -export async function setActiveSourceProfile(sourceType: SourceType, profileID: string): Promise { - const { data } = await apiClient.post(`/admin/data-management/sources/${sourceType}/profiles/${profileID}/activate`) - return data -} - -export async function listS3Profiles(): Promise { - const { data } = await apiClient.get('/admin/data-management/s3/profiles') - return data -} - -export async function createS3Profile(request: CreateS3ProfileRequest): Promise { - const { data } = await apiClient.post('/admin/data-management/s3/profiles', request) - return data -} - -export async function updateS3Profile(profileID: string, request: UpdateS3ProfileRequest): Promise { - const { data } = await apiClient.put(`/admin/data-management/s3/profiles/${profileID}`, request) - return data -} - -export async function deleteS3Profile(profileID: string): Promise { - await apiClient.delete(`/admin/data-management/s3/profiles/${profileID}`) -} - -export async function setActiveS3Profile(profileID: string): Promise { - const { data } = await apiClient.post(`/admin/data-management/s3/profiles/${profileID}/activate`) - return data -} - -export async function createBackupJob(request: CreateBackupJobRequest): Promise { - const headers = request.idempotency_key - ? { 'X-Idempotency-Key': request.idempotency_key } - : undefined - - const { data } = await apiClient.post( - '/admin/data-management/backups', - request, - { headers } - ) - return data -} - -export async function listBackupJobs(request?: ListBackupJobsRequest): Promise { - const { data } = await apiClient.get('/admin/data-management/backups', { - params: request - }) - return data -} - -export async function getBackupJob(jobID: string): Promise { - const { data } = await apiClient.get(`/admin/data-management/backups/${jobID}`) - return data -} - -export const dataManagementAPI = { - getAgentHealth, - getConfig, - updateConfig, - listSourceProfiles, - createSourceProfile, - updateSourceProfile, - deleteSourceProfile, - setActiveSourceProfile, - testS3, - listS3Profiles, - createS3Profile, - updateS3Profile, - deleteS3Profile, - setActiveS3Profile, - createBackupJob, - listBackupJobs, - getBackupJob -} - -export default dataManagementAPI diff --git a/frontend/src/api/admin/index.ts b/frontend/src/api/admin/index.ts index 9c828509..fe50989c 100644 --- a/frontend/src/api/admin/index.ts +++ b/frontend/src/api/admin/index.ts @@ -20,7 +20,6 @@ import antigravityAPI from './antigravity' import userAttributesAPI from './userAttributes' import opsAPI from './ops' import errorPassthroughAPI from './errorPassthrough' -import dataManagementAPI from './dataManagement' import apiKeysAPI from './apiKeys' import scheduledTestsAPI from './scheduledTests' import backupAPI from './backup' @@ -50,7 +49,6 @@ export const adminAPI = { userAttributes: userAttributesAPI, ops: opsAPI, errorPassthrough: errorPassthroughAPI, - dataManagement: dataManagementAPI, apiKeys: apiKeysAPI, scheduledTests: scheduledTestsAPI, backup: backupAPI, @@ -78,7 +76,6 @@ export { userAttributesAPI, opsAPI, errorPassthroughAPI, - dataManagementAPI, apiKeysAPI, scheduledTestsAPI, backupAPI, @@ -93,5 +90,4 @@ export default adminAPI // Re-export types used by components export type { BalanceHistoryItem } from './users' export type { ErrorPassthroughRule, CreateRuleRequest, UpdateRuleRequest } from './errorPassthrough' -export type { BackupAgentHealth, DataManagementConfig } from './dataManagement' export type { TLSFingerprintProfile, CreateProfileRequest, UpdateProfileRequest } from './tlsFingerprintProfile' diff --git a/frontend/src/router/__tests__/deprecatedAdminFeatures.spec.ts b/frontend/src/router/__tests__/deprecatedAdminFeatures.spec.ts new file mode 100644 index 00000000..fce82cb2 --- /dev/null +++ b/frontend/src/router/__tests__/deprecatedAdminFeatures.spec.ts @@ -0,0 +1,24 @@ +import { readFileSync } from 'node:fs' +import { dirname, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' + +import { describe, expect, it } from 'vitest' + +const routerPath = resolve(dirname(fileURLToPath(import.meta.url)), '../index.ts') +const routerSource = readFileSync(routerPath, 'utf8') +const adminApiIndexPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../api/admin/index.ts') +const adminApiIndexSource = readFileSync(adminApiIndexPath, 'utf8') + +describe('deprecated admin features', () => { + it('does not expose the deprecated data-management admin route', () => { + expect(routerSource).not.toContain("path: '/admin/data-management'") + expect(routerSource).not.toContain("name: 'AdminDataManagement'") + }) + + it('does not re-export the deprecated data-management admin API', () => { + expect(adminApiIndexSource).not.toContain("import dataManagementAPI from './dataManagement'") + expect(adminApiIndexSource).not.toContain('dataManagement: dataManagementAPI') + expect(adminApiIndexSource).not.toContain('dataManagementAPI,') + expect(adminApiIndexSource).not.toContain("from './dataManagement'") + }) +}) diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 347dc3d7..9f2dad5b 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -467,20 +467,6 @@ const routes: RouteRecordRaw[] = [ descriptionKey: 'admin.usage.description' } }, - { - path: '/admin/data-management', - name: 'AdminDataManagement', - component: () => import('@/views/admin/data-management/DataManagementView.vue'), - meta: { - requiresAuth: true, - requiresAdmin: true, - title: 'Data Management', - titleKey: 'admin.dataManagement.title', - descriptionKey: 'admin.dataManagement.description' - } - }, - - // ==================== Payment Admin Routes ==================== { path: '/admin/orders/dashboard', diff --git a/frontend/src/views/admin/data-management/DataManagementView.vue b/frontend/src/views/admin/data-management/DataManagementView.vue deleted file mode 100644 index be65fc30..00000000 --- a/frontend/src/views/admin/data-management/DataManagementView.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - diff --git a/frontend/src/views/admin/data-management/components/BackupJobsCard.vue b/frontend/src/views/admin/data-management/components/BackupJobsCard.vue deleted file mode 100644 index 31d4017c..00000000 --- a/frontend/src/views/admin/data-management/components/BackupJobsCard.vue +++ /dev/null @@ -1,216 +0,0 @@ - - - diff --git a/frontend/src/views/admin/data-management/components/PostgresProfilesCard.vue b/frontend/src/views/admin/data-management/components/PostgresProfilesCard.vue deleted file mode 100644 index f3dc06b2..00000000 --- a/frontend/src/views/admin/data-management/components/PostgresProfilesCard.vue +++ /dev/null @@ -1,356 +0,0 @@ - - - diff --git a/frontend/src/views/admin/data-management/components/RedisProfilesCard.vue b/frontend/src/views/admin/data-management/components/RedisProfilesCard.vue deleted file mode 100644 index 83359cc7..00000000 --- a/frontend/src/views/admin/data-management/components/RedisProfilesCard.vue +++ /dev/null @@ -1,331 +0,0 @@ - - - diff --git a/frontend/src/views/admin/data-management/components/S3ProfilesCard.vue b/frontend/src/views/admin/data-management/components/S3ProfilesCard.vue deleted file mode 100644 index fb17dbf3..00000000 --- a/frontend/src/views/admin/data-management/components/S3ProfilesCard.vue +++ /dev/null @@ -1,363 +0,0 @@ - - -