Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: cleanup unused types (#9484)
ecmadao0a924ee59287
diff --git a/frontend/src/store/modules/index.ts b/frontend/src/store/modules/index.tsindex 6a0208ca34..5b16489e99 100644--- a/frontend/src/store/modules/index.ts+++ b/frontend/src/store/modules/index.ts@@ -1,7 +1,6 @@export * from "./auth";export * from "./command";export * from "./help";-export * from "./issue";export * from "./notification";export * from "./slowQueryPolicy";export * from "./router";diff --git a/frontend/src/store/modules/issue.ts b/frontend/src/store/modules/issue.tsdeleted file mode 100644index 3834f09346..0000000000--- a/frontend/src/store/modules/issue.ts+++ /dev/null@@ -1,25 +0,0 @@-import { defineStore } from "pinia";-import { ref, watch, WatchCallback } from "vue";-import { IssueState } from "@/types";--export const useIssueStore = defineStore("issue", {- state: (): IssueState => ({- issueById: new Map(),- isCreatingIssue: false,- }),- getters: {- issueList: (state) => {- return [...state.issueById.values()];- },- },- actions: {},-});--// expose global list refresh features-const REFRESH_ISSUE_LIST = ref(Math.random());-export const refreshIssueList = () => {- REFRESH_ISSUE_LIST.value = Math.random();-};-export const useRefreshIssueList = (callback: WatchCallback) => {- watch(REFRESH_ISSUE_LIST, callback);-};diff --git a/frontend/src/store/modules/v1/issue.ts b/frontend/src/store/modules/v1/issue.tsindex 73e038429a..c15078ac38 100644--- a/frontend/src/store/modules/v1/issue.ts+++ b/frontend/src/store/modules/v1/issue.ts@@ -1,6 +1,7 @@import dayjs from "dayjs";import { uniq } from "lodash-es";import { defineStore } from "pinia";+import { ref, watch, WatchCallback } from "vue";import { issueServiceClient } from "@/grpcweb";import {ActivityIssueCommentCreatePayload,@@ -213,3 +214,12 @@ export const candidatesOfApprovalStepV1 = (return uniq(candidates.map((user) => user.name));};++// expose global list refresh features+const REFRESH_ISSUE_LIST = ref(Math.random());+export const refreshIssueList = () => {+ REFRESH_ISSUE_LIST.value = Math.random();+};+export const useRefreshIssueList = (callback: WatchCallback) => {+ watch(REFRESH_ISSUE_LIST, callback);+};diff --git a/frontend/src/types/backup.ts b/frontend/src/types/backup.tsindex 6d82365e81..5f2f377d0f 100644--- a/frontend/src/types/backup.ts+++ b/frontend/src/types/backup.ts@@ -25,15 +25,6 @@ export type Backup = {comment: string;};-export type BackupCreate = {- // Related fields- databaseId: DatabaseId;-- // Domain specific fields- name: string;- type: BackupType;-};-// Backup setting.export type BackupSetting = {id: BackupSettingId;diff --git a/frontend/src/types/dataSource.ts b/frontend/src/types/dataSource.tsindex bf7fdb9bbd..ef4faa2644 100644--- a/frontend/src/types/dataSource.ts+++ b/frontend/src/types/dataSource.ts@@ -1,13 +1,6 @@// For now the ADMIN requires the same database privilege as RW.// The seperation is to make it explicit which one serves as the ADMIN data source,-import {- DatabaseId,- DataSourceId,- InstanceId,- IssueId,- PrincipalId,-} from "./id";-import { Principal } from "./principal";+import { DatabaseId, DataSourceId, InstanceId } from "./id";// which from the ops perspective, having different meaning from the normal RW data source.export type DataSourceType = "ADMIN" | "RW" | "RO";@@ -52,52 +45,3 @@ export type DataSource = {updateSsl?: boolean;updateSsh?: boolean;};--export type DataSourceCreate = {- // Related fields- databaseId: DatabaseId;- instanceId: InstanceId;-- // Domain specific fields- name: string;- type: DataSourceType;- username: string;- password?: string;- sslCa?: string;- sslCert?: string;- sslKey?: string;- host: string;- port: string;- database: string;- options: DataSourceOptions;-};--export type DataSourcePatch = {- // Domain specific fields- name?: string;- username?: string;- password?: string;- useEmptyPassword?: boolean;- sslCa?: string;- sslCert?: string;- sslKey?: string;- host?: string;- port?: string;- database?: string;- options?: DataSourceOptions;-};--export type DataSourceMember = {- // Standard fields- createdTs: number;-- // Domain specific fields- principal: Principal;- issueId?: IssueId;-};--export type DataSourceMemberCreate = {- // Domain specific fields- principalId: PrincipalId;- issueId?: IssueId;-};diff --git a/frontend/src/types/database.ts b/frontend/src/types/database.tsindex af4684236a..84021b7383 100644--- a/frontend/src/types/database.ts+++ b/frontend/src/types/database.ts@@ -29,19 +29,3 @@ export type Database = {schemaVersion: string;labels: { key: string; value: string }[];};--export type DatabaseFind = {- // Related fields- projectId?: ProjectId;- instanceId?: InstanceId;-- // Domain specific fields- name?: string;- syncStatus?: DatabaseSyncStatus;-};--export type DatabasePatch = {- // Related fields- projectId?: ProjectId;- labels?: { key: string; value: string }[];-};diff --git a/frontend/src/types/instance.ts b/frontend/src/types/instance.tsindex 73f9702726..46f494b49e 100644--- a/frontend/src/types/instance.ts+++ b/frontend/src/types/instance.ts@@ -1,7 +1,7 @@import { DataSource } from ".";import { RowStatus } from "./common";import { Environment } from "./environment";-import { InstanceId, MigrationHistoryId, ResourceId } from "./id";+import { InstanceId, MigrationHistoryId } from "./id";import { Engine } from "./proto/v1/common";import { VCSPushEvent } from "./vcs";@@ -179,49 +179,6 @@ export type Instance = {authenticationDatabase: string;};-export type InstanceCreate = {- resourceId: ResourceId;-- // Related fields- environmentId: number;-- // Domain specific fields- name: string;- engine: EngineType;- externalLink?: string;- host: string;- port?: string;- database?: string;- // In mysql, username can be empty which means anonymous user- username?: string;- password?: string;- sslCa?: string;- sslCert?: string;- sslKey?: string;- // DNS SRV record is only used for MongoDB.- srv: boolean;- // For MongoDB, the auth database is used to authenticate the user.- authenticationDatabase: string;- // sid and serviceName are used for Oracle database. Required one of them.- sid: string;- serviceName: string;- // Connection over SSH.- sshHost: string;- sshPort: string;- sshUser: string;- sshPassword: string;- sshPrivateKey: string;-};--export type InstancePatch = {- // Standard fields- rowStatus?: RowStatus;-- // Domain specific fields- name?: string;- externalLink?: string;-};-export type MigrationSchemaStatus = "UNKNOWN" | "OK" | "NOT_EXIST";export type InstanceMigration = {diff --git a/frontend/src/types/oauth.ts b/frontend/src/types/oauth.tsindex fab04e59c3..0e9deccebe 100644--- a/frontend/src/types/oauth.ts+++ b/frontend/src/types/oauth.ts@@ -75,7 +75,6 @@ export function openWindowForOAuth(} else if (vcsType == ExternalVersionControl_Type.AZURE_DEVOPS) {// Scopes for Azure: https://learn.microsoft.com/zh-cn/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops#scopes// We need full scopes in the application: https://stackoverflow.com/questions/56143321/azure-devops-oauth-enpoint-always-returns-error-invalidscope- // TODO: decide necessary scopesendpointQueryParams["scope"] ="vso.code_full vso.identity vso.project vso.build_execute";endpointQueryParams["response_type"] = "Assertion";diff --git a/frontend/src/types/principal.ts b/frontend/src/types/principal.tsindex ca7df1f5c7..6d62c57719 100644--- a/frontend/src/types/principal.ts+++ b/frontend/src/types/principal.ts@@ -16,19 +16,3 @@ export type Principal = {role: RoleType;serviceKey: string;};--export type PrincipalCreate = {- // Domain specific fields- name: string;- email: string;- type: PrincipalType;-};--export type PrincipalPatch = {- // Domain specific fields- name?: string;- password?: string;- email?: string;- type: PrincipalType;- refreshKey?: boolean;-};diff --git a/frontend/src/types/project.ts b/frontend/src/types/project.tsindex fd497b01d2..ab7bfb566a 100644--- a/frontend/src/types/project.ts+++ b/frontend/src/types/project.ts@@ -41,18 +41,6 @@ export type Project = {schemaChangeType: SchemaChangeType;};-export type ProjectPatch = {- // Standard fields- rowStatus?: RowStatus;-- // Domain specific fields- name?: string;- key?: string;- schemaChangeType?: SchemaChangeType;- workflowType?: ProjectWorkflowType;- tenantMode?: ProjectTenantMode;-};-// Project Memberexport type ProjectMember = {id: string; // projects/%s/roles/%s/principals/%ddiff --git a/frontend/src/types/store.ts b/frontend/src/types/store.tsindex 973076001c..4480bf52b2 100644--- a/frontend/src/types/store.ts+++ b/frontend/src/types/store.ts@@ -1,83 +1,7 @@-import { MigrationHistoryId, QueryHistory } from ".";-import { InstanceUser } from "./InstanceUser";-import { Backup } from "./backup";+import { QueryHistory } from ".";import { Command } from "./common";-import { DataSource } from "./dataSource";-import { Database } from "./database";-import {- CommandId,- DatabaseId,- DataSourceId,- InstanceId,- IssueId,- ProjectId,- VCSId,-} from "./id";-import { Instance, MigrationHistory } from "./instance";-import { Issue } from "./issue";+import { CommandId } from "./id";import { Notification } from "./notification";-import { Principal } from "./principal";-import { Project } from "./project";-import { DatabaseMetadata } from "./proto/v1/database_service";-import { VCS } from "./vcs";--export interface PrincipalState {- principalList: Principal[];-}--export interface IssueState {- issueById: Map<IssueId, Issue>;- isCreatingIssue: boolean;-}--// eslint-disable-next-line @typescript-eslint/no-empty-interface-export interface PipelineState {}--// eslint-disable-next-line @typescript-eslint/no-empty-interface-export interface StageState {}--// eslint-disable-next-line @typescript-eslint/no-empty-interface-export interface TaskState {}--export interface ProjectState {- projectById: Map<ProjectId, Project>;-}--export interface InstanceState {- instanceById: Map<InstanceId, Instance>;- instanceUserListById: Map<InstanceId, InstanceUser[]>;- migrationHistoryById: Map<MigrationHistoryId, MigrationHistory>;- // The key is a concatenation of instance id and database name- migrationHistoryListByIdAndDatabaseName: Map<string, MigrationHistory[]>;-}--export interface DataSourceState {- dataSourceById: Map<DataSourceId, DataSource>;-}--export interface DatabaseState {- // UI may fetch the database list from different dimension (by user, by environment).- // In those cases, we will iterate through this map and compute the list on the fly.- // We save it by instance because database belongs to instance and saving this way- // follows that hierarchy.- databaseListByInstanceId: Map<string, Database[]>;- // Used exclusively for project panel, we do this to avoid interference from databaseListByInstanceId- // where updating databaseListByInstanceId will cause reloading project related UI due to reactivity- databaseListByProjectId: Map<string, Database[]>;-}--export interface DBSchemaState {- requestCache: Map<DatabaseId, Promise<DatabaseMetadata>>;- databaseMetadataById: Map<DatabaseId, DatabaseMetadata>;-}--export interface BackupState {- backupList: Map<DatabaseId, Backup[]>;-}--export interface VCSState {- vcsById: Map<VCSId, VCS>;-}export interface NotificationState {notificationByModule: Map<string, Notification[]>;@@ -94,7 +18,3 @@ export interface SQLEditorState {isFetchingSheet: boolean;isShowExecutingHint: boolean;}--export interface DebugState {- isDebug: boolean;-}diff --git a/frontend/src/types/vcs.ts b/frontend/src/types/vcs.tsindex 32584c150a..569a12bed1 100644--- a/frontend/src/types/vcs.ts+++ b/frontend/src/types/vcs.ts@@ -13,6 +13,7 @@ export type VCSUIType =| "GITHUB_ENTERPRISE"| "BITBUCKET_ORG"| "AZURE_DEVOPS";+export interface VCSConfig {type: ExternalVersionControl_Type;uiType: VCSUIType;@@ -35,11 +36,6 @@ export type VCS = {secret: string;};-export type VCSTokenCreate = {- code: string;- redirectUrl: string;-};-export type VCSFileCommit = {id: string;title: string;