@djangocfg/api 2.1.226 → 2.1.228

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 (56) hide show
  1. package/README.md +8 -9
  2. package/dist/auth-server.cjs +4 -9
  3. package/dist/auth-server.cjs.map +1 -1
  4. package/dist/auth-server.mjs +4 -9
  5. package/dist/auth-server.mjs.map +1 -1
  6. package/dist/auth.cjs +120 -158
  7. package/dist/auth.cjs.map +1 -1
  8. package/dist/auth.d.cts +120 -177
  9. package/dist/auth.d.ts +120 -177
  10. package/dist/auth.mjs +149 -191
  11. package/dist/auth.mjs.map +1 -1
  12. package/dist/clients.cjs +5 -11
  13. package/dist/clients.cjs.map +1 -1
  14. package/dist/clients.d.cts +218 -219
  15. package/dist/clients.d.ts +218 -219
  16. package/dist/clients.mjs +5 -11
  17. package/dist/clients.mjs.map +1 -1
  18. package/dist/hooks.cjs +4 -9
  19. package/dist/hooks.cjs.map +1 -1
  20. package/dist/hooks.d.cts +70 -91
  21. package/dist/hooks.d.ts +70 -91
  22. package/dist/hooks.mjs +4 -9
  23. package/dist/hooks.mjs.map +1 -1
  24. package/dist/index.cjs +5 -11
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +116 -106
  27. package/dist/index.d.ts +116 -106
  28. package/dist/index.mjs +5 -11
  29. package/dist/index.mjs.map +1 -1
  30. package/package.json +2 -2
  31. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts +24 -2
  32. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts +0 -2
  33. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts +0 -2
  34. package/src/_api/generated/cfg_accounts/accounts/client.ts +1 -1
  35. package/src/_api/generated/cfg_accounts/accounts/models.ts +25 -26
  36. package/src/_api/generated/cfg_accounts/accounts__auth/models.ts +5 -5
  37. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +42 -42
  38. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +23 -23
  39. package/src/_api/generated/cfg_accounts/enums.ts +0 -10
  40. package/src/_api/generated/cfg_accounts/schema.json +31 -25
  41. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_admin_api/models.ts +57 -57
  42. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_monitoring/models.ts +24 -24
  43. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_testing/models.ts +14 -14
  44. package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +14 -14
  45. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +10 -10
  46. package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +8 -8
  47. package/src/auth/context/AccountsContext.tsx +6 -2
  48. package/src/auth/context/AuthContext.tsx +32 -39
  49. package/src/auth/context/types.ts +5 -9
  50. package/src/auth/hooks/index.ts +1 -1
  51. package/src/auth/hooks/useAuthForm.ts +42 -75
  52. package/src/auth/hooks/useAuthFormState.ts +35 -6
  53. package/src/auth/hooks/useAuthValidation.ts +5 -65
  54. package/src/auth/hooks/useTwoFactor.ts +17 -2
  55. package/src/auth/types/form.ts +25 -70
  56. package/src/auth/types/index.ts +2 -6
package/dist/hooks.d.cts CHANGED
@@ -4,17 +4,17 @@ import useSWR from 'swr';
4
4
 
5
5
  /**
6
6
  *
7
- * Response model (includes read-only fields).
7
+ * Request model (no read-only fields).
8
8
  */
9
- interface TokenRefresh$1 {
10
- access: string;
9
+ interface TokenRefreshRequest$1 {
11
10
  refresh: string;
12
11
  }
13
12
  /**
14
13
  *
15
- * Request model (no read-only fields).
14
+ * Response model (includes read-only fields).
16
15
  */
17
- interface TokenRefreshRequest$1 {
16
+ interface TokenRefresh$1 {
17
+ access: string;
18
18
  refresh: string;
19
19
  }
20
20
 
@@ -37,16 +37,16 @@ declare class Auth {
37
37
  declare enum OAuthConnectionProvider {
38
38
  GITHUB = "github"
39
39
  }
40
+
40
41
  /**
41
- * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
42
- * * `email` - Email
43
- * * `phone` - Phone
42
+ * Response with available OAuth providers.
43
+ *
44
+ * Response model (includes read-only fields).
44
45
  */
45
- declare enum OTPRequestRequestChannel {
46
- EMAIL = "email",
47
- PHONE = "phone"
46
+ interface OAuthProvidersResponse {
47
+ /** List of available OAuth providers */
48
+ providers: Array<Record<string, any>>;
48
49
  }
49
-
50
50
  /**
51
51
  * Request to disconnect OAuth provider.
52
52
  *
@@ -58,17 +58,6 @@ interface OAuthDisconnectRequestRequest$1 {
58
58
  * `github` - GitHub */
59
59
  provider: OAuthConnectionProvider;
60
60
  }
61
- /**
62
- * Response with OAuth authorization URL.
63
- *
64
- * Response model (includes read-only fields).
65
- */
66
- interface OAuthAuthorizeResponse$1 {
67
- /** Full URL to redirect user to OAuth provider */
68
- authorization_url: string;
69
- /** State token for CSRF protection. Store this and verify on callback. */
70
- state: string;
71
- }
72
61
  /**
73
62
  * Request to start OAuth flow.
74
63
  *
@@ -80,6 +69,30 @@ interface OAuthAuthorizeRequestRequest$1 {
80
69
  /** Optional source URL for registration tracking */
81
70
  source_url?: string;
82
71
  }
72
+ /**
73
+ * Request to complete OAuth flow (callback handler).
74
+ *
75
+ * Request model (no read-only fields).
76
+ */
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 */
83
+ 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;
95
+ }
83
96
  /**
84
97
  * Response with JWT tokens after OAuth authentication. When 2FA is required: -
85
98
  * requires_2fa: True - session_id: UUID of 2FA verification session -
@@ -106,28 +119,6 @@ interface OAuthTokenResponse$1 {
106
119
  /** True if user should be prompted to enable 2FA */
107
120
  should_prompt_2fa?: boolean;
108
121
  }
109
- /**
110
- * Response with available OAuth providers.
111
- *
112
- * Response model (includes read-only fields).
113
- */
114
- interface OAuthProvidersResponse {
115
- /** List of available OAuth providers */
116
- providers: Array<Record<string, any>>;
117
- }
118
- /**
119
- * Request to complete OAuth flow (callback handler).
120
- *
121
- * Request model (no read-only fields).
122
- */
123
- interface OAuthCallbackRequestRequest$1 {
124
- /** Authorization code from OAuth provider callback */
125
- code: string;
126
- /** State token for CSRF verification (from authorize response) */
127
- state: string;
128
- /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
129
- redirect_uri?: string;
130
- }
131
122
 
132
123
  /**
133
124
  * API endpoints for Oauth.
@@ -169,6 +160,17 @@ declare class Oauth {
169
160
  accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse>;
170
161
  }
171
162
 
163
+ /**
164
+ * Response serializer for account deletion.
165
+ *
166
+ * Response model (includes read-only fields).
167
+ */
168
+ interface AccountDeleteResponse$1 {
169
+ /** Whether the account was successfully deleted */
170
+ success: boolean;
171
+ /** Human-readable message about the deletion */
172
+ message: string;
173
+ }
172
174
  /**
173
175
  * Serializer for updating user profile.
174
176
  *
@@ -183,12 +185,17 @@ interface UserProfileUpdateRequest$1 {
183
185
  language?: string;
184
186
  }
185
187
  /**
188
+ * Serializer for updating user profile.
186
189
  *
187
190
  * Request model (no read-only fields).
188
191
  */
189
- interface CfgAccountsProfileAvatarCreateRequest$1 {
190
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
191
- avatar: File | Blob;
192
+ interface PatchedUserProfileUpdateRequest$1 {
193
+ first_name?: string;
194
+ last_name?: string;
195
+ company?: string;
196
+ phone?: string;
197
+ position?: string;
198
+ language?: string;
192
199
  }
193
200
  /**
194
201
  * Serializer for user details.
@@ -221,28 +228,12 @@ interface User$2 {
221
228
  centrifugo: CentrifugoToken$1 | null;
222
229
  }
223
230
  /**
224
- * Serializer for updating user profile.
225
231
  *
226
232
  * Request model (no read-only fields).
227
233
  */
228
- interface PatchedUserProfileUpdateRequest$1 {
229
- first_name?: string;
230
- last_name?: string;
231
- company?: string;
232
- phone?: string;
233
- position?: string;
234
- language?: string;
235
- }
236
- /**
237
- * Response serializer for account deletion.
238
- *
239
- * Response model (includes read-only fields).
240
- */
241
- interface AccountDeleteResponse$1 {
242
- /** Whether the account was successfully deleted */
243
- success: boolean;
244
- /** Human-readable message about the deletion */
245
- message: string;
234
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
235
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
236
+ avatar: File | Blob;
246
237
  }
247
238
  /**
248
239
  * Nested serializer for Centrifugo WebSocket connection token.
@@ -323,16 +314,20 @@ declare class UserProfile {
323
314
  * Request model (no read-only fields).
324
315
  */
325
316
  interface OTPRequestRequest$1 {
326
- /** Email address or phone number for OTP delivery */
317
+ /** Email address for OTP delivery */
327
318
  identifier: string;
328
- /** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
329
-
330
- * `email` - Email
331
- * `phone` - Phone */
332
- channel?: OTPRequestRequestChannel;
333
319
  /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
334
320
  source_url?: string;
335
321
  }
322
+ /**
323
+ * OTP request response.
324
+ *
325
+ * Response model (includes read-only fields).
326
+ */
327
+ interface OTPRequestResponse$1 {
328
+ /** Success message */
329
+ message: string;
330
+ }
336
331
  /**
337
332
  * OTP verification response. When 2FA is required: - requires_2fa: True -
338
333
  * session_id: UUID of 2FA verification session - refresh/access/user: null
@@ -354,29 +349,15 @@ interface OTPVerifyResponse$1 {
354
349
  /** Whether user should be prompted to enable 2FA */
355
350
  should_prompt_2fa?: boolean;
356
351
  }
357
- /**
358
- * OTP request response.
359
- *
360
- * Response model (includes read-only fields).
361
- */
362
- interface OTPRequestResponse$1 {
363
- /** Success message */
364
- message: string;
365
- }
366
352
  /**
367
353
  * Serializer for OTP verification.
368
354
  *
369
355
  * Request model (no read-only fields).
370
356
  */
371
357
  interface OTPVerifyRequest$1 {
372
- /** Email address or phone number used for OTP request */
358
+ /** Email address used for OTP request */
373
359
  identifier: string;
374
360
  otp: string;
375
- /** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
376
-
377
- * `email` - Email
378
- * `phone` - Phone */
379
- channel?: OTPRequestRequestChannel;
380
361
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
381
362
  source_url?: string;
382
363
  }
@@ -433,7 +414,7 @@ declare class Accounts {
433
414
  private client;
434
415
  constructor(client: any);
435
416
  /**
436
- * Request OTP code to email or phone.
417
+ * Request OTP code to email.
437
418
  */
438
419
  otpRequestCreate(data: OTPRequestRequest$1): Promise<OTPRequestResponse$1>;
439
420
  /**
@@ -712,7 +693,6 @@ type OAuthTokenResponse = z.infer<typeof OAuthTokenResponseSchema>;
712
693
  */
713
694
  declare const OTPRequestRequestSchema: z.ZodObject<{
714
695
  identifier: z.ZodString;
715
- channel: z.ZodOptional<z.ZodEnum<typeof OTPRequestRequestChannel>>;
716
696
  source_url: z.ZodOptional<z.ZodString>;
717
697
  }, z.core.$strip>;
718
698
  /**
@@ -751,7 +731,6 @@ type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>;
751
731
  declare const OTPVerifyRequestSchema: z.ZodObject<{
752
732
  identifier: z.ZodString;
753
733
  otp: z.ZodString;
754
- channel: z.ZodOptional<z.ZodEnum<typeof OTPRequestRequestChannel>>;
755
734
  source_url: z.ZodOptional<z.ZodString>;
756
735
  }, z.core.$strip>;
757
736
  /**
package/dist/hooks.d.ts CHANGED
@@ -4,17 +4,17 @@ import useSWR from 'swr';
4
4
 
5
5
  /**
6
6
  *
7
- * Response model (includes read-only fields).
7
+ * Request model (no read-only fields).
8
8
  */
9
- interface TokenRefresh$1 {
10
- access: string;
9
+ interface TokenRefreshRequest$1 {
11
10
  refresh: string;
12
11
  }
13
12
  /**
14
13
  *
15
- * Request model (no read-only fields).
14
+ * Response model (includes read-only fields).
16
15
  */
17
- interface TokenRefreshRequest$1 {
16
+ interface TokenRefresh$1 {
17
+ access: string;
18
18
  refresh: string;
19
19
  }
20
20
 
@@ -37,16 +37,16 @@ declare class Auth {
37
37
  declare enum OAuthConnectionProvider {
38
38
  GITHUB = "github"
39
39
  }
40
+
40
41
  /**
41
- * Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
42
- * * `email` - Email
43
- * * `phone` - Phone
42
+ * Response with available OAuth providers.
43
+ *
44
+ * Response model (includes read-only fields).
44
45
  */
45
- declare enum OTPRequestRequestChannel {
46
- EMAIL = "email",
47
- PHONE = "phone"
46
+ interface OAuthProvidersResponse {
47
+ /** List of available OAuth providers */
48
+ providers: Array<Record<string, any>>;
48
49
  }
49
-
50
50
  /**
51
51
  * Request to disconnect OAuth provider.
52
52
  *
@@ -58,17 +58,6 @@ interface OAuthDisconnectRequestRequest$1 {
58
58
  * `github` - GitHub */
59
59
  provider: OAuthConnectionProvider;
60
60
  }
61
- /**
62
- * Response with OAuth authorization URL.
63
- *
64
- * Response model (includes read-only fields).
65
- */
66
- interface OAuthAuthorizeResponse$1 {
67
- /** Full URL to redirect user to OAuth provider */
68
- authorization_url: string;
69
- /** State token for CSRF protection. Store this and verify on callback. */
70
- state: string;
71
- }
72
61
  /**
73
62
  * Request to start OAuth flow.
74
63
  *
@@ -80,6 +69,30 @@ interface OAuthAuthorizeRequestRequest$1 {
80
69
  /** Optional source URL for registration tracking */
81
70
  source_url?: string;
82
71
  }
72
+ /**
73
+ * Request to complete OAuth flow (callback handler).
74
+ *
75
+ * Request model (no read-only fields).
76
+ */
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 */
83
+ 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;
95
+ }
83
96
  /**
84
97
  * Response with JWT tokens after OAuth authentication. When 2FA is required: -
85
98
  * requires_2fa: True - session_id: UUID of 2FA verification session -
@@ -106,28 +119,6 @@ interface OAuthTokenResponse$1 {
106
119
  /** True if user should be prompted to enable 2FA */
107
120
  should_prompt_2fa?: boolean;
108
121
  }
109
- /**
110
- * Response with available OAuth providers.
111
- *
112
- * Response model (includes read-only fields).
113
- */
114
- interface OAuthProvidersResponse {
115
- /** List of available OAuth providers */
116
- providers: Array<Record<string, any>>;
117
- }
118
- /**
119
- * Request to complete OAuth flow (callback handler).
120
- *
121
- * Request model (no read-only fields).
122
- */
123
- interface OAuthCallbackRequestRequest$1 {
124
- /** Authorization code from OAuth provider callback */
125
- code: string;
126
- /** State token for CSRF verification (from authorize response) */
127
- state: string;
128
- /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
129
- redirect_uri?: string;
130
- }
131
122
 
132
123
  /**
133
124
  * API endpoints for Oauth.
@@ -169,6 +160,17 @@ declare class Oauth {
169
160
  accountsOauthProvidersRetrieve(): Promise<OAuthProvidersResponse>;
170
161
  }
171
162
 
163
+ /**
164
+ * Response serializer for account deletion.
165
+ *
166
+ * Response model (includes read-only fields).
167
+ */
168
+ interface AccountDeleteResponse$1 {
169
+ /** Whether the account was successfully deleted */
170
+ success: boolean;
171
+ /** Human-readable message about the deletion */
172
+ message: string;
173
+ }
172
174
  /**
173
175
  * Serializer for updating user profile.
174
176
  *
@@ -183,12 +185,17 @@ interface UserProfileUpdateRequest$1 {
183
185
  language?: string;
184
186
  }
185
187
  /**
188
+ * Serializer for updating user profile.
186
189
  *
187
190
  * Request model (no read-only fields).
188
191
  */
189
- interface CfgAccountsProfileAvatarCreateRequest$1 {
190
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
191
- avatar: File | Blob;
192
+ interface PatchedUserProfileUpdateRequest$1 {
193
+ first_name?: string;
194
+ last_name?: string;
195
+ company?: string;
196
+ phone?: string;
197
+ position?: string;
198
+ language?: string;
192
199
  }
193
200
  /**
194
201
  * Serializer for user details.
@@ -221,28 +228,12 @@ interface User$2 {
221
228
  centrifugo: CentrifugoToken$1 | null;
222
229
  }
223
230
  /**
224
- * Serializer for updating user profile.
225
231
  *
226
232
  * Request model (no read-only fields).
227
233
  */
228
- interface PatchedUserProfileUpdateRequest$1 {
229
- first_name?: string;
230
- last_name?: string;
231
- company?: string;
232
- phone?: string;
233
- position?: string;
234
- language?: string;
235
- }
236
- /**
237
- * Response serializer for account deletion.
238
- *
239
- * Response model (includes read-only fields).
240
- */
241
- interface AccountDeleteResponse$1 {
242
- /** Whether the account was successfully deleted */
243
- success: boolean;
244
- /** Human-readable message about the deletion */
245
- message: string;
234
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
235
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
236
+ avatar: File | Blob;
246
237
  }
247
238
  /**
248
239
  * Nested serializer for Centrifugo WebSocket connection token.
@@ -323,16 +314,20 @@ declare class UserProfile {
323
314
  * Request model (no read-only fields).
324
315
  */
325
316
  interface OTPRequestRequest$1 {
326
- /** Email address or phone number for OTP delivery */
317
+ /** Email address for OTP delivery */
327
318
  identifier: string;
328
- /** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
329
-
330
- * `email` - Email
331
- * `phone` - Phone */
332
- channel?: OTPRequestRequestChannel;
333
319
  /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
334
320
  source_url?: string;
335
321
  }
322
+ /**
323
+ * OTP request response.
324
+ *
325
+ * Response model (includes read-only fields).
326
+ */
327
+ interface OTPRequestResponse$1 {
328
+ /** Success message */
329
+ message: string;
330
+ }
336
331
  /**
337
332
  * OTP verification response. When 2FA is required: - requires_2fa: True -
338
333
  * session_id: UUID of 2FA verification session - refresh/access/user: null
@@ -354,29 +349,15 @@ interface OTPVerifyResponse$1 {
354
349
  /** Whether user should be prompted to enable 2FA */
355
350
  should_prompt_2fa?: boolean;
356
351
  }
357
- /**
358
- * OTP request response.
359
- *
360
- * Response model (includes read-only fields).
361
- */
362
- interface OTPRequestResponse$1 {
363
- /** Success message */
364
- message: string;
365
- }
366
352
  /**
367
353
  * Serializer for OTP verification.
368
354
  *
369
355
  * Request model (no read-only fields).
370
356
  */
371
357
  interface OTPVerifyRequest$1 {
372
- /** Email address or phone number used for OTP request */
358
+ /** Email address used for OTP request */
373
359
  identifier: string;
374
360
  otp: string;
375
- /** Delivery channel: 'email' or 'phone'. Auto-detected if not provided.
376
-
377
- * `email` - Email
378
- * `phone` - Phone */
379
- channel?: OTPRequestRequestChannel;
380
361
  /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
381
362
  source_url?: string;
382
363
  }
@@ -433,7 +414,7 @@ declare class Accounts {
433
414
  private client;
434
415
  constructor(client: any);
435
416
  /**
436
- * Request OTP code to email or phone.
417
+ * Request OTP code to email.
437
418
  */
438
419
  otpRequestCreate(data: OTPRequestRequest$1): Promise<OTPRequestResponse$1>;
439
420
  /**
@@ -712,7 +693,6 @@ type OAuthTokenResponse = z.infer<typeof OAuthTokenResponseSchema>;
712
693
  */
713
694
  declare const OTPRequestRequestSchema: z.ZodObject<{
714
695
  identifier: z.ZodString;
715
- channel: z.ZodOptional<z.ZodEnum<typeof OTPRequestRequestChannel>>;
716
696
  source_url: z.ZodOptional<z.ZodString>;
717
697
  }, z.core.$strip>;
718
698
  /**
@@ -751,7 +731,6 @@ type OTPRequestResponse = z.infer<typeof OTPRequestResponseSchema>;
751
731
  declare const OTPVerifyRequestSchema: z.ZodObject<{
752
732
  identifier: z.ZodString;
753
733
  otp: z.ZodString;
754
- channel: z.ZodOptional<z.ZodEnum<typeof OTPRequestRequestChannel>>;
755
734
  source_url: z.ZodOptional<z.ZodString>;
756
735
  }, z.core.$strip>;
757
736
  /**
package/dist/hooks.mjs CHANGED
@@ -181,7 +181,7 @@ var Accounts = class {
181
181
  this.client = client;
182
182
  }
183
183
  /**
184
- * Request OTP code to email or phone.
184
+ * Request OTP code to email.
185
185
  */
186
186
  async otpRequestCreate(data) {
187
187
  const response = await this.client.request("POST", "/cfg/accounts/otp/request/", { body: data });
@@ -826,11 +826,6 @@ var OAuthConnectionProvider = /* @__PURE__ */ ((OAuthConnectionProvider2) => {
826
826
  OAuthConnectionProvider2["GITHUB"] = "github";
827
827
  return OAuthConnectionProvider2;
828
828
  })(OAuthConnectionProvider || {});
829
- var OTPRequestRequestChannel = /* @__PURE__ */ ((OTPRequestRequestChannel2) => {
830
- OTPRequestRequestChannel2["EMAIL"] = "email";
831
- OTPRequestRequestChannel2["PHONE"] = "phone";
832
- return OTPRequestRequestChannel2;
833
- })(OTPRequestRequestChannel || {});
834
829
 
835
830
  // src/_api/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts
836
831
  import { z as z2 } from "zod";
@@ -924,14 +919,15 @@ var OAuthTokenResponseSchema = z12.object({
924
919
  // src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts
925
920
  import { z as z13 } from "zod";
926
921
  var OTPErrorResponseSchema = z13.object({
927
- error: z13.string()
922
+ error: z13.string(),
923
+ error_code: z13.string().nullable().optional(),
924
+ retry_after: z13.number().int().nullable().optional()
928
925
  });
929
926
 
930
927
  // src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts
931
928
  import { z as z14 } from "zod";
932
929
  var OTPRequestRequestSchema = z14.object({
933
930
  identifier: z14.string().min(1),
934
- channel: z14.nativeEnum(OTPRequestRequestChannel).optional(),
935
931
  source_url: z14.string().optional()
936
932
  });
937
933
 
@@ -946,7 +942,6 @@ import { z as z16 } from "zod";
946
942
  var OTPVerifyRequestSchema = z16.object({
947
943
  identifier: z16.string().min(1),
948
944
  otp: z16.string().min(6).max(6),
949
- channel: z16.nativeEnum(OTPRequestRequestChannel).optional(),
950
945
  source_url: z16.string().optional()
951
946
  });
952
947