refactor: enhance project and environment handling across components and services by replacing projectId with environmentId, improving context clarity and authorization checks

This commit is contained in:
Mauricio Siu
2025-09-01 23:10:37 -06:00
parent 3e7eff11cd
commit be9e19e708
25 changed files with 94 additions and 69 deletions
+11 -2
View File
@@ -17,13 +17,22 @@ import { buildNixpacks, getNixpacksCommand } from "./nixpacks";
import { buildPaketo, getPaketoCommand } from "./paketo";
import { buildRailpack, getRailpackCommand } from "./railpack";
import { buildStatic, getStaticCommand } from "./static";
import { findApplicationById } from "@dokploy/server/services/application";
// NIXPACKS codeDirectory = where is the path of the code directory
// HEROKU codeDirectory = where is the path of the code directory
// PAKETO codeDirectory = where is the path of the code directory
// DOCKERFILE codeDirectory = where is the exact path of the (Dockerfile)
export type ApplicationNested = Awaited<ReturnType<typeof findApplicationById>>;
export type ApplicationNested = InferResultType<
"applications",
{
mounts: true;
security: true;
redirects: true;
ports: true;
registry: true;
environment: { with: { project: true } };
}
>;
export const buildApplication = async (
application: ApplicationNested,