@oxyhq/services 5.26.3 → 5.27.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 (263) hide show
  1. package/dist/web/oxy-services.esm.js +2 -0
  2. package/dist/web/oxy-services.esm.js.map +1 -0
  3. package/dist/web/types/assets/icons/OxyServices.d.ts +28 -0
  4. package/dist/web/types/assets/illustrations/HighFive.d.ts +8 -0
  5. package/dist/web/types/constants/version.d.ts +13 -0
  6. package/dist/web/types/core/AuthManager.d.ts +143 -0
  7. package/dist/web/types/core/CrossDomainAuth.d.ts +160 -0
  8. package/dist/web/types/core/HttpService.d.ts +163 -0
  9. package/dist/web/types/core/OxyServices.base.d.ts +126 -0
  10. package/dist/web/types/core/OxyServices.d.ts +81 -0
  11. package/dist/web/types/core/OxyServices.errors.d.ts +11 -0
  12. package/dist/web/types/core/index.d.ts +20 -0
  13. package/dist/web/types/core/mixins/OxyServices.analytics.d.ts +66 -0
  14. package/dist/web/types/core/mixins/OxyServices.assets.d.ts +135 -0
  15. package/dist/web/types/core/mixins/OxyServices.auth.d.ts +186 -0
  16. package/dist/web/types/core/mixins/OxyServices.developer.d.ts +99 -0
  17. package/dist/web/types/core/mixins/OxyServices.devices.d.ts +96 -0
  18. package/dist/web/types/core/mixins/OxyServices.features.d.ts +228 -0
  19. package/dist/web/types/core/mixins/OxyServices.fedcm.d.ts +200 -0
  20. package/dist/web/types/core/mixins/OxyServices.karma.d.ts +85 -0
  21. package/dist/web/types/core/mixins/OxyServices.language.d.ts +81 -0
  22. package/dist/web/types/core/mixins/OxyServices.location.d.ts +64 -0
  23. package/dist/web/types/core/mixins/OxyServices.payment.d.ts +111 -0
  24. package/dist/web/types/core/mixins/OxyServices.popup.d.ts +205 -0
  25. package/dist/web/types/core/mixins/OxyServices.privacy.d.ts +122 -0
  26. package/dist/web/types/core/mixins/OxyServices.redirect.d.ts +245 -0
  27. package/dist/web/types/core/mixins/OxyServices.security.d.ts +78 -0
  28. package/dist/web/types/core/mixins/OxyServices.user.d.ts +184 -0
  29. package/dist/web/types/core/mixins/OxyServices.utility.d.ts +93 -0
  30. package/dist/web/types/core/mixins/index.d.ts +30 -0
  31. package/dist/web/types/core/mixins/mixinHelpers.d.ts +31 -0
  32. package/dist/web/types/crypto/index.d.ts +11 -0
  33. package/dist/web/types/crypto/keyManager.d.ts +189 -0
  34. package/dist/web/types/crypto/polyfill.d.ts +12 -0
  35. package/dist/web/types/crypto/recoveryPhrase.d.ts +58 -0
  36. package/dist/web/types/crypto/signatureService.d.ts +86 -0
  37. package/dist/web/types/i18n/index.d.ts +3 -0
  38. package/dist/web/types/index.d.ts +62 -0
  39. package/dist/web/types/lib/sonner-safe.d.ts +8 -0
  40. package/dist/web/types/lib/sonner.d.ts +11 -0
  41. package/dist/web/types/lib/sonner.web.d.ts +14 -0
  42. package/dist/web/types/models/interfaces.d.ts +415 -0
  43. package/dist/web/types/models/session.d.ts +27 -0
  44. package/dist/web/types/node/index.d.ts +9 -0
  45. package/dist/web/types/shared/index.d.ts +28 -0
  46. package/dist/web/types/shared/utils/colorUtils.d.ts +104 -0
  47. package/dist/web/types/shared/utils/debugUtils.d.ts +48 -0
  48. package/dist/web/types/shared/utils/errorUtils.d.ts +97 -0
  49. package/dist/web/types/shared/utils/index.d.ts +13 -0
  50. package/dist/web/types/shared/utils/networkUtils.d.ts +139 -0
  51. package/dist/web/types/shared/utils/themeUtils.d.ts +90 -0
  52. package/dist/web/types/ui/client.d.ts +33 -0
  53. package/dist/web/types/ui/components/ActivityIndicator.d.ts +44 -0
  54. package/dist/web/types/ui/components/AnimationExample.d.ts +3 -0
  55. package/dist/web/types/ui/components/AutoHeightScrollView.d.ts +22 -0
  56. package/dist/web/types/ui/components/Avatar.d.ts +60 -0
  57. package/dist/web/types/ui/components/BottomSheet.d.ts +28 -0
  58. package/dist/web/types/ui/components/BottomSheetRouter.d.ts +8 -0
  59. package/dist/web/types/ui/components/CrossFadeIcon.d.ts +26 -0
  60. package/dist/web/types/ui/components/EmptyState.d.ts +7 -0
  61. package/dist/web/types/ui/components/ErrorBoundary.d.ts +30 -0
  62. package/dist/web/types/ui/components/FollowButton.d.ts +17 -0
  63. package/dist/web/types/ui/components/FontLoader.d.ts +14 -0
  64. package/dist/web/types/ui/components/GroupedItem.d.ts +23 -0
  65. package/dist/web/types/ui/components/GroupedSection.d.ts +24 -0
  66. package/dist/web/types/ui/components/Header.d.ts +37 -0
  67. package/dist/web/types/ui/components/HelperText.d.ts +46 -0
  68. package/dist/web/types/ui/components/Icon.d.ts +59 -0
  69. package/dist/web/types/ui/components/IconButton/IconButton.d.ts +98 -0
  70. package/dist/web/types/ui/components/IconButton/utils.d.ts +18 -0
  71. package/dist/web/types/ui/components/LoadingState.d.ts +8 -0
  72. package/dist/web/types/ui/components/OxyLogo.d.ts +28 -0
  73. package/dist/web/types/ui/components/OxyPayButton.d.ts +28 -0
  74. package/dist/web/types/ui/components/OxyProvider.d.ts +33 -0
  75. package/dist/web/types/ui/components/OxySignInButton.d.ts +64 -0
  76. package/dist/web/types/ui/components/ProfileCard.d.ts +17 -0
  77. package/dist/web/types/ui/components/QuickActions.d.ts +14 -0
  78. package/dist/web/types/ui/components/Section.d.ts +11 -0
  79. package/dist/web/types/ui/components/SectionTitle.d.ts +9 -0
  80. package/dist/web/types/ui/components/SettingRow.d.ts +19 -0
  81. package/dist/web/types/ui/components/SignInModal.d.ts +17 -0
  82. package/dist/web/types/ui/components/StepBasedScreen.d.ts +25 -0
  83. package/dist/web/types/ui/components/Surface.d.ts +75 -0
  84. package/dist/web/types/ui/components/TextField/Addons/Outline.d.ts +15 -0
  85. package/dist/web/types/ui/components/TextField/Addons/Underline.d.ts +18 -0
  86. package/dist/web/types/ui/components/TextField/Adornment/TextFieldAdornment.d.ts +44 -0
  87. package/dist/web/types/ui/components/TextField/Adornment/TextFieldAffix.d.ts +72 -0
  88. package/dist/web/types/ui/components/TextField/Adornment/TextFieldIcon.d.ts +77 -0
  89. package/dist/web/types/ui/components/TextField/Adornment/enums.d.ts +12 -0
  90. package/dist/web/types/ui/components/TextField/Adornment/types.d.ts +11 -0
  91. package/dist/web/types/ui/components/TextField/Adornment/utils.d.ts +11 -0
  92. package/dist/web/types/ui/components/TextField/Label/InputLabel.d.ts +4 -0
  93. package/dist/web/types/ui/components/TextField/Label/LabelBackground.d.ts +3 -0
  94. package/dist/web/types/ui/components/TextField/TextFieldFlat.d.ts +3 -0
  95. package/dist/web/types/ui/components/TextField/TextFieldOutlined.d.ts +3 -0
  96. package/dist/web/types/ui/components/TextField/constants.d.ts +31 -0
  97. package/dist/web/types/ui/components/TextField/helpers.d.ts +96 -0
  98. package/dist/web/types/ui/components/TextField/types.d.ts +155 -0
  99. package/dist/web/types/ui/components/TextField.d.ts +191 -0
  100. package/dist/web/types/ui/components/TouchableRipple/Pressable.d.ts +12 -0
  101. package/dist/web/types/ui/components/TouchableRipple/TouchableRipple.d.ts +61 -0
  102. package/dist/web/types/ui/components/TouchableRipple/utils.d.ts +10 -0
  103. package/dist/web/types/ui/components/Typography/AnimatedText.d.ts +34 -0
  104. package/dist/web/types/ui/components/Typography/types.d.ts +18 -0
  105. package/dist/web/types/ui/components/WebOxyProvider.d.ts +51 -0
  106. package/dist/web/types/ui/components/feedback/FormInput.d.ts +19 -0
  107. package/dist/web/types/ui/components/feedback/ProgressIndicator.d.ts +10 -0
  108. package/dist/web/types/ui/components/feedback/constants.d.ts +4 -0
  109. package/dist/web/types/ui/components/feedback/feedbackStyles.d.ts +279 -0
  110. package/dist/web/types/ui/components/feedback/index.d.ts +6 -0
  111. package/dist/web/types/ui/components/feedback/types.d.ts +45 -0
  112. package/dist/web/types/ui/components/feedback/useFeedbackForm.d.ts +8 -0
  113. package/dist/web/types/ui/components/fileManagement/AnimatedButton.d.ts +15 -0
  114. package/dist/web/types/ui/components/fileManagement/FileDetailsModal.d.ts +14 -0
  115. package/dist/web/types/ui/components/fileManagement/FileViewer.d.ts +17 -0
  116. package/dist/web/types/ui/components/fileManagement/UploadPreview.d.ts +20 -0
  117. package/dist/web/types/ui/components/fileManagement/styles.d.ts +859 -0
  118. package/dist/web/types/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
  119. package/dist/web/types/ui/components/icon/OxyIcon.d.ts +9 -0
  120. package/dist/web/types/ui/components/icon/index.d.ts +3 -0
  121. package/dist/web/types/ui/components/index.d.ts +16 -0
  122. package/dist/web/types/ui/components/internal/GroupedPillButtons.d.ts +17 -0
  123. package/dist/web/types/ui/components/internal/PinInput.d.ts +22 -0
  124. package/dist/web/types/ui/components/modals/DeleteAccountModal.d.ts +18 -0
  125. package/dist/web/types/ui/components/modals/index.d.ts +1 -0
  126. package/dist/web/types/ui/components/payment/PaymentDetailsStep.d.ts +20 -0
  127. package/dist/web/types/ui/components/payment/PaymentMethodStep.d.ts +13 -0
  128. package/dist/web/types/ui/components/payment/PaymentReviewStep.d.ts +15 -0
  129. package/dist/web/types/ui/components/payment/PaymentSuccessStep.d.ts +9 -0
  130. package/dist/web/types/ui/components/payment/PaymentSummaryStep.d.ts +14 -0
  131. package/dist/web/types/ui/components/payment/constants.d.ts +6 -0
  132. package/dist/web/types/ui/components/payment/index.d.ts +8 -0
  133. package/dist/web/types/ui/components/payment/paymentStyles.d.ts +395 -0
  134. package/dist/web/types/ui/components/payment/types.d.ts +39 -0
  135. package/dist/web/types/ui/components/photogrid/JustifiedPhotoGrid.d.ts +26 -0
  136. package/dist/web/types/ui/components/styles/overlay.d.ts +3 -0
  137. package/dist/web/types/ui/components/styles/shadow.d.ts +2 -0
  138. package/dist/web/types/ui/components/theming.d.ts +7 -0
  139. package/dist/web/types/ui/components/types.d.ts +79 -0
  140. package/dist/web/types/ui/components/utils/forwardRef.d.ts +11 -0
  141. package/dist/web/types/ui/components/utils/hasTouchHandler.d.ts +5 -0
  142. package/dist/web/types/ui/components/utils/roundLayoutSize.d.ts +1 -0
  143. package/dist/web/types/ui/components/utils/splitStyles.d.ts +19 -0
  144. package/dist/web/types/ui/constants/iconColors.d.ts +129 -0
  145. package/dist/web/types/ui/constants/spacing.d.ts +32 -0
  146. package/dist/web/types/ui/constants/theme.d.ts +96 -0
  147. package/dist/web/types/ui/context/OxyContext.d.ts +74 -0
  148. package/dist/web/types/ui/context/ThemeContext.d.ts +18 -0
  149. package/dist/web/types/ui/context/hooks/useAuthOperations.d.ts +39 -0
  150. package/dist/web/types/ui/context/hooks/useDeviceManagement.d.ts +26 -0
  151. package/dist/web/types/ui/context/hooks/useLanguageManagement.d.ts +24 -0
  152. package/dist/web/types/ui/context/hooks/useSessionManagement.d.ts +40 -0
  153. package/dist/web/types/ui/hooks/index.d.ts +6 -0
  154. package/dist/web/types/ui/hooks/mutations/index.d.ts +8 -0
  155. package/dist/web/types/ui/hooks/mutations/mutationFactory.d.ts +75 -0
  156. package/dist/web/types/ui/hooks/mutations/useAccountMutations.d.ts +68 -0
  157. package/dist/web/types/ui/hooks/mutations/useServicesMutations.d.ts +22 -0
  158. package/dist/web/types/ui/hooks/queries/index.d.ts +10 -0
  159. package/dist/web/types/ui/hooks/queries/queryKeys.d.ts +64 -0
  160. package/dist/web/types/ui/hooks/queries/useAccountQueries.d.ts +42 -0
  161. package/dist/web/types/ui/hooks/queries/useSecurityQueries.d.ts +14 -0
  162. package/dist/web/types/ui/hooks/queries/useServicesQueries.d.ts +31 -0
  163. package/dist/web/types/ui/hooks/queryClient.d.ts +18 -0
  164. package/dist/web/types/ui/hooks/useAssets.d.ts +34 -0
  165. package/dist/web/types/ui/hooks/useAsyncAction.d.ts +50 -0
  166. package/dist/web/types/ui/hooks/useAuth.d.ts +73 -0
  167. package/dist/web/types/ui/hooks/useColorScheme.d.ts +7 -0
  168. package/dist/web/types/ui/hooks/useDeviceManagement.d.ts +26 -0
  169. package/dist/web/types/ui/hooks/useFileDownloadUrl.d.ts +18 -0
  170. package/dist/web/types/ui/hooks/useFileFiltering.d.ts +28 -0
  171. package/dist/web/types/ui/hooks/useFollow.d.ts +61 -0
  172. package/dist/web/types/ui/hooks/useFollow.types.d.ts +32 -0
  173. package/dist/web/types/ui/hooks/useI18n.d.ts +4 -0
  174. package/dist/web/types/ui/hooks/useLanguageManagement.d.ts +24 -0
  175. package/dist/web/types/ui/hooks/useProfileEditing.d.ts +35 -0
  176. package/dist/web/types/ui/hooks/useQueryClient.d.ts +6 -0
  177. package/dist/web/types/ui/hooks/useSessionManagement.d.ts +40 -0
  178. package/dist/web/types/ui/hooks/useSessionSocket.d.ts +13 -0
  179. package/dist/web/types/ui/hooks/useSettingToggle.d.ts +56 -0
  180. package/dist/web/types/ui/hooks/useStorage.d.ts +15 -0
  181. package/dist/web/types/ui/hooks/useThemeColors.d.ts +93 -0
  182. package/dist/web/types/ui/hooks/useThemeStyles.d.ts +44 -0
  183. package/dist/web/types/ui/hooks/useWebSSO.d.ts +57 -0
  184. package/dist/web/types/ui/index.d.ts +7 -0
  185. package/dist/web/types/ui/isFrontend.d.ts +2 -0
  186. package/dist/web/types/ui/navigation/bottomSheetManager.d.ts +26 -0
  187. package/dist/web/types/ui/navigation/routes.d.ts +5 -0
  188. package/dist/web/types/ui/screens/AccountCenterScreen.d.ts +4 -0
  189. package/dist/web/types/ui/screens/AccountOverviewScreen.d.ts +4 -0
  190. package/dist/web/types/ui/screens/AccountSettingsScreen.d.ts +7 -0
  191. package/dist/web/types/ui/screens/AccountSwitcherScreen.d.ts +4 -0
  192. package/dist/web/types/ui/screens/AccountVerificationScreen.d.ts +4 -0
  193. package/dist/web/types/ui/screens/AppInfoScreen.d.ts +4 -0
  194. package/dist/web/types/ui/screens/EditProfileFieldScreen.d.ts +12 -0
  195. package/dist/web/types/ui/screens/FAQScreen.d.ts +4 -0
  196. package/dist/web/types/ui/screens/FeedbackScreen.d.ts +4 -0
  197. package/dist/web/types/ui/screens/FileManagementScreen.d.ts +4 -0
  198. package/dist/web/types/ui/screens/FollowersListScreen.d.ts +8 -0
  199. package/dist/web/types/ui/screens/FollowingListScreen.d.ts +8 -0
  200. package/dist/web/types/ui/screens/HelpSupportScreen.d.ts +4 -0
  201. package/dist/web/types/ui/screens/HistoryViewScreen.d.ts +4 -0
  202. package/dist/web/types/ui/screens/LanguageSelectorScreen.d.ts +6 -0
  203. package/dist/web/types/ui/screens/LearnMoreUsernamesScreen.d.ts +4 -0
  204. package/dist/web/types/ui/screens/LegalDocumentsScreen.d.ts +4 -0
  205. package/dist/web/types/ui/screens/OxyAuthScreen.d.ts +16 -0
  206. package/dist/web/types/ui/screens/PaymentGatewayScreen.d.ts +14 -0
  207. package/dist/web/types/ui/screens/PremiumSubscriptionScreen.d.ts +4 -0
  208. package/dist/web/types/ui/screens/PrivacySettingsScreen.d.ts +4 -0
  209. package/dist/web/types/ui/screens/ProfileScreen.d.ts +8 -0
  210. package/dist/web/types/ui/screens/SavesCollectionsScreen.d.ts +4 -0
  211. package/dist/web/types/ui/screens/SearchSettingsScreen.d.ts +4 -0
  212. package/dist/web/types/ui/screens/SessionManagementScreen.d.ts +4 -0
  213. package/dist/web/types/ui/screens/UserLinksScreen.d.ts +14 -0
  214. package/dist/web/types/ui/screens/UserListScreen.d.ts +10 -0
  215. package/dist/web/types/ui/screens/WelcomeNewUserScreen.d.ts +12 -0
  216. package/dist/web/types/ui/screens/karma/KarmaAboutScreen.d.ts +4 -0
  217. package/dist/web/types/ui/screens/karma/KarmaCenterScreen.d.ts +4 -0
  218. package/dist/web/types/ui/screens/karma/KarmaFAQScreen.d.ts +4 -0
  219. package/dist/web/types/ui/screens/karma/KarmaLeaderboardScreen.d.ts +4 -0
  220. package/dist/web/types/ui/screens/karma/KarmaRewardsScreen.d.ts +4 -0
  221. package/dist/web/types/ui/screens/karma/KarmaRulesScreen.d.ts +4 -0
  222. package/dist/web/types/ui/server.d.ts +42 -0
  223. package/dist/web/types/ui/stores/accountStore.d.ts +33 -0
  224. package/dist/web/types/ui/stores/assetStore.d.ts +53 -0
  225. package/dist/web/types/ui/stores/authStore.d.ts +16 -0
  226. package/dist/web/types/ui/stores/fileStore.d.ts +30 -0
  227. package/dist/web/types/ui/stores/followStore.d.ts +24 -0
  228. package/dist/web/types/ui/styles/authStyles.d.ts +331 -0
  229. package/dist/web/types/ui/styles/fonts.d.ts +20 -0
  230. package/dist/web/types/ui/styles/index.d.ts +4 -0
  231. package/dist/web/types/ui/styles/spacing.d.ts +48 -0
  232. package/dist/web/types/ui/styles/theme.d.ts +67 -0
  233. package/dist/web/types/ui/types/fileManagement.d.ts +40 -0
  234. package/dist/web/types/ui/types/navigation.d.ts +36 -0
  235. package/dist/web/types/ui/utils/authHelpers.d.ts +98 -0
  236. package/dist/web/types/ui/utils/avatarUtils.d.ts +33 -0
  237. package/dist/web/types/ui/utils/colorUtils.d.ts +9 -0
  238. package/dist/web/types/ui/utils/confirmAction.d.ts +6 -0
  239. package/dist/web/types/ui/utils/errorHandlers.d.ts +34 -0
  240. package/dist/web/types/ui/utils/fileManagement.d.ts +86 -0
  241. package/dist/web/types/ui/utils/iconNames.d.ts +111 -0
  242. package/dist/web/types/ui/utils/sessionHelpers.d.ts +63 -0
  243. package/dist/web/types/ui/utils/storageHelpers.d.ts +27 -0
  244. package/dist/web/types/ui/utils/themeUtils.d.ts +10 -0
  245. package/dist/web/types/ui/utils/userUtils.d.ts +28 -0
  246. package/dist/web/types/utils/apiUtils.d.ts +53 -0
  247. package/dist/web/types/utils/asyncUtils.d.ts +58 -0
  248. package/dist/web/types/utils/cache.d.ts +127 -0
  249. package/dist/web/types/utils/deviceManager.d.ts +65 -0
  250. package/dist/web/types/utils/errorUtils.d.ts +46 -0
  251. package/dist/web/types/utils/hookUtils.d.ts +101 -0
  252. package/dist/web/types/utils/index.d.ts +6 -0
  253. package/dist/web/types/utils/languageUtils.d.ts +37 -0
  254. package/dist/web/types/utils/loggerUtils.d.ts +48 -0
  255. package/dist/web/types/utils/platform.d.ts +40 -0
  256. package/dist/web/types/utils/platformInit.d.ts +8 -0
  257. package/dist/web/types/utils/requestUtils.d.ts +123 -0
  258. package/dist/web/types/utils/sessionUtils.d.ts +54 -0
  259. package/dist/web/types/utils/validationUtils.d.ts +85 -0
  260. package/dist/web/types/web/WebOxyContext.d.ts +151 -0
  261. package/dist/web/types/web/index.d.ts +52 -0
  262. package/dist/web/types/web.d.ts +53 -0
  263. package/package.json +77 -35
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Location Methods Mixin
3
+ */
4
+ import type { OxyServicesBase } from '../OxyServices.base';
5
+ export declare function OxyServicesLocationMixin<T extends typeof OxyServicesBase>(Base: T): {
6
+ new (...args: any[]): {
7
+ /**
8
+ * Update user location
9
+ * @param latitude - Latitude coordinate
10
+ * @param longitude - Longitude coordinate
11
+ * @returns Location update result
12
+ */
13
+ updateLocation(latitude: number, longitude: number): Promise<any>;
14
+ /**
15
+ * Get nearby users
16
+ * @param radius - Optional search radius in meters
17
+ * @returns Array of nearby users
18
+ */
19
+ getNearbyUsers(radius?: number): Promise<any[]>;
20
+ httpService: import("../HttpService").HttpService;
21
+ cloudURL: string;
22
+ config: import("../OxyServices.base").OxyConfig;
23
+ makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
24
+ getBaseURL(): string;
25
+ getClient(): import("../HttpService").HttpService;
26
+ getMetrics(): {
27
+ totalRequests: number;
28
+ successfulRequests: number;
29
+ failedRequests: number;
30
+ cacheHits: number;
31
+ cacheMisses: number;
32
+ averageResponseTime: number;
33
+ };
34
+ clearCache(): void;
35
+ clearCacheEntry(key: string): void;
36
+ getCacheStats(): {
37
+ size: number;
38
+ hits: number;
39
+ misses: number;
40
+ hitRate: number;
41
+ };
42
+ getCloudURL(): string;
43
+ setTokens(accessToken: string, refreshToken?: string): void;
44
+ clearTokens(): void;
45
+ getCurrentUserId(): string | null;
46
+ hasValidToken(): boolean;
47
+ getAccessToken(): string | null;
48
+ waitForAuth(timeoutMs?: number): Promise<boolean>;
49
+ withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
50
+ maxRetries?: number;
51
+ retryDelay?: number;
52
+ authTimeoutMs?: number;
53
+ }): Promise<T_1>;
54
+ validate(): Promise<boolean>;
55
+ handleError(error: unknown): Error;
56
+ healthCheck(): Promise<{
57
+ status: string;
58
+ users?: number;
59
+ timestamp?: string;
60
+ [key: string]: any;
61
+ }>;
62
+ };
63
+ __resetTokensForTests(): void;
64
+ } & T;
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Payment Methods Mixin
3
+ *
4
+ * Provides methods for payment processing and management
5
+ */
6
+ import type { OxyServicesBase } from '../OxyServices.base';
7
+ export declare function OxyServicesPaymentMixin<T extends typeof OxyServicesBase>(Base: T): {
8
+ new (...args: any[]): {
9
+ /**
10
+ * Create a payment
11
+ * @param data - Payment data
12
+ * @returns Created payment object
13
+ */
14
+ createPayment(data: any): Promise<any>;
15
+ /**
16
+ * Get payment by ID
17
+ * @param paymentId - The payment ID
18
+ * @returns Payment object
19
+ */
20
+ getPayment(paymentId: string): Promise<any>;
21
+ /**
22
+ * Get user payments
23
+ * @returns Array of user payments
24
+ */
25
+ getUserPayments(): Promise<any[]>;
26
+ /**
27
+ * Get user subscription
28
+ * @param userId - The user ID
29
+ * @returns Subscription object
30
+ */
31
+ getSubscription(userId: string): Promise<any>;
32
+ /**
33
+ * Get current user's subscription
34
+ * @returns Subscription object
35
+ */
36
+ getCurrentUserSubscription(): Promise<any>;
37
+ /**
38
+ * Get user wallet
39
+ * @param userId - The user ID
40
+ * @returns Wallet object with balance
41
+ */
42
+ getWallet(userId: string): Promise<any>;
43
+ /**
44
+ * Get current user's wallet
45
+ * @returns Wallet object with balance
46
+ */
47
+ getCurrentUserWallet(): Promise<any>;
48
+ /**
49
+ * Get wallet transaction history
50
+ * @param userId - The user ID
51
+ * @param options - Pagination options
52
+ * @returns Transaction history
53
+ */
54
+ getWalletTransactions(userId: string, options?: {
55
+ limit?: number;
56
+ offset?: number;
57
+ }): Promise<any>;
58
+ /**
59
+ * Get current user's wallet transaction history
60
+ * @param options - Pagination options
61
+ * @returns Transaction history
62
+ */
63
+ getCurrentUserWalletTransactions(options?: {
64
+ limit?: number;
65
+ offset?: number;
66
+ }): Promise<any>;
67
+ httpService: import("../HttpService").HttpService;
68
+ cloudURL: string;
69
+ config: import("../OxyServices.base").OxyConfig;
70
+ makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
71
+ getBaseURL(): string;
72
+ getClient(): import("../HttpService").HttpService;
73
+ getMetrics(): {
74
+ totalRequests: number;
75
+ successfulRequests: number;
76
+ failedRequests: number;
77
+ cacheHits: number;
78
+ cacheMisses: number;
79
+ averageResponseTime: number;
80
+ };
81
+ clearCache(): void;
82
+ clearCacheEntry(key: string): void;
83
+ getCacheStats(): {
84
+ size: number;
85
+ hits: number;
86
+ misses: number;
87
+ hitRate: number;
88
+ };
89
+ getCloudURL(): string;
90
+ setTokens(accessToken: string, refreshToken?: string): void;
91
+ clearTokens(): void;
92
+ getCurrentUserId(): string | null;
93
+ hasValidToken(): boolean;
94
+ getAccessToken(): string | null;
95
+ waitForAuth(timeoutMs?: number): Promise<boolean>;
96
+ withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
97
+ maxRetries?: number;
98
+ retryDelay?: number;
99
+ authTimeoutMs?: number;
100
+ }): Promise<T_1>;
101
+ validate(): Promise<boolean>;
102
+ handleError(error: unknown): Error;
103
+ healthCheck(): Promise<{
104
+ status: string;
105
+ users?: number;
106
+ timestamp?: string;
107
+ [key: string]: any;
108
+ }>;
109
+ };
110
+ __resetTokensForTests(): void;
111
+ } & T;
@@ -0,0 +1,205 @@
1
+ import type { OxyServicesBase } from '../OxyServices.base';
2
+ import type { SessionLoginResponse } from '../../models/session';
3
+ export interface PopupAuthOptions {
4
+ width?: number;
5
+ height?: number;
6
+ timeout?: number;
7
+ mode?: 'login' | 'signup';
8
+ }
9
+ export interface SilentAuthOptions {
10
+ timeout?: number;
11
+ }
12
+ /**
13
+ * Popup-based Cross-Domain Authentication Mixin
14
+ *
15
+ * Implements OAuth2-style authentication using popup windows and postMessage.
16
+ * This is the primary authentication method for modern browsers, providing a
17
+ * Google-like experience without full page redirects.
18
+ *
19
+ * Flow:
20
+ * 1. Opens small popup window to auth.oxy.so
21
+ * 2. User signs in (auth.oxy.so sets its own first-party cookie)
22
+ * 3. auth.oxy.so sends token back via postMessage
23
+ * 4. Popup closes, parent app has the session
24
+ *
25
+ * Features:
26
+ * - No full page redirect (preserves app state)
27
+ * - Works across different domains (homiio.com, mention.earth, etc.)
28
+ * - Silent refresh using hidden iframe for seamless SSO
29
+ * - CSRF protection via state parameter
30
+ * - XSS protection via origin validation
31
+ *
32
+ * Browser Support: All modern browsers (IE11+)
33
+ */
34
+ export declare function OxyServicesPopupAuthMixin<T extends typeof OxyServicesBase>(Base: T): {
35
+ new (...args: any[]): {
36
+ /**
37
+ * Sign in using popup window
38
+ *
39
+ * Opens a centered popup window to auth.oxy.so where the user can sign in.
40
+ * The popup automatically closes after successful authentication and the
41
+ * session is returned to the parent window.
42
+ *
43
+ * @param options - Popup configuration options
44
+ * @returns Session with access token and user data
45
+ * @throws {OxyAuthenticationError} If popup is blocked or auth fails
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * const handleSignIn = async () => {
50
+ * try {
51
+ * const session = await oxyServices.signInWithPopup();
52
+ * console.log('Signed in:', session.user);
53
+ * } catch (error) {
54
+ * if (error.message.includes('blocked')) {
55
+ * alert('Please allow popups for this site');
56
+ * }
57
+ * }
58
+ * };
59
+ * ```
60
+ */
61
+ signInWithPopup(options?: PopupAuthOptions): Promise<SessionLoginResponse>;
62
+ /**
63
+ * Sign up using popup window
64
+ *
65
+ * Same as signInWithPopup but opens the signup page by default.
66
+ *
67
+ * @param options - Popup configuration options
68
+ * @returns Session with access token and user data
69
+ */
70
+ signUpWithPopup(options?: PopupAuthOptions): Promise<SessionLoginResponse>;
71
+ /**
72
+ * Silent sign-in using hidden iframe
73
+ *
74
+ * Attempts to automatically re-authenticate the user without any UI.
75
+ * This is what enables seamless SSO across all Oxy domains.
76
+ *
77
+ * How it works:
78
+ * 1. Creates hidden iframe pointing to auth.oxy.so/silent-auth
79
+ * 2. If user has valid session at auth.oxy.so, it sends token via postMessage
80
+ * 3. If not, iframe responds with null (no error thrown)
81
+ *
82
+ * This should be called on app startup to check for existing sessions.
83
+ *
84
+ * @param options - Silent auth options
85
+ * @returns Session if user is signed in, null otherwise
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * useEffect(() => {
90
+ * const checkAuth = async () => {
91
+ * const session = await oxyServices.silentSignIn();
92
+ * if (session) {
93
+ * setUser(session.user);
94
+ * }
95
+ * };
96
+ * checkAuth();
97
+ * }, []);
98
+ * ```
99
+ */
100
+ silentSignIn(options?: SilentAuthOptions): Promise<SessionLoginResponse | null>;
101
+ /**
102
+ * Open a centered popup window
103
+ *
104
+ * @private
105
+ */
106
+ openCenteredPopup(url: string, title: string, width: number, height: number): Window | null;
107
+ /**
108
+ * Wait for authentication response from popup
109
+ *
110
+ * @private
111
+ */
112
+ waitForPopupAuth(popup: Window, expectedState: string, timeout: number): Promise<SessionLoginResponse>;
113
+ /**
114
+ * Wait for authentication response from iframe
115
+ *
116
+ * @private
117
+ */
118
+ waitForIframeAuth(iframe: HTMLIFrameElement, timeout: number, expectedOrigin: string): Promise<SessionLoginResponse | null>;
119
+ /**
120
+ * Build authentication URL with query parameters
121
+ *
122
+ * @private
123
+ */
124
+ buildAuthUrl(params: {
125
+ mode: string;
126
+ state: string;
127
+ nonce: string;
128
+ clientId: string;
129
+ redirectUri: string;
130
+ }): string;
131
+ /**
132
+ * Generate cryptographically secure state for CSRF protection
133
+ *
134
+ * @private
135
+ */
136
+ generateState(): string;
137
+ /**
138
+ * Generate nonce for replay attack prevention
139
+ *
140
+ * @private
141
+ */
142
+ generateNonce(): string;
143
+ /**
144
+ * Store auth state in session storage
145
+ *
146
+ * @private
147
+ */
148
+ storeAuthState(state: string, nonce: string): void;
149
+ /**
150
+ * Clear auth state from session storage
151
+ *
152
+ * @private
153
+ */
154
+ clearAuthState(state: string): void;
155
+ httpService: import("../HttpService").HttpService;
156
+ cloudURL: string;
157
+ config: import("../OxyServices.base").OxyConfig;
158
+ makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
159
+ getBaseURL(): string;
160
+ getClient(): import("../HttpService").HttpService;
161
+ getMetrics(): {
162
+ totalRequests: number;
163
+ successfulRequests: number;
164
+ failedRequests: number;
165
+ cacheHits: number;
166
+ cacheMisses: number;
167
+ averageResponseTime: number;
168
+ };
169
+ clearCache(): void;
170
+ clearCacheEntry(key: string): void;
171
+ getCacheStats(): {
172
+ size: number;
173
+ hits: number;
174
+ misses: number;
175
+ hitRate: number;
176
+ };
177
+ getCloudURL(): string;
178
+ setTokens(accessToken: string, refreshToken?: string): void;
179
+ clearTokens(): void;
180
+ getCurrentUserId(): string | null;
181
+ hasValidToken(): boolean;
182
+ getAccessToken(): string | null;
183
+ waitForAuth(timeoutMs?: number): Promise<boolean>;
184
+ withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
185
+ maxRetries?: number;
186
+ retryDelay?: number;
187
+ authTimeoutMs?: number;
188
+ }): Promise<T_1>;
189
+ validate(): Promise<boolean>;
190
+ handleError(error: unknown): Error;
191
+ healthCheck(): Promise<{
192
+ status: string;
193
+ users?: number;
194
+ timestamp?: string;
195
+ [key: string]: any;
196
+ }>;
197
+ };
198
+ readonly AUTH_URL: "https://auth.oxy.so";
199
+ readonly POPUP_WIDTH: 500;
200
+ readonly POPUP_HEIGHT: 700;
201
+ readonly POPUP_TIMEOUT: 60000;
202
+ readonly SILENT_TIMEOUT: 5000;
203
+ __resetTokensForTests(): void;
204
+ } & T;
205
+ export { OxyServicesPopupAuthMixin as PopupAuthMixin };
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Privacy Methods Mixin (Blocked & Restricted Users)
3
+ */
4
+ import type { BlockedUser, RestrictedUser } from '../../models/interfaces';
5
+ import type { OxyServicesBase } from '../OxyServices.base';
6
+ export declare function OxyServicesPrivacyMixin<T extends typeof OxyServicesBase>(Base: T): {
7
+ new (...args: any[]): {
8
+ /**
9
+ * Extract user ID from blocked/restricted user object
10
+ */
11
+ extractUserId(userIdField: string | {
12
+ _id: string;
13
+ username?: string;
14
+ avatar?: string;
15
+ }): string;
16
+ /**
17
+ * Check if a user is in a list (blocked or restricted)
18
+ */
19
+ isUserInList<T_1 extends BlockedUser | RestrictedUser>(userId: string, getUserList: () => Promise<T_1[]>, getIdField: (item: T_1) => string | {
20
+ _id: string;
21
+ username?: string;
22
+ avatar?: string;
23
+ }): Promise<boolean>;
24
+ /**
25
+ * Get list of blocked users
26
+ * @returns Array of blocked users
27
+ */
28
+ getBlockedUsers(): Promise<BlockedUser[]>;
29
+ /**
30
+ * Block a user
31
+ * @param userId - The user ID to block
32
+ * @returns Success message
33
+ */
34
+ blockUser(userId: string): Promise<{
35
+ message: string;
36
+ }>;
37
+ /**
38
+ * Unblock a user
39
+ * @param userId - The user ID to unblock
40
+ * @returns Success message
41
+ */
42
+ unblockUser(userId: string): Promise<{
43
+ message: string;
44
+ }>;
45
+ /**
46
+ * Check if a user is blocked
47
+ * @param userId - The user ID to check
48
+ * @returns True if the user is blocked, false otherwise
49
+ */
50
+ isUserBlocked(userId: string): Promise<boolean>;
51
+ /**
52
+ * Get list of restricted users
53
+ * @returns Array of restricted users
54
+ */
55
+ getRestrictedUsers(): Promise<RestrictedUser[]>;
56
+ /**
57
+ * Restrict a user (limit their interactions without fully blocking)
58
+ * @param userId - The user ID to restrict
59
+ * @returns Success message
60
+ */
61
+ restrictUser(userId: string): Promise<{
62
+ message: string;
63
+ }>;
64
+ /**
65
+ * Unrestrict a user
66
+ * @param userId - The user ID to unrestrict
67
+ * @returns Success message
68
+ */
69
+ unrestrictUser(userId: string): Promise<{
70
+ message: string;
71
+ }>;
72
+ /**
73
+ * Check if a user is restricted
74
+ * @param userId - The user ID to check
75
+ * @returns True if the user is restricted, false otherwise
76
+ */
77
+ isUserRestricted(userId: string): Promise<boolean>;
78
+ httpService: import("../HttpService").HttpService;
79
+ cloudURL: string;
80
+ config: import("../OxyServices.base").OxyConfig;
81
+ makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
82
+ getBaseURL(): string;
83
+ getClient(): import("../HttpService").HttpService;
84
+ getMetrics(): {
85
+ totalRequests: number;
86
+ successfulRequests: number;
87
+ failedRequests: number;
88
+ cacheHits: number;
89
+ cacheMisses: number;
90
+ averageResponseTime: number;
91
+ };
92
+ clearCache(): void;
93
+ clearCacheEntry(key: string): void;
94
+ getCacheStats(): {
95
+ size: number;
96
+ hits: number;
97
+ misses: number;
98
+ hitRate: number;
99
+ };
100
+ getCloudURL(): string;
101
+ setTokens(accessToken: string, refreshToken?: string): void;
102
+ clearTokens(): void;
103
+ getCurrentUserId(): string | null;
104
+ hasValidToken(): boolean;
105
+ getAccessToken(): string | null;
106
+ waitForAuth(timeoutMs?: number): Promise<boolean>;
107
+ withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
108
+ maxRetries?: number;
109
+ retryDelay?: number;
110
+ authTimeoutMs?: number;
111
+ }): Promise<T_1>;
112
+ validate(): Promise<boolean>;
113
+ handleError(error: unknown): Error;
114
+ healthCheck(): Promise<{
115
+ status: string;
116
+ users?: number;
117
+ timestamp?: string;
118
+ [key: string]: any;
119
+ }>;
120
+ };
121
+ __resetTokensForTests(): void;
122
+ } & T;