@oxyhq/services 5.7.5 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) 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 +88 -29
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/node/createAuth.js +585 -7
  7. package/lib/commonjs/node/createAuth.js.map +1 -1
  8. package/lib/commonjs/node/index.js +38 -1
  9. package/lib/commonjs/node/index.js.map +1 -1
  10. package/lib/commonjs/ui/components/Avatar.js +15 -6
  11. package/lib/commonjs/ui/components/Avatar.js.map +1 -1
  12. package/lib/commonjs/ui/components/GroupedItem.js +58 -13
  13. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
  14. package/lib/commonjs/ui/components/GroupedSection.js +7 -1
  15. package/lib/commonjs/ui/components/GroupedSection.js.map +1 -1
  16. package/lib/commonjs/ui/components/Header.js +322 -0
  17. package/lib/commonjs/ui/components/Header.js.map +1 -0
  18. package/lib/commonjs/ui/components/OxyProvider.js +23 -7
  19. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  20. package/lib/commonjs/ui/components/index.js +7 -0
  21. package/lib/commonjs/ui/components/index.js.map +1 -1
  22. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +1 -1
  23. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  24. package/lib/commonjs/ui/components/internal/TextField.js +606 -546
  25. package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
  26. package/lib/commonjs/ui/components/internal/TextField.md +436 -0
  27. package/lib/commonjs/ui/context/OxyContext.js +122 -78
  28. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  29. package/lib/commonjs/ui/hooks/useSessionSocket.js +5 -2
  30. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
  31. package/lib/commonjs/ui/navigation/OxyRouter.js +1 -1
  32. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
  33. package/lib/commonjs/ui/screens/AccountCenterScreen.js +6 -6
  34. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  35. package/lib/commonjs/ui/screens/AccountManagementDemo.js +3 -3
  36. package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
  37. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +241 -598
  38. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  39. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +1151 -406
  40. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  41. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +135 -237
  42. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  43. package/lib/commonjs/ui/screens/AppInfoScreen.js +246 -463
  44. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  45. package/lib/commonjs/ui/screens/FeedbackScreen.js +3 -3
  46. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  47. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +808 -650
  48. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  49. package/lib/commonjs/ui/screens/RecoverAccountScreen.js +51 -72
  50. package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -1
  51. package/lib/commonjs/ui/screens/SessionManagementScreen.js +11 -29
  52. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  53. package/lib/commonjs/ui/screens/SignInScreen.js +30 -303
  54. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/SignUpScreen.js +4 -4
  56. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
  57. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +19 -31
  58. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  59. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +7 -10
  60. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  61. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +11 -5
  62. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
  63. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +11 -4
  64. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
  65. package/lib/commonjs/ui/stores/authStore.js +12 -0
  66. package/lib/commonjs/ui/stores/authStore.js.map +1 -1
  67. package/lib/commonjs/ui/styles/authStyles.js +337 -0
  68. package/lib/commonjs/ui/styles/authStyles.js.map +1 -0
  69. package/lib/commonjs/ui/styles/index.js +11 -0
  70. package/lib/commonjs/ui/styles/index.js.map +1 -1
  71. package/lib/module/core/index.js +177 -41
  72. package/lib/module/core/index.js.map +1 -1
  73. package/lib/module/index.js +26 -4
  74. package/lib/module/index.js.map +1 -1
  75. package/lib/module/node/createAuth.js +584 -7
  76. package/lib/module/node/createAuth.js.map +1 -1
  77. package/lib/module/node/index.js +7 -1
  78. package/lib/module/node/index.js.map +1 -1
  79. package/lib/module/ui/components/Avatar.js +15 -6
  80. package/lib/module/ui/components/Avatar.js.map +1 -1
  81. package/lib/module/ui/components/GroupedItem.js +59 -14
  82. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  83. package/lib/module/ui/components/GroupedSection.js +7 -1
  84. package/lib/module/ui/components/GroupedSection.js.map +1 -1
  85. package/lib/module/ui/components/Header.js +317 -0
  86. package/lib/module/ui/components/Header.js.map +1 -0
  87. package/lib/module/ui/components/OxyProvider.js +25 -9
  88. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  89. package/lib/module/ui/components/index.js +1 -0
  90. package/lib/module/ui/components/index.js.map +1 -1
  91. package/lib/module/ui/components/internal/GroupedPillButtons.js +1 -1
  92. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  93. package/lib/module/ui/components/internal/TextField.js +607 -547
  94. package/lib/module/ui/components/internal/TextField.js.map +1 -1
  95. package/lib/module/ui/components/internal/TextField.md +436 -0
  96. package/lib/module/ui/context/OxyContext.js +121 -77
  97. package/lib/module/ui/context/OxyContext.js.map +1 -1
  98. package/lib/module/ui/hooks/useSessionSocket.js +5 -2
  99. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
  100. package/lib/module/ui/navigation/OxyRouter.js +1 -1
  101. package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
  102. package/lib/module/ui/screens/AccountCenterScreen.js +6 -6
  103. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  104. package/lib/module/ui/screens/AccountManagementDemo.js +3 -3
  105. package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
  106. package/lib/module/ui/screens/AccountOverviewScreen.js +242 -597
  107. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  108. package/lib/module/ui/screens/AccountSettingsScreen.js +1152 -407
  109. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  110. package/lib/module/ui/screens/AccountSwitcherScreen.js +135 -237
  111. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  112. package/lib/module/ui/screens/AppInfoScreen.js +248 -465
  113. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  114. package/lib/module/ui/screens/FeedbackScreen.js +3 -3
  115. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  116. package/lib/module/ui/screens/PaymentGatewayScreen.js +809 -651
  117. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  118. package/lib/module/ui/screens/RecoverAccountScreen.js +53 -74
  119. package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -1
  120. package/lib/module/ui/screens/SessionManagementScreen.js +11 -29
  121. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  122. package/lib/module/ui/screens/SignInScreen.js +32 -305
  123. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  124. package/lib/module/ui/screens/SignUpScreen.js +5 -5
  125. package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
  126. package/lib/module/ui/screens/internal/SignInPasswordStep.js +19 -31
  127. package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -1
  128. package/lib/module/ui/screens/internal/SignInUsernameStep.js +7 -10
  129. package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
  130. package/lib/module/ui/screens/internal/SignUpIdentityStep.js +11 -5
  131. package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -1
  132. package/lib/module/ui/screens/internal/SignUpSecurityStep.js +11 -4
  133. package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -1
  134. package/lib/module/ui/stores/authStore.js +12 -0
  135. package/lib/module/ui/stores/authStore.js.map +1 -1
  136. package/lib/module/ui/styles/authStyles.js +332 -0
  137. package/lib/module/ui/styles/authStyles.js.map +1 -0
  138. package/lib/module/ui/styles/index.js +1 -0
  139. package/lib/module/ui/styles/index.js.map +1 -1
  140. package/lib/typescript/core/index.d.ts +68 -24
  141. package/lib/typescript/core/index.d.ts.map +1 -1
  142. package/lib/typescript/index.d.ts +13 -3
  143. package/lib/typescript/index.d.ts.map +1 -1
  144. package/lib/typescript/node/createAuth.d.ts +112 -0
  145. package/lib/typescript/node/createAuth.d.ts.map +1 -1
  146. package/lib/typescript/node/index.d.ts +2 -0
  147. package/lib/typescript/node/index.d.ts.map +1 -1
  148. package/lib/typescript/ui/components/Avatar.d.ts.map +1 -1
  149. package/lib/typescript/ui/components/GroupedItem.d.ts +6 -0
  150. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
  151. package/lib/typescript/ui/components/GroupedSection.d.ts +6 -0
  152. package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -1
  153. package/lib/typescript/ui/components/Header.d.ts +22 -0
  154. package/lib/typescript/ui/components/Header.d.ts.map +1 -0
  155. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  156. package/lib/typescript/ui/components/index.d.ts +1 -0
  157. package/lib/typescript/ui/components/index.d.ts.map +1 -1
  158. package/lib/typescript/ui/components/internal/TextField.d.ts +31 -16
  159. package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
  160. package/lib/typescript/ui/context/OxyContext.d.ts +5 -2
  161. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  162. package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
  163. package/lib/typescript/ui/navigation/types.d.ts +9 -2
  164. package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
  165. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  166. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  167. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  168. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
  169. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  170. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +5 -1
  171. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -1
  172. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  173. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  174. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +1 -1
  175. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -1
  176. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +0 -1
  177. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -1
  178. package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -1
  179. package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -1
  180. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
  181. package/lib/typescript/ui/styles/authStyles.d.ts +326 -0
  182. package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -0
  183. package/lib/typescript/ui/styles/index.d.ts +1 -0
  184. package/lib/typescript/ui/styles/index.d.ts.map +1 -1
  185. package/package.json +1 -4
  186. package/src/core/index.ts +195 -41
  187. package/src/index.ts +72 -4
  188. package/src/node/createAuth.ts +623 -7
  189. package/src/node/index.ts +19 -1
  190. package/src/ui/components/Avatar.tsx +11 -5
  191. package/src/ui/components/GroupedItem.tsx +57 -9
  192. package/src/ui/components/GroupedSection.tsx +12 -0
  193. package/src/ui/components/Header.tsx +364 -0
  194. package/src/ui/components/OxyProvider.tsx +31 -15
  195. package/src/ui/components/index.ts +1 -0
  196. package/src/ui/components/internal/GroupedPillButtons.tsx +1 -1
  197. package/src/ui/components/internal/TextField.md +436 -0
  198. package/src/ui/components/internal/TextField.tsx +720 -620
  199. package/src/ui/context/OxyContext.tsx +150 -63
  200. package/src/ui/hooks/useSessionSocket.ts +5 -2
  201. package/src/ui/navigation/OxyRouter.tsx +1 -1
  202. package/src/ui/navigation/types.ts +10 -2
  203. package/src/ui/screens/AccountCenterScreen.tsx +5 -5
  204. package/src/ui/screens/AccountManagementDemo.tsx +9 -9
  205. package/src/ui/screens/AccountOverviewScreen.tsx +265 -414
  206. package/src/ui/screens/AccountSettingsScreen.tsx +1165 -403
  207. package/src/ui/screens/AccountSwitcherScreen.tsx +158 -202
  208. package/src/ui/screens/AppInfoScreen.tsx +270 -497
  209. package/src/ui/screens/FeedbackScreen.tsx +3 -3
  210. package/src/ui/screens/PaymentGatewayScreen.tsx +668 -365
  211. package/src/ui/screens/ProfileScreen.tsx +5 -5
  212. package/src/ui/screens/RecoverAccountScreen.tsx +46 -74
  213. package/src/ui/screens/SessionManagementScreen.tsx +14 -22
  214. package/src/ui/screens/SignInScreen.tsx +27 -294
  215. package/src/ui/screens/SignUpScreen.tsx +5 -5
  216. package/src/ui/screens/internal/SignInPasswordStep.tsx +11 -22
  217. package/src/ui/screens/internal/SignInUsernameStep.tsx +3 -10
  218. package/src/ui/screens/internal/SignUpIdentityStep.tsx +2 -5
  219. package/src/ui/screens/internal/SignUpSecurityStep.tsx +3 -4
  220. package/src/ui/stores/authStore.ts +12 -0
  221. package/src/ui/styles/authStyles.ts +352 -0
  222. package/src/ui/styles/index.ts +1 -0
  223. package/lib/commonjs/core/auth-manager.js +0 -440
  224. package/lib/commonjs/core/auth-manager.js.map +0 -1
  225. package/lib/commonjs/core/use-auth.js +0 -244
  226. package/lib/commonjs/core/use-auth.js.map +0 -1
  227. package/lib/module/core/auth-manager.js +0 -432
  228. package/lib/module/core/auth-manager.js.map +0 -1
  229. package/lib/module/core/use-auth.js +0 -235
  230. package/lib/module/core/use-auth.js.map +0 -1
  231. package/lib/typescript/core/auth-manager.d.ts +0 -136
  232. package/lib/typescript/core/auth-manager.d.ts.map +0 -1
  233. package/lib/typescript/core/use-auth.d.ts +0 -79
  234. package/lib/typescript/core/use-auth.d.ts.map +0 -1
  235. package/src/__tests__/middleware.test.ts +0 -105
  236. package/src/__tests__/setup.ts +0 -10
  237. package/src/__tests__/zero-config-auth.test.ts +0 -607
  238. package/src/core/auth-manager.ts +0 -500
  239. package/src/core/use-auth.tsx +0 -245
@@ -0,0 +1,326 @@
1
+ export interface AuthThemeColors {
2
+ text: string;
3
+ background: string;
4
+ inputBackground: string;
5
+ placeholder: string;
6
+ primary: string;
7
+ border: string;
8
+ error: string;
9
+ success: string;
10
+ warning: string;
11
+ secondaryText: string;
12
+ }
13
+ export declare const createAuthStyles: (colors: AuthThemeColors, theme: string) => {
14
+ container: {
15
+ flex: number;
16
+ };
17
+ scrollContent: {
18
+ flexGrow: number;
19
+ paddingHorizontal: number;
20
+ paddingTop: number;
21
+ paddingBottom: number;
22
+ };
23
+ stepContainer: {
24
+ flex: number;
25
+ justifyContent: "flex-start";
26
+ alignItems: "flex-start";
27
+ };
28
+ modernHeader: {
29
+ alignItems: "flex-start";
30
+ width: "100%";
31
+ marginBottom: number;
32
+ };
33
+ modernTitle: {
34
+ fontFamily: string;
35
+ fontWeight: "bold" | undefined;
36
+ fontSize: number;
37
+ lineHeight: number;
38
+ marginBottom: number;
39
+ textAlign: "left";
40
+ letterSpacing: number;
41
+ };
42
+ modernSubtitle: {
43
+ fontSize: number;
44
+ lineHeight: number;
45
+ textAlign: "left";
46
+ opacity: number;
47
+ };
48
+ welcomeTitle: {
49
+ fontFamily: string;
50
+ fontWeight: "bold" | undefined;
51
+ fontSize: number;
52
+ lineHeight: number;
53
+ marginBottom: number;
54
+ textAlign: "left";
55
+ letterSpacing: number;
56
+ };
57
+ stepTitle: {
58
+ fontFamily: string;
59
+ fontWeight: "bold" | undefined;
60
+ fontSize: number;
61
+ lineHeight: number;
62
+ marginBottom: number;
63
+ textAlign: "left";
64
+ letterSpacing: number;
65
+ };
66
+ modernInfoCard: {
67
+ flexDirection: "row";
68
+ alignItems: "center";
69
+ padding: number;
70
+ borderRadius: number;
71
+ marginBottom: number;
72
+ gap: number;
73
+ width: "100%";
74
+ };
75
+ modernInfoText: {
76
+ fontSize: number;
77
+ flex: number;
78
+ };
79
+ modernErrorCard: {
80
+ flexDirection: "row";
81
+ alignItems: "center";
82
+ padding: number;
83
+ borderRadius: number;
84
+ marginBottom: number;
85
+ gap: number;
86
+ width: "100%";
87
+ };
88
+ errorText: {
89
+ fontSize: number;
90
+ fontWeight: "500";
91
+ flex: number;
92
+ };
93
+ modernInputContainer: {
94
+ width: "100%";
95
+ marginBottom: number;
96
+ };
97
+ inputWrapper: {
98
+ flexDirection: "row";
99
+ alignItems: "center";
100
+ height: number;
101
+ borderRadius: number;
102
+ paddingHorizontal: number;
103
+ borderWidth: number;
104
+ backgroundColor: string;
105
+ };
106
+ premiumInputWrapper: {
107
+ flexDirection: "row";
108
+ alignItems: "center";
109
+ height: number;
110
+ borderRadius: number;
111
+ paddingHorizontal: number;
112
+ borderWidth: number;
113
+ backgroundColor: string;
114
+ };
115
+ inputIcon: {
116
+ marginRight: number;
117
+ };
118
+ inputContent: {
119
+ flex: number;
120
+ };
121
+ modernInput: {
122
+ flex: number;
123
+ fontSize: number;
124
+ height: "100%";
125
+ };
126
+ passwordToggle: {
127
+ padding: number;
128
+ };
129
+ validationIndicator: {
130
+ marginLeft: number;
131
+ };
132
+ validationSuccessCard: {
133
+ flexDirection: "row";
134
+ alignItems: "center";
135
+ padding: number;
136
+ borderRadius: number;
137
+ marginTop: number;
138
+ gap: number;
139
+ };
140
+ validationErrorCard: {
141
+ flexDirection: "row";
142
+ alignItems: "center";
143
+ padding: number;
144
+ borderRadius: number;
145
+ marginTop: number;
146
+ gap: number;
147
+ };
148
+ validationCard: {
149
+ flexDirection: "row";
150
+ alignItems: "center";
151
+ padding: number;
152
+ borderRadius: number;
153
+ marginTop: number;
154
+ gap: number;
155
+ };
156
+ validationText: {
157
+ fontSize: number;
158
+ fontWeight: "500";
159
+ };
160
+ belowInputMessage: {
161
+ flexDirection: "row";
162
+ alignItems: "center";
163
+ marginTop: number;
164
+ marginBottom: number;
165
+ gap: number;
166
+ };
167
+ belowInputText: {
168
+ fontSize: number;
169
+ fontWeight: "500";
170
+ };
171
+ modernButton: {
172
+ flexDirection: "row";
173
+ alignItems: "center";
174
+ justifyContent: "center";
175
+ paddingVertical: number;
176
+ paddingHorizontal: number;
177
+ borderRadius: number;
178
+ marginVertical: number;
179
+ shadowOffset: {
180
+ width: number;
181
+ height: number;
182
+ };
183
+ shadowOpacity: number;
184
+ shadowRadius: number;
185
+ elevation: number;
186
+ gap: number;
187
+ width: "100%";
188
+ };
189
+ modernButtonText: {
190
+ color: string;
191
+ fontSize: number;
192
+ fontWeight: "600";
193
+ letterSpacing: number;
194
+ };
195
+ buttonIcon: {
196
+ marginLeft: number;
197
+ };
198
+ modernLabel: {
199
+ fontSize: number;
200
+ fontWeight: "500";
201
+ marginBottom: number;
202
+ };
203
+ modernLinkText: {
204
+ fontSize: number;
205
+ lineHeight: number;
206
+ fontWeight: "600";
207
+ textDecorationLine: "underline";
208
+ };
209
+ footerTextContainer: {
210
+ flexDirection: "row";
211
+ justifyContent: "center";
212
+ marginTop: number;
213
+ };
214
+ footerText: {
215
+ fontSize: number;
216
+ };
217
+ modernUserProfileContainer: {
218
+ alignItems: "flex-start";
219
+ paddingVertical: number;
220
+ };
221
+ avatarContainer: {
222
+ position: "relative";
223
+ marginBottom: number;
224
+ };
225
+ modernUserAvatar: {
226
+ borderWidth: number;
227
+ borderColor: string;
228
+ };
229
+ statusIndicator: {
230
+ position: "absolute";
231
+ bottom: number;
232
+ right: number;
233
+ width: number;
234
+ height: number;
235
+ borderRadius: number;
236
+ borderWidth: number;
237
+ borderColor: string;
238
+ };
239
+ modernUserDisplayName: {
240
+ fontFamily: string;
241
+ fontWeight: "bold" | undefined;
242
+ fontSize: number;
243
+ marginBottom: number;
244
+ textAlign: "center";
245
+ letterSpacing: number;
246
+ };
247
+ modernUsernameSubtext: {
248
+ fontSize: number;
249
+ textAlign: "left";
250
+ marginBottom: number;
251
+ opacity: number;
252
+ };
253
+ welcomeBackBadge: {
254
+ flexDirection: "row";
255
+ alignItems: "center";
256
+ paddingHorizontal: number;
257
+ paddingVertical: number;
258
+ borderRadius: number;
259
+ gap: number;
260
+ };
261
+ welcomeBackText: {
262
+ fontSize: number;
263
+ fontWeight: "600";
264
+ textTransform: "uppercase";
265
+ letterSpacing: number;
266
+ };
267
+ modernNavigationButtons: {
268
+ flexDirection: "row";
269
+ justifyContent: "center";
270
+ marginTop: number;
271
+ marginBottom: number;
272
+ width: "100%";
273
+ gap: number;
274
+ };
275
+ modernBackButton: {
276
+ flexDirection: "row";
277
+ alignItems: "center";
278
+ paddingVertical: number;
279
+ paddingHorizontal: number;
280
+ borderRadius: number;
281
+ borderWidth: number;
282
+ gap: number;
283
+ };
284
+ modernBackButtonText: {
285
+ fontSize: number;
286
+ fontWeight: "500";
287
+ };
288
+ securityNotice: {
289
+ flexDirection: "row";
290
+ alignItems: "center";
291
+ justifyContent: "center";
292
+ marginTop: number;
293
+ gap: number;
294
+ };
295
+ securityText: {
296
+ fontSize: number;
297
+ fontWeight: "500";
298
+ };
299
+ welcomeImageContainer: {
300
+ alignItems: "center";
301
+ justifyContent: "center";
302
+ marginVertical: number;
303
+ };
304
+ welcomeText: {
305
+ fontSize: number;
306
+ lineHeight: number;
307
+ textAlign: "left";
308
+ opacity: number;
309
+ marginBottom: number;
310
+ };
311
+ successCard: {
312
+ flexDirection: "row";
313
+ alignItems: "center";
314
+ padding: number;
315
+ borderRadius: number;
316
+ marginBottom: number;
317
+ gap: number;
318
+ width: "100%";
319
+ };
320
+ successText: {
321
+ fontSize: number;
322
+ fontWeight: "500";
323
+ flex: number;
324
+ };
325
+ };
326
+ //# sourceMappingURL=authStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authStyles.d.ts","sourceRoot":"","sources":["../../../../src/ui/styles/authStyles.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,gBAAgB,GAAI,QAAQ,eAAe,EAAE,OAAO,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+UrE,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from './fonts';
2
2
  export * from './theme';
3
+ export * from './authStyles';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/styles/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/services",
3
- "version": "5.7.5",
3
+ "version": "5.8.1",
4
4
  "description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -59,9 +59,6 @@
59
59
  "typescript": "tsc --skipLibCheck --noEmit",
60
60
  "lint": "biome lint --error-on-warnings ./src",
61
61
  "build": "bob build && yarn copy-assets && yarn copy-dts && yarn delete-dts.js && yarn delete-debug-view",
62
- "test": "jest",
63
- "test:watch": "jest --watch",
64
- "test:coverage": "jest --coverage",
65
62
  "copy-assets": "copyfiles -u 1 \"src/assets/**/*\" lib/commonjs/assets && copyfiles -u 1 \"src/assets/**/*\" lib/module/assets",
66
63
  "copy-dts": "copyfiles -u 1 \"src/**/*.d.ts\" lib/typescript",
67
64
  "delete-debug-view": "rm -rf ./lib/commonjs/components/bottomSheetDebugView ./lib/module/components/bottomSheetDebugView ./lib/typescript/components/bottomSheetDebugView || true",
package/src/core/index.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, InternalAxiosRequestConfig } from 'axios';
2
2
  import { jwtDecode } from 'jwt-decode';
3
3
 
4
- // Zero-Config Authentication Exports
5
- export { AuthenticationManager, initializeAuth, getAuthManager } from './auth-manager';
6
- export { AuthProvider, useAuth, useOxyClient, useAuthStatus, useCurrentUser, withAuth } from './use-auth';
7
-
8
4
  // Remove all FormData, form-data, and polyfill logic. Delete uploadFile and uploadFiles methods. Add a comment to use the new raw upload approach instead.
9
5
 
10
6
  import {
@@ -44,7 +40,6 @@ import {
44
40
 
45
41
  // Import secure session types
46
42
  import { SecureLoginResponse, SecureClientSession } from '../models/secureSession';
47
- import { AuthenticationManager, initializeAuth } from './auth-manager';
48
43
 
49
44
  /**
50
45
  * Default cloud URL for Oxy services, cloud is where the user files are. (e.g. images, videos, etc.). Not the API.
@@ -64,23 +59,7 @@ interface JwtPayload {
64
59
  /**
65
60
  * OxyServices - Client library for interacting with the Oxy API
66
61
  *
67
- * ZERO-CONFIG MODE:
68
- * Use the new AuthProvider and useAuth hooks for automatic authentication management:
69
- *
70
- * import { AuthProvider, useAuth } from '@oxyhq/services';
71
- *
72
- * <AuthProvider baseURL="https://api.oxy.so">
73
- * <App />
74
- * </AuthProvider>
75
- *
76
- * Then in components:
77
- * const { login, user, isAuthenticated } = useAuth();
78
- *
79
- * LEGACY MODE:
80
- * The OxyServices class below is maintained for backward compatibility
81
- * but we recommend migrating to the new zero-config approach.
82
- *
83
- * Note: For authentication status in UI components, use `isAuthenticated` from useAuth() context
62
+ * Note: For authentication status in UI components, use `isAuthenticated` from useOxy() context
84
63
  * instead of checking token status directly on this service.
85
64
  */
86
65
  export class OxyServices {
@@ -88,31 +67,17 @@ export class OxyServices {
88
67
  private accessToken: string | null = null;
89
68
  private refreshToken: string | null = null;
90
69
  private refreshPromise: Promise<{ accessToken: string; refreshToken: string }> | null = null;
91
- private authManager: AuthenticationManager | null = null;
92
70
 
93
71
  /**
94
72
  * Creates a new instance of the OxyServices client
95
73
  * @param config - Configuration for the client
96
74
  */
97
75
  constructor(config: OxyConfig) {
98
- // Try to use the new auth manager if available, otherwise fall back to legacy mode
99
- try {
100
- this.authManager = initializeAuth(config.baseURL);
101
- this.client = this.authManager.getClient();
102
- } catch {
103
- // Fall back to legacy implementation
104
- this.client = axios.create({
105
- baseURL: config.baseURL,
106
- timeout: 10000 // 10 second timeout
107
- });
108
- this.setupLegacyInterceptors();
109
- }
110
- }
111
-
112
- /**
113
- * Setup legacy interceptors (only used if auth manager is not available)
114
- */
115
- private setupLegacyInterceptors(): void {
76
+ this.client = axios.create({
77
+ baseURL: config.baseURL,
78
+ timeout: 10000 // 10 second timeout
79
+ });
80
+
116
81
  // Interceptor for adding auth header and handling token refresh
117
82
  this.client.interceptors.request.use(async (req: InternalAxiosRequestConfig) => {
118
83
  if (!this.accessToken) {
@@ -529,9 +494,17 @@ export class OxyServices {
529
494
  */
530
495
  async getCurrentUser(): Promise<User> {
531
496
  try {
497
+ console.log('OxyServices: Fetching current user...');
532
498
  const res = await this.client.get('/users/me');
499
+ console.log('OxyServices: Current user response:', {
500
+ hasUser: !!res.data,
501
+ userLinksMetadata: res.data?.linksMetadata,
502
+ userLinks: res.data?.links,
503
+ userWebsite: res.data?.website
504
+ });
533
505
  return res.data;
534
506
  } catch (error) {
507
+ console.error('OxyServices: Error fetching current user:', error);
535
508
  throw this.handleError(error);
536
509
  }
537
510
  }
@@ -543,9 +516,12 @@ export class OxyServices {
543
516
  */
544
517
  async updateProfile(updates: Record<string, any>): Promise<User> {
545
518
  try {
519
+ console.log('OxyServices: Updating profile with:', updates);
546
520
  const res = await this.client.put('/users/me', updates);
521
+ console.log('OxyServices: Profile update response:', res.data);
547
522
  return res.data;
548
523
  } catch (error) {
524
+ console.error('OxyServices: Error updating profile:', error);
549
525
  throw this.handleError(error);
550
526
  }
551
527
  }
@@ -1263,10 +1239,13 @@ export class OxyServices {
1263
1239
  * @returns Array of user sessions
1264
1240
  */
1265
1241
  async getSessionsBySessionId(sessionId: string): Promise<any[]> {
1242
+ console.log('getSessionsBySessionId called with sessionId:', sessionId);
1266
1243
  try {
1267
1244
  const res = await this.client.get(`/secure-session/sessions/${sessionId}`);
1245
+ console.log('getSessionsBySessionId response:', res.data);
1268
1246
  return res.data.sessions;
1269
1247
  } catch (error) {
1248
+ console.error('getSessionsBySessionId error:', error);
1270
1249
  throw this.handleError(error);
1271
1250
  }
1272
1251
  }
@@ -1746,6 +1725,181 @@ export class OxyServices {
1746
1725
  throw this.handleError(error);
1747
1726
  }
1748
1727
  }
1728
+
1729
+ /**
1730
+ * Fetch metadata for a URL (title, description, image)
1731
+ * @param url - The URL to fetch metadata for
1732
+ * @returns Promise with metadata object
1733
+ */
1734
+ async fetchLinkMetadata(url: string): Promise<{
1735
+ url: string;
1736
+ title: string;
1737
+ description: string;
1738
+ image?: string;
1739
+ }> {
1740
+ try {
1741
+ const response = await this.client.post('/link-metadata/fetch-metadata', { url });
1742
+ return response.data;
1743
+ } catch (error) {
1744
+ throw this.handleError(error);
1745
+ }
1746
+ }
1747
+
1748
+ /**
1749
+ * Search for locations using the enhanced location search API
1750
+ * @param query - Search query string
1751
+ * @param limit - Maximum number of results (default: 5)
1752
+ * @param countrycodes - Optional country codes filter (e.g., "us,ca")
1753
+ * @returns Promise with array of location results
1754
+ */
1755
+ async searchLocations(query: string, limit: number = 5, countrycodes?: string): Promise<any[]> {
1756
+ try {
1757
+ const params = new URLSearchParams({
1758
+ query,
1759
+ limit: limit.toString()
1760
+ });
1761
+ if (countrycodes) {
1762
+ params.append('countrycodes', countrycodes);
1763
+ }
1764
+ const res = await this.client.get(`/location-search/search?${params.toString()}`);
1765
+ return res.data.results;
1766
+ } catch (error) {
1767
+ throw this.handleError(error);
1768
+ }
1769
+ }
1770
+
1771
+ /**
1772
+ * Get detailed information about a specific location by coordinates
1773
+ * @param lat - Latitude
1774
+ * @param lon - Longitude
1775
+ * @returns Promise with detailed location information
1776
+ */
1777
+ async getLocationDetails(lat: number, lon: number): Promise<any> {
1778
+ try {
1779
+ const res = await this.client.get(`/location-search/details?lat=${lat}&lon=${lon}`);
1780
+ return res.data.result;
1781
+ } catch (error) {
1782
+ throw this.handleError(error);
1783
+ }
1784
+ }
1785
+
1786
+ /**
1787
+ * Find locations near a point using geospatial queries
1788
+ * @param lat - Latitude
1789
+ * @param lon - Longitude
1790
+ * @param maxDistance - Maximum distance in meters (default: 10000)
1791
+ * @param limit - Maximum number of results (default: 10)
1792
+ * @param skip - Number of results to skip (default: 0)
1793
+ * @returns Promise with nearby locations
1794
+ */
1795
+ async findLocationsNear(
1796
+ lat: number,
1797
+ lon: number,
1798
+ maxDistance: number = 10000,
1799
+ limit: number = 10,
1800
+ skip: number = 0
1801
+ ): Promise<any> {
1802
+ try {
1803
+ const params = new URLSearchParams({
1804
+ lat: lat.toString(),
1805
+ lon: lon.toString(),
1806
+ maxDistance: maxDistance.toString(),
1807
+ limit: limit.toString(),
1808
+ skip: skip.toString()
1809
+ });
1810
+ const res = await this.client.get(`/location-search/near?${params.toString()}`);
1811
+ return res.data;
1812
+ } catch (error) {
1813
+ throw this.handleError(error);
1814
+ }
1815
+ }
1816
+
1817
+ /**
1818
+ * Search locations in database by text
1819
+ * @param query - Search query
1820
+ * @param limit - Maximum number of results (default: 10)
1821
+ * @param skip - Number of results to skip (default: 0)
1822
+ * @param type - Filter by location type
1823
+ * @param country - Filter by country
1824
+ * @param city - Filter by city
1825
+ * @returns Promise with search results
1826
+ */
1827
+ async searchLocationsInDB(
1828
+ query: string,
1829
+ limit: number = 10,
1830
+ skip: number = 0,
1831
+ type?: string,
1832
+ country?: string,
1833
+ city?: string
1834
+ ): Promise<any> {
1835
+ try {
1836
+ const params = new URLSearchParams({
1837
+ query,
1838
+ limit: limit.toString(),
1839
+ skip: skip.toString()
1840
+ });
1841
+ if (type) params.append('type', type);
1842
+ if (country) params.append('country', country);
1843
+ if (city) params.append('city', city);
1844
+
1845
+ const res = await this.client.get(`/location-search/db-search?${params.toString()}`);
1846
+ return res.data;
1847
+ } catch (error) {
1848
+ throw this.handleError(error);
1849
+ }
1850
+ }
1851
+
1852
+ /**
1853
+ * Get location statistics
1854
+ * @returns Promise with location statistics
1855
+ */
1856
+ async getLocationStats(): Promise<any> {
1857
+ try {
1858
+ const res = await this.client.get('/location-search/stats');
1859
+ return res.data.stats;
1860
+ } catch (error) {
1861
+ throw this.handleError(error);
1862
+ }
1863
+ }
1864
+
1865
+ /**
1866
+ * Get cache statistics
1867
+ * @returns Promise with cache statistics
1868
+ */
1869
+ async getLocationCacheStats(): Promise<any> {
1870
+ try {
1871
+ const res = await this.client.get('/location-search/cache/stats');
1872
+ return res.data.stats;
1873
+ } catch (error) {
1874
+ throw this.handleError(error);
1875
+ }
1876
+ }
1877
+
1878
+ /**
1879
+ * Clear location cache
1880
+ * @returns Promise with success status
1881
+ */
1882
+ async clearLocationCache(): Promise<any> {
1883
+ try {
1884
+ const res = await this.client.delete('/location-search/cache');
1885
+ return res.data;
1886
+ } catch (error) {
1887
+ throw this.handleError(error);
1888
+ }
1889
+ }
1890
+
1891
+ /**
1892
+ * Get performance statistics
1893
+ * @returns Promise with performance statistics
1894
+ */
1895
+ async getLocationPerformanceStats(): Promise<any> {
1896
+ try {
1897
+ const res = await this.client.get('/location-search/performance');
1898
+ return res.data;
1899
+ } catch (error) {
1900
+ throw this.handleError(error);
1901
+ }
1902
+ }
1749
1903
  }
1750
1904
 
1751
1905
  // Default export for backward compatibility