@oxyhq/services 5.11.12 → 5.12.1

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 (322) hide show
  1. package/README.md +48 -7
  2. package/lib/commonjs/core/OxyServices.js +168 -5
  3. package/lib/commonjs/core/OxyServices.js.map +1 -1
  4. package/lib/commonjs/i18n/index.js +40 -0
  5. package/lib/commonjs/i18n/index.js.map +1 -0
  6. package/lib/commonjs/i18n/locales/en-US.json +681 -0
  7. package/lib/commonjs/i18n/locales/es-ES.json +689 -0
  8. package/lib/commonjs/ui/components/GroupedItem.js +2 -1
  9. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
  10. package/lib/commonjs/ui/components/Header.js +4 -3
  11. package/lib/commonjs/ui/components/Header.js.map +1 -1
  12. package/lib/commonjs/ui/components/OxyProvider.js +110 -103
  13. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  14. package/lib/commonjs/ui/components/ProfileCard.js +5 -1
  15. package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
  16. package/lib/commonjs/ui/components/Section.js +1 -1
  17. package/lib/commonjs/ui/components/StepBasedScreen.js +16 -16
  18. package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
  19. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +15 -3
  20. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  21. package/lib/commonjs/ui/components/internal/PinInput.js +10 -4
  22. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
  23. package/lib/commonjs/ui/context/OxyContext.js +128 -12
  24. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/useI18n.js +22 -0
  26. package/lib/commonjs/ui/hooks/useI18n.js.map +1 -0
  27. package/lib/commonjs/ui/navigation/OxyRouter.js +11 -131
  28. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
  29. package/lib/commonjs/ui/navigation/routes.js +127 -0
  30. package/lib/commonjs/ui/navigation/routes.js.map +1 -0
  31. package/lib/commonjs/ui/navigation/types.js +7 -0
  32. package/lib/commonjs/ui/navigation/types.js.map +1 -1
  33. package/lib/commonjs/ui/screens/AccountCenterScreen.js +55 -47
  34. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  35. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +69 -61
  36. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  37. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +378 -37
  38. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  39. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +52 -34
  40. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  41. package/lib/commonjs/ui/screens/FeedbackScreen.js +40 -36
  42. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  43. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +105 -78
  44. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
  45. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1 -1
  46. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  47. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +92 -60
  48. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  49. package/lib/commonjs/ui/screens/ProfileScreen.js +21 -11
  50. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  51. package/lib/commonjs/ui/screens/RecoverAccountScreen.js +30 -8
  52. package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
  53. package/lib/commonjs/ui/screens/SignInScreen.js +47 -26
  54. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +31 -24
  56. package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  57. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +11 -7
  58. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  59. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +12 -6
  60. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  61. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +11 -7
  62. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  63. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +15 -11
  64. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  65. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +19 -27
  66. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  67. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +8 -4
  68. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  69. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +14 -10
  70. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  71. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +7 -3
  72. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +19 -14
  74. package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +1 -1
  75. package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js +130 -0
  76. package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -0
  77. package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +13 -13
  78. package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
  79. package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +14 -20
  80. package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
  81. package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +22 -8
  82. package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +1 -1
  83. package/lib/commonjs/ui/screens/steps/SignInTotpStep.js +161 -0
  84. package/lib/commonjs/ui/screens/steps/SignInTotpStep.js.map +1 -0
  85. package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +12 -6
  86. package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +1 -1
  87. package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +10 -6
  88. package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
  89. package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +10 -6
  90. package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
  91. package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +34 -4
  92. package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
  93. package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +9 -10
  94. package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
  95. package/lib/commonjs/ui/styles/authStyles.js +1 -2
  96. package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
  97. package/lib/commonjs/utils/deviceManager.js +1 -1
  98. package/lib/commonjs/utils/deviceManager.js.map +1 -1
  99. package/lib/commonjs/utils/validationUtils.js +4 -2
  100. package/lib/commonjs/utils/validationUtils.js.map +1 -1
  101. package/lib/module/core/OxyServices.js +168 -5
  102. package/lib/module/core/OxyServices.js.map +1 -1
  103. package/lib/module/i18n/index.js +35 -0
  104. package/lib/module/i18n/index.js.map +1 -0
  105. package/lib/module/i18n/locales/en-US.json +681 -0
  106. package/lib/module/i18n/locales/es-ES.json +689 -0
  107. package/lib/module/ui/components/GroupedItem.js +2 -1
  108. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  109. package/lib/module/ui/components/Header.js +4 -3
  110. package/lib/module/ui/components/Header.js.map +1 -1
  111. package/lib/module/ui/components/OxyProvider.js +109 -103
  112. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  113. package/lib/module/ui/components/ProfileCard.js +5 -1
  114. package/lib/module/ui/components/ProfileCard.js.map +1 -1
  115. package/lib/module/ui/components/Section.js +1 -1
  116. package/lib/module/ui/components/StepBasedScreen.js +16 -16
  117. package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
  118. package/lib/module/ui/components/internal/GroupedPillButtons.js +15 -3
  119. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  120. package/lib/module/ui/components/internal/PinInput.js +9 -4
  121. package/lib/module/ui/components/internal/PinInput.js.map +1 -1
  122. package/lib/module/ui/context/OxyContext.js +128 -12
  123. package/lib/module/ui/context/OxyContext.js.map +1 -1
  124. package/lib/module/ui/hooks/useI18n.js +18 -0
  125. package/lib/module/ui/hooks/useI18n.js.map +1 -0
  126. package/lib/module/ui/navigation/OxyRouter.js +7 -124
  127. package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
  128. package/lib/module/ui/navigation/routes.js +122 -0
  129. package/lib/module/ui/navigation/routes.js.map +1 -0
  130. package/lib/module/ui/navigation/types.js +19 -1
  131. package/lib/module/ui/navigation/types.js.map +1 -1
  132. package/lib/module/ui/screens/AccountCenterScreen.js +55 -47
  133. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  134. package/lib/module/ui/screens/AccountOverviewScreen.js +69 -61
  135. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  136. package/lib/module/ui/screens/AccountSettingsScreen.js +378 -37
  137. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  138. package/lib/module/ui/screens/AccountSwitcherScreen.js +52 -34
  139. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  140. package/lib/module/ui/screens/FeedbackScreen.js +40 -36
  141. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  142. package/lib/module/ui/screens/LanguageSelectorScreen.js +107 -80
  143. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  144. package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
  145. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  146. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +92 -60
  147. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  148. package/lib/module/ui/screens/ProfileScreen.js +21 -11
  149. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  150. package/lib/module/ui/screens/RecoverAccountScreen.js +30 -8
  151. package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
  152. package/lib/module/ui/screens/SignInScreen.js +47 -26
  153. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  154. package/lib/module/ui/screens/WelcomeNewUserScreen.js +31 -24
  155. package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
  156. package/lib/module/ui/screens/internal/SignInPasswordStep.js +11 -7
  157. package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  158. package/lib/module/ui/screens/internal/SignInUsernameStep.js +12 -6
  159. package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  160. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +11 -7
  161. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  162. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +15 -11
  163. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  164. package/lib/module/ui/screens/karma/KarmaFAQScreen.js +19 -27
  165. package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  166. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +8 -4
  167. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  168. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +14 -10
  169. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  170. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +7 -3
  171. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  172. package/lib/module/ui/screens/steps/RecoverRequestStep.js +19 -14
  173. package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +1 -1
  174. package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js +125 -0
  175. package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -0
  176. package/lib/module/ui/screens/steps/RecoverSuccessStep.js +13 -13
  177. package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
  178. package/lib/module/ui/screens/steps/RecoverVerifyStep.js +14 -20
  179. package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
  180. package/lib/module/ui/screens/steps/SignInPasswordStep.js +22 -8
  181. package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +1 -1
  182. package/lib/module/ui/screens/steps/SignInTotpStep.js +156 -0
  183. package/lib/module/ui/screens/steps/SignInTotpStep.js.map +1 -0
  184. package/lib/module/ui/screens/steps/SignInUsernameStep.js +12 -6
  185. package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +1 -1
  186. package/lib/module/ui/screens/steps/SignUpIdentityStep.js +10 -6
  187. package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
  188. package/lib/module/ui/screens/steps/SignUpSecurityStep.js +10 -6
  189. package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
  190. package/lib/module/ui/screens/steps/SignUpSummaryStep.js +34 -4
  191. package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
  192. package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +9 -10
  193. package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
  194. package/lib/module/ui/styles/authStyles.js +1 -2
  195. package/lib/module/ui/styles/authStyles.js.map +1 -1
  196. package/lib/module/utils/deviceManager.js +1 -1
  197. package/lib/module/utils/deviceManager.js.map +1 -1
  198. package/lib/module/utils/validationUtils.js +4 -2
  199. package/lib/module/utils/validationUtils.js.map +1 -1
  200. package/lib/typescript/core/OxyServices.d.ts +58 -3
  201. package/lib/typescript/core/OxyServices.d.ts.map +1 -1
  202. package/lib/typescript/i18n/index.d.ts +4 -0
  203. package/lib/typescript/i18n/index.d.ts.map +1 -0
  204. package/lib/typescript/models/interfaces.d.ts +4 -0
  205. package/lib/typescript/models/interfaces.d.ts.map +1 -1
  206. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
  207. package/lib/typescript/ui/components/Header.d.ts.map +1 -1
  208. package/lib/typescript/ui/components/OxyProvider.d.ts +1 -1
  209. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  210. package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -1
  211. package/lib/typescript/ui/components/StepBasedScreen.d.ts +2 -1
  212. package/lib/typescript/ui/components/StepBasedScreen.d.ts.map +1 -1
  213. package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  214. package/lib/typescript/ui/components/internal/PinInput.d.ts +6 -3
  215. package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -1
  216. package/lib/typescript/ui/context/OxyContext.d.ts +7 -4
  217. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  218. package/lib/typescript/ui/hooks/useI18n.d.ts +5 -0
  219. package/lib/typescript/ui/hooks/useI18n.d.ts.map +1 -0
  220. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
  221. package/lib/typescript/ui/navigation/routes.d.ts +9 -0
  222. package/lib/typescript/ui/navigation/routes.d.ts.map +1 -0
  223. package/lib/typescript/ui/navigation/types.d.ts +24 -10
  224. package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
  225. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  226. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  227. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  228. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  229. package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
  230. package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
  231. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  232. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
  233. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
  234. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  235. package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
  236. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +2 -1
  237. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
  238. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
  239. package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
  240. package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
  241. package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
  242. package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
  243. package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
  244. package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
  245. package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts +4 -1
  246. package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +1 -1
  247. package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts +24 -0
  248. package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts.map +1 -0
  249. package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts +2 -1
  250. package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +1 -1
  251. package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts +3 -1
  252. package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +1 -1
  253. package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +1 -0
  254. package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +1 -1
  255. package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts +19 -0
  256. package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts.map +1 -0
  257. package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts +2 -1
  258. package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +1 -1
  259. package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts +2 -1
  260. package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +1 -1
  261. package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts +2 -1
  262. package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +1 -1
  263. package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts +2 -1
  264. package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +1 -1
  265. package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts +2 -1
  266. package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +1 -1
  267. package/lib/typescript/ui/styles/authStyles.d.ts +0 -1
  268. package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -1
  269. package/lib/typescript/utils/validationUtils.d.ts.map +1 -1
  270. package/package.json +48 -14
  271. package/src/core/OxyServices.ts +143 -9
  272. package/src/i18n/index.ts +39 -0
  273. package/src/i18n/locales/en-US.json +681 -0
  274. package/src/i18n/locales/es-ES.json +689 -0
  275. package/src/models/interfaces.ts +6 -1
  276. package/src/ui/components/GroupedItem.tsx +2 -1
  277. package/src/ui/components/Header.tsx +4 -3
  278. package/src/ui/components/OxyProvider.tsx +105 -112
  279. package/src/ui/components/ProfileCard.tsx +5 -1
  280. package/src/ui/components/Section.tsx +1 -1
  281. package/src/ui/components/StepBasedScreen.tsx +16 -13
  282. package/src/ui/components/internal/GroupedPillButtons.tsx +10 -6
  283. package/src/ui/components/internal/PinInput.tsx +15 -6
  284. package/src/ui/context/OxyContext.tsx +123 -20
  285. package/src/ui/hooks/useI18n.ts +12 -0
  286. package/src/ui/navigation/OxyRouter.tsx +15 -134
  287. package/src/ui/navigation/routes.ts +153 -0
  288. package/src/ui/navigation/types.ts +28 -10
  289. package/src/ui/screens/AccountCenterScreen.tsx +47 -45
  290. package/src/ui/screens/AccountOverviewScreen.tsx +68 -70
  291. package/src/ui/screens/AccountSettingsScreen.tsx +265 -41
  292. package/src/ui/screens/AccountSwitcherScreen.tsx +35 -33
  293. package/src/ui/screens/FeedbackScreen.tsx +39 -37
  294. package/src/ui/screens/LanguageSelectorScreen.tsx +99 -70
  295. package/src/ui/screens/PaymentGatewayScreen.tsx +5 -5
  296. package/src/ui/screens/PremiumSubscriptionScreen.tsx +56 -54
  297. package/src/ui/screens/ProfileScreen.tsx +14 -8
  298. package/src/ui/screens/RecoverAccountScreen.tsx +29 -8
  299. package/src/ui/screens/SignInScreen.tsx +39 -30
  300. package/src/ui/screens/WelcomeNewUserScreen.tsx +31 -17
  301. package/src/ui/screens/internal/SignInPasswordStep.tsx +11 -8
  302. package/src/ui/screens/internal/SignInUsernameStep.tsx +10 -8
  303. package/src/ui/screens/karma/KarmaAboutScreen.tsx +23 -11
  304. package/src/ui/screens/karma/KarmaCenterScreen.tsx +21 -11
  305. package/src/ui/screens/karma/KarmaFAQScreen.tsx +15 -33
  306. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +6 -4
  307. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +28 -10
  308. package/src/ui/screens/karma/KarmaRulesScreen.tsx +5 -3
  309. package/src/ui/screens/steps/RecoverRequestStep.tsx +20 -17
  310. package/src/ui/screens/steps/RecoverResetPasswordStep.tsx +133 -0
  311. package/src/ui/screens/steps/RecoverSuccessStep.tsx +12 -19
  312. package/src/ui/screens/steps/RecoverVerifyStep.tsx +15 -24
  313. package/src/ui/screens/steps/SignInPasswordStep.tsx +19 -6
  314. package/src/ui/screens/steps/SignInTotpStep.tsx +129 -0
  315. package/src/ui/screens/steps/SignInUsernameStep.tsx +11 -10
  316. package/src/ui/screens/steps/SignUpIdentityStep.tsx +10 -11
  317. package/src/ui/screens/steps/SignUpSecurityStep.tsx +10 -11
  318. package/src/ui/screens/steps/SignUpSummaryStep.tsx +24 -9
  319. package/src/ui/screens/steps/SignUpWelcomeStep.tsx +8 -14
  320. package/src/ui/styles/authStyles.ts +0 -1
  321. package/src/utils/deviceManager.ts +1 -1
  322. package/src/utils/validationUtils.ts +5 -3
package/package.json CHANGED
@@ -1,29 +1,42 @@
1
1
  {
2
2
  "name": "@oxyhq/services",
3
- "version": "5.11.12",
3
+ "version": "5.12.1",
4
4
  "description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
7
7
  "types": "lib/typescript/index.d.ts",
8
8
  "react-native": "src/index.ts",
9
9
  "source": "src/index.ts",
10
+ "sideEffects": false,
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
10
14
  "exports": {
11
15
  ".": {
16
+ "react-native": "./src/index.ts",
17
+ "node": {
18
+ "import": "./lib/module/core/index.js",
19
+ "require": "./lib/commonjs/core/index.js",
20
+ "types": "./lib/typescript/core/index.d.ts"
21
+ },
12
22
  "import": "./lib/module/index.js",
13
23
  "require": "./lib/commonjs/index.js",
14
24
  "types": "./lib/typescript/index.d.ts"
15
25
  },
16
26
  "./core": {
27
+ "react-native": "./src/core/index.ts",
17
28
  "import": "./lib/module/core/index.js",
18
29
  "require": "./lib/commonjs/core/index.js",
19
30
  "types": "./lib/typescript/core/index.d.ts"
20
31
  },
21
32
  "./ui": {
33
+ "react-native": "./src/ui/index.ts",
22
34
  "import": "./lib/module/ui/index.js",
23
35
  "require": "./lib/commonjs/ui/index.js",
24
36
  "types": "./lib/typescript/ui/index.d.ts"
25
37
  },
26
38
  "./full": {
39
+ "react-native": "./src/index.ts",
27
40
  "import": "./lib/module/index.js",
28
41
  "require": "./lib/commonjs/index.js",
29
42
  "types": "./lib/typescript/index.d.ts"
@@ -66,32 +79,25 @@
66
79
  "copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" lib/typescript",
67
80
  "delete-debug-view": "rm -rf ./lib/commonjs/components/bottomSheetDebugView ./lib/module/components/bottomSheetDebugView ./lib/typescript/components/bottomSheetDebugView || true",
68
81
  "delete-dts.js": "find ./lib/commonjs -name '*.d.js*' -delete && find ./lib/module -name '*.d.js*' -delete",
69
- "release": "rm -rf lib && npm run build && release-it"
82
+ "release": "rm -rf lib && npm run build && release-it",
83
+ "prepublishOnly": "npm run typescript && npm test && npm run build"
70
84
  },
71
85
  "dependencies": {
86
+ "@amir-hossein-karimi/bottom-sheet": "^9.1.2",
87
+ "@gorhom/bottom-sheet": "^5.1.6",
72
88
  "@react-native-async-storage/async-storage": "2.1.2",
73
- "@react-navigation/native": "^7.1.14",
89
+ "@tanstack/react-query": "^5.59.0",
74
90
  "@th3rdwave/react-navigation-bottom-sheet": "^0.3.2",
75
91
  "axios": "^1.9.0",
76
- "expo": "^53.0.20",
77
- "expo-font": "^13.3.1",
78
- "expo-image": "~2.4.0",
79
- "expo-linear-gradient": "^14.1.4",
80
92
  "invariant": "^2.2.4",
81
93
  "jwt-decode": "^4.0.0",
82
- "react-native-iap": "^12.16.4",
83
94
  "react-native-qrcode-svg": "^6.3.0",
84
- "react-native-safe-area-context": "^5.4.0",
85
95
  "react-native-url-polyfill": "^2.0.0",
86
96
  "socket.io-client": "^4.8.1",
87
97
  "sonner": "^2.0.4",
88
98
  "sonner-native": "^0.20.0",
89
- "tailwindcss": "^4.1.11",
90
99
  "zod": "^3.25.64",
91
- "zustand": "^5.0.6",
92
- "@tanstack/react-query": "^5.59.0",
93
- "@amir-hossein-karimi/bottom-sheet": "^9.1.2",
94
- "@gorhom/bottom-sheet": "^5.1.6"
100
+ "zustand": "^5.0.6"
95
101
  },
96
102
  "devDependencies": {
97
103
  "@biomejs/biome": "^1.9.4",
@@ -108,13 +114,17 @@
108
114
  "@types/react": "~19.0.10",
109
115
  "@types/react-native": "~0.73.0",
110
116
  "copyfiles": "^2.4.1",
117
+ "expo-font": "^13.3.2",
118
+ "expo-image": "^2.4.0",
111
119
  "husky": "^4.3.8",
112
120
  "jest": "~29.7.0",
113
121
  "lint-staged": "^13.2.2",
114
122
  "metro-react-native-babel-preset": "^0.77.0",
115
123
  "react-native-builder-bob": "^0.30.3",
116
124
  "react-native-gesture-handler": "~2.24.0",
125
+ "react-native-iap": "^13.0.4",
117
126
  "react-native-reanimated": "~3.17.4",
127
+ "react-native-safe-area-context": "^5.6.1",
118
128
  "react-native-svg": "15.11.2",
119
129
  "react-test-renderer": "^18.3.1",
120
130
  "release-it": "^17.6.0",
@@ -123,14 +133,20 @@
123
133
  },
124
134
  "peerDependencies": {
125
135
  "@expo/vector-icons": "^14.1.0",
136
+ "@react-navigation/native": "^7.0.0",
126
137
  "@types/react": "*",
127
138
  "@types/react-native": "*",
128
139
  "axios": "^1.9.0",
140
+ "expo": "^53.0.0",
141
+ "expo-font": "^13.0.0",
142
+ "expo-image": "^2.4.0",
143
+ "expo-linear-gradient": "^14.0.0",
129
144
  "invariant": "^2.2.4",
130
145
  "jwt-decode": "^4.0.0",
131
146
  "react": ">=18.0.0",
132
147
  "react-native": ">=0.76.0",
133
148
  "react-native-gesture-handler": ">=2.16.1",
149
+ "react-native-iap": "^12.16.0",
134
150
  "react-native-reanimated": ">=3.16.0",
135
151
  "react-native-safe-area-context": "^5.4.0",
136
152
  "react-native-svg": ">=13.0.0"
@@ -147,6 +163,24 @@
147
163
  },
148
164
  "react-native-qrcode-svg": {
149
165
  "optional": true
166
+ },
167
+ "expo": {
168
+ "optional": true
169
+ },
170
+ "expo-font": {
171
+ "optional": true
172
+ },
173
+ "expo-image": {
174
+ "optional": true
175
+ },
176
+ "expo-linear-gradient": {
177
+ "optional": true
178
+ },
179
+ "@react-navigation/native": {
180
+ "optional": true
181
+ },
182
+ "react-native-iap": {
183
+ "optional": true
150
184
  }
151
185
  },
152
186
  "react-native-builder-bob": {
@@ -177,12 +177,18 @@ export class OxyServices {
177
177
  baseURL: config.baseURL,
178
178
  timeout: 10000 // 10 second timeout
179
179
  });
180
- this.cloudURL = config.cloudURL || 'https://cloud.oxyhq.com';
181
- this.cloudURL = config.cloudURL || 'https://cloud.oxy.so';
180
+ this.cloudURL = config.cloudURL || OXY_CLOUD_URL;
182
181
  this.tokenStore = TokenStore.getInstance();
183
182
  this.setupInterceptors();
184
183
  }
185
184
 
185
+ // Test-only utility to reset global tokens between jest tests
186
+ static __resetTokensForTests(): void {
187
+ try {
188
+ TokenStore.getInstance().clearTokens();
189
+ } catch {}
190
+ }
191
+
186
192
  /**
187
193
  * Setup axios interceptors for authentication and error handling
188
194
  */
@@ -453,8 +459,13 @@ export class OxyServices {
453
459
  /**
454
460
  * Centralized error handling
455
461
  */
456
- protected handleError(error: any): ApiError {
457
- return handleHttpError(error);
462
+ protected handleError(error: any): Error {
463
+ const api = handleHttpError(error);
464
+ const err = new Error(api.message) as Error & { code?: string; status?: number; details?: Record<string, unknown> };
465
+ err.code = api.code;
466
+ err.status = api.status;
467
+ err.details = api.details as any;
468
+ return err;
458
469
  }
459
470
 
460
471
  /**
@@ -488,16 +499,90 @@ export class OxyServices {
488
499
  email,
489
500
  password
490
501
  });
502
+ if (!res || !res.data || (typeof res.data === 'object' && Object.keys(res.data).length === 0)) {
503
+ throw new OxyAuthenticationError('Sign up failed', 'SIGNUP_FAILED', 400);
504
+ }
491
505
  return res.data;
492
506
  } catch (error) {
493
507
  throw this.handleError(error);
494
508
  }
495
509
  }
496
510
 
511
+ /**
512
+ * Request account recovery (send verification code)
513
+ */
514
+ async requestRecovery(identifier: string): Promise<{ delivery?: string; destination?: string }> {
515
+ try {
516
+ const res = await this.client.post('/api/auth/recover/request', { identifier });
517
+ return res.data;
518
+ } catch (error: any) {
519
+ throw this.handleError(error);
520
+ }
521
+ }
522
+
523
+ /**
524
+ * Verify recovery code
525
+ */
526
+ async verifyRecoveryCode(identifier: string, code: string): Promise<{ verified: boolean }> {
527
+ try {
528
+ const res = await this.client.post('/api/auth/recover/verify', { identifier, code });
529
+ return res.data;
530
+ } catch (error: any) {
531
+ throw this.handleError(error);
532
+ }
533
+ }
534
+
535
+ /**
536
+ * Reset password using verified code
537
+ */
538
+ async resetPassword(identifier: string, code: string, newPassword: string): Promise<{ success: boolean }> {
539
+ try {
540
+ const res = await this.client.post('/api/auth/recover/reset', { identifier, code, newPassword });
541
+ return res.data;
542
+ } catch (error: any) {
543
+ throw this.handleError(error);
544
+ }
545
+ }
546
+
547
+ /**
548
+ * Reset password using TOTP code (recommended recovery)
549
+ */
550
+ async resetPasswordWithTotp(identifier: string, code: string, newPassword: string): Promise<{ success: boolean }> {
551
+ try {
552
+ const res = await this.client.post('/api/auth/recover/totp/reset', { identifier, code, newPassword });
553
+ return res.data;
554
+ } catch (error: any) {
555
+ throw this.handleError(error);
556
+ }
557
+ }
558
+
559
+ async resetPasswordWithBackupCode(identifier: string, backupCode: string, newPassword: string): Promise<{ success: boolean }> {
560
+ try {
561
+ const res = await this.client.post('/api/auth/recover/backup/reset', { identifier, backupCode, newPassword });
562
+ return res.data;
563
+ } catch (error: any) {
564
+ throw this.handleError(error);
565
+ }
566
+ }
567
+
568
+ async resetPasswordWithRecoveryKey(identifier: string, recoveryKey: string, newPassword: string): Promise<{ success: boolean; nextRecoveryKey?: string }> {
569
+ try {
570
+ const res = await this.client.post('/api/auth/recover/recovery-key/reset', { identifier, recoveryKey, newPassword });
571
+ return res.data;
572
+ } catch (error: any) {
573
+ throw this.handleError(error);
574
+ }
575
+ }
576
+
497
577
  /**
498
578
  * Sign in with device management
499
579
  */
500
- async signIn(username: string, password: string, deviceName?: string, deviceFingerprint?: any): Promise<SessionLoginResponse> {
580
+ async signIn(
581
+ username: string,
582
+ password: string,
583
+ deviceName?: string,
584
+ deviceFingerprint?: any
585
+ ): Promise<SessionLoginResponse | { mfaRequired: true; mfaToken: string; expiresAt: string }> {
501
586
  try {
502
587
  const res = await this.client.post('/api/auth/login', {
503
588
  username,
@@ -511,6 +596,18 @@ export class OxyServices {
511
596
  }
512
597
  }
513
598
 
599
+ /**
600
+ * Complete login by verifying TOTP with MFA token
601
+ */
602
+ async verifyTotpLogin(mfaToken: string, code: string): Promise<SessionLoginResponse> {
603
+ try {
604
+ const res = await this.client.post('/api/auth/totp/verify-login', { mfaToken, code });
605
+ return res.data;
606
+ } catch (error) {
607
+ throw this.handleError(error);
608
+ }
609
+ }
610
+
514
611
  /**
515
612
  * Get user by session ID
516
613
  */
@@ -657,6 +754,43 @@ export class OxyServices {
657
754
  }
658
755
  }
659
756
 
757
+ // ============================================================================
758
+ // TOTP ENROLLMENT
759
+ // ============================================================================
760
+
761
+ async startTotpEnrollment(sessionId: string): Promise<{ secret: string; otpauthUrl: string; issuer: string; label: string }> {
762
+ try {
763
+ const res = await this.client.post('/api/auth/totp/enroll/start', { sessionId }, {
764
+ headers: { 'x-session-id': sessionId }
765
+ });
766
+ return res.data;
767
+ } catch (error) {
768
+ throw this.handleError(error);
769
+ }
770
+ }
771
+
772
+ async verifyTotpEnrollment(sessionId: string, code: string): Promise<{ enabled: boolean; backupCodes?: string[]; recoveryKey?: string }> {
773
+ try {
774
+ const res = await this.client.post('/api/auth/totp/enroll/verify', { sessionId, code }, {
775
+ headers: { 'x-session-id': sessionId }
776
+ });
777
+ return res.data;
778
+ } catch (error) {
779
+ throw this.handleError(error);
780
+ }
781
+ }
782
+
783
+ async disableTotp(sessionId: string, code: string): Promise<{ disabled: boolean }> {
784
+ try {
785
+ const res = await this.client.post('/api/auth/totp/disable', { sessionId, code }, {
786
+ headers: { 'x-session-id': sessionId }
787
+ });
788
+ return res.data;
789
+ } catch (error) {
790
+ throw this.handleError(error);
791
+ }
792
+ }
793
+
660
794
  /**
661
795
  * Search user profiles
662
796
  */
@@ -1631,14 +1765,14 @@ export class OxyServices {
1631
1765
 
1632
1766
  next();
1633
1767
  } catch (error) {
1634
- const apiError = this.handleError(error);
1768
+ const apiError = this.handleError(error) as any;
1635
1769
 
1636
1770
  if (debug) {
1637
1771
  console.log(`❌ Auth: Unexpected error:`, apiError);
1638
1772
  }
1639
1773
 
1640
1774
  if (onError) return onError(apiError);
1641
- return res.status(apiError.status || 500).json(apiError);
1775
+ return res.status((apiError && apiError.status) || 500).json(apiError);
1642
1776
  }
1643
1777
  };
1644
1778
  }
@@ -1647,7 +1781,7 @@ export class OxyServices {
1647
1781
  /**
1648
1782
  * Export the default Oxy Cloud URL (for backward compatibility)
1649
1783
  */
1650
- export const OXY_CLOUD_URL = 'https://cloud.oxy.so';
1784
+ export const OXY_CLOUD_URL = 'https://cloud.oxyhq.com';
1651
1785
 
1652
1786
  /**
1653
1787
  * Export the default Oxy API URL (for documentation)
@@ -1658,4 +1792,4 @@ export const OXY_API_URL = 'https://api.oxy.so';
1658
1792
  * Pre-configured client instance for easy import
1659
1793
  * Uses OXY_API_URL as baseURL and OXY_CLOUD_URL as cloudURL
1660
1794
  */
1661
- export const oxyClient = new OxyServices({ baseURL: OXY_API_URL, cloudURL: OXY_CLOUD_URL });
1795
+ export const oxyClient = new OxyServices({ baseURL: OXY_API_URL, cloudURL: OXY_CLOUD_URL });
@@ -0,0 +1,39 @@
1
+ // Use JSON locale files (RN Metro supports static requires reliably)
2
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
3
+ const enUS = require('./locales/en-US.json') as Record<string, any>;
4
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
5
+ const esES = require('./locales/es-ES.json') as Record<string, any>;
6
+
7
+ export type LocaleDict = Record<string, any>;
8
+
9
+ const DICTS: Record<string, LocaleDict> = {
10
+ 'en': enUS as LocaleDict,
11
+ 'en-US': enUS as LocaleDict,
12
+ 'es': esES as LocaleDict,
13
+ 'es-ES': esES as LocaleDict,
14
+ };
15
+
16
+ const FALLBACK = 'en-US';
17
+
18
+ function getNested(obj: any, path: string): any {
19
+ return path.split('.').reduce((acc, key) => (acc && acc[key] != null ? acc[key] : undefined), obj);
20
+ }
21
+
22
+ export function translate(locale: string | undefined, key: string, vars?: Record<string, string | number>): string {
23
+ const lang = locale && DICTS[locale] ? locale : FALLBACK;
24
+ const dict = DICTS[lang] || DICTS[FALLBACK];
25
+ let val = getNested(dict, key);
26
+ if (typeof val !== 'string') return key; // fallback to key if missing
27
+ if (vars) {
28
+ Object.keys(vars).forEach(k => {
29
+ const token = `{{${k}}}`;
30
+ val = val.replaceAll(token, String(vars[k]));
31
+ });
32
+ }
33
+ return val;
34
+ }
35
+
36
+ export function hasKey(locale: string | undefined, key: string): boolean {
37
+ const lang = locale && DICTS[locale] ? locale : FALLBACK;
38
+ return getNested(DICTS[lang], key) != null || getNested(DICTS[FALLBACK], key) != null;
39
+ }