@joelbarron/react-web-dev-kit 0.1.7 → 0.1.9

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 (272) hide show
  1. package/README.md +65 -160
  2. package/package.json +9 -2
  3. package/dist/auth/client.d.ts +0 -45
  4. package/dist/auth/client.d.ts.map +0 -1
  5. package/dist/auth/client.js +0 -367
  6. package/dist/auth/constants/countryCallingCodes.d.ts +0 -9
  7. package/dist/auth/constants/countryCallingCodes.d.ts.map +0 -1
  8. package/dist/auth/constants/countryCallingCodes.js +0 -209
  9. package/dist/auth/constants/gender.d.ts +0 -9
  10. package/dist/auth/constants/gender.d.ts.map +0 -1
  11. package/dist/auth/constants/gender.js +0 -12
  12. package/dist/auth/constants/index.d.ts +0 -3
  13. package/dist/auth/constants/index.d.ts.map +0 -1
  14. package/dist/auth/constants/index.js +0 -2
  15. package/dist/auth/forms/account/AuthAccountConfirmationForm.d.ts +0 -18
  16. package/dist/auth/forms/account/AuthAccountConfirmationForm.d.ts.map +0 -1
  17. package/dist/auth/forms/account/AuthAccountConfirmationForm.js +0 -167
  18. package/dist/auth/forms/account/index.d.ts +0 -2
  19. package/dist/auth/forms/account/index.d.ts.map +0 -1
  20. package/dist/auth/forms/account/index.js +0 -1
  21. package/dist/auth/forms/errorParser.d.ts +0 -7
  22. package/dist/auth/forms/errorParser.d.ts.map +0 -1
  23. package/dist/auth/forms/errorParser.js +0 -65
  24. package/dist/auth/forms/index.d.ts +0 -6
  25. package/dist/auth/forms/index.d.ts.map +0 -1
  26. package/dist/auth/forms/index.js +0 -5
  27. package/dist/auth/forms/password/AuthForgotPasswordForm.d.ts +0 -16
  28. package/dist/auth/forms/password/AuthForgotPasswordForm.d.ts.map +0 -1
  29. package/dist/auth/forms/password/AuthForgotPasswordForm.js +0 -109
  30. package/dist/auth/forms/password/AuthPasswordResetConfirmForm.d.ts +0 -17
  31. package/dist/auth/forms/password/AuthPasswordResetConfirmForm.d.ts.map +0 -1
  32. package/dist/auth/forms/password/AuthPasswordResetConfirmForm.js +0 -163
  33. package/dist/auth/forms/password/AuthResetPasswordForm.d.ts +0 -12
  34. package/dist/auth/forms/password/AuthResetPasswordForm.d.ts.map +0 -1
  35. package/dist/auth/forms/password/AuthResetPasswordForm.js +0 -22
  36. package/dist/auth/forms/password/index.d.ts +0 -4
  37. package/dist/auth/forms/password/index.d.ts.map +0 -1
  38. package/dist/auth/forms/password/index.js +0 -3
  39. package/dist/auth/forms/password/passwordValidation.d.ts +0 -3
  40. package/dist/auth/forms/password/passwordValidation.d.ts.map +0 -1
  41. package/dist/auth/forms/password/passwordValidation.js +0 -45
  42. package/dist/auth/forms/sign-in/AuthOtpSignInForm.d.ts +0 -24
  43. package/dist/auth/forms/sign-in/AuthOtpSignInForm.d.ts.map +0 -1
  44. package/dist/auth/forms/sign-in/AuthOtpSignInForm.js +0 -227
  45. package/dist/auth/forms/sign-in/AuthPasswordSignInForm.d.ts +0 -22
  46. package/dist/auth/forms/sign-in/AuthPasswordSignInForm.d.ts.map +0 -1
  47. package/dist/auth/forms/sign-in/AuthPasswordSignInForm.js +0 -148
  48. package/dist/auth/forms/sign-in/index.d.ts +0 -3
  49. package/dist/auth/forms/sign-in/index.d.ts.map +0 -1
  50. package/dist/auth/forms/sign-in/index.js +0 -2
  51. package/dist/auth/forms/sign-up/AuthSignUpForm.d.ts +0 -37
  52. package/dist/auth/forms/sign-up/AuthSignUpForm.d.ts.map +0 -1
  53. package/dist/auth/forms/sign-up/AuthSignUpForm.js +0 -190
  54. package/dist/auth/forms/sign-up/index.d.ts +0 -2
  55. package/dist/auth/forms/sign-up/index.d.ts.map +0 -1
  56. package/dist/auth/forms/sign-up/index.js +0 -1
  57. package/dist/auth/fuse/createFuseAuthViews.d.ts +0 -25
  58. package/dist/auth/fuse/createFuseAuthViews.d.ts.map +0 -1
  59. package/dist/auth/fuse/createFuseAuthViews.js +0 -460
  60. package/dist/auth/fuse/fuseAdapter.d.ts +0 -41
  61. package/dist/auth/fuse/fuseAdapter.d.ts.map +0 -1
  62. package/dist/auth/fuse/fuseAdapter.js +0 -271
  63. package/dist/auth/fuse/fuseIntegration.d.ts +0 -61
  64. package/dist/auth/fuse/fuseIntegration.d.ts.map +0 -1
  65. package/dist/auth/fuse/fuseIntegration.js +0 -103
  66. package/dist/auth/fuse/index.d.ts +0 -4
  67. package/dist/auth/fuse/index.d.ts.map +0 -1
  68. package/dist/auth/fuse/index.js +0 -3
  69. package/dist/auth/index.d.ts +0 -11
  70. package/dist/auth/index.d.ts.map +0 -1
  71. package/dist/auth/index.js +0 -10
  72. package/dist/auth/provider.d.ts +0 -35
  73. package/dist/auth/provider.d.ts.map +0 -1
  74. package/dist/auth/provider.js +0 -133
  75. package/dist/auth/query.d.ts +0 -23
  76. package/dist/auth/query.d.ts.map +0 -1
  77. package/dist/auth/query.js +0 -103
  78. package/dist/auth/routes.d.ts +0 -37
  79. package/dist/auth/routes.d.ts.map +0 -1
  80. package/dist/auth/routes.js +0 -75
  81. package/dist/auth/social/providerAuth.d.ts +0 -101
  82. package/dist/auth/social/providerAuth.d.ts.map +0 -1
  83. package/dist/auth/social/providerAuth.js +0 -207
  84. package/dist/auth/storage.d.ts +0 -3
  85. package/dist/auth/storage.d.ts.map +0 -1
  86. package/dist/auth/storage.js +0 -20
  87. package/dist/auth/types.d.ts +0 -226
  88. package/dist/auth/types.d.ts.map +0 -1
  89. package/dist/auth/types.js +0 -1
  90. package/dist/auth/ui/AuthPageTitle.d.ts +0 -7
  91. package/dist/auth/ui/AuthPageTitle.d.ts.map +0 -1
  92. package/dist/auth/ui/AuthPageTitle.js +0 -7
  93. package/dist/auth/ui/AuthPagesMessageSection.d.ts +0 -3
  94. package/dist/auth/ui/AuthPagesMessageSection.d.ts.map +0 -1
  95. package/dist/auth/ui/AuthPagesMessageSection.js +0 -39
  96. package/dist/auth/ui/AuthPrimaryButton.d.ts +0 -9
  97. package/dist/auth/ui/AuthPrimaryButton.d.ts.map +0 -1
  98. package/dist/auth/ui/AuthPrimaryButton.js +0 -19
  99. package/dist/auth/ui/AuthRoleSelectionDialog.d.ts +0 -14
  100. package/dist/auth/ui/AuthRoleSelectionDialog.d.ts.map +0 -1
  101. package/dist/auth/ui/AuthRoleSelectionDialog.js +0 -39
  102. package/dist/auth/ui/AuthRoutePageWrapper.d.ts +0 -12
  103. package/dist/auth/ui/AuthRoutePageWrapper.d.ts.map +0 -1
  104. package/dist/auth/ui/AuthRoutePageWrapper.js +0 -61
  105. package/dist/auth/ui/AuthSecondaryButton.d.ts +0 -7
  106. package/dist/auth/ui/AuthSecondaryButton.d.ts.map +0 -1
  107. package/dist/auth/ui/AuthSecondaryButton.js +0 -18
  108. package/dist/auth/ui/AuthSocialProviderButton.d.ts +0 -11
  109. package/dist/auth/ui/AuthSocialProviderButton.d.ts.map +0 -1
  110. package/dist/auth/ui/AuthSocialProviderButton.js +0 -33
  111. package/dist/auth/ui/index.d.ts +0 -9
  112. package/dist/auth/ui/index.d.ts.map +0 -1
  113. package/dist/auth/ui/index.js +0 -8
  114. package/dist/auth/ui/types.d.ts +0 -15
  115. package/dist/auth/ui/types.d.ts.map +0 -1
  116. package/dist/auth/ui/types.js +0 -1
  117. package/dist/config/createConfig.d.ts +0 -14
  118. package/dist/config/createConfig.d.ts.map +0 -1
  119. package/dist/config/createConfig.js +0 -179
  120. package/dist/config/defaults.d.ts +0 -3
  121. package/dist/config/defaults.d.ts.map +0 -1
  122. package/dist/config/defaults.js +0 -39
  123. package/dist/config/index.d.ts +0 -5
  124. package/dist/config/index.d.ts.map +0 -1
  125. package/dist/config/index.js +0 -4
  126. package/dist/config/merge.d.ts +0 -2
  127. package/dist/config/merge.d.ts.map +0 -1
  128. package/dist/config/merge.js +0 -18
  129. package/dist/config/types.d.ts +0 -53
  130. package/dist/config/types.d.ts.map +0 -1
  131. package/dist/config/types.js +0 -1
  132. package/dist/core/buttons/JBButton.d.ts +0 -8
  133. package/dist/core/buttons/JBButton.d.ts.map +0 -1
  134. package/dist/core/buttons/JBButton.js +0 -55
  135. package/dist/core/buttons/index.d.ts +0 -2
  136. package/dist/core/buttons/index.d.ts.map +0 -1
  137. package/dist/core/buttons/index.js +0 -1
  138. package/dist/core/dialogs/JBConfirmDialog.d.ts +0 -15
  139. package/dist/core/dialogs/JBConfirmDialog.d.ts.map +0 -1
  140. package/dist/core/dialogs/JBConfirmDialog.js +0 -6
  141. package/dist/core/dialogs/index.d.ts +0 -2
  142. package/dist/core/dialogs/index.d.ts.map +0 -1
  143. package/dist/core/dialogs/index.js +0 -1
  144. package/dist/core/index.d.ts +0 -5
  145. package/dist/core/index.d.ts.map +0 -1
  146. package/dist/core/index.js +0 -4
  147. package/dist/core/layout/JBContentContainer.d.ts +0 -31
  148. package/dist/core/layout/JBContentContainer.d.ts.map +0 -1
  149. package/dist/core/layout/JBContentContainer.js +0 -50
  150. package/dist/core/layout/JBFormHeader.d.ts +0 -3
  151. package/dist/core/layout/JBFormHeader.d.ts.map +0 -1
  152. package/dist/core/layout/JBFormHeader.js +0 -131
  153. package/dist/core/layout/index.d.ts +0 -3
  154. package/dist/core/layout/index.d.ts.map +0 -1
  155. package/dist/core/layout/index.js +0 -2
  156. package/dist/core/skeletons/JBFormContentSkeleton.d.ts +0 -5
  157. package/dist/core/skeletons/JBFormContentSkeleton.d.ts.map +0 -1
  158. package/dist/core/skeletons/JBFormContentSkeleton.js +0 -12
  159. package/dist/core/skeletons/JBFormHeaderSkeleton.d.ts +0 -6
  160. package/dist/core/skeletons/JBFormHeaderSkeleton.d.ts.map +0 -1
  161. package/dist/core/skeletons/JBFormHeaderSkeleton.js +0 -19
  162. package/dist/core/skeletons/index.d.ts +0 -3
  163. package/dist/core/skeletons/index.d.ts.map +0 -1
  164. package/dist/core/skeletons/index.js +0 -2
  165. package/dist/forms/JBAutocompleteField.d.ts +0 -12
  166. package/dist/forms/JBAutocompleteField.d.ts.map +0 -1
  167. package/dist/forms/JBAutocompleteField.js +0 -20
  168. package/dist/forms/JBCheckboxField.d.ts +0 -12
  169. package/dist/forms/JBCheckboxField.d.ts.map +0 -1
  170. package/dist/forms/JBCheckboxField.js +0 -36
  171. package/dist/forms/JBDatePickerField.d.ts +0 -12
  172. package/dist/forms/JBDatePickerField.d.ts.map +0 -1
  173. package/dist/forms/JBDatePickerField.js +0 -16
  174. package/dist/forms/JBRadioGroupField.d.ts +0 -10
  175. package/dist/forms/JBRadioGroupField.d.ts.map +0 -1
  176. package/dist/forms/JBRadioGroupField.js +0 -8
  177. package/dist/forms/JBSelectField.d.ts +0 -9
  178. package/dist/forms/JBSelectField.d.ts.map +0 -1
  179. package/dist/forms/JBSelectField.js +0 -8
  180. package/dist/forms/JBSwitchField.d.ts +0 -11
  181. package/dist/forms/JBSwitchField.d.ts.map +0 -1
  182. package/dist/forms/JBSwitchField.js +0 -10
  183. package/dist/forms/JBTextField.d.ts +0 -6
  184. package/dist/forms/JBTextField.d.ts.map +0 -1
  185. package/dist/forms/JBTextField.js +0 -8
  186. package/dist/forms/JBTimePickerField.d.ts +0 -12
  187. package/dist/forms/JBTimePickerField.d.ts.map +0 -1
  188. package/dist/forms/JBTimePickerField.js +0 -16
  189. package/dist/forms/index.d.ts +0 -13
  190. package/dist/forms/index.d.ts.map +0 -1
  191. package/dist/forms/index.js +0 -12
  192. package/dist/forms/rules.d.ts +0 -16
  193. package/dist/forms/rules.d.ts.map +0 -1
  194. package/dist/forms/rules.js +0 -21
  195. package/dist/forms/types.d.ts +0 -12
  196. package/dist/forms/types.d.ts.map +0 -1
  197. package/dist/forms/types.js +0 -1
  198. package/dist/forms/utils.d.ts +0 -5
  199. package/dist/forms/utils.d.ts.map +0 -1
  200. package/dist/forms/utils.js +0 -7
  201. package/dist/forms/zod.d.ts +0 -4
  202. package/dist/forms/zod.d.ts.map +0 -1
  203. package/dist/forms/zod.js +0 -9
  204. package/dist/grid/JBGrid.d.ts +0 -3
  205. package/dist/grid/JBGrid.d.ts.map +0 -1
  206. package/dist/grid/JBGrid.js +0 -333
  207. package/dist/grid/JBGridHeader.d.ts +0 -3
  208. package/dist/grid/JBGridHeader.d.ts.map +0 -1
  209. package/dist/grid/JBGridHeader.js +0 -93
  210. package/dist/grid/JBGridLoading.d.ts +0 -9
  211. package/dist/grid/JBGridLoading.d.ts.map +0 -1
  212. package/dist/grid/JBGridLoading.js +0 -14
  213. package/dist/grid/JBGridProviders.d.ts +0 -13
  214. package/dist/grid/JBGridProviders.d.ts.map +0 -1
  215. package/dist/grid/JBGridProviders.js +0 -47
  216. package/dist/grid/JBGridSkeleton.d.ts +0 -7
  217. package/dist/grid/JBGridSkeleton.d.ts.map +0 -1
  218. package/dist/grid/JBGridSkeleton.js +0 -6
  219. package/dist/grid/defaults.d.ts +0 -4
  220. package/dist/grid/defaults.d.ts.map +0 -1
  221. package/dist/grid/defaults.js +0 -28
  222. package/dist/grid/index.d.ts +0 -8
  223. package/dist/grid/index.d.ts.map +0 -1
  224. package/dist/grid/index.js +0 -7
  225. package/dist/grid/types.d.ts +0 -196
  226. package/dist/grid/types.d.ts.map +0 -1
  227. package/dist/grid/types.js +0 -1
  228. package/dist/hooks/index.d.ts +0 -4
  229. package/dist/hooks/index.d.ts.map +0 -1
  230. package/dist/hooks/index.js +0 -3
  231. package/dist/hooks/useJBDebouncedValue.d.ts +0 -2
  232. package/dist/hooks/useJBDebouncedValue.d.ts.map +0 -1
  233. package/dist/hooks/useJBDebouncedValue.js +0 -11
  234. package/dist/hooks/useJBEntityFormController.d.ts +0 -54
  235. package/dist/hooks/useJBEntityFormController.d.ts.map +0 -1
  236. package/dist/hooks/useJBEntityFormController.js +0 -156
  237. package/dist/hooks/useJBRedirect.d.ts +0 -10
  238. package/dist/hooks/useJBRedirect.d.ts.map +0 -1
  239. package/dist/hooks/useJBRedirect.js +0 -11
  240. package/dist/index.d.ts +0 -9
  241. package/dist/index.d.ts.map +0 -1
  242. package/dist/index.js +0 -8
  243. package/dist/query/createQueryClient.d.ts +0 -8
  244. package/dist/query/createQueryClient.d.ts.map +0 -1
  245. package/dist/query/createQueryClient.js +0 -25
  246. package/dist/query/http.d.ts +0 -3
  247. package/dist/query/http.d.ts.map +0 -1
  248. package/dist/query/http.js +0 -12
  249. package/dist/query/index.d.ts +0 -4
  250. package/dist/query/index.d.ts.map +0 -1
  251. package/dist/query/index.js +0 -3
  252. package/dist/query/types.d.ts +0 -7
  253. package/dist/query/types.d.ts.map +0 -1
  254. package/dist/query/types.js +0 -1
  255. package/dist/utils/errors.d.ts +0 -10
  256. package/dist/utils/errors.d.ts.map +0 -1
  257. package/dist/utils/errors.js +0 -55
  258. package/dist/utils/format.d.ts +0 -4
  259. package/dist/utils/format.d.ts.map +0 -1
  260. package/dist/utils/format.js +0 -28
  261. package/dist/utils/geo.d.ts +0 -9
  262. package/dist/utils/geo.d.ts.map +0 -1
  263. package/dist/utils/geo.js +0 -186
  264. package/dist/utils/index.d.ts +0 -6
  265. package/dist/utils/index.d.ts.map +0 -1
  266. package/dist/utils/index.js +0 -5
  267. package/dist/utils/query.d.ts +0 -2
  268. package/dist/utils/query.d.ts.map +0 -1
  269. package/dist/utils/query.js +0 -4
  270. package/dist/utils/regex.d.ts +0 -7
  271. package/dist/utils/regex.d.ts.map +0 -1
  272. package/dist/utils/regex.js +0 -6
@@ -1,367 +0,0 @@
1
- import axios from 'axios';
2
- import { getApiBaseUrl, getAuthBasePath } from '../config';
3
- import { createLocalStorageTokenStorage } from './storage';
4
- const normalizeAuthBasePath = (basePath) => {
5
- const normalized = (basePath ?? '/authentication').trim();
6
- if (!normalized) {
7
- return '/authentication';
8
- }
9
- const withLeadingSlash = normalized.startsWith('/') ? normalized : `/${normalized}`;
10
- return withLeadingSlash.replace(/\/+$/, '');
11
- };
12
- export const createAuthEndpoints = (basePath) => {
13
- const root = normalizeAuthBasePath(basePath);
14
- return {
15
- loginBasic: `${root}/login/basic/`,
16
- loginSocial: `${root}/login/social/`,
17
- loginSocialPrecheck: `${root}/login/social/precheck/`,
18
- loginSocialLink: `${root}/login/social/link/`,
19
- loginSocialUnlink: `${root}/login/social/unlink/`,
20
- loginOtpVerify: `${root}/otp/verify/`,
21
- otpRequest: `${root}/otp/request/`,
22
- register: `${root}/register/`,
23
- accountConfirmation: `${root}/registration/account-confirmation-email/`,
24
- accountConfirmationResend: `${root}/registration/account-confirmation-email/resend/`,
25
- me: `${root}/me/?client=web`,
26
- profilePicture: `${root}/profile/picture/`,
27
- refresh: `${root}/token/refresh/`,
28
- switchProfile: `${root}/profile/switch/`,
29
- profiles: `${root}/profiles/`,
30
- accountUpdate: `${root}/account/update/`,
31
- accountDelete: `${root}/account/delete/`,
32
- passwordResetRequest: `${root}/password-reset/request/`,
33
- passwordResetConfirm: `${root}/password-reset/confirm/`,
34
- passwordResetChange: `${root}/password-reset/change/`,
35
- adminCreateSuperuser: `${root}/admin/create-superuser/`,
36
- adminCreateStaff: `${root}/admin/create-staff/`
37
- };
38
- };
39
- export const defaultAuthEndpoints = createAuthEndpoints('/authentication');
40
- const getRefreshTokenFromResponse = (response) => ({
41
- accessToken: response.data.accessToken ?? response.data.access ?? '',
42
- refreshToken: response.data.refreshToken ?? response.data.refresh ?? ''
43
- });
44
- const normalizeBaseUrl = (apiBaseUrl) => apiBaseUrl.replace(/\/+$/, '');
45
- const normalizeDetailResponse = (data) => ({
46
- ...data,
47
- emailSent: data.emailSent ?? data.email_sent
48
- });
49
- const withClientPayload = (payload, defaultClient) => {
50
- const client = payload.client ?? defaultClient;
51
- if (client === 'web') {
52
- const { device: _device, ...rest } = payload;
53
- return { ...rest, client };
54
- }
55
- return { ...payload, client };
56
- };
57
- export const createAuthClient = (config) => {
58
- const endpoints = {
59
- ...createAuthEndpoints(config.apiBasePath),
60
- ...(config.endpoints ?? {})
61
- };
62
- const tokenStorageKey = config.tokenStorageKey ?? 'jwt_access_token';
63
- const refreshTokenStorageKey = config.refreshTokenStorageKey ?? 'jwt_refresh_token';
64
- const tokenStorage = config.tokenStorage ?? createLocalStorageTokenStorage(tokenStorageKey);
65
- const baseUrl = normalizeBaseUrl(config.apiBaseUrl);
66
- const defaultClient = config.defaultClient ?? 'web';
67
- const withBaseUrl = (path) => `${baseUrl}${path.startsWith('/') ? path : `/${path}`}`;
68
- const getAccessToken = () => tokenStorage.getAccessToken();
69
- const setAccessToken = (token) => tokenStorage.setAccessToken(token);
70
- const clearSession = () => tokenStorage.removeAccessToken();
71
- let refreshPromise = null;
72
- const saveRefreshToken = (token) => {
73
- if (!token) {
74
- return;
75
- }
76
- if (typeof window === 'undefined' || !window.localStorage) {
77
- return;
78
- }
79
- window.localStorage.setItem(refreshTokenStorageKey, token);
80
- };
81
- const getStoredRefreshToken = () => {
82
- if (typeof window === 'undefined' || !window.localStorage) {
83
- return null;
84
- }
85
- return window.localStorage.getItem(refreshTokenStorageKey);
86
- };
87
- const clearStoredRefreshToken = () => {
88
- if (typeof window === 'undefined' || !window.localStorage) {
89
- return;
90
- }
91
- window.localStorage.removeItem(refreshTokenStorageKey);
92
- };
93
- const createPublicAxios = () => axios.create({
94
- baseURL: baseUrl
95
- });
96
- const createAuthenticatedAxios = (options) => {
97
- const instance = axios.create({
98
- baseURL: baseUrl,
99
- ...(options?.requestConfig ?? {})
100
- });
101
- instance.interceptors.request.use((requestConfig) => {
102
- const token = getAccessToken();
103
- if (token) {
104
- requestConfig.headers = requestConfig.headers ?? {};
105
- requestConfig.headers.Authorization = `Bearer ${token}`;
106
- }
107
- return requestConfig;
108
- });
109
- instance.interceptors.response.use((response) => response, (error) => {
110
- if (axios.isAxiosError(error) &&
111
- error.response?.status === 401 &&
112
- typeof config.onUnauthorized === 'function') {
113
- config.onUnauthorized();
114
- }
115
- return Promise.reject(error);
116
- });
117
- return instance;
118
- };
119
- const createAuthenticatedAxiosWithRefresh = (options) => {
120
- const instance = createAuthenticatedAxios(options);
121
- instance.interceptors.response.use((response) => response, async (error) => {
122
- if (!axios.isAxiosError(error)) {
123
- return Promise.reject(error);
124
- }
125
- const originalRequest = error.config;
126
- if (error.response?.status !== 401 || !originalRequest || originalRequest._retry) {
127
- return Promise.reject(error);
128
- }
129
- originalRequest._retry = true;
130
- try {
131
- if (!refreshPromise) {
132
- refreshPromise = (async () => {
133
- const refreshTokenFromStorage = getStoredRefreshToken();
134
- if (!refreshTokenFromStorage) {
135
- return null;
136
- }
137
- const nextTokens = await refreshToken({ refreshToken: refreshTokenFromStorage });
138
- saveRefreshToken(nextTokens.refreshToken);
139
- return nextTokens.accessToken || null;
140
- })().finally(() => {
141
- refreshPromise = null;
142
- });
143
- }
144
- const nextAccessToken = await refreshPromise;
145
- if (!nextAccessToken) {
146
- return Promise.reject(error);
147
- }
148
- setAccessToken(nextAccessToken);
149
- originalRequest.headers = originalRequest.headers ?? {};
150
- originalRequest.headers.Authorization = `Bearer ${nextAccessToken}`;
151
- return instance(originalRequest);
152
- }
153
- catch (refreshError) {
154
- if (typeof config.onUnauthorized === 'function') {
155
- config.onUnauthorized();
156
- }
157
- return Promise.reject(refreshError);
158
- }
159
- });
160
- return instance;
161
- };
162
- const loginBasic = async (payload) => {
163
- const response = await createPublicAxios().post(withBaseUrl(endpoints.loginBasic), {
164
- ...withClientPayload(payload, defaultClient)
165
- });
166
- const accessToken = response.data.tokens?.accessToken;
167
- const refreshTokenValue = response.data.tokens?.refreshToken;
168
- if (accessToken) {
169
- setAccessToken(accessToken);
170
- }
171
- saveRefreshToken(refreshTokenValue);
172
- return response.data;
173
- };
174
- const loginSocial = async (payload) => {
175
- const response = await createPublicAxios().post(withBaseUrl(endpoints.loginSocial), withClientPayload(payload, defaultClient));
176
- const accessToken = response.data.tokens?.accessToken;
177
- const refreshTokenValue = response.data.tokens?.refreshToken;
178
- if (accessToken) {
179
- setAccessToken(accessToken);
180
- }
181
- saveRefreshToken(refreshTokenValue);
182
- return response.data;
183
- };
184
- const loginSocialPrecheck = async (payload) => {
185
- const response = await createPublicAxios().post(withBaseUrl(endpoints.loginSocialPrecheck), withClientPayload(payload, defaultClient));
186
- return response.data;
187
- };
188
- const linkSocial = async (payload) => {
189
- const response = await createAuthenticatedAxiosWithRefresh().post(withBaseUrl(endpoints.loginSocialLink), payload);
190
- return response.data;
191
- };
192
- const unlinkSocial = async (payload) => {
193
- const response = await createAuthenticatedAxiosWithRefresh().post(withBaseUrl(endpoints.loginSocialUnlink), payload);
194
- return response.data;
195
- };
196
- const requestOtp = async (payload) => {
197
- const response = await createPublicAxios().post(withBaseUrl(endpoints.otpRequest), payload);
198
- return response.data;
199
- };
200
- const verifyOtp = async (payload) => {
201
- const response = await createPublicAxios().post(withBaseUrl(endpoints.loginOtpVerify), withClientPayload(payload, defaultClient));
202
- const accessToken = response.data.tokens?.accessToken;
203
- const refreshTokenValue = response.data.tokens?.refreshToken;
204
- if (accessToken) {
205
- setAccessToken(accessToken);
206
- }
207
- saveRefreshToken(refreshTokenValue);
208
- return response.data;
209
- };
210
- const register = async (payload) => {
211
- const response = await createPublicAxios().post(withBaseUrl(endpoints.register), payload);
212
- return normalizeDetailResponse(response.data);
213
- };
214
- const confirmAccountEmail = async (payload) => {
215
- const response = await createPublicAxios().post(withBaseUrl(endpoints.accountConfirmation), payload);
216
- return normalizeDetailResponse(response.data);
217
- };
218
- const resendAccountConfirmation = async (payload) => {
219
- const response = await createPublicAxios().post(withBaseUrl(endpoints.accountConfirmationResend), payload);
220
- return normalizeDetailResponse(response.data);
221
- };
222
- const getMe = async () => {
223
- const response = await createAuthenticatedAxiosWithRefresh().get(withBaseUrl(endpoints.me));
224
- return response.data;
225
- };
226
- const updateProfilePicture = async (payload) => {
227
- const response = await createAuthenticatedAxiosWithRefresh().patch(withBaseUrl(endpoints.profilePicture), payload);
228
- return response.data;
229
- };
230
- const updateAccount = async (payload, method = 'PATCH') => {
231
- const instance = createAuthenticatedAxiosWithRefresh();
232
- const response = method === 'PUT'
233
- ? await instance.put(withBaseUrl(endpoints.accountUpdate), payload)
234
- : await instance.patch(withBaseUrl(endpoints.accountUpdate), payload);
235
- return response.data;
236
- };
237
- const deleteAccount = async (payload) => {
238
- const response = await createAuthenticatedAxiosWithRefresh().delete(withBaseUrl(endpoints.accountDelete), {
239
- data: payload
240
- });
241
- return response.data;
242
- };
243
- const getProfiles = async () => {
244
- const response = await createAuthenticatedAxiosWithRefresh().get(withBaseUrl(endpoints.profiles));
245
- return response.data;
246
- };
247
- const getProfileById = async (profileId) => {
248
- const response = await createAuthenticatedAxiosWithRefresh().get(withBaseUrl(`${endpoints.profiles}${profileId}/`));
249
- return response.data;
250
- };
251
- const createProfile = async (payload) => {
252
- const response = await createAuthenticatedAxiosWithRefresh().post(withBaseUrl(endpoints.profiles), payload);
253
- return response.data;
254
- };
255
- const updateProfile = async (profileId, payload) => {
256
- const response = await createAuthenticatedAxiosWithRefresh().patch(withBaseUrl(`${endpoints.profiles}${profileId}/`), payload);
257
- return response.data;
258
- };
259
- const deleteProfile = async (profileId) => {
260
- const response = await createAuthenticatedAxiosWithRefresh().delete(withBaseUrl(`${endpoints.profiles}${profileId}/`));
261
- return response.data;
262
- };
263
- const requestPasswordReset = async (payload) => {
264
- const response = await createPublicAxios().post(withBaseUrl(endpoints.passwordResetRequest), payload);
265
- return normalizeDetailResponse(response.data);
266
- };
267
- const confirmPasswordReset = async (payload) => {
268
- const response = await createPublicAxios().post(withBaseUrl(endpoints.passwordResetConfirm), payload);
269
- return response.data;
270
- };
271
- const changePassword = async (payload) => {
272
- const response = await createAuthenticatedAxiosWithRefresh().post(withBaseUrl(endpoints.passwordResetChange), payload);
273
- return response.data;
274
- };
275
- const refreshToken = async (payload) => {
276
- const refreshTokenValue = payload?.refreshToken ?? getStoredRefreshToken();
277
- if (!refreshTokenValue) {
278
- return {
279
- accessToken: '',
280
- refreshToken: ''
281
- };
282
- }
283
- const response = await createPublicAxios().post(withBaseUrl(endpoints.refresh), {
284
- refresh: refreshTokenValue
285
- });
286
- const nextTokens = getRefreshTokenFromResponse(response);
287
- if (nextTokens.accessToken) {
288
- setAccessToken(nextTokens.accessToken);
289
- }
290
- saveRefreshToken(nextTokens.refreshToken);
291
- return nextTokens;
292
- };
293
- const switchProfile = async (payload) => {
294
- const response = await createAuthenticatedAxios().post(withBaseUrl(endpoints.switchProfile), withClientPayload(payload, defaultClient));
295
- const accessToken = response.data.tokens?.accessToken;
296
- const refreshTokenValue = response.data.tokens?.refreshToken;
297
- if (accessToken) {
298
- setAccessToken(accessToken);
299
- }
300
- saveRefreshToken(refreshTokenValue);
301
- return response.data;
302
- };
303
- const logout = () => {
304
- clearSession();
305
- clearStoredRefreshToken();
306
- };
307
- const createAdminUser = async (endpoint, payload, bootstrapToken) => {
308
- const headers = bootstrapToken
309
- ? {
310
- 'X-Admin-Bootstrap-Token': bootstrapToken
311
- }
312
- : undefined;
313
- const requestClient = bootstrapToken ? createPublicAxios() : createAuthenticatedAxiosWithRefresh();
314
- const response = await requestClient.post(withBaseUrl(endpoint), payload, { headers });
315
- return response.data;
316
- };
317
- const createSuperuser = async (payload, bootstrapToken) => {
318
- return createAdminUser(endpoints.adminCreateSuperuser, payload, bootstrapToken);
319
- };
320
- const createStaffUser = async (payload, bootstrapToken) => {
321
- return createAdminUser(endpoints.adminCreateStaff, payload, bootstrapToken);
322
- };
323
- return {
324
- endpoints,
325
- tokenStorage,
326
- getAccessToken,
327
- setAccessToken,
328
- clearSession,
329
- createPublicAxios,
330
- createAuthenticatedAxios,
331
- createAuthenticatedAxiosWithRefresh,
332
- loginBasic,
333
- loginSocial,
334
- loginSocialPrecheck,
335
- linkSocial,
336
- unlinkSocial,
337
- requestOtp,
338
- verifyOtp,
339
- register,
340
- confirmAccountEmail,
341
- resendAccountConfirmation,
342
- getMe,
343
- updateProfilePicture,
344
- updateAccount,
345
- deleteAccount,
346
- getProfiles,
347
- getProfileById,
348
- createProfile,
349
- updateProfile,
350
- deleteProfile,
351
- requestPasswordReset,
352
- confirmPasswordReset,
353
- changePassword,
354
- refreshToken,
355
- switchProfile,
356
- createSuperuser,
357
- createStaffUser,
358
- logout
359
- };
360
- };
361
- export const createAuthClientFromJBWebConfig = (appConfig, overrides) => {
362
- return createAuthClient({
363
- apiBaseUrl: getApiBaseUrl(appConfig),
364
- apiBasePath: getAuthBasePath(appConfig),
365
- ...(overrides ?? {})
366
- });
367
- };
@@ -1,9 +0,0 @@
1
- import { SelectOption } from '../../forms';
2
- export type CountryCallingCodeOption = SelectOption<string> & {
3
- iso2: string;
4
- countryName: string;
5
- dialCode: string;
6
- };
7
- export declare const COUNTRY_CALLING_CODE_OPTIONS: CountryCallingCodeOption[];
8
- export declare const DEFAULT_OTP_COUNTRY_CODE = "+52";
9
- //# sourceMappingURL=countryCallingCodes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"countryCallingCodes.d.ts","sourceRoot":"","sources":["../../../src/auth/constants/countryCallingCodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,wBAAwB,EA+MlE,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAQ,CAAC"}
@@ -1,209 +0,0 @@
1
- export const COUNTRY_CALLING_CODE_OPTIONS = [
2
- { value: '+1', label: "🇺🇸 United States (+1)", iso2: 'us', countryName: "United States", dialCode: '+1' },
3
- { value: '+52', label: "🇲🇽 Mexico (+52)", iso2: 'mx', countryName: "Mexico", dialCode: '+52' },
4
- { value: '+44', label: "🇬🇧 United Kingdom (+44)", iso2: 'gb', countryName: "United Kingdom", dialCode: '+44' },
5
- { value: '+34', label: "🇪🇸 Spain (+34)", iso2: 'es', countryName: "Spain", dialCode: '+34' },
6
- { value: '+57', label: "🇨🇴 Colombia (+57)", iso2: 'co', countryName: "Colombia", dialCode: '+57' },
7
- { value: '+54', label: "🇦🇷 Argentina (+54)", iso2: 'ar', countryName: "Argentina", dialCode: '+54' },
8
- { value: '+55', label: "🇧🇷 Brazil (+55)", iso2: 'br', countryName: "Brazil", dialCode: '+55' },
9
- { value: '+49', label: "🇩🇪 Germany (+49)", iso2: 'de', countryName: "Germany", dialCode: '+49' },
10
- { value: '+33', label: "🇫🇷 France (+33)", iso2: 'fr', countryName: "France", dialCode: '+33' },
11
- { value: '+39', label: "🇮🇹 Italy (+39)", iso2: 'it', countryName: "Italy", dialCode: '+39' },
12
- { value: '+91', label: "🇮🇳 India (+91)", iso2: 'in', countryName: "India", dialCode: '+91' },
13
- { value: '+86', label: "🇨🇳 China (+86)", iso2: 'cn', countryName: "China", dialCode: '+86' },
14
- { value: '+81', label: "🇯🇵 Japan (+81)", iso2: 'jp', countryName: "Japan", dialCode: '+81' },
15
- { value: '+61', label: "🇦🇺 Australia (+61)", iso2: 'au', countryName: "Australia", dialCode: '+61' },
16
- { value: '+56', label: "🇨🇱 Chile (+56)", iso2: 'cl', countryName: "Chile", dialCode: '+56' },
17
- { value: '+51', label: "🇵🇪 Peru (+51)", iso2: 'pe', countryName: "Peru", dialCode: '+51' },
18
- { value: '+93', label: "🇦🇫 Afghanistan (+93)", iso2: 'af', countryName: "Afghanistan", dialCode: '+93' },
19
- { value: '+358', label: "🇦🇽 Åland Islands (+358)", iso2: 'ax', countryName: "Åland Islands", dialCode: '+358' },
20
- { value: '+355', label: "🇦🇱 Albania (+355)", iso2: 'al', countryName: "Albania", dialCode: '+355' },
21
- { value: '+213', label: "🇩🇿 Algeria (+213)", iso2: 'dz', countryName: "Algeria", dialCode: '+213' },
22
- { value: '+376', label: "🇦🇩 Andorra (+376)", iso2: 'ad', countryName: "Andorra", dialCode: '+376' },
23
- { value: '+244', label: "🇦🇴 Angola (+244)", iso2: 'ao', countryName: "Angola", dialCode: '+244' },
24
- { value: '+374', label: "🇦🇲 Armenia (+374)", iso2: 'am', countryName: "Armenia", dialCode: '+374' },
25
- { value: '+297', label: "🇦🇼 Aruba (+297)", iso2: 'aw', countryName: "Aruba", dialCode: '+297' },
26
- { value: '+247', label: "🇦🇨 Ascension Island (+247)", iso2: 'ac', countryName: "Ascension Island", dialCode: '+247' },
27
- { value: '+43', label: "🇦🇹 Austria (+43)", iso2: 'at', countryName: "Austria", dialCode: '+43' },
28
- { value: '+994', label: "🇦🇿 Azerbaijan (+994)", iso2: 'az', countryName: "Azerbaijan", dialCode: '+994' },
29
- { value: '+973', label: "🇧🇭 Bahrain (+973)", iso2: 'bh', countryName: "Bahrain", dialCode: '+973' },
30
- { value: '+880', label: "🇧🇩 Bangladesh (+880)", iso2: 'bd', countryName: "Bangladesh", dialCode: '+880' },
31
- { value: '+375', label: "🇧🇾 Belarus (+375)", iso2: 'by', countryName: "Belarus", dialCode: '+375' },
32
- { value: '+32', label: "🇧🇪 Belgium (+32)", iso2: 'be', countryName: "Belgium", dialCode: '+32' },
33
- { value: '+501', label: "🇧🇿 Belize (+501)", iso2: 'bz', countryName: "Belize", dialCode: '+501' },
34
- { value: '+229', label: "🇧🇯 Benin (+229)", iso2: 'bj', countryName: "Benin", dialCode: '+229' },
35
- { value: '+975', label: "🇧🇹 Bhutan (+975)", iso2: 'bt', countryName: "Bhutan", dialCode: '+975' },
36
- { value: '+591', label: "🇧🇴 Bolivia (+591)", iso2: 'bo', countryName: "Bolivia", dialCode: '+591' },
37
- { value: '+387', label: "🇧🇦 Bosnia and Herzegovina (+387)", iso2: 'ba', countryName: "Bosnia and Herzegovina", dialCode: '+387' },
38
- { value: '+267', label: "🇧🇼 Botswana (+267)", iso2: 'bw', countryName: "Botswana", dialCode: '+267' },
39
- { value: '+246', label: "🇮🇴 British Indian Ocean Territory (+246)", iso2: 'io', countryName: "British Indian Ocean Territory", dialCode: '+246' },
40
- { value: '+673', label: "🇧🇳 Brunei (+673)", iso2: 'bn', countryName: "Brunei", dialCode: '+673' },
41
- { value: '+359', label: "🇧🇬 Bulgaria (+359)", iso2: 'bg', countryName: "Bulgaria", dialCode: '+359' },
42
- { value: '+226', label: "🇧🇫 Burkina Faso (+226)", iso2: 'bf', countryName: "Burkina Faso", dialCode: '+226' },
43
- { value: '+257', label: "🇧🇮 Burundi (+257)", iso2: 'bi', countryName: "Burundi", dialCode: '+257' },
44
- { value: '+855', label: "🇰🇭 Cambodia (+855)", iso2: 'kh', countryName: "Cambodia", dialCode: '+855' },
45
- { value: '+237', label: "🇨🇲 Cameroon (+237)", iso2: 'cm', countryName: "Cameroon", dialCode: '+237' },
46
- { value: '+238', label: "🇨🇻 Cape Verde (+238)", iso2: 'cv', countryName: "Cape Verde", dialCode: '+238' },
47
- { value: '+599', label: "🇧🇶 Caribbean Netherlands (+599)", iso2: 'bq', countryName: "Caribbean Netherlands", dialCode: '+599' },
48
- { value: '+236', label: "🇨🇫 Central African Republic (+236)", iso2: 'cf', countryName: "Central African Republic", dialCode: '+236' },
49
- { value: '+235', label: "🇹🇩 Chad (+235)", iso2: 'td', countryName: "Chad", dialCode: '+235' },
50
- { value: '+269', label: "🇰🇲 Comoros (+269)", iso2: 'km', countryName: "Comoros", dialCode: '+269' },
51
- { value: '+242', label: "🇨🇬 Congo (Brazzaville) (+242)", iso2: 'cg', countryName: "Congo (Brazzaville)", dialCode: '+242' },
52
- { value: '+243', label: "🇨🇩 Congo (Kinshasa) (+243)", iso2: 'cd', countryName: "Congo (Kinshasa)", dialCode: '+243' },
53
- { value: '+682', label: "🇨🇰 Cook Islands (+682)", iso2: 'ck', countryName: "Cook Islands", dialCode: '+682' },
54
- { value: '+506', label: "🇨🇷 Costa Rica (+506)", iso2: 'cr', countryName: "Costa Rica", dialCode: '+506' },
55
- { value: '+225', label: "🇨🇮 Côte d'Ivoire (+225)", iso2: 'ci', countryName: "Côte d'Ivoire", dialCode: '+225' },
56
- { value: '+385', label: "🇭🇷 Croatia (+385)", iso2: 'hr', countryName: "Croatia", dialCode: '+385' },
57
- { value: '+53', label: "🇨🇺 Cuba (+53)", iso2: 'cu', countryName: "Cuba", dialCode: '+53' },
58
- { value: '+357', label: "🇨🇾 Cyprus (+357)", iso2: 'cy', countryName: "Cyprus", dialCode: '+357' },
59
- { value: '+420', label: "🇨🇿 Czech Republic (+420)", iso2: 'cz', countryName: "Czech Republic", dialCode: '+420' },
60
- { value: '+45', label: "🇩🇰 Denmark (+45)", iso2: 'dk', countryName: "Denmark", dialCode: '+45' },
61
- { value: '+253', label: "🇩🇯 Djibouti (+253)", iso2: 'dj', countryName: "Djibouti", dialCode: '+253' },
62
- { value: '+593', label: "🇪🇨 Ecuador (+593)", iso2: 'ec', countryName: "Ecuador", dialCode: '+593' },
63
- { value: '+20', label: "🇪🇬 Egypt (+20)", iso2: 'eg', countryName: "Egypt", dialCode: '+20' },
64
- { value: '+503', label: "🇸🇻 El Salvador (+503)", iso2: 'sv', countryName: "El Salvador", dialCode: '+503' },
65
- { value: '+240', label: "🇬🇶 Equatorial Guinea (+240)", iso2: 'gq', countryName: "Equatorial Guinea", dialCode: '+240' },
66
- { value: '+291', label: "🇪🇷 Eritrea (+291)", iso2: 'er', countryName: "Eritrea", dialCode: '+291' },
67
- { value: '+372', label: "🇪🇪 Estonia (+372)", iso2: 'ee', countryName: "Estonia", dialCode: '+372' },
68
- { value: '+268', label: "🇸🇿 Eswatini (+268)", iso2: 'sz', countryName: "Eswatini", dialCode: '+268' },
69
- { value: '+251', label: "🇪🇹 Ethiopia (+251)", iso2: 'et', countryName: "Ethiopia", dialCode: '+251' },
70
- { value: '+500', label: "🇫🇰 Falkland Islands (Malvinas) (+500)", iso2: 'fk', countryName: "Falkland Islands (Malvinas)", dialCode: '+500' },
71
- { value: '+298', label: "🇫🇴 Faroe Islands (+298)", iso2: 'fo', countryName: "Faroe Islands", dialCode: '+298' },
72
- { value: '+679', label: "🇫🇯 Fiji (+679)", iso2: 'fj', countryName: "Fiji", dialCode: '+679' },
73
- { value: '+594', label: "🇬🇫 French Guiana (+594)", iso2: 'gf', countryName: "French Guiana", dialCode: '+594' },
74
- { value: '+689', label: "🇵🇫 French Polynesia (+689)", iso2: 'pf', countryName: "French Polynesia", dialCode: '+689' },
75
- { value: '+241', label: "🇬🇦 Gabon (+241)", iso2: 'ga', countryName: "Gabon", dialCode: '+241' },
76
- { value: '+220', label: "🇬🇲 Gambia (+220)", iso2: 'gm', countryName: "Gambia", dialCode: '+220' },
77
- { value: '+995', label: "🇬🇪 Georgia (+995)", iso2: 'ge', countryName: "Georgia", dialCode: '+995' },
78
- { value: '+233', label: "🇬🇭 Ghana (+233)", iso2: 'gh', countryName: "Ghana", dialCode: '+233' },
79
- { value: '+350', label: "🇬🇮 Gibraltar (+350)", iso2: 'gi', countryName: "Gibraltar", dialCode: '+350' },
80
- { value: '+30', label: "🇬🇷 Greece (+30)", iso2: 'gr', countryName: "Greece", dialCode: '+30' },
81
- { value: '+299', label: "🇬🇱 Greenland (+299)", iso2: 'gl', countryName: "Greenland", dialCode: '+299' },
82
- { value: '+590', label: "🇬🇵 Guadeloupe (+590)", iso2: 'gp', countryName: "Guadeloupe", dialCode: '+590' },
83
- { value: '+502', label: "🇬🇹 Guatemala (+502)", iso2: 'gt', countryName: "Guatemala", dialCode: '+502' },
84
- { value: '+224', label: "🇬🇳 Guinea (+224)", iso2: 'gn', countryName: "Guinea", dialCode: '+224' },
85
- { value: '+245', label: "🇬🇼 Guinea-Bissau (+245)", iso2: 'gw', countryName: "Guinea-Bissau", dialCode: '+245' },
86
- { value: '+592', label: "🇬🇾 Guyana (+592)", iso2: 'gy', countryName: "Guyana", dialCode: '+592' },
87
- { value: '+509', label: "🇭🇹 Haiti (+509)", iso2: 'ht', countryName: "Haiti", dialCode: '+509' },
88
- { value: '+504', label: "🇭🇳 Honduras (+504)", iso2: 'hn', countryName: "Honduras", dialCode: '+504' },
89
- { value: '+852', label: "🇭🇰 Hong Kong SAR China (+852)", iso2: 'hk', countryName: "Hong Kong SAR China", dialCode: '+852' },
90
- { value: '+36', label: "🇭🇺 Hungary (+36)", iso2: 'hu', countryName: "Hungary", dialCode: '+36' },
91
- { value: '+354', label: "🇮🇸 Iceland (+354)", iso2: 'is', countryName: "Iceland", dialCode: '+354' },
92
- { value: '+62', label: "🇮🇩 Indonesia (+62)", iso2: 'id', countryName: "Indonesia", dialCode: '+62' },
93
- { value: '+98', label: "🇮🇷 Iran (+98)", iso2: 'ir', countryName: "Iran", dialCode: '+98' },
94
- { value: '+964', label: "🇮🇶 Iraq (+964)", iso2: 'iq', countryName: "Iraq", dialCode: '+964' },
95
- { value: '+353', label: "🇮🇪 Ireland (+353)", iso2: 'ie', countryName: "Ireland", dialCode: '+353' },
96
- { value: '+972', label: "🇮🇱 Israel (+972)", iso2: 'il', countryName: "Israel", dialCode: '+972' },
97
- { value: '+962', label: "🇯🇴 Jordan (+962)", iso2: 'jo', countryName: "Jordan", dialCode: '+962' },
98
- { value: '+7', label: "🇰🇿 Kazakhstan (+7)", iso2: 'kz', countryName: "Kazakhstan", dialCode: '+7' },
99
- { value: '+254', label: "🇰🇪 Kenya (+254)", iso2: 'ke', countryName: "Kenya", dialCode: '+254' },
100
- { value: '+686', label: "🇰🇮 Kiribati (+686)", iso2: 'ki', countryName: "Kiribati", dialCode: '+686' },
101
- { value: '+383', label: "🇽🇰 Kosovo (+383)", iso2: 'xk', countryName: "Kosovo", dialCode: '+383' },
102
- { value: '+965', label: "🇰🇼 Kuwait (+965)", iso2: 'kw', countryName: "Kuwait", dialCode: '+965' },
103
- { value: '+996', label: "🇰🇬 Kyrgyzstan (+996)", iso2: 'kg', countryName: "Kyrgyzstan", dialCode: '+996' },
104
- { value: '+856', label: "🇱🇦 Laos (+856)", iso2: 'la', countryName: "Laos", dialCode: '+856' },
105
- { value: '+371', label: "🇱🇻 Latvia (+371)", iso2: 'lv', countryName: "Latvia", dialCode: '+371' },
106
- { value: '+961', label: "🇱🇧 Lebanon (+961)", iso2: 'lb', countryName: "Lebanon", dialCode: '+961' },
107
- { value: '+266', label: "🇱🇸 Lesotho (+266)", iso2: 'ls', countryName: "Lesotho", dialCode: '+266' },
108
- { value: '+231', label: "🇱🇷 Liberia (+231)", iso2: 'lr', countryName: "Liberia", dialCode: '+231' },
109
- { value: '+218', label: "🇱🇾 Libya (+218)", iso2: 'ly', countryName: "Libya", dialCode: '+218' },
110
- { value: '+423', label: "🇱🇮 Liechtenstein (+423)", iso2: 'li', countryName: "Liechtenstein", dialCode: '+423' },
111
- { value: '+370', label: "🇱🇹 Lithuania (+370)", iso2: 'lt', countryName: "Lithuania", dialCode: '+370' },
112
- { value: '+352', label: "🇱🇺 Luxembourg (+352)", iso2: 'lu', countryName: "Luxembourg", dialCode: '+352' },
113
- { value: '+853', label: "🇲🇴 Macao SAR China (+853)", iso2: 'mo', countryName: "Macao SAR China", dialCode: '+853' },
114
- { value: '+261', label: "🇲🇬 Madagascar (+261)", iso2: 'mg', countryName: "Madagascar", dialCode: '+261' },
115
- { value: '+265', label: "🇲🇼 Malawi (+265)", iso2: 'mw', countryName: "Malawi", dialCode: '+265' },
116
- { value: '+60', label: "🇲🇾 Malaysia (+60)", iso2: 'my', countryName: "Malaysia", dialCode: '+60' },
117
- { value: '+960', label: "🇲🇻 Maldives (+960)", iso2: 'mv', countryName: "Maldives", dialCode: '+960' },
118
- { value: '+223', label: "🇲🇱 Mali (+223)", iso2: 'ml', countryName: "Mali", dialCode: '+223' },
119
- { value: '+356', label: "🇲🇹 Malta (+356)", iso2: 'mt', countryName: "Malta", dialCode: '+356' },
120
- { value: '+692', label: "🇲🇭 Marshall Islands (+692)", iso2: 'mh', countryName: "Marshall Islands", dialCode: '+692' },
121
- { value: '+596', label: "🇲🇶 Martinique (+596)", iso2: 'mq', countryName: "Martinique", dialCode: '+596' },
122
- { value: '+222', label: "🇲🇷 Mauritania (+222)", iso2: 'mr', countryName: "Mauritania", dialCode: '+222' },
123
- { value: '+230', label: "🇲🇺 Mauritius (+230)", iso2: 'mu', countryName: "Mauritius", dialCode: '+230' },
124
- { value: '+262', label: "🇾🇹 Mayotte (+262)", iso2: 'yt', countryName: "Mayotte", dialCode: '+262' },
125
- { value: '+691', label: "🇫🇲 Micronesia (+691)", iso2: 'fm', countryName: "Micronesia", dialCode: '+691' },
126
- { value: '+373', label: "🇲🇩 Moldova (+373)", iso2: 'md', countryName: "Moldova", dialCode: '+373' },
127
- { value: '+377', label: "🇲🇨 Monaco (+377)", iso2: 'mc', countryName: "Monaco", dialCode: '+377' },
128
- { value: '+976', label: "🇲🇳 Mongolia (+976)", iso2: 'mn', countryName: "Mongolia", dialCode: '+976' },
129
- { value: '+382', label: "🇲🇪 Montenegro (+382)", iso2: 'me', countryName: "Montenegro", dialCode: '+382' },
130
- { value: '+212', label: "🇲🇦 Morocco (+212)", iso2: 'ma', countryName: "Morocco", dialCode: '+212' },
131
- { value: '+258', label: "🇲🇿 Mozambique (+258)", iso2: 'mz', countryName: "Mozambique", dialCode: '+258' },
132
- { value: '+95', label: "🇲🇲 Myanmar (Burma) (+95)", iso2: 'mm', countryName: "Myanmar (Burma)", dialCode: '+95' },
133
- { value: '+264', label: "🇳🇦 Namibia (+264)", iso2: 'na', countryName: "Namibia", dialCode: '+264' },
134
- { value: '+674', label: "🇳🇷 Nauru (+674)", iso2: 'nr', countryName: "Nauru", dialCode: '+674' },
135
- { value: '+977', label: "🇳🇵 Nepal (+977)", iso2: 'np', countryName: "Nepal", dialCode: '+977' },
136
- { value: '+31', label: "🇳🇱 Netherlands (+31)", iso2: 'nl', countryName: "Netherlands", dialCode: '+31' },
137
- { value: '+687', label: "🇳🇨 New Caledonia (+687)", iso2: 'nc', countryName: "New Caledonia", dialCode: '+687' },
138
- { value: '+64', label: "🇳🇿 New Zealand (+64)", iso2: 'nz', countryName: "New Zealand", dialCode: '+64' },
139
- { value: '+505', label: "🇳🇮 Nicaragua (+505)", iso2: 'ni', countryName: "Nicaragua", dialCode: '+505' },
140
- { value: '+227', label: "🇳🇪 Niger (+227)", iso2: 'ne', countryName: "Niger", dialCode: '+227' },
141
- { value: '+234', label: "🇳🇬 Nigeria (+234)", iso2: 'ng', countryName: "Nigeria", dialCode: '+234' },
142
- { value: '+683', label: "🇳🇺 Niue (+683)", iso2: 'nu', countryName: "Niue", dialCode: '+683' },
143
- { value: '+672', label: "🇳🇫 Norfolk Island (+672)", iso2: 'nf', countryName: "Norfolk Island", dialCode: '+672' },
144
- { value: '+850', label: "🇰🇵 North Korea (+850)", iso2: 'kp', countryName: "North Korea", dialCode: '+850' },
145
- { value: '+389', label: "🇲🇰 North Macedonia (+389)", iso2: 'mk', countryName: "North Macedonia", dialCode: '+389' },
146
- { value: '+47', label: "🇳🇴 Norway (+47)", iso2: 'no', countryName: "Norway", dialCode: '+47' },
147
- { value: '+968', label: "🇴🇲 Oman (+968)", iso2: 'om', countryName: "Oman", dialCode: '+968' },
148
- { value: '+92', label: "🇵🇰 Pakistan (+92)", iso2: 'pk', countryName: "Pakistan", dialCode: '+92' },
149
- { value: '+680', label: "🇵🇼 Palau (+680)", iso2: 'pw', countryName: "Palau", dialCode: '+680' },
150
- { value: '+970', label: "🇵🇸 Palestinian Territories (+970)", iso2: 'ps', countryName: "Palestinian Territories", dialCode: '+970' },
151
- { value: '+507', label: "🇵🇦 Panama (+507)", iso2: 'pa', countryName: "Panama", dialCode: '+507' },
152
- { value: '+675', label: "🇵🇬 Papua New Guinea (+675)", iso2: 'pg', countryName: "Papua New Guinea", dialCode: '+675' },
153
- { value: '+595', label: "🇵🇾 Paraguay (+595)", iso2: 'py', countryName: "Paraguay", dialCode: '+595' },
154
- { value: '+63', label: "🇵🇭 Philippines (+63)", iso2: 'ph', countryName: "Philippines", dialCode: '+63' },
155
- { value: '+48', label: "🇵🇱 Poland (+48)", iso2: 'pl', countryName: "Poland", dialCode: '+48' },
156
- { value: '+351', label: "🇵🇹 Portugal (+351)", iso2: 'pt', countryName: "Portugal", dialCode: '+351' },
157
- { value: '+974', label: "🇶🇦 Qatar (+974)", iso2: 'qa', countryName: "Qatar", dialCode: '+974' },
158
- { value: '+40', label: "🇷🇴 Romania (+40)", iso2: 'ro', countryName: "Romania", dialCode: '+40' },
159
- { value: '+250', label: "🇷🇼 Rwanda (+250)", iso2: 'rw', countryName: "Rwanda", dialCode: '+250' },
160
- { value: '+685', label: "🇼🇸 Samoa (+685)", iso2: 'ws', countryName: "Samoa", dialCode: '+685' },
161
- { value: '+378', label: "🇸🇲 San Marino (+378)", iso2: 'sm', countryName: "San Marino", dialCode: '+378' },
162
- { value: '+239', label: "🇸🇹 São Tomé & Príncipe (+239)", iso2: 'st', countryName: "São Tomé & Príncipe", dialCode: '+239' },
163
- { value: '+966', label: "🇸🇦 Saudi Arabia (+966)", iso2: 'sa', countryName: "Saudi Arabia", dialCode: '+966' },
164
- { value: '+221', label: "🇸🇳 Senegal (+221)", iso2: 'sn', countryName: "Senegal", dialCode: '+221' },
165
- { value: '+381', label: "🇷🇸 Serbia (+381)", iso2: 'rs', countryName: "Serbia", dialCode: '+381' },
166
- { value: '+248', label: "🇸🇨 Seychelles (+248)", iso2: 'sc', countryName: "Seychelles", dialCode: '+248' },
167
- { value: '+232', label: "🇸🇱 Sierra Leone (+232)", iso2: 'sl', countryName: "Sierra Leone", dialCode: '+232' },
168
- { value: '+65', label: "🇸🇬 Singapore (+65)", iso2: 'sg', countryName: "Singapore", dialCode: '+65' },
169
- { value: '+421', label: "🇸🇰 Slovakia (+421)", iso2: 'sk', countryName: "Slovakia", dialCode: '+421' },
170
- { value: '+386', label: "🇸🇮 Slovenia (+386)", iso2: 'si', countryName: "Slovenia", dialCode: '+386' },
171
- { value: '+677', label: "🇸🇧 Solomon Islands (+677)", iso2: 'sb', countryName: "Solomon Islands", dialCode: '+677' },
172
- { value: '+252', label: "🇸🇴 Somalia (+252)", iso2: 'so', countryName: "Somalia", dialCode: '+252' },
173
- { value: '+27', label: "🇿🇦 South Africa (+27)", iso2: 'za', countryName: "South Africa", dialCode: '+27' },
174
- { value: '+82', label: "🇰🇷 South Korea (+82)", iso2: 'kr', countryName: "South Korea", dialCode: '+82' },
175
- { value: '+211', label: "🇸🇸 South Sudan (+211)", iso2: 'ss', countryName: "South Sudan", dialCode: '+211' },
176
- { value: '+94', label: "🇱🇰 Sri Lanka (+94)", iso2: 'lk', countryName: "Sri Lanka", dialCode: '+94' },
177
- { value: '+290', label: "🇸🇭 St. Helena (+290)", iso2: 'sh', countryName: "St. Helena", dialCode: '+290' },
178
- { value: '+508', label: "🇵🇲 St. Pierre & Miquelon (+508)", iso2: 'pm', countryName: "St. Pierre & Miquelon", dialCode: '+508' },
179
- { value: '+249', label: "🇸🇩 Sudan (+249)", iso2: 'sd', countryName: "Sudan", dialCode: '+249' },
180
- { value: '+597', label: "🇸🇷 Suriname (+597)", iso2: 'sr', countryName: "Suriname", dialCode: '+597' },
181
- { value: '+46', label: "🇸🇪 Sweden (+46)", iso2: 'se', countryName: "Sweden", dialCode: '+46' },
182
- { value: '+41', label: "🇨🇭 Switzerland (+41)", iso2: 'ch', countryName: "Switzerland", dialCode: '+41' },
183
- { value: '+963', label: "🇸🇾 Syria (+963)", iso2: 'sy', countryName: "Syria", dialCode: '+963' },
184
- { value: '+886', label: "🇹🇼 Taiwan (+886)", iso2: 'tw', countryName: "Taiwan", dialCode: '+886' },
185
- { value: '+992', label: "🇹🇯 Tajikistan (+992)", iso2: 'tj', countryName: "Tajikistan", dialCode: '+992' },
186
- { value: '+255', label: "🇹🇿 Tanzania (+255)", iso2: 'tz', countryName: "Tanzania", dialCode: '+255' },
187
- { value: '+66', label: "🇹🇭 Thailand (+66)", iso2: 'th', countryName: "Thailand", dialCode: '+66' },
188
- { value: '+670', label: "🇹🇱 Timor-Leste (+670)", iso2: 'tl', countryName: "Timor-Leste", dialCode: '+670' },
189
- { value: '+228', label: "🇹🇬 Togo (+228)", iso2: 'tg', countryName: "Togo", dialCode: '+228' },
190
- { value: '+690', label: "🇹🇰 Tokelau (+690)", iso2: 'tk', countryName: "Tokelau", dialCode: '+690' },
191
- { value: '+676', label: "🇹🇴 Tonga (+676)", iso2: 'to', countryName: "Tonga", dialCode: '+676' },
192
- { value: '+216', label: "🇹🇳 Tunisia (+216)", iso2: 'tn', countryName: "Tunisia", dialCode: '+216' },
193
- { value: '+90', label: "🇹🇷 Turkey (+90)", iso2: 'tr', countryName: "Turkey", dialCode: '+90' },
194
- { value: '+993', label: "🇹🇲 Turkmenistan (+993)", iso2: 'tm', countryName: "Turkmenistan", dialCode: '+993' },
195
- { value: '+688', label: "🇹🇻 Tuvalu (+688)", iso2: 'tv', countryName: "Tuvalu", dialCode: '+688' },
196
- { value: '+256', label: "🇺🇬 Uganda (+256)", iso2: 'ug', countryName: "Uganda", dialCode: '+256' },
197
- { value: '+380', label: "🇺🇦 Ukraine (+380)", iso2: 'ua', countryName: "Ukraine", dialCode: '+380' },
198
- { value: '+971', label: "🇦🇪 United Arab Emirates (+971)", iso2: 'ae', countryName: "United Arab Emirates", dialCode: '+971' },
199
- { value: '+598', label: "🇺🇾 Uruguay (+598)", iso2: 'uy', countryName: "Uruguay", dialCode: '+598' },
200
- { value: '+998', label: "🇺🇿 Uzbekistan (+998)", iso2: 'uz', countryName: "Uzbekistan", dialCode: '+998' },
201
- { value: '+678', label: "🇻🇺 Vanuatu (+678)", iso2: 'vu', countryName: "Vanuatu", dialCode: '+678' },
202
- { value: '+58', label: "🇻🇪 Venezuela (+58)", iso2: 've', countryName: "Venezuela", dialCode: '+58' },
203
- { value: '+84', label: "🇻🇳 Vietnam (+84)", iso2: 'vn', countryName: "Vietnam", dialCode: '+84' },
204
- { value: '+681', label: "🇼🇫 Wallis & Futuna (+681)", iso2: 'wf', countryName: "Wallis & Futuna", dialCode: '+681' },
205
- { value: '+967', label: "🇾🇪 Yemen (+967)", iso2: 'ye', countryName: "Yemen", dialCode: '+967' },
206
- { value: '+260', label: "🇿🇲 Zambia (+260)", iso2: 'zm', countryName: "Zambia", dialCode: '+260' },
207
- { value: '+263', label: "🇿🇼 Zimbabwe (+263)", iso2: 'zw', countryName: "Zimbabwe", dialCode: '+263' },
208
- ];
209
- export const DEFAULT_OTP_COUNTRY_CODE = '+52';
@@ -1,9 +0,0 @@
1
- export declare const GENDERS: readonly ["MALE", "FEMALE", "OTHER", "PREFER_NOT_TO_SAY"];
2
- export type Gender = (typeof GENDERS)[number];
3
- export declare const DEFAULT_GENDER: Gender;
4
- export declare const GENDER_LABELS: Record<Gender, string>;
5
- export declare const GENDER_SELECT_OPTIONS: {
6
- value: "MALE" | "FEMALE" | "OTHER" | "PREFER_NOT_TO_SAY";
7
- label: string;
8
- }[];
9
- //# sourceMappingURL=gender.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gender.d.ts","sourceRoot":"","sources":["../../../src/auth/constants/gender.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,2DAA4D,CAAC;AAEjF,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,eAAO,MAAM,cAAc,EAAE,MAAgB,CAAC;AAE9C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKhD,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;GAG/B,CAAC"}
@@ -1,12 +0,0 @@
1
- export const GENDERS = ['MALE', 'FEMALE', 'OTHER', 'PREFER_NOT_TO_SAY'];
2
- export const DEFAULT_GENDER = 'OTHER';
3
- export const GENDER_LABELS = {
4
- MALE: 'Masculino',
5
- FEMALE: 'Femenino',
6
- OTHER: 'Otro',
7
- PREFER_NOT_TO_SAY: 'Prefiero no decirlo'
8
- };
9
- export const GENDER_SELECT_OPTIONS = GENDERS.map((value) => ({
10
- value,
11
- label: GENDER_LABELS[value]
12
- }));
@@ -1,3 +0,0 @@
1
- export * from './gender';
2
- export * from './countryCallingCodes';
3
- //# sourceMappingURL=index.d.ts.map