@djangocfg/api 2.1.99 → 2.1.100
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 +333 -313
- package/dist/auth-server.cjs.map +1 -1
- package/dist/auth-server.mjs +333 -313
- package/dist/auth-server.mjs.map +1 -1
- package/dist/auth.cjs +441 -383
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +36 -1
- package/dist/auth.d.ts +36 -1
- package/dist/auth.mjs +441 -383
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +458 -383
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.d.cts +55 -1
- package/dist/clients.d.ts +55 -1
- package/dist/clients.mjs +458 -383
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +184 -111
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +48 -1
- package/dist/hooks.d.ts +48 -1
- package/dist/hooks.mjs +184 -111
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +382 -313
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -5
- package/dist/index.d.ts +58 -5
- package/dist/index.mjs +382 -313
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/auth/hooks/index.ts +7 -0
- package/src/auth/hooks/useDeleteAccount.ts +90 -0
- package/src/generated/cfg_accounts/CLAUDE.md +4 -3
- package/src/generated/cfg_accounts/_utils/fetchers/accounts__user_profile.ts +58 -0
- package/src/generated/cfg_accounts/_utils/hooks/accounts__user_profile.ts +19 -0
- package/src/generated/cfg_accounts/_utils/schemas/AccountDeleteResponse.schema.ts +20 -0
- package/src/generated/cfg_accounts/_utils/schemas/index.ts +1 -0
- package/src/generated/cfg_accounts/accounts__user_profile/client.ts +14 -0
- package/src/generated/cfg_accounts/accounts__user_profile/models.ts +12 -0
- package/src/generated/cfg_accounts/schema.json +69 -0
package/dist/auth.d.cts
CHANGED
|
@@ -851,6 +851,41 @@ declare function useTokenRefresh(options?: UseTokenRefreshOptions): {
|
|
|
851
851
|
checkAndRefresh: () => Promise<void>;
|
|
852
852
|
};
|
|
853
853
|
|
|
854
|
+
interface DeleteAccountResult {
|
|
855
|
+
success: boolean;
|
|
856
|
+
message: string;
|
|
857
|
+
}
|
|
858
|
+
interface UseDeleteAccountReturn {
|
|
859
|
+
/** Loading state */
|
|
860
|
+
isLoading: boolean;
|
|
861
|
+
/** Error message */
|
|
862
|
+
error: string | null;
|
|
863
|
+
/** Delete the account */
|
|
864
|
+
deleteAccount: () => Promise<DeleteAccountResult>;
|
|
865
|
+
/** Clear error */
|
|
866
|
+
clearError: () => void;
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Hook for deleting user account.
|
|
870
|
+
*
|
|
871
|
+
* This performs a soft delete - deactivates the account and anonymizes personal data.
|
|
872
|
+
* The account can be restored by an administrator if needed.
|
|
873
|
+
*
|
|
874
|
+
* @example
|
|
875
|
+
* ```tsx
|
|
876
|
+
* const { deleteAccount, isLoading, error } = useDeleteAccount();
|
|
877
|
+
*
|
|
878
|
+
* const handleDelete = async () => {
|
|
879
|
+
* const result = await deleteAccount();
|
|
880
|
+
* if (result.success) {
|
|
881
|
+
* // Account deleted, perform logout
|
|
882
|
+
* await logout();
|
|
883
|
+
* }
|
|
884
|
+
* };
|
|
885
|
+
* ```
|
|
886
|
+
*/
|
|
887
|
+
declare const useDeleteAccount: () => UseDeleteAccountReturn;
|
|
888
|
+
|
|
854
889
|
/**
|
|
855
890
|
* Email validation utility
|
|
856
891
|
*/
|
|
@@ -910,4 +945,4 @@ declare const Analytics: {
|
|
|
910
945
|
setUser(userId: string): void;
|
|
911
946
|
};
|
|
912
947
|
|
|
913
|
-
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 };
|
|
948
|
+
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 DeleteAccountResult, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseDeleteAccountReturn, 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, useDeleteAccount, useGithubAuth, useLocalStorage, useSessionStorage, useTokenRefresh, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|
package/dist/auth.d.ts
CHANGED
|
@@ -851,6 +851,41 @@ declare function useTokenRefresh(options?: UseTokenRefreshOptions): {
|
|
|
851
851
|
checkAndRefresh: () => Promise<void>;
|
|
852
852
|
};
|
|
853
853
|
|
|
854
|
+
interface DeleteAccountResult {
|
|
855
|
+
success: boolean;
|
|
856
|
+
message: string;
|
|
857
|
+
}
|
|
858
|
+
interface UseDeleteAccountReturn {
|
|
859
|
+
/** Loading state */
|
|
860
|
+
isLoading: boolean;
|
|
861
|
+
/** Error message */
|
|
862
|
+
error: string | null;
|
|
863
|
+
/** Delete the account */
|
|
864
|
+
deleteAccount: () => Promise<DeleteAccountResult>;
|
|
865
|
+
/** Clear error */
|
|
866
|
+
clearError: () => void;
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Hook for deleting user account.
|
|
870
|
+
*
|
|
871
|
+
* This performs a soft delete - deactivates the account and anonymizes personal data.
|
|
872
|
+
* The account can be restored by an administrator if needed.
|
|
873
|
+
*
|
|
874
|
+
* @example
|
|
875
|
+
* ```tsx
|
|
876
|
+
* const { deleteAccount, isLoading, error } = useDeleteAccount();
|
|
877
|
+
*
|
|
878
|
+
* const handleDelete = async () => {
|
|
879
|
+
* const result = await deleteAccount();
|
|
880
|
+
* if (result.success) {
|
|
881
|
+
* // Account deleted, perform logout
|
|
882
|
+
* await logout();
|
|
883
|
+
* }
|
|
884
|
+
* };
|
|
885
|
+
* ```
|
|
886
|
+
*/
|
|
887
|
+
declare const useDeleteAccount: () => UseDeleteAccountReturn;
|
|
888
|
+
|
|
854
889
|
/**
|
|
855
890
|
* Email validation utility
|
|
856
891
|
*/
|
|
@@ -910,4 +945,4 @@ declare const Analytics: {
|
|
|
910
945
|
setUser(userId: string): void;
|
|
911
946
|
};
|
|
912
947
|
|
|
913
|
-
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 };
|
|
948
|
+
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 DeleteAccountResult, type PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type ProfileCacheOptions, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseDeleteAccountReturn, 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, useDeleteAccount, useGithubAuth, useLocalStorage, useSessionStorage, useTokenRefresh, useTwoFactor, useTwoFactorSetup, useTwoFactorStatus, validateEmail, validateIdentifier };
|