@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,135 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- /**
4
- * Zod Validation Events - Browser CustomEvent integration
5
- *
6
- * Dispatches browser CustomEvents when Zod validation fails, allowing
7
- * React/frontend apps to listen and handle validation errors globally.
8
- *
9
- * @example
10
- * ```typescript
11
- * // In your React app
12
- * window.addEventListener('zod-validation-error', (event) => {
13
- * const { operation, path, method, error, response } = event.detail;
14
- * console.error(`Validation failed for ${method} ${path}`, error);
15
- * // Show toast notification, log to Sentry, etc.
16
- * });
17
- * ```
18
- */
19
-
20
- import type { ZodError } from 'zod'
21
-
22
- /**
23
- * Validation error event detail
24
- */
25
- export interface ValidationErrorDetail {
26
- /** Operation/function name that failed validation */
27
- operation: string
28
- /** API endpoint path */
29
- path: string
30
- /** HTTP method */
31
- method: string
32
- /** Zod validation error */
33
- error: ZodError
34
- /** Raw response data that failed validation */
35
- response: any
36
- /** Timestamp of the error */
37
- timestamp: Date
38
- }
39
-
40
- /**
41
- * Custom event type for Zod validation errors
42
- */
43
- export type ValidationErrorEvent = CustomEvent<ValidationErrorDetail>
44
-
45
- /**
46
- * Dispatch a Zod validation error event.
47
- *
48
- * Only dispatches in browser environment (when window is defined).
49
- * Safe to call in Node.js/SSR - will be a no-op.
50
- *
51
- * @param detail - Validation error details
52
- */
53
- export function dispatchValidationError(detail: ValidationErrorDetail): void {
54
- // Check if running in browser
55
- if (typeof window === 'undefined') {
56
- return
57
- }
58
-
59
- try {
60
- const event = new CustomEvent<ValidationErrorDetail>('zod-validation-error', {
61
- detail,
62
- bubbles: true,
63
- cancelable: false,
64
- })
65
-
66
- window.dispatchEvent(event)
67
- } catch (error) {
68
- // Silently fail - validation event dispatch should never crash the app
69
- console.warn('Failed to dispatch validation error event:', error)
70
- }
71
- }
72
-
73
- /**
74
- * Add a global listener for Zod validation errors.
75
- *
76
- * @param callback - Function to call when validation error occurs
77
- * @returns Cleanup function to remove the listener
78
- *
79
- * @example
80
- * ```typescript
81
- * const cleanup = onValidationError(({ operation, error }) => {
82
- * toast.error(`Validation failed in ${operation}`);
83
- * logToSentry(error);
84
- * });
85
- *
86
- * // Later, remove listener
87
- * cleanup();
88
- * ```
89
- */
90
- export function onValidationError(
91
- callback: (detail: ValidationErrorDetail) => void
92
- ): () => void {
93
- if (typeof window === 'undefined') {
94
- // Return no-op cleanup function for SSR
95
- return () => {}
96
- }
97
-
98
- const handler = (event: Event) => {
99
- if (event instanceof CustomEvent) {
100
- callback(event.detail)
101
- }
102
- }
103
-
104
- window.addEventListener('zod-validation-error', handler)
105
-
106
- // Return cleanup function
107
- return () => {
108
- window.removeEventListener('zod-validation-error', handler)
109
- }
110
- }
111
-
112
- /**
113
- * Format Zod error for logging/display.
114
- *
115
- * @param error - Zod validation error
116
- * @returns Formatted error message
117
- */
118
- export function formatZodError(error: ZodError): string {
119
- const issues = error.issues.map((issue, index) => {
120
- const path = issue.path.join('.') || 'root'
121
- const parts = [`${index + 1}. ${path}: ${issue.message}`]
122
-
123
- if ('expected' in issue && issue.expected) {
124
- parts.push(` Expected: ${issue.expected}`)
125
- }
126
-
127
- if ('received' in issue && issue.received) {
128
- parts.push(` Received: ${issue.received}`)
129
- }
130
-
131
- return parts.join('\n')
132
- })
133
-
134
- return issues.join('\n')
135
- }
@@ -1,83 +0,0 @@
1
- # Django CFG API - Typescript Client
2
-
3
- Auto-generated. **Do not edit manually.**
4
-
5
- ```bash
6
- python manage.py generate_client --groups cfg_totp --typescript
7
- ```
8
-
9
- ## Stats
10
-
11
- | | |
12
- |---|---|
13
- | Version | 3.1.0 |
14
- | Operations | 9 |
15
- | Schemas | 14 |
16
-
17
- ## Resources
18
-
19
- - **Backup Codes** (2 ops)
20
- - **TOTP Management** (2 ops)
21
- - **TOTP Setup** (2 ops)
22
- - **TOTP Verification** (2 ops)
23
- - **totp** (1 ops)
24
-
25
- ## Operations
26
-
27
- **Backup Codes:**
28
- - `POST` /cfg/totp/backup-codes/regenerate/ → `cfg_totp_backup_codes_regenerate_create`
29
- - `GET` /cfg/totp/backup-codes/ → `cfg_totp_backup_codes_retrieve`
30
-
31
- **TOTP Management:**
32
- - `GET` /cfg/totp/devices/ → `cfg_totp_devices_retrieve`
33
- - `POST` /cfg/totp/disable/ → `cfg_totp_disable_create`
34
-
35
- **TOTP Setup:**
36
- - `POST` /cfg/totp/setup/confirm/ → `cfg_totp_setup_confirm_create`
37
- - `POST` /cfg/totp/setup/ → `cfg_totp_setup_create`
38
-
39
- **TOTP Verification:**
40
- - `POST` /cfg/totp/verify/backup/ → `cfg_totp_verify_backup_create`
41
- - `POST` /cfg/totp/verify/ → `cfg_totp_verify_create`
42
-
43
- **totp:**
44
- - `DELETE` /cfg/totp/devices/{id}/ → `cfg_totp_devices_destroy`
45
-
46
- ## Usage
47
-
48
- ```typescript
49
- import { APIClient } from './';
50
-
51
- const client = new APIClient({ baseUrl, token });
52
-
53
- await client.backup codes.retrieve({ id: 1 });
54
- await client.backup codes.create({ ... });
55
- await client.totp management.retrieve({ id: 1 });
56
- await client.totp management.create({ ... });
57
- ```
58
-
59
- **SWR Hooks:**
60
- ```typescript
61
- import { useBackup codesList } from './hooks';
62
- const { data, isLoading } = useBackup codesList();
63
- ```
64
-
65
- ## How It Works
66
-
67
- ```
68
- DRF ViewSets → drf-spectacular → OpenAPI → IR Parser → Generator → This Client
69
- ```
70
-
71
- **Configuration** (`api/config.py`):
72
- ```python
73
- openapi_client = OpenAPIClientConfig(
74
- enabled=True,
75
- groups=[OpenAPIGroupConfig(name="cfg_totp", apps=["..."])],
76
- generate_zod_schemas=True, # → schemas.ts
77
- generate_fetchers=True, # → fetchers.ts
78
- generate_swr_hooks=True, # → hooks.ts
79
- )
80
- ```
81
-
82
- @see https://djangocfg.com/docs/features/api-generation
83
-
@@ -1,34 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- /**
4
- * Typed Fetchers - Universal API functions
5
- *
6
- * Auto-generated from OpenAPI specification.
7
- * These functions work in any JavaScript environment.
8
- *
9
- * Features:
10
- * - Runtime validation with Zod
11
- * - Type-safe parameters and responses
12
- * - Works with any data-fetching library (SWR, React Query, etc)
13
- * - Server Component compatible
14
- *
15
- * Usage:
16
- * ```typescript
17
- * import * as fetchers from './fetchers'
18
- *
19
- * // Direct usage
20
- * const user = await fetchers.getUser(1)
21
- *
22
- * // With SWR
23
- * const { data } = useSWR('user-1', () => fetchers.getUser(1))
24
- *
25
- * // With React Query
26
- * const { data } = useQuery(['user', 1], () => fetchers.getUser(1))
27
- * ```
28
- */
29
-
30
- export * from './totp'
31
- export * from './totp__backup_codes'
32
- export * from './totp__totp_management'
33
- export * from './totp__totp_setup'
34
- export * from './totp__totp_verification'
@@ -1,50 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- /**
4
- * Typed fetchers for Totp
5
- *
6
- * Universal functions that work in any environment:
7
- * - Next.js (App Router / Pages Router / Server Components)
8
- * - React Native
9
- * - Node.js backend
10
- *
11
- * These fetchers use Zod schemas for runtime validation.
12
- *
13
- * Usage:
14
- * ```typescript
15
- * // Configure API once (in your app entry point)
16
- * import { configureAPI } from '../../api-instance'
17
- * configureAPI({ baseUrl: 'https://api.example.com' })
18
- *
19
- * // Then use fetchers anywhere
20
- * const users = await getUsers({ page: 1 })
21
- *
22
- * // With SWR
23
- * const { data } = useSWR(['users', params], () => getUsers(params))
24
- *
25
- * // With React Query
26
- * const { data } = useQuery(['users', params], () => getUsers(params))
27
- *
28
- * // In Server Component or SSR (pass custom client)
29
- * import { API } from '../../index'
30
- * const api = new API('https://api.example.com')
31
- * const users = await getUsers({ page: 1 }, api)
32
- * ```
33
- */
34
- import { consola } from 'consola'
35
- import { getAPIInstance } from '../../api-instance'
36
-
37
- /**
38
- * API operation
39
- *
40
- * @method DELETE
41
- * @path /cfg/totp/devices/{id}/
42
- */
43
- export async function deleteTotpDevicesDestroy( id: string, client?: any
44
- ): Promise<void> {
45
- const api = client || getAPIInstance()
46
- const response = await api.totp.devicesDestroy(id)
47
- return response
48
- }
49
-
50
-
@@ -1,153 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- /**
4
- * Typed fetchers for Backup Codes
5
- *
6
- * Universal functions that work in any environment:
7
- * - Next.js (App Router / Pages Router / Server Components)
8
- * - React Native
9
- * - Node.js backend
10
- *
11
- * These fetchers use Zod schemas for runtime validation.
12
- *
13
- * Usage:
14
- * ```typescript
15
- * // Configure API once (in your app entry point)
16
- * import { configureAPI } from '../../api-instance'
17
- * configureAPI({ baseUrl: 'https://api.example.com' })
18
- *
19
- * // Then use fetchers anywhere
20
- * const users = await getUsers({ page: 1 })
21
- *
22
- * // With SWR
23
- * const { data } = useSWR(['users', params], () => getUsers(params))
24
- *
25
- * // With React Query
26
- * const { data } = useQuery(['users', params], () => getUsers(params))
27
- *
28
- * // In Server Component or SSR (pass custom client)
29
- * import { API } from '../../index'
30
- * const api = new API('https://api.example.com')
31
- * const users = await getUsers({ page: 1 }, api)
32
- * ```
33
- */
34
- import { consola } from 'consola'
35
- import { BackupCodesRegenerateRequestSchema, type BackupCodesRegenerateRequest } from '../schemas/BackupCodesRegenerateRequest.schema'
36
- import { BackupCodesRegenerateResponseSchema, type BackupCodesRegenerateResponse } from '../schemas/BackupCodesRegenerateResponse.schema'
37
- import { BackupCodesStatusSchema, type BackupCodesStatus } from '../schemas/BackupCodesStatus.schema'
38
- import { getAPIInstance } from '../../api-instance'
39
-
40
- /**
41
- * API operation
42
- *
43
- * @method GET
44
- * @path /cfg/totp/backup-codes/
45
- */
46
- export async function getTotpBackupCodesRetrieve( client?: any
47
- ): Promise<BackupCodesStatus> {
48
- const api = client || getAPIInstance()
49
- const response = await api.backup_codes.totpBackupCodesRetrieve()
50
- try {
51
- return BackupCodesStatusSchema.parse(response)
52
- } catch (error) {
53
- // Zod validation error - log detailed information
54
- consola.error('❌ Zod Validation Failed');
55
- consola.box(`getTotpBackupCodesRetrieve\nPath: /cfg/totp/backup-codes/\nMethod: GET`);
56
-
57
- if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
58
- consola.error('Validation Issues:');
59
- (error as any).issues.forEach((issue: any, index: number) => {
60
- consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
61
- consola.error(` ├─ Message: ${issue.message}`);
62
- if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
63
- if (issue.received) consola.error(` └─ Received: ${issue.received}`);
64
- });
65
- }
66
-
67
- consola.error('Response data:', response);
68
-
69
- // Dispatch browser CustomEvent (only if window is defined)
70
- if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
71
- try {
72
- const event = new CustomEvent('zod-validation-error', {
73
- detail: {
74
- operation: 'getTotpBackupCodesRetrieve',
75
- path: '/cfg/totp/backup-codes/',
76
- method: 'GET',
77
- error: error,
78
- response: response,
79
- timestamp: new Date(),
80
- },
81
- bubbles: true,
82
- cancelable: false,
83
- });
84
- window.dispatchEvent(event);
85
- } catch (eventError) {
86
- // Silently fail - event dispatch should never crash the app
87
- consola.warn('Failed to dispatch validation error event:', eventError);
88
- }
89
- }
90
-
91
- // Re-throw the error
92
- throw error;
93
- }
94
- }
95
-
96
-
97
- /**
98
- * API operation
99
- *
100
- * @method POST
101
- * @path /cfg/totp/backup-codes/regenerate/
102
- */
103
- export async function createTotpBackupCodesRegenerateCreate( data: BackupCodesRegenerateRequest, client?: any
104
- ): Promise<BackupCodesRegenerateResponse> {
105
- const api = client || getAPIInstance()
106
- const response = await api.backup_codes.totpBackupCodesRegenerateCreate(data)
107
- try {
108
- return BackupCodesRegenerateResponseSchema.parse(response)
109
- } catch (error) {
110
- // Zod validation error - log detailed information
111
- consola.error('❌ Zod Validation Failed');
112
- consola.box(`createTotpBackupCodesRegenerateCreate\nPath: /cfg/totp/backup-codes/regenerate/\nMethod: POST`);
113
-
114
- if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
115
- consola.error('Validation Issues:');
116
- (error as any).issues.forEach((issue: any, index: number) => {
117
- consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
118
- consola.error(` ├─ Message: ${issue.message}`);
119
- if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
120
- if (issue.received) consola.error(` └─ Received: ${issue.received}`);
121
- });
122
- }
123
-
124
- consola.error('Response data:', response);
125
-
126
- // Dispatch browser CustomEvent (only if window is defined)
127
- if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
128
- try {
129
- const event = new CustomEvent('zod-validation-error', {
130
- detail: {
131
- operation: 'createTotpBackupCodesRegenerateCreate',
132
- path: '/cfg/totp/backup-codes/regenerate/',
133
- method: 'POST',
134
- error: error,
135
- response: response,
136
- timestamp: new Date(),
137
- },
138
- bubbles: true,
139
- cancelable: false,
140
- });
141
- window.dispatchEvent(event);
142
- } catch (eventError) {
143
- // Silently fail - event dispatch should never crash the app
144
- consola.warn('Failed to dispatch validation error event:', eventError);
145
- }
146
- }
147
-
148
- // Re-throw the error
149
- throw error;
150
- }
151
- }
152
-
153
-
@@ -1,109 +0,0 @@
1
- // @ts-nocheck
2
- // Auto-generated by DjangoCFG - see CLAUDE.md
3
- /**
4
- * Typed fetchers for TOTP Management
5
- *
6
- * Universal functions that work in any environment:
7
- * - Next.js (App Router / Pages Router / Server Components)
8
- * - React Native
9
- * - Node.js backend
10
- *
11
- * These fetchers use Zod schemas for runtime validation.
12
- *
13
- * Usage:
14
- * ```typescript
15
- * // Configure API once (in your app entry point)
16
- * import { configureAPI } from '../../api-instance'
17
- * configureAPI({ baseUrl: 'https://api.example.com' })
18
- *
19
- * // Then use fetchers anywhere
20
- * const users = await getUsers({ page: 1 })
21
- *
22
- * // With SWR
23
- * const { data } = useSWR(['users', params], () => getUsers(params))
24
- *
25
- * // With React Query
26
- * const { data } = useQuery(['users', params], () => getUsers(params))
27
- *
28
- * // In Server Component or SSR (pass custom client)
29
- * import { API } from '../../index'
30
- * const api = new API('https://api.example.com')
31
- * const users = await getUsers({ page: 1 }, api)
32
- * ```
33
- */
34
- import { consola } from 'consola'
35
- import { DeviceListResponseSchema, type DeviceListResponse } from '../schemas/DeviceListResponse.schema'
36
- import { DisableRequestSchema, type DisableRequest } from '../schemas/DisableRequest.schema'
37
- import { getAPIInstance } from '../../api-instance'
38
-
39
- /**
40
- * API operation
41
- *
42
- * @method GET
43
- * @path /cfg/totp/devices/
44
- */
45
- export async function getTotpDevicesRetrieve( client?: any
46
- ): Promise<DeviceListResponse> {
47
- const api = client || getAPIInstance()
48
- const response = await api.totp_management.totpDevicesRetrieve()
49
- try {
50
- return DeviceListResponseSchema.parse(response)
51
- } catch (error) {
52
- // Zod validation error - log detailed information
53
- consola.error('❌ Zod Validation Failed');
54
- consola.box(`getTotpDevicesRetrieve\nPath: /cfg/totp/devices/\nMethod: GET`);
55
-
56
- if (error instanceof Error && 'issues' in error && Array.isArray((error as any).issues)) {
57
- consola.error('Validation Issues:');
58
- (error as any).issues.forEach((issue: any, index: number) => {
59
- consola.error(` ${index + 1}. ${issue.path.join('.') || 'root'}`);
60
- consola.error(` ├─ Message: ${issue.message}`);
61
- if (issue.expected) consola.error(` ├─ Expected: ${issue.expected}`);
62
- if (issue.received) consola.error(` └─ Received: ${issue.received}`);
63
- });
64
- }
65
-
66
- consola.error('Response data:', response);
67
-
68
- // Dispatch browser CustomEvent (only if window is defined)
69
- if (typeof window !== 'undefined' && error instanceof Error && 'issues' in error) {
70
- try {
71
- const event = new CustomEvent('zod-validation-error', {
72
- detail: {
73
- operation: 'getTotpDevicesRetrieve',
74
- path: '/cfg/totp/devices/',
75
- method: 'GET',
76
- error: error,
77
- response: response,
78
- timestamp: new Date(),
79
- },
80
- bubbles: true,
81
- cancelable: false,
82
- });
83
- window.dispatchEvent(event);
84
- } catch (eventError) {
85
- // Silently fail - event dispatch should never crash the app
86
- consola.warn('Failed to dispatch validation error event:', eventError);
87
- }
88
- }
89
-
90
- // Re-throw the error
91
- throw error;
92
- }
93
- }
94
-
95
-
96
- /**
97
- * API operation
98
- *
99
- * @method POST
100
- * @path /cfg/totp/disable/
101
- */
102
- export async function createTotpDisableCreate( data: DisableRequest, client?: any
103
- ): Promise<any> {
104
- const api = client || getAPIInstance()
105
- const response = await api.totp_management.totpDisableCreate(data)
106
- return response
107
- }
108
-
109
-