* deployment * update imports * booking report * update import paths * watch list * watch list * api key * api key * selected slots * wip * event type translation * work flow step * booking reference * fix tests * fix * fix * migrate * wip * address * fix
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import type { PrismaClient as PrismaClientWithExtensions } from "@calcom/prisma";
|
|
import type { PrismaClient as PrismaClientWithoutExtensions } from "@calcom/prisma/client";
|
|
|
|
import type { IDeploymentRepository } from "./IDeploymentRepository";
|
|
|
|
export class DeploymentRepository implements IDeploymentRepository {
|
|
constructor(private prisma: PrismaClientWithoutExtensions | PrismaClientWithExtensions) {}
|
|
|
|
async getLicenseKeyWithId(id: number): Promise<string | null> {
|
|
// This repository is special as it is used within prisma extensions
|
|
const deployment = await (this.prisma as PrismaClientWithoutExtensions).deployment.findUnique({
|
|
where: { id },
|
|
select: { licenseKey: true },
|
|
});
|
|
return deployment?.licenseKey || null;
|
|
}
|
|
|
|
async getSignatureToken(id: number): Promise<string | null> {
|
|
const deployment = await (this.prisma as PrismaClientWithoutExtensions).deployment.findUnique({
|
|
where: { id },
|
|
select: { signatureTokenEncrypted: true },
|
|
});
|
|
return deployment?.signatureTokenEncrypted || null;
|
|
}
|
|
}
|