From 5ed337eb382d6812a038ce0c7d065a74a251a7fa Mon Sep 17 00:00:00 2001 From: Developing-Gamer Date: Wed, 27 May 2026 12:47:47 -0700 Subject: [PATCH] Add local types for dashboard account settings API keys. Co-authored-by: Cursor --- .../supporting/types.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 apps/dashboard/src/components/dashboard-account-settings/supporting/types.ts diff --git a/apps/dashboard/src/components/dashboard-account-settings/supporting/types.ts b/apps/dashboard/src/components/dashboard-account-settings/supporting/types.ts new file mode 100644 index 000000000..46b633d6a --- /dev/null +++ b/apps/dashboard/src/components/dashboard-account-settings/supporting/types.ts @@ -0,0 +1,36 @@ +export type ApiKeyType = "user" | "team"; + +export type ApiKey = { + 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; + revoke: () => Promise; + isValid: () => boolean; + whyInvalid: () => 'manually-revoked' | 'expired' | null; +} + +export type ApiKeyCreationOptions = { + description: string; + expiresAt?: Date | null; +} + +export type ActiveSession = { + id: string; + isCurrentSession: boolean; + isImpersonation?: boolean; + createdAt: string; + lastUsedAt?: string; + geoInfo?: { + ip?: string; + cityName?: string; + }; +}