@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,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OxyServices - Unified client for Oxy API and Oxy Cloud
|
|
3
|
+
*
|
|
4
|
+
* # Usage Examples
|
|
5
|
+
*
|
|
6
|
+
* ## Browser (ESM/TypeScript)
|
|
7
|
+
*
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { OxyServices } from './core/OxyServices';
|
|
10
|
+
*
|
|
11
|
+
* const oxy = new OxyServices({
|
|
12
|
+
* baseURL: 'https://api.oxy.so',
|
|
13
|
+
* cloudURL: 'https://cloud.oxy.so',
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* // Authenticate and fetch user
|
|
17
|
+
* await oxy.setTokens('ACCESS_TOKEN');
|
|
18
|
+
* const user = await oxy.getCurrentUser();
|
|
19
|
+
*
|
|
20
|
+
* // Upload a file (browser File API)
|
|
21
|
+
* const fileInput = document.querySelector('input[type=file]');
|
|
22
|
+
* const file = fileInput.files[0];
|
|
23
|
+
* await oxy.uploadRawFile(file);
|
|
24
|
+
*
|
|
25
|
+
* // Get a file download URL for <img src>
|
|
26
|
+
* const url = oxy.getFileDownloadUrl('fileId', 'thumb');
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* ## Node.js (CommonJS/TypeScript)
|
|
30
|
+
*
|
|
31
|
+
* ```typescript
|
|
32
|
+
* import { OxyServices } from './core/OxyServices';
|
|
33
|
+
* import fs from 'fs';
|
|
34
|
+
*
|
|
35
|
+
* const oxy = new OxyServices({
|
|
36
|
+
* baseURL: 'https://api.oxy.so',
|
|
37
|
+
* cloudURL: 'https://cloud.oxy.so',
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* // Authenticate and fetch user
|
|
41
|
+
* await oxy.setTokens('ACCESS_TOKEN');
|
|
42
|
+
* const user = await oxy.getCurrentUser();
|
|
43
|
+
*
|
|
44
|
+
* // Upload a file (Node.js Buffer)
|
|
45
|
+
* const buffer = fs.readFileSync('myfile.png');
|
|
46
|
+
* const blob = new Blob([buffer]);
|
|
47
|
+
* await oxy.uploadRawFile(blob, { filename: 'myfile.png' });
|
|
48
|
+
*
|
|
49
|
+
* // Get a file download URL
|
|
50
|
+
* const url = oxy.getFileDownloadUrl('fileId');
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* ## Configuration
|
|
54
|
+
* - `baseURL`: Oxy API endpoint (e.g., https://api.oxy.so)
|
|
55
|
+
* - `cloudURL`: Oxy Cloud/CDN endpoint (e.g., https://cloud.oxy.so)
|
|
56
|
+
*
|
|
57
|
+
* See method JSDoc for more details and options.
|
|
58
|
+
*/
|
|
59
|
+
import { type OxyConfig } from './OxyServices.base';
|
|
60
|
+
import { OxyAuthenticationError, OxyAuthenticationTimeoutError } from './OxyServices.errors';
|
|
61
|
+
import { composeOxyServices } from './mixins';
|
|
62
|
+
declare const OxyServices_base: any;
|
|
63
|
+
export declare class OxyServices extends OxyServices_base {
|
|
64
|
+
constructor(config: OxyConfig);
|
|
65
|
+
}
|
|
66
|
+
export interface OxyServices extends InstanceType<ReturnType<typeof composeOxyServices>> {
|
|
67
|
+
}
|
|
68
|
+
export { OxyAuthenticationError, OxyAuthenticationTimeoutError };
|
|
69
|
+
/**
|
|
70
|
+
* Export the default Oxy Cloud URL (for backward compatibility)
|
|
71
|
+
*/
|
|
72
|
+
export declare const OXY_CLOUD_URL = "https://cloud.oxy.so";
|
|
73
|
+
/**
|
|
74
|
+
* Export the default Oxy API URL (for documentation)
|
|
75
|
+
*/
|
|
76
|
+
export declare const OXY_API_URL: any;
|
|
77
|
+
/**
|
|
78
|
+
* Pre-configured client instance for easy import
|
|
79
|
+
* Uses OXY_API_URL as baseURL and OXY_CLOUD_URL as cloudURL
|
|
80
|
+
*/
|
|
81
|
+
export declare const oxyClient: OxyServices;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom error types for better error handling
|
|
3
|
+
*/
|
|
4
|
+
export declare class OxyAuthenticationError extends Error {
|
|
5
|
+
readonly code: string;
|
|
6
|
+
readonly status: number;
|
|
7
|
+
constructor(message: string, code?: string, status?: number);
|
|
8
|
+
}
|
|
9
|
+
export declare class OxyAuthenticationTimeoutError extends OxyAuthenticationError {
|
|
10
|
+
constructor(operationName: string, timeoutMs: number);
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OxyServices Core Module - Unified Architecture
|
|
3
|
+
*
|
|
4
|
+
* This module exports the unified OxyServices class that provides all API functionality
|
|
5
|
+
* in one simple, easy-to-use interface.
|
|
6
|
+
*/
|
|
7
|
+
export { OxyServices, OxyAuthenticationError, OxyAuthenticationTimeoutError } from './OxyServices';
|
|
8
|
+
export { OXY_CLOUD_URL, oxyClient } from './OxyServices';
|
|
9
|
+
export { CrossDomainAuth, createCrossDomainAuth } from './CrossDomainAuth';
|
|
10
|
+
export type { CrossDomainAuthOptions } from './CrossDomainAuth';
|
|
11
|
+
export { AuthManager, createAuthManager } from './AuthManager';
|
|
12
|
+
export type { StorageAdapter, AuthStateChangeCallback, AuthMethod, AuthManagerConfig } from './AuthManager';
|
|
13
|
+
export * from '../models/interfaces';
|
|
14
|
+
export * from '../models/session';
|
|
15
|
+
export { DeviceManager } from '../utils/deviceManager';
|
|
16
|
+
export type { DeviceFingerprint, StoredDeviceInfo } from '../utils/deviceManager';
|
|
17
|
+
export { SUPPORTED_LANGUAGES, getLanguageMetadata, getLanguageName, getNativeLanguageName, normalizeLanguageCode } from '../utils/languageUtils';
|
|
18
|
+
export type { LanguageMetadata } from '../utils/languageUtils';
|
|
19
|
+
import { OxyServices } from './OxyServices';
|
|
20
|
+
export default OxyServices;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics Methods Mixin
|
|
3
|
+
*
|
|
4
|
+
* Provides methods for analytics tracking and data retrieval
|
|
5
|
+
*/
|
|
6
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
7
|
+
export declare function OxyServicesAnalyticsMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
8
|
+
new (...args: any[]): {
|
|
9
|
+
/**
|
|
10
|
+
* Track an analytics event
|
|
11
|
+
* @param eventName - Name of the event to track
|
|
12
|
+
* @param properties - Optional event properties
|
|
13
|
+
*/
|
|
14
|
+
trackEvent(eventName: string, properties?: Record<string, any>): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Get analytics data for a date range
|
|
17
|
+
* @param startDate - Optional start date (ISO string)
|
|
18
|
+
* @param endDate - Optional end date (ISO string)
|
|
19
|
+
* @returns Analytics data
|
|
20
|
+
*/
|
|
21
|
+
getAnalytics(startDate?: string, endDate?: string): Promise<any>;
|
|
22
|
+
httpService: import("../HttpService").HttpService;
|
|
23
|
+
cloudURL: string;
|
|
24
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
25
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
26
|
+
getBaseURL(): string;
|
|
27
|
+
getClient(): import("../HttpService").HttpService;
|
|
28
|
+
getMetrics(): {
|
|
29
|
+
totalRequests: number;
|
|
30
|
+
successfulRequests: number;
|
|
31
|
+
failedRequests: number;
|
|
32
|
+
cacheHits: number;
|
|
33
|
+
cacheMisses: number;
|
|
34
|
+
averageResponseTime: number;
|
|
35
|
+
};
|
|
36
|
+
clearCache(): void;
|
|
37
|
+
clearCacheEntry(key: string): void;
|
|
38
|
+
getCacheStats(): {
|
|
39
|
+
size: number;
|
|
40
|
+
hits: number;
|
|
41
|
+
misses: number;
|
|
42
|
+
hitRate: number;
|
|
43
|
+
};
|
|
44
|
+
getCloudURL(): string;
|
|
45
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
46
|
+
clearTokens(): void;
|
|
47
|
+
getCurrentUserId(): string | null;
|
|
48
|
+
hasValidToken(): boolean;
|
|
49
|
+
getAccessToken(): string | null;
|
|
50
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
51
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
52
|
+
maxRetries?: number;
|
|
53
|
+
retryDelay?: number;
|
|
54
|
+
authTimeoutMs?: number;
|
|
55
|
+
}): Promise<T_1>;
|
|
56
|
+
validate(): Promise<boolean>;
|
|
57
|
+
handleError(error: unknown): Error;
|
|
58
|
+
healthCheck(): Promise<{
|
|
59
|
+
status: string;
|
|
60
|
+
users?: number;
|
|
61
|
+
timestamp?: string;
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
__resetTokensForTests(): void;
|
|
66
|
+
} & T;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { AccountStorageUsageResponse, AssetUrlResponse, AssetVariant } from '../../models/interfaces';
|
|
2
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
3
|
+
export declare function OxyServicesAssetsMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
4
|
+
new (...args: any[]): {
|
|
5
|
+
/**
|
|
6
|
+
* Delete file
|
|
7
|
+
*/
|
|
8
|
+
deleteFile(fileId: string): Promise<any>;
|
|
9
|
+
/**
|
|
10
|
+
* Get file download URL (synchronous - uses stream endpoint for images to avoid ORB blocking)
|
|
11
|
+
*/
|
|
12
|
+
getFileDownloadUrl(fileId: string, variant?: string, expiresIn?: number): string;
|
|
13
|
+
/**
|
|
14
|
+
* Get file download URL asynchronously (returns signed URL directly from CDN)
|
|
15
|
+
*/
|
|
16
|
+
getFileDownloadUrlAsync(fileId: string, variant?: string, expiresIn?: number): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* List user files
|
|
19
|
+
*/
|
|
20
|
+
listUserFiles(limit?: number, offset?: number): Promise<{
|
|
21
|
+
files: any[];
|
|
22
|
+
total: number;
|
|
23
|
+
hasMore: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Get account storage usage (server-side usage aggregated from assets)
|
|
27
|
+
*/
|
|
28
|
+
getAccountStorageUsage(): Promise<AccountStorageUsageResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Get file content as text
|
|
31
|
+
*/
|
|
32
|
+
getFileContentAsText(fileId: string, variant?: string): Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Get file content as blob
|
|
35
|
+
*/
|
|
36
|
+
getFileContentAsBlob(fileId: string, variant?: string): Promise<Blob>;
|
|
37
|
+
/**
|
|
38
|
+
* Get batch access to multiple files
|
|
39
|
+
*/
|
|
40
|
+
getBatchFileAccess(fileIds: string[], context?: string): Promise<Record<string, any>>;
|
|
41
|
+
/**
|
|
42
|
+
* Get download URLs for multiple files efficiently
|
|
43
|
+
*/
|
|
44
|
+
getFileDownloadUrls(fileIds: string[], context?: string): Promise<Record<string, string>>;
|
|
45
|
+
/**
|
|
46
|
+
* Upload raw file data
|
|
47
|
+
*/
|
|
48
|
+
uploadRawFile(file: File | Blob, visibility?: "private" | "public" | "unlisted", metadata?: Record<string, any>): Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* Upload file using Central Asset Service
|
|
51
|
+
*/
|
|
52
|
+
assetUpload(file: File, visibility?: "private" | "public" | "unlisted", metadata?: Record<string, any>, onProgress?: (progress: number) => void): Promise<any>;
|
|
53
|
+
/**
|
|
54
|
+
* Link asset to an entity
|
|
55
|
+
*/
|
|
56
|
+
assetLink(fileId: string, app: string, entityType: string, entityId: string, visibility?: "private" | "public" | "unlisted", webhookUrl?: string): Promise<any>;
|
|
57
|
+
/**
|
|
58
|
+
* Unlink asset from an entity
|
|
59
|
+
*/
|
|
60
|
+
assetUnlink(fileId: string, app: string, entityType: string, entityId: string): Promise<any>;
|
|
61
|
+
/**
|
|
62
|
+
* Get asset metadata
|
|
63
|
+
*/
|
|
64
|
+
assetGet(fileId: string): Promise<any>;
|
|
65
|
+
/**
|
|
66
|
+
* Get asset URL (CDN or signed URL)
|
|
67
|
+
*/
|
|
68
|
+
assetGetUrl(fileId: string, variant?: string, expiresIn?: number): Promise<AssetUrlResponse>;
|
|
69
|
+
/**
|
|
70
|
+
* Restore asset from trash
|
|
71
|
+
*/
|
|
72
|
+
assetRestore(fileId: string): Promise<any>;
|
|
73
|
+
/**
|
|
74
|
+
* Delete asset with optional force
|
|
75
|
+
*/
|
|
76
|
+
assetDelete(fileId: string, force?: boolean): Promise<any>;
|
|
77
|
+
/**
|
|
78
|
+
* Get list of available variants for an asset
|
|
79
|
+
*/
|
|
80
|
+
assetGetVariants(fileId: string): Promise<AssetVariant[]>;
|
|
81
|
+
/**
|
|
82
|
+
* Update asset visibility
|
|
83
|
+
*/
|
|
84
|
+
assetUpdateVisibility(fileId: string, visibility: "private" | "public" | "unlisted"): Promise<any>;
|
|
85
|
+
uploadAvatar(file: File, userId: string, app?: string): Promise<any>;
|
|
86
|
+
uploadProfileBanner(file: File, userId: string, app?: string): Promise<any>;
|
|
87
|
+
getAssetUrlCacheTTL(expiresIn?: number): number;
|
|
88
|
+
fetchAssetDownloadUrl(fileId: string, variant?: string, cacheTTL?: number, expiresIn?: number): Promise<string | null>;
|
|
89
|
+
fetchAssetContent(url: string, type: "text"): Promise<string>;
|
|
90
|
+
fetchAssetContent(url: string, type: "blob"): Promise<Blob>;
|
|
91
|
+
httpService: import("../HttpService").HttpService;
|
|
92
|
+
cloudURL: string;
|
|
93
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
94
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
95
|
+
getBaseURL(): string;
|
|
96
|
+
getClient(): import("../HttpService").HttpService;
|
|
97
|
+
getMetrics(): {
|
|
98
|
+
totalRequests: number;
|
|
99
|
+
successfulRequests: number;
|
|
100
|
+
failedRequests: number;
|
|
101
|
+
cacheHits: number;
|
|
102
|
+
cacheMisses: number;
|
|
103
|
+
averageResponseTime: number;
|
|
104
|
+
};
|
|
105
|
+
clearCache(): void;
|
|
106
|
+
clearCacheEntry(key: string): void;
|
|
107
|
+
getCacheStats(): {
|
|
108
|
+
size: number;
|
|
109
|
+
hits: number;
|
|
110
|
+
misses: number;
|
|
111
|
+
hitRate: number;
|
|
112
|
+
};
|
|
113
|
+
getCloudURL(): string;
|
|
114
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
115
|
+
clearTokens(): void;
|
|
116
|
+
getCurrentUserId(): string | null;
|
|
117
|
+
hasValidToken(): boolean;
|
|
118
|
+
getAccessToken(): string | null;
|
|
119
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
120
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
121
|
+
maxRetries?: number;
|
|
122
|
+
retryDelay?: number;
|
|
123
|
+
authTimeoutMs?: number;
|
|
124
|
+
}): Promise<T_1>;
|
|
125
|
+
validate(): Promise<boolean>;
|
|
126
|
+
handleError(error: unknown): Error;
|
|
127
|
+
healthCheck(): Promise<{
|
|
128
|
+
status: string;
|
|
129
|
+
users?: number;
|
|
130
|
+
timestamp?: string;
|
|
131
|
+
[key: string]: any;
|
|
132
|
+
}>;
|
|
133
|
+
};
|
|
134
|
+
__resetTokensForTests(): void;
|
|
135
|
+
} & T;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication Methods Mixin
|
|
3
|
+
*
|
|
4
|
+
* Supports password-based login (email/username) and public key challenge-response.
|
|
5
|
+
*/
|
|
6
|
+
import type { User } from '../../models/interfaces';
|
|
7
|
+
import type { SessionLoginResponse } from '../../models/session';
|
|
8
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
9
|
+
export interface ChallengeResponse {
|
|
10
|
+
challenge: string;
|
|
11
|
+
expiresAt: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RegistrationRequest {
|
|
14
|
+
publicKey: string;
|
|
15
|
+
username: string;
|
|
16
|
+
email?: string;
|
|
17
|
+
signature: string;
|
|
18
|
+
timestamp: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ChallengeVerifyRequest {
|
|
21
|
+
publicKey: string;
|
|
22
|
+
challenge: string;
|
|
23
|
+
signature: string;
|
|
24
|
+
timestamp: number;
|
|
25
|
+
deviceName?: string;
|
|
26
|
+
deviceFingerprint?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface PublicKeyCheckResponse {
|
|
29
|
+
registered: boolean;
|
|
30
|
+
message: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function OxyServicesAuthMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
33
|
+
new (...args: any[]): {
|
|
34
|
+
/**
|
|
35
|
+
* Register a new identity with public key authentication
|
|
36
|
+
* Identity is purely cryptographic - username and profile data are optional
|
|
37
|
+
*
|
|
38
|
+
* @param publicKey - The user's ECDSA public key (hex)
|
|
39
|
+
* @param signature - Signature of the registration request
|
|
40
|
+
* @param timestamp - Timestamp when the signature was created
|
|
41
|
+
*/
|
|
42
|
+
register(publicKey: string, signature: string, timestamp: number): Promise<{
|
|
43
|
+
message: string;
|
|
44
|
+
user: User;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Request an authentication challenge
|
|
48
|
+
* The client must sign this challenge with their private key
|
|
49
|
+
*
|
|
50
|
+
* @param publicKey - The user's public key
|
|
51
|
+
*/
|
|
52
|
+
requestChallenge(publicKey: string): Promise<ChallengeResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Verify a signed challenge and create a session
|
|
55
|
+
*
|
|
56
|
+
* @param publicKey - The user's public key
|
|
57
|
+
* @param challenge - The challenge string from requestChallenge
|
|
58
|
+
* @param signature - Signature of the auth message
|
|
59
|
+
* @param timestamp - Timestamp when the signature was created
|
|
60
|
+
* @param deviceName - Optional device name
|
|
61
|
+
* @param deviceFingerprint - Optional device fingerprint
|
|
62
|
+
*/
|
|
63
|
+
verifyChallenge(publicKey: string, challenge: string, signature: string, timestamp: number, deviceName?: string, deviceFingerprint?: string): Promise<SessionLoginResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Check if a public key is already registered
|
|
66
|
+
*/
|
|
67
|
+
checkPublicKeyRegistered(publicKey: string): Promise<PublicKeyCheckResponse>;
|
|
68
|
+
/**
|
|
69
|
+
* Get user by public key
|
|
70
|
+
*/
|
|
71
|
+
getUserByPublicKey(publicKey: string): Promise<User>;
|
|
72
|
+
/**
|
|
73
|
+
* Get user by session ID
|
|
74
|
+
*/
|
|
75
|
+
getUserBySession(sessionId: string): Promise<User>;
|
|
76
|
+
/**
|
|
77
|
+
* Batch get multiple user profiles by session IDs
|
|
78
|
+
*/
|
|
79
|
+
getUsersBySessions(sessionIds: string[]): Promise<Array<{
|
|
80
|
+
sessionId: string;
|
|
81
|
+
user: User | null;
|
|
82
|
+
}>>;
|
|
83
|
+
/**
|
|
84
|
+
* Get access token by session ID
|
|
85
|
+
*/
|
|
86
|
+
getTokenBySession(sessionId: string): Promise<{
|
|
87
|
+
accessToken: string;
|
|
88
|
+
expiresAt: string;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* Get sessions by session ID
|
|
92
|
+
*/
|
|
93
|
+
getSessionsBySessionId(sessionId: string): Promise<any[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Logout from a specific session
|
|
96
|
+
*/
|
|
97
|
+
logoutSession(sessionId: string, targetSessionId?: string): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Logout from all sessions
|
|
100
|
+
*/
|
|
101
|
+
logoutAllSessions(sessionId: string): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Validate session
|
|
104
|
+
*/
|
|
105
|
+
validateSession(sessionId: string, options?: {
|
|
106
|
+
deviceFingerprint?: string;
|
|
107
|
+
useHeaderValidation?: boolean;
|
|
108
|
+
}): Promise<{
|
|
109
|
+
valid: boolean;
|
|
110
|
+
expiresAt: string;
|
|
111
|
+
lastActivity: string;
|
|
112
|
+
user: User;
|
|
113
|
+
sessionId?: string;
|
|
114
|
+
source?: string;
|
|
115
|
+
}>;
|
|
116
|
+
/**
|
|
117
|
+
* Check username availability
|
|
118
|
+
*/
|
|
119
|
+
checkUsernameAvailability(username: string): Promise<{
|
|
120
|
+
available: boolean;
|
|
121
|
+
message: string;
|
|
122
|
+
}>;
|
|
123
|
+
/**
|
|
124
|
+
* Check email availability
|
|
125
|
+
*/
|
|
126
|
+
checkEmailAvailability(email: string): Promise<{
|
|
127
|
+
available: boolean;
|
|
128
|
+
message: string;
|
|
129
|
+
}>;
|
|
130
|
+
/**
|
|
131
|
+
* Register a new user with email/username and password
|
|
132
|
+
*/
|
|
133
|
+
signUp(username: string, email: string, password: string, deviceName?: string, deviceFingerprint?: any): Promise<SessionLoginResponse>;
|
|
134
|
+
/**
|
|
135
|
+
* Sign in with email or username and password
|
|
136
|
+
*/
|
|
137
|
+
signIn(identifier: string, password: string, deviceName?: string, deviceFingerprint?: any): Promise<SessionLoginResponse>;
|
|
138
|
+
/**
|
|
139
|
+
* Convenience helper for email sign-in
|
|
140
|
+
*/
|
|
141
|
+
signInWithEmail(email: string, password: string, deviceName?: string, deviceFingerprint?: any): Promise<SessionLoginResponse>;
|
|
142
|
+
httpService: import("../HttpService").HttpService;
|
|
143
|
+
cloudURL: string;
|
|
144
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
145
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
146
|
+
getBaseURL(): string;
|
|
147
|
+
getClient(): import("../HttpService").HttpService;
|
|
148
|
+
getMetrics(): {
|
|
149
|
+
totalRequests: number;
|
|
150
|
+
successfulRequests: number;
|
|
151
|
+
failedRequests: number;
|
|
152
|
+
cacheHits: number;
|
|
153
|
+
cacheMisses: number;
|
|
154
|
+
averageResponseTime: number;
|
|
155
|
+
};
|
|
156
|
+
clearCache(): void;
|
|
157
|
+
clearCacheEntry(key: string): void;
|
|
158
|
+
getCacheStats(): {
|
|
159
|
+
size: number;
|
|
160
|
+
hits: number;
|
|
161
|
+
misses: number;
|
|
162
|
+
hitRate: number;
|
|
163
|
+
};
|
|
164
|
+
getCloudURL(): string;
|
|
165
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
166
|
+
clearTokens(): void;
|
|
167
|
+
getCurrentUserId(): string | null;
|
|
168
|
+
hasValidToken(): boolean;
|
|
169
|
+
getAccessToken(): string | null;
|
|
170
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
171
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
172
|
+
maxRetries?: number;
|
|
173
|
+
retryDelay?: number;
|
|
174
|
+
authTimeoutMs?: number;
|
|
175
|
+
}): Promise<T_1>;
|
|
176
|
+
validate(): Promise<boolean>;
|
|
177
|
+
handleError(error: unknown): Error;
|
|
178
|
+
healthCheck(): Promise<{
|
|
179
|
+
status: string;
|
|
180
|
+
users?: number;
|
|
181
|
+
timestamp?: string;
|
|
182
|
+
[key: string]: any;
|
|
183
|
+
}>;
|
|
184
|
+
};
|
|
185
|
+
__resetTokensForTests(): void;
|
|
186
|
+
} & T;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Developer API Methods Mixin
|
|
3
|
+
*
|
|
4
|
+
* Provides methods for managing developer applications and API keys
|
|
5
|
+
*/
|
|
6
|
+
import type { OxyServicesBase } from '../OxyServices.base';
|
|
7
|
+
export declare function OxyServicesDeveloperMixin<T extends typeof OxyServicesBase>(Base: T): {
|
|
8
|
+
new (...args: any[]): {
|
|
9
|
+
/**
|
|
10
|
+
* Get developer apps for the current user
|
|
11
|
+
* @returns Array of developer apps
|
|
12
|
+
*/
|
|
13
|
+
getDeveloperApps(): Promise<any[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new developer app
|
|
16
|
+
* @param data - Developer app configuration
|
|
17
|
+
* @returns Created developer app
|
|
18
|
+
*/
|
|
19
|
+
createDeveloperApp(data: {
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
webhookUrl: string;
|
|
23
|
+
devWebhookUrl?: string;
|
|
24
|
+
scopes?: string[];
|
|
25
|
+
}): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* Get a specific developer app
|
|
28
|
+
*/
|
|
29
|
+
getDeveloperApp(appId: string): Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* Update a developer app
|
|
32
|
+
* @param appId - The developer app ID
|
|
33
|
+
* @param data - Updated app configuration
|
|
34
|
+
* @returns Updated developer app
|
|
35
|
+
*/
|
|
36
|
+
updateDeveloperApp(appId: string, data: {
|
|
37
|
+
name?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
webhookUrl?: string;
|
|
40
|
+
devWebhookUrl?: string;
|
|
41
|
+
scopes?: string[];
|
|
42
|
+
}): Promise<any>;
|
|
43
|
+
/**
|
|
44
|
+
* Regenerate API secret for a developer app
|
|
45
|
+
* @param appId - The developer app ID
|
|
46
|
+
* @returns App with new secret
|
|
47
|
+
*/
|
|
48
|
+
regenerateDeveloperAppSecret(appId: string): Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* Delete a developer app
|
|
51
|
+
* @param appId - The developer app ID
|
|
52
|
+
* @returns Deletion result
|
|
53
|
+
*/
|
|
54
|
+
deleteDeveloperApp(appId: string): Promise<any>;
|
|
55
|
+
httpService: import("../HttpService").HttpService;
|
|
56
|
+
cloudURL: string;
|
|
57
|
+
config: import("../OxyServices.base").OxyConfig;
|
|
58
|
+
makeRequest<T_1>(method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE", url: string, data?: any, options?: import("../HttpService").RequestOptions): Promise<T_1>;
|
|
59
|
+
getBaseURL(): string;
|
|
60
|
+
getClient(): import("../HttpService").HttpService;
|
|
61
|
+
getMetrics(): {
|
|
62
|
+
totalRequests: number;
|
|
63
|
+
successfulRequests: number;
|
|
64
|
+
failedRequests: number;
|
|
65
|
+
cacheHits: number;
|
|
66
|
+
cacheMisses: number;
|
|
67
|
+
averageResponseTime: number;
|
|
68
|
+
};
|
|
69
|
+
clearCache(): void;
|
|
70
|
+
clearCacheEntry(key: string): void;
|
|
71
|
+
getCacheStats(): {
|
|
72
|
+
size: number;
|
|
73
|
+
hits: number;
|
|
74
|
+
misses: number;
|
|
75
|
+
hitRate: number;
|
|
76
|
+
};
|
|
77
|
+
getCloudURL(): string;
|
|
78
|
+
setTokens(accessToken: string, refreshToken?: string): void;
|
|
79
|
+
clearTokens(): void;
|
|
80
|
+
getCurrentUserId(): string | null;
|
|
81
|
+
hasValidToken(): boolean;
|
|
82
|
+
getAccessToken(): string | null;
|
|
83
|
+
waitForAuth(timeoutMs?: number): Promise<boolean>;
|
|
84
|
+
withAuthRetry<T_1>(operation: () => Promise<T_1>, operationName: string, options?: {
|
|
85
|
+
maxRetries?: number;
|
|
86
|
+
retryDelay?: number;
|
|
87
|
+
authTimeoutMs?: number;
|
|
88
|
+
}): Promise<T_1>;
|
|
89
|
+
validate(): Promise<boolean>;
|
|
90
|
+
handleError(error: unknown): Error;
|
|
91
|
+
healthCheck(): Promise<{
|
|
92
|
+
status: string;
|
|
93
|
+
users?: number;
|
|
94
|
+
timestamp?: string;
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
}>;
|
|
97
|
+
};
|
|
98
|
+
__resetTokensForTests(): void;
|
|
99
|
+
} & T;
|