@djangocfg/api 2.1.322 → 2.1.327

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 (293) hide show
  1. package/dist/auth-server.cjs +4265 -1169
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.mjs +4265 -1159
  4. package/dist/auth-server.mjs.map +1 -1
  5. package/dist/auth.cjs +4150 -3053
  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 +4139 -3042
  10. package/dist/auth.mjs.map +1 -1
  11. package/dist/clients.cjs +3932 -4031
  12. package/dist/clients.cjs.map +1 -1
  13. package/dist/clients.d.cts +2408 -2671
  14. package/dist/clients.d.ts +2408 -2671
  15. package/dist/clients.mjs +3945 -4038
  16. package/dist/clients.mjs.map +1 -1
  17. package/dist/index.cjs +4214 -2713
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +2758 -1828
  20. package/dist/index.d.ts +2758 -1828
  21. package/dist/index.mjs +4183 -2676
  22. package/dist/index.mjs.map +1 -1
  23. package/package.json +2 -7
  24. package/src/_api/generated/_shared/errors.ts +70 -0
  25. package/src/_api/generated/_shared/index.ts +25 -0
  26. package/src/_api/generated/_shared/logger.ts +123 -0
  27. package/src/_api/generated/_shared/storage.ts +83 -0
  28. package/src/_api/generated/_shared/validation-events.ts +52 -0
  29. package/src/_api/generated/cfg_accounts/api.ts +187 -0
  30. package/src/_api/generated/cfg_accounts/client/client.gen.ts +280 -0
  31. package/src/_api/generated/cfg_accounts/client/index.ts +25 -0
  32. package/src/_api/generated/cfg_accounts/client/types.gen.ts +217 -0
  33. package/src/_api/generated/cfg_accounts/client/utils.gen.ts +318 -0
  34. package/src/_api/generated/cfg_accounts/client.gen.ts +16 -0
  35. package/src/_api/generated/cfg_accounts/core/auth.gen.ts +41 -0
  36. package/src/_api/generated/cfg_accounts/core/bodySerializer.gen.ts +82 -0
  37. package/src/_api/generated/cfg_accounts/core/params.gen.ts +169 -0
  38. package/src/_api/generated/cfg_accounts/core/pathSerializer.gen.ts +171 -0
  39. package/src/_api/generated/cfg_accounts/core/queryKeySerializer.gen.ts +117 -0
  40. package/src/_api/generated/cfg_accounts/core/serverSentEvents.gen.ts +242 -0
  41. package/src/_api/generated/cfg_accounts/core/types.gen.ts +104 -0
  42. package/src/_api/generated/cfg_accounts/core/utils.gen.ts +140 -0
  43. package/src/_api/generated/cfg_accounts/events.ts +198 -0
  44. package/src/_api/generated/cfg_accounts/hooks/index.ts +18 -0
  45. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsOauthConnectionsList.ts +26 -0
  46. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsOauthDisconnectCreate.ts +24 -0
  47. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsOauthGithubAuthorizeCreate.ts +24 -0
  48. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsOauthGithubCallbackCreate.ts +24 -0
  49. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsOauthProvidersRetrieve.ts +26 -0
  50. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsOtpRequestCreate.ts +24 -0
  51. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsOtpVerifyCreate.ts +24 -0
  52. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsProfileAvatarCreate.ts +24 -0
  53. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsProfileDeleteCreate.ts +24 -0
  54. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsProfilePartialPartialUpdate.ts +24 -0
  55. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsProfilePartialUpdate.ts +24 -0
  56. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsProfileRetrieve.ts +26 -0
  57. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsProfileUpdatePartialUpdate.ts +24 -0
  58. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsProfileUpdateUpdate.ts +24 -0
  59. package/src/_api/generated/cfg_accounts/hooks/useCfgAccountsTokenRefreshCreate.ts +24 -0
  60. package/src/_api/generated/cfg_accounts/index.ts +26 -335
  61. package/src/_api/generated/cfg_accounts/schemas/AccountDeleteResponse.ts +12 -0
  62. package/src/_api/generated/cfg_accounts/schemas/CentrifugoToken.ts +14 -0
  63. package/src/_api/generated/cfg_accounts/schemas/CfgUserUpdateRequest.ts +16 -0
  64. package/src/_api/generated/cfg_accounts/schemas/OAuthAuthorizeRequestRequest.ts +12 -0
  65. package/src/_api/generated/cfg_accounts/schemas/OAuthAuthorizeResponse.ts +12 -0
  66. package/src/_api/generated/cfg_accounts/schemas/OAuthCallbackRequestRequest.ts +13 -0
  67. package/src/_api/generated/cfg_accounts/schemas/OAuthConnection.ts +19 -0
  68. package/src/_api/generated/cfg_accounts/schemas/OAuthDisconnectRequestRequest.ts +12 -0
  69. package/src/_api/generated/cfg_accounts/schemas/OAuthError.ts +12 -0
  70. package/src/_api/generated/cfg_accounts/schemas/OAuthProvidersResponse.ts +11 -0
  71. package/src/_api/generated/cfg_accounts/schemas/OAuthTokenResponse.ts +18 -0
  72. package/src/_api/generated/cfg_accounts/schemas/OTPErrorResponse.ts +13 -0
  73. package/src/_api/generated/cfg_accounts/schemas/OTPRequestRequest.ts +12 -0
  74. package/src/_api/generated/cfg_accounts/schemas/OTPRequestResponse.ts +11 -0
  75. package/src/_api/generated/cfg_accounts/schemas/OTPVerifyRequest.ts +13 -0
  76. package/src/_api/generated/cfg_accounts/schemas/OTPVerifyResponse.ts +17 -0
  77. package/src/_api/generated/cfg_accounts/schemas/PatchedCfgUserUpdateRequest.ts +16 -0
  78. package/src/_api/generated/cfg_accounts/schemas/ProviderEnum.ts +9 -0
  79. package/src/_api/generated/cfg_accounts/schemas/TokenRefresh.ts +12 -0
  80. package/src/_api/generated/cfg_accounts/schemas/TokenRefreshRequest.ts +11 -0
  81. package/src/_api/generated/cfg_accounts/{_utils/schemas/User.schema.ts → schemas/User.ts} +8 -16
  82. package/src/_api/generated/cfg_accounts/schemas/index.ts +24 -0
  83. package/src/_api/generated/cfg_accounts/sdk.gen.ts +796 -0
  84. package/src/_api/generated/cfg_accounts/types.gen.ts +764 -0
  85. package/src/_api/generated/cfg_centrifugo/api.ts +164 -0
  86. package/src/_api/generated/cfg_centrifugo/client/client.gen.ts +280 -0
  87. package/src/_api/generated/cfg_centrifugo/client/index.ts +25 -0
  88. package/src/_api/generated/cfg_centrifugo/client/types.gen.ts +217 -0
  89. package/src/_api/generated/cfg_centrifugo/client/utils.gen.ts +318 -0
  90. package/src/_api/generated/cfg_centrifugo/client.gen.ts +16 -0
  91. package/src/_api/generated/cfg_centrifugo/core/auth.gen.ts +41 -0
  92. package/src/_api/generated/cfg_centrifugo/core/bodySerializer.gen.ts +82 -0
  93. package/src/_api/generated/cfg_centrifugo/core/params.gen.ts +169 -0
  94. package/src/_api/generated/cfg_centrifugo/core/pathSerializer.gen.ts +171 -0
  95. package/src/_api/generated/cfg_centrifugo/core/queryKeySerializer.gen.ts +117 -0
  96. package/src/_api/generated/cfg_centrifugo/core/serverSentEvents.gen.ts +242 -0
  97. package/src/_api/generated/cfg_centrifugo/core/types.gen.ts +104 -0
  98. package/src/_api/generated/cfg_centrifugo/core/utils.gen.ts +140 -0
  99. package/src/_api/generated/cfg_centrifugo/events.ts +198 -0
  100. package/src/_api/generated/cfg_centrifugo/hooks/index.ts +4 -0
  101. package/src/_api/generated/cfg_centrifugo/hooks/useCfgCentrifugoAuthTokenRetrieve.ts +26 -0
  102. package/src/_api/generated/cfg_centrifugo/index.ts +26 -313
  103. package/src/_api/generated/cfg_centrifugo/schemas/ConnectionTokenResponse.ts +14 -0
  104. package/src/_api/generated/cfg_centrifugo/schemas/index.ts +4 -0
  105. package/src/_api/generated/cfg_centrifugo/sdk.gen.ts +64 -0
  106. package/src/_api/generated/cfg_centrifugo/types.gen.ts +61 -0
  107. package/src/_api/generated/cfg_totp/api.ts +181 -0
  108. package/src/_api/generated/cfg_totp/client/client.gen.ts +280 -0
  109. package/src/_api/generated/cfg_totp/client/index.ts +25 -0
  110. package/src/_api/generated/cfg_totp/client/types.gen.ts +217 -0
  111. package/src/_api/generated/cfg_totp/client/utils.gen.ts +318 -0
  112. package/src/_api/generated/cfg_totp/client.gen.ts +16 -0
  113. package/src/_api/generated/cfg_totp/core/auth.gen.ts +41 -0
  114. package/src/_api/generated/cfg_totp/core/bodySerializer.gen.ts +82 -0
  115. package/src/_api/generated/cfg_totp/core/params.gen.ts +169 -0
  116. package/src/_api/generated/cfg_totp/core/pathSerializer.gen.ts +171 -0
  117. package/src/_api/generated/cfg_totp/core/queryKeySerializer.gen.ts +117 -0
  118. package/src/_api/generated/cfg_totp/core/serverSentEvents.gen.ts +242 -0
  119. package/src/_api/generated/cfg_totp/core/types.gen.ts +104 -0
  120. package/src/_api/generated/cfg_totp/core/utils.gen.ts +140 -0
  121. package/src/_api/generated/cfg_totp/events.ts +198 -0
  122. package/src/_api/generated/cfg_totp/hooks/index.ts +12 -0
  123. package/src/_api/generated/cfg_totp/hooks/useCfgTotpBackupCodesRegenerateCreate.ts +24 -0
  124. package/src/_api/generated/cfg_totp/hooks/useCfgTotpBackupCodesRetrieve.ts +26 -0
  125. package/src/_api/generated/cfg_totp/hooks/useCfgTotpDevicesDestroy.ts +24 -0
  126. package/src/_api/generated/cfg_totp/hooks/useCfgTotpDevicesRetrieve.ts +26 -0
  127. package/src/_api/generated/cfg_totp/hooks/useCfgTotpDisableCreate.ts +24 -0
  128. package/src/_api/generated/cfg_totp/hooks/useCfgTotpSetupConfirmCreate.ts +24 -0
  129. package/src/_api/generated/cfg_totp/hooks/useCfgTotpSetupCreate.ts +24 -0
  130. package/src/_api/generated/cfg_totp/hooks/useCfgTotpVerifyBackupCreate.ts +24 -0
  131. package/src/_api/generated/cfg_totp/hooks/useCfgTotpVerifyCreate.ts +24 -0
  132. package/src/_api/generated/cfg_totp/index.ts +26 -342
  133. package/src/_api/generated/cfg_totp/schemas/BackupCodesRegenerateRequest.ts +11 -0
  134. package/src/_api/generated/cfg_totp/schemas/BackupCodesRegenerateResponse.ts +12 -0
  135. package/src/_api/generated/cfg_totp/schemas/BackupCodesStatus.ts +13 -0
  136. package/src/_api/generated/cfg_totp/schemas/ConfirmSetupRequest.ts +12 -0
  137. package/src/_api/generated/cfg_totp/schemas/ConfirmSetupResponse.ts +13 -0
  138. package/src/_api/generated/cfg_totp/schemas/DeviceList.ts +18 -0
  139. package/src/_api/generated/cfg_totp/schemas/DeviceListResponse.ts +13 -0
  140. package/src/_api/generated/cfg_totp/schemas/DeviceListStatusEnum.ts +9 -0
  141. package/src/_api/generated/cfg_totp/schemas/DisableRequest.ts +11 -0
  142. package/src/_api/generated/cfg_totp/schemas/SetupRequest.ts +11 -0
  143. package/src/_api/generated/cfg_totp/schemas/SetupResponse.ts +15 -0
  144. package/src/_api/generated/cfg_totp/{_utils/schemas/TotpVerifyUser.schema.ts → schemas/TotpVerifyUser.ts} +7 -15
  145. package/src/_api/generated/cfg_totp/schemas/VerifyBackupRequest.ts +12 -0
  146. package/src/_api/generated/cfg_totp/schemas/VerifyRequest.ts +12 -0
  147. package/src/_api/generated/cfg_totp/schemas/VerifyResponse.ts +17 -0
  148. package/src/_api/generated/cfg_totp/schemas/index.ts +18 -0
  149. package/src/_api/generated/cfg_totp/sdk.gen.ts +432 -0
  150. package/src/_api/generated/cfg_totp/types.gen.ts +479 -0
  151. package/src/_api/generated/index.ts +30 -0
  152. package/src/_api/index.ts +5 -23
  153. package/src/auth/context/AccountsContext.tsx +58 -89
  154. package/src/auth/context/AuthContext.tsx +3 -3
  155. package/src/auth/context/index.ts +2 -2
  156. package/src/auth/hooks/useDeleteAccount.ts +2 -1
  157. package/src/auth/hooks/useGithubAuth.ts +12 -11
  158. package/src/auth/hooks/useTokenRefresh.ts +6 -4
  159. package/src/auth/hooks/useTwoFactor.ts +14 -8
  160. package/src/auth/hooks/useTwoFactorSetup.ts +8 -5
  161. package/src/auth/hooks/useTwoFactorStatus.ts +3 -2
  162. package/src/auth/middlewares/tokenRefresh.ts +6 -4
  163. package/src/clients.ts +14 -51
  164. package/src/index.ts +15 -57
  165. package/src/server.ts +25 -23
  166. package/src/_api/BaseClient.ts +0 -22
  167. package/src/_api/generated/cfg_accounts/CLAUDE.md +0 -86
  168. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts.ts +0 -154
  169. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__auth.ts +0 -95
  170. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__oauth.ts +0 -285
  171. package/src/_api/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +0 -440
  172. package/src/_api/generated/cfg_accounts/_utils/fetchers/index.ts +0 -33
  173. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts.ts +0 -64
  174. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__auth.ts +0 -44
  175. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__oauth.ts +0 -114
  176. package/src/_api/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +0 -152
  177. package/src/_api/generated/cfg_accounts/_utils/hooks/index.ts +0 -33
  178. package/src/_api/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts +0 -20
  179. package/src/_api/generated/cfg_accounts/_utils/schemas/CentrifugoToken.schema.ts +0 -22
  180. package/src/_api/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts +0 -15
  181. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeRequestRequest.schema.ts +0 -20
  182. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthAuthorizeResponse.schema.ts +0 -20
  183. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthCallbackRequestRequest.schema.ts +0 -21
  184. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthConnection.schema.ts +0 -27
  185. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthDisconnectRequestRequest.schema.ts +0 -20
  186. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthError.schema.ts +0 -20
  187. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthProvidersResponse.schema.ts +0 -19
  188. package/src/_api/generated/cfg_accounts/_utils/schemas/OAuthTokenResponse.schema.ts +0 -46
  189. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPErrorResponse.schema.ts +0 -41
  190. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestRequest.schema.ts +0 -20
  191. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPRequestResponse.schema.ts +0 -19
  192. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyRequest.schema.ts +0 -21
  193. package/src/_api/generated/cfg_accounts/_utils/schemas/OTPVerifyResponse.schema.ts +0 -45
  194. package/src/_api/generated/cfg_accounts/_utils/schemas/PatchedUserProfileUpdateRequest.schema.ts +0 -24
  195. package/src/_api/generated/cfg_accounts/_utils/schemas/TokenRefresh.schema.ts +0 -16
  196. package/src/_api/generated/cfg_accounts/_utils/schemas/TokenRefreshRequest.schema.ts +0 -15
  197. package/src/_api/generated/cfg_accounts/_utils/schemas/UserProfileUpdateRequest.schema.ts +0 -24
  198. package/src/_api/generated/cfg_accounts/_utils/schemas/index.ts +0 -41
  199. package/src/_api/generated/cfg_accounts/accounts/client.ts +0 -34
  200. package/src/_api/generated/cfg_accounts/accounts/index.ts +0 -4
  201. package/src/_api/generated/cfg_accounts/accounts/models.ts +0 -127
  202. package/src/_api/generated/cfg_accounts/accounts__auth/client.ts +0 -23
  203. package/src/_api/generated/cfg_accounts/accounts__auth/index.ts +0 -4
  204. package/src/_api/generated/cfg_accounts/accounts__auth/models.ts +0 -19
  205. package/src/_api/generated/cfg_accounts/accounts__oauth/client.ts +0 -67
  206. package/src/_api/generated/cfg_accounts/accounts__oauth/index.ts +0 -4
  207. package/src/_api/generated/cfg_accounts/accounts__oauth/models.ts +0 -127
  208. package/src/_api/generated/cfg_accounts/accounts__user_profile/client.ts +0 -94
  209. package/src/_api/generated/cfg_accounts/accounts__user_profile/index.ts +0 -4
  210. package/src/_api/generated/cfg_accounts/accounts__user_profile/models.ts +0 -98
  211. package/src/_api/generated/cfg_accounts/api-instance.ts +0 -181
  212. package/src/_api/generated/cfg_accounts/client.ts +0 -339
  213. package/src/_api/generated/cfg_accounts/enums.ts +0 -10
  214. package/src/_api/generated/cfg_accounts/errors.ts +0 -123
  215. package/src/_api/generated/cfg_accounts/http.ts +0 -160
  216. package/src/_api/generated/cfg_accounts/logger.ts +0 -261
  217. package/src/_api/generated/cfg_accounts/retry.ts +0 -177
  218. package/src/_api/generated/cfg_accounts/schema.json +0 -1576
  219. package/src/_api/generated/cfg_accounts/storage.ts +0 -163
  220. package/src/_api/generated/cfg_accounts/validation-events.ts +0 -135
  221. package/src/_api/generated/cfg_centrifugo/CLAUDE.md +0 -60
  222. package/src/_api/generated/cfg_centrifugo/_utils/fetchers/centrifugo__centrifugo_auth.ts +0 -94
  223. package/src/_api/generated/cfg_centrifugo/_utils/fetchers/index.ts +0 -30
  224. package/src/_api/generated/cfg_centrifugo/_utils/hooks/centrifugo__centrifugo_auth.ts +0 -39
  225. package/src/_api/generated/cfg_centrifugo/_utils/hooks/index.ts +0 -30
  226. package/src/_api/generated/cfg_centrifugo/_utils/schemas/ConnectionTokenResponse.schema.ts +0 -22
  227. package/src/_api/generated/cfg_centrifugo/_utils/schemas/index.ts +0 -21
  228. package/src/_api/generated/cfg_centrifugo/api-instance.ts +0 -181
  229. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/client.ts +0 -27
  230. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/index.ts +0 -4
  231. package/src/_api/generated/cfg_centrifugo/centrifugo__centrifugo_auth/models.ts +0 -18
  232. package/src/_api/generated/cfg_centrifugo/client.ts +0 -330
  233. package/src/_api/generated/cfg_centrifugo/errors.ts +0 -123
  234. package/src/_api/generated/cfg_centrifugo/http.ts +0 -160
  235. package/src/_api/generated/cfg_centrifugo/logger.ts +0 -261
  236. package/src/_api/generated/cfg_centrifugo/retry.ts +0 -177
  237. package/src/_api/generated/cfg_centrifugo/schema.json +0 -118
  238. package/src/_api/generated/cfg_centrifugo/storage.ts +0 -163
  239. package/src/_api/generated/cfg_centrifugo/validation-events.ts +0 -135
  240. package/src/_api/generated/cfg_totp/CLAUDE.md +0 -83
  241. package/src/_api/generated/cfg_totp/_utils/fetchers/index.ts +0 -34
  242. package/src/_api/generated/cfg_totp/_utils/fetchers/totp.ts +0 -50
  243. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__backup_codes.ts +0 -153
  244. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_management.ts +0 -109
  245. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_setup.ts +0 -154
  246. package/src/_api/generated/cfg_totp/_utils/fetchers/totp__totp_verification.ts +0 -153
  247. package/src/_api/generated/cfg_totp/_utils/hooks/index.ts +0 -34
  248. package/src/_api/generated/cfg_totp/_utils/hooks/totp.ts +0 -43
  249. package/src/_api/generated/cfg_totp/_utils/hooks/totp__backup_codes.ts +0 -60
  250. package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_management.ts +0 -59
  251. package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_setup.ts +0 -64
  252. package/src/_api/generated/cfg_totp/_utils/hooks/totp__totp_verification.ts +0 -63
  253. package/src/_api/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateRequest.schema.ts +0 -19
  254. package/src/_api/generated/cfg_totp/_utils/schemas/BackupCodesRegenerateResponse.schema.ts +0 -20
  255. package/src/_api/generated/cfg_totp/_utils/schemas/BackupCodesStatus.schema.ts +0 -21
  256. package/src/_api/generated/cfg_totp/_utils/schemas/ConfirmSetupRequest.schema.ts +0 -20
  257. package/src/_api/generated/cfg_totp/_utils/schemas/ConfirmSetupResponse.schema.ts +0 -21
  258. package/src/_api/generated/cfg_totp/_utils/schemas/DeviceList.schema.ts +0 -26
  259. package/src/_api/generated/cfg_totp/_utils/schemas/DeviceListResponse.schema.ts +0 -21
  260. package/src/_api/generated/cfg_totp/_utils/schemas/DisableRequest.schema.ts +0 -19
  261. package/src/_api/generated/cfg_totp/_utils/schemas/SetupRequest.schema.ts +0 -19
  262. package/src/_api/generated/cfg_totp/_utils/schemas/SetupResponse.schema.ts +0 -23
  263. package/src/_api/generated/cfg_totp/_utils/schemas/VerifyBackupRequest.schema.ts +0 -20
  264. package/src/_api/generated/cfg_totp/_utils/schemas/VerifyRequest.schema.ts +0 -20
  265. package/src/_api/generated/cfg_totp/_utils/schemas/VerifyResponse.schema.ts +0 -25
  266. package/src/_api/generated/cfg_totp/_utils/schemas/index.ts +0 -34
  267. package/src/_api/generated/cfg_totp/api-instance.ts +0 -181
  268. package/src/_api/generated/cfg_totp/client.ts +0 -342
  269. package/src/_api/generated/cfg_totp/enums.ts +0 -13
  270. package/src/_api/generated/cfg_totp/errors.ts +0 -123
  271. package/src/_api/generated/cfg_totp/http.ts +0 -160
  272. package/src/_api/generated/cfg_totp/logger.ts +0 -261
  273. package/src/_api/generated/cfg_totp/retry.ts +0 -177
  274. package/src/_api/generated/cfg_totp/schema.json +0 -910
  275. package/src/_api/generated/cfg_totp/storage.ts +0 -163
  276. package/src/_api/generated/cfg_totp/totp/client.ts +0 -24
  277. package/src/_api/generated/cfg_totp/totp/index.ts +0 -4
  278. package/src/_api/generated/cfg_totp/totp/models.ts +0 -4
  279. package/src/_api/generated/cfg_totp/totp__backup_codes/client.ts +0 -32
  280. package/src/_api/generated/cfg_totp/totp__backup_codes/index.ts +0 -4
  281. package/src/_api/generated/cfg_totp/totp__backup_codes/models.ts +0 -38
  282. package/src/_api/generated/cfg_totp/totp__totp_management/client.ts +0 -31
  283. package/src/_api/generated/cfg_totp/totp__totp_management/index.ts +0 -4
  284. package/src/_api/generated/cfg_totp/totp__totp_management/models.ts +0 -46
  285. package/src/_api/generated/cfg_totp/totp__totp_setup/client.ts +0 -33
  286. package/src/_api/generated/cfg_totp/totp__totp_setup/index.ts +0 -4
  287. package/src/_api/generated/cfg_totp/totp__totp_setup/models.ts +0 -55
  288. package/src/_api/generated/cfg_totp/totp__totp_verification/client.ts +0 -33
  289. package/src/_api/generated/cfg_totp/totp__totp_verification/index.ts +0 -4
  290. package/src/_api/generated/cfg_totp/totp__totp_verification/models.ts +0 -74
  291. package/src/_api/generated/cfg_totp/validation-events.ts +0 -135
  292. package/src/hooks/accounts.ts +0 -8
  293. package/src/hooks/index.ts +0 -10
@@ -1,1576 +0,0 @@
1
- {
2
- "openapi": "3.1.0",
3
- "info": {
4
- "title": "Django CFG API",
5
- "version": "1.0.0",
6
- "description": "Complete API documentation for Django CFG Demo Project",
7
- "x-django-metadata": {
8
- "group": "cfg_accounts",
9
- "apps": [
10
- "django_cfg_accounts"
11
- ],
12
- "generator": "django-client",
13
- "generator_version": "1.0.0"
14
- }
15
- },
16
- "paths": {
17
- "/cfg/accounts/oauth/connections/": {
18
- "get": {
19
- "operationId": "cfg_accounts_oauth_connections_list",
20
- "description": "Get all OAuth connections for the current user.",
21
- "summary": "List OAuth connections",
22
- "tags": [
23
- "OAuth"
24
- ],
25
- "security": [
26
- {
27
- "jwtAuthWithLastLogin": []
28
- }
29
- ],
30
- "responses": {
31
- "200": {
32
- "content": {
33
- "application/json": {
34
- "schema": {
35
- "type": "array",
36
- "items": {
37
- "$ref": "#/components/schemas/OAuthConnection"
38
- }
39
- }
40
- }
41
- },
42
- "description": ""
43
- }
44
- },
45
- "x-async-capable": false
46
- }
47
- },
48
- "/cfg/accounts/oauth/disconnect/": {
49
- "post": {
50
- "operationId": "cfg_accounts_oauth_disconnect_create",
51
- "description": "Remove OAuth connection for the specified provider.",
52
- "summary": "Disconnect OAuth provider",
53
- "tags": [
54
- "OAuth"
55
- ],
56
- "requestBody": {
57
- "content": {
58
- "application/json": {
59
- "schema": {
60
- "$ref": "#/components/schemas/OAuthDisconnectRequestRequest"
61
- }
62
- },
63
- "application/x-www-form-urlencoded": {
64
- "schema": {
65
- "$ref": "#/components/schemas/OAuthDisconnectRequestRequest"
66
- }
67
- },
68
- "multipart/form-data": {
69
- "schema": {
70
- "$ref": "#/components/schemas/OAuthDisconnectRequestRequest"
71
- }
72
- }
73
- },
74
- "required": true
75
- },
76
- "security": [
77
- {
78
- "jwtAuthWithLastLogin": []
79
- }
80
- ],
81
- "responses": {
82
- "200": {
83
- "content": {
84
- "application/json": {
85
- "schema": {
86
- "type": "object",
87
- "properties": {
88
- "message": {
89
- "type": "string"
90
- }
91
- }
92
- }
93
- }
94
- },
95
- "description": ""
96
- },
97
- "400": {
98
- "content": {
99
- "application/json": {
100
- "schema": {
101
- "$ref": "#/components/schemas/OAuthError"
102
- }
103
- }
104
- },
105
- "description": ""
106
- },
107
- "404": {
108
- "content": {
109
- "application/json": {
110
- "schema": {
111
- "$ref": "#/components/schemas/OAuthError"
112
- }
113
- }
114
- },
115
- "description": ""
116
- }
117
- },
118
- "x-async-capable": false
119
- }
120
- },
121
- "/cfg/accounts/oauth/github/authorize/": {
122
- "post": {
123
- "operationId": "cfg_accounts_oauth_github_authorize_create",
124
- "description": "Generate GitHub OAuth authorization URL. Redirect user to this URL to start authentication.",
125
- "summary": "Start GitHub OAuth",
126
- "tags": [
127
- "OAuth"
128
- ],
129
- "requestBody": {
130
- "content": {
131
- "application/json": {
132
- "schema": {
133
- "$ref": "#/components/schemas/OAuthAuthorizeRequestRequest"
134
- }
135
- },
136
- "application/x-www-form-urlencoded": {
137
- "schema": {
138
- "$ref": "#/components/schemas/OAuthAuthorizeRequestRequest"
139
- }
140
- },
141
- "multipart/form-data": {
142
- "schema": {
143
- "$ref": "#/components/schemas/OAuthAuthorizeRequestRequest"
144
- }
145
- }
146
- }
147
- },
148
- "security": [
149
- {}
150
- ],
151
- "responses": {
152
- "200": {
153
- "content": {
154
- "application/json": {
155
- "schema": {
156
- "$ref": "#/components/schemas/OAuthAuthorizeResponse"
157
- }
158
- }
159
- },
160
- "description": ""
161
- },
162
- "503": {
163
- "content": {
164
- "application/json": {
165
- "schema": {
166
- "$ref": "#/components/schemas/OAuthError"
167
- }
168
- }
169
- },
170
- "description": ""
171
- }
172
- },
173
- "x-async-capable": false
174
- }
175
- },
176
- "/cfg/accounts/oauth/github/callback/": {
177
- "post": {
178
- "operationId": "cfg_accounts_oauth_github_callback_create",
179
- "description": "Exchange authorization code for JWT tokens. Call this after GitHub redirects back with code.",
180
- "summary": "Complete GitHub OAuth",
181
- "tags": [
182
- "OAuth"
183
- ],
184
- "requestBody": {
185
- "content": {
186
- "application/json": {
187
- "schema": {
188
- "$ref": "#/components/schemas/OAuthCallbackRequestRequest"
189
- }
190
- },
191
- "application/x-www-form-urlencoded": {
192
- "schema": {
193
- "$ref": "#/components/schemas/OAuthCallbackRequestRequest"
194
- }
195
- },
196
- "multipart/form-data": {
197
- "schema": {
198
- "$ref": "#/components/schemas/OAuthCallbackRequestRequest"
199
- }
200
- }
201
- },
202
- "required": true
203
- },
204
- "security": [
205
- {}
206
- ],
207
- "responses": {
208
- "200": {
209
- "content": {
210
- "application/json": {
211
- "schema": {
212
- "$ref": "#/components/schemas/OAuthTokenResponse"
213
- }
214
- }
215
- },
216
- "description": ""
217
- },
218
- "400": {
219
- "content": {
220
- "application/json": {
221
- "schema": {
222
- "$ref": "#/components/schemas/OAuthError"
223
- }
224
- }
225
- },
226
- "description": ""
227
- }
228
- },
229
- "x-async-capable": false
230
- }
231
- },
232
- "/cfg/accounts/oauth/providers/": {
233
- "get": {
234
- "operationId": "cfg_accounts_oauth_providers_retrieve",
235
- "description": "Get list of available OAuth providers for authentication.",
236
- "summary": "List OAuth providers",
237
- "tags": [
238
- "OAuth"
239
- ],
240
- "security": [
241
- {}
242
- ],
243
- "responses": {
244
- "200": {
245
- "content": {
246
- "application/json": {
247
- "schema": {
248
- "$ref": "#/components/schemas/OAuthProvidersResponse"
249
- }
250
- }
251
- },
252
- "description": ""
253
- }
254
- },
255
- "x-async-capable": false
256
- }
257
- },
258
- "/cfg/accounts/otp/request/": {
259
- "post": {
260
- "operationId": "cfg_accounts_otp_request_create",
261
- "description": "Request OTP code to email.",
262
- "tags": [
263
- "accounts"
264
- ],
265
- "requestBody": {
266
- "content": {
267
- "application/json": {
268
- "schema": {
269
- "$ref": "#/components/schemas/OTPRequestRequest"
270
- }
271
- },
272
- "application/x-www-form-urlencoded": {
273
- "schema": {
274
- "$ref": "#/components/schemas/OTPRequestRequest"
275
- }
276
- },
277
- "multipart/form-data": {
278
- "schema": {
279
- "$ref": "#/components/schemas/OTPRequestRequest"
280
- }
281
- }
282
- },
283
- "required": true
284
- },
285
- "security": [
286
- {
287
- "jwtAuthWithLastLogin": []
288
- },
289
- {}
290
- ],
291
- "responses": {
292
- "200": {
293
- "content": {
294
- "application/json": {
295
- "schema": {
296
- "$ref": "#/components/schemas/OTPRequestResponse"
297
- }
298
- }
299
- },
300
- "description": ""
301
- },
302
- "400": {
303
- "content": {
304
- "application/json": {
305
- "schema": {
306
- "$ref": "#/components/schemas/OTPErrorResponse"
307
- }
308
- }
309
- },
310
- "description": ""
311
- },
312
- "429": {
313
- "content": {
314
- "application/json": {
315
- "schema": {
316
- "$ref": "#/components/schemas/OTPErrorResponse"
317
- }
318
- }
319
- },
320
- "description": ""
321
- },
322
- "500": {
323
- "content": {
324
- "application/json": {
325
- "schema": {
326
- "$ref": "#/components/schemas/OTPErrorResponse"
327
- }
328
- }
329
- },
330
- "description": ""
331
- }
332
- },
333
- "x-async-capable": false
334
- }
335
- },
336
- "/cfg/accounts/otp/verify/": {
337
- "post": {
338
- "operationId": "cfg_accounts_otp_verify_create",
339
- "description": "Verify OTP code and return JWT tokens or 2FA session.\n\nIf user has 2FA enabled:\n- Returns requires_2fa=True with session_id\n- Client must complete 2FA verification at /cfg/totp/verify/\n\nIf user has no 2FA:\n- Returns JWT tokens and user data directly",
340
- "tags": [
341
- "accounts"
342
- ],
343
- "requestBody": {
344
- "content": {
345
- "application/json": {
346
- "schema": {
347
- "$ref": "#/components/schemas/OTPVerifyRequest"
348
- }
349
- },
350
- "application/x-www-form-urlencoded": {
351
- "schema": {
352
- "$ref": "#/components/schemas/OTPVerifyRequest"
353
- }
354
- },
355
- "multipart/form-data": {
356
- "schema": {
357
- "$ref": "#/components/schemas/OTPVerifyRequest"
358
- }
359
- }
360
- },
361
- "required": true
362
- },
363
- "security": [
364
- {
365
- "jwtAuthWithLastLogin": []
366
- },
367
- {}
368
- ],
369
- "responses": {
370
- "200": {
371
- "content": {
372
- "application/json": {
373
- "schema": {
374
- "$ref": "#/components/schemas/OTPVerifyResponse"
375
- }
376
- }
377
- },
378
- "description": ""
379
- },
380
- "401": {
381
- "content": {
382
- "application/json": {
383
- "schema": {
384
- "$ref": "#/components/schemas/OTPErrorResponse"
385
- }
386
- }
387
- },
388
- "description": ""
389
- },
390
- "429": {
391
- "content": {
392
- "application/json": {
393
- "schema": {
394
- "$ref": "#/components/schemas/OTPErrorResponse"
395
- }
396
- }
397
- },
398
- "description": ""
399
- }
400
- },
401
- "x-async-capable": false
402
- }
403
- },
404
- "/cfg/accounts/profile/": {
405
- "get": {
406
- "operationId": "cfg_accounts_profile_retrieve",
407
- "description": "Retrieve the current authenticated user's profile information.",
408
- "summary": "Get current user profile",
409
- "tags": [
410
- "User Profile"
411
- ],
412
- "security": [
413
- {
414
- "jwtAuth": []
415
- },
416
- {
417
- "cookieAuth": []
418
- }
419
- ],
420
- "responses": {
421
- "200": {
422
- "content": {
423
- "application/json": {
424
- "schema": {
425
- "$ref": "#/components/schemas/User"
426
- }
427
- }
428
- },
429
- "description": ""
430
- },
431
- "401": {
432
- "content": {
433
- "application/json": {
434
- "schema": {
435
- "description": "Authentication credentials were not provided."
436
- }
437
- }
438
- },
439
- "description": ""
440
- }
441
- },
442
- "x-async-capable": false
443
- }
444
- },
445
- "/cfg/accounts/profile/avatar/": {
446
- "post": {
447
- "operationId": "cfg_accounts_profile_avatar_create",
448
- "description": "Upload avatar image for the current authenticated user. Accepts multipart/form-data with 'avatar' field.",
449
- "summary": "Upload user avatar",
450
- "tags": [
451
- "User Profile"
452
- ],
453
- "requestBody": {
454
- "content": {
455
- "multipart/form-data": {
456
- "schema": {
457
- "type": "object",
458
- "properties": {
459
- "avatar": {
460
- "type": "string",
461
- "format": "binary",
462
- "description": "Avatar image file (JPEG, PNG, GIF, WebP, max 5MB)"
463
- }
464
- },
465
- "required": [
466
- "avatar"
467
- ]
468
- }
469
- }
470
- }
471
- },
472
- "security": [
473
- {
474
- "jwtAuthWithLastLogin": []
475
- }
476
- ],
477
- "responses": {
478
- "200": {
479
- "content": {
480
- "application/json": {
481
- "schema": {
482
- "$ref": "#/components/schemas/User"
483
- }
484
- }
485
- },
486
- "description": ""
487
- },
488
- "400": {
489
- "content": {
490
- "application/json": {
491
- "schema": {
492
- "description": "Invalid file or validation error."
493
- }
494
- }
495
- },
496
- "description": ""
497
- },
498
- "401": {
499
- "content": {
500
- "application/json": {
501
- "schema": {
502
- "description": "Authentication credentials were not provided."
503
- }
504
- }
505
- },
506
- "description": ""
507
- }
508
- },
509
- "x-async-capable": false
510
- }
511
- },
512
- "/cfg/accounts/profile/delete/": {
513
- "post": {
514
- "operationId": "cfg_accounts_profile_delete_create",
515
- "description": "\n Permanently delete the current user's account.\n\n This operation:\n - Deactivates the account (user cannot log in)\n - Anonymizes personal data (GDPR compliance)\n - Frees up the email address for re-registration\n - Preserves audit trail\n\n The account can be restored by an administrator if needed.\n ",
516
- "summary": "Delete user account",
517
- "tags": [
518
- "User Profile"
519
- ],
520
- "security": [
521
- {
522
- "jwtAuth": []
523
- },
524
- {
525
- "cookieAuth": []
526
- }
527
- ],
528
- "responses": {
529
- "200": {
530
- "content": {
531
- "application/json": {
532
- "schema": {
533
- "$ref": "#/components/schemas/AccountDeleteResponse"
534
- }
535
- }
536
- },
537
- "description": ""
538
- },
539
- "401": {
540
- "content": {
541
- "application/json": {
542
- "schema": {
543
- "description": "Authentication credentials were not provided."
544
- }
545
- }
546
- },
547
- "description": ""
548
- },
549
- "400": {
550
- "content": {
551
- "application/json": {
552
- "schema": {
553
- "description": "Account is already deleted."
554
- }
555
- }
556
- },
557
- "description": ""
558
- }
559
- },
560
- "x-async-capable": false
561
- }
562
- },
563
- "/cfg/accounts/profile/partial/": {
564
- "put": {
565
- "operationId": "cfg_accounts_profile_partial_update",
566
- "description": "Partially update the current authenticated user's profile information. Supports avatar upload.",
567
- "summary": "Partial update user profile",
568
- "tags": [
569
- "User Profile"
570
- ],
571
- "requestBody": {
572
- "content": {
573
- "application/json": {
574
- "schema": {
575
- "$ref": "#/components/schemas/UserProfileUpdateRequest"
576
- },
577
- "examples": {
578
- "ProfileUpdateWithAvatar": {
579
- "value": {
580
- "first_name": "John",
581
- "last_name": "Doe",
582
- "company": "Tech Corp",
583
- "phone": "+1 (555) 123-4567",
584
- "position": "Software Engineer"
585
- },
586
- "summary": "Profile Update with Avatar"
587
- }
588
- }
589
- },
590
- "application/x-www-form-urlencoded": {
591
- "schema": {
592
- "$ref": "#/components/schemas/UserProfileUpdateRequest"
593
- }
594
- },
595
- "multipart/form-data": {
596
- "schema": {
597
- "$ref": "#/components/schemas/UserProfileUpdateRequest"
598
- }
599
- }
600
- }
601
- },
602
- "security": [
603
- {
604
- "jwtAuth": []
605
- },
606
- {
607
- "cookieAuth": []
608
- }
609
- ],
610
- "responses": {
611
- "200": {
612
- "content": {
613
- "application/json": {
614
- "schema": {
615
- "$ref": "#/components/schemas/User"
616
- }
617
- }
618
- },
619
- "description": ""
620
- },
621
- "400": {
622
- "content": {
623
- "application/json": {
624
- "schema": {
625
- "description": "Invalid data provided."
626
- }
627
- }
628
- },
629
- "description": ""
630
- },
631
- "401": {
632
- "content": {
633
- "application/json": {
634
- "schema": {
635
- "description": "Authentication credentials were not provided."
636
- }
637
- }
638
- },
639
- "description": ""
640
- }
641
- },
642
- "x-async-capable": false
643
- },
644
- "patch": {
645
- "operationId": "cfg_accounts_profile_partial_partial_update",
646
- "description": "Partially update the current authenticated user's profile information. Supports avatar upload.",
647
- "summary": "Partial update user profile",
648
- "tags": [
649
- "User Profile"
650
- ],
651
- "requestBody": {
652
- "content": {
653
- "application/json": {
654
- "schema": {
655
- "$ref": "#/components/schemas/PatchedUserProfileUpdateRequest"
656
- },
657
- "examples": {
658
- "ProfileUpdateWithAvatar": {
659
- "value": {
660
- "first_name": "John",
661
- "last_name": "Doe",
662
- "company": "Tech Corp",
663
- "phone": "+1 (555) 123-4567",
664
- "position": "Software Engineer"
665
- },
666
- "summary": "Profile Update with Avatar"
667
- }
668
- }
669
- },
670
- "application/x-www-form-urlencoded": {
671
- "schema": {
672
- "$ref": "#/components/schemas/PatchedUserProfileUpdateRequest"
673
- }
674
- },
675
- "multipart/form-data": {
676
- "schema": {
677
- "$ref": "#/components/schemas/PatchedUserProfileUpdateRequest"
678
- }
679
- }
680
- }
681
- },
682
- "security": [
683
- {
684
- "jwtAuth": []
685
- },
686
- {
687
- "cookieAuth": []
688
- }
689
- ],
690
- "responses": {
691
- "200": {
692
- "content": {
693
- "application/json": {
694
- "schema": {
695
- "$ref": "#/components/schemas/User"
696
- }
697
- }
698
- },
699
- "description": ""
700
- },
701
- "400": {
702
- "content": {
703
- "application/json": {
704
- "schema": {
705
- "description": "Invalid data provided."
706
- }
707
- }
708
- },
709
- "description": ""
710
- },
711
- "401": {
712
- "content": {
713
- "application/json": {
714
- "schema": {
715
- "description": "Authentication credentials were not provided."
716
- }
717
- }
718
- },
719
- "description": ""
720
- }
721
- },
722
- "x-async-capable": false
723
- }
724
- },
725
- "/cfg/accounts/profile/update/": {
726
- "put": {
727
- "operationId": "cfg_accounts_profile_update_update",
728
- "description": "Update the current authenticated user's profile information.",
729
- "summary": "Update user profile",
730
- "tags": [
731
- "User Profile"
732
- ],
733
- "requestBody": {
734
- "content": {
735
- "application/json": {
736
- "schema": {
737
- "$ref": "#/components/schemas/UserProfileUpdateRequest"
738
- },
739
- "examples": {
740
- "ValidProfileUpdate": {
741
- "value": {
742
- "first_name": "John",
743
- "last_name": "Doe",
744
- "company": "Tech Corp",
745
- "phone": "+1 (555) 123-4567",
746
- "position": "Software Engineer"
747
- },
748
- "summary": "Valid Profile Update"
749
- }
750
- }
751
- },
752
- "application/x-www-form-urlencoded": {
753
- "schema": {
754
- "$ref": "#/components/schemas/UserProfileUpdateRequest"
755
- }
756
- },
757
- "multipart/form-data": {
758
- "schema": {
759
- "$ref": "#/components/schemas/UserProfileUpdateRequest"
760
- }
761
- }
762
- }
763
- },
764
- "security": [
765
- {
766
- "jwtAuth": []
767
- },
768
- {
769
- "cookieAuth": []
770
- }
771
- ],
772
- "responses": {
773
- "200": {
774
- "content": {
775
- "application/json": {
776
- "schema": {
777
- "$ref": "#/components/schemas/User"
778
- }
779
- }
780
- },
781
- "description": ""
782
- },
783
- "400": {
784
- "content": {
785
- "application/json": {
786
- "schema": {
787
- "description": "Invalid data provided."
788
- }
789
- }
790
- },
791
- "description": ""
792
- },
793
- "401": {
794
- "content": {
795
- "application/json": {
796
- "schema": {
797
- "description": "Authentication credentials were not provided."
798
- }
799
- }
800
- },
801
- "description": ""
802
- }
803
- },
804
- "x-async-capable": false
805
- },
806
- "patch": {
807
- "operationId": "cfg_accounts_profile_update_partial_update",
808
- "description": "Update the current authenticated user's profile information.",
809
- "summary": "Update user profile",
810
- "tags": [
811
- "User Profile"
812
- ],
813
- "requestBody": {
814
- "content": {
815
- "application/json": {
816
- "schema": {
817
- "$ref": "#/components/schemas/PatchedUserProfileUpdateRequest"
818
- },
819
- "examples": {
820
- "ValidProfileUpdate": {
821
- "value": {
822
- "first_name": "John",
823
- "last_name": "Doe",
824
- "company": "Tech Corp",
825
- "phone": "+1 (555) 123-4567",
826
- "position": "Software Engineer"
827
- },
828
- "summary": "Valid Profile Update"
829
- }
830
- }
831
- },
832
- "application/x-www-form-urlencoded": {
833
- "schema": {
834
- "$ref": "#/components/schemas/PatchedUserProfileUpdateRequest"
835
- }
836
- },
837
- "multipart/form-data": {
838
- "schema": {
839
- "$ref": "#/components/schemas/PatchedUserProfileUpdateRequest"
840
- }
841
- }
842
- }
843
- },
844
- "security": [
845
- {
846
- "jwtAuth": []
847
- },
848
- {
849
- "cookieAuth": []
850
- }
851
- ],
852
- "responses": {
853
- "200": {
854
- "content": {
855
- "application/json": {
856
- "schema": {
857
- "$ref": "#/components/schemas/User"
858
- }
859
- }
860
- },
861
- "description": ""
862
- },
863
- "400": {
864
- "content": {
865
- "application/json": {
866
- "schema": {
867
- "description": "Invalid data provided."
868
- }
869
- }
870
- },
871
- "description": ""
872
- },
873
- "401": {
874
- "content": {
875
- "application/json": {
876
- "schema": {
877
- "description": "Authentication credentials were not provided."
878
- }
879
- }
880
- },
881
- "description": ""
882
- }
883
- },
884
- "x-async-capable": false
885
- }
886
- },
887
- "/cfg/accounts/token/refresh/": {
888
- "post": {
889
- "operationId": "cfg_accounts_token_refresh_create",
890
- "description": "Refresh JWT token.",
891
- "tags": [
892
- "Auth"
893
- ],
894
- "requestBody": {
895
- "content": {
896
- "application/json": {
897
- "schema": {
898
- "$ref": "#/components/schemas/TokenRefreshRequest"
899
- }
900
- },
901
- "application/x-www-form-urlencoded": {
902
- "schema": {
903
- "$ref": "#/components/schemas/TokenRefreshRequest"
904
- }
905
- },
906
- "multipart/form-data": {
907
- "schema": {
908
- "$ref": "#/components/schemas/TokenRefreshRequest"
909
- }
910
- }
911
- },
912
- "required": true
913
- },
914
- "responses": {
915
- "200": {
916
- "content": {
917
- "application/json": {
918
- "schema": {
919
- "$ref": "#/components/schemas/TokenRefresh"
920
- }
921
- }
922
- },
923
- "description": ""
924
- }
925
- },
926
- "x-async-capable": false
927
- }
928
- }
929
- },
930
- "components": {
931
- "schemas": {
932
- "AccountDeleteResponse": {
933
- "type": "object",
934
- "description": "Response serializer for account deletion.",
935
- "properties": {
936
- "success": {
937
- "type": "boolean",
938
- "description": "Whether the account was successfully deleted"
939
- },
940
- "message": {
941
- "type": "string",
942
- "description": "Human-readable message about the deletion"
943
- }
944
- },
945
- "required": [
946
- "message",
947
- "success"
948
- ]
949
- },
950
- "CentrifugoToken": {
951
- "type": "object",
952
- "description": "Nested serializer for Centrifugo WebSocket connection token.",
953
- "properties": {
954
- "token": {
955
- "type": "string",
956
- "description": "JWT token for Centrifugo WebSocket connection"
957
- },
958
- "centrifugo_url": {
959
- "type": "string",
960
- "format": "uri",
961
- "description": "Centrifugo WebSocket URL"
962
- },
963
- "expires_at": {
964
- "type": "string",
965
- "format": "date-time",
966
- "description": "Token expiration time (ISO 8601)"
967
- },
968
- "channels": {
969
- "type": "array",
970
- "items": {
971
- "type": "string"
972
- },
973
- "description": "List of allowed channels for this user"
974
- }
975
- },
976
- "required": [
977
- "centrifugo_url",
978
- "channels",
979
- "expires_at",
980
- "token"
981
- ]
982
- },
983
- "OAuthAuthorizeRequestRequest": {
984
- "type": "object",
985
- "description": "Request to start OAuth flow.",
986
- "properties": {
987
- "redirect_uri": {
988
- "type": "string",
989
- "format": "uri",
990
- "description": "URL to redirect after OAuth authorization. If not provided, uses config's site_url + callback_path"
991
- },
992
- "source_url": {
993
- "type": "string",
994
- "format": "uri",
995
- "description": "Optional source URL for registration tracking"
996
- }
997
- }
998
- },
999
- "OAuthAuthorizeResponse": {
1000
- "type": "object",
1001
- "description": "Response with OAuth authorization URL.",
1002
- "properties": {
1003
- "authorization_url": {
1004
- "type": "string",
1005
- "format": "uri",
1006
- "description": "Full URL to redirect user to OAuth provider"
1007
- },
1008
- "state": {
1009
- "type": "string",
1010
- "description": "State token for CSRF protection. Store this and verify on callback."
1011
- }
1012
- },
1013
- "required": [
1014
- "authorization_url",
1015
- "state"
1016
- ]
1017
- },
1018
- "OAuthCallbackRequestRequest": {
1019
- "type": "object",
1020
- "description": "Request to complete OAuth flow (callback handler).",
1021
- "properties": {
1022
- "code": {
1023
- "type": "string",
1024
- "minLength": 10,
1025
- "description": "Authorization code from OAuth provider callback",
1026
- "maxLength": 500
1027
- },
1028
- "state": {
1029
- "type": "string",
1030
- "minLength": 20,
1031
- "description": "State token for CSRF verification (from authorize response)",
1032
- "maxLength": 100
1033
- },
1034
- "redirect_uri": {
1035
- "type": "string",
1036
- "format": "uri",
1037
- "description": "Same redirect_uri used in authorize request. If not provided, uses config's site_url + callback_path"
1038
- }
1039
- },
1040
- "required": [
1041
- "code",
1042
- "state"
1043
- ]
1044
- },
1045
- "OAuthConnection": {
1046
- "type": "object",
1047
- "description": "Serializer for OAuth connection info (user-facing).",
1048
- "properties": {
1049
- "id": {
1050
- "type": "integer",
1051
- "readOnly": true
1052
- },
1053
- "provider": {
1054
- "enum": [
1055
- "github"
1056
- ],
1057
- "type": "string",
1058
- "x-spec-enum-id": "c2a91afcd0429742",
1059
- "readOnly": true,
1060
- "description": "OAuth provider name (github, google, etc.)\n\n* `github` - GitHub"
1061
- },
1062
- "provider_display": {
1063
- "type": "string",
1064
- "readOnly": true
1065
- },
1066
- "provider_username": {
1067
- "type": "string",
1068
- "readOnly": true,
1069
- "description": "Username on the OAuth provider platform"
1070
- },
1071
- "provider_email": {
1072
- "type": "string",
1073
- "format": "email",
1074
- "readOnly": true,
1075
- "description": "Email from OAuth provider (may differ from user.email)"
1076
- },
1077
- "provider_avatar_url": {
1078
- "type": "string",
1079
- "format": "uri",
1080
- "readOnly": true,
1081
- "description": "Avatar URL from OAuth provider"
1082
- },
1083
- "connected_at": {
1084
- "type": "string",
1085
- "format": "date-time",
1086
- "readOnly": true,
1087
- "description": "When this OAuth connection was created"
1088
- },
1089
- "last_login_at": {
1090
- "type": "string",
1091
- "format": "date-time",
1092
- "readOnly": true,
1093
- "description": "Last time this OAuth connection was used for login"
1094
- }
1095
- },
1096
- "required": [
1097
- "connected_at",
1098
- "id",
1099
- "last_login_at",
1100
- "provider",
1101
- "provider_avatar_url",
1102
- "provider_display",
1103
- "provider_email",
1104
- "provider_username"
1105
- ]
1106
- },
1107
- "OAuthDisconnectRequestRequest": {
1108
- "type": "object",
1109
- "description": "Request to disconnect OAuth provider.",
1110
- "properties": {
1111
- "provider": {
1112
- "enum": [
1113
- "github"
1114
- ],
1115
- "type": "string",
1116
- "x-spec-enum-id": "c2a91afcd0429742",
1117
- "description": "OAuth provider to disconnect\n\n* `github` - GitHub"
1118
- }
1119
- },
1120
- "required": [
1121
- "provider"
1122
- ]
1123
- },
1124
- "OAuthError": {
1125
- "type": "object",
1126
- "description": "Error response for OAuth endpoints.",
1127
- "properties": {
1128
- "error": {
1129
- "type": "string",
1130
- "description": "Error code"
1131
- },
1132
- "error_description": {
1133
- "type": "string",
1134
- "description": "Human-readable error description"
1135
- }
1136
- },
1137
- "required": [
1138
- "error"
1139
- ]
1140
- },
1141
- "OAuthProvidersResponse": {
1142
- "type": "object",
1143
- "description": "Response with available OAuth providers.",
1144
- "properties": {
1145
- "providers": {
1146
- "type": "array",
1147
- "items": {
1148
- "type": "object",
1149
- "additionalProperties": {}
1150
- },
1151
- "description": "List of available OAuth providers"
1152
- }
1153
- },
1154
- "required": [
1155
- "providers"
1156
- ]
1157
- },
1158
- "OAuthTokenResponse": {
1159
- "type": "object",
1160
- "description": "Response with JWT tokens after OAuth authentication.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- access/refresh/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- access/refresh/user: populated",
1161
- "properties": {
1162
- "requires_2fa": {
1163
- "type": "boolean",
1164
- "default": false,
1165
- "description": "True if 2FA verification is required"
1166
- },
1167
- "session_id": {
1168
- "type": [
1169
- "string",
1170
- "null"
1171
- ],
1172
- "format": "uuid",
1173
- "description": "2FA session ID (only when requires_2fa=True)"
1174
- },
1175
- "access": {
1176
- "type": [
1177
- "string",
1178
- "null"
1179
- ],
1180
- "description": "JWT access token (null when requires_2fa=True)"
1181
- },
1182
- "refresh": {
1183
- "type": [
1184
- "string",
1185
- "null"
1186
- ],
1187
- "description": "JWT refresh token (null when requires_2fa=True)"
1188
- },
1189
- "user": {
1190
- "type": [
1191
- "object",
1192
- "null"
1193
- ],
1194
- "additionalProperties": {},
1195
- "description": "Authenticated user info (null when requires_2fa=True)"
1196
- },
1197
- "is_new_user": {
1198
- "type": "boolean",
1199
- "description": "True if a new user was created during this OAuth flow"
1200
- },
1201
- "is_new_connection": {
1202
- "type": "boolean",
1203
- "description": "True if a new OAuth connection was created"
1204
- },
1205
- "should_prompt_2fa": {
1206
- "type": "boolean",
1207
- "description": "True if user should be prompted to enable 2FA"
1208
- }
1209
- },
1210
- "required": [
1211
- "is_new_connection",
1212
- "is_new_user"
1213
- ]
1214
- },
1215
- "OTPErrorResponse": {
1216
- "type": "object",
1217
- "description": "Typed error response for OTP operations.\n\nerror_code values:\n - invalid_identifier — malformed email\n - cooldown — too soon after last request (retry_after = seconds)\n - hourly_limit — hourly quota exceeded (retry_after = seconds until reset)\n - daily_limit — daily quota exceeded (retry_after = seconds until reset)\n - rate_limited — IP-level rate limit hit (no retry_after)\n - user_creation_failed — internal error creating account\n - send_failed — transport error (email / SMS)\n - internal_error — unexpected server error",
1218
- "properties": {
1219
- "error": {
1220
- "type": "string",
1221
- "description": "Human-readable error message"
1222
- },
1223
- "error_code": {
1224
- "type": [
1225
- "string",
1226
- "null"
1227
- ],
1228
- "description": "Machine-readable error code"
1229
- },
1230
- "retry_after": {
1231
- "type": [
1232
- "integer",
1233
- "null"
1234
- ],
1235
- "description": "Seconds until the client may retry (present only for rate-limit errors)"
1236
- }
1237
- },
1238
- "required": [
1239
- "error"
1240
- ]
1241
- },
1242
- "OTPRequestRequest": {
1243
- "type": "object",
1244
- "description": "Serializer for OTP request.",
1245
- "properties": {
1246
- "identifier": {
1247
- "type": "string",
1248
- "minLength": 1,
1249
- "description": "Email address for OTP delivery"
1250
- },
1251
- "source_url": {
1252
- "type": "string",
1253
- "format": "uri",
1254
- "description": "Source URL for tracking registration (e.g., https://my.djangocfg.com)"
1255
- }
1256
- },
1257
- "required": [
1258
- "identifier"
1259
- ]
1260
- },
1261
- "OTPRequestResponse": {
1262
- "type": "object",
1263
- "description": "OTP request response.",
1264
- "properties": {
1265
- "message": {
1266
- "type": "string",
1267
- "description": "Success message"
1268
- }
1269
- },
1270
- "required": [
1271
- "message"
1272
- ]
1273
- },
1274
- "OTPVerifyRequest": {
1275
- "type": "object",
1276
- "description": "Serializer for OTP verification.",
1277
- "properties": {
1278
- "identifier": {
1279
- "type": "string",
1280
- "minLength": 1,
1281
- "description": "Email address used for OTP request"
1282
- },
1283
- "otp": {
1284
- "type": "string",
1285
- "minLength": 6,
1286
- "maxLength": 6
1287
- },
1288
- "source_url": {
1289
- "type": "string",
1290
- "format": "uri",
1291
- "description": "Source URL for tracking login (e.g., https://my.djangocfg.com)"
1292
- }
1293
- },
1294
- "required": [
1295
- "identifier",
1296
- "otp"
1297
- ]
1298
- },
1299
- "OTPVerifyResponse": {
1300
- "type": "object",
1301
- "description": "OTP verification response.\n\nWhen 2FA is required:\n- requires_2fa: True\n- session_id: UUID of 2FA verification session\n- refresh/access/user: null\n\nWhen 2FA is not required:\n- requires_2fa: False\n- session_id: null\n- refresh/access/user: populated",
1302
- "properties": {
1303
- "requires_2fa": {
1304
- "type": "boolean",
1305
- "default": false,
1306
- "description": "Whether 2FA verification is required"
1307
- },
1308
- "session_id": {
1309
- "type": [
1310
- "string",
1311
- "null"
1312
- ],
1313
- "format": "uuid",
1314
- "description": "2FA session ID (if requires_2fa is True)"
1315
- },
1316
- "refresh": {
1317
- "type": [
1318
- "string",
1319
- "null"
1320
- ],
1321
- "description": "JWT refresh token (if requires_2fa is False)"
1322
- },
1323
- "access": {
1324
- "type": [
1325
- "string",
1326
- "null"
1327
- ],
1328
- "description": "JWT access token (if requires_2fa is False)"
1329
- },
1330
- "user": {
1331
- "oneOf": [
1332
- {
1333
- "$ref": "#/components/schemas/User"
1334
- },
1335
- {
1336
- "type": "null"
1337
- }
1338
- ],
1339
- "description": "User information (if requires_2fa is False)"
1340
- },
1341
- "should_prompt_2fa": {
1342
- "type": "boolean",
1343
- "description": "Whether user should be prompted to enable 2FA"
1344
- }
1345
- }
1346
- },
1347
- "PatchedUserProfileUpdateRequest": {
1348
- "type": "object",
1349
- "description": "Serializer for updating user profile.",
1350
- "properties": {
1351
- "first_name": {
1352
- "type": "string",
1353
- "maxLength": 50
1354
- },
1355
- "last_name": {
1356
- "type": "string",
1357
- "maxLength": 50
1358
- },
1359
- "company": {
1360
- "type": "string",
1361
- "maxLength": 100
1362
- },
1363
- "phone": {
1364
- "type": "string",
1365
- "maxLength": 20
1366
- },
1367
- "position": {
1368
- "type": "string",
1369
- "maxLength": 100
1370
- },
1371
- "language": {
1372
- "type": "string",
1373
- "maxLength": 10
1374
- }
1375
- }
1376
- },
1377
- "TokenRefresh": {
1378
- "type": "object",
1379
- "properties": {
1380
- "access": {
1381
- "type": "string",
1382
- "readOnly": true
1383
- },
1384
- "refresh": {
1385
- "type": "string"
1386
- }
1387
- },
1388
- "required": [
1389
- "access",
1390
- "refresh"
1391
- ]
1392
- },
1393
- "TokenRefreshRequest": {
1394
- "type": "object",
1395
- "properties": {
1396
- "refresh": {
1397
- "type": "string",
1398
- "minLength": 1
1399
- }
1400
- },
1401
- "required": [
1402
- "refresh"
1403
- ]
1404
- },
1405
- "User": {
1406
- "type": "object",
1407
- "description": "Serializer for user details.",
1408
- "properties": {
1409
- "id": {
1410
- "type": "integer",
1411
- "readOnly": true
1412
- },
1413
- "email": {
1414
- "type": "string",
1415
- "format": "email",
1416
- "readOnly": true
1417
- },
1418
- "first_name": {
1419
- "type": "string",
1420
- "maxLength": 50
1421
- },
1422
- "last_name": {
1423
- "type": "string",
1424
- "maxLength": 50
1425
- },
1426
- "full_name": {
1427
- "type": "string",
1428
- "description": "Get user's full name.",
1429
- "readOnly": true
1430
- },
1431
- "initials": {
1432
- "type": "string",
1433
- "description": "Get user's initials for avatar fallback.",
1434
- "readOnly": true
1435
- },
1436
- "display_username": {
1437
- "type": "string",
1438
- "description": "Get formatted username for display.",
1439
- "readOnly": true
1440
- },
1441
- "company": {
1442
- "type": "string",
1443
- "maxLength": 100
1444
- },
1445
- "phone": {
1446
- "type": "string",
1447
- "maxLength": 20
1448
- },
1449
- "position": {
1450
- "type": "string",
1451
- "maxLength": 100
1452
- },
1453
- "language": {
1454
- "type": "string",
1455
- "maxLength": 10
1456
- },
1457
- "avatar": {
1458
- "type": [
1459
- "string",
1460
- "null"
1461
- ],
1462
- "format": "uri",
1463
- "readOnly": true
1464
- },
1465
- "is_staff": {
1466
- "type": "boolean",
1467
- "readOnly": true,
1468
- "title": "Staff status",
1469
- "description": "Designates whether the user can log into this admin site."
1470
- },
1471
- "is_superuser": {
1472
- "type": "boolean",
1473
- "readOnly": true,
1474
- "title": "Superuser status",
1475
- "description": "Designates that this user has all permissions without explicitly assigning them."
1476
- },
1477
- "date_joined": {
1478
- "type": "string",
1479
- "format": "date-time",
1480
- "readOnly": true
1481
- },
1482
- "last_login": {
1483
- "type": [
1484
- "string",
1485
- "null"
1486
- ],
1487
- "format": "date-time",
1488
- "readOnly": true
1489
- },
1490
- "unanswered_messages_count": {
1491
- "type": "integer",
1492
- "readOnly": true,
1493
- "default": 0
1494
- },
1495
- "centrifugo": {
1496
- "oneOf": [
1497
- {
1498
- "$ref": "#/components/schemas/CentrifugoToken"
1499
- },
1500
- {
1501
- "type": "null"
1502
- }
1503
- ],
1504
- "readOnly": true
1505
- }
1506
- },
1507
- "required": [
1508
- "avatar",
1509
- "centrifugo",
1510
- "date_joined",
1511
- "display_username",
1512
- "email",
1513
- "full_name",
1514
- "id",
1515
- "initials",
1516
- "is_staff",
1517
- "is_superuser",
1518
- "last_login",
1519
- "unanswered_messages_count"
1520
- ]
1521
- },
1522
- "UserProfileUpdateRequest": {
1523
- "type": "object",
1524
- "description": "Serializer for updating user profile.",
1525
- "properties": {
1526
- "first_name": {
1527
- "type": "string",
1528
- "maxLength": 50
1529
- },
1530
- "last_name": {
1531
- "type": "string",
1532
- "maxLength": 50
1533
- },
1534
- "company": {
1535
- "type": "string",
1536
- "maxLength": 100
1537
- },
1538
- "phone": {
1539
- "type": "string",
1540
- "maxLength": 20
1541
- },
1542
- "position": {
1543
- "type": "string",
1544
- "maxLength": 100
1545
- },
1546
- "language": {
1547
- "type": "string",
1548
- "maxLength": 10
1549
- }
1550
- }
1551
- }
1552
- },
1553
- "securitySchemes": {
1554
- "cookieAuth": {
1555
- "type": "apiKey",
1556
- "in": "cookie",
1557
- "name": "sessionid"
1558
- },
1559
- "jwtAuth": {
1560
- "type": "http",
1561
- "scheme": "bearer",
1562
- "bearerFormat": "JWT"
1563
- },
1564
- "jwtAuthWithLastLogin": {
1565
- "type": "http",
1566
- "scheme": "bearer",
1567
- "bearerFormat": "JWT"
1568
- }
1569
- }
1570
- },
1571
- "servers": [
1572
- {
1573
- "url": "http://localhost:8000"
1574
- }
1575
- ]
1576
- }