mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 11:38:55 +00:00
feat: added project id mapping logic for cert and kms
This commit is contained in:
@@ -336,6 +336,22 @@ export const projectDALFactory = (db: TDbClient) => {
|
||||
};
|
||||
};
|
||||
|
||||
const getProjectFromSplitId = async (projectId: string, projectType: ProjectType) => {
|
||||
try {
|
||||
const project = await db(TableName.ProjectSplitBackfillIds)
|
||||
.where({
|
||||
sourceProjectId: projectId,
|
||||
destinationProjectType: projectType
|
||||
})
|
||||
.join(TableName.Project, `${TableName.Project}.id`, `${TableName.ProjectSplitBackfillIds}.destinationProjectId`)
|
||||
.select(selectAllTableCols(TableName.Project))
|
||||
.first();
|
||||
return project;
|
||||
} catch (error) {
|
||||
throw new DatabaseError({ error, name: `Failed to find split project with id ${projectId}` });
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
...projectOrm,
|
||||
findAllProjects,
|
||||
@@ -346,6 +362,7 @@ export const projectDALFactory = (db: TDbClient) => {
|
||||
findProjectByFilter,
|
||||
findProjectBySlug,
|
||||
findProjectWithOrg,
|
||||
checkProjectUpgradeStatus
|
||||
checkProjectUpgradeStatus,
|
||||
getProjectFromSplitId
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user