(applicationId: string)
| 92 | }; |
| 93 | |
| 94 | export const findApplicationById = async (applicationId: string) => { |
| 95 | const application = await db.query.applications.findFirst({ |
| 96 | where: eq(applications.applicationId, applicationId), |
| 97 | with: { |
| 98 | environment: { with: { project: true } }, |
| 99 | domains: true, |
| 100 | deployments: true, |
| 101 | mounts: true, |
| 102 | redirects: true, |
| 103 | security: true, |
| 104 | ports: true, |
| 105 | gitlab: true, |
| 106 | github: true, |
| 107 | bitbucket: true, |
| 108 | gitea: true, |
| 109 | server: true, |
| 110 | previewDeployments: true, |
| 111 | registry: { columns: { password: false } }, |
| 112 | buildRegistry: { columns: { password: false } }, |
| 113 | rollbackRegistry: { columns: { password: false } }, |
| 114 | }, |
| 115 | }); |
| 116 | if (!application) { |
| 117 | throw new TRPCError({ |
| 118 | code: "NOT_FOUND", |
| 119 | message: "Application not found", |
| 120 | }); |
| 121 | } |
| 122 | return application; |
| 123 | }; |
| 124 | |
| 125 | export const findApplicationByName = async (appName: string) => { |
| 126 | const application = await db.query.applications.findFirst({ |
no outgoing calls
no test coverage detected