@djangocfg/api 2.1.590 → 2.1.592
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.cjs +214 -154
- package/dist/auth.cjs.map +1 -1
- package/dist/auth.d.cts +12 -1
- package/dist/auth.d.ts +12 -1
- package/dist/auth.mjs +137 -77
- package/dist/auth.mjs.map +1 -1
- package/dist/clients.cjs +19 -5
- package/dist/clients.cjs.map +1 -1
- package/dist/clients.mjs +19 -5
- package/dist/clients.mjs.map +1 -1
- package/dist/hooks.cjs +19 -5
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.mjs +19 -5
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.cjs +19 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +19 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/_api/generated/helpers/auth.ts +17 -4
- package/src/auth/__tests__/timezone.test.ts +18 -0
- package/src/auth/hooks/index.ts +3 -0
- package/src/auth/hooks/useTimezone.ts +67 -0
package/dist/auth.d.cts
CHANGED
|
@@ -711,6 +711,17 @@ declare function useAccountsContext(): AccountsContextValue;
|
|
|
711
711
|
|
|
712
712
|
declare function useSession(): SessionSnapshot;
|
|
713
713
|
|
|
714
|
+
interface UseTimezoneReturn {
|
|
715
|
+
/** Zone in effect: the explicit choice, else the browser's. `null` only where Intl cannot tell. */
|
|
716
|
+
timezone: string | null;
|
|
717
|
+
/** The explicit choice; `null` = automatic. Feed this to `TimezoneSelect`. */
|
|
718
|
+
preference: string | null;
|
|
719
|
+
isAuto: boolean;
|
|
720
|
+
/** Pick a zone, or `null` for automatic. */
|
|
721
|
+
setTimezone: (timezone: string | null) => void;
|
|
722
|
+
}
|
|
723
|
+
declare function useTimezone(): UseTimezoneReturn;
|
|
724
|
+
|
|
714
725
|
/**
|
|
715
726
|
* Universal Router Hook with BasePath Support
|
|
716
727
|
*
|
|
@@ -1405,4 +1416,4 @@ declare const Analytics: {
|
|
|
1405
1416
|
setUser(userId: string | null): void;
|
|
1406
1417
|
};
|
|
1407
1418
|
|
|
1408
|
-
export { AUTH_CONSTANTS, AUTH_ERROR_KEYS, type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AnalyticsSink, type AuthConfig, AuthContext, type AuthContextType, type AuthErrorCopy, type AuthErrorKey, type AuthFormAutoSubmit, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, AuthProvider, type AuthProviderProps, type AuthStep, type DeleteAccountResult, type GuardInput, type OTPRequestConsent, type OTPRequestResult, type PasswordLoginOptions, type PasswordLoginResult, type PatchedCfgUserUpdateRequest, type ProfileCacheOptions, type SessionSnapshot, type SessionStatus, type TwoFactorChallenge, 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 UseTwoFactorVerifyOptions, type UseTwoFactorVerifyReturn, type UserProfile, type WebmailLink, authLogger, beginTwoFactorChallenge, clearProfileCache, consumeSavedRedirect, decodeBase64, encodeBase64, endTwoFactorChallenge, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, isAllowedAuthPath, isForbidden, logAuthFailure, logger, normalizePath, peekSavedRedirect, resolveAuthError, resolveGuardIsAuthenticated, resolveGuardIsLoading, setAnalyticsSink, setCachedProfile, shouldRedirectToAuth, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useCfgRouter, useDeleteAccount, useGithubAuth, useLocalStorage, useQueryParams, useSession, useSessionStorage, useTwoFactor, useTwoFactorChallenge, useTwoFactorSetup, useTwoFactorStatus, useTwoFactorVerify, validateEmail, validateIdentifier };
|
|
1419
|
+
export { AUTH_CONSTANTS, AUTH_ERROR_KEYS, type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AnalyticsSink, type AuthConfig, AuthContext, type AuthContextType, type AuthErrorCopy, type AuthErrorKey, type AuthFormAutoSubmit, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, AuthProvider, type AuthProviderProps, type AuthStep, type DeleteAccountResult, type GuardInput, type OTPRequestConsent, type OTPRequestResult, type PasswordLoginOptions, type PasswordLoginResult, type PatchedCfgUserUpdateRequest, type ProfileCacheOptions, type SessionSnapshot, type SessionStatus, type TwoFactorChallenge, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseDeleteAccountReturn, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTimezoneReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UseTwoFactorVerifyOptions, type UseTwoFactorVerifyReturn, type UserProfile, type WebmailLink, authLogger, beginTwoFactorChallenge, clearProfileCache, consumeSavedRedirect, decodeBase64, encodeBase64, endTwoFactorChallenge, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, isAllowedAuthPath, isForbidden, logAuthFailure, logger, normalizePath, peekSavedRedirect, resolveAuthError, resolveGuardIsAuthenticated, resolveGuardIsLoading, setAnalyticsSink, setCachedProfile, shouldRedirectToAuth, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useCfgRouter, useDeleteAccount, useGithubAuth, useLocalStorage, useQueryParams, useSession, useSessionStorage, useTimezone, useTwoFactor, useTwoFactorChallenge, useTwoFactorSetup, useTwoFactorStatus, useTwoFactorVerify, validateEmail, validateIdentifier };
|
package/dist/auth.d.ts
CHANGED
|
@@ -711,6 +711,17 @@ declare function useAccountsContext(): AccountsContextValue;
|
|
|
711
711
|
|
|
712
712
|
declare function useSession(): SessionSnapshot;
|
|
713
713
|
|
|
714
|
+
interface UseTimezoneReturn {
|
|
715
|
+
/** Zone in effect: the explicit choice, else the browser's. `null` only where Intl cannot tell. */
|
|
716
|
+
timezone: string | null;
|
|
717
|
+
/** The explicit choice; `null` = automatic. Feed this to `TimezoneSelect`. */
|
|
718
|
+
preference: string | null;
|
|
719
|
+
isAuto: boolean;
|
|
720
|
+
/** Pick a zone, or `null` for automatic. */
|
|
721
|
+
setTimezone: (timezone: string | null) => void;
|
|
722
|
+
}
|
|
723
|
+
declare function useTimezone(): UseTimezoneReturn;
|
|
724
|
+
|
|
714
725
|
/**
|
|
715
726
|
* Universal Router Hook with BasePath Support
|
|
716
727
|
*
|
|
@@ -1405,4 +1416,4 @@ declare const Analytics: {
|
|
|
1405
1416
|
setUser(userId: string | null): void;
|
|
1406
1417
|
};
|
|
1407
1418
|
|
|
1408
|
-
export { AUTH_CONSTANTS, AUTH_ERROR_KEYS, type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AnalyticsSink, type AuthConfig, AuthContext, type AuthContextType, type AuthErrorCopy, type AuthErrorKey, type AuthFormAutoSubmit, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, AuthProvider, type AuthProviderProps, type AuthStep, type DeleteAccountResult, type GuardInput, type OTPRequestConsent, type OTPRequestResult, type PasswordLoginOptions, type PasswordLoginResult, type PatchedCfgUserUpdateRequest, type ProfileCacheOptions, type SessionSnapshot, type SessionStatus, type TwoFactorChallenge, 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 UseTwoFactorVerifyOptions, type UseTwoFactorVerifyReturn, type UserProfile, type WebmailLink, authLogger, beginTwoFactorChallenge, clearProfileCache, consumeSavedRedirect, decodeBase64, encodeBase64, endTwoFactorChallenge, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, isAllowedAuthPath, isForbidden, logAuthFailure, logger, normalizePath, peekSavedRedirect, resolveAuthError, resolveGuardIsAuthenticated, resolveGuardIsLoading, setAnalyticsSink, setCachedProfile, shouldRedirectToAuth, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useCfgRouter, useDeleteAccount, useGithubAuth, useLocalStorage, useQueryParams, useSession, useSessionStorage, useTwoFactor, useTwoFactorChallenge, useTwoFactorSetup, useTwoFactorStatus, useTwoFactorVerify, validateEmail, validateIdentifier };
|
|
1419
|
+
export { AUTH_CONSTANTS, AUTH_ERROR_KEYS, type AccountsContextValue, AccountsProvider, Analytics, AnalyticsCategory, type AnalyticsCategoryType, AnalyticsEvent, type AnalyticsEventType, type AnalyticsSink, type AuthConfig, AuthContext, type AuthContextType, type AuthErrorCopy, type AuthErrorKey, type AuthFormAutoSubmit, type AuthFormReturn, type AuthFormState, type AuthFormStateHandlers, type AuthFormSubmitHandlers, type AuthFormValidation, AuthProvider, type AuthProviderProps, type AuthStep, type DeleteAccountResult, type GuardInput, type OTPRequestConsent, type OTPRequestResult, type PasswordLoginOptions, type PasswordLoginResult, type PatchedCfgUserUpdateRequest, type ProfileCacheOptions, type SessionSnapshot, type SessionStatus, type TwoFactorChallenge, type TwoFactorDevice, type TwoFactorSetupData, type UseAuthFormOptions, type UseAuthFormStateReturn, type UseAutoAuthOptions, type UseDeleteAccountReturn, type UseGithubAuthOptions, type UseGithubAuthReturn, type UseTimezoneReturn, type UseTwoFactorOptions, type UseTwoFactorReturn, type UseTwoFactorSetupOptions, type UseTwoFactorSetupReturn, type UseTwoFactorStatusReturn, type UseTwoFactorVerifyOptions, type UseTwoFactorVerifyReturn, type UserProfile, type WebmailLink, authLogger, beginTwoFactorChallenge, clearProfileCache, consumeSavedRedirect, decodeBase64, encodeBase64, endTwoFactorChallenge, formatAuthError, getCacheMetadata, getCachedProfile, hasValidCache, isAllowedAuthPath, isForbidden, logAuthFailure, logger, normalizePath, peekSavedRedirect, resolveAuthError, resolveGuardIsAuthenticated, resolveGuardIsLoading, setAnalyticsSink, setCachedProfile, shouldRedirectToAuth, useAccountsContext, useAuth, useAuthForm, useAuthFormState, useAuthRedirectManager, useAuthValidation, useAutoAuth, useBase64, useCfgRouter, useDeleteAccount, useGithubAuth, useLocalStorage, useQueryParams, useSession, useSessionStorage, useTimezone, useTwoFactor, useTwoFactorChallenge, useTwoFactorSetup, useTwoFactorStatus, useTwoFactorVerify, validateEmail, validateIdentifier };
|