@djangocfg/api 2.1.230 → 2.1.232

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 (92) hide show
  1. package/README.md +19 -4
  2. package/dist/auth-server.cjs +45 -358
  3. package/dist/auth-server.cjs.map +1 -1
  4. package/dist/auth-server.mjs +43 -356
  5. package/dist/auth-server.mjs.map +1 -1
  6. package/dist/auth.cjs +223 -735
  7. package/dist/auth.cjs.map +1 -1
  8. package/dist/auth.mjs +218 -730
  9. package/dist/auth.mjs.map +1 -1
  10. package/dist/clients.cjs +313 -1568
  11. package/dist/clients.cjs.map +1 -1
  12. package/dist/clients.d.cts +211 -1932
  13. package/dist/clients.d.ts +211 -1932
  14. package/dist/clients.mjs +309 -1564
  15. package/dist/clients.mjs.map +1 -1
  16. package/dist/hooks.cjs +36 -32
  17. package/dist/hooks.cjs.map +1 -1
  18. package/dist/hooks.d.cts +76 -76
  19. package/dist/hooks.d.ts +76 -76
  20. package/dist/hooks.mjs +36 -32
  21. package/dist/hooks.mjs.map +1 -1
  22. package/dist/index.cjs +88 -593
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +88 -88
  25. package/dist/index.d.ts +88 -88
  26. package/dist/index.mjs +88 -593
  27. package/dist/index.mjs.map +1 -1
  28. package/package.json +2 -2
  29. package/src/_api/generated/cfg_accounts/accounts/models.ts +34 -34
  30. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +41 -41
  31. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +18 -18
  32. package/src/_api/generated/cfg_accounts/client.ts +39 -42
  33. package/src/_api/generated/cfg_centrifugo/CLAUDE.md +2 -27
  34. package/src/_api/generated/cfg_centrifugo/_utils/fetchers/index.ts +0 -3
  35. package/src/_api/generated/cfg_centrifugo/_utils/hooks/index.ts +0 -3
  36. package/src/_api/generated/cfg_centrifugo/_utils/schemas/index.ts +0 -34
  37. package/src/_api/generated/cfg_centrifugo/client.ts +39 -51
  38. package/src/_api/generated/cfg_centrifugo/index.ts +0 -21
  39. package/src/_api/generated/cfg_centrifugo/schema.json +4 -2039
  40. package/src/_api/generated/cfg_totp/client.ts +39 -42
  41. package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +10 -10
  42. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +12 -12
  43. package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +8 -8
  44. package/src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_admin_api.ts +0 -344
  45. package/src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_monitoring.ts +0 -326
  46. package/src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_testing.ts +0 -211
  47. package/src/_api/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_admin_api.ts +0 -141
  48. package/src/_api/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_monitoring.ts +0 -99
  49. package/src/_api/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_testing.ts +0 -82
  50. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelInfo.schema.ts +0 -19
  51. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsRequestRequest.schema.ts +0 -19
  52. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResponse.schema.ts +0 -22
  53. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoChannelsResult.schema.ts +0 -20
  54. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoClientInfo.schema.ts +0 -22
  55. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoError.schema.ts +0 -20
  56. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoHealthCheck.schema.ts +0 -22
  57. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryRequestRequest.schema.ts +0 -23
  58. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResponse.schema.ts +0 -22
  59. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoHistoryResult.schema.ts +0 -22
  60. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResponse.schema.ts +0 -22
  61. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoInfoResult.schema.ts +0 -20
  62. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoMetrics.schema.ts +0 -20
  63. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoNodeInfo.schema.ts +0 -30
  64. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoOverviewStats.schema.ts +0 -26
  65. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceRequestRequest.schema.ts +0 -19
  66. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResponse.schema.ts +0 -22
  67. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceResult.schema.ts +0 -20
  68. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsRequestRequest.schema.ts +0 -19
  69. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResponse.schema.ts +0 -22
  70. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPresenceStatsResult.schema.ts +0 -20
  71. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoProcess.schema.ts +0 -20
  72. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoPublication.schema.ts +0 -23
  73. package/src/_api/generated/cfg_centrifugo/_utils/schemas/CentrifugoStreamPosition.schema.ts +0 -20
  74. package/src/_api/generated/cfg_centrifugo/_utils/schemas/ChannelList.schema.ts +0 -21
  75. package/src/_api/generated/cfg_centrifugo/_utils/schemas/ChannelStats.schema.ts +0 -25
  76. package/src/_api/generated/cfg_centrifugo/_utils/schemas/ManualAckRequestRequest.schema.ts +0 -20
  77. package/src/_api/generated/cfg_centrifugo/_utils/schemas/ManualAckResponse.schema.ts +0 -21
  78. package/src/_api/generated/cfg_centrifugo/_utils/schemas/PaginatedPublishList.schema.ts +0 -24
  79. package/src/_api/generated/cfg_centrifugo/_utils/schemas/Publish.schema.ts +0 -29
  80. package/src/_api/generated/cfg_centrifugo/_utils/schemas/PublishTestRequestRequest.schema.ts +0 -22
  81. package/src/_api/generated/cfg_centrifugo/_utils/schemas/PublishTestResponse.schema.ts +0 -24
  82. package/src/_api/generated/cfg_centrifugo/_utils/schemas/TimelineItem.schema.ts +0 -23
  83. package/src/_api/generated/cfg_centrifugo/_utils/schemas/TimelineResponse.schema.ts +0 -22
  84. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/client.ts +0 -76
  85. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/index.ts +0 -4
  86. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/models.ts +0 -268
  87. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/client.ts +0 -110
  88. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/index.ts +0 -4
  89. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/models.ts +0 -144
  90. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/client.ts +0 -48
  91. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/index.ts +0 -4
  92. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/models.ts +0 -64
package/dist/hooks.d.cts CHANGED
@@ -39,15 +39,13 @@ 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
51
  * Request to disconnect OAuth provider.
@@ -61,37 +59,15 @@ interface OAuthDisconnectRequestRequest$1 {
61
59
  provider: OAuthConnectionProvider;
62
60
  }
63
61
  /**
64
- * Response with available OAuth providers.
65
- *
66
- * Response model (includes read-only fields).
67
- */
68
- interface OAuthProvidersResponse {
69
- /** List of available OAuth providers */
70
- providers: Array<Record<string, any>>;
71
- }
72
- /**
73
- * Request to complete OAuth flow (callback handler).
62
+ * Request to start OAuth flow.
74
63
  *
75
64
  * Request model (no read-only fields).
76
65
  */
77
- interface OAuthCallbackRequestRequest$1 {
78
- /** Authorization code from OAuth provider callback */
79
- code: string;
80
- /** State token for CSRF verification (from authorize response) */
81
- state: string;
82
- /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
66
+ interface OAuthAuthorizeRequestRequest$1 {
67
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
83
68
  redirect_uri?: string;
84
- }
85
- /**
86
- * Response with OAuth authorization URL.
87
- *
88
- * Response model (includes read-only fields).
89
- */
90
- interface OAuthAuthorizeResponse$1 {
91
- /** Full URL to redirect user to OAuth provider */
92
- authorization_url: string;
93
- /** State token for CSRF protection. Store this and verify on callback. */
94
- state: string;
69
+ /** Optional source URL for registration tracking */
70
+ source_url?: string;
95
71
  }
96
72
  /**
97
73
  * Response with JWT tokens after OAuth authentication. When 2FA is required: -
@@ -119,6 +95,30 @@ interface OAuthTokenResponse$1 {
119
95
  /** True if user should be prompted to enable 2FA */
120
96
  should_prompt_2fa?: boolean;
121
97
  }
98
+ /**
99
+ * Response with OAuth authorization URL.
100
+ *
101
+ * Response model (includes read-only fields).
102
+ */
103
+ interface OAuthAuthorizeResponse$1 {
104
+ /** Full URL to redirect user to OAuth provider */
105
+ authorization_url: string;
106
+ /** State token for CSRF protection. Store this and verify on callback. */
107
+ state: string;
108
+ }
109
+ /**
110
+ * Request to complete OAuth flow (callback handler).
111
+ *
112
+ * Request model (no read-only fields).
113
+ */
114
+ interface OAuthCallbackRequestRequest$1 {
115
+ /** Authorization code from OAuth provider callback */
116
+ code: string;
117
+ /** State token for CSRF verification (from authorize response) */
118
+ state: string;
119
+ /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
120
+ redirect_uri?: string;
121
+ }
122
122
 
123
123
  /**
124
124
  * API endpoints for Oauth.
@@ -165,7 +165,7 @@ declare class Oauth {
165
165
  *
166
166
  * Request model (no read-only fields).
167
167
  */
168
- interface UserProfileUpdateRequest$1 {
168
+ interface PatchedUserProfileUpdateRequest$1 {
169
169
  first_name?: string;
170
170
  last_name?: string;
171
171
  company?: string;
@@ -173,14 +173,6 @@ interface UserProfileUpdateRequest$1 {
173
173
  position?: string;
174
174
  language?: string;
175
175
  }
176
- /**
177
- *
178
- * Request model (no read-only fields).
179
- */
180
- interface CfgAccountsProfileAvatarCreateRequest$1 {
181
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
182
- avatar: File | Blob;
183
- }
184
176
  /**
185
177
  * Serializer for user details.
186
178
  *
@@ -211,12 +203,23 @@ interface User$2 {
211
203
  unanswered_messages_count: number;
212
204
  centrifugo: CentrifugoToken$1 | null;
213
205
  }
206
+ /**
207
+ * Response serializer for account deletion.
208
+ *
209
+ * Response model (includes read-only fields).
210
+ */
211
+ interface AccountDeleteResponse$1 {
212
+ /** Whether the account was successfully deleted */
213
+ success: boolean;
214
+ /** Human-readable message about the deletion */
215
+ message: string;
216
+ }
214
217
  /**
215
218
  * Serializer for updating user profile.
216
219
  *
217
220
  * Request model (no read-only fields).
218
221
  */
219
- interface PatchedUserProfileUpdateRequest$1 {
222
+ interface UserProfileUpdateRequest$1 {
220
223
  first_name?: string;
221
224
  last_name?: string;
222
225
  company?: string;
@@ -225,15 +228,12 @@ interface PatchedUserProfileUpdateRequest$1 {
225
228
  language?: string;
226
229
  }
227
230
  /**
228
- * Response serializer for account deletion.
229
231
  *
230
- * Response model (includes read-only fields).
232
+ * Request model (no read-only fields).
231
233
  */
232
- interface AccountDeleteResponse$1 {
233
- /** Whether the account was successfully deleted */
234
- success: boolean;
235
- /** Human-readable message about the deletion */
236
- message: string;
234
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
235
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
236
+ avatar: File | Blob;
237
237
  }
238
238
  /**
239
239
  * Nested serializer for Centrifugo WebSocket connection token.
@@ -308,27 +308,6 @@ declare class UserProfile {
308
308
  accountsProfileUpdatePartialUpdate(data?: PatchedUserProfileUpdateRequest$1): Promise<User$2>;
309
309
  }
310
310
 
311
- /**
312
- * OTP verification response. When 2FA is required: - requires_2fa: True -
313
- * session_id: UUID of 2FA verification session - refresh/access/user: null
314
- * When 2FA is not required: - requires_2fa: False - session_id: null -
315
- * refresh/access/user: populated
316
- *
317
- * Response model (includes read-only fields).
318
- */
319
- interface OTPVerifyResponse$1 {
320
- /** Whether 2FA verification is required */
321
- requires_2fa?: boolean;
322
- /** 2FA session ID (if requires_2fa is True) */
323
- session_id?: string | null;
324
- /** JWT refresh token (if requires_2fa is False) */
325
- refresh?: string | null;
326
- /** JWT access token (if requires_2fa is False) */
327
- access?: string | null;
328
- user?: User$1 | null;
329
- /** Whether user should be prompted to enable 2FA */
330
- should_prompt_2fa?: boolean;
331
- }
332
311
  /**
333
312
  * Serializer for OTP verification.
334
313
  *
@@ -341,6 +320,15 @@ interface OTPVerifyRequest$1 {
341
320
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
342
321
  source_url?: string;
343
322
  }
323
+ /**
324
+ * OTP request response.
325
+ *
326
+ * Response model (includes read-only fields).
327
+ */
328
+ interface OTPRequestResponse$1 {
329
+ /** Success message */
330
+ message: string;
331
+ }
344
332
  /**
345
333
  * Serializer for OTP request.
346
334
  *
@@ -353,13 +341,25 @@ interface OTPRequestRequest$1 {
353
341
  source_url?: string;
354
342
  }
355
343
  /**
356
- * OTP request response.
344
+ * OTP verification response. When 2FA is required: - requires_2fa: True -
345
+ * session_id: UUID of 2FA verification session - refresh/access/user: null
346
+ * When 2FA is not required: - requires_2fa: False - session_id: null -
347
+ * refresh/access/user: populated
357
348
  *
358
349
  * Response model (includes read-only fields).
359
350
  */
360
- interface OTPRequestResponse$1 {
361
- /** Success message */
362
- message: string;
351
+ interface OTPVerifyResponse$1 {
352
+ /** Whether 2FA verification is required */
353
+ requires_2fa?: boolean;
354
+ /** 2FA session ID (if requires_2fa is True) */
355
+ session_id?: string | null;
356
+ /** JWT refresh token (if requires_2fa is False) */
357
+ refresh?: string | null;
358
+ /** JWT access token (if requires_2fa is False) */
359
+ access?: string | null;
360
+ user?: User$1 | null;
361
+ /** Whether user should be prompted to enable 2FA */
362
+ should_prompt_2fa?: boolean;
363
363
  }
364
364
  /**
365
365
  * Serializer for user details.
package/dist/hooks.d.ts CHANGED
@@ -39,15 +39,13 @@ 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
51
  * Request to disconnect OAuth provider.
@@ -61,37 +59,15 @@ interface OAuthDisconnectRequestRequest$1 {
61
59
  provider: OAuthConnectionProvider;
62
60
  }
63
61
  /**
64
- * Response with available OAuth providers.
65
- *
66
- * Response model (includes read-only fields).
67
- */
68
- interface OAuthProvidersResponse {
69
- /** List of available OAuth providers */
70
- providers: Array<Record<string, any>>;
71
- }
72
- /**
73
- * Request to complete OAuth flow (callback handler).
62
+ * Request to start OAuth flow.
74
63
  *
75
64
  * Request model (no read-only fields).
76
65
  */
77
- interface OAuthCallbackRequestRequest$1 {
78
- /** Authorization code from OAuth provider callback */
79
- code: string;
80
- /** State token for CSRF verification (from authorize response) */
81
- state: string;
82
- /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
66
+ interface OAuthAuthorizeRequestRequest$1 {
67
+ /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
83
68
  redirect_uri?: string;
84
- }
85
- /**
86
- * Response with OAuth authorization URL.
87
- *
88
- * Response model (includes read-only fields).
89
- */
90
- interface OAuthAuthorizeResponse$1 {
91
- /** Full URL to redirect user to OAuth provider */
92
- authorization_url: string;
93
- /** State token for CSRF protection. Store this and verify on callback. */
94
- state: string;
69
+ /** Optional source URL for registration tracking */
70
+ source_url?: string;
95
71
  }
96
72
  /**
97
73
  * Response with JWT tokens after OAuth authentication. When 2FA is required: -
@@ -119,6 +95,30 @@ interface OAuthTokenResponse$1 {
119
95
  /** True if user should be prompted to enable 2FA */
120
96
  should_prompt_2fa?: boolean;
121
97
  }
98
+ /**
99
+ * Response with OAuth authorization URL.
100
+ *
101
+ * Response model (includes read-only fields).
102
+ */
103
+ interface OAuthAuthorizeResponse$1 {
104
+ /** Full URL to redirect user to OAuth provider */
105
+ authorization_url: string;
106
+ /** State token for CSRF protection. Store this and verify on callback. */
107
+ state: string;
108
+ }
109
+ /**
110
+ * Request to complete OAuth flow (callback handler).
111
+ *
112
+ * Request model (no read-only fields).
113
+ */
114
+ interface OAuthCallbackRequestRequest$1 {
115
+ /** Authorization code from OAuth provider callback */
116
+ code: string;
117
+ /** State token for CSRF verification (from authorize response) */
118
+ state: string;
119
+ /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
120
+ redirect_uri?: string;
121
+ }
122
122
 
123
123
  /**
124
124
  * API endpoints for Oauth.
@@ -165,7 +165,7 @@ declare class Oauth {
165
165
  *
166
166
  * Request model (no read-only fields).
167
167
  */
168
- interface UserProfileUpdateRequest$1 {
168
+ interface PatchedUserProfileUpdateRequest$1 {
169
169
  first_name?: string;
170
170
  last_name?: string;
171
171
  company?: string;
@@ -173,14 +173,6 @@ interface UserProfileUpdateRequest$1 {
173
173
  position?: string;
174
174
  language?: string;
175
175
  }
176
- /**
177
- *
178
- * Request model (no read-only fields).
179
- */
180
- interface CfgAccountsProfileAvatarCreateRequest$1 {
181
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
182
- avatar: File | Blob;
183
- }
184
176
  /**
185
177
  * Serializer for user details.
186
178
  *
@@ -211,12 +203,23 @@ interface User$2 {
211
203
  unanswered_messages_count: number;
212
204
  centrifugo: CentrifugoToken$1 | null;
213
205
  }
206
+ /**
207
+ * Response serializer for account deletion.
208
+ *
209
+ * Response model (includes read-only fields).
210
+ */
211
+ interface AccountDeleteResponse$1 {
212
+ /** Whether the account was successfully deleted */
213
+ success: boolean;
214
+ /** Human-readable message about the deletion */
215
+ message: string;
216
+ }
214
217
  /**
215
218
  * Serializer for updating user profile.
216
219
  *
217
220
  * Request model (no read-only fields).
218
221
  */
219
- interface PatchedUserProfileUpdateRequest$1 {
222
+ interface UserProfileUpdateRequest$1 {
220
223
  first_name?: string;
221
224
  last_name?: string;
222
225
  company?: string;
@@ -225,15 +228,12 @@ interface PatchedUserProfileUpdateRequest$1 {
225
228
  language?: string;
226
229
  }
227
230
  /**
228
- * Response serializer for account deletion.
229
231
  *
230
- * Response model (includes read-only fields).
232
+ * Request model (no read-only fields).
231
233
  */
232
- interface AccountDeleteResponse$1 {
233
- /** Whether the account was successfully deleted */
234
- success: boolean;
235
- /** Human-readable message about the deletion */
236
- message: string;
234
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
235
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
236
+ avatar: File | Blob;
237
237
  }
238
238
  /**
239
239
  * Nested serializer for Centrifugo WebSocket connection token.
@@ -308,27 +308,6 @@ declare class UserProfile {
308
308
  accountsProfileUpdatePartialUpdate(data?: PatchedUserProfileUpdateRequest$1): Promise<User$2>;
309
309
  }
310
310
 
311
- /**
312
- * OTP verification response. When 2FA is required: - requires_2fa: True -
313
- * session_id: UUID of 2FA verification session - refresh/access/user: null
314
- * When 2FA is not required: - requires_2fa: False - session_id: null -
315
- * refresh/access/user: populated
316
- *
317
- * Response model (includes read-only fields).
318
- */
319
- interface OTPVerifyResponse$1 {
320
- /** Whether 2FA verification is required */
321
- requires_2fa?: boolean;
322
- /** 2FA session ID (if requires_2fa is True) */
323
- session_id?: string | null;
324
- /** JWT refresh token (if requires_2fa is False) */
325
- refresh?: string | null;
326
- /** JWT access token (if requires_2fa is False) */
327
- access?: string | null;
328
- user?: User$1 | null;
329
- /** Whether user should be prompted to enable 2FA */
330
- should_prompt_2fa?: boolean;
331
- }
332
311
  /**
333
312
  * Serializer for OTP verification.
334
313
  *
@@ -341,6 +320,15 @@ interface OTPVerifyRequest$1 {
341
320
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
342
321
  source_url?: string;
343
322
  }
323
+ /**
324
+ * OTP request response.
325
+ *
326
+ * Response model (includes read-only fields).
327
+ */
328
+ interface OTPRequestResponse$1 {
329
+ /** Success message */
330
+ message: string;
331
+ }
344
332
  /**
345
333
  * Serializer for OTP request.
346
334
  *
@@ -353,13 +341,25 @@ interface OTPRequestRequest$1 {
353
341
  source_url?: string;
354
342
  }
355
343
  /**
356
- * OTP request response.
344
+ * OTP verification response. When 2FA is required: - requires_2fa: True -
345
+ * session_id: UUID of 2FA verification session - refresh/access/user: null
346
+ * When 2FA is not required: - requires_2fa: False - session_id: null -
347
+ * refresh/access/user: populated
357
348
  *
358
349
  * Response model (includes read-only fields).
359
350
  */
360
- interface OTPRequestResponse$1 {
361
- /** Success message */
362
- message: string;
351
+ interface OTPVerifyResponse$1 {
352
+ /** Whether 2FA verification is required */
353
+ requires_2fa?: boolean;
354
+ /** 2FA session ID (if requires_2fa is True) */
355
+ session_id?: string | null;
356
+ /** JWT refresh token (if requires_2fa is False) */
357
+ refresh?: string | null;
358
+ /** JWT access token (if requires_2fa is False) */
359
+ access?: string | null;
360
+ user?: User$1 | null;
361
+ /** Whether user should be prompted to enable 2FA */
362
+ should_prompt_2fa?: boolean;
363
363
  }
364
364
  /**
365
365
  * Serializer for user details.
package/dist/hooks.mjs CHANGED
@@ -713,43 +713,47 @@ var APIClient = class {
713
713
  if (error instanceof APIError) {
714
714
  throw error;
715
715
  }
716
- const isCORSError = error instanceof TypeError && (error.message.toLowerCase().includes("cors") || error.message.toLowerCase().includes("failed to fetch") || error.message.toLowerCase().includes("network request failed"));
716
+ let possiblyCors = false;
717
+ if (error instanceof TypeError && typeof window !== "undefined") {
718
+ try {
719
+ const isCrossOrigin = (() => {
720
+ try {
721
+ return new URL(url).origin !== window.location.origin;
722
+ } catch {
723
+ return false;
724
+ }
725
+ })();
726
+ if (isCrossOrigin) {
727
+ const entries = performance.getEntriesByName(url, "resource");
728
+ if (entries.length > 0) {
729
+ const last = entries[entries.length - 1];
730
+ possiblyCors = "responseStatus" in last && last.responseStatus === 0;
731
+ }
732
+ }
733
+ } catch {
734
+ }
735
+ }
717
736
  if (this.logger) {
718
- if (isCORSError) {
719
- this.logger.error(`\u{1F6AB} CORS Error: ${method} ${url}`);
720
- this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
721
- this.logger.error(` \u2192 Configure security_domains parameter on the server`);
722
- } else {
723
- this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
724
- this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
737
+ this.logger.error(`\u26A0\uFE0F Network Error: ${method} ${url}`);
738
+ this.logger.error(` \u2192 ${error instanceof Error ? error.message : String(error)}`);
739
+ if (possiblyCors) {
740
+ this.logger.error(` \u2192 Possibly blocked by CORS policy (configure CORS on the server)`);
725
741
  }
726
742
  }
727
743
  if (typeof window !== "undefined") {
728
744
  try {
729
- if (isCORSError) {
730
- window.dispatchEvent(new CustomEvent("cors-error", {
731
- detail: {
732
- url,
733
- method,
734
- error: error instanceof Error ? error.message : String(error),
735
- timestamp: /* @__PURE__ */ new Date()
736
- },
737
- bubbles: true,
738
- cancelable: false
739
- }));
740
- } else {
741
- window.dispatchEvent(new CustomEvent("network-error", {
742
- detail: {
743
- url,
744
- method,
745
- error: error instanceof Error ? error.message : String(error),
746
- timestamp: /* @__PURE__ */ new Date()
747
- },
748
- bubbles: true,
749
- cancelable: false
750
- }));
751
- }
752
- } catch (eventError) {
745
+ window.dispatchEvent(new CustomEvent("network-error", {
746
+ detail: {
747
+ url,
748
+ method,
749
+ error: error instanceof Error ? error.message : String(error),
750
+ possibly_cors: possiblyCors,
751
+ timestamp: /* @__PURE__ */ new Date()
752
+ },
753
+ bubbles: true,
754
+ cancelable: false
755
+ }));
756
+ } catch {
753
757
  }
754
758
  }
755
759
  const networkError = error instanceof Error ? new NetworkError(error.message, url, error) : new NetworkError("Unknown error", url);