Add request logging mode, dark mode, Account hub, profile, vehicle CRUD, cards view
- Client: logRequests option + redacted request/response logging (setLogRequests to toggle at runtime); enabled via app extra.debugHttp for on-device 401 debugging - Dark mode (persisted) via ThemeProvider + React Navigation theme - New "Account" tab: Profile (view), Vehicles (full CRUD), Payment methods (view-only), About, dark-mode + request-logging toggles, sign out Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
65e9118806
commit
2f9f0f604a
11 changed files with 707 additions and 8 deletions
|
|
@ -45,6 +45,10 @@ export interface ParkSmarterClientOptions {
|
|||
uuid?: () => string;
|
||||
/** Called when any authenticated request returns 401 (token cleared automatically). */
|
||||
onUnauthorized?: () => void;
|
||||
/** Log every request/response (redacted) — useful for on-device debugging via logcat. */
|
||||
logRequests?: boolean;
|
||||
/** Where log lines go (default console.log). */
|
||||
logSink?: (line: string) => void;
|
||||
}
|
||||
|
||||
function resolveEnvironment(
|
||||
|
|
@ -69,6 +73,8 @@ export class ParkSmarterClient {
|
|||
fetchImpl: options.fetchImpl,
|
||||
uuid: options.uuid,
|
||||
onUnauthorized: options.onUnauthorized,
|
||||
logRequests: options.logRequests,
|
||||
logSink: options.logSink,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -77,6 +83,11 @@ export class ParkSmarterClient {
|
|||
this.http.setLocaleCode(localeCode);
|
||||
}
|
||||
|
||||
/** Toggle redacted request/response logging at runtime. */
|
||||
setLogRequests(on: boolean): void {
|
||||
this.http.setLogRequests(on);
|
||||
}
|
||||
|
||||
private unwrap<D>(p: Promise<ParkSmarterResponse<D>>): Promise<D> {
|
||||
return p.then((r) => r.data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue