Fix Codex auth import and reset credit details
# Conflicts: # app/(tabs)/codex.tsx # app/(tabs)/index.tsx # app/(tabs)/settings.tsx # hooks/useCodexUsage.ts # lib/api/codexApi.ts # package-lock.json # package.json
This commit is contained in:
+49
-15
@@ -3,21 +3,55 @@ export interface CodexAuth {
|
||||
accountId?: string;
|
||||
}
|
||||
|
||||
export interface UsageWindow {
|
||||
used_percent: number;
|
||||
reset_at: number;
|
||||
limit_window_seconds: number;
|
||||
export interface CodexUsageWindow {
|
||||
usedPercent: number;
|
||||
resetsAt: number;
|
||||
windowMinutes: number;
|
||||
windowSeconds: number;
|
||||
}
|
||||
|
||||
export interface CodexUsageResponse {
|
||||
plan_type: string;
|
||||
rate_limit: {
|
||||
primary_window: UsageWindow;
|
||||
secondary_window: UsageWindow;
|
||||
};
|
||||
credits: {
|
||||
has_credits: boolean;
|
||||
unlimited: boolean;
|
||||
balance: number;
|
||||
};
|
||||
export interface CodexCreditsSummary {
|
||||
hasCredits: boolean;
|
||||
unlimited: boolean;
|
||||
balance: number;
|
||||
}
|
||||
|
||||
export interface CodexResetCredit {
|
||||
index: number;
|
||||
status?: string;
|
||||
grantedAt?: string | null;
|
||||
grantedAtLocal?: string | null;
|
||||
expiresAt?: string | null;
|
||||
expiresAtLocal?: string | null;
|
||||
timeUntilExpiry?: string | null;
|
||||
}
|
||||
|
||||
export interface CodexResetCoupons {
|
||||
source: "live_api" | "local_state_fallback" | "unavailable";
|
||||
sourceDescription: string;
|
||||
availableCount?: number | null;
|
||||
totalEarnedCount?: number | null;
|
||||
credits?: CodexResetCredit[];
|
||||
nextExpiringCredit?: CodexResetCredit | null;
|
||||
dismissedAtLocal?: string | null;
|
||||
latestPossibleExpiryLocal?: string | null;
|
||||
latestPossibleExpiryNote?: string | null;
|
||||
fallbackReason?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface CodexDesktopSnapshot {
|
||||
sessionFile?: string;
|
||||
threadId?: string | null;
|
||||
snapshotTimestamp?: string | null;
|
||||
limitId?: string | null;
|
||||
planType?: string | null;
|
||||
rateLimitReachedType?: string | null;
|
||||
primary: CodexUsageWindow | null;
|
||||
secondary: CodexUsageWindow | null;
|
||||
}
|
||||
|
||||
export interface CodexUsageResponse extends CodexDesktopSnapshot {
|
||||
credits: CodexCreditsSummary;
|
||||
resetCoupons?: CodexResetCoupons | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user