@oxyhq/services 5.26.4 → 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.
- package/dist/web/oxy-services.esm.js +2 -0
- package/dist/web/oxy-services.esm.js.map +1 -0
- package/dist/web/types/assets/icons/OxyServices.d.ts +28 -0
- package/dist/web/types/assets/illustrations/HighFive.d.ts +8 -0
- package/dist/web/types/constants/version.d.ts +13 -0
- package/dist/web/types/core/AuthManager.d.ts +143 -0
- package/dist/web/types/core/CrossDomainAuth.d.ts +160 -0
- package/dist/web/types/core/HttpService.d.ts +163 -0
- package/dist/web/types/core/OxyServices.base.d.ts +126 -0
- package/dist/web/types/core/OxyServices.d.ts +81 -0
- package/dist/web/types/core/OxyServices.errors.d.ts +11 -0
- package/dist/web/types/core/index.d.ts +20 -0
- package/dist/web/types/core/mixins/OxyServices.analytics.d.ts +66 -0
- package/dist/web/types/core/mixins/OxyServices.assets.d.ts +135 -0
- package/dist/web/types/core/mixins/OxyServices.auth.d.ts +186 -0
- package/dist/web/types/core/mixins/OxyServices.developer.d.ts +99 -0
- package/dist/web/types/core/mixins/OxyServices.devices.d.ts +96 -0
- package/dist/web/types/core/mixins/OxyServices.features.d.ts +228 -0
- package/dist/web/types/core/mixins/OxyServices.fedcm.d.ts +200 -0
- package/dist/web/types/core/mixins/OxyServices.karma.d.ts +85 -0
- package/dist/web/types/core/mixins/OxyServices.language.d.ts +81 -0
- package/dist/web/types/core/mixins/OxyServices.location.d.ts +64 -0
- package/dist/web/types/core/mixins/OxyServices.payment.d.ts +111 -0
- package/dist/web/types/core/mixins/OxyServices.popup.d.ts +205 -0
- package/dist/web/types/core/mixins/OxyServices.privacy.d.ts +122 -0
- package/dist/web/types/core/mixins/OxyServices.redirect.d.ts +245 -0
- package/dist/web/types/core/mixins/OxyServices.security.d.ts +78 -0
- package/dist/web/types/core/mixins/OxyServices.user.d.ts +184 -0
- package/dist/web/types/core/mixins/OxyServices.utility.d.ts +93 -0
- package/dist/web/types/core/mixins/index.d.ts +30 -0
- package/dist/web/types/core/mixins/mixinHelpers.d.ts +31 -0
- package/dist/web/types/crypto/index.d.ts +11 -0
- package/dist/web/types/crypto/keyManager.d.ts +189 -0
- package/dist/web/types/crypto/polyfill.d.ts +12 -0
- package/dist/web/types/crypto/recoveryPhrase.d.ts +58 -0
- package/dist/web/types/crypto/signatureService.d.ts +86 -0
- package/dist/web/types/i18n/index.d.ts +3 -0
- package/dist/web/types/index.d.ts +62 -0
- package/dist/web/types/lib/sonner-safe.d.ts +8 -0
- package/dist/web/types/lib/sonner.d.ts +11 -0
- package/dist/web/types/lib/sonner.web.d.ts +14 -0
- package/dist/web/types/models/interfaces.d.ts +415 -0
- package/dist/web/types/models/session.d.ts +27 -0
- package/dist/web/types/node/index.d.ts +9 -0
- package/dist/web/types/shared/index.d.ts +28 -0
- package/dist/web/types/shared/utils/colorUtils.d.ts +104 -0
- package/dist/web/types/shared/utils/debugUtils.d.ts +48 -0
- package/dist/web/types/shared/utils/errorUtils.d.ts +97 -0
- package/dist/web/types/shared/utils/index.d.ts +13 -0
- package/dist/web/types/shared/utils/networkUtils.d.ts +139 -0
- package/dist/web/types/shared/utils/themeUtils.d.ts +90 -0
- package/dist/web/types/ui/client.d.ts +33 -0
- package/dist/web/types/ui/components/ActivityIndicator.d.ts +44 -0
- package/dist/web/types/ui/components/AnimationExample.d.ts +3 -0
- package/dist/web/types/ui/components/AutoHeightScrollView.d.ts +22 -0
- package/dist/web/types/ui/components/Avatar.d.ts +60 -0
- package/dist/web/types/ui/components/BottomSheet.d.ts +28 -0
- package/dist/web/types/ui/components/BottomSheetRouter.d.ts +8 -0
- package/dist/web/types/ui/components/CrossFadeIcon.d.ts +26 -0
- package/dist/web/types/ui/components/EmptyState.d.ts +7 -0
- package/dist/web/types/ui/components/ErrorBoundary.d.ts +30 -0
- package/dist/web/types/ui/components/FollowButton.d.ts +17 -0
- package/dist/web/types/ui/components/FontLoader.d.ts +14 -0
- package/dist/web/types/ui/components/GroupedItem.d.ts +23 -0
- package/dist/web/types/ui/components/GroupedSection.d.ts +24 -0
- package/dist/web/types/ui/components/Header.d.ts +37 -0
- package/dist/web/types/ui/components/HelperText.d.ts +46 -0
- package/dist/web/types/ui/components/Icon.d.ts +59 -0
- package/dist/web/types/ui/components/IconButton/IconButton.d.ts +98 -0
- package/dist/web/types/ui/components/IconButton/utils.d.ts +18 -0
- package/dist/web/types/ui/components/LoadingState.d.ts +8 -0
- package/dist/web/types/ui/components/OxyLogo.d.ts +28 -0
- package/dist/web/types/ui/components/OxyPayButton.d.ts +28 -0
- package/dist/web/types/ui/components/OxyProvider.d.ts +33 -0
- package/dist/web/types/ui/components/OxySignInButton.d.ts +64 -0
- package/dist/web/types/ui/components/ProfileCard.d.ts +17 -0
- package/dist/web/types/ui/components/QuickActions.d.ts +14 -0
- package/dist/web/types/ui/components/Section.d.ts +11 -0
- package/dist/web/types/ui/components/SectionTitle.d.ts +9 -0
- package/dist/web/types/ui/components/SettingRow.d.ts +19 -0
- package/dist/web/types/ui/components/SignInModal.d.ts +17 -0
- package/dist/web/types/ui/components/StepBasedScreen.d.ts +25 -0
- package/dist/web/types/ui/components/Surface.d.ts +75 -0
- package/dist/web/types/ui/components/TextField/Addons/Outline.d.ts +15 -0
- package/dist/web/types/ui/components/TextField/Addons/Underline.d.ts +18 -0
- package/dist/web/types/ui/components/TextField/Adornment/TextFieldAdornment.d.ts +44 -0
- package/dist/web/types/ui/components/TextField/Adornment/TextFieldAffix.d.ts +72 -0
- package/dist/web/types/ui/components/TextField/Adornment/TextFieldIcon.d.ts +77 -0
- package/dist/web/types/ui/components/TextField/Adornment/enums.d.ts +12 -0
- package/dist/web/types/ui/components/TextField/Adornment/types.d.ts +11 -0
- package/dist/web/types/ui/components/TextField/Adornment/utils.d.ts +11 -0
- package/dist/web/types/ui/components/TextField/Label/InputLabel.d.ts +4 -0
- package/dist/web/types/ui/components/TextField/Label/LabelBackground.d.ts +3 -0
- package/dist/web/types/ui/components/TextField/TextFieldFlat.d.ts +3 -0
- package/dist/web/types/ui/components/TextField/TextFieldOutlined.d.ts +3 -0
- package/dist/web/types/ui/components/TextField/constants.d.ts +31 -0
- package/dist/web/types/ui/components/TextField/helpers.d.ts +96 -0
- package/dist/web/types/ui/components/TextField/types.d.ts +155 -0
- package/dist/web/types/ui/components/TextField.d.ts +191 -0
- package/dist/web/types/ui/components/TouchableRipple/Pressable.d.ts +12 -0
- package/dist/web/types/ui/components/TouchableRipple/TouchableRipple.d.ts +61 -0
- package/dist/web/types/ui/components/TouchableRipple/utils.d.ts +10 -0
- package/dist/web/types/ui/components/Typography/AnimatedText.d.ts +34 -0
- package/dist/web/types/ui/components/Typography/types.d.ts +18 -0
- package/dist/web/types/ui/components/WebOxyProvider.d.ts +51 -0
- package/dist/web/types/ui/components/feedback/FormInput.d.ts +19 -0
- package/dist/web/types/ui/components/feedback/ProgressIndicator.d.ts +10 -0
- package/dist/web/types/ui/components/feedback/constants.d.ts +4 -0
- package/dist/web/types/ui/components/feedback/feedbackStyles.d.ts +279 -0
- package/dist/web/types/ui/components/feedback/index.d.ts +6 -0
- package/dist/web/types/ui/components/feedback/types.d.ts +45 -0
- package/dist/web/types/ui/components/feedback/useFeedbackForm.d.ts +8 -0
- package/dist/web/types/ui/components/fileManagement/AnimatedButton.d.ts +15 -0
- package/dist/web/types/ui/components/fileManagement/FileDetailsModal.d.ts +14 -0
- package/dist/web/types/ui/components/fileManagement/FileViewer.d.ts +17 -0
- package/dist/web/types/ui/components/fileManagement/UploadPreview.d.ts +20 -0
- package/dist/web/types/ui/components/fileManagement/styles.d.ts +859 -0
- package/dist/web/types/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
- package/dist/web/types/ui/components/icon/OxyIcon.d.ts +9 -0
- package/dist/web/types/ui/components/icon/index.d.ts +3 -0
- package/dist/web/types/ui/components/index.d.ts +16 -0
- package/dist/web/types/ui/components/internal/GroupedPillButtons.d.ts +17 -0
- package/dist/web/types/ui/components/internal/PinInput.d.ts +22 -0
- package/dist/web/types/ui/components/modals/DeleteAccountModal.d.ts +18 -0
- package/dist/web/types/ui/components/modals/index.d.ts +1 -0
- package/dist/web/types/ui/components/payment/PaymentDetailsStep.d.ts +20 -0
- package/dist/web/types/ui/components/payment/PaymentMethodStep.d.ts +13 -0
- package/dist/web/types/ui/components/payment/PaymentReviewStep.d.ts +15 -0
- package/dist/web/types/ui/components/payment/PaymentSuccessStep.d.ts +9 -0
- package/dist/web/types/ui/components/payment/PaymentSummaryStep.d.ts +14 -0
- package/dist/web/types/ui/components/payment/constants.d.ts +6 -0
- package/dist/web/types/ui/components/payment/index.d.ts +8 -0
- package/dist/web/types/ui/components/payment/paymentStyles.d.ts +395 -0
- package/dist/web/types/ui/components/payment/types.d.ts +39 -0
- package/dist/web/types/ui/components/photogrid/JustifiedPhotoGrid.d.ts +26 -0
- package/dist/web/types/ui/components/styles/overlay.d.ts +3 -0
- package/dist/web/types/ui/components/styles/shadow.d.ts +2 -0
- package/dist/web/types/ui/components/theming.d.ts +7 -0
- package/dist/web/types/ui/components/types.d.ts +79 -0
- package/dist/web/types/ui/components/utils/forwardRef.d.ts +11 -0
- package/dist/web/types/ui/components/utils/hasTouchHandler.d.ts +5 -0
- package/dist/web/types/ui/components/utils/roundLayoutSize.d.ts +1 -0
- package/dist/web/types/ui/components/utils/splitStyles.d.ts +19 -0
- package/dist/web/types/ui/constants/iconColors.d.ts +129 -0
- package/dist/web/types/ui/constants/spacing.d.ts +32 -0
- package/dist/web/types/ui/constants/theme.d.ts +96 -0
- package/dist/web/types/ui/context/OxyContext.d.ts +74 -0
- package/dist/web/types/ui/context/ThemeContext.d.ts +18 -0
- package/dist/web/types/ui/context/hooks/useAuthOperations.d.ts +39 -0
- package/dist/web/types/ui/context/hooks/useDeviceManagement.d.ts +26 -0
- package/dist/web/types/ui/context/hooks/useLanguageManagement.d.ts +24 -0
- package/dist/web/types/ui/context/hooks/useSessionManagement.d.ts +40 -0
- package/dist/web/types/ui/hooks/index.d.ts +6 -0
- package/dist/web/types/ui/hooks/mutations/index.d.ts +8 -0
- package/dist/web/types/ui/hooks/mutations/mutationFactory.d.ts +75 -0
- package/dist/web/types/ui/hooks/mutations/useAccountMutations.d.ts +68 -0
- package/dist/web/types/ui/hooks/mutations/useServicesMutations.d.ts +22 -0
- package/dist/web/types/ui/hooks/queries/index.d.ts +10 -0
- package/dist/web/types/ui/hooks/queries/queryKeys.d.ts +64 -0
- package/dist/web/types/ui/hooks/queries/useAccountQueries.d.ts +42 -0
- package/dist/web/types/ui/hooks/queries/useSecurityQueries.d.ts +14 -0
- package/dist/web/types/ui/hooks/queries/useServicesQueries.d.ts +31 -0
- package/dist/web/types/ui/hooks/queryClient.d.ts +18 -0
- package/dist/web/types/ui/hooks/useAssets.d.ts +34 -0
- package/dist/web/types/ui/hooks/useAsyncAction.d.ts +50 -0
- package/dist/web/types/ui/hooks/useAuth.d.ts +73 -0
- package/dist/web/types/ui/hooks/useColorScheme.d.ts +7 -0
- package/dist/web/types/ui/hooks/useDeviceManagement.d.ts +26 -0
- package/dist/web/types/ui/hooks/useFileDownloadUrl.d.ts +18 -0
- package/dist/web/types/ui/hooks/useFileFiltering.d.ts +28 -0
- package/dist/web/types/ui/hooks/useFollow.d.ts +61 -0
- package/dist/web/types/ui/hooks/useFollow.types.d.ts +32 -0
- package/dist/web/types/ui/hooks/useI18n.d.ts +4 -0
- package/dist/web/types/ui/hooks/useLanguageManagement.d.ts +24 -0
- package/dist/web/types/ui/hooks/useProfileEditing.d.ts +35 -0
- package/dist/web/types/ui/hooks/useQueryClient.d.ts +6 -0
- package/dist/web/types/ui/hooks/useSessionManagement.d.ts +40 -0
- package/dist/web/types/ui/hooks/useSessionSocket.d.ts +13 -0
- package/dist/web/types/ui/hooks/useSettingToggle.d.ts +56 -0
- package/dist/web/types/ui/hooks/useStorage.d.ts +15 -0
- package/dist/web/types/ui/hooks/useThemeColors.d.ts +93 -0
- package/dist/web/types/ui/hooks/useThemeStyles.d.ts +44 -0
- package/dist/web/types/ui/hooks/useWebSSO.d.ts +57 -0
- package/dist/web/types/ui/index.d.ts +7 -0
- package/dist/web/types/ui/isFrontend.d.ts +2 -0
- package/dist/web/types/ui/navigation/bottomSheetManager.d.ts +26 -0
- package/dist/web/types/ui/navigation/routes.d.ts +5 -0
- package/dist/web/types/ui/screens/AccountCenterScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/AccountOverviewScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/AccountSettingsScreen.d.ts +7 -0
- package/dist/web/types/ui/screens/AccountSwitcherScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/AccountVerificationScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/AppInfoScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/EditProfileFieldScreen.d.ts +12 -0
- package/dist/web/types/ui/screens/FAQScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/FeedbackScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/FileManagementScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/FollowersListScreen.d.ts +8 -0
- package/dist/web/types/ui/screens/FollowingListScreen.d.ts +8 -0
- package/dist/web/types/ui/screens/HelpSupportScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/HistoryViewScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/LanguageSelectorScreen.d.ts +6 -0
- package/dist/web/types/ui/screens/LearnMoreUsernamesScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/LegalDocumentsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/OxyAuthScreen.d.ts +16 -0
- package/dist/web/types/ui/screens/PaymentGatewayScreen.d.ts +14 -0
- package/dist/web/types/ui/screens/PremiumSubscriptionScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/PrivacySettingsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/ProfileScreen.d.ts +8 -0
- package/dist/web/types/ui/screens/SavesCollectionsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/SearchSettingsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/SessionManagementScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/UserLinksScreen.d.ts +14 -0
- package/dist/web/types/ui/screens/UserListScreen.d.ts +10 -0
- package/dist/web/types/ui/screens/WelcomeNewUserScreen.d.ts +12 -0
- package/dist/web/types/ui/screens/karma/KarmaAboutScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaCenterScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaFAQScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaLeaderboardScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaRewardsScreen.d.ts +4 -0
- package/dist/web/types/ui/screens/karma/KarmaRulesScreen.d.ts +4 -0
- package/dist/web/types/ui/server.d.ts +42 -0
- package/dist/web/types/ui/stores/accountStore.d.ts +33 -0
- package/dist/web/types/ui/stores/assetStore.d.ts +53 -0
- package/dist/web/types/ui/stores/authStore.d.ts +16 -0
- package/dist/web/types/ui/stores/fileStore.d.ts +30 -0
- package/dist/web/types/ui/stores/followStore.d.ts +24 -0
- package/dist/web/types/ui/styles/authStyles.d.ts +331 -0
- package/dist/web/types/ui/styles/fonts.d.ts +20 -0
- package/dist/web/types/ui/styles/index.d.ts +4 -0
- package/dist/web/types/ui/styles/spacing.d.ts +48 -0
- package/dist/web/types/ui/styles/theme.d.ts +67 -0
- package/dist/web/types/ui/types/fileManagement.d.ts +40 -0
- package/dist/web/types/ui/types/navigation.d.ts +36 -0
- package/dist/web/types/ui/utils/authHelpers.d.ts +98 -0
- package/dist/web/types/ui/utils/avatarUtils.d.ts +33 -0
- package/dist/web/types/ui/utils/colorUtils.d.ts +9 -0
- package/dist/web/types/ui/utils/confirmAction.d.ts +6 -0
- package/dist/web/types/ui/utils/errorHandlers.d.ts +34 -0
- package/dist/web/types/ui/utils/fileManagement.d.ts +86 -0
- package/dist/web/types/ui/utils/iconNames.d.ts +111 -0
- package/dist/web/types/ui/utils/sessionHelpers.d.ts +63 -0
- package/dist/web/types/ui/utils/storageHelpers.d.ts +27 -0
- package/dist/web/types/ui/utils/themeUtils.d.ts +10 -0
- package/dist/web/types/ui/utils/userUtils.d.ts +28 -0
- package/dist/web/types/utils/apiUtils.d.ts +53 -0
- package/dist/web/types/utils/asyncUtils.d.ts +58 -0
- package/dist/web/types/utils/cache.d.ts +127 -0
- package/dist/web/types/utils/deviceManager.d.ts +65 -0
- package/dist/web/types/utils/errorUtils.d.ts +46 -0
- package/dist/web/types/utils/hookUtils.d.ts +101 -0
- package/dist/web/types/utils/index.d.ts +6 -0
- package/dist/web/types/utils/languageUtils.d.ts +37 -0
- package/dist/web/types/utils/loggerUtils.d.ts +48 -0
- package/dist/web/types/utils/platform.d.ts +40 -0
- package/dist/web/types/utils/platformInit.d.ts +8 -0
- package/dist/web/types/utils/requestUtils.d.ts +123 -0
- package/dist/web/types/utils/sessionUtils.d.ts +54 -0
- package/dist/web/types/utils/validationUtils.d.ts +85 -0
- package/dist/web/types/web/WebOxyContext.d.ts +151 -0
- package/dist/web/types/web/index.d.ts +52 -0
- package/dist/web/types/web.d.ts +53 -0
- package/package.json +20 -6
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device Methods Mixin
|
|
3
|
+
*/
|
|
4
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
5
|
+
export declare function OxyServicesDevicesMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
6
|
+
new (...args: any[]): {
|
|
7
|
+
/**
|
|
8
|
+
* Register a new device
|
|
9
|
+
* @param deviceData - Device information
|
|
10
|
+
* @returns Registered device object
|
|
11
|
+
*/
|
|
12
|
+
registerDevice(deviceData: any): Promise<any>;
|
|
13
|
+
/**
|
|
14
|
+
* Get all devices for the current user
|
|
15
|
+
* @returns Array of user devices
|
|
16
|
+
*/
|
|
17
|
+
getUserDevices(): Promise<any[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Remove a device
|
|
20
|
+
* @param deviceId - The device ID to remove
|
|
21
|
+
*/
|
|
22
|
+
removeDevice(deviceId: string): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Get device sessions for a given session ID
|
|
25
|
+
* Note: Not cached by default to ensure fresh data
|
|
26
|
+
* @param sessionId - The session ID
|
|
27
|
+
* @returns Array of device sessions
|
|
28
|
+
*/
|
|
29
|
+
getDeviceSessions(sessionId: string): Promise<any[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Logout all device sessions
|
|
32
|
+
* @param sessionId - The session ID
|
|
33
|
+
* @param deviceId - Optional device ID to target
|
|
34
|
+
* @param excludeCurrent - Whether to exclude the current session
|
|
35
|
+
* @returns Logout result
|
|
36
|
+
*/
|
|
37
|
+
logoutAllDeviceSessions(sessionId: string, deviceId?: string, excludeCurrent?: boolean): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* Update device name
|
|
40
|
+
* @param sessionId - The session ID
|
|
41
|
+
* @param deviceName - New device name
|
|
42
|
+
* @returns Updated device object
|
|
43
|
+
*/
|
|
44
|
+
updateDeviceName(sessionId: string, deviceName: string): Promise<any>;
|
|
45
|
+
/**
|
|
46
|
+
* Get security information
|
|
47
|
+
* @returns Security information object
|
|
48
|
+
*/
|
|
49
|
+
getSecurityInfo(): Promise<{
|
|
50
|
+
recoveryEmail: string | null;
|
|
51
|
+
}>;
|
|
52
|
+
httpService: import("../HttpService").HttpService;
|
|
53
|
+
cloudURL: string;
|
|
54
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
55
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
56
|
+
getBaseURL(): string;
|
|
57
|
+
getClient(): import("../HttpService").HttpService;
|
|
58
|
+
getMetrics(): {
|
|
59
|
+
totalRequests: number;
|
|
60
|
+
successfulRequests: number;
|
|
61
|
+
failedRequests: number;
|
|
62
|
+
cacheHits: number;
|
|
63
|
+
cacheMisses: number;
|
|
64
|
+
averageResponseTime: number;
|
|
65
|
+
};
|
|
66
|
+
clearCache(): void;
|
|
67
|
+
clearCacheEntry(key: string): void;
|
|
68
|
+
getCacheStats(): {
|
|
69
|
+
size: number;
|
|
70
|
+
hits: number;
|
|
71
|
+
misses: number;
|
|
72
|
+
hitRate: number;
|
|
73
|
+
};
|
|
74
|
+
getCloudURL(): string;
|
|
75
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
76
|
+
clearTokens(): void;
|
|
77
|
+
getCurrentUserId(): string | null;
|
|
78
|
+
hasValidToken(): boolean;
|
|
79
|
+
getAccessToken(): string | null;
|
|
80
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
81
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
82
|
+
maxRetries?: number;
|
|
83
|
+
retryDelay?: number;
|
|
84
|
+
authTimeoutMs?: number;
|
|
85
|
+
}): Promise<T_1>;
|
|
86
|
+
validate(): Promise<boolean>;
|
|
87
|
+
handleError(error: unknown): Error;
|
|
88
|
+
healthCheck(): Promise<{
|
|
89
|
+
status: string;
|
|
90
|
+
users?: number;
|
|
91
|
+
timestamp?: string;
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
}>;
|
|
94
|
+
};
|
|
95
|
+
__resetTokensForTests(): void;
|
|
96
|
+
} & T;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Features Methods Mixin
|
|
3
|
+
*
|
|
4
|
+
* Provides methods for various features:
|
|
5
|
+
* - Feedback submission
|
|
6
|
+
* - Subscription plans
|
|
7
|
+
* - Saves/Collections
|
|
8
|
+
* - User history
|
|
9
|
+
* - FAQ
|
|
10
|
+
* - User stats
|
|
11
|
+
* - Achievements
|
|
12
|
+
*/
|
|
13
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
14
|
+
export interface FeedbackPayload {
|
|
15
|
+
type: 'bug' | 'feature' | 'general' | 'support';
|
|
16
|
+
title: string;
|
|
17
|
+
description: string;
|
|
18
|
+
priority: 'low' | 'medium' | 'high' | 'critical';
|
|
19
|
+
category: string;
|
|
20
|
+
contactEmail?: string;
|
|
21
|
+
systemInfo?: {
|
|
22
|
+
platform: string;
|
|
23
|
+
version: string;
|
|
24
|
+
appVersion: string;
|
|
25
|
+
userId?: string;
|
|
26
|
+
username?: string;
|
|
27
|
+
timestamp: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface FeedbackResult {
|
|
31
|
+
id: string;
|
|
32
|
+
status: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
}
|
|
35
|
+
export interface SubscriptionPlan {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
price: number;
|
|
40
|
+
currency: string;
|
|
41
|
+
interval: 'month' | 'year';
|
|
42
|
+
features: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface SubscriptionResult {
|
|
45
|
+
subscriptionId: string;
|
|
46
|
+
status: string;
|
|
47
|
+
currentPeriodEnd: string;
|
|
48
|
+
}
|
|
49
|
+
export interface SavedItem {
|
|
50
|
+
id: string;
|
|
51
|
+
itemId: string;
|
|
52
|
+
itemType: string;
|
|
53
|
+
title: string;
|
|
54
|
+
createdAt: string;
|
|
55
|
+
}
|
|
56
|
+
export interface Collection {
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
itemCount: number;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
}
|
|
63
|
+
export interface UserStats {
|
|
64
|
+
postCount: number;
|
|
65
|
+
commentCount: number;
|
|
66
|
+
followerCount: number;
|
|
67
|
+
followingCount: number;
|
|
68
|
+
karmaScore?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface HistoryItem {
|
|
71
|
+
id: string;
|
|
72
|
+
type: string;
|
|
73
|
+
title: string;
|
|
74
|
+
timestamp: string;
|
|
75
|
+
metadata?: Record<string, any>;
|
|
76
|
+
}
|
|
77
|
+
export interface FAQ {
|
|
78
|
+
id: string;
|
|
79
|
+
question: string;
|
|
80
|
+
answer: string;
|
|
81
|
+
category: string;
|
|
82
|
+
}
|
|
83
|
+
export interface Achievement {
|
|
84
|
+
id: string;
|
|
85
|
+
name: string;
|
|
86
|
+
description: string;
|
|
87
|
+
icon: string;
|
|
88
|
+
unlockedAt?: string;
|
|
89
|
+
}
|
|
90
|
+
export declare function OxyServicesFeaturesMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
91
|
+
new (...args: any[]): {
|
|
92
|
+
/**
|
|
93
|
+
* Submit user feedback
|
|
94
|
+
*/
|
|
95
|
+
submitFeedback(payload: FeedbackPayload): Promise<FeedbackResult>;
|
|
96
|
+
/**
|
|
97
|
+
* Get available subscription plans
|
|
98
|
+
*/
|
|
99
|
+
getSubscriptionPlans(): Promise<SubscriptionPlan[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Get individual purchasable features
|
|
102
|
+
*/
|
|
103
|
+
getIndividualFeatures(): Promise<any[]>;
|
|
104
|
+
/**
|
|
105
|
+
* Subscribe to a plan
|
|
106
|
+
*/
|
|
107
|
+
subscribe(planId: string, paymentMethodId?: string): Promise<SubscriptionResult>;
|
|
108
|
+
/**
|
|
109
|
+
* Subscribe to an individual feature
|
|
110
|
+
*/
|
|
111
|
+
subscribeToFeature(featureId: string, paymentMethodId?: string): Promise<SubscriptionResult>;
|
|
112
|
+
/**
|
|
113
|
+
* Cancel subscription
|
|
114
|
+
*/
|
|
115
|
+
cancelSubscription(subscriptionId: string): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Reactivate subscription
|
|
118
|
+
*/
|
|
119
|
+
reactivateSubscription(subscriptionId: string): Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Get current user's subscription
|
|
122
|
+
*/
|
|
123
|
+
getCurrentSubscription(): Promise<SubscriptionResult | null>;
|
|
124
|
+
/**
|
|
125
|
+
* Get user's saved items
|
|
126
|
+
*/
|
|
127
|
+
getSavedItems(userId?: string): Promise<SavedItem[]>;
|
|
128
|
+
/**
|
|
129
|
+
* Get user's collections
|
|
130
|
+
*/
|
|
131
|
+
getCollections(userId?: string): Promise<Collection[]>;
|
|
132
|
+
/**
|
|
133
|
+
* Save an item
|
|
134
|
+
*/
|
|
135
|
+
saveItem(itemId: string, itemType: string, collectionId?: string): Promise<SavedItem>;
|
|
136
|
+
/**
|
|
137
|
+
* Remove an item from saves
|
|
138
|
+
*/
|
|
139
|
+
removeSavedItem(saveId: string): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Create a collection
|
|
142
|
+
*/
|
|
143
|
+
createCollection(name: string, description?: string): Promise<Collection>;
|
|
144
|
+
/**
|
|
145
|
+
* Delete a collection
|
|
146
|
+
*/
|
|
147
|
+
deleteCollection(collectionId: string): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Get user statistics
|
|
150
|
+
*/
|
|
151
|
+
getUserStats(userId: string): Promise<UserStats>;
|
|
152
|
+
/**
|
|
153
|
+
* Get user history
|
|
154
|
+
*/
|
|
155
|
+
getUserHistory(userId?: string, limit?: number, offset?: number): Promise<HistoryItem[]>;
|
|
156
|
+
/**
|
|
157
|
+
* Clear user history
|
|
158
|
+
*/
|
|
159
|
+
clearUserHistory(): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Delete a history item
|
|
162
|
+
*/
|
|
163
|
+
deleteHistoryItem(itemId: string): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Get FAQs
|
|
166
|
+
*/
|
|
167
|
+
getFAQs(category?: string): Promise<FAQ[]>;
|
|
168
|
+
/**
|
|
169
|
+
* Search FAQs
|
|
170
|
+
*/
|
|
171
|
+
searchFAQs(query: string): Promise<FAQ[]>;
|
|
172
|
+
/**
|
|
173
|
+
* Get user achievements
|
|
174
|
+
*/
|
|
175
|
+
getUserAchievements(userId?: string): Promise<Achievement[]>;
|
|
176
|
+
/**
|
|
177
|
+
* Get all available achievements
|
|
178
|
+
*/
|
|
179
|
+
getAllAchievements(): Promise<Achievement[]>;
|
|
180
|
+
/**
|
|
181
|
+
* Delete user account (requires password confirmation)
|
|
182
|
+
*/
|
|
183
|
+
deleteAccount(password: string): Promise<void>;
|
|
184
|
+
httpService: import("../HttpService").HttpService;
|
|
185
|
+
cloudURL: string;
|
|
186
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
187
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
188
|
+
getBaseURL(): string;
|
|
189
|
+
getClient(): import("../HttpService").HttpService;
|
|
190
|
+
getMetrics(): {
|
|
191
|
+
totalRequests: number;
|
|
192
|
+
successfulRequests: number;
|
|
193
|
+
failedRequests: number;
|
|
194
|
+
cacheHits: number;
|
|
195
|
+
cacheMisses: number;
|
|
196
|
+
averageResponseTime: number;
|
|
197
|
+
};
|
|
198
|
+
clearCache(): void;
|
|
199
|
+
clearCacheEntry(key: string): void;
|
|
200
|
+
getCacheStats(): {
|
|
201
|
+
size: number;
|
|
202
|
+
hits: number;
|
|
203
|
+
misses: number;
|
|
204
|
+
hitRate: number;
|
|
205
|
+
};
|
|
206
|
+
getCloudURL(): string;
|
|
207
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
208
|
+
clearTokens(): void;
|
|
209
|
+
getCurrentUserId(): string | null;
|
|
210
|
+
hasValidToken(): boolean;
|
|
211
|
+
getAccessToken(): string | null;
|
|
212
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
213
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
214
|
+
maxRetries?: number;
|
|
215
|
+
retryDelay?: number;
|
|
216
|
+
authTimeoutMs?: number;
|
|
217
|
+
}): Promise<T_1>;
|
|
218
|
+
validate(): Promise<boolean>;
|
|
219
|
+
handleError(error: unknown): Error;
|
|
220
|
+
healthCheck(): Promise<{
|
|
221
|
+
status: string;
|
|
222
|
+
users?: number;
|
|
223
|
+
timestamp?: string;
|
|
224
|
+
[key: string]: any;
|
|
225
|
+
}>;
|
|
226
|
+
};
|
|
227
|
+
__resetTokensForTests(): void;
|
|
228
|
+
} & T;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
2
|
+
import type { SessionLoginResponse } from '../../models/session';
|
|
3
|
+
export interface FedCMAuthOptions {
|
|
4
|
+
nonce?: string;
|
|
5
|
+
context?: 'signin' | 'signup' | 'continue' | 'use';
|
|
6
|
+
}
|
|
7
|
+
export interface FedCMConfig {
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
configURL: string;
|
|
10
|
+
clientId?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Federated Credential Management (FedCM) Authentication Mixin
|
|
14
|
+
*
|
|
15
|
+
* Implements the modern browser-native identity federation API that enables
|
|
16
|
+
* Google-style cross-domain authentication without third-party cookies.
|
|
17
|
+
*
|
|
18
|
+
* Browser Support:
|
|
19
|
+
* - Chrome 108+
|
|
20
|
+
* - Safari 16.4+
|
|
21
|
+
* - Edge 108+
|
|
22
|
+
* - Firefox: Not yet supported (fallback required)
|
|
23
|
+
*
|
|
24
|
+
* Key Features:
|
|
25
|
+
* - No redirects or popups required
|
|
26
|
+
* - Browser-native UI prompts
|
|
27
|
+
* - Privacy-preserving (IdP can't track users)
|
|
28
|
+
* - Automatic SSO across domains
|
|
29
|
+
* - Silent re-authentication support
|
|
30
|
+
*
|
|
31
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/FedCM_API
|
|
32
|
+
*/
|
|
33
|
+
export declare function OxyServicesFedCMMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
34
|
+
new (...args: any[]): {
|
|
35
|
+
/**
|
|
36
|
+
* Instance method to check FedCM support
|
|
37
|
+
*/
|
|
38
|
+
isFedCMSupported(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Sign in using FedCM (Federated Credential Management API)
|
|
41
|
+
*
|
|
42
|
+
* This provides a Google-style authentication experience:
|
|
43
|
+
* - Browser shows native "Sign in with Oxy" prompt
|
|
44
|
+
* - No redirect or popup required
|
|
45
|
+
* - User approves → credential exchange happens in browser
|
|
46
|
+
* - All apps automatically get SSO after first sign-in
|
|
47
|
+
*
|
|
48
|
+
* @param options - Authentication options
|
|
49
|
+
* @returns Session with access token and user data
|
|
50
|
+
* @throws {OxyAuthenticationError} If FedCM not supported or user cancels
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* try {
|
|
55
|
+
* const session = await oxyServices.signInWithFedCM();
|
|
56
|
+
* console.log('Signed in:', session.user);
|
|
57
|
+
* } catch (error) {
|
|
58
|
+
* // Fallback to popup or redirect auth
|
|
59
|
+
* await oxyServices.signInWithPopup();
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
signInWithFedCM(options?: FedCMAuthOptions): Promise<SessionLoginResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Silent sign-in using FedCM
|
|
66
|
+
*
|
|
67
|
+
* Attempts to automatically re-authenticate the user without any UI.
|
|
68
|
+
* This is what enables "instant sign-in" across all Oxy domains after
|
|
69
|
+
* the user has signed in once.
|
|
70
|
+
*
|
|
71
|
+
* The browser will:
|
|
72
|
+
* 1. Check if user has previously signed in to Oxy
|
|
73
|
+
* 2. Check if user is still signed in at auth.oxy.so
|
|
74
|
+
* 3. If yes, automatically provide credential without prompting
|
|
75
|
+
*
|
|
76
|
+
* @returns Session if user is already signed in, null otherwise
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* // On app startup
|
|
81
|
+
* useEffect(() => {
|
|
82
|
+
* const checkAuth = async () => {
|
|
83
|
+
* const session = await oxyServices.silentSignInWithFedCM();
|
|
84
|
+
* if (session) {
|
|
85
|
+
* setUser(session.user);
|
|
86
|
+
* } else {
|
|
87
|
+
* // Show sign-in button
|
|
88
|
+
* }
|
|
89
|
+
* };
|
|
90
|
+
* checkAuth();
|
|
91
|
+
* }, []);
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
silentSignInWithFedCM(): Promise<SessionLoginResponse | null>;
|
|
95
|
+
/**
|
|
96
|
+
* Request identity credential from browser using FedCM API
|
|
97
|
+
*
|
|
98
|
+
* Uses a global lock to prevent concurrent requests, as FedCM only
|
|
99
|
+
* allows one navigator.credentials.get request at a time.
|
|
100
|
+
*
|
|
101
|
+
* Interactive requests (optional/required) wait for any silent request to finish first.
|
|
102
|
+
*
|
|
103
|
+
* @private
|
|
104
|
+
*/
|
|
105
|
+
requestIdentityCredential(options: {
|
|
106
|
+
configURL: string;
|
|
107
|
+
clientId: string;
|
|
108
|
+
nonce: string;
|
|
109
|
+
context?: string;
|
|
110
|
+
mediation?: "silent" | "optional" | "required";
|
|
111
|
+
}): Promise<{
|
|
112
|
+
token: string;
|
|
113
|
+
} | null>;
|
|
114
|
+
/**
|
|
115
|
+
* Exchange FedCM ID token for Oxy session
|
|
116
|
+
*
|
|
117
|
+
* The ID token is a JWT issued by auth.oxy.so that proves the user's
|
|
118
|
+
* identity. We exchange it for a full Oxy session with access token.
|
|
119
|
+
*
|
|
120
|
+
* @private
|
|
121
|
+
*/
|
|
122
|
+
exchangeIdTokenForSession(idToken: string): Promise<SessionLoginResponse>;
|
|
123
|
+
/**
|
|
124
|
+
* Revoke FedCM credential (sign out)
|
|
125
|
+
*
|
|
126
|
+
* This tells the browser to forget the FedCM credential for this app.
|
|
127
|
+
* The user will need to re-authenticate next time.
|
|
128
|
+
*/
|
|
129
|
+
revokeFedCMCredential(): Promise<void>;
|
|
130
|
+
/**
|
|
131
|
+
* Get configuration for FedCM
|
|
132
|
+
*
|
|
133
|
+
* @returns FedCM configuration with browser support info
|
|
134
|
+
*/
|
|
135
|
+
getFedCMConfig(): FedCMConfig;
|
|
136
|
+
/**
|
|
137
|
+
* Generate a cryptographically secure nonce for FedCM
|
|
138
|
+
*
|
|
139
|
+
* @private
|
|
140
|
+
*/
|
|
141
|
+
generateNonce(): string;
|
|
142
|
+
/**
|
|
143
|
+
* Get the client ID for this origin
|
|
144
|
+
*
|
|
145
|
+
* @private
|
|
146
|
+
*/
|
|
147
|
+
getClientId(): string;
|
|
148
|
+
httpService: import("../HttpService").HttpService;
|
|
149
|
+
cloudURL: string;
|
|
150
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
151
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
152
|
+
getBaseURL(): string;
|
|
153
|
+
getClient(): import("../HttpService").HttpService;
|
|
154
|
+
getMetrics(): {
|
|
155
|
+
totalRequests: number;
|
|
156
|
+
successfulRequests: number;
|
|
157
|
+
failedRequests: number;
|
|
158
|
+
cacheHits: number;
|
|
159
|
+
cacheMisses: number;
|
|
160
|
+
averageResponseTime: number;
|
|
161
|
+
};
|
|
162
|
+
clearCache(): void;
|
|
163
|
+
clearCacheEntry(key: string): void;
|
|
164
|
+
getCacheStats(): {
|
|
165
|
+
size: number;
|
|
166
|
+
hits: number;
|
|
167
|
+
misses: number;
|
|
168
|
+
hitRate: number;
|
|
169
|
+
};
|
|
170
|
+
getCloudURL(): string;
|
|
171
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
172
|
+
clearTokens(): void;
|
|
173
|
+
getCurrentUserId(): string | null;
|
|
174
|
+
hasValidToken(): boolean;
|
|
175
|
+
getAccessToken(): string | null;
|
|
176
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
177
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
178
|
+
maxRetries?: number;
|
|
179
|
+
retryDelay?: number;
|
|
180
|
+
authTimeoutMs?: number;
|
|
181
|
+
}): Promise<T_1>;
|
|
182
|
+
validate(): Promise<boolean>;
|
|
183
|
+
handleError(error: unknown): Error;
|
|
184
|
+
healthCheck(): Promise<{
|
|
185
|
+
status: string;
|
|
186
|
+
users?: number;
|
|
187
|
+
timestamp?: string;
|
|
188
|
+
[key: string]: any;
|
|
189
|
+
}>;
|
|
190
|
+
};
|
|
191
|
+
readonly DEFAULT_CONFIG_URL: "https://auth.oxy.so/fedcm.json";
|
|
192
|
+
readonly FEDCM_TIMEOUT: 60000;
|
|
193
|
+
readonly FEDCM_SILENT_TIMEOUT: 10000;
|
|
194
|
+
/**
|
|
195
|
+
* Check if FedCM is supported in the current browser
|
|
196
|
+
*/
|
|
197
|
+
isFedCMSupported(): boolean;
|
|
198
|
+
__resetTokensForTests(): void;
|
|
199
|
+
} & T;
|
|
200
|
+
export { OxyServicesFedCMMixin as FedCMMixin };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Karma Methods Mixin
|
|
3
|
+
*
|
|
4
|
+
* Provides methods for karma system management
|
|
5
|
+
*/
|
|
6
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
7
|
+
export declare function OxyServicesKarmaMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
8
|
+
new (...args: any[]): {
|
|
9
|
+
/**
|
|
10
|
+
* Get user karma
|
|
11
|
+
*/
|
|
12
|
+
getUserKarma(userId: string): Promise<any>;
|
|
13
|
+
/**
|
|
14
|
+
* Give karma to user
|
|
15
|
+
*/
|
|
16
|
+
giveKarma(userId: string, amount: number, reason?: string): Promise<any>;
|
|
17
|
+
/**
|
|
18
|
+
* Get user karma total
|
|
19
|
+
* @param userId - The user ID
|
|
20
|
+
* @returns User karma total
|
|
21
|
+
*/
|
|
22
|
+
getUserKarmaTotal(userId: string): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Get user karma history
|
|
25
|
+
* @param userId - The user ID
|
|
26
|
+
* @param limit - Optional limit for results
|
|
27
|
+
* @param offset - Optional offset for pagination
|
|
28
|
+
* @returns User karma history
|
|
29
|
+
*/
|
|
30
|
+
getUserKarmaHistory(userId: string, limit?: number, offset?: number): Promise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* Get karma leaderboard
|
|
33
|
+
* @returns Karma leaderboard
|
|
34
|
+
*/
|
|
35
|
+
getKarmaLeaderboard(): Promise<any>;
|
|
36
|
+
/**
|
|
37
|
+
* Get karma rules
|
|
38
|
+
* @returns Karma rules
|
|
39
|
+
*/
|
|
40
|
+
getKarmaRules(): Promise<any>;
|
|
41
|
+
httpService: import("../HttpService").HttpService;
|
|
42
|
+
cloudURL: string;
|
|
43
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
44
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
45
|
+
getBaseURL(): string;
|
|
46
|
+
getClient(): import("../HttpService").HttpService;
|
|
47
|
+
getMetrics(): {
|
|
48
|
+
totalRequests: number;
|
|
49
|
+
successfulRequests: number;
|
|
50
|
+
failedRequests: number;
|
|
51
|
+
cacheHits: number;
|
|
52
|
+
cacheMisses: number;
|
|
53
|
+
averageResponseTime: number;
|
|
54
|
+
};
|
|
55
|
+
clearCache(): void;
|
|
56
|
+
clearCacheEntry(key: string): void;
|
|
57
|
+
getCacheStats(): {
|
|
58
|
+
size: number;
|
|
59
|
+
hits: number;
|
|
60
|
+
misses: number;
|
|
61
|
+
hitRate: number;
|
|
62
|
+
};
|
|
63
|
+
getCloudURL(): string;
|
|
64
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
65
|
+
clearTokens(): void;
|
|
66
|
+
getCurrentUserId(): string | null;
|
|
67
|
+
hasValidToken(): boolean;
|
|
68
|
+
getAccessToken(): string | null;
|
|
69
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
70
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
71
|
+
maxRetries?: number;
|
|
72
|
+
retryDelay?: number;
|
|
73
|
+
authTimeoutMs?: number;
|
|
74
|
+
}): Promise<T_1>;
|
|
75
|
+
validate(): Promise<boolean>;
|
|
76
|
+
handleError(error: unknown): Error;
|
|
77
|
+
healthCheck(): Promise<{
|
|
78
|
+
status: string;
|
|
79
|
+
users?: number;
|
|
80
|
+
timestamp?: string;
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
}>;
|
|
83
|
+
};
|
|
84
|
+
__resetTokensForTests(): void;
|
|
85
|
+
} & T;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { LanguageMetadata } from '../../utils/languageUtils';
|
|
2
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
3
|
+
export declare function OxyServicesLanguageMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
4
|
+
new (...args: any[]): {
|
|
5
|
+
/**
|
|
6
|
+
* Get appropriate storage for the platform (similar to DeviceManager)
|
|
7
|
+
*/
|
|
8
|
+
getStorage(): Promise<{
|
|
9
|
+
getItem: (key: string) => Promise<string | null>;
|
|
10
|
+
setItem: (key: string, value: string) => Promise<void>;
|
|
11
|
+
removeItem: (key: string) => Promise<void>;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Get the current language from storage or user profile
|
|
15
|
+
* @param storageKeyPrefix - Optional prefix for storage key (default: 'oxy_session')
|
|
16
|
+
* @returns The current language code (e.g., 'en-US') or null if not set
|
|
17
|
+
*/
|
|
18
|
+
getCurrentLanguage(storageKeyPrefix?: string): Promise<string | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the current language with metadata (name, nativeName, etc.)
|
|
21
|
+
* @param storageKeyPrefix - Optional prefix for storage key (default: 'oxy_session')
|
|
22
|
+
* @returns Language metadata object or null if not set
|
|
23
|
+
*/
|
|
24
|
+
getCurrentLanguageMetadata(storageKeyPrefix?: string): Promise<LanguageMetadata | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Get the current language name (e.g., 'English')
|
|
27
|
+
* @param storageKeyPrefix - Optional prefix for storage key (default: 'oxy_session')
|
|
28
|
+
* @returns Language name or null if not set
|
|
29
|
+
*/
|
|
30
|
+
getCurrentLanguageName(storageKeyPrefix?: string): Promise<string | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Get the current native language name (e.g., 'Español')
|
|
33
|
+
* @param storageKeyPrefix - Optional prefix for storage key (default: 'oxy_session')
|
|
34
|
+
* @returns Native language name or null if not set
|
|
35
|
+
*/
|
|
36
|
+
getCurrentNativeLanguageName(storageKeyPrefix?: string): Promise<string | null>;
|
|
37
|
+
httpService: import("../HttpService").HttpService;
|
|
38
|
+
cloudURL: string;
|
|
39
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
40
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
41
|
+
getBaseURL(): string;
|
|
42
|
+
getClient(): import("../HttpService").HttpService;
|
|
43
|
+
getMetrics(): {
|
|
44
|
+
totalRequests: number;
|
|
45
|
+
successfulRequests: number;
|
|
46
|
+
failedRequests: number;
|
|
47
|
+
cacheHits: number;
|
|
48
|
+
cacheMisses: number;
|
|
49
|
+
averageResponseTime: number;
|
|
50
|
+
};
|
|
51
|
+
clearCache(): void;
|
|
52
|
+
clearCacheEntry(key: string): void;
|
|
53
|
+
getCacheStats(): {
|
|
54
|
+
size: number;
|
|
55
|
+
hits: number;
|
|
56
|
+
misses: number;
|
|
57
|
+
hitRate: number;
|
|
58
|
+
};
|
|
59
|
+
getCloudURL(): string;
|
|
60
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
61
|
+
clearTokens(): void;
|
|
62
|
+
getCurrentUserId(): string | null;
|
|
63
|
+
hasValidToken(): boolean;
|
|
64
|
+
getAccessToken(): string | null;
|
|
65
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
66
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
67
|
+
maxRetries?: number;
|
|
68
|
+
retryDelay?: number;
|
|
69
|
+
authTimeoutMs?: number;
|
|
70
|
+
}): Promise<T_1>;
|
|
71
|
+
validate(): Promise<boolean>;
|
|
72
|
+
handleError(error: unknown): Error;
|
|
73
|
+
healthCheck(): Promise<{
|
|
74
|
+
status: string;
|
|
75
|
+
users?: number;
|
|
76
|
+
timestamp?: string;
|
|
77
|
+
[key: string]: any;
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
80
|
+
__resetTokensForTests(): void;
|
|
81
|
+
} & T;
|