@djangocfg/api 2.1.263 → 2.1.266

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 (33) hide show
  1. package/dist/auth.cjs +62 -74
  2. package/dist/auth.cjs.map +1 -1
  3. package/dist/auth.d.cts +0 -18
  4. package/dist/auth.d.ts +0 -18
  5. package/dist/auth.mjs +62 -74
  6. package/dist/auth.mjs.map +1 -1
  7. package/dist/clients.cjs +57 -79
  8. package/dist/clients.cjs.map +1 -1
  9. package/dist/clients.d.cts +113 -179
  10. package/dist/clients.d.ts +113 -179
  11. package/dist/clients.mjs +57 -79
  12. package/dist/clients.mjs.map +1 -1
  13. package/dist/hooks.d.cts +72 -72
  14. package/dist/hooks.d.ts +72 -72
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +97 -97
  17. package/dist/index.d.ts +97 -97
  18. package/dist/index.mjs.map +1 -1
  19. package/package.json +2 -2
  20. package/src/_api/generated/cfg_accounts/accounts/models.ts +31 -31
  21. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +40 -40
  22. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +31 -31
  23. package/src/_api/generated/cfg_totp/CLAUDE.md +3 -3
  24. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +7 -7
  25. package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +5 -5
  26. package/src/_api/generated/cfg_totp/_utils/schemas/index.ts +0 -1
  27. package/src/_api/generated/cfg_totp/schema.json +2 -103
  28. package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +14 -14
  29. package/src/_api/generated/cfg_totp/totp__totp_management/client.ts +2 -13
  30. package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +4 -29
  31. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +13 -13
  32. package/src/auth/hooks/useTwoFactorStatus.ts +21 -14
  33. package/src/_api/generated/cfg_totp/_utils/schemas/PaginatedDeviceListResponseList.schema.ts +0 -24
package/dist/hooks.d.cts CHANGED
@@ -39,26 +39,24 @@ declare enum OAuthConnectionProvider {
39
39
  }
40
40
 
41
41
  /**
42
- * Request to start OAuth flow.
42
+ * Response with available OAuth providers.
43
43
  *
44
- * Request model (no read-only fields).
44
+ * Response model (includes read-only fields).
45
45
  */
46
- interface OAuthAuthorizeRequestRequest$1 {
47
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
48
- redirect_uri?: string;
49
- /** Optional source URL for registration tracking */
50
- source_url?: string;
46
+ interface OAuthProvidersResponse {
47
+ /** List of available OAuth providers */
48
+ providers: Array<Record<string, any>>;
51
49
  }
52
50
  /**
53
- * Request to disconnect OAuth provider.
51
+ * Response with OAuth authorization URL.
54
52
  *
55
- * Request model (no read-only fields).
53
+ * Response model (includes read-only fields).
56
54
  */
57
- interface OAuthDisconnectRequestRequest$1 {
58
- /** OAuth provider to disconnect
59
-
60
- * `github` - GitHub */
61
- provider: OAuthConnectionProvider;
55
+ interface OAuthAuthorizeResponse$1 {
56
+ /** Full URL to redirect user to OAuth provider */
57
+ authorization_url: string;
58
+ /** State token for CSRF protection. Store this and verify on callback. */
59
+ state: string;
62
60
  }
63
61
  /**
64
62
  * Request to complete OAuth flow (callback handler).
@@ -73,26 +71,6 @@ interface OAuthCallbackRequestRequest$1 {
73
71
  /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
74
72
  redirect_uri?: string;
75
73
  }
76
- /**
77
- * Response with OAuth authorization URL.
78
- *
79
- * Response model (includes read-only fields).
80
- */
81
- interface OAuthAuthorizeResponse$1 {
82
- /** Full URL to redirect user to OAuth provider */
83
- authorization_url: string;
84
- /** State token for CSRF protection. Store this and verify on callback. */
85
- state: string;
86
- }
87
- /**
88
- * Response with available OAuth providers.
89
- *
90
- * Response model (includes read-only fields).
91
- */
92
- interface OAuthProvidersResponse {
93
- /** List of available OAuth providers */
94
- providers: Array<Record<string, any>>;
95
- }
96
74
  /**
97
75
  * Serializer for OAuth connection info (user-facing).
98
76
  *
@@ -116,6 +94,17 @@ interface OAuthConnection {
116
94
  /** Last time this OAuth connection was used for login */
117
95
  last_login_at: string;
118
96
  }
97
+ /**
98
+ * Request to start OAuth flow.
99
+ *
100
+ * Request model (no read-only fields).
101
+ */
102
+ interface OAuthAuthorizeRequestRequest$1 {
103
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
104
+ redirect_uri?: string;
105
+ /** Optional source URL for registration tracking */
106
+ source_url?: string;
107
+ }
119
108
  /**
120
109
  * Response with JWT tokens after OAuth authentication. When 2FA is required: -
121
110
  * requires_2fa: True - session_id: UUID of 2FA verification session -
@@ -142,6 +131,17 @@ interface OAuthTokenResponse$1 {
142
131
  /** True if user should be prompted to enable 2FA */
143
132
  should_prompt_2fa?: boolean;
144
133
  }
134
+ /**
135
+ * Request to disconnect OAuth provider.
136
+ *
137
+ * Request model (no read-only fields).
138
+ */
139
+ interface OAuthDisconnectRequestRequest$1 {
140
+ /** OAuth provider to disconnect
141
+
142
+ * `github` - GitHub */
143
+ provider: OAuthConnectionProvider;
144
+ }
145
145
 
146
146
  /**
147
147
  * API endpoints for Oauth.
@@ -183,6 +183,32 @@ declare class Oauth {
183
183
  accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse>;
184
184
  }
185
185
 
186
+ /**
187
+ * Serializer for updating user profile.
188
+ *
189
+ * Request model (no read-only fields).
190
+ */
191
+ interface UserProfileUpdateRequest$1 {
192
+ first_name?: string;
193
+ last_name?: string;
194
+ company?: string;
195
+ phone?: string;
196
+ position?: string;
197
+ language?: string;
198
+ }
199
+ /**
200
+ * Serializer for updating user profile.
201
+ *
202
+ * Request model (no read-only fields).
203
+ */
204
+ interface PatchedUserProfileUpdateRequest$1 {
205
+ first_name?: string;
206
+ last_name?: string;
207
+ company?: string;
208
+ phone?: string;
209
+ position?: string;
210
+ language?: string;
211
+ }
186
212
  /**
187
213
  * Serializer for user details.
188
214
  *
@@ -213,27 +239,6 @@ interface User$2 {
213
239
  unanswered_messages_count: number;
214
240
  centrifugo: CentrifugoToken$1 | null;
215
241
  }
216
- /**
217
- * Serializer for updating user profile.
218
- *
219
- * Request model (no read-only fields).
220
- */
221
- interface PatchedUserProfileUpdateRequest$1 {
222
- first_name?: string;
223
- last_name?: string;
224
- company?: string;
225
- phone?: string;
226
- position?: string;
227
- language?: string;
228
- }
229
- /**
230
- *
231
- * Request model (no read-only fields).
232
- */
233
- interface CfgAccountsProfileAvatarCreateRequest$1 {
234
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
235
- avatar: File | Blob;
236
- }
237
242
  /**
238
243
  * Response serializer for account deletion.
239
244
  *
@@ -246,17 +251,12 @@ interface AccountDeleteResponse$1 {
246
251
  message: string;
247
252
  }
248
253
  /**
249
- * Serializer for updating user profile.
250
254
  *
251
255
  * Request model (no read-only fields).
252
256
  */
253
- interface UserProfileUpdateRequest$1 {
254
- first_name?: string;
255
- last_name?: string;
256
- company?: string;
257
- phone?: string;
258
- position?: string;
259
- language?: string;
257
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
258
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
259
+ avatar: File | Blob;
260
260
  }
261
261
  /**
262
262
  * Nested serializer for Centrifugo WebSocket connection token.
@@ -343,15 +343,6 @@ interface OTPVerifyRequest$1 {
343
343
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
344
344
  source_url?: string;
345
345
  }
346
- /**
347
- * OTP request response.
348
- *
349
- * Response model (includes read-only fields).
350
- */
351
- interface OTPRequestResponse$1 {
352
- /** Success message */
353
- message: string;
354
- }
355
346
  /**
356
347
  * OTP verification response. When 2FA is required: - requires_2fa: True -
357
348
  * session_id: UUID of 2FA verification session - refresh/access/user: null
@@ -384,6 +375,15 @@ interface OTPRequestRequest$1 {
384
375
  /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
385
376
  source_url?: string;
386
377
  }
378
+ /**
379
+ * OTP request response.
380
+ *
381
+ * Response model (includes read-only fields).
382
+ */
383
+ interface OTPRequestResponse$1 {
384
+ /** Success message */
385
+ message: string;
386
+ }
387
387
  /**
388
388
  * Serializer for user details.
389
389
  *
package/dist/hooks.d.ts CHANGED
@@ -39,26 +39,24 @@ declare enum OAuthConnectionProvider {
39
39
  }
40
40
 
41
41
  /**
42
- * Request to start OAuth flow.
42
+ * Response with available OAuth providers.
43
43
  *
44
- * Request model (no read-only fields).
44
+ * Response model (includes read-only fields).
45
45
  */
46
- interface OAuthAuthorizeRequestRequest$1 {
47
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
48
- redirect_uri?: string;
49
- /** Optional source URL for registration tracking */
50
- source_url?: string;
46
+ interface OAuthProvidersResponse {
47
+ /** List of available OAuth providers */
48
+ providers: Array<Record<string, any>>;
51
49
  }
52
50
  /**
53
- * Request to disconnect OAuth provider.
51
+ * Response with OAuth authorization URL.
54
52
  *
55
- * Request model (no read-only fields).
53
+ * Response model (includes read-only fields).
56
54
  */
57
- interface OAuthDisconnectRequestRequest$1 {
58
- /** OAuth provider to disconnect
59
-
60
- * `github` - GitHub */
61
- provider: OAuthConnectionProvider;
55
+ interface OAuthAuthorizeResponse$1 {
56
+ /** Full URL to redirect user to OAuth provider */
57
+ authorization_url: string;
58
+ /** State token for CSRF protection. Store this and verify on callback. */
59
+ state: string;
62
60
  }
63
61
  /**
64
62
  * Request to complete OAuth flow (callback handler).
@@ -73,26 +71,6 @@ interface OAuthCallbackRequestRequest$1 {
73
71
  /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
74
72
  redirect_uri?: string;
75
73
  }
76
- /**
77
- * Response with OAuth authorization URL.
78
- *
79
- * Response model (includes read-only fields).
80
- */
81
- interface OAuthAuthorizeResponse$1 {
82
- /** Full URL to redirect user to OAuth provider */
83
- authorization_url: string;
84
- /** State token for CSRF protection. Store this and verify on callback. */
85
- state: string;
86
- }
87
- /**
88
- * Response with available OAuth providers.
89
- *
90
- * Response model (includes read-only fields).
91
- */
92
- interface OAuthProvidersResponse {
93
- /** List of available OAuth providers */
94
- providers: Array<Record<string, any>>;
95
- }
96
74
  /**
97
75
  * Serializer for OAuth connection info (user-facing).
98
76
  *
@@ -116,6 +94,17 @@ interface OAuthConnection {
116
94
  /** Last time this OAuth connection was used for login */
117
95
  last_login_at: string;
118
96
  }
97
+ /**
98
+ * Request to start OAuth flow.
99
+ *
100
+ * Request model (no read-only fields).
101
+ */
102
+ interface OAuthAuthorizeRequestRequest$1 {
103
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
104
+ redirect_uri?: string;
105
+ /** Optional source URL for registration tracking */
106
+ source_url?: string;
107
+ }
119
108
  /**
120
109
  * Response with JWT tokens after OAuth authentication. When 2FA is required: -
121
110
  * requires_2fa: True - session_id: UUID of 2FA verification session -
@@ -142,6 +131,17 @@ interface OAuthTokenResponse$1 {
142
131
  /** True if user should be prompted to enable 2FA */
143
132
  should_prompt_2fa?: boolean;
144
133
  }
134
+ /**
135
+ * Request to disconnect OAuth provider.
136
+ *
137
+ * Request model (no read-only fields).
138
+ */
139
+ interface OAuthDisconnectRequestRequest$1 {
140
+ /** OAuth provider to disconnect
141
+
142
+ * `github` - GitHub */
143
+ provider: OAuthConnectionProvider;
144
+ }
145
145
 
146
146
  /**
147
147
  * API endpoints for Oauth.
@@ -183,6 +183,32 @@ declare class Oauth {
183
183
  accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse>;
184
184
  }
185
185
 
186
+ /**
187
+ * Serializer for updating user profile.
188
+ *
189
+ * Request model (no read-only fields).
190
+ */
191
+ interface UserProfileUpdateRequest$1 {
192
+ first_name?: string;
193
+ last_name?: string;
194
+ company?: string;
195
+ phone?: string;
196
+ position?: string;
197
+ language?: string;
198
+ }
199
+ /**
200
+ * Serializer for updating user profile.
201
+ *
202
+ * Request model (no read-only fields).
203
+ */
204
+ interface PatchedUserProfileUpdateRequest$1 {
205
+ first_name?: string;
206
+ last_name?: string;
207
+ company?: string;
208
+ phone?: string;
209
+ position?: string;
210
+ language?: string;
211
+ }
186
212
  /**
187
213
  * Serializer for user details.
188
214
  *
@@ -213,27 +239,6 @@ interface User$2 {
213
239
  unanswered_messages_count: number;
214
240
  centrifugo: CentrifugoToken$1 | null;
215
241
  }
216
- /**
217
- * Serializer for updating user profile.
218
- *
219
- * Request model (no read-only fields).
220
- */
221
- interface PatchedUserProfileUpdateRequest$1 {
222
- first_name?: string;
223
- last_name?: string;
224
- company?: string;
225
- phone?: string;
226
- position?: string;
227
- language?: string;
228
- }
229
- /**
230
- *
231
- * Request model (no read-only fields).
232
- */
233
- interface CfgAccountsProfileAvatarCreateRequest$1 {
234
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
235
- avatar: File | Blob;
236
- }
237
242
  /**
238
243
  * Response serializer for account deletion.
239
244
  *
@@ -246,17 +251,12 @@ interface AccountDeleteResponse$1 {
246
251
  message: string;
247
252
  }
248
253
  /**
249
- * Serializer for updating user profile.
250
254
  *
251
255
  * Request model (no read-only fields).
252
256
  */
253
- interface UserProfileUpdateRequest$1 {
254
- first_name?: string;
255
- last_name?: string;
256
- company?: string;
257
- phone?: string;
258
- position?: string;
259
- language?: string;
257
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
258
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
259
+ avatar: File | Blob;
260
260
  }
261
261
  /**
262
262
  * Nested serializer for Centrifugo WebSocket connection token.
@@ -343,15 +343,6 @@ interface OTPVerifyRequest$1 {
343
343
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
344
344
  source_url?: string;
345
345
  }
346
- /**
347
- * OTP request response.
348
- *
349
- * Response model (includes read-only fields).
350
- */
351
- interface OTPRequestResponse$1 {
352
- /** Success message */
353
- message: string;
354
- }
355
346
  /**
356
347
  * OTP verification response. When 2FA is required: - requires_2fa: True -
357
348
  * session_id: UUID of 2FA verification session - refresh/access/user: null
@@ -384,6 +375,15 @@ interface OTPRequestRequest$1 {
384
375
  /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
385
376
  source_url?: string;
386
377
  }
378
+ /**
379
+ * OTP request response.
380
+ *
381
+ * Response model (includes read-only fields).
382
+ */
383
+ interface OTPRequestResponse$1 {
384
+ /** Success message */
385
+ message: string;
386
+ }
387
387
  /**
388
388
  * Serializer for user details.
389
389
  *