@djangocfg/api 2.1.322 → 2.1.331

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 (272) hide show
  1. package/dist/auth-server.cjs +1037 -1227
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.mjs +1037 -1217
  4. package/dist/auth-server.mjs.map +1 -1
  5. package/dist/auth.cjs +2142 -3398
  6. package/dist/auth.cjs.map +1 -1
  7. package/dist/auth.d.cts +158 -209
  8. package/dist/auth.d.ts +158 -209
  9. package/dist/auth.mjs +2136 -3392
  10. package/dist/auth.mjs.map +1 -1
  11. package/dist/clients.cjs +1018 -4423
  12. package/dist/clients.cjs.map +1 -1
  13. package/dist/clients.d.cts +151 -2918
  14. package/dist/clients.d.ts +151 -2918
  15. package/dist/clients.mjs +1018 -4417
  16. package/dist/clients.mjs.map +1 -1
  17. package/dist/index.cjs +2253 -2819
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +2408 -1872
  20. package/dist/index.d.ts +2408 -1872
  21. package/dist/index.mjs +2235 -2795
  22. package/dist/index.mjs.map +1 -1
  23. package/package.json +2 -7
  24. package/src/_api/generated/_cfg_accounts/api.ts +120 -0
  25. package/src/_api/generated/_cfg_accounts/events.ts +198 -0
  26. package/src/_api/generated/_cfg_accounts/hooks/index.ts +18 -0
  27. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthConnectionsList.ts +25 -0
  28. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthDisconnectCreate.ts +24 -0
  29. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +24 -0
  30. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +24 -0
  31. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOauthProvidersRetrieve.ts +25 -0
  32. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpRequestCreate.ts +24 -0
  33. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsOtpVerifyCreate.ts +24 -0
  34. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileAvatarCreate.ts +24 -0
  35. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileDeleteCreate.ts +24 -0
  36. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +24 -0
  37. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfilePartialUpdate.ts +24 -0
  38. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileRetrieve.ts +25 -0
  39. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +24 -0
  40. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsProfileUpdateUpdate.ts +24 -0
  41. package/src/_api/generated/_cfg_accounts/hooks/useCfgAccountsTokenRefreshCreate.ts +24 -0
  42. package/src/_api/generated/_cfg_accounts/index.ts +29 -0
  43. package/src/_api/generated/_cfg_accounts/schemas/AccountDeleteResponse.ts +12 -0
  44. package/src/_api/generated/_cfg_accounts/schemas/CentrifugoToken.ts +14 -0
  45. package/src/_api/generated/_cfg_accounts/schemas/CfgUserUpdateRequest.ts +16 -0
  46. package/src/_api/generated/_cfg_accounts/schemas/OAuthAuthorizeRequestRequest.ts +12 -0
  47. package/src/_api/generated/_cfg_accounts/schemas/OAuthAuthorizeResponse.ts +12 -0
  48. package/src/_api/generated/_cfg_accounts/schemas/OAuthCallbackRequestRequest.ts +13 -0
  49. package/src/_api/generated/_cfg_accounts/schemas/OAuthConnection.ts +19 -0
  50. package/src/_api/generated/_cfg_accounts/schemas/OAuthDisconnectRequestRequest.ts +12 -0
  51. package/src/_api/generated/_cfg_accounts/schemas/OAuthError.ts +12 -0
  52. package/src/_api/generated/_cfg_accounts/schemas/OAuthProvidersResponse.ts +11 -0
  53. package/src/_api/generated/_cfg_accounts/schemas/OAuthTokenResponse.ts +18 -0
  54. package/src/_api/generated/_cfg_accounts/schemas/OTPErrorResponse.ts +13 -0
  55. package/src/_api/generated/_cfg_accounts/schemas/OTPRequestRequest.ts +12 -0
  56. package/src/_api/generated/_cfg_accounts/schemas/OTPRequestResponse.ts +11 -0
  57. package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyRequest.ts +13 -0
  58. package/src/_api/generated/_cfg_accounts/schemas/OTPVerifyResponse.ts +17 -0
  59. package/src/_api/generated/_cfg_accounts/schemas/PatchedCfgUserUpdateRequest.ts +16 -0
  60. package/src/_api/generated/_cfg_accounts/schemas/ProviderEnum.ts +9 -0
  61. package/src/_api/generated/_cfg_accounts/schemas/TokenRefresh.ts +12 -0
  62. package/src/_api/generated/_cfg_accounts/schemas/TokenRefreshRequest.ts +11 -0
  63. package/src/_api/generated/{cfg_accounts/_utils/schemas/User.schema.ts → _cfg_accounts/schemas/User.ts} +19 -27
  64. package/src/_api/generated/_cfg_accounts/schemas/index.ts +24 -0
  65. package/src/_api/generated/_cfg_accounts/sdk.gen.ts +5 -0
  66. package/src/_api/generated/_cfg_accounts/types.gen.ts +5 -0
  67. package/src/_api/generated/_cfg_centrifugo/api.ts +120 -0
  68. package/src/_api/generated/_cfg_centrifugo/events.ts +198 -0
  69. package/src/_api/generated/_cfg_centrifugo/hooks/index.ts +4 -0
  70. package/src/_api/generated/_cfg_centrifugo/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +25 -0
  71. package/src/_api/generated/_cfg_centrifugo/index.ts +29 -0
  72. package/src/_api/generated/_cfg_centrifugo/schemas/ConnectionTokenResponse.ts +14 -0
  73. package/src/_api/generated/_cfg_centrifugo/schemas/index.ts +4 -0
  74. package/src/_api/generated/_cfg_centrifugo/sdk.gen.ts +5 -0
  75. package/src/_api/generated/_cfg_centrifugo/types.gen.ts +5 -0
  76. package/src/_api/generated/_cfg_totp/api.ts +120 -0
  77. package/src/_api/generated/_cfg_totp/events.ts +198 -0
  78. package/src/_api/generated/_cfg_totp/hooks/index.ts +12 -0
  79. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +24 -0
  80. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpBackupCodesRetrieve.ts +25 -0
  81. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesDestroy.ts +24 -0
  82. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +25 -0
  83. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpDisableCreate.ts +24 -0
  84. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupConfirmCreate.ts +24 -0
  85. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpSetupCreate.ts +24 -0
  86. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyBackupCreate.ts +24 -0
  87. package/src/_api/generated/_cfg_totp/hooks/useCfgTotpVerifyCreate.ts +24 -0
  88. package/src/_api/generated/_cfg_totp/index.ts +29 -0
  89. package/src/_api/generated/_cfg_totp/schemas/BackupCodesRegenerateRequest.ts +11 -0
  90. package/src/_api/generated/_cfg_totp/schemas/BackupCodesRegenerateResponse.ts +12 -0
  91. package/src/_api/generated/_cfg_totp/schemas/BackupCodesStatus.ts +13 -0
  92. package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupRequest.ts +12 -0
  93. package/src/_api/generated/_cfg_totp/schemas/ConfirmSetupResponse.ts +13 -0
  94. package/src/_api/generated/_cfg_totp/schemas/DeviceList.ts +18 -0
  95. package/src/_api/generated/_cfg_totp/schemas/DeviceListResponse.ts +13 -0
  96. package/src/_api/generated/_cfg_totp/schemas/DeviceListStatusEnum.ts +9 -0
  97. package/src/_api/generated/_cfg_totp/schemas/DisableRequest.ts +11 -0
  98. package/src/_api/generated/_cfg_totp/schemas/SetupRequest.ts +11 -0
  99. package/src/_api/generated/_cfg_totp/schemas/SetupResponse.ts +15 -0
  100. package/src/_api/generated/{cfg_totp/_utils/schemas/TotpVerifyUser.schema.ts → _cfg_totp/schemas/TotpVerifyUser.ts} +17 -25
  101. package/src/_api/generated/_cfg_totp/schemas/VerifyBackupRequest.ts +12 -0
  102. package/src/_api/generated/_cfg_totp/schemas/VerifyRequest.ts +12 -0
  103. package/src/_api/generated/_cfg_totp/schemas/VerifyResponse.ts +17 -0
  104. package/src/_api/generated/_cfg_totp/schemas/index.ts +18 -0
  105. package/src/_api/generated/_cfg_totp/sdk.gen.ts +5 -0
  106. package/src/_api/generated/_cfg_totp/types.gen.ts +5 -0
  107. package/src/_api/generated/client/client.gen.ts +280 -0
  108. package/src/_api/generated/client/index.ts +25 -0
  109. package/src/_api/generated/client/types.gen.ts +217 -0
  110. package/src/_api/generated/client/utils.gen.ts +318 -0
  111. package/src/_api/generated/client.gen.ts +16 -0
  112. package/src/_api/generated/core/auth.gen.ts +41 -0
  113. package/src/_api/generated/core/bodySerializer.gen.ts +82 -0
  114. package/src/_api/generated/core/params.gen.ts +169 -0
  115. package/src/_api/generated/core/pathSerializer.gen.ts +171 -0
  116. package/src/_api/generated/core/queryKeySerializer.gen.ts +117 -0
  117. package/src/_api/generated/core/serverSentEvents.gen.ts +242 -0
  118. package/src/_api/generated/core/types.gen.ts +104 -0
  119. package/src/_api/generated/core/utils.gen.ts +140 -0
  120. package/src/_api/generated/helpers/errors.ts +70 -0
  121. package/src/_api/generated/helpers/index.ts +25 -0
  122. package/src/_api/generated/helpers/logger.ts +123 -0
  123. package/src/_api/generated/helpers/storage.ts +83 -0
  124. package/src/_api/generated/helpers/validation-events.ts +52 -0
  125. package/src/_api/generated/index.ts +28 -0
  126. package/src/_api/generated/sdk.gen.ts +1250 -0
  127. package/src/_api/generated/types.gen.ts +1294 -0
  128. package/src/_api/index.ts +5 -23
  129. package/src/auth/context/AccountsContext.tsx +58 -89
  130. package/src/auth/context/AuthContext.tsx +3 -3
  131. package/src/auth/context/index.ts +2 -2
  132. package/src/auth/hooks/useDeleteAccount.ts +3 -1
  133. package/src/auth/hooks/useGithubAuth.ts +13 -11
  134. package/src/auth/hooks/useTokenRefresh.ts +7 -4
  135. package/src/auth/hooks/useTwoFactor.ts +15 -8
  136. package/src/auth/hooks/useTwoFactorSetup.ts +9 -5
  137. package/src/auth/hooks/useTwoFactorStatus.ts +5 -3
  138. package/src/auth/middlewares/tokenRefresh.ts +7 -4
  139. package/src/clients.ts +14 -51
  140. package/src/index.ts +35 -60
  141. package/src/server.ts +25 -23
  142. package/src/_api/BaseClient.ts +0 -22
  143. package/src/_api/generated/cfg_accounts/CLAUDE.md +0 -86
  144. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts.ts +0 -154
  145. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts +0 -95
  146. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts +0 -285
  147. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +0 -440
  148. package/src/_api/generated/cfg_accounts/_utils/fetchers/index.ts +0 -33
  149. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts.ts +0 -64
  150. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__auth.ts +0 -44
  151. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts +0 -114
  152. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +0 -152
  153. package/src/_api/generated/cfg_accounts/_utils/hooks/index.ts +0 -33
  154. package/src/_api/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts +0 -20
  155. package/src/_api/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts +0 -22
  156. package/src/_api/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts +0 -15
  157. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts +0 -20
  158. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts +0 -20
  159. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts +0 -21
  160. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts +0 -27
  161. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts +0 -20
  162. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts +0 -20
  163. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts +0 -19
  164. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts +0 -46
  165. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts +0 -41
  166. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts +0 -20
  167. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts +0 -19
  168. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts +0 -21
  169. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts +0 -45
  170. package/src/_api/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts +0 -24
  171. package/src/_api/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts +0 -16
  172. package/src/_api/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts +0 -15
  173. package/src/_api/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts +0 -24
  174. package/src/_api/generated/cfg_accounts/_utils/schemas/index.ts +0 -41
  175. package/src/_api/generated/cfg_accounts/accounts/client.ts +0 -34
  176. package/src/_api/generated/cfg_accounts/accounts/index.ts +0 -4
  177. package/src/_api/generated/cfg_accounts/accounts/models.ts +0 -127
  178. package/src/_api/generated/cfg_accounts/accounts__auth/client.ts +0 -23
  179. package/src/_api/generated/cfg_accounts/accounts__auth/index.ts +0 -4
  180. package/src/_api/generated/cfg_accounts/accounts__auth/models.ts +0 -19
  181. package/src/_api/generated/cfg_accounts/accounts__oauth/client.ts +0 -67
  182. package/src/_api/generated/cfg_accounts/accounts__oauth/index.ts +0 -4
  183. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +0 -127
  184. package/src/_api/generated/cfg_accounts/accounts__user_profile/client.ts +0 -94
  185. package/src/_api/generated/cfg_accounts/accounts__user_profile/index.ts +0 -4
  186. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +0 -98
  187. package/src/_api/generated/cfg_accounts/api-instance.ts +0 -181
  188. package/src/_api/generated/cfg_accounts/client.ts +0 -339
  189. package/src/_api/generated/cfg_accounts/enums.ts +0 -10
  190. package/src/_api/generated/cfg_accounts/errors.ts +0 -123
  191. package/src/_api/generated/cfg_accounts/http.ts +0 -160
  192. package/src/_api/generated/cfg_accounts/index.ts +0 -338
  193. package/src/_api/generated/cfg_accounts/logger.ts +0 -261
  194. package/src/_api/generated/cfg_accounts/retry.ts +0 -177
  195. package/src/_api/generated/cfg_accounts/schema.json +0 -1576
  196. package/src/_api/generated/cfg_accounts/storage.ts +0 -163
  197. package/src/_api/generated/cfg_accounts/validation-events.ts +0 -135
  198. package/src/_api/generated/cfg_centrifugo/CLAUDE.md +0 -60
  199. package/src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts +0 -94
  200. package/src/_api/generated/cfg_centrifugo/_utils/fetchers/index.ts +0 -30
  201. package/src/_api/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_auth.ts +0 -39
  202. package/src/_api/generated/cfg_centrifugo/_utils/hooks/index.ts +0 -30
  203. package/src/_api/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts +0 -22
  204. package/src/_api/generated/cfg_centrifugo/_utils/schemas/index.ts +0 -21
  205. package/src/_api/generated/cfg_centrifugo/api-instance.ts +0 -181
  206. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/client.ts +0 -27
  207. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/index.ts +0 -4
  208. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/models.ts +0 -18
  209. package/src/_api/generated/cfg_centrifugo/client.ts +0 -330
  210. package/src/_api/generated/cfg_centrifugo/errors.ts +0 -123
  211. package/src/_api/generated/cfg_centrifugo/http.ts +0 -160
  212. package/src/_api/generated/cfg_centrifugo/index.ts +0 -316
  213. package/src/_api/generated/cfg_centrifugo/logger.ts +0 -261
  214. package/src/_api/generated/cfg_centrifugo/retry.ts +0 -177
  215. package/src/_api/generated/cfg_centrifugo/schema.json +0 -118
  216. package/src/_api/generated/cfg_centrifugo/storage.ts +0 -163
  217. package/src/_api/generated/cfg_centrifugo/validation-events.ts +0 -135
  218. package/src/_api/generated/cfg_totp/CLAUDE.md +0 -83
  219. package/src/_api/generated/cfg_totp/_utils/fetchers/index.ts +0 -34
  220. package/src/_api/generated/cfg_totp/_utils/fetchers/totp.ts +0 -50
  221. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__backup_codes.ts +0 -153
  222. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +0 -109
  223. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_setup.ts +0 -154
  224. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_verification.ts +0 -153
  225. package/src/_api/generated/cfg_totp/_utils/hooks/index.ts +0 -34
  226. package/src/_api/generated/cfg_totp/_utils/hooks/totp.ts +0 -43
  227. package/src/_api/generated/cfg_totp/_utils/hooks/totp__backup_codes.ts +0 -60
  228. package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +0 -59
  229. package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_setup.ts +0 -64
  230. package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_verification.ts +0 -63
  231. package/src/_api/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateRequest.schema.ts +0 -19
  232. package/src/_api/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateResponse.schema.ts +0 -20
  233. package/src/_api/generated/cfg_totp/_utils/schemas/BackupCodesStatus.schema.ts +0 -21
  234. package/src/_api/generated/cfg_totp/_utils/schemas/ConfirmSetupRequest.schema.ts +0 -20
  235. package/src/_api/generated/cfg_totp/_utils/schemas/ConfirmSetupResponse.schema.ts +0 -21
  236. package/src/_api/generated/cfg_totp/_utils/schemas/DeviceList.schema.ts +0 -26
  237. package/src/_api/generated/cfg_totp/_utils/schemas/DeviceListResponse.schema.ts +0 -21
  238. package/src/_api/generated/cfg_totp/_utils/schemas/DisableRequest.schema.ts +0 -19
  239. package/src/_api/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts +0 -19
  240. package/src/_api/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts +0 -23
  241. package/src/_api/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts +0 -20
  242. package/src/_api/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts +0 -20
  243. package/src/_api/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts +0 -25
  244. package/src/_api/generated/cfg_totp/_utils/schemas/index.ts +0 -34
  245. package/src/_api/generated/cfg_totp/api-instance.ts +0 -181
  246. package/src/_api/generated/cfg_totp/client.ts +0 -342
  247. package/src/_api/generated/cfg_totp/enums.ts +0 -13
  248. package/src/_api/generated/cfg_totp/errors.ts +0 -123
  249. package/src/_api/generated/cfg_totp/http.ts +0 -160
  250. package/src/_api/generated/cfg_totp/index.ts +0 -345
  251. package/src/_api/generated/cfg_totp/logger.ts +0 -261
  252. package/src/_api/generated/cfg_totp/retry.ts +0 -177
  253. package/src/_api/generated/cfg_totp/schema.json +0 -910
  254. package/src/_api/generated/cfg_totp/storage.ts +0 -163
  255. package/src/_api/generated/cfg_totp/totp/client.ts +0 -24
  256. package/src/_api/generated/cfg_totp/totp/index.ts +0 -4
  257. package/src/_api/generated/cfg_totp/totp/models.ts +0 -4
  258. package/src/_api/generated/cfg_totp/totp__backup_codes/client.ts +0 -32
  259. package/src/_api/generated/cfg_totp/totp__backup_codes/index.ts +0 -4
  260. package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +0 -38
  261. package/src/_api/generated/cfg_totp/totp__totp_management/client.ts +0 -31
  262. package/src/_api/generated/cfg_totp/totp__totp_management/index.ts +0 -4
  263. package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +0 -46
  264. package/src/_api/generated/cfg_totp/totp__totp_setup/client.ts +0 -33
  265. package/src/_api/generated/cfg_totp/totp__totp_setup/index.ts +0 -4
  266. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +0 -55
  267. package/src/_api/generated/cfg_totp/totp__totp_verification/client.ts +0 -33
  268. package/src/_api/generated/cfg_totp/totp__totp_verification/index.ts +0 -4
  269. package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +0 -74
  270. package/src/_api/generated/cfg_totp/validation-events.ts +0 -135
  271. package/src/hooks/accounts.ts +0 -8
  272. package/src/hooks/index.ts +0 -10
@@ -1,41 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- /**
4
- * Zod Schemas - Runtime validation and type inference
5
- *
6
- * Auto-generated from OpenAPI specification.
7
- * Provides runtime validation for API requests and responses.
8
- *
9
- * Usage:
10
- * ```typescript
11
- * import { UserSchema } from './schemas'
12
- *
13
- * // Validate data
14
- * const user = UserSchema.parse(data)
15
- *
16
- * // Type inference
17
- * type User = z.infer<typeof UserSchema>
18
- * ```
19
- */
20
-
21
- export * from './AccountDeleteResponse.schema'
22
- export * from './CentrifugoToken.schema'
23
- export * from './CfgAccountsProfileAvatarCreateRequest.schema'
24
- export * from './OAuthAuthorizeRequestRequest.schema'
25
- export * from './OAuthAuthorizeResponse.schema'
26
- export * from './OAuthCallbackRequestRequest.schema'
27
- export * from './OAuthConnection.schema'
28
- export * from './OAuthDisconnectRequestRequest.schema'
29
- export * from './OAuthError.schema'
30
- export * from './OAuthProvidersResponse.schema'
31
- export * from './OAuthTokenResponse.schema'
32
- export * from './OTPErrorResponse.schema'
33
- export * from './OTPRequestRequest.schema'
34
- export * from './OTPRequestResponse.schema'
35
- export * from './OTPVerifyRequest.schema'
36
- export * from './OTPVerifyResponse.schema'
37
- export * from './PatchedUserProfileUpdateRequest.schema'
38
- export * from './TokenRefresh.schema'
39
- export * from './TokenRefreshRequest.schema'
40
- export * from './User.schema'
41
- export * from './UserProfileUpdateRequest.schema'
@@ -1,34 +0,0 @@
1
- // @ts-nocheck
2
- import * as Models from "./models";
3
-
4
-
5
- /**
6
- * API endpoints for Accounts.
7
- */
8
- export class Accounts {
9
- private client: any;
10
-
11
- constructor(client: any) {
12
- this.client = client;
13
- }
14
-
15
- /**
16
- * Request OTP code to email.
17
- */
18
- async otpRequestCreate(data: Models.OTPRequestRequest): Promise<Models.OTPRequestResponse> {
19
- const response = await this.client.request('POST', "/cfg/accounts/otp/request/", { body: data });
20
- return response;
21
- }
22
-
23
- /**
24
- * Verify OTP code and return JWT tokens or 2FA session. If user has 2FA
25
- * enabled: - Returns requires_2fa=True with session_id - Client must
26
- * complete 2FA verification at /cfg/totp/verify/ If user has no 2FA: -
27
- * Returns JWT tokens and user data directly
28
- */
29
- async otpVerifyCreate(data: Models.OTPVerifyRequest): Promise<Models.OTPVerifyResponse> {
30
- const response = await this.client.request('POST', "/cfg/accounts/otp/verify/", { body: data });
31
- return response;
32
- }
33
-
34
- }
@@ -1,4 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- export * from "./client";
4
- export * as Models from "./models";
@@ -1,127 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- /**
4
- * OTP verification response. When 2FA is required: - requires_2fa: True -
5
- * session_id: UUID of 2FA verification session - refresh/access/user: null
6
- * When 2FA is not required: - requires_2fa: False - session_id: null -
7
- * refresh/access/user: populated
8
- *
9
- * Response model (includes read-only fields).
10
- */
11
- export interface OTPVerifyResponse {
12
- /** Whether 2FA verification is required */
13
- requires_2fa?: boolean;
14
- /** 2FA session ID (if requires_2fa is True) */
15
- session_id?: string | null;
16
- /** JWT refresh token (if requires_2fa is False) */
17
- refresh?: string | null;
18
- /** JWT access token (if requires_2fa is False) */
19
- access?: string | null;
20
- user?: User | null;
21
- /** Whether user should be prompted to enable 2FA */
22
- should_prompt_2fa?: boolean;
23
- }
24
-
25
- /**
26
- * OTP request response.
27
- *
28
- * Response model (includes read-only fields).
29
- */
30
- export interface OTPRequestResponse {
31
- /** Success message */
32
- message: string;
33
- }
34
-
35
- /**
36
- * Typed error response for OTP operations. error_code values: -
37
- * invalid_identifier — malformed email - cooldown — too soon after last
38
- * request (retry_after = seconds) - hourly_limit — hourly quota exceeded
39
- * (retry_after = seconds until reset) - daily_limit — daily quota exceeded
40
- * (retry_after = seconds until reset) - rate_limited — IP-level rate limit hit
41
- * (no retry_after) - user_creation_failed — internal error creating account -
42
- * send_failed — transport error (email / SMS) - internal_error — unexpected
43
- * server error
44
- *
45
- * Response model (includes read-only fields).
46
- */
47
- export interface OTPErrorResponse {
48
- /** Human-readable error message */
49
- error: string;
50
- /** Machine-readable error code */
51
- error_code?: string | null;
52
- /** Seconds until the client may retry (present only for rate-limit errors) */
53
- retry_after?: number | null;
54
- }
55
-
56
- /**
57
- * Serializer for OTP verification.
58
- *
59
- * Request model (no read-only fields).
60
- */
61
- export interface OTPVerifyRequest {
62
- /** Email address used for OTP request */
63
- identifier: string;
64
- otp: string;
65
- /** Source URL for tracking login (e.g., https://my.djangocfg.com) */
66
- source_url?: string;
67
- }
68
-
69
- /**
70
- * Serializer for OTP request.
71
- *
72
- * Request model (no read-only fields).
73
- */
74
- export interface OTPRequestRequest {
75
- /** Email address for OTP delivery */
76
- identifier: string;
77
- /** Source URL for tracking registration (e.g., https://my.djangocfg.com) */
78
- source_url?: string;
79
- }
80
-
81
- /**
82
- * Serializer for user details.
83
- *
84
- * Response model (includes read-only fields).
85
- */
86
- export interface User {
87
- id: number;
88
- email: string;
89
- first_name?: string;
90
- last_name?: string;
91
- /** Get user's full name. */
92
- full_name: string;
93
- /** Get user's initials for avatar fallback. */
94
- initials: string;
95
- /** Get formatted username for display. */
96
- display_username: string;
97
- company?: string;
98
- phone?: string;
99
- position?: string;
100
- language?: string;
101
- avatar?: string | null;
102
- /** Designates whether the user can log into this admin site. */
103
- is_staff: boolean;
104
- /** Designates that this user has all permissions without explicitly assigning them. */
105
- is_superuser: boolean;
106
- date_joined: string;
107
- last_login?: string | null;
108
- unanswered_messages_count: number;
109
- centrifugo: CentrifugoToken | null;
110
- }
111
-
112
- /**
113
- * Nested serializer for Centrifugo WebSocket connection token.
114
- *
115
- * Response model (includes read-only fields).
116
- */
117
- export interface CentrifugoToken {
118
- /** JWT token for Centrifugo WebSocket connection */
119
- token: string;
120
- /** Centrifugo WebSocket URL */
121
- centrifugo_url: string;
122
- /** Token expiration time (ISO 8601) */
123
- expires_at: string;
124
- /** List of allowed channels for this user */
125
- channels: Array<string>;
126
- }
127
-
@@ -1,23 +0,0 @@
1
- // @ts-nocheck
2
- import * as Models from "./models";
3
-
4
-
5
- /**
6
- * API endpoints for Auth.
7
- */
8
- export class Auth {
9
- private client: any;
10
-
11
- constructor(client: any) {
12
- this.client = client;
13
- }
14
-
15
- /**
16
- * Refresh JWT token.
17
- */
18
- async accountsTokenRefreshCreate(data: Models.TokenRefreshRequest): Promise<Models.TokenRefresh> {
19
- const response = await this.client.request('POST', "/cfg/accounts/token/refresh/", { body: data });
20
- return response;
21
- }
22
-
23
- }
@@ -1,4 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- export * from "./client";
4
- export * as Models from "./models";
@@ -1,19 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- /**
4
- *
5
- * Request model (no read-only fields).
6
- */
7
- export interface TokenRefreshRequest {
8
- refresh: string;
9
- }
10
-
11
- /**
12
- *
13
- * Response model (includes read-only fields).
14
- */
15
- export interface TokenRefresh {
16
- access: string;
17
- refresh: string;
18
- }
19
-
@@ -1,67 +0,0 @@
1
- // @ts-nocheck
2
- import * as Models from "./models";
3
-
4
-
5
- /**
6
- * API endpoints for Oauth.
7
- */
8
- export class Oauth {
9
- private client: any;
10
-
11
- constructor(client: any) {
12
- this.client = client;
13
- }
14
-
15
- /**
16
- * List OAuth connections
17
- *
18
- * Get all OAuth connections for the current user.
19
- */
20
- async accountsOauthConnectionsList(): Promise<Models.OAuthConnection[]> {
21
- const response = await this.client.request('GET', "/cfg/accounts/oauth/connections/");
22
- return (response as any).results || response;
23
- }
24
-
25
- /**
26
- * Disconnect OAuth provider
27
- *
28
- * Remove OAuth connection for the specified provider.
29
- */
30
- async accountsOauthDisconnectCreate(data: Models.OAuthDisconnectRequestRequest): Promise<any> {
31
- const response = await this.client.request('POST', "/cfg/accounts/oauth/disconnect/", { body: data });
32
- return response;
33
- }
34
-
35
- /**
36
- * Start GitHub OAuth
37
- *
38
- * Generate GitHub OAuth authorization URL. Redirect user to this URL to
39
- * start authentication.
40
- */
41
- async accountsOauthGithubAuthorizeCreate(data: Models.OAuthAuthorizeRequestRequest): Promise<Models.OAuthAuthorizeResponse> {
42
- const response = await this.client.request('POST', "/cfg/accounts/oauth/github/authorize/", { body: data });
43
- return response;
44
- }
45
-
46
- /**
47
- * Complete GitHub OAuth
48
- *
49
- * Exchange authorization code for JWT tokens. Call this after GitHub
50
- * redirects back with code.
51
- */
52
- async accountsOauthGithubCallbackCreate(data: Models.OAuthCallbackRequestRequest): Promise<Models.OAuthTokenResponse> {
53
- const response = await this.client.request('POST', "/cfg/accounts/oauth/github/callback/", { body: data });
54
- return response;
55
- }
56
-
57
- /**
58
- * List OAuth providers
59
- *
60
- * Get list of available OAuth providers for authentication.
61
- */
62
- async accountsOauthProvidersRetrieve(): Promise<Models.OAuthProvidersResponse> {
63
- const response = await this.client.request('GET', "/cfg/accounts/oauth/providers/");
64
- return response;
65
- }
66
-
67
- }
@@ -1,4 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- export * from "./client";
4
- export * as Models from "./models";
@@ -1,127 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- import * as Enums from "../enums";
4
-
5
- /**
6
- * Request to start OAuth flow.
7
- *
8
- * Request model (no read-only fields).
9
- */
10
- export interface OAuthAuthorizeRequestRequest {
11
- /** URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path */
12
- redirect_uri?: string;
13
- /** Optional source URL for registration tracking */
14
- source_url?: string;
15
- }
16
-
17
- /**
18
- * Request to complete OAuth flow (callback handler).
19
- *
20
- * Request model (no read-only fields).
21
- */
22
- export interface OAuthCallbackRequestRequest {
23
- /** Authorization code from OAuth provider callback */
24
- code: string;
25
- /** State token for CSRF verification (from authorize response) */
26
- state: string;
27
- /** Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path */
28
- redirect_uri?: string;
29
- }
30
-
31
- /**
32
- * Response with JWT tokens after OAuth authentication. When 2FA is required: -
33
- * requires_2fa: True - session_id: UUID of 2FA verification session -
34
- * access/refresh/user: null When 2FA is not required: - requires_2fa: False -
35
- * session_id: null - access/refresh/user: populated
36
- *
37
- * Response model (includes read-only fields).
38
- */
39
- export interface OAuthTokenResponse {
40
- /** True if 2FA verification is required */
41
- requires_2fa?: boolean;
42
- /** 2FA session ID (only when requires_2fa=True) */
43
- session_id?: string | null;
44
- /** JWT access token (null when requires_2fa=True) */
45
- access?: string | null;
46
- /** JWT refresh token (null when requires_2fa=True) */
47
- refresh?: string | null;
48
- /** Authenticated user info (null when requires_2fa=True) */
49
- user?: Record<string, any> | null;
50
- /** True if a new user was created during this OAuth flow */
51
- is_new_user: boolean;
52
- /** True if a new OAuth connection was created */
53
- is_new_connection: boolean;
54
- /** True if user should be prompted to enable 2FA */
55
- should_prompt_2fa?: boolean;
56
- }
57
-
58
- /**
59
- * Serializer for OAuth connection info (user-facing).
60
- *
61
- * Response model (includes read-only fields).
62
- */
63
- export interface OAuthConnection {
64
- id: number;
65
- /** OAuth provider name (github, google, etc.)
66
-
67
- * `github` - GitHub */
68
- provider: Enums.OAuthConnectionProvider;
69
- provider_display: string;
70
- /** Username on the OAuth provider platform */
71
- provider_username: string;
72
- /** Email from OAuth provider (may differ from user.email) */
73
- provider_email: string;
74
- /** Avatar URL from OAuth provider */
75
- provider_avatar_url: string;
76
- /** When this OAuth connection was created */
77
- connected_at: string;
78
- /** Last time this OAuth connection was used for login */
79
- last_login_at: string;
80
- }
81
-
82
- /**
83
- * Response with OAuth authorization URL.
84
- *
85
- * Response model (includes read-only fields).
86
- */
87
- export interface OAuthAuthorizeResponse {
88
- /** Full URL to redirect user to OAuth provider */
89
- authorization_url: string;
90
- /** State token for CSRF protection. Store this and verify on callback. */
91
- state: string;
92
- }
93
-
94
- /**
95
- * Request to disconnect OAuth provider.
96
- *
97
- * Request model (no read-only fields).
98
- */
99
- export interface OAuthDisconnectRequestRequest {
100
- /** OAuth provider to disconnect
101
-
102
- * `github` - GitHub */
103
- provider: Enums.OAuthConnectionProvider;
104
- }
105
-
106
- /**
107
- * Response with available OAuth providers.
108
- *
109
- * Response model (includes read-only fields).
110
- */
111
- export interface OAuthProvidersResponse {
112
- /** List of available OAuth providers */
113
- providers: Array<Record<string, any>>;
114
- }
115
-
116
- /**
117
- * Error response for OAuth endpoints.
118
- *
119
- * Response model (includes read-only fields).
120
- */
121
- export interface OAuthError {
122
- /** Error code */
123
- error: string;
124
- /** Human-readable error description */
125
- error_description?: string;
126
- }
127
-
@@ -1,94 +0,0 @@
1
- // @ts-nocheck
2
- import * as Models from "./models";
3
-
4
-
5
- /**
6
- * API endpoints for User Profile.
7
- */
8
- export class UserProfile {
9
- private client: any;
10
-
11
- constructor(client: any) {
12
- this.client = client;
13
- }
14
-
15
- /**
16
- * Get current user profile
17
- *
18
- * Retrieve the current authenticated user's profile information.
19
- */
20
- async accountsProfileRetrieve(): Promise<Models.User> {
21
- const response = await this.client.request('GET', "/cfg/accounts/profile/");
22
- return response;
23
- }
24
-
25
- /**
26
- * Upload user avatar
27
- *
28
- * Upload avatar image for the current authenticated user. Accepts
29
- * multipart/form-data with 'avatar' field.
30
- */
31
- async accountsProfileAvatarCreate(data: Models.CfgAccountsProfileAvatarCreateRequest): Promise<Models.User> {
32
- const formData = new FormData();
33
- formData.append('avatar', data.avatar);
34
- const response = await this.client.request('POST', "/cfg/accounts/profile/avatar/", { formData });
35
- return response;
36
- }
37
-
38
- /**
39
- * Delete user account
40
- *
41
- * Permanently delete the current user's account. This operation: -
42
- * Deactivates the account (user cannot log in) - Anonymizes personal data
43
- * (GDPR compliance) - Frees up the email address for re-registration -
44
- * Preserves audit trail The account can be restored by an administrator if
45
- * needed.
46
- */
47
- async accountsProfileDeleteCreate(): Promise<Models.AccountDeleteResponse> {
48
- const response = await this.client.request('POST', "/cfg/accounts/profile/delete/");
49
- return response;
50
- }
51
-
52
- /**
53
- * Partial update user profile
54
- *
55
- * Partially update the current authenticated user's profile information.
56
- * Supports avatar upload.
57
- */
58
- async accountsProfilePartialUpdate(data: Models.UserProfileUpdateRequest): Promise<Models.User> {
59
- const response = await this.client.request('PUT', "/cfg/accounts/profile/partial/", { body: data });
60
- return response;
61
- }
62
-
63
- /**
64
- * Partial update user profile
65
- *
66
- * Partially update the current authenticated user's profile information.
67
- * Supports avatar upload.
68
- */
69
- async accountsProfilePartialPartialUpdate(data?: Models.PatchedUserProfileUpdateRequest): Promise<Models.User> {
70
- const response = await this.client.request('PATCH', "/cfg/accounts/profile/partial/", { body: data });
71
- return response;
72
- }
73
-
74
- /**
75
- * Update user profile
76
- *
77
- * Update the current authenticated user's profile information.
78
- */
79
- async accountsProfileUpdateUpdate(data: Models.UserProfileUpdateRequest): Promise<Models.User> {
80
- const response = await this.client.request('PUT', "/cfg/accounts/profile/update/", { body: data });
81
- return response;
82
- }
83
-
84
- /**
85
- * Update user profile
86
- *
87
- * Update the current authenticated user's profile information.
88
- */
89
- async accountsProfileUpdatePartialUpdate(data?: Models.PatchedUserProfileUpdateRequest): Promise<Models.User> {
90
- const response = await this.client.request('PATCH', "/cfg/accounts/profile/update/", { body: data });
91
- return response;
92
- }
93
-
94
- }
@@ -1,4 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- export * from "./client";
4
- export * as Models from "./models";
@@ -1,98 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- /**
4
- * Serializer for updating user profile.
5
- *
6
- * Request model (no read-only fields).
7
- */
8
- export interface PatchedUserProfileUpdateRequest {
9
- first_name?: string;
10
- last_name?: string;
11
- company?: string;
12
- phone?: string;
13
- position?: string;
14
- language?: string;
15
- }
16
-
17
- /**
18
- *
19
- * Request model (no read-only fields).
20
- */
21
- export interface CfgAccountsProfileAvatarCreateRequest {
22
- /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
23
- avatar: File | Blob;
24
- }
25
-
26
- /**
27
- * Response serializer for account deletion.
28
- *
29
- * Response model (includes read-only fields).
30
- */
31
- export interface AccountDeleteResponse {
32
- /** Whether the account was successfully deleted */
33
- success: boolean;
34
- /** Human-readable message about the deletion */
35
- message: string;
36
- }
37
-
38
- /**
39
- * Serializer for user details.
40
- *
41
- * Response model (includes read-only fields).
42
- */
43
- export interface User {
44
- id: number;
45
- email: string;
46
- first_name?: string;
47
- last_name?: string;
48
- /** Get user's full name. */
49
- full_name: string;
50
- /** Get user's initials for avatar fallback. */
51
- initials: string;
52
- /** Get formatted username for display. */
53
- display_username: string;
54
- company?: string;
55
- phone?: string;
56
- position?: string;
57
- language?: string;
58
- avatar?: string | null;
59
- /** Designates whether the user can log into this admin site. */
60
- is_staff: boolean;
61
- /** Designates that this user has all permissions without explicitly assigning them. */
62
- is_superuser: boolean;
63
- date_joined: string;
64
- last_login?: string | null;
65
- unanswered_messages_count: number;
66
- centrifugo: CentrifugoToken | null;
67
- }
68
-
69
- /**
70
- * Serializer for updating user profile.
71
- *
72
- * Request model (no read-only fields).
73
- */
74
- export interface UserProfileUpdateRequest {
75
- first_name?: string;
76
- last_name?: string;
77
- company?: string;
78
- phone?: string;
79
- position?: string;
80
- language?: string;
81
- }
82
-
83
- /**
84
- * Nested serializer for Centrifugo WebSocket connection token.
85
- *
86
- * Response model (includes read-only fields).
87
- */
88
- export interface CentrifugoToken {
89
- /** JWT token for Centrifugo WebSocket connection */
90
- token: string;
91
- /** Centrifugo WebSocket URL */
92
- centrifugo_url: string;
93
- /** Token expiration time (ISO 8601) */
94
- expires_at: string;
95
- /** List of allowed channels for this user */
96
- channels: Array<string>;
97
- }
98
-