Files
calendar/packages/features/deployment/repositories/DeploymentRepository.ts
T
Benny JooandGitHub cb7844fd22 refactor: Migrate repositories/services from /lib to /features (#25925)
* 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
2025-12-17 14:14:50 +00:00

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;
}
}