2023-02-16 19:39:57 -03:00
|
|
|
import type { Prisma } from "@prisma/client";
|
2022-10-31 19:06:03 -03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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: {
|
|
|
|
id: true;
|
|
|
|
appId: true;
|
|
|
|
type: true;
|
|
|
|
userId: true;
|
2023-08-01 08:10:52 -03:00
|
|
|
teamId: true;
|
2022-10-31 19:06:03 -03:00
|
|
|
key: true;
|
2022-12-07 18:47:02 -03:00
|
|
|
invalid: true;
|
2022-10-31 19:06:03 -03:00
|
|
|
};
|
|
|
|
}>;
|
|
|
|
|
2022-12-20 19:15:06 -03:00
|
|
|
export type CredentialFrontendPayload = Omit<CredentialPayload, "key"> & {
|
|
|
|
/** We should type error if keys are leaked to the frontend */
|
|
|
|
key?: never;
|
|
|
|
};
|
|
|
|
|
2022-10-31 19:06:03 -03:00
|
|
|
export type CredentialWithAppName = CredentialPayload & { appName: string };
|