Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Added types to database/gitlab

dominicbachmannc390f82246d3
diff --git a/src/lib/database/gitlab.ts b/src/lib/database/gitlab.ts
index eb9bdfb1b3..8bb6a9c9b0 100644
--- a/src/lib/database/gitlab.ts
+++ b/src/lib/database/gitlab.ts
@@ -1,7 +1,14 @@
import { encrypt } from '$lib/crypto';
import { generateSshKeyPair, prisma } from './common';
+import type { GitlabApp } from '@prisma/client';
-export async function updateDeployKey({ id, deployKeyId }) {
+export async function updateDeployKey({
+ id,
+ deployKeyId
+}: {
+ id: string;
+ deployKeyId: number;
+}): Promise<GitlabApp> {
const application = await prisma.application.findUnique({
where: { id },
include: { gitSource: { include: { gitlabApp: true } } }
@@ -11,14 +18,24 @@ export async function updateDeployKey({ id, deployKeyId }) {
data: { deployKeyId }
});
}
-export async function getSshKey({ id }) {
+export async function getSshKey({
+ id
+}: {
+ id: string;
+}): Promise<{ status: number; body: { publicKey: string } }> {
const application = await prisma.application.findUnique({
where: { id },
include: { gitSource: { include: { gitlabApp: true } } }
});
return { status: 200, body: { publicKey: application.gitSource.gitlabApp.publicSshKey } };
}
-export async function generateSshKey({ id }) {
+export async function generateSshKey({
+ id
+}: {
+ id: string;
+}): Promise<
+ { status: number; body: { publicKey: string } } | { status: number; body?: undefined }
+> {
const application = await prisma.application.findUnique({
where: { id },
include: { gitSource: { include: { gitlabApp: true } } }