@djangocfg/api 2.1.103 → 2.1.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.cjs +3348 -3218
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +77 -1
- package/dist/auth.d.ts +77 -1
- package/dist/auth.mjs +3295 -3165
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +95 -64
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +134 -21
- package/dist/clients.d.ts +134 -21
- package/dist/clients.mjs +95 -64
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +1 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.mjs +1 -0
- package/dist/hooks.mjs.map +1 -1
- package/package.json +2 -3
- package/src/auth/context/AuthContext.tsx +1 -1
- package/src/auth/hooks/index.ts +4 -0
- package/src/auth/hooks/useAuthGuard.ts +1 -1
- package/src/auth/hooks/useAutoAuth.ts +2 -1
- package/src/auth/hooks/useCfgRouter.ts +153 -0
- package/src/auth/hooks/useGithubAuth.ts +1 -1
- package/src/auth/hooks/useQueryParams.ts +73 -0
- package/src/auth/hooks/useTwoFactor.ts +1 -1
- package/src/auth/hooks/useTwoFactorStatus.ts +5 -1
- package/src/generated/cfg_totp/CLAUDE.md +1 -1
- package/src/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +3 -3
- package/src/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +3 -3
- package/src/generated/cfg_totp/_utils/schemas/DeviceListResponse.schema.ts +21 -0
- package/src/generated/cfg_totp/_utils/schemas/{PaginatedDeviceListList.schema.ts → PaginatedDeviceListResponseList.schema.ts} +5 -5
- package/src/generated/cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts +34 -0
- package/src/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts +2 -1
- package/src/generated/cfg_totp/_utils/schemas/index.ts +3 -1
- package/src/generated/cfg_totp/schema.json +124 -5
- package/src/generated/cfg_totp/totp__totp_management/client.ts +3 -3
- package/src/generated/cfg_totp/totp__totp_management/models.ts +12 -2
- package/src/generated/cfg_totp/totp__totp_verification/models.ts +30 -2
|
@@ -11,13 +11,13 @@ export class TotpManagement {
|
|
|
11
11
|
this.client = client;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
async totpDevicesList(page?: number, page_size?: number): Promise<Models.
|
|
15
|
-
async totpDevicesList(params?: { page?: number; page_size?: number }): Promise<Models.
|
|
14
|
+
async totpDevicesList(page?: number, page_size?: number): Promise<Models.PaginatedDeviceListResponseList>;
|
|
15
|
+
async totpDevicesList(params?: { page?: number; page_size?: number }): Promise<Models.PaginatedDeviceListResponseList>;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* List all TOTP devices for user.
|
|
19
19
|
*/
|
|
20
|
-
async totpDevicesList(...args: any[]): Promise<Models.
|
|
20
|
+
async totpDevicesList(...args: any[]): Promise<Models.PaginatedDeviceListResponseList> {
|
|
21
21
|
const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
|
|
22
22
|
|
|
23
23
|
let params;
|
|
@@ -5,7 +5,7 @@ import * as Enums from "../enums";
|
|
|
5
5
|
*
|
|
6
6
|
* Response model (includes read-only fields).
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
8
|
+
export interface PaginatedDeviceListResponseList {
|
|
9
9
|
/** Total number of items across all pages */
|
|
10
10
|
count: number;
|
|
11
11
|
/** Current page number (1-based) */
|
|
@@ -23,7 +23,7 @@ export interface PaginatedDeviceListList {
|
|
|
23
23
|
/** Previous page number (null if no previous page) */
|
|
24
24
|
previous_page?: number | null;
|
|
25
25
|
/** Array of items for current page */
|
|
26
|
-
results: Array<
|
|
26
|
+
results: Array<DeviceListResponse>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -36,6 +36,16 @@ export interface DisableRequest {
|
|
|
36
36
|
code: string;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Response serializer for device list endpoint.
|
|
41
|
+
*
|
|
42
|
+
* Response model (includes read-only fields).
|
|
43
|
+
*/
|
|
44
|
+
export interface DeviceListResponse {
|
|
45
|
+
devices: Array<DeviceList>;
|
|
46
|
+
has_2fa_enabled: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
39
49
|
/**
|
|
40
50
|
* Serializer for listing TOTP devices.
|
|
41
51
|
*
|
|
@@ -22,8 +22,7 @@ export interface VerifyResponse {
|
|
|
22
22
|
access_token: string;
|
|
23
23
|
/** JWT refresh token */
|
|
24
24
|
refresh_token: string;
|
|
25
|
-
|
|
26
|
-
user: Record<string, any>;
|
|
25
|
+
user: TotpVerifyUser;
|
|
27
26
|
/** Number of remaining backup codes (if backup code was used) */
|
|
28
27
|
remaining_backup_codes?: number;
|
|
29
28
|
/** Warning message (e.g., low backup codes) */
|
|
@@ -42,3 +41,32 @@ export interface VerifyBackupRequest {
|
|
|
42
41
|
backup_code: string;
|
|
43
42
|
}
|
|
44
43
|
|
|
44
|
+
/**
|
|
45
|
+
* User data returned after 2FA verification.
|
|
46
|
+
*
|
|
47
|
+
* Response model (includes read-only fields).
|
|
48
|
+
*/
|
|
49
|
+
export interface TotpVerifyUser {
|
|
50
|
+
id: number;
|
|
51
|
+
email: string;
|
|
52
|
+
first_name?: string;
|
|
53
|
+
last_name?: string;
|
|
54
|
+
/** Get user's full name. */
|
|
55
|
+
full_name: string;
|
|
56
|
+
/** Get user's initials for avatar fallback. */
|
|
57
|
+
initials: string;
|
|
58
|
+
/** Get formatted username for display. */
|
|
59
|
+
display_username: string;
|
|
60
|
+
company?: string;
|
|
61
|
+
phone?: string;
|
|
62
|
+
position?: string;
|
|
63
|
+
avatar?: string | null;
|
|
64
|
+
/** Designates whether the user can log into this admin site. */
|
|
65
|
+
is_staff: boolean;
|
|
66
|
+
/** Designates that this user has all permissions without explicitly assigning them. */
|
|
67
|
+
is_superuser: boolean;
|
|
68
|
+
date_joined: string;
|
|
69
|
+
last_login?: string | null;
|
|
70
|
+
unanswered_messages_count: number;
|
|
71
|
+
}
|
|
72
|
+
|