feat: complete account-bound profile switching and hardening (#78)

This commit is contained in:
vin authored and GitHub committed 2026-02-08 01:10:07 +08:00
1 parent ee641799c2
commit a93c6d0cea
31 files changed
+3612 -197

No files matched your search

+5
View File
@@ -1,4 +1,5 @@
import { z } from 'zod';
import { DeviceProfileSchema, DeviceProfileVersionSchema, type DeviceProfile, type DeviceProfileVersion } from './account';
export interface CloudTokenData {
access_token: string;
@@ -29,6 +30,8 @@ export interface CloudAccount {
avatar_url?: string | null;
token: CloudTokenData;
quota?: CloudQuotaData;
device_profile?: DeviceProfile;
device_history?: DeviceProfileVersion[];
created_at: number;
last_used: number; // Unix timestamp
status?: 'active' | 'rate_limited' | 'expired';
@@ -65,6 +68,8 @@ export const CloudAccountSchema = z.object({
avatar_url: z.string().optional().nullable(),
token: CloudTokenDataSchema,
quota: CloudQuotaDataSchema.optional(),
device_profile: DeviceProfileSchema.optional(),
device_history: z.array(DeviceProfileVersionSchema).optional(),
created_at: z.number(),
last_used: z.number(),
status: z.enum(['active', 'rate_limited', 'expired']).optional(),