/** * Copyright (c) 2021 Gitpod GmbH. All rights reserved. * Licensed under the GNU Affero General Public License (AGPL). * See License.AGPL.txt in the project root for license information. */ import { PartialProject, Project, ProjectEnvVar, ProjectEnvVarWithValue, ProjectUsage } from "@gitpod/gitpod-protocol"; import { TransactionalDB } from "./typeorm/transactional-db-impl"; export const ProjectDB = Symbol("ProjectDB"); export interface ProjectDB extends TransactionalDB { findProjectById(projectId: string): Promise; findProjectsByCloneUrl(cloneUrl: string): Promise; findProjects(orgID: string): Promise; findProjectsBySearchTerm( offset: number, limit: number, orderBy: keyof Project, orderDir: "ASC" | "DESC", searchTerm: string, ): Promise<{ total: number; rows: Project[] }>; storeProject(project: Project): Promise; updateProject(partialProject: PartialProject): Promise; markDeleted(projectId: string): Promise; findProjectEnvironmentVariable( projectId: string, envVar: ProjectEnvVarWithValue, ): Promise; addProjectEnvironmentVariable(projectId: string, envVar: ProjectEnvVarWithValue): Promise; updateProjectEnvironmentVariable(projectId: string, envVar: Required): Promise; getProjectEnvironmentVariables(projectId: string): Promise; getProjectEnvironmentVariableById(variableId: string): Promise; deleteProjectEnvironmentVariable(variableId: string): Promise; getProjectEnvironmentVariableValues(envVars: ProjectEnvVar[]): Promise; findCachedProjectOverview(projectId: string): Promise; storeCachedProjectOverview(projectId: string, overview: Project.Overview): Promise; getProjectUsage(projectId: string): Promise; updateProjectUsage(projectId: string, usage: Partial): Promise; }