@djangocfg/api 2.1.327 → 2.1.332

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 (174) hide show
  1. package/dist/auth-server.cjs +328 -3553
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.mjs +328 -3553
  4. package/dist/auth-server.mjs.map +1 -1
  5. package/dist/auth.cjs +744 -3036
  6. package/dist/auth.cjs.map +1 -1
  7. package/dist/auth.d.cts +35 -35
  8. package/dist/auth.d.ts +35 -35
  9. package/dist/auth.mjs +744 -3036
  10. package/dist/auth.mjs.map +1 -1
  11. package/dist/clients.cjs +303 -3548
  12. package/dist/clients.cjs.map +1 -1
  13. package/dist/clients.d.cts +28 -2557
  14. package/dist/clients.d.ts +28 -2557
  15. package/dist/clients.mjs +303 -3548
  16. package/dist/clients.mjs.map +1 -1
  17. package/dist/index.cjs +1130 -3099
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +1807 -2165
  20. package/dist/index.d.ts +1807 -2165
  21. package/dist/index.mjs +1130 -3099
  22. package/dist/index.mjs.map +1 -1
  23. package/package.json +2 -2
  24. package/src/_api/generated/_cfg_accounts/api.ts +67 -0
  25. package/src/_api/generated/{cfg_totp → _cfg_accounts}/events.ts +3 -3
  26. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/index.ts +1 -1
  27. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthConnectionsList.ts +5 -6
  28. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthDisconnectCreate.ts +3 -3
  29. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +3 -3
  30. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +3 -3
  31. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOauthProvidersRetrieve.ts +5 -6
  32. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOtpRequestCreate.ts +3 -3
  33. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsOtpVerifyCreate.ts +3 -3
  34. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileAvatarCreate.ts +3 -3
  35. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileDeleteCreate.ts +3 -3
  36. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +3 -3
  37. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfilePartialUpdate.ts +3 -3
  38. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileRetrieve.ts +5 -6
  39. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +3 -3
  40. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsProfileUpdateUpdate.ts +3 -3
  41. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/hooks/useCfgAccountsTokenRefreshCreate.ts +3 -3
  42. package/src/_api/generated/{cfg_centrifugo → _cfg_accounts}/index.ts +6 -6
  43. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/AccountDeleteResponse.ts +3 -3
  44. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/CentrifugoToken.ts +4 -4
  45. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/CfgUserUpdateRequest.ts +4 -4
  46. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthAuthorizeRequestRequest.ts +2 -2
  47. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthAuthorizeResponse.ts +2 -2
  48. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthCallbackRequestRequest.ts +3 -3
  49. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthConnection.ts +6 -6
  50. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthDisconnectRequestRequest.ts +2 -2
  51. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthError.ts +2 -2
  52. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthProvidersResponse.ts +3 -3
  53. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OAuthTokenResponse.ts +7 -7
  54. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPErrorResponse.ts +2 -2
  55. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPRequestRequest.ts +2 -2
  56. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPRequestResponse.ts +2 -2
  57. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPVerifyRequest.ts +2 -2
  58. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/OTPVerifyResponse.ts +6 -6
  59. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/PatchedCfgUserUpdateRequest.ts +4 -4
  60. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/ProviderEnum.ts +2 -2
  61. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/TokenRefresh.ts +2 -2
  62. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/TokenRefreshRequest.ts +2 -2
  63. package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/User.ts +13 -13
  64. package/src/_api/generated/_cfg_accounts/sdk.gen.ts +5 -0
  65. package/src/_api/generated/_cfg_accounts/types.gen.ts +5 -0
  66. package/src/_api/generated/_cfg_centrifugo/api.ts +67 -0
  67. package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/events.ts +3 -3
  68. package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/hooks/index.ts +1 -1
  69. package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +5 -6
  70. package/src/_api/generated/{cfg_accounts → _cfg_centrifugo}/index.ts +6 -6
  71. package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/schemas/ConnectionTokenResponse.ts +4 -4
  72. package/src/_api/generated/_cfg_centrifugo/sdk.gen.ts +5 -0
  73. package/src/_api/generated/_cfg_centrifugo/types.gen.ts +5 -0
  74. package/src/_api/generated/_cfg_totp/api.ts +67 -0
  75. package/src/_api/generated/{cfg_accounts → _cfg_totp}/events.ts +3 -3
  76. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/index.ts +1 -1
  77. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +3 -3
  78. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpBackupCodesRetrieve.ts +5 -6
  79. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDevicesDestroy.ts +3 -3
  80. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDevicesRetrieve.ts +5 -6
  81. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpDisableCreate.ts +3 -3
  82. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpSetupConfirmCreate.ts +3 -3
  83. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpSetupCreate.ts +3 -3
  84. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpVerifyBackupCreate.ts +3 -3
  85. package/src/_api/generated/{cfg_totp → _cfg_totp}/hooks/useCfgTotpVerifyCreate.ts +3 -3
  86. package/src/_api/generated/{cfg_totp → _cfg_totp}/index.ts +6 -6
  87. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesRegenerateRequest.ts +2 -2
  88. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesRegenerateResponse.ts +2 -2
  89. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/BackupCodesStatus.ts +2 -2
  90. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/ConfirmSetupRequest.ts +3 -3
  91. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/ConfirmSetupResponse.ts +3 -3
  92. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceList.ts +6 -6
  93. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceListResponse.ts +2 -2
  94. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DeviceListStatusEnum.ts +2 -2
  95. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/DisableRequest.ts +2 -2
  96. package/src/_api/generated/_cfg_totp/schemas/SetupRequest.ts +11 -0
  97. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/SetupResponse.ts +4 -4
  98. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/TotpVerifyUser.ts +12 -12
  99. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyBackupRequest.ts +3 -3
  100. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyRequest.ts +3 -3
  101. package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/VerifyResponse.ts +4 -4
  102. package/src/_api/generated/_cfg_totp/sdk.gen.ts +5 -0
  103. package/src/_api/generated/_cfg_totp/types.gen.ts +5 -0
  104. package/src/_api/generated/{cfg_centrifugo/client.gen.ts → client.gen.ts} +3 -0
  105. package/src/_api/generated/helpers/auth.ts +223 -0
  106. package/src/_api/generated/{_shared → helpers}/index.ts +1 -0
  107. package/src/_api/generated/index.ts +22 -20
  108. package/src/_api/generated/{cfg_accounts/sdk.gen.ts → sdk.gen.ts} +455 -1
  109. package/src/_api/generated/{cfg_accounts/types.gen.ts → types.gen.ts} +607 -77
  110. package/src/auth/context/AccountsContext.tsx +10 -10
  111. package/src/auth/context/AuthContext.tsx +1 -1
  112. package/src/auth/hooks/useDeleteAccount.ts +2 -1
  113. package/src/auth/hooks/useGithubAuth.ts +3 -2
  114. package/src/auth/hooks/useTokenRefresh.ts +2 -1
  115. package/src/auth/hooks/useTwoFactor.ts +4 -3
  116. package/src/auth/hooks/useTwoFactorSetup.ts +3 -2
  117. package/src/auth/hooks/useTwoFactorStatus.ts +4 -3
  118. package/src/auth/middlewares/tokenRefresh.ts +2 -1
  119. package/src/clients.ts +3 -3
  120. package/src/index.ts +22 -5
  121. package/src/server.ts +9 -9
  122. package/src/_api/generated/cfg_accounts/api.ts +0 -187
  123. package/src/_api/generated/cfg_accounts/client.gen.ts +0 -16
  124. package/src/_api/generated/cfg_centrifugo/api.ts +0 -164
  125. package/src/_api/generated/cfg_centrifugo/client/client.gen.ts +0 -280
  126. package/src/_api/generated/cfg_centrifugo/client/index.ts +0 -25
  127. package/src/_api/generated/cfg_centrifugo/client/types.gen.ts +0 -217
  128. package/src/_api/generated/cfg_centrifugo/client/utils.gen.ts +0 -318
  129. package/src/_api/generated/cfg_centrifugo/core/auth.gen.ts +0 -41
  130. package/src/_api/generated/cfg_centrifugo/core/bodySerializer.gen.ts +0 -82
  131. package/src/_api/generated/cfg_centrifugo/core/params.gen.ts +0 -169
  132. package/src/_api/generated/cfg_centrifugo/core/pathSerializer.gen.ts +0 -171
  133. package/src/_api/generated/cfg_centrifugo/core/queryKeySerializer.gen.ts +0 -117
  134. package/src/_api/generated/cfg_centrifugo/core/serverSentEvents.gen.ts +0 -242
  135. package/src/_api/generated/cfg_centrifugo/core/types.gen.ts +0 -104
  136. package/src/_api/generated/cfg_centrifugo/core/utils.gen.ts +0 -140
  137. package/src/_api/generated/cfg_centrifugo/sdk.gen.ts +0 -64
  138. package/src/_api/generated/cfg_centrifugo/types.gen.ts +0 -61
  139. package/src/_api/generated/cfg_totp/api.ts +0 -181
  140. package/src/_api/generated/cfg_totp/client/client.gen.ts +0 -280
  141. package/src/_api/generated/cfg_totp/client/index.ts +0 -25
  142. package/src/_api/generated/cfg_totp/client/types.gen.ts +0 -217
  143. package/src/_api/generated/cfg_totp/client/utils.gen.ts +0 -318
  144. package/src/_api/generated/cfg_totp/client.gen.ts +0 -16
  145. package/src/_api/generated/cfg_totp/core/auth.gen.ts +0 -41
  146. package/src/_api/generated/cfg_totp/core/bodySerializer.gen.ts +0 -82
  147. package/src/_api/generated/cfg_totp/core/params.gen.ts +0 -169
  148. package/src/_api/generated/cfg_totp/core/pathSerializer.gen.ts +0 -171
  149. package/src/_api/generated/cfg_totp/core/queryKeySerializer.gen.ts +0 -117
  150. package/src/_api/generated/cfg_totp/core/serverSentEvents.gen.ts +0 -242
  151. package/src/_api/generated/cfg_totp/core/types.gen.ts +0 -104
  152. package/src/_api/generated/cfg_totp/core/utils.gen.ts +0 -140
  153. package/src/_api/generated/cfg_totp/schemas/SetupRequest.ts +0 -11
  154. package/src/_api/generated/cfg_totp/sdk.gen.ts +0 -432
  155. package/src/_api/generated/cfg_totp/types.gen.ts +0 -479
  156. /package/src/_api/generated/{cfg_accounts → _cfg_accounts}/schemas/index.ts +0 -0
  157. /package/src/_api/generated/{cfg_centrifugo → _cfg_centrifugo}/schemas/index.ts +0 -0
  158. /package/src/_api/generated/{cfg_totp → _cfg_totp}/schemas/index.ts +0 -0
  159. /package/src/_api/generated/{cfg_accounts/client → client}/client.gen.ts +0 -0
  160. /package/src/_api/generated/{cfg_accounts/client → client}/index.ts +0 -0
  161. /package/src/_api/generated/{cfg_accounts/client → client}/types.gen.ts +0 -0
  162. /package/src/_api/generated/{cfg_accounts/client → client}/utils.gen.ts +0 -0
  163. /package/src/_api/generated/{cfg_accounts/core → core}/auth.gen.ts +0 -0
  164. /package/src/_api/generated/{cfg_accounts/core → core}/bodySerializer.gen.ts +0 -0
  165. /package/src/_api/generated/{cfg_accounts/core → core}/params.gen.ts +0 -0
  166. /package/src/_api/generated/{cfg_accounts/core → core}/pathSerializer.gen.ts +0 -0
  167. /package/src/_api/generated/{cfg_accounts/core → core}/queryKeySerializer.gen.ts +0 -0
  168. /package/src/_api/generated/{cfg_accounts/core → core}/serverSentEvents.gen.ts +0 -0
  169. /package/src/_api/generated/{cfg_accounts/core → core}/types.gen.ts +0 -0
  170. /package/src/_api/generated/{cfg_accounts/core → core}/utils.gen.ts +0 -0
  171. /package/src/_api/generated/{_shared → helpers}/errors.ts +0 -0
  172. /package/src/_api/generated/{_shared → helpers}/logger.ts +0 -0
  173. /package/src/_api/generated/{_shared → helpers}/storage.ts +0 -0
  174. /package/src/_api/generated/{_shared → helpers}/validation-events.ts +0 -0
package/dist/auth.d.cts CHANGED
@@ -7,33 +7,33 @@ import { z } from 'zod';
7
7
  * Nested serializer for Centrifugo WebSocket connection token.
8
8
  */
9
9
  type CentrifugoToken = {
10
- /**
11
- * JWT token for Centrifugo WebSocket connection
12
- */
13
- token: string;
14
10
  /**
15
11
  * Centrifugo WebSocket URL
16
12
  */
17
13
  centrifugo_url: string;
14
+ /**
15
+ * List of allowed channels for this user
16
+ */
17
+ channels: Array<string>;
18
18
  /**
19
19
  * Token expiration time (ISO 8601)
20
20
  */
21
21
  expires_at: string;
22
22
  /**
23
- * List of allowed channels for this user
23
+ * JWT token for Centrifugo WebSocket connection
24
24
  */
25
- channels: Array<string>;
25
+ token: string;
26
26
  };
27
27
  /**
28
28
  * Serializer for updating user profile.
29
29
  */
30
30
  type CfgUserUpdateRequest = {
31
+ company?: string;
31
32
  first_name?: string;
33
+ language?: string;
32
34
  last_name?: string;
33
- company?: string;
34
35
  phone?: string;
35
36
  position?: string;
36
- language?: string;
37
37
  };
38
38
  /**
39
39
  * Serializer for OTP request.
@@ -86,40 +86,40 @@ type OtpVerifyRequest = {
86
86
  */
87
87
  type OtpVerifyResponse = {
88
88
  /**
89
- * Whether 2FA verification is required
90
- */
91
- requires_2fa?: boolean;
92
- /**
93
- * 2FA session ID (if requires_2fa is True)
89
+ * JWT access token (if requires_2fa is False)
94
90
  */
95
- session_id?: string | null;
91
+ access?: string | null;
96
92
  /**
97
93
  * JWT refresh token (if requires_2fa is False)
98
94
  */
99
95
  refresh?: string | null;
100
96
  /**
101
- * JWT access token (if requires_2fa is False)
97
+ * Whether 2FA verification is required
102
98
  */
103
- access?: string | null;
99
+ requires_2fa?: boolean;
104
100
  /**
105
- * User information (if requires_2fa is False)
101
+ * 2FA session ID (if requires_2fa is True)
106
102
  */
107
- user?: User | null;
103
+ session_id?: string | null;
108
104
  /**
109
105
  * Whether user should be prompted to enable 2FA
110
106
  */
111
107
  should_prompt_2fa?: boolean;
108
+ /**
109
+ * User information (if requires_2fa is False)
110
+ */
111
+ user?: User | null;
112
112
  };
113
113
  /**
114
114
  * Serializer for updating user profile.
115
115
  */
116
116
  type PatchedCfgUserUpdateRequest = {
117
+ company?: string;
117
118
  first_name?: string;
119
+ language?: string;
118
120
  last_name?: string;
119
- company?: string;
120
121
  phone?: string;
121
122
  position?: string;
122
- language?: string;
123
123
  };
124
124
  type TokenRefresh = {
125
125
  readonly access: string;
@@ -129,27 +129,25 @@ type TokenRefresh = {
129
129
  * Serializer for user details.
130
130
  */
131
131
  type User = {
132
- readonly id: number;
132
+ readonly avatar: string | null;
133
+ readonly centrifugo: CentrifugoToken | null;
134
+ company?: string;
135
+ readonly date_joined: string;
136
+ /**
137
+ * Get formatted username for display.
138
+ */
139
+ readonly display_username: string;
133
140
  readonly email: string;
134
141
  first_name?: string;
135
- last_name?: string;
136
142
  /**
137
143
  * Get user's full name.
138
144
  */
139
145
  readonly full_name: string;
146
+ readonly id: number;
140
147
  /**
141
148
  * Get user's initials for avatar fallback.
142
149
  */
143
150
  readonly initials: string;
144
- /**
145
- * Get formatted username for display.
146
- */
147
- readonly display_username: string;
148
- company?: string;
149
- phone?: string;
150
- position?: string;
151
- language?: string;
152
- readonly avatar: string | null;
153
151
  /**
154
152
  * Staff status
155
153
  *
@@ -162,10 +160,12 @@ type User = {
162
160
  * Designates that this user has all permissions without explicitly assigning them.
163
161
  */
164
162
  readonly is_superuser: boolean;
165
- readonly date_joined: string;
163
+ language?: string;
166
164
  readonly last_login: string | null;
165
+ last_name?: string;
166
+ phone?: string;
167
+ position?: string;
167
168
  readonly unanswered_messages_count: number;
168
- readonly centrifugo: CentrifugoToken | null;
169
169
  };
170
170
 
171
171
  /**
@@ -342,12 +342,12 @@ declare const AuthProvider: React$1.FC<AuthProviderProps>;
342
342
  declare const useAuth: () => AuthContextType;
343
343
 
344
344
  declare const PatchedCfgUserUpdateRequestSchema: z.ZodObject<{
345
+ company: z.ZodOptional<z.ZodString>;
345
346
  first_name: z.ZodOptional<z.ZodString>;
347
+ language: z.ZodOptional<z.ZodString>;
346
348
  last_name: z.ZodOptional<z.ZodString>;
347
- company: z.ZodOptional<z.ZodString>;
348
349
  phone: z.ZodOptional<z.ZodString>;
349
350
  position: z.ZodOptional<z.ZodString>;
350
- language: z.ZodOptional<z.ZodString>;
351
351
  }, z.core.$strip>;
352
352
 
353
353
  interface AccountsContextValue {
package/dist/auth.d.ts CHANGED
@@ -7,33 +7,33 @@ import { z } from 'zod';
7
7
  * Nested serializer for Centrifugo WebSocket connection token.
8
8
  */
9
9
  type CentrifugoToken = {
10
- /**
11
- * JWT token for Centrifugo WebSocket connection
12
- */
13
- token: string;
14
10
  /**
15
11
  * Centrifugo WebSocket URL
16
12
  */
17
13
  centrifugo_url: string;
14
+ /**
15
+ * List of allowed channels for this user
16
+ */
17
+ channels: Array<string>;
18
18
  /**
19
19
  * Token expiration time (ISO 8601)
20
20
  */
21
21
  expires_at: string;
22
22
  /**
23
- * List of allowed channels for this user
23
+ * JWT token for Centrifugo WebSocket connection
24
24
  */
25
- channels: Array<string>;
25
+ token: string;
26
26
  };
27
27
  /**
28
28
  * Serializer for updating user profile.
29
29
  */
30
30
  type CfgUserUpdateRequest = {
31
+ company?: string;
31
32
  first_name?: string;
33
+ language?: string;
32
34
  last_name?: string;
33
- company?: string;
34
35
  phone?: string;
35
36
  position?: string;
36
- language?: string;
37
37
  };
38
38
  /**
39
39
  * Serializer for OTP request.
@@ -86,40 +86,40 @@ type OtpVerifyRequest = {
86
86
  */
87
87
  type OtpVerifyResponse = {
88
88
  /**
89
- * Whether 2FA verification is required
90
- */
91
- requires_2fa?: boolean;
92
- /**
93
- * 2FA session ID (if requires_2fa is True)
89
+ * JWT access token (if requires_2fa is False)
94
90
  */
95
- session_id?: string | null;
91
+ access?: string | null;
96
92
  /**
97
93
  * JWT refresh token (if requires_2fa is False)
98
94
  */
99
95
  refresh?: string | null;
100
96
  /**
101
- * JWT access token (if requires_2fa is False)
97
+ * Whether 2FA verification is required
102
98
  */
103
- access?: string | null;
99
+ requires_2fa?: boolean;
104
100
  /**
105
- * User information (if requires_2fa is False)
101
+ * 2FA session ID (if requires_2fa is True)
106
102
  */
107
- user?: User | null;
103
+ session_id?: string | null;
108
104
  /**
109
105
  * Whether user should be prompted to enable 2FA
110
106
  */
111
107
  should_prompt_2fa?: boolean;
108
+ /**
109
+ * User information (if requires_2fa is False)
110
+ */
111
+ user?: User | null;
112
112
  };
113
113
  /**
114
114
  * Serializer for updating user profile.
115
115
  */
116
116
  type PatchedCfgUserUpdateRequest = {
117
+ company?: string;
117
118
  first_name?: string;
119
+ language?: string;
118
120
  last_name?: string;
119
- company?: string;
120
121
  phone?: string;
121
122
  position?: string;
122
- language?: string;
123
123
  };
124
124
  type TokenRefresh = {
125
125
  readonly access: string;
@@ -129,27 +129,25 @@ type TokenRefresh = {
129
129
  * Serializer for user details.
130
130
  */
131
131
  type User = {
132
- readonly id: number;
132
+ readonly avatar: string | null;
133
+ readonly centrifugo: CentrifugoToken | null;
134
+ company?: string;
135
+ readonly date_joined: string;
136
+ /**
137
+ * Get formatted username for display.
138
+ */
139
+ readonly display_username: string;
133
140
  readonly email: string;
134
141
  first_name?: string;
135
- last_name?: string;
136
142
  /**
137
143
  * Get user's full name.
138
144
  */
139
145
  readonly full_name: string;
146
+ readonly id: number;
140
147
  /**
141
148
  * Get user's initials for avatar fallback.
142
149
  */
143
150
  readonly initials: string;
144
- /**
145
- * Get formatted username for display.
146
- */
147
- readonly display_username: string;
148
- company?: string;
149
- phone?: string;
150
- position?: string;
151
- language?: string;
152
- readonly avatar: string | null;
153
151
  /**
154
152
  * Staff status
155
153
  *
@@ -162,10 +160,12 @@ type User = {
162
160
  * Designates that this user has all permissions without explicitly assigning them.
163
161
  */
164
162
  readonly is_superuser: boolean;
165
- readonly date_joined: string;
163
+ language?: string;
166
164
  readonly last_login: string | null;
165
+ last_name?: string;
166
+ phone?: string;
167
+ position?: string;
167
168
  readonly unanswered_messages_count: number;
168
- readonly centrifugo: CentrifugoToken | null;
169
169
  };
170
170
 
171
171
  /**
@@ -342,12 +342,12 @@ declare const AuthProvider: React$1.FC<AuthProviderProps>;
342
342
  declare const useAuth: () => AuthContextType;
343
343
 
344
344
  declare const PatchedCfgUserUpdateRequestSchema: z.ZodObject<{
345
+ company: z.ZodOptional<z.ZodString>;
345
346
  first_name: z.ZodOptional<z.ZodString>;
347
+ language: z.ZodOptional<z.ZodString>;
346
348
  last_name: z.ZodOptional<z.ZodString>;
347
- company: z.ZodOptional<z.ZodString>;
348
349
  phone: z.ZodOptional<z.ZodString>;
349
350
  position: z.ZodOptional<z.ZodString>;
350
- language: z.ZodOptional<z.ZodString>;
351
351
  }, z.core.$strip>;
352
352
 
353
353
  interface AccountsContextValue {