diff --git a/src/puter-js/types/modules/auth.d.ts b/src/puter-js/types/modules/auth.d.ts index fc559326c..6a7b47b9c 100644 --- a/src/puter-js/types/modules/auth.d.ts +++ b/src/puter-js/types/modules/auth.d.ts @@ -1,8 +1,18 @@ -export interface AuthUser { +export interface User { uuid: string; username: string; - email_confirmed?: boolean; - [key: string]: unknown; + email_confirmed?: boolean | number; + actual_free_storage?: number; + app_name?: string; + feature_flags?: Record; + hasDevAccountAccess?: boolean; + is_temp?: boolean; + last_activity_ts?: number; + otp?: boolean; + paid_storage?: number; + referral_code?: string; + requires_email_confirmation?: boolean | number; + subscribed?: boolean; } export interface AllowanceInfo { @@ -32,17 +42,21 @@ export interface DetailedAppUsage { [key: string]: APIUsage; } +export interface SignInResult { + success: boolean; + token: string; + app_uid: string; + username: string; + error?: string; + msg?: string; +} + export class Auth { - constructor (context: { authToken?: string; APIOrigin: string; appID?: string }); - - setAuthToken (authToken: string): void; - setAPIOrigin (APIOrigin: string): void; - - signIn (options?: { attempt_temp_user_creation?: boolean }): Promise; + signIn (options?: { attempt_temp_user_creation?: boolean }): Promise; signOut (): void; isSignedIn (): boolean; - getUser (): Promise; - whoami (): Promise; + getUser (): Promise; + whoami (): Promise; getMonthlyUsage (): Promise; getDetailedAppUsage (appId: string): Promise; }