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; + }; +}