@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.
- package/dist/auth-server.cjs +1963 -4
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.d.cts +35 -1
- package/dist/auth-server.d.ts +35 -1
- package/dist/auth-server.mjs +1953 -4
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +692 -497
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +18 -2
- package/dist/auth.d.ts +18 -2
- package/dist/auth.mjs +655 -460
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +460 -383
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +26 -6
- package/dist/clients.d.ts +26 -6
- package/dist/clients.mjs +460 -383
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +130 -105
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +24 -4
- package/dist/hooks.d.ts +24 -4
- package/dist/hooks.mjs +130 -105
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +373 -311
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -8
- package/dist/index.d.ts +54 -8
- package/dist/index.mjs +373 -311
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/auth/context/AccountsContext.tsx +3 -3
- package/src/auth/context/AuthContext.tsx +56 -10
- package/src/auth/hooks/index.ts +3 -0
- package/src/auth/hooks/useProfileCache.ts +1 -1
- package/src/auth/hooks/useTokenRefresh.ts +161 -0
- package/src/auth/middlewares/index.ts +8 -1
- package/src/auth/middlewares/tokenRefresh.ts +158 -0
- package/src/generated/cfg_accounts/CLAUDE.md +2 -9
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +2 -1
- package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +2 -1
- package/src/generated/cfg_accounts/_utils/schemas/CfgAccountsProfileAvatarCreateRequest.schema.ts +15 -0
- package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts/models.ts +0 -1
- package/src/generated/cfg_accounts/accounts__user_profile/client.ts +4 -2
- package/src/generated/cfg_accounts/accounts__user_profile/models.ts +9 -1
- package/src/generated/cfg_accounts/client.ts +18 -0
- package/src/generated/cfg_accounts/index.ts +3 -1
- package/src/generated/cfg_accounts/schema.json +2 -2
- package/src/generated/cfg_centrifugo/CLAUDE.md +1 -8
- package/src/generated/cfg_centrifugo/client.ts +18 -0
- package/src/generated/cfg_centrifugo/index.ts +3 -1
- package/src/generated/cfg_totp/CLAUDE.md +1 -8
- package/src/generated/cfg_totp/client.ts +18 -0
- package/src/generated/cfg_totp/index.ts +3 -1
- package/src/generated/cfg_totp/totp/models.ts +2 -0
- package/src/generated/cfg_webpush/CLAUDE.md +1 -8
- package/src/generated/cfg_webpush/client.ts +18 -0
- package/src/generated/cfg_webpush/index.ts +3 -1
package/dist/auth.d.cts
CHANGED
|
@@ -315,7 +315,7 @@ interface AccountsContextValue {
|
|
|
315
315
|
profileError: Error | null;
|
|
316
316
|
updateProfile: (data: UserProfileUpdateRequest) => Promise<User>;
|
|
317
317
|
partialUpdateProfile: (data: PatchedUserProfileUpdateRequest) => Promise<User>;
|
|
318
|
-
uploadAvatar: (
|
|
318
|
+
uploadAvatar: (avatar: File | Blob) => Promise<User>;
|
|
319
319
|
refreshProfile: (callerId?: string) => Promise<User | undefined>;
|
|
320
320
|
requestOTP: (data: OTPRequestRequest) => Promise<OTPRequestResponse>;
|
|
321
321
|
verifyOTP: (data: OTPVerifyRequest) => Promise<OTPVerifyResponse>;
|
|
@@ -829,6 +829,22 @@ declare function getCacheMetadata(): {
|
|
|
829
829
|
expiresIn?: number;
|
|
830
830
|
} | null;
|
|
831
831
|
|
|
832
|
+
interface UseTokenRefreshOptions {
|
|
833
|
+
/** Enable automatic token refresh (default: true) */
|
|
834
|
+
enabled?: boolean;
|
|
835
|
+
/** Callback when token is refreshed */
|
|
836
|
+
onRefresh?: (newToken: string) => void;
|
|
837
|
+
/** Callback when refresh fails */
|
|
838
|
+
onRefreshError?: (error: Error) => void;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Hook for automatic token refresh
|
|
842
|
+
*/
|
|
843
|
+
declare function useTokenRefresh(options?: UseTokenRefreshOptions): {
|
|
844
|
+
refreshToken: () => Promise<boolean>;
|
|
845
|
+
checkAndRefresh: () => Promise<void>;
|
|
846
|
+
};
|
|
847
|
+
|
|
832
848
|
/**
|
|
833
849
|
* Email validation utility
|
|
834
850
|
*/
|
|
@@ -888,4 +904,4 @@ declare const Analytics: {
|
|
|
888
904
|
setUser(userId: string): void;
|
|
889
905
|
};
|
|
890
906
|
|
|
891
|
-
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthChannel, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormContextType, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, type AuthHelpProps, type AuthLayoutConfig, type AuthLayoutProps, AuthProvider, type AuthProviderProps, type AuthStep, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UserProfile, authLogger, clearProfileCache, decodeBase64, detectChannelFromIdentifier, encodeBase64, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, logger, setCachedProfile, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthGuard, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useGithubAuth, useLocalStorage, useSessionStorage, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|
|
907
|
+
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthChannel, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormContextType, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, type AuthHelpProps, type AuthLayoutConfig, type AuthLayoutProps, AuthProvider, type AuthProviderProps, type AuthStep, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UserProfile, authLogger, clearProfileCache, decodeBase64, detectChannelFromIdentifier, encodeBase64, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, logger, setCachedProfile, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthGuard, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useGithubAuth, useLocalStorage, useSessionStorage, useTokenRefresh, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|
package/dist/auth.d.ts
CHANGED
|
@@ -315,7 +315,7 @@ interface AccountsContextValue {
|
|
|
315
315
|
profileError: Error | null;
|
|
316
316
|
updateProfile: (data: UserProfileUpdateRequest) => Promise<User>;
|
|
317
317
|
partialUpdateProfile: (data: PatchedUserProfileUpdateRequest) => Promise<User>;
|
|
318
|
-
uploadAvatar: (
|
|
318
|
+
uploadAvatar: (avatar: File | Blob) => Promise<User>;
|
|
319
319
|
refreshProfile: (callerId?: string) => Promise<User | undefined>;
|
|
320
320
|
requestOTP: (data: OTPRequestRequest) => Promise<OTPRequestResponse>;
|
|
321
321
|
verifyOTP: (data: OTPVerifyRequest) => Promise<OTPVerifyResponse>;
|
|
@@ -829,6 +829,22 @@ declare function getCacheMetadata(): {
|
|
|
829
829
|
expiresIn?: number;
|
|
830
830
|
} | null;
|
|
831
831
|
|
|
832
|
+
interface UseTokenRefreshOptions {
|
|
833
|
+
/** Enable automatic token refresh (default: true) */
|
|
834
|
+
enabled?: boolean;
|
|
835
|
+
/** Callback when token is refreshed */
|
|
836
|
+
onRefresh?: (newToken: string) => void;
|
|
837
|
+
/** Callback when refresh fails */
|
|
838
|
+
onRefreshError?: (error: Error) => void;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Hook for automatic token refresh
|
|
842
|
+
*/
|
|
843
|
+
declare function useTokenRefresh(options?: UseTokenRefreshOptions): {
|
|
844
|
+
refreshToken: () => Promise<boolean>;
|
|
845
|
+
checkAndRefresh: () => Promise<void>;
|
|
846
|
+
};
|
|
847
|
+
|
|
832
848
|
/**
|
|
833
849
|
* Email validation utility
|
|
834
850
|
*/
|
|
@@ -888,4 +904,4 @@ declare const Analytics: {
|
|
|
888
904
|
setUser(userId: string): void;
|
|
889
905
|
};
|
|
890
906
|
|
|
891
|
-
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthChannel, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormContextType, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, type AuthHelpProps, type AuthLayoutConfig, type AuthLayoutProps, AuthProvider, type AuthProviderProps, type AuthStep, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UserProfile, authLogger, clearProfileCache, decodeBase64, detectChannelFromIdentifier, encodeBase64, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, logger, setCachedProfile, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthGuard, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useGithubAuth, useLocalStorage, useSessionStorage, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|
|
907
|
+
export { type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AuthChannel, type AuthConfig, type AuthContextType, type AuthFormAutoSubmit, type AuthFormContextType, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, type AuthHelpProps, type AuthLayoutConfig, type AuthLayoutProps, AuthProvider, type AuthProviderProps, type AuthStep, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UserProfile, authLogger, clearProfileCache, decodeBase64, detectChannelFromIdentifier, encodeBase64, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, logger, setCachedProfile, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthGuard, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useGithubAuth, useLocalStorage, useSessionStorage, useTokenRefresh, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|