@djangocfg/api 2.1.356 → 2.1.358

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 (113) hide show
  1. package/README.md +53 -632
  2. package/dist/auth-server.cjs +717 -200
  3. package/dist/auth-server.cjs.map +1 -1
  4. package/dist/auth-server.mjs +717 -200
  5. package/dist/auth-server.mjs.map +1 -1
  6. package/dist/auth.cjs +843 -783
  7. package/dist/auth.cjs.map +1 -1
  8. package/dist/auth.d.cts +58 -37
  9. package/dist/auth.d.ts +58 -37
  10. package/dist/auth.mjs +846 -784
  11. package/dist/auth.mjs.map +1 -1
  12. package/dist/clients.cjs +1427 -0
  13. package/dist/clients.cjs.map +1 -1
  14. package/dist/clients.d.cts +1686 -0
  15. package/dist/clients.d.ts +1686 -0
  16. package/dist/clients.mjs +1427 -0
  17. package/dist/clients.mjs.map +1 -1
  18. package/dist/hooks.cjs +1277 -1924
  19. package/dist/hooks.cjs.map +1 -1
  20. package/dist/hooks.d.cts +18 -1206
  21. package/dist/hooks.d.ts +18 -1206
  22. package/dist/hooks.mjs +1253 -1900
  23. package/dist/hooks.mjs.map +1 -1
  24. package/dist/index.cjs +545 -1232
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +1389 -1455
  27. package/dist/index.d.ts +1389 -1455
  28. package/dist/index.mjs +545 -1232
  29. package/dist/index.mjs.map +1 -1
  30. package/package.json +7 -2
  31. package/src/_api/generated/_cfg_accounts/api.ts +11 -3
  32. package/src/_api/generated/_cfg_accounts/hooks/index.ts +3 -0
  33. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRegenerateCreate.ts +64 -0
  34. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyRetrieve.ts +65 -0
  35. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsApiKeyTestCreate.ts +64 -0
  36. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthConnectionsList.ts +43 -3
  37. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthDisconnectCreate.ts +43 -3
  38. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +43 -3
  39. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +43 -3
  40. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthProvidersRetrieve.ts +43 -3
  41. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpRequestCreate.ts +43 -3
  42. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpVerifyCreate.ts +43 -3
  43. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileAvatarCreate.ts +43 -3
  44. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileDeleteCreate.ts +43 -3
  45. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +43 -3
  46. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialUpdate.ts +43 -3
  47. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileRetrieve.ts +43 -3
  48. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +43 -3
  49. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdateUpdate.ts +43 -3
  50. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsTokenRefreshCreate.ts +43 -3
  51. package/src/_api/generated/_cfg_accounts/index.ts +1 -1
  52. package/src/_api/generated/_cfg_accounts/schemas/APIKey.ts +13 -0
  53. package/src/_api/generated/_cfg_accounts/schemas/APIKeyRegenerate.ts +12 -0
  54. package/src/_api/generated/_cfg_accounts/schemas/APIKeyRequest.ts +13 -0
  55. package/src/_api/generated/{_cfg_totp/schemas/DeviceListStatusEnum.ts → _cfg_accounts/schemas/APIKeyTestRequest.ts} +4 -2
  56. package/src/_api/generated/_cfg_accounts/schemas/APIKeyTestResult.ts +12 -0
  57. package/src/_api/generated/_cfg_accounts/schemas/AccountDeleteResponse.ts +1 -1
  58. package/src/_api/generated/_cfg_accounts/schemas/CentrifugoToken.ts +2 -2
  59. package/src/_api/generated/_cfg_accounts/schemas/CfgUserUpdateRequest.ts +3 -2
  60. package/src/_api/generated/_cfg_accounts/schemas/OAuthCallbackRequestRequest.ts +1 -1
  61. package/src/_api/generated/_cfg_accounts/schemas/OAuthConnection.ts +6 -6
  62. package/src/_api/generated/_cfg_accounts/schemas/OAuthDisconnectRequestRequest.ts +2 -2
  63. package/src/_api/generated/_cfg_accounts/schemas/{ProviderEnum.ts → OAuthProviderEnum.ts} +2 -2
  64. package/src/_api/generated/_cfg_accounts/schemas/OAuthTokenResponse.ts +5 -5
  65. package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyRequest.ts +1 -1
  66. package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyResponse.ts +3 -3
  67. package/src/_api/generated/_cfg_accounts/schemas/PatchedCfgUserUpdateRequest.ts +3 -2
  68. package/src/_api/generated/_cfg_accounts/schemas/User.ts +12 -10
  69. package/src/_api/generated/_cfg_accounts/schemas/cfg_accounts_oauth_connections_response_200_AutoRef.ts +10 -0
  70. package/src/_api/generated/_cfg_accounts/schemas/cfg_accounts_oauth_disconnect_response_200_AutoRef.ts +11 -0
  71. package/src/_api/generated/_cfg_accounts/schemas/index.ts +8 -1
  72. package/src/_api/generated/_cfg_centrifugo/api.ts +3 -3
  73. package/src/_api/generated/_cfg_centrifugo/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +43 -3
  74. package/src/_api/generated/_cfg_centrifugo/index.ts +1 -1
  75. package/src/_api/generated/_cfg_centrifugo/schemas/ConnectionTokenResponse.ts +2 -2
  76. package/src/_api/generated/_cfg_totp/api.ts +9 -3
  77. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +43 -3
  78. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRetrieve.ts +43 -3
  79. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesDestroy.ts +7 -3
  80. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +43 -3
  81. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDisableCreate.ts +43 -3
  82. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupConfirmCreate.ts +43 -3
  83. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupCreate.ts +43 -3
  84. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyBackupCreate.ts +43 -3
  85. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyCreate.ts +43 -3
  86. package/src/_api/generated/_cfg_totp/index.ts +1 -1
  87. package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupRequest.ts +1 -1
  88. package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupResponse.ts +1 -1
  89. package/src/_api/generated/_cfg_totp/schemas/DeviceList.ts +5 -5
  90. package/src/_api/generated/_cfg_totp/schemas/DeviceStatusEnum.ts +9 -0
  91. package/src/_api/generated/_cfg_totp/schemas/SetupResponse.ts +2 -2
  92. package/src/_api/generated/_cfg_totp/schemas/TotpVerifyUser.ts +11 -9
  93. package/src/_api/generated/_cfg_totp/schemas/VerifyBackupRequest.ts +1 -1
  94. package/src/_api/generated/_cfg_totp/schemas/VerifyRequest.ts +1 -1
  95. package/src/_api/generated/_cfg_totp/schemas/VerifyResponse.ts +2 -2
  96. package/src/_api/generated/_cfg_totp/schemas/cfg_totp_disable_response_200_AutoRef.ts +9 -0
  97. package/src/_api/generated/_cfg_totp/schemas/index.ts +2 -1
  98. package/src/_api/generated/index.ts +3 -1
  99. package/src/_api/generated/sdk.gen.ts +80 -813
  100. package/src/_api/generated/types.gen.ts +320 -159
  101. package/src/auth/context/AccountsContext.tsx +18 -6
  102. package/src/auth/context/AuthContext.tsx +11 -3
  103. package/src/auth/hooks/useDeleteAccount.ts +2 -2
  104. package/src/auth/hooks/useGithubAuth.ts +3 -3
  105. package/src/auth/hooks/useTokenRefresh.ts +2 -2
  106. package/src/auth/hooks/useTwoFactor.ts +3 -3
  107. package/src/auth/hooks/useTwoFactorSetup.ts +3 -3
  108. package/src/auth/hooks/useTwoFactorStatus.ts +3 -3
  109. package/src/auth/middlewares/tokenRefresh.ts +2 -2
  110. package/src/hooks/index.ts +1 -0
  111. package/src/hooks/useApiKey.ts +73 -0
  112. package/src/index.ts +12 -16
  113. package/src/lib/env.ts +10 -0
@@ -5,17 +5,91 @@ export type ClientOptions = {
5
5
  };
6
6
 
7
7
  /**
8
- * Response serializer for account deletion.
8
+ * Serializer for API key response (masked).
9
9
  */
10
- export type AccountDeleteResponse = {
10
+ export type ApiKey = {
11
11
  /**
12
- * Human-readable message about the deletion
12
+ * Masked API key
13
13
  */
14
- message: string;
14
+ key: string;
15
+ /**
16
+ * When the key was last regenerated
17
+ */
18
+ reissued_at: string | null;
19
+ /**
20
+ * When the key was created
21
+ */
22
+ created_at: string;
23
+ };
24
+
25
+ /**
26
+ * Serializer for API key regeneration response (full key shown once).
27
+ */
28
+ export type ApiKeyRegenerate = {
29
+ /**
30
+ * New API key (shown only once)
31
+ */
32
+ key: string;
33
+ /**
34
+ * When the key was regenerated
35
+ */
36
+ reissued_at: string;
37
+ };
38
+
39
+ /**
40
+ * Serializer for API key response (masked).
41
+ */
42
+ export type ApiKeyRequest = {
43
+ /**
44
+ * Masked API key
45
+ */
46
+ key: string;
47
+ /**
48
+ * When the key was last regenerated
49
+ */
50
+ reissued_at: string | null;
51
+ /**
52
+ * When the key was created
53
+ */
54
+ created_at: string;
55
+ };
56
+
57
+ /**
58
+ * Serializer for testing an API key.
59
+ */
60
+ export type ApiKeyTestRequest = {
61
+ /**
62
+ * API key to test
63
+ */
64
+ key: string;
65
+ };
66
+
67
+ /**
68
+ * Serializer for API key test result.
69
+ */
70
+ export type ApiKeyTestResult = {
71
+ /**
72
+ * Whether the key is valid
73
+ */
74
+ valid: boolean;
75
+ /**
76
+ * User ID if valid, null otherwise
77
+ */
78
+ user_id: string | null;
79
+ };
80
+
81
+ /**
82
+ * Response serializer for account deletion.
83
+ */
84
+ export type AccountDeleteResponse = {
15
85
  /**
16
86
  * Whether the account was successfully deleted
17
87
  */
18
88
  success: boolean;
89
+ /**
90
+ * Human-readable message about the deletion
91
+ */
92
+ message: string;
19
93
  };
20
94
 
21
95
  /**
@@ -65,53 +139,58 @@ export type BackupCodesStatus = {
65
139
  */
66
140
  export type CentrifugoToken = {
67
141
  /**
68
- * Centrifugo WebSocket URL
142
+ * JWT token for Centrifugo WebSocket connection
69
143
  */
70
- centrifugo_url: string;
144
+ token: string;
71
145
  /**
72
- * List of allowed channels for this user
146
+ * Centrifugo WebSocket URL
73
147
  */
74
- channels: Array<string>;
148
+ centrifugo_url: string;
75
149
  /**
76
150
  * Token expiration time (ISO 8601)
77
151
  */
78
152
  expires_at: string;
79
153
  /**
80
- * JWT token for Centrifugo WebSocket connection
154
+ * List of allowed channels for this user
81
155
  */
82
- token: string;
156
+ channels: Array<string>;
83
157
  };
84
158
 
85
159
  /**
86
160
  * Serializer for updating user profile.
87
161
  */
88
162
  export type CfgUserUpdateRequest = {
89
- company?: string;
90
163
  first_name?: string;
91
- language?: string;
92
164
  last_name?: string;
165
+ company?: string;
93
166
  phone?: string;
94
167
  position?: string;
168
+ language?: string;
169
+ /**
170
+ * IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
171
+ */
172
+ timezone?: string;
95
173
  };
96
174
 
97
175
  /**
98
176
  * Serializer for confirming 2FA setup with first code.
99
177
  */
100
178
  export type ConfirmSetupRequest = {
101
- /**
102
- * 6-digit TOTP code from authenticator app
103
- */
104
- code: string;
105
179
  /**
106
180
  * Device ID from setup response
107
181
  */
108
182
  device_id: string;
183
+ /**
184
+ * 6-digit TOTP code from authenticator app
185
+ */
186
+ code: string;
109
187
  };
110
188
 
111
189
  /**
112
190
  * Response serializer for setup confirmation.
113
191
  */
114
192
  export type ConfirmSetupResponse = {
193
+ message: string;
115
194
  /**
116
195
  * List of backup recovery codes (save these!)
117
196
  */
@@ -120,7 +199,6 @@ export type ConfirmSetupResponse = {
120
199
  * Warning message about backup codes
121
200
  */
122
201
  backup_codes_warning: string;
123
- message: string;
124
202
  };
125
203
 
126
204
  /**
@@ -130,17 +208,17 @@ export type ConfirmSetupResponse = {
130
208
  */
131
209
  export type ConnectionTokenResponse = {
132
210
  /**
133
- * Centrifugo Url
211
+ * Token
134
212
  *
135
- * Centrifugo WebSocket URL
213
+ * JWT token for Centrifugo connection
136
214
  */
137
- centrifugo_url: string;
215
+ token: string;
138
216
  /**
139
- * Channels
217
+ * Centrifugo Url
140
218
  *
141
- * List of allowed channels
219
+ * Centrifugo WebSocket URL
142
220
  */
143
- channels: Array<string>;
221
+ centrifugo_url: string;
144
222
  /**
145
223
  * Expires At
146
224
  *
@@ -148,36 +226,36 @@ export type ConnectionTokenResponse = {
148
226
  */
149
227
  expires_at: string;
150
228
  /**
151
- * Token
229
+ * Channels
152
230
  *
153
- * JWT token for Centrifugo connection
231
+ * List of allowed channels
154
232
  */
155
- token: string;
233
+ channels: Array<string>;
156
234
  };
157
235
 
158
236
  /**
159
237
  * Serializer for listing TOTP devices.
160
238
  */
161
239
  export type DeviceList = {
240
+ readonly id: string;
162
241
  /**
163
- * When device setup was confirmed
242
+ * Device name for identification
164
243
  */
165
- readonly confirmed_at: string | null;
166
- readonly created_at: string;
167
- readonly id: string;
244
+ readonly name: string;
168
245
  /**
169
246
  * Primary device used for verification
170
247
  */
171
248
  readonly is_primary: boolean;
249
+ readonly status: DeviceStatusEnum;
250
+ readonly created_at: string;
172
251
  /**
173
- * Last successful verification
252
+ * When device setup was confirmed
174
253
  */
175
- readonly last_used_at: string | null;
254
+ readonly confirmed_at: string | null;
176
255
  /**
177
- * Device name for identification
256
+ * Last successful verification
178
257
  */
179
- readonly name: string;
180
- readonly status: DeviceListStatusEnum;
258
+ readonly last_used_at: string | null;
181
259
  };
182
260
 
183
261
  /**
@@ -193,7 +271,7 @@ export type DeviceListResponse = {
193
271
  * * `active` - Active
194
272
  * * `disabled` - Disabled
195
273
  */
196
- export enum DeviceListStatusEnum {
274
+ export enum DeviceStatusEnum {
197
275
  PENDING = 'pending',
198
276
  ACTIVE = 'active',
199
277
  DISABLED = 'disabled'
@@ -245,48 +323,48 @@ export type OAuthCallbackRequestRequest = {
245
323
  * Authorization code from OAuth provider callback
246
324
  */
247
325
  code: string;
248
- /**
249
- * Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path
250
- */
251
- redirect_uri?: string;
252
326
  /**
253
327
  * State token for CSRF verification (from authorize response)
254
328
  */
255
329
  state: string;
330
+ /**
331
+ * Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path
332
+ */
333
+ redirect_uri?: string;
256
334
  };
257
335
 
258
336
  /**
259
337
  * Serializer for OAuth connection info (user-facing).
260
338
  */
261
339
  export type OAuthConnection = {
262
- /**
263
- * When this OAuth connection was created
264
- */
265
- readonly connected_at: string;
266
340
  readonly id: number;
267
- /**
268
- * Last time this OAuth connection was used for login
269
- */
270
- readonly last_login_at: string;
271
341
  /**
272
342
  * OAuth provider name (github, google, etc.)
273
343
  *
274
344
  * * `github` - GitHub
275
345
  */
276
- readonly provider: ProviderEnum;
346
+ readonly provider: OAuthProviderEnum;
347
+ readonly provider_display: string;
277
348
  /**
278
- * Avatar URL from OAuth provider
349
+ * Username on the OAuth provider platform
279
350
  */
280
- readonly provider_avatar_url: string;
281
- readonly provider_display: string;
351
+ readonly provider_username: string;
282
352
  /**
283
353
  * Email from OAuth provider (may differ from user.email)
284
354
  */
285
355
  readonly provider_email: string;
286
356
  /**
287
- * Username on the OAuth provider platform
357
+ * Avatar URL from OAuth provider
288
358
  */
289
- readonly provider_username: string;
359
+ readonly provider_avatar_url: string;
360
+ /**
361
+ * When this OAuth connection was created
362
+ */
363
+ readonly connected_at: string;
364
+ /**
365
+ * Last time this OAuth connection was used for login
366
+ */
367
+ readonly last_login_at: string;
290
368
  };
291
369
 
292
370
  /**
@@ -298,7 +376,7 @@ export type OAuthDisconnectRequestRequest = {
298
376
  *
299
377
  * * `github` - GitHub
300
378
  */
301
- provider: ProviderEnum;
379
+ provider: OAuthProviderEnum;
302
380
  };
303
381
 
304
382
  /**
@@ -315,6 +393,13 @@ export type OAuthError = {
315
393
  error_description?: string;
316
394
  };
317
395
 
396
+ /**
397
+ * * `github` - GitHub
398
+ */
399
+ export enum OAuthProviderEnum {
400
+ GITHUB = 'github'
401
+ }
402
+
318
403
  /**
319
404
  * Response with available OAuth providers.
320
405
  */
@@ -342,39 +427,39 @@ export type OAuthProvidersResponse = {
342
427
  */
343
428
  export type OAuthTokenResponse = {
344
429
  /**
345
- * JWT access token (null when requires_2fa=True)
430
+ * True if 2FA verification is required
346
431
  */
347
- access?: string | null;
432
+ requires_2fa?: boolean;
348
433
  /**
349
- * True if a new OAuth connection was created
434
+ * 2FA session ID (only when requires_2fa=True)
350
435
  */
351
- is_new_connection: boolean;
436
+ session_id?: string | null;
352
437
  /**
353
- * True if a new user was created during this OAuth flow
438
+ * JWT access token (null when requires_2fa=True)
354
439
  */
355
- is_new_user: boolean;
440
+ access?: string | null;
356
441
  /**
357
442
  * JWT refresh token (null when requires_2fa=True)
358
443
  */
359
444
  refresh?: string | null;
360
445
  /**
361
- * True if 2FA verification is required
446
+ * Authenticated user info (null when requires_2fa=True)
362
447
  */
363
- requires_2fa?: boolean;
448
+ user?: {
449
+ [key: string]: unknown;
450
+ } | null;
364
451
  /**
365
- * 2FA session ID (only when requires_2fa=True)
452
+ * True if a new user was created during this OAuth flow
366
453
  */
367
- session_id?: string | null;
454
+ is_new_user: boolean;
368
455
  /**
369
- * True if user should be prompted to enable 2FA
456
+ * True if a new OAuth connection was created
370
457
  */
371
- should_prompt_2fa?: boolean;
458
+ is_new_connection: boolean;
372
459
  /**
373
- * Authenticated user info (null when requires_2fa=True)
460
+ * True if user should be prompted to enable 2FA
374
461
  */
375
- user?: {
376
- [key: string]: unknown;
377
- } | null;
462
+ should_prompt_2fa?: boolean;
378
463
  };
379
464
 
380
465
  /**
@@ -458,14 +543,6 @@ export type OtpVerifyRequest = {
458
543
  * - refresh/access/user: populated
459
544
  */
460
545
  export type OtpVerifyResponse = {
461
- /**
462
- * JWT access token (if requires_2fa is False)
463
- */
464
- access?: string | null;
465
- /**
466
- * JWT refresh token (if requires_2fa is False)
467
- */
468
- refresh?: string | null;
469
546
  /**
470
547
  * Whether 2FA verification is required
471
548
  */
@@ -475,34 +552,39 @@ export type OtpVerifyResponse = {
475
552
  */
476
553
  session_id?: string | null;
477
554
  /**
478
- * Whether user should be prompted to enable 2FA
555
+ * JWT refresh token (if requires_2fa is False)
479
556
  */
480
- should_prompt_2fa?: boolean;
557
+ refresh?: string | null;
558
+ /**
559
+ * JWT access token (if requires_2fa is False)
560
+ */
561
+ access?: string | null;
481
562
  /**
482
563
  * User information (if requires_2fa is False)
483
564
  */
484
565
  user?: User | null;
566
+ /**
567
+ * Whether user should be prompted to enable 2FA
568
+ */
569
+ should_prompt_2fa?: boolean;
485
570
  };
486
571
 
487
572
  /**
488
573
  * Serializer for updating user profile.
489
574
  */
490
575
  export type PatchedCfgUserUpdateRequest = {
491
- company?: string;
492
576
  first_name?: string;
493
- language?: string;
494
577
  last_name?: string;
578
+ company?: string;
495
579
  phone?: string;
496
580
  position?: string;
581
+ language?: string;
582
+ /**
583
+ * IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
584
+ */
585
+ timezone?: string;
497
586
  };
498
587
 
499
- /**
500
- * * `github` - GitHub
501
- */
502
- export enum ProviderEnum {
503
- GITHUB = 'github'
504
- }
505
-
506
588
  /**
507
589
  * Serializer for starting 2FA setup.
508
590
  */
@@ -522,9 +604,9 @@ export type SetupResponse = {
522
604
  */
523
605
  device_id: string;
524
606
  /**
525
- * Seconds until setup expires (typically 600 = 10 minutes)
607
+ * Base32-encoded TOTP secret (for manual entry)
526
608
  */
527
- expires_in: number;
609
+ secret: string;
528
610
  /**
529
611
  * otpauth:// URI for QR code generation
530
612
  */
@@ -534,9 +616,9 @@ export type SetupResponse = {
534
616
  */
535
617
  qr_code_base64: string;
536
618
  /**
537
- * Base32-encoded TOTP secret (for manual entry)
619
+ * Seconds until setup expires (typically 600 = 10 minutes)
538
620
  */
539
- secret: string;
621
+ expires_in: number;
540
622
  };
541
623
 
542
624
  export type TokenRefresh = {
@@ -552,24 +634,31 @@ export type TokenRefreshRequest = {
552
634
  * User data returned after 2FA verification.
553
635
  */
554
636
  export type TotpVerifyUser = {
555
- readonly avatar: string | null;
556
- company?: string;
557
- readonly date_joined: string;
558
- /**
559
- * Get formatted username for display.
560
- */
561
- readonly display_username: string;
637
+ readonly id: number;
562
638
  readonly email: string;
563
639
  first_name?: string;
640
+ last_name?: string;
564
641
  /**
565
642
  * Get user's full name.
566
643
  */
567
644
  readonly full_name: string;
568
- readonly id: number;
569
645
  /**
570
646
  * Get user's initials for avatar fallback.
571
647
  */
572
648
  readonly initials: string;
649
+ /**
650
+ * Get formatted username for display.
651
+ */
652
+ readonly display_username: string;
653
+ company?: string;
654
+ phone?: string;
655
+ position?: string;
656
+ language?: string;
657
+ /**
658
+ * IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
659
+ */
660
+ timezone?: string;
661
+ readonly avatar: string | null;
573
662
  /**
574
663
  * Staff status
575
664
  *
@@ -582,37 +671,41 @@ export type TotpVerifyUser = {
582
671
  * Designates that this user has all permissions without explicitly assigning them.
583
672
  */
584
673
  readonly is_superuser: boolean;
585
- language?: string;
674
+ readonly date_joined: string;
586
675
  readonly last_login: string | null;
587
- last_name?: string;
588
- phone?: string;
589
- position?: string;
590
676
  readonly unanswered_messages_count: number;
677
+ readonly api_key: string | null;
591
678
  };
592
679
 
593
680
  /**
594
681
  * Serializer for user details.
595
682
  */
596
683
  export type User = {
597
- readonly avatar: string | null;
598
- readonly centrifugo: CentrifugoToken | null;
599
- company?: string;
600
- readonly date_joined: string;
601
- /**
602
- * Get formatted username for display.
603
- */
604
- readonly display_username: string;
684
+ readonly id: number;
605
685
  readonly email: string;
606
686
  first_name?: string;
687
+ last_name?: string;
607
688
  /**
608
689
  * Get user's full name.
609
690
  */
610
691
  readonly full_name: string;
611
- readonly id: number;
612
692
  /**
613
693
  * Get user's initials for avatar fallback.
614
694
  */
615
695
  readonly initials: string;
696
+ /**
697
+ * Get formatted username for display.
698
+ */
699
+ readonly display_username: string;
700
+ company?: string;
701
+ phone?: string;
702
+ position?: string;
703
+ language?: string;
704
+ /**
705
+ * IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
706
+ */
707
+ timezone?: string;
708
+ readonly avatar: string | null;
616
709
  /**
617
710
  * Staff status
618
711
  *
@@ -625,69 +718,79 @@ export type User = {
625
718
  * Designates that this user has all permissions without explicitly assigning them.
626
719
  */
627
720
  readonly is_superuser: boolean;
628
- language?: string;
721
+ readonly date_joined: string;
629
722
  readonly last_login: string | null;
630
- last_name?: string;
631
- phone?: string;
632
- position?: string;
633
723
  readonly unanswered_messages_count: number;
724
+ readonly centrifugo: CentrifugoToken | null;
725
+ readonly api_key: string | null;
634
726
  };
635
727
 
636
728
  /**
637
729
  * Serializer for backup code verification during login.
638
730
  */
639
731
  export type VerifyBackupRequest = {
640
- /**
641
- * 8-character backup recovery code
642
- */
643
- backup_code: string;
644
732
  /**
645
733
  * 2FA session ID from login response
646
734
  */
647
735
  session_id: string;
736
+ /**
737
+ * 8-character backup recovery code
738
+ */
739
+ backup_code: string;
648
740
  };
649
741
 
650
742
  /**
651
743
  * Serializer for TOTP code verification during login.
652
744
  */
653
745
  export type VerifyRequest = {
654
- /**
655
- * 6-digit TOTP code from authenticator app
656
- */
657
- code: string;
658
746
  /**
659
747
  * 2FA session ID from login response
660
748
  */
661
749
  session_id: string;
750
+ /**
751
+ * 6-digit TOTP code from authenticator app
752
+ */
753
+ code: string;
662
754
  };
663
755
 
664
756
  /**
665
757
  * Response serializer for successful 2FA verification.
666
758
  */
667
759
  export type VerifyResponse = {
760
+ message: string;
668
761
  /**
669
762
  * JWT access token
670
763
  */
671
764
  access_token: string;
672
- message: string;
673
765
  /**
674
766
  * JWT refresh token
675
767
  */
676
768
  refresh_token: string;
677
- /**
678
- * Number of remaining backup codes (if backup code was used)
679
- */
680
- remaining_backup_codes?: number;
681
769
  /**
682
770
  * User profile data
683
771
  */
684
772
  user: TotpVerifyUser;
773
+ /**
774
+ * Number of remaining backup codes (if backup code was used)
775
+ */
776
+ remaining_backup_codes?: number;
685
777
  /**
686
778
  * Warning message (e.g., low backup codes)
687
779
  */
688
780
  warning?: string;
689
781
  };
690
782
 
783
+ export type CfgAccountsOauthConnectionsResponse200AutoRef = Array<OAuthConnection>;
784
+
785
+ export type CfgAccountsOauthDisconnectResponse200AutoRef = {
786
+ message?: string;
787
+ };
788
+
789
+ /**
790
+ * 2FA disabled successfully
791
+ */
792
+ export type CfgTotpDisableResponse200AutoRef = unknown;
793
+
691
794
  /**
692
795
  * Response serializer for device list endpoint.
693
796
  */
@@ -710,14 +813,6 @@ export type DeviceListResponseWritable = {
710
813
  * - refresh/access/user: populated
711
814
  */
712
815
  export type OtpVerifyResponseWritable = {
713
- /**
714
- * JWT access token (if requires_2fa is False)
715
- */
716
- access?: string | null;
717
- /**
718
- * JWT refresh token (if requires_2fa is False)
719
- */
720
- refresh?: string | null;
721
816
  /**
722
817
  * Whether 2FA verification is required
723
818
  */
@@ -727,13 +822,21 @@ export type OtpVerifyResponseWritable = {
727
822
  */
728
823
  session_id?: string | null;
729
824
  /**
730
- * Whether user should be prompted to enable 2FA
825
+ * JWT refresh token (if requires_2fa is False)
731
826
  */
732
- should_prompt_2fa?: boolean;
827
+ refresh?: string | null;
828
+ /**
829
+ * JWT access token (if requires_2fa is False)
830
+ */
831
+ access?: string | null;
733
832
  /**
734
833
  * User information (if requires_2fa is False)
735
834
  */
736
835
  user?: UserWritable | null;
836
+ /**
837
+ * Whether user should be prompted to enable 2FA
838
+ */
839
+ should_prompt_2fa?: boolean;
737
840
  };
738
841
 
739
842
  export type TokenRefreshWritable = {
@@ -744,53 +847,114 @@ export type TokenRefreshWritable = {
744
847
  * User data returned after 2FA verification.
745
848
  */
746
849
  export type TotpVerifyUserWritable = {
747
- company?: string;
748
850
  first_name?: string;
749
- language?: string;
750
851
  last_name?: string;
852
+ company?: string;
751
853
  phone?: string;
752
854
  position?: string;
855
+ language?: string;
856
+ /**
857
+ * IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
858
+ */
859
+ timezone?: string;
753
860
  };
754
861
 
755
862
  /**
756
863
  * Serializer for user details.
757
864
  */
758
865
  export type UserWritable = {
759
- company?: string;
760
866
  first_name?: string;
761
- language?: string;
762
867
  last_name?: string;
868
+ company?: string;
763
869
  phone?: string;
764
870
  position?: string;
871
+ language?: string;
872
+ /**
873
+ * IANA timezone name (e.g. 'Asia/Seoul'). Auto-detected from browser via X-Timezone header.
874
+ */
875
+ timezone?: string;
765
876
  };
766
877
 
767
878
  /**
768
879
  * Response serializer for successful 2FA verification.
769
880
  */
770
881
  export type VerifyResponseWritable = {
882
+ message: string;
771
883
  /**
772
884
  * JWT access token
773
885
  */
774
886
  access_token: string;
775
- message: string;
776
887
  /**
777
888
  * JWT refresh token
778
889
  */
779
890
  refresh_token: string;
780
- /**
781
- * Number of remaining backup codes (if backup code was used)
782
- */
783
- remaining_backup_codes?: number;
784
891
  /**
785
892
  * User profile data
786
893
  */
787
894
  user: TotpVerifyUserWritable;
895
+ /**
896
+ * Number of remaining backup codes (if backup code was used)
897
+ */
898
+ remaining_backup_codes?: number;
788
899
  /**
789
900
  * Warning message (e.g., low backup codes)
790
901
  */
791
902
  warning?: string;
792
903
  };
793
904
 
905
+ export type CfgAccountsApiKeyRetrieveData = {
906
+ body?: never;
907
+ path?: never;
908
+ query?: never;
909
+ url: '/cfg/accounts/api-key/';
910
+ };
911
+
912
+ export type CfgAccountsApiKeyRetrieveErrors = {
913
+ /**
914
+ * Authentication credentials were not provided.
915
+ */
916
+ 401: unknown;
917
+ };
918
+
919
+ export type CfgAccountsApiKeyRetrieveResponses = {
920
+ 200: ApiKey;
921
+ };
922
+
923
+ export type CfgAccountsApiKeyRetrieveResponse = CfgAccountsApiKeyRetrieveResponses[keyof CfgAccountsApiKeyRetrieveResponses];
924
+
925
+ export type CfgAccountsApiKeyRegenerateCreateData = {
926
+ body: ApiKeyRequest;
927
+ path?: never;
928
+ query?: never;
929
+ url: '/cfg/accounts/api-key/regenerate/';
930
+ };
931
+
932
+ export type CfgAccountsApiKeyRegenerateCreateErrors = {
933
+ /**
934
+ * Authentication credentials were not provided.
935
+ */
936
+ 401: unknown;
937
+ };
938
+
939
+ export type CfgAccountsApiKeyRegenerateCreateResponses = {
940
+ 200: ApiKeyRegenerate;
941
+ };
942
+
943
+ export type CfgAccountsApiKeyRegenerateCreateResponse = CfgAccountsApiKeyRegenerateCreateResponses[keyof CfgAccountsApiKeyRegenerateCreateResponses];
944
+
945
+ export type CfgAccountsApiKeyTestCreateData = {
946
+ body: ApiKeyTestRequest;
947
+ path?: never;
948
+ query?: never;
949
+ url: '/cfg/accounts/api-key/test/';
950
+ };
951
+
952
+ export type CfgAccountsApiKeyTestCreateResponses = {
953
+ 200: ApiKeyTestResult;
954
+ };
955
+
956
+ export type CfgAccountsApiKeyTestCreateResponse = CfgAccountsApiKeyTestCreateResponses[keyof CfgAccountsApiKeyTestCreateResponses];
957
+
794
958
  export type CfgAccountsOauthConnectionsListData = {
795
959
  body?: never;
796
960
  path?: never;
@@ -799,7 +963,7 @@ export type CfgAccountsOauthConnectionsListData = {
799
963
  };
800
964
 
801
965
  export type CfgAccountsOauthConnectionsListResponses = {
802
- 200: Array<OAuthConnection>;
966
+ 200: CfgAccountsOauthConnectionsResponse200AutoRef;
803
967
  };
804
968
 
805
969
  export type CfgAccountsOauthConnectionsListResponse = CfgAccountsOauthConnectionsListResponses[keyof CfgAccountsOauthConnectionsListResponses];
@@ -819,9 +983,7 @@ export type CfgAccountsOauthDisconnectCreateErrors = {
819
983
  export type CfgAccountsOauthDisconnectCreateError = CfgAccountsOauthDisconnectCreateErrors[keyof CfgAccountsOauthDisconnectCreateErrors];
820
984
 
821
985
  export type CfgAccountsOauthDisconnectCreateResponses = {
822
- 200: {
823
- message?: string;
824
- };
986
+ 200: CfgAccountsOauthDisconnectResponse200AutoRef;
825
987
  };
826
988
 
827
989
  export type CfgAccountsOauthDisconnectCreateResponse = CfgAccountsOauthDisconnectCreateResponses[keyof CfgAccountsOauthDisconnectCreateResponses];
@@ -1203,12 +1365,11 @@ export type CfgTotpDisableCreateErrors = {
1203
1365
  };
1204
1366
 
1205
1367
  export type CfgTotpDisableCreateResponses = {
1206
- /**
1207
- * 2FA disabled successfully
1208
- */
1209
- 200: unknown;
1368
+ 200: CfgTotpDisableResponse200AutoRef;
1210
1369
  };
1211
1370
 
1371
+ export type CfgTotpDisableCreateResponse = CfgTotpDisableCreateResponses[keyof CfgTotpDisableCreateResponses];
1372
+
1212
1373
  export type CfgTotpSetupCreateData = {
1213
1374
  body?: SetupRequest;
1214
1375
  path?: never;