@djangocfg/api 2.1.263 → 2.1.264

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.
Files changed (31) hide show
  1. package/dist/auth.cjs +49 -72
  2. package/dist/auth.cjs.map +1 -1
  3. package/dist/auth.mjs +49 -72
  4. package/dist/auth.mjs.map +1 -1
  5. package/dist/clients.cjs +57 -79
  6. package/dist/clients.cjs.map +1 -1
  7. package/dist/clients.d.cts +113 -179
  8. package/dist/clients.d.ts +113 -179
  9. package/dist/clients.mjs +57 -79
  10. package/dist/clients.mjs.map +1 -1
  11. package/dist/hooks.d.cts +72 -72
  12. package/dist/hooks.d.ts +72 -72
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +97 -97
  15. package/dist/index.d.ts +97 -97
  16. package/dist/index.mjs.map +1 -1
  17. package/package.json +2 -2
  18. package/src/_api/generated/cfg_accounts/accounts/models.ts +31 -31
  19. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +40 -40
  20. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +31 -31
  21. package/src/_api/generated/cfg_totp/CLAUDE.md +3 -3
  22. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +7 -7
  23. package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +5 -5
  24. package/src/_api/generated/cfg_totp/_utils/schemas/index.ts +0 -1
  25. package/src/_api/generated/cfg_totp/schema.json +2 -103
  26. package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +14 -14
  27. package/src/_api/generated/cfg_totp/totp__totp_management/client.ts +2 -13
  28. package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +4 -29
  29. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +13 -13
  30. package/src/auth/hooks/useTwoFactorStatus.ts +5 -11
  31. package/src/_api/generated/cfg_totp/_utils/schemas/PaginatedDeviceListResponseList.schema.ts +0 -24
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/api",
3
- "version": "2.1.263",
3
+ "version": "2.1.264",
4
4
  "description": "Auto-generated TypeScript API client with React hooks, SWR integration, and Zod validation for Django REST Framework backends",
5
5
  "keywords": [
6
6
  "django",
@@ -84,7 +84,7 @@
84
84
  "devDependencies": {
85
85
  "@types/node": "^24.7.2",
86
86
  "@types/react": "^19.1.0",
87
- "@djangocfg/typescript-config": "^2.1.263",
87
+ "@djangocfg/typescript-config": "^2.1.264",
88
88
  "next": "^16.0.10",
89
89
  "react": "^19.1.0",
90
90
  "tsup": "^8.5.0",
@@ -13,37 +13,6 @@ export interface OTPVerifyRequest {
13
13
  source_url?: string;
14
14
  }
15
15
 
16
- /**
17
- * OTP request response.
18
- *
19
- * Response model (includes read-only fields).
20
- */
21
- export interface OTPRequestResponse {
22
- /** Success message */
23
- message: string;
24
- }
25
-
26
- /**
27
- * Typed error response for OTP operations. error_code values: -
28
- * invalid_identifier — malformed email - cooldown — too soon after last
29
- * request (retry_after = seconds) - hourly_limit — hourly quota exceeded
30
- * (retry_after = seconds until reset) - daily_limit — daily quota exceeded
31
- * (retry_after = seconds until reset) - rate_limited — IP-level rate limit hit
32
- * (no retry_after) - user_creation_failed — internal error creating account -
33
- * send_failed — transport error (email / SMS) - internal_error — unexpected
34
- * server error
35
- *
36
- * Response model (includes read-only fields).
37
- */
38
- export interface OTPErrorResponse {
39
- /** Human-readable error message */
40
- error: string;
41
- /** Machine-readable error code */
42
- error_code?: string | null;
43
- /** Seconds until the client may retry (present only for rate-limit errors) */
44
- retry_after?: number | null;
45
- }
46
-
47
16
  /**
48
17
  * OTP verification response. When 2FA is required: - requires_2fa: True -
49
18
  * session_id: UUID of 2FA verification session - refresh/access/user: null
@@ -78,6 +47,37 @@ export interface OTPRequestRequest {
78
47
  source_url?: string;
79
48
  }
80
49
 
50
+ /**
51
+ * OTP request response.
52
+ *
53
+ * Response model (includes read-only fields).
54
+ */
55
+ export interface OTPRequestResponse {
56
+ /** Success message */
57
+ message: string;
58
+ }
59
+
60
+ /**
61
+ * Typed error response for OTP operations. error_code values: -
62
+ * invalid_identifier — malformed email - cooldown — too soon after last
63
+ * request (retry_after = seconds) - hourly_limit — hourly quota exceeded
64
+ * (retry_after = seconds until reset) - daily_limit — daily quota exceeded
65
+ * (retry_after = seconds until reset) - rate_limited — IP-level rate limit hit
66
+ * (no retry_after) - user_creation_failed — internal error creating account -
67
+ * send_failed — transport error (email / SMS) - internal_error — unexpected
68
+ * server error
69
+ *
70
+ * Response model (includes read-only fields).
71
+ */
72
+ export interface OTPErrorResponse {
73
+ /** Human-readable error message */
74
+ error: string;
75
+ /** Machine-readable error code */
76
+ error_code?: string | null;
77
+ /** Seconds until the client may retry (present only for rate-limit errors) */
78
+ retry_after?: number | null;
79
+ }
80
+
81
81
  /**
82
82
  * Serializer for user details.
83
83
  *
@@ -3,41 +3,25 @@
3
3
  import * as Enums from "../enums";
4
4
 
5
5
  /**
6
- * Request to start OAuth flow.
7
- *
8
- * Request model (no read-only fields).
9
- */
10
- export interface OAuthAuthorizeRequestRequest {
11
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
12
- redirect_uri?: string;
13
- /** Optional source URL for registration tracking */
14
- source_url?: string;
15
- }
16
-
17
- /**
18
- * Request to disconnect OAuth provider.
6
+ * Error response for OAuth endpoints.
19
7
  *
20
- * Request model (no read-only fields).
8
+ * Response model (includes read-only fields).
21
9
  */
22
- export interface OAuthDisconnectRequestRequest {
23
- /** OAuth provider to disconnect
24
-
25
- * `github` - GitHub */
26
- provider: Enums.OAuthConnectionProvider;
10
+ export interface OAuthError {
11
+ /** Error code */
12
+ error: string;
13
+ /** Human-readable error description */
14
+ error_description?: string;
27
15
  }
28
16
 
29
17
  /**
30
- * Request to complete OAuth flow (callback handler).
18
+ * Response with available OAuth providers.
31
19
  *
32
- * Request model (no read-only fields).
20
+ * Response model (includes read-only fields).
33
21
  */
34
- export interface OAuthCallbackRequestRequest {
35
- /** Authorization code from OAuth provider callback */
36
- code: string;
37
- /** State token for CSRF verification (from authorize response) */
38
- state: string;
39
- /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
40
- redirect_uri?: string;
22
+ export interface OAuthProvidersResponse {
23
+ /** List of available OAuth providers */
24
+ providers: Array<Record<string, any>>;
41
25
  }
42
26
 
43
27
  /**
@@ -53,13 +37,17 @@ export interface OAuthAuthorizeResponse {
53
37
  }
54
38
 
55
39
  /**
56
- * Response with available OAuth providers.
40
+ * Request to complete OAuth flow (callback handler).
57
41
  *
58
- * Response model (includes read-only fields).
42
+ * Request model (no read-only fields).
59
43
  */
60
- export interface OAuthProvidersResponse {
61
- /** List of available OAuth providers */
62
- providers: Array<Record<string, any>>;
44
+ export interface OAuthCallbackRequestRequest {
45
+ /** Authorization code from OAuth provider callback */
46
+ code: string;
47
+ /** State token for CSRF verification (from authorize response) */
48
+ state: string;
49
+ /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
50
+ redirect_uri?: string;
63
51
  }
64
52
 
65
53
  /**
@@ -86,6 +74,18 @@ export interface OAuthConnection {
86
74
  last_login_at: string;
87
75
  }
88
76
 
77
+ /**
78
+ * Request to start OAuth flow.
79
+ *
80
+ * Request model (no read-only fields).
81
+ */
82
+ export interface OAuthAuthorizeRequestRequest {
83
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
84
+ redirect_uri?: string;
85
+ /** Optional source URL for registration tracking */
86
+ source_url?: string;
87
+ }
88
+
89
89
  /**
90
90
  * Response with JWT tokens after OAuth authentication. When 2FA is required: -
91
91
  * requires_2fa: True - session_id: UUID of 2FA verification session -
@@ -114,14 +114,14 @@ export interface OAuthTokenResponse {
114
114
  }
115
115
 
116
116
  /**
117
- * Error response for OAuth endpoints.
117
+ * Request to disconnect OAuth provider.
118
118
  *
119
- * Response model (includes read-only fields).
119
+ * Request model (no read-only fields).
120
120
  */
121
- export interface OAuthError {
122
- /** Error code */
123
- error: string;
124
- /** Human-readable error description */
125
- error_description?: string;
121
+ export interface OAuthDisconnectRequestRequest {
122
+ /** OAuth provider to disconnect
123
+
124
+ * `github` - GitHub */
125
+ provider: Enums.OAuthConnectionProvider;
126
126
  }
127
127
 
@@ -1,5 +1,33 @@
1
1
  // @ts-nocheck
2
2
  // Auto-generated by DjangoCFG - see CLAUDE.md
3
+ /**
4
+ * Serializer for updating user profile.
5
+ *
6
+ * Request model (no read-only fields).
7
+ */
8
+ export interface UserProfileUpdateRequest {
9
+ first_name?: string;
10
+ last_name?: string;
11
+ company?: string;
12
+ phone?: string;
13
+ position?: string;
14
+ language?: string;
15
+ }
16
+
17
+ /**
18
+ * Serializer for updating user profile.
19
+ *
20
+ * Request model (no read-only fields).
21
+ */
22
+ export interface PatchedUserProfileUpdateRequest {
23
+ first_name?: string;
24
+ last_name?: string;
25
+ company?: string;
26
+ phone?: string;
27
+ position?: string;
28
+ language?: string;
29
+ }
30
+
3
31
  /**
4
32
  * Serializer for user details.
5
33
  *
@@ -31,29 +59,6 @@ export interface User {
31
59
  centrifugo: CentrifugoToken | null;
32
60
  }
33
61
 
34
- /**
35
- * Serializer for updating user profile.
36
- *
37
- * Request model (no read-only fields).
38
- */
39
- export interface PatchedUserProfileUpdateRequest {
40
- first_name?: string;
41
- last_name?: string;
42
- company?: string;
43
- phone?: string;
44
- position?: string;
45
- language?: string;
46
- }
47
-
48
- /**
49
- *
50
- * Request model (no read-only fields).
51
- */
52
- export interface CfgAccountsProfileAvatarCreateRequest {
53
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
54
- avatar: File | Blob;
55
- }
56
-
57
62
  /**
58
63
  * Response serializer for account deletion.
59
64
  *
@@ -67,17 +72,12 @@ export interface AccountDeleteResponse {
67
72
  }
68
73
 
69
74
  /**
70
- * Serializer for updating user profile.
71
75
  *
72
76
  * Request model (no read-only fields).
73
77
  */
74
- export interface UserProfileUpdateRequest {
75
- first_name?: string;
76
- last_name?: string;
77
- company?: string;
78
- phone?: string;
79
- position?: string;
80
- language?: string;
78
+ export interface CfgAccountsProfileAvatarCreateRequest {
79
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
80
+ avatar: File | Blob;
81
81
  }
82
82
 
83
83
  /**
@@ -12,7 +12,7 @@ python manage.py generate_client --groups cfg_totp --typescript
12
12
  |---|---|
13
13
  | Version | 3.1.0 |
14
14
  | Operations | 9 |
15
- | Schemas | 15 |
15
+ | Schemas | 14 |
16
16
 
17
17
  ## Resources
18
18
 
@@ -29,7 +29,7 @@ python manage.py generate_client --groups cfg_totp --typescript
29
29
  - `GET` /cfg/totp/backup-codes/ → `cfg_totp_backup_codes_retrieve`
30
30
 
31
31
  **TOTP Management:**
32
- - `GET` /cfg/totp/devices/ → `cfg_totp_devices_list`
32
+ - `GET` /cfg/totp/devices/ → `cfg_totp_devices_retrieve`
33
33
  - `POST` /cfg/totp/disable/ → `cfg_totp_disable_create`
34
34
 
35
35
  **TOTP Setup:**
@@ -52,7 +52,7 @@ const client = new APIClient({ baseUrl, token });
52
52
 
53
53
  await client.backup codes.retrieve({ id: 1 });
54
54
  await client.backup codes.create({ ... });
55
- await client.totp management.list();
55
+ await client.totp management.retrieve({ id: 1 });
56
56
  await client.totp management.create({ ... });
57
57
  ```
58
58
 
@@ -32,8 +32,8 @@
32
32
  * ```
33
33
  */
34
34
  import { consola } from 'consola'
35
+ import { DeviceListResponseSchema, type DeviceListResponse } from '../schemas/DeviceListResponse.schema'
35
36
  import { DisableRequestSchema, type DisableRequest } from '../schemas/DisableRequest.schema'
36
- import { PaginatedDeviceListResponseListSchema, type PaginatedDeviceListResponseList } from '../schemas/PaginatedDeviceListResponseList.schema'
37
37
  import { getAPIInstance } from '../../api-instance'
38
38
 
39
39
  /**
@@ -42,16 +42,16 @@ import { getAPIInstance } from '../../api-instance'
42
42
  * @method GET
43
43
  * @path /cfg/totp/devices/
44
44
  */
45
- export async function getTotpDevicesList( params?: { ordering?: string; page?: number; page_size?: number; search?: string }, client?: any
46
- ): Promise<PaginatedDeviceListResponseList> {
45
+ export async function getTotpDevicesRetrieve( client?: any
46
+ ): Promise<DeviceListResponse> {
47
47
  const api = client || getAPIInstance()
48
- const response = await api.totp_management.totpDevicesList(params?.ordering, params?.page, params?.page_size, params?.search)
48
+ const response = await api.totp_management.totpDevicesRetrieve()
49
49
  try {
50
- return PaginatedDeviceListResponseListSchema.parse(response)
50
+ return DeviceListResponseSchema.parse(response)
51
51
  } catch (error) {
52
52
  // Zod validation error - log detailed information
53
53
  consola.error('❌ Zod Validation Failed');
54
- consola.box(`getTotpDevicesList\nPath: /cfg/totp/devices/\nMethod: GET`);
54
+ consola.box(`getTotpDevicesRetrieve\nPath: /cfg/totp/devices/\nMethod: GET`);
55
55
 
56
56
  if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
57
57
  consola.error('Validation Issues:');
@@ -70,7 +70,7 @@ export async function getTotpDevicesList( params?: { ordering?: string; page?:
70
70
  try {
71
71
  const event = new CustomEvent('zod-validation-error', {
72
72
  detail: {
73
- operation: 'getTotpDevicesList',
73
+ operation: 'getTotpDevicesRetrieve',
74
74
  path: '/cfg/totp/devices/',
75
75
  method: 'GET',
76
76
  error: error,
@@ -22,8 +22,8 @@ import useSWR from 'swr'
22
22
  import { useSWRConfig } from 'swr'
23
23
  import * as Fetchers from '../fetchers/totp__totp_management'
24
24
  import type { API } from '../../index'
25
+ import type { DeviceListResponse } from '../schemas/DeviceListResponse.schema'
25
26
  import type { DisableRequest } from '../schemas/DisableRequest.schema'
26
- import type { PaginatedDeviceListResponseList } from '../schemas/PaginatedDeviceListResponseList.schema'
27
27
 
28
28
  /**
29
29
  * API operation
@@ -31,10 +31,10 @@ import type { PaginatedDeviceListResponseList } from '../schemas/PaginatedDevice
31
31
  * @method GET
32
32
  * @path /cfg/totp/devices/
33
33
  */
34
- export function useTotpDevicesList(params?: { ordering?: string; page?: number; page_size?: number; search?: string }, client?: API): ReturnType<typeof useSWR<PaginatedDeviceListResponseList>> {
35
- return useSWR<PaginatedDeviceListResponseList>(
36
- ['cfg-totp-devices', params],
37
- () => Fetchers.getTotpDevicesList(params, client)
34
+ export function useTotpDevicesRetrieve(client?: API): ReturnType<typeof useSWR<DeviceListResponse>> {
35
+ return useSWR<DeviceListResponse>(
36
+ 'cfg-totp-device',
37
+ () => Fetchers.getTotpDevicesRetrieve(client)
38
38
  )
39
39
  }
40
40
 
@@ -26,7 +26,6 @@ export * from './ConfirmSetupResponse.schema'
26
26
  export * from './DeviceList.schema'
27
27
  export * from './DeviceListResponse.schema'
28
28
  export * from './DisableRequest.schema'
29
- export * from './PaginatedDeviceListResponseList.schema'
30
29
  export * from './SetupRequest.schema'
31
30
  export * from './SetupResponse.schema'
32
31
  export * from './TotpVerifyUser.schema'
@@ -100,46 +100,8 @@
100
100
  },
101
101
  "/cfg/totp/devices/": {
102
102
  "get": {
103
- "operationId": "cfg_totp_devices_list",
103
+ "operationId": "cfg_totp_devices_retrieve",
104
104
  "description": "List all TOTP devices for user.",
105
- "parameters": [
106
- {
107
- "name": "ordering",
108
- "required": false,
109
- "in": "query",
110
- "description": "Which field to use when ordering the results.",
111
- "schema": {
112
- "type": "string"
113
- }
114
- },
115
- {
116
- "name": "page",
117
- "required": false,
118
- "in": "query",
119
- "description": "A page number within the paginated result set.",
120
- "schema": {
121
- "type": "integer"
122
- }
123
- },
124
- {
125
- "name": "page_size",
126
- "required": false,
127
- "in": "query",
128
- "description": "Number of results to return per page.",
129
- "schema": {
130
- "type": "integer"
131
- }
132
- },
133
- {
134
- "name": "search",
135
- "required": false,
136
- "in": "query",
137
- "description": "A search term.",
138
- "schema": {
139
- "type": "string"
140
- }
141
- }
142
- ],
143
105
  "tags": [
144
106
  "TOTP Management"
145
107
  ],
@@ -153,7 +115,7 @@
153
115
  "content": {
154
116
  "application/json": {
155
117
  "schema": {
156
- "$ref": "#/components/schemas/PaginatedDeviceListResponseList"
118
+ "$ref": "#/components/schemas/DeviceListResponse"
157
119
  }
158
120
  }
159
121
  },
@@ -698,69 +660,6 @@
698
660
  "code"
699
661
  ]
700
662
  },
701
- "PaginatedDeviceListResponseList": {
702
- "type": "object",
703
- "required": [
704
- "count",
705
- "page",
706
- "pages",
707
- "page_size",
708
- "has_next",
709
- "has_previous",
710
- "results"
711
- ],
712
- "properties": {
713
- "count": {
714
- "type": "integer",
715
- "description": "Total number of items across all pages",
716
- "example": 150
717
- },
718
- "page": {
719
- "type": "integer",
720
- "description": "Current page number (1-based)",
721
- "example": 2
722
- },
723
- "pages": {
724
- "type": "integer",
725
- "description": "Total number of pages",
726
- "example": 15
727
- },
728
- "page_size": {
729
- "type": "integer",
730
- "description": "Number of items per page",
731
- "example": 10
732
- },
733
- "has_next": {
734
- "type": "boolean",
735
- "description": "Whether there is a next page",
736
- "example": true
737
- },
738
- "has_previous": {
739
- "type": "boolean",
740
- "description": "Whether there is a previous page",
741
- "example": true
742
- },
743
- "next_page": {
744
- "type": "integer",
745
- "nullable": true,
746
- "description": "Next page number (null if no next page)",
747
- "example": 3
748
- },
749
- "previous_page": {
750
- "type": "integer",
751
- "nullable": true,
752
- "description": "Previous page number (null if no previous page)",
753
- "example": 1
754
- },
755
- "results": {
756
- "type": "array",
757
- "items": {
758
- "$ref": "#/components/schemas/DeviceListResponse"
759
- },
760
- "description": "Array of items for current page"
761
- }
762
- }
763
- },
764
663
  "SetupRequest": {
765
664
  "type": "object",
766
665
  "description": "Serializer for starting 2FA setup.",
@@ -1,17 +1,13 @@
1
1
  // @ts-nocheck
2
2
  // Auto-generated by DjangoCFG - see CLAUDE.md
3
3
  /**
4
- * Serializer for backup codes status.
4
+ * Serializer for regenerating backup codes.
5
5
  *
6
- * Response model (includes read-only fields).
6
+ * Request model (no read-only fields).
7
7
  */
8
- export interface BackupCodesStatus {
9
- /** Number of unused backup codes */
10
- remaining_count: number;
11
- /** Total number of codes generated */
12
- total_generated: number;
13
- /** Warning if running low on codes */
14
- warning?: string | null;
8
+ export interface BackupCodesRegenerateRequest {
9
+ /** TOTP code for verification */
10
+ code: string;
15
11
  }
16
12
 
17
13
  /**
@@ -27,12 +23,16 @@ export interface BackupCodesRegenerateResponse {
27
23
  }
28
24
 
29
25
  /**
30
- * Serializer for regenerating backup codes.
26
+ * Serializer for backup codes status.
31
27
  *
32
- * Request model (no read-only fields).
28
+ * Response model (includes read-only fields).
33
29
  */
34
- export interface BackupCodesRegenerateRequest {
35
- /** TOTP code for verification */
36
- code: string;
30
+ export interface BackupCodesStatus {
31
+ /** Number of unused backup codes */
32
+ remaining_count: number;
33
+ /** Total number of codes generated */
34
+ total_generated: number;
35
+ /** Warning if running low on codes */
36
+ warning?: string | null;
37
37
  }
38
38
 
@@ -12,22 +12,11 @@ export class TotpManagement {
12
12
  this.client = client;
13
13
  }
14
14
 
15
- async totpDevicesList(ordering?: string, page?: number, page_size?: number, search?: string): Promise<Models.PaginatedDeviceListResponseList>;
16
- async totpDevicesList(params?: { ordering?: string; page?: number; page_size?: number; search?: string }): Promise<Models.PaginatedDeviceListResponseList>;
17
-
18
15
  /**
19
16
  * List all TOTP devices for user.
20
17
  */
21
- async totpDevicesList(...args: any[]): Promise<Models.PaginatedDeviceListResponseList> {
22
- const isParamsObject = args.length === 1 && typeof args[0] === 'object' && args[0] !== null && !Array.isArray(args[0]);
23
-
24
- let params;
25
- if (isParamsObject) {
26
- params = args[0];
27
- } else {
28
- params = { ordering: args[0], page: args[1], page_size: args[2], search: args[3] };
29
- }
30
- const response = await this.client.request('GET', "/cfg/totp/devices/", { params });
18
+ async totpDevicesRetrieve(): Promise<Models.DeviceListResponse> {
19
+ const response = await this.client.request('GET', "/cfg/totp/devices/");
31
20
  return response;
32
21
  }
33
22
 
@@ -3,28 +3,13 @@
3
3
  import * as Enums from "../enums";
4
4
 
5
5
  /**
6
+ * Response serializer for device list endpoint.
6
7
  *
7
8
  * Response model (includes read-only fields).
8
9
  */
9
- export interface PaginatedDeviceListResponseList {
10
- /** Total number of items across all pages */
11
- count: number;
12
- /** Current page number (1-based) */
13
- page: number;
14
- /** Total number of pages */
15
- pages: number;
16
- /** Number of items per page */
17
- page_size: number;
18
- /** Whether there is a next page */
19
- has_next: boolean;
20
- /** Whether there is a previous page */
21
- has_previous: boolean;
22
- /** Next page number (null if no next page) */
23
- next_page?: number | null;
24
- /** Previous page number (null if no previous page) */
25
- previous_page?: number | null;
26
- /** Array of items for current page */
27
- results: Array<DeviceListResponse>;
10
+ export interface DeviceListResponse {
11
+ devices: Array<DeviceList>;
12
+ has_2fa_enabled: boolean;
28
13
  }
29
14
 
30
15
  /**
@@ -37,16 +22,6 @@ export interface DisableRequest {
37
22
  code: string;
38
23
  }
39
24
 
40
- /**
41
- * Response serializer for device list endpoint.
42
- *
43
- * Response model (includes read-only fields).
44
- */
45
- export interface DeviceListResponse {
46
- devices: Array<DeviceList>;
47
- has_2fa_enabled: boolean;
48
- }
49
-
50
25
  /**
51
26
  * Serializer for listing TOTP devices.
52
27
  *
@@ -12,19 +12,6 @@ export interface ConfirmSetupRequest {
12
12
  code: string;
13
13
  }
14
14
 
15
- /**
16
- * Response serializer for setup confirmation.
17
- *
18
- * Response model (includes read-only fields).
19
- */
20
- export interface ConfirmSetupResponse {
21
- message: string;
22
- /** List of backup recovery codes (save these!) */
23
- backup_codes: Array<string>;
24
- /** Warning message about backup codes */
25
- backup_codes_warning: string;
26
- }
27
-
28
15
  /**
29
16
  * Response serializer for setup initiation.
30
17
  *
@@ -53,3 +40,16 @@ export interface SetupRequest {
53
40
  device_name?: string;
54
41
  }
55
42
 
43
+ /**
44
+ * Response serializer for setup confirmation.
45
+ *
46
+ * Response model (includes read-only fields).
47
+ */
48
+ export interface ConfirmSetupResponse {
49
+ message: string;
50
+ /** List of backup recovery codes (save these!) */
51
+ backup_codes: Array<string>;
52
+ /** Warning message about backup codes */
53
+ backup_codes_warning: string;
54
+ }
55
+