@oxyhq/services 5.24.0 → 5.26.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 (444) hide show
  1. package/README.md +60 -8
  2. package/lib/commonjs/core/AuthManager.js +405 -0
  3. package/lib/commonjs/core/AuthManager.js.map +1 -0
  4. package/lib/commonjs/core/HttpService.js +39 -1
  5. package/lib/commonjs/core/HttpService.js.map +1 -1
  6. package/lib/commonjs/core/index.js +16 -0
  7. package/lib/commonjs/core/index.js.map +1 -1
  8. package/lib/commonjs/core/mixins/OxyServices.fedcm.js +38 -44
  9. package/lib/commonjs/core/mixins/OxyServices.fedcm.js.map +1 -1
  10. package/lib/commonjs/core/mixins/OxyServices.popup.js +9 -7
  11. package/lib/commonjs/core/mixins/OxyServices.popup.js.map +1 -1
  12. package/lib/commonjs/index.js +321 -18
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/commonjs/shared/index.js +227 -0
  15. package/lib/commonjs/shared/index.js.map +1 -0
  16. package/lib/commonjs/shared/utils/colorUtils.js +161 -0
  17. package/lib/commonjs/shared/utils/colorUtils.js.map +1 -0
  18. package/lib/commonjs/shared/utils/debugUtils.js +84 -0
  19. package/lib/commonjs/shared/utils/debugUtils.js.map +1 -0
  20. package/lib/commonjs/shared/utils/errorUtils.js +190 -0
  21. package/lib/commonjs/shared/utils/errorUtils.js.map +1 -0
  22. package/lib/commonjs/shared/utils/index.js +196 -0
  23. package/lib/commonjs/shared/utils/index.js.map +1 -0
  24. package/lib/commonjs/shared/utils/networkUtils.js +213 -0
  25. package/lib/commonjs/shared/utils/networkUtils.js.map +1 -0
  26. package/lib/commonjs/shared/utils/themeUtils.js +118 -0
  27. package/lib/commonjs/shared/utils/themeUtils.js.map +1 -0
  28. package/lib/commonjs/ui/components/BottomSheetRouter.js +1 -1
  29. package/lib/commonjs/ui/components/FontLoader.js +1 -1
  30. package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
  31. package/lib/commonjs/ui/components/GroupedItem.js +1 -1
  32. package/lib/commonjs/ui/components/Header.js +1 -1
  33. package/lib/commonjs/ui/components/OxyProvider.js +9 -1
  34. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  35. package/lib/commonjs/ui/components/OxySignInButton.js +19 -20
  36. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  37. package/lib/commonjs/ui/components/ProfileCard.js +1 -1
  38. package/lib/commonjs/ui/components/ProfileCard.js.map +1 -1
  39. package/lib/commonjs/ui/components/QuickActions.js +1 -1
  40. package/lib/commonjs/ui/components/QuickActions.js.map +1 -1
  41. package/lib/commonjs/ui/components/Section.js +1 -1
  42. package/lib/commonjs/ui/components/SectionTitle.js +1 -1
  43. package/lib/commonjs/ui/components/SignInModal.js +546 -0
  44. package/lib/commonjs/ui/components/SignInModal.js.map +1 -0
  45. package/lib/commonjs/ui/context/OxyContext.js +2 -1
  46. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  47. package/lib/commonjs/ui/hooks/{use-color-scheme.js → useColorScheme.js} +1 -1
  48. package/lib/commonjs/ui/hooks/useColorScheme.js.map +1 -0
  49. package/lib/commonjs/ui/hooks/useSessionSocket.js +6 -12
  50. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
  51. package/lib/commonjs/ui/hooks/useThemeColors.js +1 -1
  52. package/lib/commonjs/ui/hooks/useThemeStyles.js +1 -1
  53. package/lib/commonjs/ui/navigation/bottomSheetManager.js +5 -2
  54. package/lib/commonjs/ui/navigation/bottomSheetManager.js.map +1 -1
  55. package/lib/commonjs/ui/navigation/routes.js +7 -8
  56. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  57. package/lib/commonjs/ui/screens/AccountCenterScreen.js +7 -7
  58. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  59. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +6 -6
  60. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  61. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +2 -2
  62. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +4 -4
  63. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  64. package/lib/commonjs/ui/screens/AppInfoScreen.js +1 -1
  65. package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +1 -1
  66. package/lib/commonjs/ui/screens/FileManagementScreen.js +1 -1
  67. package/lib/commonjs/ui/screens/FollowersListScreen.js +18 -0
  68. package/lib/commonjs/ui/screens/FollowersListScreen.js.map +1 -0
  69. package/lib/commonjs/ui/screens/FollowingListScreen.js +18 -0
  70. package/lib/commonjs/ui/screens/FollowingListScreen.js.map +1 -0
  71. package/lib/commonjs/ui/screens/HelpSupportScreen.js +1 -1
  72. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/HistoryViewScreen.js +1 -1
  74. package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +1 -1
  75. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js +229 -0
  76. package/lib/commonjs/ui/screens/LearnMoreUsernamesScreen.js.map +1 -0
  77. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +1 -1
  78. package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/OxyAuthScreen.js +9 -21
  80. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1 -1
  82. package/lib/commonjs/ui/screens/ProfileScreen.js +1 -1
  83. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  84. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +1 -1
  85. package/lib/commonjs/ui/screens/UserListScreen.js +411 -0
  86. package/lib/commonjs/ui/screens/UserListScreen.js.map +1 -0
  87. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +1 -1
  88. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +1 -1
  89. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +1 -1
  90. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  91. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +1 -1
  92. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -1
  93. package/lib/commonjs/ui/stores/authStore.js +4 -6
  94. package/lib/commonjs/ui/stores/authStore.js.map +1 -1
  95. package/lib/commonjs/ui/utils/colorUtils.js +43 -46
  96. package/lib/commonjs/ui/utils/colorUtils.js.map +1 -1
  97. package/lib/commonjs/ui/utils/themeUtils.js +29 -39
  98. package/lib/commonjs/ui/utils/themeUtils.js.map +1 -1
  99. package/lib/commonjs/ui/utils/{user-utils.js → userUtils.js} +1 -1
  100. package/lib/commonjs/ui/utils/userUtils.js.map +1 -0
  101. package/lib/commonjs/utils/errorUtils.js +0 -13
  102. package/lib/commonjs/utils/errorUtils.js.map +1 -1
  103. package/lib/commonjs/utils/hookUtils.js +8 -8
  104. package/lib/commonjs/utils/hookUtils.js.map +1 -1
  105. package/lib/commonjs/web/WebOxyContext.js +277 -72
  106. package/lib/commonjs/web/WebOxyContext.js.map +1 -1
  107. package/lib/commonjs/web/index.js +177 -4
  108. package/lib/commonjs/web/index.js.map +1 -1
  109. package/lib/commonjs/web.js +12 -12
  110. package/lib/commonjs/web.js.map +1 -1
  111. package/lib/module/core/AuthManager.js +399 -0
  112. package/lib/module/core/AuthManager.js.map +1 -0
  113. package/lib/module/core/HttpService.js +39 -1
  114. package/lib/module/core/HttpService.js.map +1 -1
  115. package/lib/module/core/index.js +2 -0
  116. package/lib/module/core/index.js.map +1 -1
  117. package/lib/module/core/mixins/OxyServices.fedcm.js +38 -44
  118. package/lib/module/core/mixins/OxyServices.fedcm.js.map +1 -1
  119. package/lib/module/core/mixins/OxyServices.popup.js +9 -7
  120. package/lib/module/core/mixins/OxyServices.popup.js.map +1 -1
  121. package/lib/module/index.js +27 -2
  122. package/lib/module/index.js.map +1 -1
  123. package/lib/module/shared/index.js +37 -0
  124. package/lib/module/shared/index.js.map +1 -0
  125. package/lib/module/shared/utils/colorUtils.js +150 -0
  126. package/lib/module/shared/utils/colorUtils.js.map +1 -0
  127. package/lib/module/shared/utils/debugUtils.js +75 -0
  128. package/lib/module/shared/utils/debugUtils.js.map +1 -0
  129. package/lib/module/shared/utils/errorUtils.js +176 -0
  130. package/lib/module/shared/utils/errorUtils.js.map +1 -0
  131. package/lib/module/shared/utils/index.js +21 -0
  132. package/lib/module/shared/utils/index.js.map +1 -0
  133. package/lib/module/shared/utils/networkUtils.js +202 -0
  134. package/lib/module/shared/utils/networkUtils.js.map +1 -0
  135. package/lib/module/shared/utils/themeUtils.js +109 -0
  136. package/lib/module/shared/utils/themeUtils.js.map +1 -0
  137. package/lib/module/ui/components/BottomSheetRouter.js +1 -1
  138. package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
  139. package/lib/module/ui/components/FontLoader.js +1 -1
  140. package/lib/module/ui/components/FontLoader.js.map +1 -1
  141. package/lib/module/ui/components/GroupedItem.js +1 -1
  142. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  143. package/lib/module/ui/components/Header.js +1 -1
  144. package/lib/module/ui/components/Header.js.map +1 -1
  145. package/lib/module/ui/components/OxyProvider.js +9 -1
  146. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  147. package/lib/module/ui/components/OxySignInButton.js +20 -21
  148. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  149. package/lib/module/ui/components/ProfileCard.js +1 -1
  150. package/lib/module/ui/components/ProfileCard.js.map +1 -1
  151. package/lib/module/ui/components/QuickActions.js +1 -1
  152. package/lib/module/ui/components/QuickActions.js.map +1 -1
  153. package/lib/module/ui/components/Section.js +1 -1
  154. package/lib/module/ui/components/Section.js.map +1 -1
  155. package/lib/module/ui/components/SectionTitle.js +1 -1
  156. package/lib/module/ui/components/SectionTitle.js.map +1 -1
  157. package/lib/module/ui/components/SignInModal.js +536 -0
  158. package/lib/module/ui/components/SignInModal.js.map +1 -0
  159. package/lib/module/ui/context/OxyContext.js +1 -1
  160. package/lib/module/ui/context/OxyContext.js.map +1 -1
  161. package/lib/module/ui/hooks/{use-color-scheme.js → useColorScheme.js} +1 -1
  162. package/lib/module/ui/hooks/useColorScheme.js.map +1 -0
  163. package/lib/module/ui/hooks/useSessionSocket.js +6 -12
  164. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
  165. package/lib/module/ui/hooks/useThemeColors.js +1 -1
  166. package/lib/module/ui/hooks/useThemeColors.js.map +1 -1
  167. package/lib/module/ui/hooks/useThemeStyles.js +1 -1
  168. package/lib/module/ui/hooks/useThemeStyles.js.map +1 -1
  169. package/lib/module/ui/navigation/bottomSheetManager.js +5 -2
  170. package/lib/module/ui/navigation/bottomSheetManager.js.map +1 -1
  171. package/lib/module/ui/navigation/routes.js +7 -8
  172. package/lib/module/ui/navigation/routes.js.map +1 -1
  173. package/lib/module/ui/screens/AccountCenterScreen.js +7 -7
  174. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  175. package/lib/module/ui/screens/AccountOverviewScreen.js +6 -6
  176. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  177. package/lib/module/ui/screens/AccountSettingsScreen.js +2 -2
  178. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  179. package/lib/module/ui/screens/AccountSwitcherScreen.js +4 -4
  180. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  181. package/lib/module/ui/screens/AppInfoScreen.js +1 -1
  182. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  183. package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
  184. package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
  185. package/lib/module/ui/screens/FileManagementScreen.js +1 -1
  186. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  187. package/lib/module/ui/screens/FollowersListScreen.js +13 -0
  188. package/lib/module/ui/screens/FollowersListScreen.js.map +1 -0
  189. package/lib/module/ui/screens/FollowingListScreen.js +13 -0
  190. package/lib/module/ui/screens/FollowingListScreen.js.map +1 -0
  191. package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
  192. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  193. package/lib/module/ui/screens/HistoryViewScreen.js +1 -1
  194. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  195. package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
  196. package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
  197. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js +224 -0
  198. package/lib/module/ui/screens/LearnMoreUsernamesScreen.js.map +1 -0
  199. package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
  200. package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
  201. package/lib/module/ui/screens/OxyAuthScreen.js +9 -21
  202. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  203. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1 -1
  204. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  205. package/lib/module/ui/screens/ProfileScreen.js +1 -1
  206. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  207. package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
  208. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  209. package/lib/module/ui/screens/UserListScreen.js +405 -0
  210. package/lib/module/ui/screens/UserListScreen.js.map +1 -0
  211. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +1 -1
  212. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  213. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +1 -1
  214. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  215. package/lib/module/ui/screens/karma/KarmaFAQScreen.js +1 -1
  216. package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  217. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +1 -1
  218. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  219. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +1 -1
  220. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  221. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
  222. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  223. package/lib/module/ui/stores/authStore.js +4 -6
  224. package/lib/module/ui/stores/authStore.js.map +1 -1
  225. package/lib/module/ui/utils/colorUtils.js +7 -40
  226. package/lib/module/ui/utils/colorUtils.js.map +1 -1
  227. package/lib/module/ui/utils/themeUtils.js +7 -35
  228. package/lib/module/ui/utils/themeUtils.js.map +1 -1
  229. package/lib/module/ui/utils/{user-utils.js → userUtils.js} +1 -1
  230. package/lib/module/ui/utils/userUtils.js.map +1 -0
  231. package/lib/module/utils/errorUtils.js +0 -7
  232. package/lib/module/utils/errorUtils.js.map +1 -1
  233. package/lib/module/utils/hookUtils.js +8 -8
  234. package/lib/module/utils/hookUtils.js.map +1 -1
  235. package/lib/module/web/WebOxyContext.js +276 -72
  236. package/lib/module/web/WebOxyContext.js.map +1 -1
  237. package/lib/module/web/index.js +26 -5
  238. package/lib/module/web/index.js.map +1 -1
  239. package/lib/module/web.js +2 -1
  240. package/lib/module/web.js.map +1 -1
  241. package/lib/typescript/commonjs/core/AuthManager.d.ts +144 -0
  242. package/lib/typescript/commonjs/core/AuthManager.d.ts.map +1 -0
  243. package/lib/typescript/commonjs/core/HttpService.d.ts.map +1 -1
  244. package/lib/typescript/commonjs/core/index.d.ts +2 -0
  245. package/lib/typescript/commonjs/core/index.d.ts.map +1 -1
  246. package/lib/typescript/commonjs/core/mixins/OxyServices.fedcm.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/core/mixins/OxyServices.popup.d.ts.map +1 -1
  248. package/lib/typescript/commonjs/index.d.ts +16 -2
  249. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  250. package/lib/typescript/commonjs/models/session.d.ts +4 -0
  251. package/lib/typescript/commonjs/models/session.d.ts.map +1 -1
  252. package/lib/typescript/commonjs/shared/index.d.ts +29 -0
  253. package/lib/typescript/commonjs/shared/index.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/shared/utils/colorUtils.d.ts +105 -0
  255. package/lib/typescript/commonjs/shared/utils/colorUtils.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/shared/utils/debugUtils.d.ts +49 -0
  257. package/lib/typescript/commonjs/shared/utils/debugUtils.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/shared/utils/errorUtils.d.ts +98 -0
  259. package/lib/typescript/commonjs/shared/utils/errorUtils.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/shared/utils/index.d.ts +14 -0
  261. package/lib/typescript/commonjs/shared/utils/index.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/shared/utils/networkUtils.d.ts +140 -0
  263. package/lib/typescript/commonjs/shared/utils/networkUtils.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/shared/utils/themeUtils.d.ts +91 -0
  265. package/lib/typescript/commonjs/shared/utils/themeUtils.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +1 -1
  267. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +1 -1
  268. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  269. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts +18 -0
  271. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -0
  272. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +1 -2
  273. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  274. package/lib/typescript/commonjs/ui/hooks/{use-color-scheme.d.ts → useColorScheme.d.ts} +1 -1
  275. package/lib/typescript/commonjs/ui/hooks/useColorScheme.d.ts.map +1 -0
  276. package/lib/typescript/commonjs/ui/hooks/useSessionSocket.d.ts.map +1 -1
  277. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts +2 -0
  278. package/lib/typescript/commonjs/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  280. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts +9 -0
  282. package/lib/typescript/commonjs/ui/screens/FollowersListScreen.d.ts.map +1 -0
  283. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts +9 -0
  284. package/lib/typescript/commonjs/ui/screens/FollowingListScreen.d.ts.map +1 -0
  285. package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts +5 -0
  286. package/lib/typescript/commonjs/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -0
  287. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts +11 -0
  289. package/lib/typescript/commonjs/ui/screens/UserListScreen.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/ui/stores/authStore.d.ts.map +1 -1
  291. package/lib/typescript/commonjs/ui/utils/colorUtils.d.ts +7 -11
  292. package/lib/typescript/commonjs/ui/utils/colorUtils.d.ts.map +1 -1
  293. package/lib/typescript/commonjs/ui/utils/themeUtils.d.ts +6 -19
  294. package/lib/typescript/commonjs/ui/utils/themeUtils.d.ts.map +1 -1
  295. package/lib/typescript/commonjs/ui/utils/{user-utils.d.ts → userUtils.d.ts} +1 -1
  296. package/lib/typescript/commonjs/ui/utils/userUtils.d.ts.map +1 -0
  297. package/lib/typescript/commonjs/utils/errorUtils.d.ts +0 -6
  298. package/lib/typescript/commonjs/utils/errorUtils.d.ts.map +1 -1
  299. package/lib/typescript/commonjs/web/WebOxyContext.d.ts +113 -4
  300. package/lib/typescript/commonjs/web/WebOxyContext.d.ts.map +1 -1
  301. package/lib/typescript/commonjs/web/index.d.ts +20 -9
  302. package/lib/typescript/commonjs/web/index.d.ts.map +1 -1
  303. package/lib/typescript/commonjs/web.d.ts +2 -1
  304. package/lib/typescript/commonjs/web.d.ts.map +1 -1
  305. package/lib/typescript/module/core/AuthManager.d.ts +144 -0
  306. package/lib/typescript/module/core/AuthManager.d.ts.map +1 -0
  307. package/lib/typescript/module/core/HttpService.d.ts.map +1 -1
  308. package/lib/typescript/module/core/index.d.ts +2 -0
  309. package/lib/typescript/module/core/index.d.ts.map +1 -1
  310. package/lib/typescript/module/core/mixins/OxyServices.fedcm.d.ts.map +1 -1
  311. package/lib/typescript/module/core/mixins/OxyServices.popup.d.ts.map +1 -1
  312. package/lib/typescript/module/index.d.ts +16 -2
  313. package/lib/typescript/module/index.d.ts.map +1 -1
  314. package/lib/typescript/module/models/session.d.ts +4 -0
  315. package/lib/typescript/module/models/session.d.ts.map +1 -1
  316. package/lib/typescript/module/shared/index.d.ts +29 -0
  317. package/lib/typescript/module/shared/index.d.ts.map +1 -0
  318. package/lib/typescript/module/shared/utils/colorUtils.d.ts +105 -0
  319. package/lib/typescript/module/shared/utils/colorUtils.d.ts.map +1 -0
  320. package/lib/typescript/module/shared/utils/debugUtils.d.ts +49 -0
  321. package/lib/typescript/module/shared/utils/debugUtils.d.ts.map +1 -0
  322. package/lib/typescript/module/shared/utils/errorUtils.d.ts +98 -0
  323. package/lib/typescript/module/shared/utils/errorUtils.d.ts.map +1 -0
  324. package/lib/typescript/module/shared/utils/index.d.ts +14 -0
  325. package/lib/typescript/module/shared/utils/index.d.ts.map +1 -0
  326. package/lib/typescript/module/shared/utils/networkUtils.d.ts +140 -0
  327. package/lib/typescript/module/shared/utils/networkUtils.d.ts.map +1 -0
  328. package/lib/typescript/module/shared/utils/themeUtils.d.ts +91 -0
  329. package/lib/typescript/module/shared/utils/themeUtils.d.ts.map +1 -0
  330. package/lib/typescript/module/ui/components/FontLoader.d.ts +1 -1
  331. package/lib/typescript/module/ui/components/FontLoader.d.ts.map +1 -1
  332. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  333. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  334. package/lib/typescript/module/ui/components/SignInModal.d.ts +18 -0
  335. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -0
  336. package/lib/typescript/module/ui/context/OxyContext.d.ts +1 -2
  337. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  338. package/lib/typescript/module/ui/hooks/{use-color-scheme.d.ts → useColorScheme.d.ts} +1 -1
  339. package/lib/typescript/module/ui/hooks/useColorScheme.d.ts.map +1 -0
  340. package/lib/typescript/module/ui/hooks/useSessionSocket.d.ts.map +1 -1
  341. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts +2 -0
  342. package/lib/typescript/module/ui/navigation/bottomSheetManager.d.ts.map +1 -1
  343. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  344. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  345. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts +9 -0
  346. package/lib/typescript/module/ui/screens/FollowersListScreen.d.ts.map +1 -0
  347. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts +9 -0
  348. package/lib/typescript/module/ui/screens/FollowingListScreen.d.ts.map +1 -0
  349. package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts +5 -0
  350. package/lib/typescript/module/ui/screens/LearnMoreUsernamesScreen.d.ts.map +1 -0
  351. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  352. package/lib/typescript/module/ui/screens/UserListScreen.d.ts +11 -0
  353. package/lib/typescript/module/ui/screens/UserListScreen.d.ts.map +1 -0
  354. package/lib/typescript/module/ui/stores/authStore.d.ts.map +1 -1
  355. package/lib/typescript/module/ui/utils/colorUtils.d.ts +7 -11
  356. package/lib/typescript/module/ui/utils/colorUtils.d.ts.map +1 -1
  357. package/lib/typescript/module/ui/utils/themeUtils.d.ts +6 -19
  358. package/lib/typescript/module/ui/utils/themeUtils.d.ts.map +1 -1
  359. package/lib/typescript/module/ui/utils/{user-utils.d.ts → userUtils.d.ts} +1 -1
  360. package/lib/typescript/module/ui/utils/userUtils.d.ts.map +1 -0
  361. package/lib/typescript/module/utils/errorUtils.d.ts +0 -6
  362. package/lib/typescript/module/utils/errorUtils.d.ts.map +1 -1
  363. package/lib/typescript/module/web/WebOxyContext.d.ts +113 -4
  364. package/lib/typescript/module/web/WebOxyContext.d.ts.map +1 -1
  365. package/lib/typescript/module/web/index.d.ts +20 -9
  366. package/lib/typescript/module/web/index.d.ts.map +1 -1
  367. package/lib/typescript/module/web.d.ts +2 -1
  368. package/lib/typescript/module/web.d.ts.map +1 -1
  369. package/package.json +8 -2
  370. package/src/core/AuthManager.ts +436 -0
  371. package/src/core/HttpService.ts +43 -1
  372. package/src/core/index.ts +4 -0
  373. package/src/core/mixins/OxyServices.fedcm.ts +37 -42
  374. package/src/core/mixins/OxyServices.popup.ts +10 -7
  375. package/src/index.ts +76 -11
  376. package/src/models/session.ts +4 -0
  377. package/src/shared/index.ts +82 -0
  378. package/src/shared/utils/colorUtils.ts +155 -0
  379. package/src/shared/utils/debugUtils.ts +73 -0
  380. package/src/shared/utils/errorUtils.ts +181 -0
  381. package/src/shared/utils/index.ts +59 -0
  382. package/src/shared/utils/networkUtils.ts +248 -0
  383. package/src/shared/utils/themeUtils.ts +115 -0
  384. package/src/ui/components/BottomSheetRouter.tsx +1 -1
  385. package/src/ui/components/FontLoader.tsx +1 -2
  386. package/src/ui/components/GroupedItem.tsx +1 -1
  387. package/src/ui/components/Header.tsx +1 -1
  388. package/src/ui/components/OxyProvider.tsx +10 -0
  389. package/src/ui/components/OxySignInButton.tsx +20 -22
  390. package/src/ui/components/ProfileCard.tsx +1 -1
  391. package/src/ui/components/QuickActions.tsx +1 -1
  392. package/src/ui/components/Section.tsx +1 -1
  393. package/src/ui/components/SectionTitle.tsx +1 -1
  394. package/src/ui/components/SignInModal.tsx +534 -0
  395. package/src/ui/context/OxyContext.tsx +1 -2
  396. package/src/ui/hooks/queries/queryKeys.ts +2 -2
  397. package/src/ui/hooks/useSessionSocket.ts +12 -17
  398. package/src/ui/hooks/useThemeColors.ts +1 -1
  399. package/src/ui/hooks/useThemeStyles.ts +1 -1
  400. package/src/ui/navigation/bottomSheetManager.ts +5 -1
  401. package/src/ui/navigation/routes.ts +8 -9
  402. package/src/ui/screens/AccountCenterScreen.tsx +7 -7
  403. package/src/ui/screens/AccountOverviewScreen.tsx +6 -6
  404. package/src/ui/screens/AccountSettingsScreen.tsx +2 -2
  405. package/src/ui/screens/AccountSwitcherScreen.tsx +4 -4
  406. package/src/ui/screens/AppInfoScreen.tsx +1 -1
  407. package/src/ui/screens/EditProfileFieldScreen.tsx +1 -1
  408. package/src/ui/screens/FileManagementScreen.tsx +1 -1
  409. package/src/ui/screens/FollowersListScreen.tsx +14 -0
  410. package/src/ui/screens/FollowingListScreen.tsx +14 -0
  411. package/src/ui/screens/HelpSupportScreen.tsx +1 -1
  412. package/src/ui/screens/HistoryViewScreen.tsx +1 -1
  413. package/src/ui/screens/LanguageSelectorScreen.tsx +1 -1
  414. package/src/ui/screens/LearnMoreUsernamesScreen.tsx +231 -0
  415. package/src/ui/screens/LegalDocumentsScreen.tsx +1 -1
  416. package/src/ui/screens/OxyAuthScreen.tsx +10 -21
  417. package/src/ui/screens/PremiumSubscriptionScreen.tsx +1 -1
  418. package/src/ui/screens/ProfileScreen.tsx +1 -1
  419. package/src/ui/screens/SavesCollectionsScreen.tsx +1 -1
  420. package/src/ui/screens/UserListScreen.tsx +416 -0
  421. package/src/ui/screens/karma/KarmaAboutScreen.tsx +1 -1
  422. package/src/ui/screens/karma/KarmaCenterScreen.tsx +1 -1
  423. package/src/ui/screens/karma/KarmaFAQScreen.tsx +1 -1
  424. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +1 -1
  425. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +1 -1
  426. package/src/ui/screens/karma/KarmaRulesScreen.tsx +1 -1
  427. package/src/ui/stores/authStore.ts +5 -6
  428. package/src/ui/utils/colorUtils.ts +15 -43
  429. package/src/ui/utils/themeUtils.ts +14 -39
  430. package/src/utils/errorUtils.ts +1 -6
  431. package/src/utils/hookUtils.ts +8 -8
  432. package/src/web/WebOxyContext.tsx +330 -72
  433. package/src/web/index.ts +77 -7
  434. package/src/web.ts +1 -1
  435. package/lib/commonjs/ui/hooks/use-color-scheme.js.map +0 -1
  436. package/lib/commonjs/ui/utils/user-utils.js.map +0 -1
  437. package/lib/module/ui/hooks/use-color-scheme.js.map +0 -1
  438. package/lib/module/ui/utils/user-utils.js.map +0 -1
  439. package/lib/typescript/commonjs/ui/hooks/use-color-scheme.d.ts.map +0 -1
  440. package/lib/typescript/commonjs/ui/utils/user-utils.d.ts.map +0 -1
  441. package/lib/typescript/module/ui/hooks/use-color-scheme.d.ts.map +0 -1
  442. package/lib/typescript/module/ui/utils/user-utils.d.ts.map +0 -1
  443. /package/src/ui/hooks/{use-color-scheme.ts → useColorScheme.ts} +0 -0
  444. /package/src/ui/utils/{user-utils.ts → userUtils.ts} +0 -0
@@ -1,6 +1,9 @@
1
1
  import type { OxyServicesBase } from '../OxyServices.base';
2
2
  import { OxyAuthenticationError } from '../OxyServices.errors';
3
3
  import type { SessionLoginResponse } from '../../models/session';
4
+ import { createDebugLogger } from '../../shared/utils/debugUtils';
5
+
6
+ const debug = createDebugLogger('FedCM');
4
7
 
5
8
  export interface FedCMAuthOptions {
6
9
  nonce?: string;
@@ -99,9 +102,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
99
102
  const nonce = options.nonce || this.generateNonce();
100
103
  const clientId = this.getClientId();
101
104
 
102
- if (typeof __DEV__ !== 'undefined' && __DEV__) {
103
- console.log('[FedCM] Interactive sign-in: Requesting credential for', clientId);
104
- }
105
+ debug.log('Interactive sign-in: Requesting credential for', clientId);
105
106
 
106
107
  // Request credential from browser's native identity flow
107
108
  const credential = await this.requestIdentityCredential({
@@ -115,9 +116,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
115
116
  throw new OxyAuthenticationError('No credential received from browser');
116
117
  }
117
118
 
118
- if (typeof __DEV__ !== 'undefined' && __DEV__) {
119
- console.log('[FedCM] Interactive sign-in: Got credential, exchanging for session');
120
- }
119
+ debug.log('Interactive sign-in: Got credential, exchanging for session');
121
120
 
122
121
  // Exchange FedCM ID token for Oxy session
123
122
  const session = await this.exchangeIdTokenForSession(credential.token);
@@ -127,15 +126,11 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
127
126
  this.httpService.setTokens((session as any).accessToken);
128
127
  }
129
128
 
130
- if (typeof __DEV__ !== 'undefined' && __DEV__) {
131
- console.log('[FedCM] Interactive sign-in: Success!', { userId: (session as any)?.user?.id });
132
- }
129
+ debug.log('Interactive sign-in: Success!', { userId: (session as any)?.user?.id });
133
130
 
134
131
  return session;
135
132
  } catch (error) {
136
- if (typeof __DEV__ !== 'undefined' && __DEV__) {
137
- console.log('[FedCM] Interactive sign-in failed:', error);
138
- }
133
+ debug.log('Interactive sign-in failed:', error);
139
134
  if ((error as any).name === 'AbortError') {
140
135
  throw new OxyAuthenticationError('Sign-in was cancelled by user');
141
136
  }
@@ -178,19 +173,19 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
178
173
  */
179
174
  async silentSignInWithFedCM(): Promise<SessionLoginResponse | null> {
180
175
  if (!this.isFedCMSupported()) {
181
- console.log('[FedCM] Silent SSO: FedCM not supported in this browser');
176
+ debug.log('Silent SSO: FedCM not supported in this browser');
182
177
  return null;
183
178
  }
184
179
 
185
180
  const clientId = this.getClientId();
186
- console.log('[FedCM] Silent SSO: Starting for', clientId);
181
+ debug.log('Silent SSO: Starting for', clientId);
187
182
 
188
183
  // First try silent mediation (no UI) - works if user previously consented
189
184
  let credential: { token: string } | null = null;
190
185
 
191
186
  try {
192
187
  const nonce = this.generateNonce();
193
- console.log('[FedCM] Silent SSO: Attempting silent mediation...');
188
+ debug.log('Silent SSO: Attempting silent mediation...');
194
189
 
195
190
  credential = await this.requestIdentityCredential({
196
191
  configURL: (this.constructor as any).DEFAULT_CONFIG_URL,
@@ -199,19 +194,19 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
199
194
  mediation: 'silent',
200
195
  });
201
196
 
202
- console.log('[FedCM] Silent SSO: Silent mediation result:', { hasCredential: !!credential, hasToken: !!credential?.token });
197
+ debug.log('Silent SSO: Silent mediation result:', { hasCredential: !!credential, hasToken: !!credential?.token });
203
198
  } catch (silentError) {
204
199
  // Silent mediation failed - this is expected if user hasn't consented before or is in quiet period
205
200
  const errorName = silentError instanceof Error ? silentError.name : 'Unknown';
206
201
  const errorMessage = silentError instanceof Error ? silentError.message : String(silentError);
207
- console.log('[FedCM] Silent SSO: Silent mediation error (will try optional):', { name: errorName, message: errorMessage });
202
+ debug.log('Silent SSO: Silent mediation error (will try optional):', { name: errorName, message: errorMessage });
208
203
  }
209
204
 
210
205
  // If silent failed, try optional mediation which shows browser UI if needed
211
206
  if (!credential || !credential.token) {
212
207
  try {
213
208
  const nonce = this.generateNonce();
214
- console.log('[FedCM] Silent SSO: Trying optional mediation (may show browser UI)...');
209
+ debug.log('Silent SSO: Trying optional mediation (may show browser UI)...');
215
210
 
216
211
  credential = await this.requestIdentityCredential({
217
212
  configURL: (this.constructor as any).DEFAULT_CONFIG_URL,
@@ -220,55 +215,55 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
220
215
  mediation: 'optional',
221
216
  });
222
217
 
223
- console.log('[FedCM] Silent SSO: Optional mediation result:', { hasCredential: !!credential, hasToken: !!credential?.token });
218
+ debug.log('Silent SSO: Optional mediation result:', { hasCredential: !!credential, hasToken: !!credential?.token });
224
219
  } catch (optionalError) {
225
220
  const errorName = optionalError instanceof Error ? optionalError.name : 'Unknown';
226
221
  const errorMessage = optionalError instanceof Error ? optionalError.message : String(optionalError);
227
- console.log('[FedCM] Silent SSO: Optional mediation also failed:', { name: errorName, message: errorMessage });
222
+ debug.log('Silent SSO: Optional mediation also failed:', { name: errorName, message: errorMessage });
228
223
  return null;
229
224
  }
230
225
  }
231
226
 
232
227
  if (!credential || !credential.token) {
233
- console.log('[FedCM] Silent SSO: No credential returned (user may have dismissed prompt or is not logged in at IdP)');
228
+ debug.log('Silent SSO: No credential returned (user may have dismissed prompt or is not logged in at IdP)');
234
229
  return null;
235
230
  }
236
231
 
237
- console.log('[FedCM] Silent SSO: Got credential, exchanging for session...');
232
+ debug.log('Silent SSO: Got credential, exchanging for session...');
238
233
 
239
234
  let session: SessionLoginResponse;
240
235
  try {
241
236
  session = await this.exchangeIdTokenForSession(credential.token);
242
237
  } catch (exchangeError) {
243
- console.error('[FedCM] Silent SSO: Token exchange failed:', exchangeError);
238
+ debug.error('Silent SSO: Token exchange failed:', exchangeError);
244
239
  return null;
245
240
  }
246
241
 
247
242
  // Validate session response has required fields
248
243
  if (!session) {
249
- console.error('[FedCM] Silent SSO: Exchange returned null session');
244
+ debug.error('Silent SSO: Exchange returned null session');
250
245
  return null;
251
246
  }
252
247
 
253
248
  if (!session.sessionId) {
254
- console.error('[FedCM] Silent SSO: Exchange returned session without sessionId:', session);
249
+ debug.error('Silent SSO: Exchange returned session without sessionId:', session);
255
250
  return null;
256
251
  }
257
252
 
258
253
  if (!session.user) {
259
- console.error('[FedCM] Silent SSO: Exchange returned session without user:', session);
254
+ debug.error('Silent SSO: Exchange returned session without user:', session);
260
255
  return null;
261
256
  }
262
257
 
263
258
  // Set the access token
264
259
  if ((session as any).accessToken) {
265
260
  this.httpService.setTokens((session as any).accessToken);
266
- console.log('[FedCM] Silent SSO: Access token set');
261
+ debug.log('Silent SSO: Access token set');
267
262
  } else {
268
- console.warn('[FedCM] Silent SSO: No accessToken in session response');
263
+ debug.warn('Silent SSO: No accessToken in session response');
269
264
  }
270
265
 
271
- console.log('[FedCM] Silent SSO: Success!', {
266
+ debug.log('Silent SSO: Success!', {
272
267
  sessionId: session.sessionId?.substring(0, 8) + '...',
273
268
  userId: session.user?.id
274
269
  });
@@ -296,7 +291,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
296
291
  const requestedMediation = options.mediation || 'optional';
297
292
  const isInteractive = requestedMediation !== 'silent';
298
293
 
299
- console.log('[FedCM] requestIdentityCredential called:', {
294
+ debug.log('requestIdentityCredential called:', {
300
295
  mediation: requestedMediation,
301
296
  clientId: options.clientId,
302
297
  inProgress: fedCMRequestInProgress,
@@ -304,7 +299,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
304
299
 
305
300
  // If a request is already in progress...
306
301
  if (fedCMRequestInProgress && fedCMRequestPromise) {
307
- console.log('[FedCM] Request already in progress, waiting...');
302
+ debug.log('Request already in progress, waiting...');
308
303
  // If current request is silent and new request is interactive,
309
304
  // wait for silent to finish, then make the interactive request
310
305
  if (currentMediationMode === 'silent' && isInteractive) {
@@ -332,13 +327,13 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
332
327
  ? (this.constructor as any).FEDCM_SILENT_TIMEOUT
333
328
  : (this.constructor as any).FEDCM_TIMEOUT;
334
329
  const timeout = setTimeout(() => {
335
- console.log('[FedCM] Request timed out after', timeoutMs, 'ms (mediation:', requestedMediation + ')');
330
+ debug.log('Request timed out after', timeoutMs, 'ms (mediation:', requestedMediation + ')');
336
331
  controller.abort();
337
332
  }, timeoutMs);
338
333
 
339
334
  fedCMRequestPromise = (async () => {
340
335
  try {
341
- console.log('[FedCM] Calling navigator.credentials.get with mediation:', requestedMediation);
336
+ debug.log('Calling navigator.credentials.get with mediation:', requestedMediation);
342
337
  // Type assertion needed as FedCM types may not be in all TypeScript versions
343
338
  const credential = (await (navigator.credentials as any).get({
344
339
  identity: {
@@ -359,23 +354,23 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
359
354
  signal: controller.signal,
360
355
  })) as any;
361
356
 
362
- console.log('[FedCM] navigator.credentials.get returned:', {
357
+ debug.log('navigator.credentials.get returned:', {
363
358
  hasCredential: !!credential,
364
359
  type: credential?.type,
365
360
  hasToken: !!credential?.token,
366
361
  });
367
362
 
368
363
  if (!credential || credential.type !== 'identity') {
369
- console.log('[FedCM] No valid identity credential returned');
364
+ debug.log('No valid identity credential returned');
370
365
  return null;
371
366
  }
372
367
 
373
- console.log('[FedCM] Got valid identity credential with token');
368
+ debug.log('Got valid identity credential with token');
374
369
  return { token: credential.token };
375
370
  } catch (error) {
376
371
  const errorName = error instanceof Error ? error.name : 'Unknown';
377
372
  const errorMessage = error instanceof Error ? error.message : String(error);
378
- console.log('[FedCM] navigator.credentials.get error:', { name: errorName, message: errorMessage });
373
+ debug.log('navigator.credentials.get error:', { name: errorName, message: errorMessage });
379
374
  throw error;
380
375
  } finally {
381
376
  clearTimeout(timeout);
@@ -397,9 +392,9 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
397
392
  * @private
398
393
  */
399
394
  public async exchangeIdTokenForSession(idToken: string): Promise<SessionLoginResponse> {
400
- console.log('[FedCM] exchangeIdTokenForSession: Starting exchange...');
401
- console.log('[FedCM] exchangeIdTokenForSession: Token length:', idToken?.length);
402
- console.log('[FedCM] exchangeIdTokenForSession: Token preview:', idToken?.substring(0, 50) + '...');
395
+ debug.log('exchangeIdTokenForSession: Starting exchange...');
396
+ debug.log('exchangeIdTokenForSession: Token length:', idToken?.length);
397
+ debug.log('exchangeIdTokenForSession: Token preview:', idToken?.substring(0, 50) + '...');
403
398
 
404
399
  try {
405
400
  const response = await this.makeRequest<SessionLoginResponse>(
@@ -409,7 +404,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
409
404
  { cache: false }
410
405
  );
411
406
 
412
- console.log('[FedCM] exchangeIdTokenForSession: Response received:', {
407
+ debug.log('exchangeIdTokenForSession: Response received:', {
413
408
  hasResponse: !!response,
414
409
  hasSessionId: !!(response as any)?.sessionId,
415
410
  hasUser: !!(response as any)?.user,
@@ -421,7 +416,7 @@ export function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T)
421
416
 
422
417
  return response;
423
418
  } catch (error) {
424
- console.error('[FedCM] exchangeIdTokenForSession: Error:', {
419
+ debug.error('exchangeIdTokenForSession: Error:', {
425
420
  name: error instanceof Error ? error.name : 'Unknown',
426
421
  message: error instanceof Error ? error.message : String(error),
427
422
  stack: error instanceof Error ? error.stack : undefined,
@@ -1,6 +1,9 @@
1
1
  import type { OxyServicesBase } from '../OxyServices.base';
2
2
  import { OxyAuthenticationError } from '../OxyServices.errors';
3
3
  import type { SessionLoginResponse } from '../../models/session';
4
+ import { createDebugLogger } from '../../shared/utils/debugUtils';
5
+
6
+ const debug = createDebugLogger('PopupAuth');
4
7
 
5
8
  export interface PopupAuthOptions {
6
9
  width?: number;
@@ -125,7 +128,7 @@ export function OxyServicesPopupAuthMixin<T extends typeof OxyServicesBase>(Base
125
128
  (session as any).user = userData;
126
129
  }
127
130
  } catch (userError) {
128
- console.warn('[PopupAuth] Failed to fetch user data:', userError);
131
+ debug.warn('Failed to fetch user data:', userError);
129
132
  // Continue without user data - caller can fetch separately
130
133
  }
131
134
  }
@@ -261,7 +264,7 @@ export function OxyServicesPopupAuthMixin<T extends typeof OxyServicesBase>(Base
261
264
 
262
265
  // Log all messages for debugging
263
266
  if (event.data && typeof event.data === 'object' && event.data.type) {
264
- console.log('[PopupAuth] Message received:', {
267
+ debug.log('Message received:', {
265
268
  origin: event.origin,
266
269
  expectedOrigin: authUrl,
267
270
  type: event.data.type,
@@ -281,12 +284,12 @@ export function OxyServicesPopupAuthMixin<T extends typeof OxyServicesBase>(Base
281
284
  return;
282
285
  }
283
286
 
284
- console.log('[PopupAuth] Valid auth response:', { state, expectedState, hasSession: !!session, error });
287
+ debug.log('Valid auth response:', { state, expectedState, hasSession: !!session, error });
285
288
 
286
289
  // Verify state parameter to prevent CSRF attacks
287
290
  if (state !== expectedState) {
288
291
  cleanup();
289
- console.error('[PopupAuth] State mismatch');
292
+ debug.error('State mismatch');
290
293
  reject(new OxyAuthenticationError('Invalid state parameter. Possible CSRF attack.'));
291
294
  return;
292
295
  }
@@ -294,13 +297,13 @@ export function OxyServicesPopupAuthMixin<T extends typeof OxyServicesBase>(Base
294
297
  cleanup();
295
298
 
296
299
  if (error) {
297
- console.error('[PopupAuth] Auth error:', error);
300
+ debug.error('Auth error:', error);
298
301
  reject(new OxyAuthenticationError(error));
299
302
  } else if (session) {
300
- console.log('[PopupAuth] Session received successfully');
303
+ debug.log('Session received successfully');
301
304
  resolve(session);
302
305
  } else {
303
- console.error('[PopupAuth] No session in response');
306
+ debug.error('No session in response');
304
307
  reject(new OxyAuthenticationError('No session received from authentication server'));
305
308
  }
306
309
  };
package/src/index.ts CHANGED
@@ -39,6 +39,9 @@ export type { AuthState, AuthActions, UseAuthReturn } from './ui/hooks/useAuth';
39
39
  // Streamlined provider with built-in bottom sheet
40
40
  export { default as OxyProvider } from './ui/components/OxyProvider';
41
41
 
42
+ // Font loading utility
43
+ export { FontLoader } from './ui/components/FontLoader';
44
+
42
45
  // Web-only provider (no React Native dependencies)
43
46
  export { default as WebOxyProvider } from './ui/components/WebOxyProvider';
44
47
 
@@ -114,7 +117,7 @@ export type {
114
117
  SecurityEventType,
115
118
  SecurityEventSeverity,
116
119
  SecurityActivity,
117
- SecurityActivityResponse
120
+ SecurityActivityResponse,
118
121
  } from './models/interfaces';
119
122
 
120
123
  // Export security constants
@@ -145,6 +148,7 @@ export {
145
148
  export { useSessionSocket } from './ui/hooks/useSessionSocket';
146
149
  export { useAssets, setOxyAssetInstance } from './ui/hooks/useAssets';
147
150
  export { useFileDownloadUrl, setOxyFileUrlInstance } from './ui/hooks/useFileDownloadUrl';
151
+ export { useFollow, useFollowerCounts } from './ui/hooks/useFollow';
148
152
 
149
153
  // UI hooks - Query hooks (TanStack Query)
150
154
  export {
@@ -204,6 +208,10 @@ export {
204
208
  } from './ui/utils/authHelpers';
205
209
  export type { HandleApiErrorOptions } from './ui/utils/authHelpers';
206
210
 
211
+ // Error handlers
212
+ export { handleAuthError, isInvalidSessionError, isTimeoutOrNetworkError, extractErrorMessage } from './ui/utils/errorHandlers';
213
+ export type { HandleAuthErrorOptions } from './ui/utils/errorHandlers';
214
+
207
215
  // File filtering hook
208
216
  export { useFileFiltering } from './ui/hooks/useFileFiltering';
209
217
  export type { ViewMode, SortBy, SortOrder } from './ui/hooks/useFileFiltering';
@@ -212,19 +220,69 @@ export type { ViewMode, SortBy, SortOrder } from './ui/hooks/useFileFiltering';
212
220
  export { OxySignInButton } from './ui/components/OxySignInButton';
213
221
  export { OxyLogo, FollowButton } from './ui';
214
222
 
215
- // New consolidated utilities
223
+ // Shared utilities (platform-agnostic)
224
+ export {
225
+ // Color utilities
226
+ darkenColor,
227
+ lightenColor,
228
+ hexToRgb,
229
+ rgbToHex,
230
+ withOpacity,
231
+ isLightColor,
232
+ getContrastTextColor,
233
+ } from './shared/utils/colorUtils';
234
+
235
+ export {
236
+ // Theme utilities
237
+ normalizeTheme,
238
+ normalizeColorScheme,
239
+ getOppositeTheme,
240
+ systemPrefersDarkMode,
241
+ getSystemColorScheme,
242
+ } from './shared/utils/themeUtils';
243
+ export type { ThemeValue } from './shared/utils/themeUtils';
244
+
245
+ export {
246
+ // Error utilities
247
+ HttpStatus,
248
+ getErrorStatus,
249
+ getErrorMessage,
250
+ isAlreadyRegisteredError,
251
+ isUnauthorizedError,
252
+ isForbiddenError,
253
+ isNotFoundError,
254
+ isRateLimitError,
255
+ isServerError,
256
+ isNetworkError,
257
+ isRetryableError,
258
+ } from './shared/utils/errorUtils';
259
+
260
+ export {
261
+ // Network utilities
262
+ DEFAULT_CIRCUIT_BREAKER_CONFIG,
263
+ createCircuitBreakerState,
264
+ calculateBackoffInterval,
265
+ recordFailure,
266
+ recordSuccess,
267
+ shouldAllowRequest,
268
+ delay,
269
+ withRetry,
270
+ } from './shared/utils/networkUtils';
271
+ export type { CircuitBreakerState, CircuitBreakerConfig } from './shared/utils/networkUtils';
272
+
273
+ // Other utilities
216
274
  export * from './utils/apiUtils';
217
- export {
218
- ErrorCodes,
219
- createApiError,
220
- handleHttpError,
275
+ export {
276
+ ErrorCodes,
277
+ createApiError,
278
+ handleHttpError,
221
279
  validateRequiredFields,
222
- retryWithBackoff
223
280
  } from './utils/errorUtils';
281
+ export { retryAsync } from './utils/asyncUtils';
224
282
  export * from './utils/validationUtils';
225
- export {
226
- logger,
227
- LogLevel,
283
+ export {
284
+ logger,
285
+ LogLevel,
228
286
  LogContext,
229
287
  logAuth,
230
288
  logApi,
@@ -235,4 +293,11 @@ export {
235
293
  logPerformance
236
294
  } from './utils/loggerUtils';
237
295
  export * from './utils/asyncUtils';
238
- export * from './utils/hookUtils';
296
+ export * from './utils/hookUtils';
297
+
298
+ // Bottom sheet navigation
299
+ export { showBottomSheet, closeBottomSheet } from './ui/navigation/bottomSheetManager';
300
+ export type { RouteName } from './ui/navigation/routes';
301
+
302
+ // Sign-in modal
303
+ export { showSignInModal, hideSignInModal } from './ui/components/SignInModal';
@@ -23,4 +23,8 @@ export interface SessionLoginResponse {
23
23
  deviceId: string;
24
24
  expiresAt: string;
25
25
  user: MinimalUserData;
26
+ /** JWT access token for API authentication */
27
+ accessToken?: string;
28
+ /** Refresh token for obtaining new access tokens */
29
+ refreshToken?: string;
26
30
  }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * OxyServices Shared Module
3
+ *
4
+ * Platform-agnostic utilities and helpers that work everywhere:
5
+ * - Browser (Web, Expo Web)
6
+ * - React Native (iOS, Android)
7
+ * - Node.js (Backend)
8
+ *
9
+ * This module contains NO React Native or browser-specific dependencies.
10
+ *
11
+ * @module shared
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import { darkenColor, normalizeTheme, withRetry } from '@oxyhq/services/shared';
16
+ *
17
+ * const darkBlue = darkenColor('#0066FF', 0.3);
18
+ * const theme = normalizeTheme(userPreference);
19
+ * const data = await withRetry(() => fetchData(), { maxRetries: 3 });
20
+ * ```
21
+ */
22
+
23
+ // Color utilities
24
+ export {
25
+ darkenColor,
26
+ lightenColor,
27
+ hexToRgb,
28
+ rgbToHex,
29
+ withOpacity,
30
+ isLightColor,
31
+ getContrastTextColor,
32
+ } from './utils/colorUtils';
33
+
34
+ // Theme utilities
35
+ export {
36
+ normalizeTheme,
37
+ normalizeColorScheme,
38
+ getOppositeTheme,
39
+ systemPrefersDarkMode,
40
+ getSystemColorScheme,
41
+ } from './utils/themeUtils';
42
+ export type { ThemeValue } from './utils/themeUtils';
43
+
44
+ // Error utilities
45
+ export {
46
+ HttpStatus,
47
+ getErrorStatus,
48
+ getErrorMessage,
49
+ isAlreadyRegisteredError,
50
+ isUnauthorizedError,
51
+ isForbiddenError,
52
+ isNotFoundError,
53
+ isRateLimitError,
54
+ isServerError,
55
+ isNetworkError,
56
+ isRetryableError,
57
+ } from './utils/errorUtils';
58
+
59
+ // Network utilities
60
+ export {
61
+ DEFAULT_CIRCUIT_BREAKER_CONFIG,
62
+ createCircuitBreakerState,
63
+ calculateBackoffInterval,
64
+ recordFailure,
65
+ recordSuccess,
66
+ shouldAllowRequest,
67
+ delay,
68
+ withRetry,
69
+ } from './utils/networkUtils';
70
+ export type {
71
+ CircuitBreakerState,
72
+ CircuitBreakerConfig,
73
+ } from './utils/networkUtils';
74
+
75
+ // Debug utilities
76
+ export {
77
+ isDev,
78
+ debugLog,
79
+ debugWarn,
80
+ debugError,
81
+ createDebugLogger,
82
+ } from './utils/debugUtils';