react-redux-django-auth 1.4.4 → 1.4.6

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 (68) hide show
  1. package/README.md +77 -0
  2. package/dist/auth-core/actions/authActions.d.ts +57 -0
  3. package/dist/auth-core/actions/authActions.js +451 -0
  4. package/dist/auth-core/actions/types.d.ts +26 -0
  5. package/dist/auth-core/actions/types.js +22 -0
  6. package/dist/auth-core/apis/apis.d.ts +1 -0
  7. package/dist/auth-core/apis/apis.js +11 -0
  8. package/dist/auth-core/apis/config.d.ts +2 -0
  9. package/dist/auth-core/apis/config.js +10 -0
  10. package/dist/auth-core/hooks/useActivate.d.ts +9 -0
  11. package/dist/auth-core/hooks/useActivate.js +96 -0
  12. package/dist/auth-core/hooks/useChangePassword.d.ts +16 -0
  13. package/dist/auth-core/hooks/useChangePassword.js +121 -0
  14. package/dist/auth-core/hooks/useFacebookAuth.d.ts +11 -0
  15. package/dist/auth-core/hooks/useFacebookAuth.js +125 -0
  16. package/dist/auth-core/hooks/useGoogleAuth.d.ts +11 -0
  17. package/dist/auth-core/hooks/useGoogleAuth.js +125 -0
  18. package/dist/auth-core/hooks/useLoadUser.d.ts +12 -0
  19. package/dist/auth-core/hooks/useLoadUser.js +116 -0
  20. package/dist/auth-core/hooks/useLogin.d.ts +13 -0
  21. package/dist/auth-core/hooks/useLogin.js +119 -0
  22. package/dist/auth-core/hooks/useLogout.d.ts +3 -0
  23. package/dist/auth-core/hooks/useLogout.js +14 -0
  24. package/dist/auth-core/hooks/usePasswordConfirm.d.ts +17 -0
  25. package/dist/auth-core/hooks/usePasswordConfirm.js +117 -0
  26. package/dist/auth-core/hooks/useResetPassword.d.ts +11 -0
  27. package/dist/auth-core/hooks/useResetPassword.js +102 -0
  28. package/dist/auth-core/hooks/useSignup.d.ts +12 -0
  29. package/dist/auth-core/hooks/useSignup.js +115 -0
  30. package/dist/auth-core/reducers/authReducer.d.ts +10 -0
  31. package/dist/auth-core/reducers/authReducer.js +58 -0
  32. package/dist/auth-core/reducers/index.d.ts +7 -0
  33. package/dist/auth-core/reducers/index.js +6 -0
  34. package/dist/auth-core/setup/setupAuth.d.ts +4 -0
  35. package/dist/auth-core/setup/setupAuth.js +137 -0
  36. package/dist/auth-core/utils/ExtractErrorMsg.d.ts +33 -0
  37. package/dist/auth-core/utils/ExtractErrorMsg.js +38 -0
  38. package/dist/auth-native/AuthProvider.d.ts +7 -0
  39. package/dist/auth-native/AuthProvider.js +14 -0
  40. package/dist/auth-native/biometrics/biometricService.d.ts +4 -0
  41. package/dist/auth-native/biometrics/biometricService.js +74 -0
  42. package/dist/auth-native/hooks/useBiometricAuth.d.ts +9 -0
  43. package/dist/auth-native/hooks/useBiometricAuth.js +87 -0
  44. package/dist/auth-native/hooks/useGoogleAuth.d.ts +13 -0
  45. package/dist/auth-native/hooks/useGoogleAuth.js +145 -0
  46. package/dist/auth-native/index.d.ts +6 -0
  47. package/dist/auth-native/index.js +6 -0
  48. package/dist/auth-native/storage/nativeStorage.d.ts +18 -0
  49. package/dist/auth-native/storage/nativeStorage.js +111 -0
  50. package/dist/auth-native/store.d.ts +8 -0
  51. package/dist/auth-native/store.js +9 -0
  52. package/dist/auth-web/authProvider.d.ts +7 -0
  53. package/dist/auth-web/authProvider.js +14 -0
  54. package/dist/auth-web/hooks/useGoogleAuth.d.ts +11 -0
  55. package/dist/auth-web/hooks/useGoogleAuth.js +126 -0
  56. package/dist/auth-web/index.d.ts +6 -0
  57. package/dist/auth-web/index.js +6 -0
  58. package/dist/auth-web/oauth/google.d.ts +3 -0
  59. package/dist/auth-web/oauth/google.js +93 -0
  60. package/dist/auth-web/storage/webStorage.d.ts +5 -0
  61. package/dist/auth-web/storage/webStorage.js +13 -0
  62. package/dist/auth-web/store.d.ts +8 -0
  63. package/dist/auth-web/store.js +9 -0
  64. package/dist/index.d.mts +21 -140
  65. package/dist/index.d.ts +12 -150
  66. package/dist/index.js +12 -2107
  67. package/dist/index.mjs +72 -839
  68. package/package.json +42 -7
package/dist/index.d.ts CHANGED
@@ -1,150 +1,12 @@
1
- import React$1 from 'react';
2
-
3
- interface ActivateHookReturn {
4
- loading: boolean;
5
- error: any;
6
- onSubmit: (e: React.FormEvent) => Promise<void>;
7
- status: any;
8
- isStatus204: boolean;
9
- }
10
- declare const useActivate: (uid: string, token: string, apiUrl: string) => ActivateHookReturn;
11
-
12
- interface LoginHookReturn {
13
- loading: boolean;
14
- formData: any;
15
- error: any;
16
- currentUser: any;
17
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
18
- onSubmit: (e: React.FormEvent) => Promise<void>;
19
- isAuthenticated: boolean | null;
20
- isStatus200: boolean;
21
- }
22
- declare const useLogin: (initialFields: any, apiUrl: string, location: any) => LoginHookReturn;
23
-
24
- declare const useLogout: () => (() => void);
25
-
26
- interface SignupHookReturn {
27
- loading: boolean;
28
- formData: any;
29
- error: any;
30
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
31
- onSubmit: (e: React.FormEvent) => Promise<void>;
32
- isAuthenticated: boolean | null;
33
- status: any;
34
- isStatus201: boolean;
35
- }
36
- declare const useSignup: (initialFields: any, apiUrl: string, location: any) => SignupHookReturn;
37
-
38
- interface AuthHookReturn {
39
- error: any;
40
- isAuthenticated: boolean | null;
41
- currentUser: any;
42
- clearErrors: () => void;
43
- refreshUser: () => void;
44
- refreshAuth: () => Promise<void>;
45
- isLoading: boolean;
46
- }
47
- declare const useAuthicatedUser: (apiURL: string, location: any) => AuthHookReturn;
48
-
49
- interface ResetPasswordHookReturn {
50
- email: string;
51
- loading: boolean;
52
- handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
53
- status: any;
54
- error: any;
55
- handleSubmit: (e: React.FormEvent) => Promise<void>;
56
- isStatus204: boolean;
57
- }
58
- declare const useResetPassword: (apiUrl: string) => ResetPasswordHookReturn;
59
-
60
- interface FormData$1 {
61
- new_password?: string;
62
- re_new_password?: string;
63
- uid?: string;
64
- token?: string;
65
- }
66
- interface PasswordConfirmHookReturn {
67
- loading: boolean;
68
- formData: FormData$1;
69
- error: any;
70
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
71
- onSubmit: (e: React.FormEvent) => Promise<void>;
72
- status: any;
73
- isStatus204: boolean;
74
- }
75
- declare const usePasswordConfirm: (initialFields: FormData$1, apiUrl: string) => PasswordConfirmHookReturn;
76
-
77
- interface FormData {
78
- current_password?: string;
79
- new_password?: string;
80
- re_new_password?: string;
81
- }
82
- interface ChangePasswordHookReturn {
83
- loading: boolean;
84
- formData: FormData;
85
- error: string | null;
86
- onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
87
- onSubmit: (e: React.FormEvent) => Promise<void>;
88
- status: any;
89
- }
90
- declare const useChangeAuthenticatedUserPassword: (initialFields: FormData, apiUrl: string) => ChangePasswordHookReturn;
91
-
92
- interface GoogleAuthHookReturn {
93
- continueWithGoogle: () => Promise<void>;
94
- authenticateWithGoogle: (state: string, code: string) => Promise<void>;
95
- isAuthenticated: boolean | null;
96
- error: any;
97
- isStatus201: boolean;
98
- loading: boolean;
99
- }
100
- declare const useGoogleAuth: (apiUrl: string) => GoogleAuthHookReturn;
101
-
102
- interface FacebookAuthHookReturn {
103
- continueWithFacebook: () => Promise<void>;
104
- authenticateWithFacebook: (state: string, code: string) => Promise<void>;
105
- isAuthenticated: boolean | null;
106
- error: any;
107
- isStatus201: boolean;
108
- loading: boolean;
109
- }
110
- declare const useFacebookAuth: (apiUrl: string) => FacebookAuthHookReturn;
111
-
112
- type AuthProviderProps = {
113
- children: React$1.ReactNode;
114
- };
115
- declare const AuthProvider: React$1.FC<AuthProviderProps>;
116
-
117
- /**
118
- * A type representing a single error message string.
119
- */
120
- type ErrorMessage = string;
121
- /**
122
- * A type representing an array of error messages.
123
- */
124
- type ErrorMessageArray = string[];
125
- /**
126
- * A type representing an object where keys map to either a single error message
127
- * or an array of error messages.
128
- */
129
- type ErrorMessageObject = {
130
- [key: string]: ErrorMessage | ErrorMessageArray;
131
- };
132
- /**
133
- * A union type for all possible error message inputs.
134
- */
135
- type ErrorMessageType = ErrorMessage | ErrorMessageArray | ErrorMessageObject;
136
- /**
137
- * Extracts and flattens various error message formats into a single array of strings.
138
- *
139
- * This function can handle:
140
- * - A single string: Returns an array with that string.
141
- * - An array of strings: Returns the array as is.
142
- * - An object: Iterates through the object's values and extracts all strings
143
- * and strings from arrays into a single flattened array.
144
- *
145
- * @param errorMsg The error message(s) to extract, which can be a string, array, or object.
146
- * @returns A flattened array of error message strings.
147
- */
148
- declare const extractErrorMessages: (errorMsg: ErrorMessageType) => string[];
149
-
150
- export { AuthProvider, extractErrorMessages, useActivate, useAuthicatedUser, useChangeAuthenticatedUserPassword, useFacebookAuth, useGoogleAuth, useLogin, useLogout, usePasswordConfirm, useResetPassword, useSignup };
1
+ import useActivate from "./auth-core/hooks/useActivate";
2
+ import useLogin from "./auth-core/hooks/useLogin";
3
+ import useLogout from "./auth-core/hooks/useLogout";
4
+ import useSignup from "./auth-core/hooks/useSignup";
5
+ import useAuthicatedUser from "./auth-core/hooks/useLoadUser";
6
+ import useResetPassword from "./auth-core/hooks/useResetPassword";
7
+ import usePasswordConfirm from "./auth-core/hooks/usePasswordConfirm";
8
+ import useChangeAuthenticatedUserPassword from "./auth-core/hooks/useChangePassword";
9
+ import useGoogleAuth from "./auth-web/hooks/useGoogleAuth";
10
+ import useFacebookAuth from "./auth-core/hooks/useFacebookAuth";
11
+ import { extractErrorMessages } from "./auth-core/utils/ExtractErrorMsg";
12
+ export { useActivate, useLogin, useLogout, useSignup, useAuthicatedUser, useResetPassword, usePasswordConfirm, useChangeAuthenticatedUserPassword, useGoogleAuth, useFacebookAuth, extractErrorMessages, };