cal/packages/types/Credential.d.ts
Omar López 7c749299bb
Enforces explicit type imports (#7158)
* Enforces explicit type imports

* Upgrades typescript-eslint

* Upgrades eslint related dependencies

* Update config

* Sync packages mismatches

* Syncs prettier version

* Linting

* Relocks node version

* Fixes

* Locks @vitejs/plugin-react to 1.3.2

* Linting
2023-02-16 15:39:57 -07:00

25 lines
676 B
TypeScript

import type { Prisma } from "@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: {
id: true;
appId: true;
type: true;
userId: true;
key: true;
invalid: true;
};
}>;
export type CredentialFrontendPayload = Omit<CredentialPayload, "key"> & {
/** We should type error if keys are leaked to the frontend */
key?: never;
};
export type CredentialWithAppName = CredentialPayload & { appName: string };