@oxyhq/services 5.7.5 → 5.8.2

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 (303) hide show
  1. package/README.md +76 -76
  2. package/lib/commonjs/core/index.js +177 -102
  3. package/lib/commonjs/core/index.js.map +1 -1
  4. package/lib/commonjs/index.js +69 -28
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/ui/components/Avatar.js +15 -6
  7. package/lib/commonjs/ui/components/Avatar.js.map +1 -1
  8. package/lib/commonjs/ui/components/FollowButton.js +100 -12
  9. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  10. package/lib/commonjs/ui/components/GroupedItem.js +58 -13
  11. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
  12. package/lib/commonjs/ui/components/GroupedSection.js +7 -1
  13. package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
  14. package/lib/commonjs/ui/components/Header.js +356 -0
  15. package/lib/commonjs/ui/components/Header.js.map +1 -0
  16. package/lib/commonjs/ui/components/OxyProvider.js +28 -7
  17. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  18. package/lib/commonjs/ui/components/index.js +7 -0
  19. package/lib/commonjs/ui/components/index.js.map +1 -1
  20. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +1 -1
  21. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  22. package/lib/commonjs/ui/components/internal/TextField.js +606 -546
  23. package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
  24. package/lib/commonjs/ui/components/internal/TextField.md +436 -0
  25. package/lib/commonjs/ui/context/OxyContext.js +181 -199
  26. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  27. package/lib/commonjs/ui/hooks/index.js +6 -0
  28. package/lib/commonjs/ui/hooks/index.js.map +1 -1
  29. package/lib/commonjs/ui/hooks/useFollow.js +59 -2
  30. package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
  31. package/lib/commonjs/ui/hooks/useSessionSocket.js +5 -2
  32. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
  33. package/lib/commonjs/ui/navigation/OxyRouter.js +11 -1
  34. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
  35. package/lib/commonjs/ui/screens/AccountCenterScreen.js +6 -6
  36. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  37. package/lib/commonjs/ui/screens/AccountManagementDemo.js +3 -3
  38. package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
  39. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +241 -598
  40. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  41. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +1160 -406
  42. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  43. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +135 -237
  44. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  45. package/lib/commonjs/ui/screens/AppInfoScreen.js +246 -463
  46. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  47. package/lib/commonjs/ui/screens/FeedbackScreen.js +3 -3
  48. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  49. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +808 -650
  50. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  51. package/lib/commonjs/ui/screens/ProfileScreen.js +214 -37
  52. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  53. package/lib/commonjs/ui/screens/RecoverAccountScreen.js +51 -72
  54. package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/SessionManagementScreen.js +11 -29
  56. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  57. package/lib/commonjs/ui/screens/SignInScreen.js +30 -303
  58. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  59. package/lib/commonjs/ui/screens/SignUpScreen.js +4 -4
  60. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
  61. package/lib/commonjs/ui/screens/UserLinksScreen.js +90 -0
  62. package/lib/commonjs/ui/screens/UserLinksScreen.js.map +1 -0
  63. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +19 -31
  64. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  65. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +7 -10
  66. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  67. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +11 -5
  68. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
  69. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +11 -4
  70. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
  71. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +9 -6
  72. package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  73. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +3 -30
  74. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  75. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +37 -46
  76. package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  77. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +9 -12
  78. package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  79. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +9 -12
  80. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  81. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +9 -12
  82. package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  83. package/lib/commonjs/ui/stores/authStore.js +36 -6
  84. package/lib/commonjs/ui/stores/authStore.js.map +1 -1
  85. package/lib/commonjs/ui/stores/followStore.js +106 -1
  86. package/lib/commonjs/ui/stores/followStore.js.map +1 -1
  87. package/lib/commonjs/ui/styles/authStyles.js +337 -0
  88. package/lib/commonjs/ui/styles/authStyles.js.map +1 -0
  89. package/lib/commonjs/ui/styles/index.js +11 -0
  90. package/lib/commonjs/ui/styles/index.js.map +1 -1
  91. package/lib/module/core/index.js +177 -41
  92. package/lib/module/core/index.js.map +1 -1
  93. package/lib/module/index.js +24 -4
  94. package/lib/module/index.js.map +1 -1
  95. package/lib/module/ui/components/Avatar.js +15 -6
  96. package/lib/module/ui/components/Avatar.js.map +1 -1
  97. package/lib/module/ui/components/FollowButton.js +101 -13
  98. package/lib/module/ui/components/FollowButton.js.map +1 -1
  99. package/lib/module/ui/components/GroupedItem.js +59 -14
  100. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  101. package/lib/module/ui/components/GroupedSection.js +7 -1
  102. package/lib/module/ui/components/GroupedSection.js.map +1 -1
  103. package/lib/module/ui/components/Header.js +351 -0
  104. package/lib/module/ui/components/Header.js.map +1 -0
  105. package/lib/module/ui/components/OxyProvider.js +30 -9
  106. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  107. package/lib/module/ui/components/index.js +1 -0
  108. package/lib/module/ui/components/index.js.map +1 -1
  109. package/lib/module/ui/components/internal/GroupedPillButtons.js +1 -1
  110. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  111. package/lib/module/ui/components/internal/TextField.js +607 -547
  112. package/lib/module/ui/components/internal/TextField.js.map +1 -1
  113. package/lib/module/ui/components/internal/TextField.md +436 -0
  114. package/lib/module/ui/context/OxyContext.js +180 -198
  115. package/lib/module/ui/context/OxyContext.js.map +1 -1
  116. package/lib/module/ui/hooks/index.js +1 -1
  117. package/lib/module/ui/hooks/index.js.map +1 -1
  118. package/lib/module/ui/hooks/useFollow.js +57 -1
  119. package/lib/module/ui/hooks/useFollow.js.map +1 -1
  120. package/lib/module/ui/hooks/useSessionSocket.js +5 -2
  121. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
  122. package/lib/module/ui/navigation/OxyRouter.js +11 -1
  123. package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
  124. package/lib/module/ui/screens/AccountCenterScreen.js +6 -6
  125. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  126. package/lib/module/ui/screens/AccountManagementDemo.js +3 -3
  127. package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
  128. package/lib/module/ui/screens/AccountOverviewScreen.js +242 -597
  129. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  130. package/lib/module/ui/screens/AccountSettingsScreen.js +1161 -407
  131. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  132. package/lib/module/ui/screens/AccountSwitcherScreen.js +135 -237
  133. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  134. package/lib/module/ui/screens/AppInfoScreen.js +248 -465
  135. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  136. package/lib/module/ui/screens/FeedbackScreen.js +3 -3
  137. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  138. package/lib/module/ui/screens/PaymentGatewayScreen.js +809 -651
  139. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  140. package/lib/module/ui/screens/ProfileScreen.js +214 -37
  141. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  142. package/lib/module/ui/screens/RecoverAccountScreen.js +53 -74
  143. package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
  144. package/lib/module/ui/screens/SessionManagementScreen.js +11 -29
  145. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  146. package/lib/module/ui/screens/SignInScreen.js +32 -305
  147. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  148. package/lib/module/ui/screens/SignUpScreen.js +5 -5
  149. package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
  150. package/lib/module/ui/screens/UserLinksScreen.js +85 -0
  151. package/lib/module/ui/screens/UserLinksScreen.js.map +1 -0
  152. package/lib/module/ui/screens/internal/SignInPasswordStep.js +19 -31
  153. package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  154. package/lib/module/ui/screens/internal/SignInUsernameStep.js +7 -10
  155. package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  156. package/lib/module/ui/screens/internal/SignUpIdentityStep.js +11 -5
  157. package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
  158. package/lib/module/ui/screens/internal/SignUpSecurityStep.js +11 -4
  159. package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
  160. package/lib/module/ui/screens/karma/KarmaAboutScreen.js +9 -6
  161. package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
  162. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -30
  163. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  164. package/lib/module/ui/screens/karma/KarmaFAQScreen.js +37 -46
  165. package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
  166. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +9 -12
  167. package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
  168. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +9 -12
  169. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  170. package/lib/module/ui/screens/karma/KarmaRulesScreen.js +9 -12
  171. package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
  172. package/lib/module/ui/stores/authStore.js +36 -6
  173. package/lib/module/ui/stores/authStore.js.map +1 -1
  174. package/lib/module/ui/stores/followStore.js +106 -1
  175. package/lib/module/ui/stores/followStore.js.map +1 -1
  176. package/lib/module/ui/styles/authStyles.js +332 -0
  177. package/lib/module/ui/styles/authStyles.js.map +1 -0
  178. package/lib/module/ui/styles/index.js +1 -0
  179. package/lib/module/ui/styles/index.js.map +1 -1
  180. package/lib/typescript/core/index.d.ts +68 -24
  181. package/lib/typescript/core/index.d.ts.map +1 -1
  182. package/lib/typescript/index.d.ts +13 -3
  183. package/lib/typescript/index.d.ts.map +1 -1
  184. package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
  185. package/lib/typescript/ui/components/FollowButton.d.ts +1 -0
  186. package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
  187. package/lib/typescript/ui/components/GroupedItem.d.ts +6 -0
  188. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
  189. package/lib/typescript/ui/components/GroupedSection.d.ts +6 -0
  190. package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
  191. package/lib/typescript/ui/components/Header.d.ts +24 -0
  192. package/lib/typescript/ui/components/Header.d.ts.map +1 -0
  193. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  194. package/lib/typescript/ui/components/index.d.ts +1 -0
  195. package/lib/typescript/ui/components/index.d.ts.map +1 -1
  196. package/lib/typescript/ui/components/internal/TextField.d.ts +31 -16
  197. package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
  198. package/lib/typescript/ui/context/OxyContext.d.ts +5 -2
  199. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  200. package/lib/typescript/ui/hooks/index.d.ts +1 -1
  201. package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
  202. package/lib/typescript/ui/hooks/useFollow.d.ts +20 -0
  203. package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
  204. package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
  205. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
  206. package/lib/typescript/ui/navigation/types.d.ts +9 -2
  207. package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
  208. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  209. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  210. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  211. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
  212. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  213. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
  214. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +5 -1
  215. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
  216. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  217. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  218. package/lib/typescript/ui/screens/UserLinksScreen.d.ts +15 -0
  219. package/lib/typescript/ui/screens/UserLinksScreen.d.ts.map +1 -0
  220. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +1 -1
  221. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
  222. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +0 -1
  223. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
  224. package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -1
  225. package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -1
  226. package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
  227. package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
  228. package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
  229. package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -1
  230. package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
  231. package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -1
  232. package/lib/typescript/ui/stores/authStore.d.ts +3 -1
  233. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
  234. package/lib/typescript/ui/stores/followStore.d.ts +10 -0
  235. package/lib/typescript/ui/stores/followStore.d.ts.map +1 -1
  236. package/lib/typescript/ui/styles/authStyles.d.ts +326 -0
  237. package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -0
  238. package/lib/typescript/ui/styles/index.d.ts +1 -0
  239. package/lib/typescript/ui/styles/index.d.ts.map +1 -1
  240. package/package.json +1 -4
  241. package/src/core/index.ts +195 -41
  242. package/src/index.ts +64 -4
  243. package/src/ui/components/Avatar.tsx +11 -5
  244. package/src/ui/components/FollowButton.tsx +95 -11
  245. package/src/ui/components/GroupedItem.tsx +57 -9
  246. package/src/ui/components/GroupedSection.tsx +12 -0
  247. package/src/ui/components/Header.tsx +405 -0
  248. package/src/ui/components/OxyProvider.tsx +37 -15
  249. package/src/ui/components/index.ts +1 -0
  250. package/src/ui/components/internal/GroupedPillButtons.tsx +1 -1
  251. package/src/ui/components/internal/TextField.md +436 -0
  252. package/src/ui/components/internal/TextField.tsx +720 -620
  253. package/src/ui/context/OxyContext.tsx +211 -195
  254. package/src/ui/hooks/index.ts +1 -1
  255. package/src/ui/hooks/useFollow.ts +63 -0
  256. package/src/ui/hooks/useSessionSocket.ts +5 -2
  257. package/src/ui/navigation/OxyRouter.tsx +11 -1
  258. package/src/ui/navigation/types.ts +10 -2
  259. package/src/ui/screens/AccountCenterScreen.tsx +5 -5
  260. package/src/ui/screens/AccountManagementDemo.tsx +9 -9
  261. package/src/ui/screens/AccountOverviewScreen.tsx +265 -414
  262. package/src/ui/screens/AccountSettingsScreen.tsx +1173 -403
  263. package/src/ui/screens/AccountSwitcherScreen.tsx +158 -202
  264. package/src/ui/screens/AppInfoScreen.tsx +270 -497
  265. package/src/ui/screens/FeedbackScreen.tsx +3 -3
  266. package/src/ui/screens/PaymentGatewayScreen.tsx +668 -365
  267. package/src/ui/screens/ProfileScreen.tsx +196 -33
  268. package/src/ui/screens/RecoverAccountScreen.tsx +46 -74
  269. package/src/ui/screens/SessionManagementScreen.tsx +14 -22
  270. package/src/ui/screens/SignInScreen.tsx +27 -294
  271. package/src/ui/screens/SignUpScreen.tsx +5 -5
  272. package/src/ui/screens/UserLinksScreen.tsx +96 -0
  273. package/src/ui/screens/internal/SignInPasswordStep.tsx +11 -22
  274. package/src/ui/screens/internal/SignInUsernameStep.tsx +3 -10
  275. package/src/ui/screens/internal/SignUpIdentityStep.tsx +2 -5
  276. package/src/ui/screens/internal/SignUpSecurityStep.tsx +3 -4
  277. package/src/ui/screens/karma/KarmaAboutScreen.tsx +9 -2
  278. package/src/ui/screens/karma/KarmaCenterScreen.tsx +1 -20
  279. package/src/ui/screens/karma/KarmaFAQScreen.tsx +40 -24
  280. package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +9 -3
  281. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +9 -3
  282. package/src/ui/screens/karma/KarmaRulesScreen.tsx +9 -3
  283. package/src/ui/stores/authStore.ts +34 -7
  284. package/src/ui/stores/followStore.ts +102 -1
  285. package/src/ui/styles/authStyles.ts +352 -0
  286. package/src/ui/styles/index.ts +1 -0
  287. package/lib/commonjs/core/auth-manager.js +0 -440
  288. package/lib/commonjs/core/auth-manager.js.map +0 -1
  289. package/lib/commonjs/core/use-auth.js +0 -244
  290. package/lib/commonjs/core/use-auth.js.map +0 -1
  291. package/lib/module/core/auth-manager.js +0 -432
  292. package/lib/module/core/auth-manager.js.map +0 -1
  293. package/lib/module/core/use-auth.js +0 -235
  294. package/lib/module/core/use-auth.js.map +0 -1
  295. package/lib/typescript/core/auth-manager.d.ts +0 -136
  296. package/lib/typescript/core/auth-manager.d.ts.map +0 -1
  297. package/lib/typescript/core/use-auth.d.ts +0 -79
  298. package/lib/typescript/core/use-auth.d.ts.map +0 -1
  299. package/src/__tests__/middleware.test.ts +0 -105
  300. package/src/__tests__/setup.ts +0 -10
  301. package/src/__tests__/zero-config-auth.test.ts +0 -607
  302. package/src/core/auth-manager.ts +0 -500
  303. package/src/core/use-auth.tsx +0 -245
package/README.md CHANGED
@@ -1,100 +1,95 @@
1
1
  # OxyHQServices
2
2
 
3
- 🚀 **Zero-config authentication and user management** for React, React Native, and Node.js applications. No manual token handling, no interceptor setup, no middleware configuration required.
3
+ A TypeScript client library for the Oxy API providing authentication, user management, and UI components for React and React Native applications.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Features](#features)
8
+ - [Quick Start](#quick-start)
9
+ - [Documentation](#documentation)
10
+ - [UI Components](#ui-components)
11
+ - [Package Exports](#package-exports)
12
+ - [Requirements](#requirements)
13
+ - [Development](#development)
14
+ - [Integration](#integration)
15
+ - [License](#license)
4
16
 
5
- ## ✨ Quick Start (Zero Config)
17
+ ## Features
6
18
 
7
- ### Frontend (React/React Native)
19
+ - 🔐 **Streamlined Authentication**: Zero-config authentication with automatic token management
20
+ - 🔄 **Auto Token Refresh**: Seamless token lifecycle management behind the scenes
21
+ - 👥 **User Management**: Profile operations and social features
22
+ - 🎨 **UI Components**: Pre-built React components for common functionality
23
+ - 📱 **Cross-Platform**: Works in React Native and web applications
24
+ - 🔧 **TypeScript**: Full type safety and IntelliSense support
25
+ - 🚀 **Performance**: Optimized with automatic caching and state management
26
+
27
+ ## Quick Start
28
+
29
+ ```bash
30
+ npm install @oxyhq/services
31
+ ```
8
32
 
9
- ```tsx
10
- import React from 'react';
11
- import { AuthProvider, useAuth } from '@oxyhq/services';
33
+ ### Streamlined Authentication (Recommended)
34
+
35
+ ```typescript
36
+ import { OxyProvider, useOxy } from '@oxyhq/services';
12
37
 
13
- // 1. Wrap your app (that's it for setup!)
14
38
  function App() {
15
39
  return (
16
- <AuthProvider baseURL="https://api.oxy.so">
17
- <MainApp />
18
- </AuthProvider>
40
+ <OxyProvider baseURL="https://api.example.com">
41
+ <YourApp />
42
+ </OxyProvider>
19
43
  );
20
44
  }
21
45
 
22
- // 2. Use authentication anywhere
23
- function MainApp() {
24
- const { isAuthenticated, user, login, logout } = useAuth();
46
+ function UserProfile() {
47
+ const { oxyServices } = useOxy();
25
48
 
26
- if (!isAuthenticated) {
27
- return <button onClick={() => login('user', 'pass')}>Login</button>;
28
- }
29
-
30
- return (
31
- <div>
32
- <h1>Welcome {user?.username}!</h1>
33
- <button onClick={logout}>Logout</button>
34
- </div>
35
- );
49
+ const fetchData = async () => {
50
+ // No manual authentication needed - everything is automatic!
51
+ const user = await oxyServices.getCurrentUser();
52
+ const notifications = await oxyServices.getNotifications();
53
+ };
36
54
  }
37
55
  ```
38
56
 
39
- ### Backend (Express.js)
57
+ ### With Built-in Bottom Sheet
58
+
59
+ The OxyProvider now includes a built-in gorhom bottom sheet - no manual setup required!
40
60
 
41
61
  ```typescript
42
- import express from 'express';
43
- import { authenticateRequest, OxyRequest } from '@oxyhq/services/api';
62
+ import { OxyProvider, useOxy, OxySignInButton } from '@oxyhq/services';
44
63
 
45
- const app = express();
64
+ function App() {
65
+ return (
66
+ <OxyProvider
67
+ baseURL="https://api.example.com"
68
+ initialScreen="SignIn"
69
+ theme="light"
70
+ >
71
+ <YourApp />
72
+ </OxyProvider>
73
+ );
74
+ }
46
75
 
47
- // Zero-config authentication - just add the middleware
48
- app.get('/profile', authenticateRequest(), (req: OxyRequest, res) => {
49
- // req.user is automatically populated!
50
- res.json({
51
- message: `Hello ${req.user!.username}!`,
52
- user: req.user
53
- });
54
- });
76
+ function Component() {
77
+ const { showBottomSheet } = useOxy();
78
+
79
+ const openSignIn = () => {
80
+ showBottomSheet('SignIn'); // Works automatically!
81
+ };
82
+
83
+ return (
84
+ <div>
85
+ <button onClick={openSignIn}>Sign In</button>
86
+ <OxySignInButton /> {/* Also works automatically! */}
87
+ </div>
88
+ );
89
+ }
55
90
  ```
56
91
 
57
- That's it! 🎉 Authentication is now fully automated with:
58
- - ✅ Automatic token management and refresh
59
- - ✅ Secure storage across app restarts
60
- - ✅ Built-in error handling and retry logic
61
- - ✅ Cross-platform support (React Native + Web)
62
- - ✅ TypeScript support throughout
63
-
64
- ## 📖 Documentation
65
-
66
- - **[🚀 Zero-Config Authentication Guide](./packages/services/ZERO_CONFIG_AUTH.md)** - Complete setup guide
67
- - **[🔧 Migration Guide](./packages/services/ZERO_CONFIG_AUTH.md#migration-from-legacy-authentication)** - Upgrade from legacy auth
68
- - **[📚 Examples](./packages/services/examples/)** - Complete integration examples
69
- - **[🔐 API Reference](./packages/services/ZERO_CONFIG_AUTH.md#complete-api-reference)** - All components and hooks
70
-
71
- ## Table of Contents
72
-
73
- - [Legacy Features](#features)
74
- - [Legacy Quick Start](#quick-start)
75
- - [Package Exports](#package-exports)
76
- - [Requirements](#requirements)
77
- - [Development](#development)
78
- - [Integration](#integration)
79
- - [License](#license)
80
-
81
- ---
82
-
83
- ## Legacy Features (Still Supported)
84
-
85
- A TypeScript client library for the Oxy API providing authentication, user management, and UI components for React and React Native applications.
86
-
87
- - 🔐 **Authentication**: JWT-based auth with automatic token refresh
88
- - 👥 **User Management**: Profile operations and social features
89
- - 🎨 **UI Components**: Pre-built React components for common functionality
90
- - 📱 **Cross-Platform**: Works in React Native and web applications
91
- - 🔧 **TypeScript**: Full type safety and IntelliSense support
92
-
93
- ## Legacy Quick Start
94
-
95
- ```bash
96
- npm install @oxyhq/services
97
- ```
92
+ ### Traditional Usage
98
93
 
99
94
  ```typescript
100
95
  import { OxyServices } from '@oxyhq/services';
@@ -113,9 +108,14 @@ const response = await oxy.auth.login({
113
108
  const user = await oxy.users.getCurrentUser();
114
109
  ```
115
110
 
111
+ ## Documentation
112
+
113
+ For comprehensive documentation, API reference, and examples:
114
+
116
115
  - [📚 Full Documentation](./docs/README.md)
117
116
  - [🚀 Quick Start Guide](./docs/quick-start.md)
118
117
  - [🔐 Core API Reference](./docs/core-api.md)
118
+ - [⚡ Streamlined Authentication](./docs/core-api.md#streamlined-authentication) - **NEW!**
119
119
  - [💼 Integration Examples](./docs/examples/)
120
120
 
121
121
  ## UI Components
@@ -6,29 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  var _exportNames = {
7
7
  OXY_CLOUD_URL: true,
8
8
  OxyServices: true,
9
- AuthenticationManager: true,
10
- initializeAuth: true,
11
- getAuthManager: true,
12
- AuthProvider: true,
13
- useAuth: true,
14
- useOxyClient: true,
15
- useAuthStatus: true,
16
- useCurrentUser: true,
17
- withAuth: true,
18
9
  DeviceManager: true
19
10
  };
20
- Object.defineProperty(exports, "AuthProvider", {
21
- enumerable: true,
22
- get: function () {
23
- return _useAuth.AuthProvider;
24
- }
25
- });
26
- Object.defineProperty(exports, "AuthenticationManager", {
27
- enumerable: true,
28
- get: function () {
29
- return _authManager.AuthenticationManager;
30
- }
31
- });
32
11
  Object.defineProperty(exports, "DeviceManager", {
33
12
  enumerable: true,
34
13
  get: function () {
@@ -36,52 +15,8 @@ Object.defineProperty(exports, "DeviceManager", {
36
15
  }
37
16
  });
38
17
  exports.default = exports.OxyServices = exports.OXY_CLOUD_URL = void 0;
39
- Object.defineProperty(exports, "getAuthManager", {
40
- enumerable: true,
41
- get: function () {
42
- return _authManager.getAuthManager;
43
- }
44
- });
45
- Object.defineProperty(exports, "initializeAuth", {
46
- enumerable: true,
47
- get: function () {
48
- return _authManager.initializeAuth;
49
- }
50
- });
51
- Object.defineProperty(exports, "useAuth", {
52
- enumerable: true,
53
- get: function () {
54
- return _useAuth.useAuth;
55
- }
56
- });
57
- Object.defineProperty(exports, "useAuthStatus", {
58
- enumerable: true,
59
- get: function () {
60
- return _useAuth.useAuthStatus;
61
- }
62
- });
63
- Object.defineProperty(exports, "useCurrentUser", {
64
- enumerable: true,
65
- get: function () {
66
- return _useAuth.useCurrentUser;
67
- }
68
- });
69
- Object.defineProperty(exports, "useOxyClient", {
70
- enumerable: true,
71
- get: function () {
72
- return _useAuth.useOxyClient;
73
- }
74
- });
75
- Object.defineProperty(exports, "withAuth", {
76
- enumerable: true,
77
- get: function () {
78
- return _useAuth.withAuth;
79
- }
80
- });
81
18
  var _axios = _interopRequireDefault(require("axios"));
82
19
  var _jwtDecode = require("jwt-decode");
83
- var _authManager = require("./auth-manager");
84
- var _useAuth = require("./use-auth");
85
20
  var _deviceManager = require("../utils/deviceManager");
86
21
  var _interfaces = require("../models/interfaces");
87
22
  Object.keys(_interfaces).forEach(function (key) {
@@ -108,8 +43,6 @@ Object.keys(_secureSession).forEach(function (key) {
108
43
  });
109
44
  });
110
45
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
111
- // Zero-Config Authentication Exports
112
-
113
46
  // Remove all FormData, form-data, and polyfill logic. Delete uploadFile and uploadFiles methods. Add a comment to use the new raw upload approach instead.
114
47
 
115
48
  // Import secure session types
@@ -124,54 +57,24 @@ const OXY_CLOUD_URL = exports.OXY_CLOUD_URL = 'https://cloud.oxy.so';
124
57
  /**
125
58
  * OxyServices - Client library for interacting with the Oxy API
126
59
  *
127
- * ZERO-CONFIG MODE:
128
- * Use the new AuthProvider and useAuth hooks for automatic authentication management:
129
- *
130
- * import { AuthProvider, useAuth } from '@oxyhq/services';
131
- *
132
- * <AuthProvider baseURL="https://api.oxy.so">
133
- * <App />
134
- * </AuthProvider>
135
- *
136
- * Then in components:
137
- * const { login, user, isAuthenticated } = useAuth();
138
- *
139
- * LEGACY MODE:
140
- * The OxyServices class below is maintained for backward compatibility
141
- * but we recommend migrating to the new zero-config approach.
142
- *
143
- * Note: For authentication status in UI components, use `isAuthenticated` from useAuth() context
60
+ * Note: For authentication status in UI components, use `isAuthenticated` from useOxy() context
144
61
  * instead of checking token status directly on this service.
145
62
  */
146
63
  class OxyServices {
147
64
  accessToken = null;
148
65
  refreshToken = null;
149
66
  refreshPromise = null;
150
- authManager = null;
151
67
 
152
68
  /**
153
69
  * Creates a new instance of the OxyServices client
154
70
  * @param config - Configuration for the client
155
71
  */
156
72
  constructor(config) {
157
- // Try to use the new auth manager if available, otherwise fall back to legacy mode
158
- try {
159
- this.authManager = (0, _authManager.initializeAuth)(config.baseURL);
160
- this.client = this.authManager.getClient();
161
- } catch {
162
- // Fall back to legacy implementation
163
- this.client = _axios.default.create({
164
- baseURL: config.baseURL,
165
- timeout: 10000 // 10 second timeout
166
- });
167
- this.setupLegacyInterceptors();
168
- }
169
- }
73
+ this.client = _axios.default.create({
74
+ baseURL: config.baseURL,
75
+ timeout: 10000 // 10 second timeout
76
+ });
170
77
 
171
- /**
172
- * Setup legacy interceptors (only used if auth manager is not available)
173
- */
174
- setupLegacyInterceptors() {
175
78
  // Interceptor for adding auth header and handling token refresh
176
79
  this.client.interceptors.request.use(async req => {
177
80
  if (!this.accessToken) {
@@ -613,9 +516,17 @@ class OxyServices {
613
516
  */
614
517
  async getCurrentUser() {
615
518
  try {
519
+ console.log('OxyServices: Fetching current user...');
616
520
  const res = await this.client.get('/users/me');
521
+ console.log('OxyServices: Current user response:', {
522
+ hasUser: !!res.data,
523
+ userLinksMetadata: res.data?.linksMetadata,
524
+ userLinks: res.data?.links,
525
+ userWebsite: res.data?.website
526
+ });
617
527
  return res.data;
618
528
  } catch (error) {
529
+ console.error('OxyServices: Error fetching current user:', error);
619
530
  throw this.handleError(error);
620
531
  }
621
532
  }
@@ -627,9 +538,12 @@ class OxyServices {
627
538
  */
628
539
  async updateProfile(updates) {
629
540
  try {
541
+ console.log('OxyServices: Updating profile with:', updates);
630
542
  const res = await this.client.put('/users/me', updates);
543
+ console.log('OxyServices: Profile update response:', res.data);
631
544
  return res.data;
632
545
  } catch (error) {
546
+ console.error('OxyServices: Error updating profile:', error);
633
547
  throw this.handleError(error);
634
548
  }
635
549
  }
@@ -1343,10 +1257,13 @@ class OxyServices {
1343
1257
  * @returns Array of user sessions
1344
1258
  */
1345
1259
  async getSessionsBySessionId(sessionId) {
1260
+ console.log('getSessionsBySessionId called with sessionId:', sessionId);
1346
1261
  try {
1347
1262
  const res = await this.client.get(`/secure-session/sessions/${sessionId}`);
1263
+ console.log('getSessionsBySessionId response:', res.data);
1348
1264
  return res.data.sessions;
1349
1265
  } catch (error) {
1266
+ console.error('getSessionsBySessionId error:', error);
1350
1267
  throw this.handleError(error);
1351
1268
  }
1352
1269
  }
@@ -1815,6 +1732,164 @@ class OxyServices {
1815
1732
  throw this.handleError(error);
1816
1733
  }
1817
1734
  }
1735
+
1736
+ /**
1737
+ * Fetch metadata for a URL (title, description, image)
1738
+ * @param url - The URL to fetch metadata for
1739
+ * @returns Promise with metadata object
1740
+ */
1741
+ async fetchLinkMetadata(url) {
1742
+ try {
1743
+ const response = await this.client.post('/link-metadata/fetch-metadata', {
1744
+ url
1745
+ });
1746
+ return response.data;
1747
+ } catch (error) {
1748
+ throw this.handleError(error);
1749
+ }
1750
+ }
1751
+
1752
+ /**
1753
+ * Search for locations using the enhanced location search API
1754
+ * @param query - Search query string
1755
+ * @param limit - Maximum number of results (default: 5)
1756
+ * @param countrycodes - Optional country codes filter (e.g., "us,ca")
1757
+ * @returns Promise with array of location results
1758
+ */
1759
+ async searchLocations(query, limit = 5, countrycodes) {
1760
+ try {
1761
+ const params = new URLSearchParams({
1762
+ query,
1763
+ limit: limit.toString()
1764
+ });
1765
+ if (countrycodes) {
1766
+ params.append('countrycodes', countrycodes);
1767
+ }
1768
+ const res = await this.client.get(`/location-search/search?${params.toString()}`);
1769
+ return res.data.results;
1770
+ } catch (error) {
1771
+ throw this.handleError(error);
1772
+ }
1773
+ }
1774
+
1775
+ /**
1776
+ * Get detailed information about a specific location by coordinates
1777
+ * @param lat - Latitude
1778
+ * @param lon - Longitude
1779
+ * @returns Promise with detailed location information
1780
+ */
1781
+ async getLocationDetails(lat, lon) {
1782
+ try {
1783
+ const res = await this.client.get(`/location-search/details?lat=${lat}&lon=${lon}`);
1784
+ return res.data.result;
1785
+ } catch (error) {
1786
+ throw this.handleError(error);
1787
+ }
1788
+ }
1789
+
1790
+ /**
1791
+ * Find locations near a point using geospatial queries
1792
+ * @param lat - Latitude
1793
+ * @param lon - Longitude
1794
+ * @param maxDistance - Maximum distance in meters (default: 10000)
1795
+ * @param limit - Maximum number of results (default: 10)
1796
+ * @param skip - Number of results to skip (default: 0)
1797
+ * @returns Promise with nearby locations
1798
+ */
1799
+ async findLocationsNear(lat, lon, maxDistance = 10000, limit = 10, skip = 0) {
1800
+ try {
1801
+ const params = new URLSearchParams({
1802
+ lat: lat.toString(),
1803
+ lon: lon.toString(),
1804
+ maxDistance: maxDistance.toString(),
1805
+ limit: limit.toString(),
1806
+ skip: skip.toString()
1807
+ });
1808
+ const res = await this.client.get(`/location-search/near?${params.toString()}`);
1809
+ return res.data;
1810
+ } catch (error) {
1811
+ throw this.handleError(error);
1812
+ }
1813
+ }
1814
+
1815
+ /**
1816
+ * Search locations in database by text
1817
+ * @param query - Search query
1818
+ * @param limit - Maximum number of results (default: 10)
1819
+ * @param skip - Number of results to skip (default: 0)
1820
+ * @param type - Filter by location type
1821
+ * @param country - Filter by country
1822
+ * @param city - Filter by city
1823
+ * @returns Promise with search results
1824
+ */
1825
+ async searchLocationsInDB(query, limit = 10, skip = 0, type, country, city) {
1826
+ try {
1827
+ const params = new URLSearchParams({
1828
+ query,
1829
+ limit: limit.toString(),
1830
+ skip: skip.toString()
1831
+ });
1832
+ if (type) params.append('type', type);
1833
+ if (country) params.append('country', country);
1834
+ if (city) params.append('city', city);
1835
+ const res = await this.client.get(`/location-search/db-search?${params.toString()}`);
1836
+ return res.data;
1837
+ } catch (error) {
1838
+ throw this.handleError(error);
1839
+ }
1840
+ }
1841
+
1842
+ /**
1843
+ * Get location statistics
1844
+ * @returns Promise with location statistics
1845
+ */
1846
+ async getLocationStats() {
1847
+ try {
1848
+ const res = await this.client.get('/location-search/stats');
1849
+ return res.data.stats;
1850
+ } catch (error) {
1851
+ throw this.handleError(error);
1852
+ }
1853
+ }
1854
+
1855
+ /**
1856
+ * Get cache statistics
1857
+ * @returns Promise with cache statistics
1858
+ */
1859
+ async getLocationCacheStats() {
1860
+ try {
1861
+ const res = await this.client.get('/location-search/cache/stats');
1862
+ return res.data.stats;
1863
+ } catch (error) {
1864
+ throw this.handleError(error);
1865
+ }
1866
+ }
1867
+
1868
+ /**
1869
+ * Clear location cache
1870
+ * @returns Promise with success status
1871
+ */
1872
+ async clearLocationCache() {
1873
+ try {
1874
+ const res = await this.client.delete('/location-search/cache');
1875
+ return res.data;
1876
+ } catch (error) {
1877
+ throw this.handleError(error);
1878
+ }
1879
+ }
1880
+
1881
+ /**
1882
+ * Get performance statistics
1883
+ * @returns Promise with performance statistics
1884
+ */
1885
+ async getLocationPerformanceStats() {
1886
+ try {
1887
+ const res = await this.client.get('/location-search/performance');
1888
+ return res.data;
1889
+ } catch (error) {
1890
+ throw this.handleError(error);
1891
+ }
1892
+ }
1818
1893
  }
1819
1894
 
1820
1895
  // Default export for backward compatibility