Files
calendar/packages/types/Credential.d.ts
T
Dhairyashil ShindeandGitHub 9909ac53fc fix: use app name instead of app slug in email (#25285)
* fix: google calender name in email

* fix: google calender name in email

* cleaner code

* test: add test for human-readable app name in appsStatus
2025-12-23 03:41:08 +05:30

62 lines
1.5 KiB
TypeScript

import type { Prisma } from "@calcom/prisma/client";
/*
* The logic on this it's just using Credential Type doesn't reflect that some fields can be
* null sometimes, so with this we should get correct type.
* Also there may be a better place to save this.
*/
export type CredentialPayload = Prisma.CredentialGetPayload<{
select: typeof import("@calcom/prisma/selects/credential").credentialForCalendarServiceSelect;
}> & {
delegatedToId?: string | null;
appName?: string;
};
export type CredentialForCalendarService = CredentialPayload & {
delegatedTo: {
serviceAccountKey: {
client_email?: string;
tenant_id?: string;
client_id: string;
private_key: string;
};
} | null;
};
export type CredentialForCalendarServiceWithEmail = CredentialPayload & {
delegatedTo: {
serviceAccountKey: {
client_email: string;
tenant_id?: undefined;
client_id: string;
private_key: string;
};
} | null;
};
export type CredentialForCalendarServiceWithTenantId = CredentialPayload & {
delegatedTo: {
serviceAccountKey: {
client_email?: undefined;
tenant_id: string;
client_id: string;
private_key: string;
};
} | null;
};
export type Office365CredentialPayload = CredentialPayload & {
delegatedTo: {
serviceAccountKey: {
tenant_id: string;
client_id: string;
private_key: string;
};
} | null;
};
export type CredentialFrontendPayload = Omit<CredentialPayload, "key"> & {
/** We should type error if keys are leaked to the frontend */
key?: never;
};