@oxyhq/services 5.11.12 → 5.12.0

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 +162 -12
  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 +162 -12
  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 +57 -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 +49 -15
  271. package/src/core/OxyServices.ts +138 -19
  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.0",
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": {
@@ -163,4 +197,4 @@
163
197
  "react-native-gesture-handler": "^2.20.2",
164
198
  "react-native-reanimated": "^3.16.1"
165
199
  }
166
- }
200
+ }
@@ -121,18 +121,10 @@ export class OxyAuthenticationTimeoutError extends OxyAuthenticationError {
121
121
  */
122
122
  // Centralized token store
123
123
  class TokenStore {
124
- private static instance: TokenStore;
125
124
  private accessToken: string | null = null;
126
125
  private refreshToken: string | null = null;
127
126
 
128
- private constructor() {}
129
-
130
- static getInstance(): TokenStore {
131
- if (!TokenStore.instance) {
132
- TokenStore.instance = new TokenStore();
133
- }
134
- return TokenStore.instance;
135
- }
127
+ constructor() {}
136
128
 
137
129
  setTokens(accessToken: string, refreshToken = ''): void {
138
130
  this.accessToken = accessToken;
@@ -177,9 +169,8 @@ export class OxyServices {
177
169
  baseURL: config.baseURL,
178
170
  timeout: 10000 // 10 second timeout
179
171
  });
180
- this.cloudURL = config.cloudURL || 'https://cloud.oxyhq.com';
181
- this.cloudURL = config.cloudURL || 'https://cloud.oxy.so';
182
- this.tokenStore = TokenStore.getInstance();
172
+ this.cloudURL = config.cloudURL || OXY_CLOUD_URL;
173
+ this.tokenStore = new TokenStore();
183
174
  this.setupInterceptors();
184
175
  }
185
176
 
@@ -453,8 +444,13 @@ export class OxyServices {
453
444
  /**
454
445
  * Centralized error handling
455
446
  */
456
- protected handleError(error: any): ApiError {
457
- return handleHttpError(error);
447
+ protected handleError(error: any): Error {
448
+ const api = handleHttpError(error);
449
+ const err = new Error(api.message) as Error & { code?: string; status?: number; details?: Record<string, unknown> };
450
+ err.code = api.code;
451
+ err.status = api.status;
452
+ err.details = api.details as any;
453
+ return err;
458
454
  }
459
455
 
460
456
  /**
@@ -488,16 +484,90 @@ export class OxyServices {
488
484
  email,
489
485
  password
490
486
  });
487
+ if (!res || !res.data || (typeof res.data === 'object' && Object.keys(res.data).length === 0)) {
488
+ throw new OxyAuthenticationError('Sign up failed', 'SIGNUP_FAILED', 400);
489
+ }
491
490
  return res.data;
492
491
  } catch (error) {
493
492
  throw this.handleError(error);
494
493
  }
495
494
  }
496
495
 
496
+ /**
497
+ * Request account recovery (send verification code)
498
+ */
499
+ async requestRecovery(identifier: string): Promise<{ delivery?: string; destination?: string }> {
500
+ try {
501
+ const res = await this.client.post('/api/auth/recover/request', { identifier });
502
+ return res.data;
503
+ } catch (error: any) {
504
+ throw this.handleError(error);
505
+ }
506
+ }
507
+
508
+ /**
509
+ * Verify recovery code
510
+ */
511
+ async verifyRecoveryCode(identifier: string, code: string): Promise<{ verified: boolean }> {
512
+ try {
513
+ const res = await this.client.post('/api/auth/recover/verify', { identifier, code });
514
+ return res.data;
515
+ } catch (error: any) {
516
+ throw this.handleError(error);
517
+ }
518
+ }
519
+
520
+ /**
521
+ * Reset password using verified code
522
+ */
523
+ async resetPassword(identifier: string, code: string, newPassword: string): Promise<{ success: boolean }> {
524
+ try {
525
+ const res = await this.client.post('/api/auth/recover/reset', { identifier, code, newPassword });
526
+ return res.data;
527
+ } catch (error: any) {
528
+ throw this.handleError(error);
529
+ }
530
+ }
531
+
532
+ /**
533
+ * Reset password using TOTP code (recommended recovery)
534
+ */
535
+ async resetPasswordWithTotp(identifier: string, code: string, newPassword: string): Promise<{ success: boolean }> {
536
+ try {
537
+ const res = await this.client.post('/api/auth/recover/totp/reset', { identifier, code, newPassword });
538
+ return res.data;
539
+ } catch (error: any) {
540
+ throw this.handleError(error);
541
+ }
542
+ }
543
+
544
+ async resetPasswordWithBackupCode(identifier: string, backupCode: string, newPassword: string): Promise<{ success: boolean }> {
545
+ try {
546
+ const res = await this.client.post('/api/auth/recover/backup/reset', { identifier, backupCode, newPassword });
547
+ return res.data;
548
+ } catch (error: any) {
549
+ throw this.handleError(error);
550
+ }
551
+ }
552
+
553
+ async resetPasswordWithRecoveryKey(identifier: string, recoveryKey: string, newPassword: string): Promise<{ success: boolean; nextRecoveryKey?: string }> {
554
+ try {
555
+ const res = await this.client.post('/api/auth/recover/recovery-key/reset', { identifier, recoveryKey, newPassword });
556
+ return res.data;
557
+ } catch (error: any) {
558
+ throw this.handleError(error);
559
+ }
560
+ }
561
+
497
562
  /**
498
563
  * Sign in with device management
499
564
  */
500
- async signIn(username: string, password: string, deviceName?: string, deviceFingerprint?: any): Promise<SessionLoginResponse> {
565
+ async signIn(
566
+ username: string,
567
+ password: string,
568
+ deviceName?: string,
569
+ deviceFingerprint?: any
570
+ ): Promise<SessionLoginResponse | { mfaRequired: true; mfaToken: string; expiresAt: string }> {
501
571
  try {
502
572
  const res = await this.client.post('/api/auth/login', {
503
573
  username,
@@ -511,6 +581,18 @@ export class OxyServices {
511
581
  }
512
582
  }
513
583
 
584
+ /**
585
+ * Complete login by verifying TOTP with MFA token
586
+ */
587
+ async verifyTotpLogin(mfaToken: string, code: string): Promise<SessionLoginResponse> {
588
+ try {
589
+ const res = await this.client.post('/api/auth/totp/verify-login', { mfaToken, code });
590
+ return res.data;
591
+ } catch (error) {
592
+ throw this.handleError(error);
593
+ }
594
+ }
595
+
514
596
  /**
515
597
  * Get user by session ID
516
598
  */
@@ -657,6 +739,43 @@ export class OxyServices {
657
739
  }
658
740
  }
659
741
 
742
+ // ============================================================================
743
+ // TOTP ENROLLMENT
744
+ // ============================================================================
745
+
746
+ async startTotpEnrollment(sessionId: string): Promise<{ secret: string; otpauthUrl: string; issuer: string; label: string }> {
747
+ try {
748
+ const res = await this.client.post('/api/auth/totp/enroll/start', { sessionId }, {
749
+ headers: { 'x-session-id': sessionId }
750
+ });
751
+ return res.data;
752
+ } catch (error) {
753
+ throw this.handleError(error);
754
+ }
755
+ }
756
+
757
+ async verifyTotpEnrollment(sessionId: string, code: string): Promise<{ enabled: boolean; backupCodes?: string[]; recoveryKey?: string }> {
758
+ try {
759
+ const res = await this.client.post('/api/auth/totp/enroll/verify', { sessionId, code }, {
760
+ headers: { 'x-session-id': sessionId }
761
+ });
762
+ return res.data;
763
+ } catch (error) {
764
+ throw this.handleError(error);
765
+ }
766
+ }
767
+
768
+ async disableTotp(sessionId: string, code: string): Promise<{ disabled: boolean }> {
769
+ try {
770
+ const res = await this.client.post('/api/auth/totp/disable', { sessionId, code }, {
771
+ headers: { 'x-session-id': sessionId }
772
+ });
773
+ return res.data;
774
+ } catch (error) {
775
+ throw this.handleError(error);
776
+ }
777
+ }
778
+
660
779
  /**
661
780
  * Search user profiles
662
781
  */
@@ -1631,14 +1750,14 @@ export class OxyServices {
1631
1750
 
1632
1751
  next();
1633
1752
  } catch (error) {
1634
- const apiError = this.handleError(error);
1753
+ const apiError = this.handleError(error) as any;
1635
1754
 
1636
1755
  if (debug) {
1637
1756
  console.log(`❌ Auth: Unexpected error:`, apiError);
1638
1757
  }
1639
1758
 
1640
1759
  if (onError) return onError(apiError);
1641
- return res.status(apiError.status || 500).json(apiError);
1760
+ return res.status((apiError && apiError.status) || 500).json(apiError);
1642
1761
  }
1643
1762
  };
1644
1763
  }
@@ -1647,7 +1766,7 @@ export class OxyServices {
1647
1766
  /**
1648
1767
  * Export the default Oxy Cloud URL (for backward compatibility)
1649
1768
  */
1650
- export const OXY_CLOUD_URL = 'https://cloud.oxy.so';
1769
+ export const OXY_CLOUD_URL = 'https://cloud.oxyhq.com';
1651
1770
 
1652
1771
  /**
1653
1772
  * Export the default Oxy API URL (for documentation)
@@ -1658,4 +1777,4 @@ export const OXY_API_URL = 'https://api.oxy.so';
1658
1777
  * Pre-configured client instance for easy import
1659
1778
  * Uses OXY_API_URL as baseURL and OXY_CLOUD_URL as cloudURL
1660
1779
  */
1661
- export const oxyClient = new OxyServices({ baseURL: OXY_API_URL, cloudURL: OXY_CLOUD_URL });
1780
+ 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
+ }