Add local types for dashboard account settings API keys.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Developing-Gamer 2026-05-27 12:47:47 -07:00
parent c2ce97e8ce
commit 5ed337eb38

View File

@ -0,0 +1,36 @@
export type ApiKeyType = "user" | "team";
export type ApiKey<Type extends ApiKeyType = ApiKeyType, IsFirstView extends boolean = false> = {
id: string;
description: string;
createdAt: Date;
expiresAt?: Date | null;
manuallyRevokedAt?: Date | null;
value: {
lastFour: string;
secret?: string;
};
type: Type;
userId: string;
update: (options: { description?: string }) => Promise<void>;
revoke: () => Promise<void>;
isValid: () => boolean;
whyInvalid: () => 'manually-revoked' | 'expired' | null;
}
export type ApiKeyCreationOptions<Type extends ApiKeyType = ApiKeyType> = {
description: string;
expiresAt?: Date | null;
}
export type ActiveSession = {
id: string;
isCurrentSession: boolean;
isImpersonation?: boolean;
createdAt: string;
lastUsedAt?: string;
geoInfo?: {
ip?: string;
cityName?: string;
};
}