@djangocfg/api 2.1.87 → 2.1.89

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 (59) hide show
  1. package/dist/auth-server.cjs +1963 -4
  2. package/dist/auth-server.cjs.map +1 -1
  3. package/dist/auth-server.d.cts +35 -1
  4. package/dist/auth-server.d.ts +35 -1
  5. package/dist/auth-server.mjs +1953 -4
  6. package/dist/auth-server.mjs.map +1 -1
  7. package/dist/auth.cjs +692 -497
  8. package/dist/auth.cjs.map +1 -1
  9. package/dist/auth.d.cts +18 -2
  10. package/dist/auth.d.ts +18 -2
  11. package/dist/auth.mjs +655 -460
  12. package/dist/auth.mjs.map +1 -1
  13. package/dist/clients.cjs +460 -383
  14. package/dist/clients.cjs.map +1 -1
  15. package/dist/clients.d.cts +26 -6
  16. package/dist/clients.d.ts +26 -6
  17. package/dist/clients.mjs +460 -383
  18. package/dist/clients.mjs.map +1 -1
  19. package/dist/hooks.cjs +130 -105
  20. package/dist/hooks.cjs.map +1 -1
  21. package/dist/hooks.d.cts +24 -4
  22. package/dist/hooks.d.ts +24 -4
  23. package/dist/hooks.mjs +130 -105
  24. package/dist/hooks.mjs.map +1 -1
  25. package/dist/index.cjs +373 -311
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.cts +54 -8
  28. package/dist/index.d.ts +54 -8
  29. package/dist/index.mjs +373 -311
  30. package/dist/index.mjs.map +1 -1
  31. package/package.json +3 -3
  32. package/src/auth/context/AccountsContext.tsx +3 -3
  33. package/src/auth/context/AuthContext.tsx +56 -10
  34. package/src/auth/hooks/index.ts +3 -0
  35. package/src/auth/hooks/useProfileCache.ts +1 -1
  36. package/src/auth/hooks/useTokenRefresh.ts +161 -0
  37. package/src/auth/middlewares/index.ts +8 -1
  38. package/src/auth/middlewares/tokenRefresh.ts +158 -0
  39. package/src/generated/cfg_accounts/CLAUDE.md +2 -9
  40. package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +2 -1
  41. package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +2 -1
  42. package/src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts +15 -0
  43. package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
  44. package/src/generated/cfg_accounts/accounts/models.ts +0 -1
  45. package/src/generated/cfg_accounts/accounts__user_profile/client.ts +4 -2
  46. package/src/generated/cfg_accounts/accounts__user_profile/models.ts +9 -1
  47. package/src/generated/cfg_accounts/client.ts +18 -0
  48. package/src/generated/cfg_accounts/index.ts +3 -1
  49. package/src/generated/cfg_accounts/schema.json +2 -2
  50. package/src/generated/cfg_centrifugo/CLAUDE.md +1 -8
  51. package/src/generated/cfg_centrifugo/client.ts +18 -0
  52. package/src/generated/cfg_centrifugo/index.ts +3 -1
  53. package/src/generated/cfg_totp/CLAUDE.md +1 -8
  54. package/src/generated/cfg_totp/client.ts +18 -0
  55. package/src/generated/cfg_totp/index.ts +3 -1
  56. package/src/generated/cfg_totp/totp/models.ts +2 -0
  57. package/src/generated/cfg_webpush/CLAUDE.md +1 -8
  58. package/src/generated/cfg_webpush/client.ts +18 -0
  59. package/src/generated/cfg_webpush/index.ts +3 -1
@@ -223,10 +223,17 @@ interface User$2 {
223
223
  is_superuser: boolean;
224
224
  date_joined: string;
225
225
  last_login?: string | null;
226
- /** Get count of unanswered messages for the user. */
227
226
  unanswered_messages_count: number;
228
227
  centrifugo: CentrifugoToken$2 | null;
229
228
  }
229
+ /**
230
+ *
231
+ * Request model (no read-only fields).
232
+ */
233
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
234
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
235
+ avatar: File | Blob;
236
+ }
230
237
  /**
231
238
  * Serializer for updating user profile.
232
239
  *
@@ -285,7 +292,7 @@ declare class UserProfile {
285
292
  * Upload avatar image for the current authenticated user. Accepts
286
293
  * multipart/form-data with 'avatar' field.
287
294
  */
288
- accountsProfileAvatarCreate(data: FormData): Promise<User$2>;
295
+ accountsProfileAvatarCreate(data: CfgAccountsProfileAvatarCreateRequest$1): Promise<User$2>;
289
296
  /**
290
297
  * Partial update user profile
291
298
  *
@@ -403,7 +410,6 @@ interface User$1 {
403
410
  is_superuser: boolean;
404
411
  date_joined: string;
405
412
  last_login?: string | null;
406
- /** Get count of unanswered messages for the user. */
407
413
  unanswered_messages_count: number;
408
414
  centrifugo: CentrifugoToken$1 | null;
409
415
  }
@@ -564,6 +570,20 @@ declare const CentrifugoTokenSchema: z.ZodObject<{
564
570
  */
565
571
  type CentrifugoToken = z.infer<typeof CentrifugoTokenSchema>;
566
572
 
573
+ /**
574
+ * Zod schema for CfgAccountsProfileAvatarCreateRequest
575
+ *
576
+ * This schema provides runtime validation and type inference.
577
+ * */
578
+
579
+ declare const CfgAccountsProfileAvatarCreateRequestSchema: z.ZodObject<{
580
+ avatar: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>]>;
581
+ }, z.core.$strip>;
582
+ /**
583
+ * Infer TypeScript type from Zod schema
584
+ */
585
+ type CfgAccountsProfileAvatarCreateRequest = z.infer<typeof CfgAccountsProfileAvatarCreateRequestSchema>;
586
+
567
587
  /**
568
588
  * Zod schema for OAuthAuthorizeRequestRequest
569
589
  *
@@ -1074,7 +1094,7 @@ declare function getAccountsProfileRetrieve(client?: any): Promise<User>;
1074
1094
  * @method POST
1075
1095
  * @path /cfg/accounts/profile/avatar/
1076
1096
  */
1077
- declare function createAccountsProfileAvatarCreate(data: any, client?: any): Promise<User>;
1097
+ declare function createAccountsProfileAvatarCreate(data: CfgAccountsProfileAvatarCreateRequest, client?: any): Promise<User>;
1078
1098
  /**
1079
1099
  * Partial update user profile
1080
1100
  *
@@ -4561,7 +4581,7 @@ declare function useAccountsProfileRetrieve(client?: API$3): ReturnType<typeof u
4561
4581
  * @method POST
4562
4582
  * @path /cfg/accounts/profile/avatar/
4563
4583
  */
4564
- declare function useCreateAccountsProfileAvatarCreate(): (data: any, client?: API$3) => Promise<User>;
4584
+ declare function useCreateAccountsProfileAvatarCreate(): (data: CfgAccountsProfileAvatarCreateRequest, client?: API$3) => Promise<User>;
4565
4585
  /**
4566
4586
  * Partial update user profile
4567
4587
  *
@@ -5034,4 +5054,4 @@ declare const apiTotp: API$1;
5034
5054
  declare const apiWebPush: API;
5035
5055
  declare const apiCentrifugo: API$2;
5036
5056
 
5037
- export { API$3 as AccountsAPI, API$2 as CentrifugoAPI, index$7 as CentrifugoFetchers, index$1 as CentrifugoHooks, type CentrifugoToken, CentrifugoTokenSchema, index$8 as CentrifugoTypes, enums as Enums, type OAuthAuthorizeRequestRequest, OAuthAuthorizeRequestRequestSchema, type OAuthAuthorizeResponse, OAuthAuthorizeResponseSchema, type OAuthCallbackRequestRequest, OAuthCallbackRequestRequestSchema, type OAuthConnection, OAuthConnectionSchema, type OAuthDisconnectRequestRequest, OAuthDisconnectRequestRequestSchema, type OAuthError, OAuthErrorSchema, type OAuthProvidersResponse, OAuthProvidersResponseSchema, type OAuthTokenResponse, OAuthTokenResponseSchema, type OTPErrorResponse, OTPErrorResponseSchema, type OTPRequestRequest, OTPRequestRequestSchema, type OTPRequestResponse, OTPRequestResponseSchema, type OTPVerifyRequest, OTPVerifyRequestSchema, type OTPVerifyResponse, OTPVerifyResponseSchema, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type TokenRefresh, type TokenRefreshRequest, TokenRefreshRequestSchema, TokenRefreshSchema, API$1 as TotpAPI, index$5 as TotpFetchers, index as TotpHooks, index$6 as TotpTypes, type User, type UserProfileUpdateRequest, UserProfileUpdateRequestSchema, UserSchema, API as WebPushAPI, index$3 as WebPushFetchers, index$2 as WebPushHooks, index$4 as WebPushTypes, apiAccounts, apiCentrifugo, apiTotp, apiWebPush, createAccountsOauthDisconnectCreate, createAccountsOauthGithubAuthorizeCreate, createAccountsOauthGithubCallbackCreate, createAccountsOtpRequestCreate, createAccountsOtpVerifyCreate, createAccountsProfileAvatarCreate, createAccountsTokenRefreshCreate, getAccountsOauthConnectionsList, getAccountsOauthProvidersRetrieve, getAccountsProfileRetrieve, partialUpdateAccountsProfilePartialPartialUpdate, partialUpdateAccountsProfilePartialUpdate, partialUpdateAccountsProfileUpdatePartialUpdate, updateAccountsProfileUpdateUpdate, useAccountsOauthConnectionsList, useAccountsOauthProvidersRetrieve, useAccountsProfileRetrieve, useCreateAccountsOauthDisconnectCreate, useCreateAccountsOauthGithubAuthorizeCreate, useCreateAccountsOauthGithubCallbackCreate, useCreateAccountsOtpRequestCreate, useCreateAccountsOtpVerifyCreate, useCreateAccountsProfileAvatarCreate, useCreateAccountsTokenRefreshCreate, usePartialUpdateAccountsProfilePartialPartialUpdate, usePartialUpdateAccountsProfilePartialUpdate, usePartialUpdateAccountsProfileUpdatePartialUpdate, useUpdateAccountsProfileUpdateUpdate };
5057
+ export { API$3 as AccountsAPI, API$2 as CentrifugoAPI, index$7 as CentrifugoFetchers, index$1 as CentrifugoHooks, type CentrifugoToken, CentrifugoTokenSchema, index$8 as CentrifugoTypes, type CfgAccountsProfileAvatarCreateRequest, CfgAccountsProfileAvatarCreateRequestSchema, enums as Enums, type OAuthAuthorizeRequestRequest, OAuthAuthorizeRequestRequestSchema, type OAuthAuthorizeResponse, OAuthAuthorizeResponseSchema, type OAuthCallbackRequestRequest, OAuthCallbackRequestRequestSchema, type OAuthConnection, OAuthConnectionSchema, type OAuthDisconnectRequestRequest, OAuthDisconnectRequestRequestSchema, type OAuthError, OAuthErrorSchema, type OAuthProvidersResponse, OAuthProvidersResponseSchema, type OAuthTokenResponse, OAuthTokenResponseSchema, type OTPErrorResponse, OTPErrorResponseSchema, type OTPRequestRequest, OTPRequestRequestSchema, type OTPRequestResponse, OTPRequestResponseSchema, type OTPVerifyRequest, OTPVerifyRequestSchema, type OTPVerifyResponse, OTPVerifyResponseSchema, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type TokenRefresh, type TokenRefreshRequest, TokenRefreshRequestSchema, TokenRefreshSchema, API$1 as TotpAPI, index$5 as TotpFetchers, index as TotpHooks, index$6 as TotpTypes, type User, type UserProfileUpdateRequest, UserProfileUpdateRequestSchema, UserSchema, API as WebPushAPI, index$3 as WebPushFetchers, index$2 as WebPushHooks, index$4 as WebPushTypes, apiAccounts, apiCentrifugo, apiTotp, apiWebPush, createAccountsOauthDisconnectCreate, createAccountsOauthGithubAuthorizeCreate, createAccountsOauthGithubCallbackCreate, createAccountsOtpRequestCreate, createAccountsOtpVerifyCreate, createAccountsProfileAvatarCreate, createAccountsTokenRefreshCreate, getAccountsOauthConnectionsList, getAccountsOauthProvidersRetrieve, getAccountsProfileRetrieve, partialUpdateAccountsProfilePartialPartialUpdate, partialUpdateAccountsProfilePartialUpdate, partialUpdateAccountsProfileUpdatePartialUpdate, updateAccountsProfileUpdateUpdate, useAccountsOauthConnectionsList, useAccountsOauthProvidersRetrieve, useAccountsProfileRetrieve, useCreateAccountsOauthDisconnectCreate, useCreateAccountsOauthGithubAuthorizeCreate, useCreateAccountsOauthGithubCallbackCreate, useCreateAccountsOtpRequestCreate, useCreateAccountsOtpVerifyCreate, useCreateAccountsProfileAvatarCreate, useCreateAccountsTokenRefreshCreate, usePartialUpdateAccountsProfilePartialPartialUpdate, usePartialUpdateAccountsProfilePartialUpdate, usePartialUpdateAccountsProfileUpdatePartialUpdate, useUpdateAccountsProfileUpdateUpdate };
package/dist/clients.d.ts CHANGED
@@ -223,10 +223,17 @@ interface User$2 {
223
223
  is_superuser: boolean;
224
224
  date_joined: string;
225
225
  last_login?: string | null;
226
- /** Get count of unanswered messages for the user. */
227
226
  unanswered_messages_count: number;
228
227
  centrifugo: CentrifugoToken$2 | null;
229
228
  }
229
+ /**
230
+ *
231
+ * Request model (no read-only fields).
232
+ */
233
+ interface CfgAccountsProfileAvatarCreateRequest$1 {
234
+ /** Avatar image file (JPEG, PNG, GIF, WebP, max 5MB) */
235
+ avatar: File | Blob;
236
+ }
230
237
  /**
231
238
  * Serializer for updating user profile.
232
239
  *
@@ -285,7 +292,7 @@ declare class UserProfile {
285
292
  * Upload avatar image for the current authenticated user. Accepts
286
293
  * multipart/form-data with 'avatar' field.
287
294
  */
288
- accountsProfileAvatarCreate(data: FormData): Promise<User$2>;
295
+ accountsProfileAvatarCreate(data: CfgAccountsProfileAvatarCreateRequest$1): Promise<User$2>;
289
296
  /**
290
297
  * Partial update user profile
291
298
  *
@@ -403,7 +410,6 @@ interface User$1 {
403
410
  is_superuser: boolean;
404
411
  date_joined: string;
405
412
  last_login?: string | null;
406
- /** Get count of unanswered messages for the user. */
407
413
  unanswered_messages_count: number;
408
414
  centrifugo: CentrifugoToken$1 | null;
409
415
  }
@@ -564,6 +570,20 @@ declare const CentrifugoTokenSchema: z.ZodObject<{
564
570
  */
565
571
  type CentrifugoToken = z.infer<typeof CentrifugoTokenSchema>;
566
572
 
573
+ /**
574
+ * Zod schema for CfgAccountsProfileAvatarCreateRequest
575
+ *
576
+ * This schema provides runtime validation and type inference.
577
+ * */
578
+
579
+ declare const CfgAccountsProfileAvatarCreateRequestSchema: z.ZodObject<{
580
+ avatar: z.ZodUnion<readonly [z.ZodCustom<File, File>, z.ZodCustom<Blob, Blob>]>;
581
+ }, z.core.$strip>;
582
+ /**
583
+ * Infer TypeScript type from Zod schema
584
+ */
585
+ type CfgAccountsProfileAvatarCreateRequest = z.infer<typeof CfgAccountsProfileAvatarCreateRequestSchema>;
586
+
567
587
  /**
568
588
  * Zod schema for OAuthAuthorizeRequestRequest
569
589
  *
@@ -1074,7 +1094,7 @@ declare function getAccountsProfileRetrieve(client?: any): Promise<User>;
1074
1094
  * @method POST
1075
1095
  * @path /cfg/accounts/profile/avatar/
1076
1096
  */
1077
- declare function createAccountsProfileAvatarCreate(data: any, client?: any): Promise<User>;
1097
+ declare function createAccountsProfileAvatarCreate(data: CfgAccountsProfileAvatarCreateRequest, client?: any): Promise<User>;
1078
1098
  /**
1079
1099
  * Partial update user profile
1080
1100
  *
@@ -4561,7 +4581,7 @@ declare function useAccountsProfileRetrieve(client?: API$3): ReturnType<typeof u
4561
4581
  * @method POST
4562
4582
  * @path /cfg/accounts/profile/avatar/
4563
4583
  */
4564
- declare function useCreateAccountsProfileAvatarCreate(): (data: any, client?: API$3) => Promise<User>;
4584
+ declare function useCreateAccountsProfileAvatarCreate(): (data: CfgAccountsProfileAvatarCreateRequest, client?: API$3) => Promise<User>;
4565
4585
  /**
4566
4586
  * Partial update user profile
4567
4587
  *
@@ -5034,4 +5054,4 @@ declare const apiTotp: API$1;
5034
5054
  declare const apiWebPush: API;
5035
5055
  declare const apiCentrifugo: API$2;
5036
5056
 
5037
- export { API$3 as AccountsAPI, API$2 as CentrifugoAPI, index$7 as CentrifugoFetchers, index$1 as CentrifugoHooks, type CentrifugoToken, CentrifugoTokenSchema, index$8 as CentrifugoTypes, enums as Enums, type OAuthAuthorizeRequestRequest, OAuthAuthorizeRequestRequestSchema, type OAuthAuthorizeResponse, OAuthAuthorizeResponseSchema, type OAuthCallbackRequestRequest, OAuthCallbackRequestRequestSchema, type OAuthConnection, OAuthConnectionSchema, type OAuthDisconnectRequestRequest, OAuthDisconnectRequestRequestSchema, type OAuthError, OAuthErrorSchema, type OAuthProvidersResponse, OAuthProvidersResponseSchema, type OAuthTokenResponse, OAuthTokenResponseSchema, type OTPErrorResponse, OTPErrorResponseSchema, type OTPRequestRequest, OTPRequestRequestSchema, type OTPRequestResponse, OTPRequestResponseSchema, type OTPVerifyRequest, OTPVerifyRequestSchema, type OTPVerifyResponse, OTPVerifyResponseSchema, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type TokenRefresh, type TokenRefreshRequest, TokenRefreshRequestSchema, TokenRefreshSchema, API$1 as TotpAPI, index$5 as TotpFetchers, index as TotpHooks, index$6 as TotpTypes, type User, type UserProfileUpdateRequest, UserProfileUpdateRequestSchema, UserSchema, API as WebPushAPI, index$3 as WebPushFetchers, index$2 as WebPushHooks, index$4 as WebPushTypes, apiAccounts, apiCentrifugo, apiTotp, apiWebPush, createAccountsOauthDisconnectCreate, createAccountsOauthGithubAuthorizeCreate, createAccountsOauthGithubCallbackCreate, createAccountsOtpRequestCreate, createAccountsOtpVerifyCreate, createAccountsProfileAvatarCreate, createAccountsTokenRefreshCreate, getAccountsOauthConnectionsList, getAccountsOauthProvidersRetrieve, getAccountsProfileRetrieve, partialUpdateAccountsProfilePartialPartialUpdate, partialUpdateAccountsProfilePartialUpdate, partialUpdateAccountsProfileUpdatePartialUpdate, updateAccountsProfileUpdateUpdate, useAccountsOauthConnectionsList, useAccountsOauthProvidersRetrieve, useAccountsProfileRetrieve, useCreateAccountsOauthDisconnectCreate, useCreateAccountsOauthGithubAuthorizeCreate, useCreateAccountsOauthGithubCallbackCreate, useCreateAccountsOtpRequestCreate, useCreateAccountsOtpVerifyCreate, useCreateAccountsProfileAvatarCreate, useCreateAccountsTokenRefreshCreate, usePartialUpdateAccountsProfilePartialPartialUpdate, usePartialUpdateAccountsProfilePartialUpdate, usePartialUpdateAccountsProfileUpdatePartialUpdate, useUpdateAccountsProfileUpdateUpdate };
5057
+ export { API$3 as AccountsAPI, API$2 as CentrifugoAPI, index$7 as CentrifugoFetchers, index$1 as CentrifugoHooks, type CentrifugoToken, CentrifugoTokenSchema, index$8 as CentrifugoTypes, type CfgAccountsProfileAvatarCreateRequest, CfgAccountsProfileAvatarCreateRequestSchema, enums as Enums, type OAuthAuthorizeRequestRequest, OAuthAuthorizeRequestRequestSchema, type OAuthAuthorizeResponse, OAuthAuthorizeResponseSchema, type OAuthCallbackRequestRequest, OAuthCallbackRequestRequestSchema, type OAuthConnection, OAuthConnectionSchema, type OAuthDisconnectRequestRequest, OAuthDisconnectRequestRequestSchema, type OAuthError, OAuthErrorSchema, type OAuthProvidersResponse, OAuthProvidersResponseSchema, type OAuthTokenResponse, OAuthTokenResponseSchema, type OTPErrorResponse, OTPErrorResponseSchema, type OTPRequestRequest, OTPRequestRequestSchema, type OTPRequestResponse, OTPRequestResponseSchema, type OTPVerifyRequest, OTPVerifyRequestSchema, type OTPVerifyResponse, OTPVerifyResponseSchema, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type TokenRefresh, type TokenRefreshRequest, TokenRefreshRequestSchema, TokenRefreshSchema, API$1 as TotpAPI, index$5 as TotpFetchers, index as TotpHooks, index$6 as TotpTypes, type User, type UserProfileUpdateRequest, UserProfileUpdateRequestSchema, UserSchema, API as WebPushAPI, index$3 as WebPushFetchers, index$2 as WebPushHooks, index$4 as WebPushTypes, apiAccounts, apiCentrifugo, apiTotp, apiWebPush, createAccountsOauthDisconnectCreate, createAccountsOauthGithubAuthorizeCreate, createAccountsOauthGithubCallbackCreate, createAccountsOtpRequestCreate, createAccountsOtpVerifyCreate, createAccountsProfileAvatarCreate, createAccountsTokenRefreshCreate, getAccountsOauthConnectionsList, getAccountsOauthProvidersRetrieve, getAccountsProfileRetrieve, partialUpdateAccountsProfilePartialPartialUpdate, partialUpdateAccountsProfilePartialUpdate, partialUpdateAccountsProfileUpdatePartialUpdate, updateAccountsProfileUpdateUpdate, useAccountsOauthConnectionsList, useAccountsOauthProvidersRetrieve, useAccountsProfileRetrieve, useCreateAccountsOauthDisconnectCreate, useCreateAccountsOauthGithubAuthorizeCreate, useCreateAccountsOauthGithubCallbackCreate, useCreateAccountsOtpRequestCreate, useCreateAccountsOtpVerifyCreate, useCreateAccountsProfileAvatarCreate, useCreateAccountsTokenRefreshCreate, usePartialUpdateAccountsProfilePartialPartialUpdate, usePartialUpdateAccountsProfilePartialUpdate, usePartialUpdateAccountsProfileUpdatePartialUpdate, useUpdateAccountsProfileUpdateUpdate };