@oxyhq/services 5.16.16 → 5.16.18
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/lib/commonjs/core/mixins/OxyServices.payment.js +102 -0
- package/lib/commonjs/core/mixins/OxyServices.payment.js.map +1 -1
- package/lib/commonjs/core/mixins/OxyServices.security.js +42 -0
- package/lib/commonjs/core/mixins/OxyServices.security.js.map +1 -1
- package/lib/commonjs/crypto/keyManager.js +44 -0
- package/lib/commonjs/crypto/keyManager.js.map +1 -1
- package/lib/commonjs/models/interfaces.js +2 -0
- package/lib/commonjs/models/interfaces.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +19 -1
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +1 -27
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/Section.js +2 -1
- package/lib/commonjs/ui/components/Section.js.map +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +1 -2
- package/lib/commonjs/ui/components/SectionTitle.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +3 -3
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +48 -6
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +9 -2
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useDeviceManagement.js +1 -1
- package/lib/commonjs/ui/context/hooks/useLanguageManagement.js +1 -1
- package/lib/commonjs/ui/context/hooks/useSessionManagement.js +3 -3
- package/lib/commonjs/ui/context/hooks/useStorage.js +2 -2
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +1 -1
- package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +22 -7
- package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +13 -13
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +17 -17
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +2 -2
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +10 -9
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +15 -15
- package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +3 -3
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +2 -2
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +3 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +4 -4
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1 -2
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +44 -16
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +3 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +2 -2
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +8 -5
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/errorHandlers.js +49 -2
- package/lib/commonjs/ui/utils/errorHandlers.js.map +1 -1
- package/lib/commonjs/ui/utils/sessionHelpers.js +0 -2
- package/lib/commonjs/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/commonjs/utils/languageUtils.js +11 -11
- package/lib/commonjs/utils/languageUtils.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.payment.js +102 -0
- package/lib/module/core/mixins/OxyServices.payment.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.security.js +42 -0
- package/lib/module/core/mixins/OxyServices.security.js.map +1 -1
- package/lib/module/crypto/keyManager.js +45 -0
- package/lib/module/crypto/keyManager.js.map +1 -1
- package/lib/module/models/interfaces.js +2 -0
- package/lib/module/models/interfaces.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +19 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +1 -29
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/Section.js +2 -1
- package/lib/module/ui/components/Section.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +1 -2
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +3 -3
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +49 -7
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +9 -2
- package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
- package/lib/module/ui/context/hooks/useDeviceManagement.js +1 -1
- package/lib/module/ui/context/hooks/useDeviceManagement.js.map +1 -1
- package/lib/module/ui/context/hooks/useLanguageManagement.js +1 -1
- package/lib/module/ui/context/hooks/useLanguageManagement.js.map +1 -1
- package/lib/module/ui/context/hooks/useSessionManagement.js +3 -3
- package/lib/module/ui/context/hooks/useSessionManagement.js.map +1 -1
- package/lib/module/ui/context/hooks/useStorage.js +2 -2
- package/lib/module/ui/context/hooks/useStorage.js.map +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js +1 -1
- package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
- package/lib/module/ui/hooks/queries/useServicesQueries.js +1 -1
- package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +22 -7
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +13 -13
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +17 -17
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +2 -2
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +11 -10
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +15 -15
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js +1 -1
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +3 -3
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +2 -2
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +4 -2
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +4 -4
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1 -2
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +44 -16
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +3 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -3
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +9 -6
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
- package/lib/module/ui/utils/errorHandlers.js +46 -0
- package/lib/module/ui/utils/errorHandlers.js.map +1 -1
- package/lib/module/ui/utils/sessionHelpers.js +0 -2
- package/lib/module/ui/utils/sessionHelpers.js.map +1 -1
- package/lib/module/utils/languageUtils.js +11 -11
- package/lib/module/utils/languageUtils.js.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.payment.d.ts +41 -0
- package/lib/typescript/core/mixins/OxyServices.payment.d.ts.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.security.d.ts +12 -0
- package/lib/typescript/core/mixins/OxyServices.security.d.ts.map +1 -1
- package/lib/typescript/core/mixins/index.d.ts +14 -0
- package/lib/typescript/core/mixins/index.d.ts.map +1 -1
- package/lib/typescript/crypto/keyManager.d.ts.map +1 -1
- package/lib/typescript/models/interfaces.d.ts +1 -1
- package/lib/typescript/models/interfaces.d.ts.map +1 -1
- package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/Section.d.ts.map +1 -1
- package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +1 -1
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts +1 -1
- package/lib/typescript/ui/context/hooks/useLanguageManagement.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts +1 -1
- package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useStorage.d.ts +1 -1
- package/lib/typescript/ui/context/hooks/useStorage.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
- package/lib/typescript/ui/screens/LanguageSelectorScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/utils/errorHandlers.d.ts +5 -0
- package/lib/typescript/ui/utils/errorHandlers.d.ts.map +1 -1
- package/lib/typescript/ui/utils/sessionHelpers.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/core/mixins/OxyServices.payment.ts +104 -0
- package/src/core/mixins/OxyServices.security.ts +44 -0
- package/src/crypto/keyManager.ts +44 -0
- package/src/models/interfaces.ts +4 -0
- package/src/ui/components/FollowButton.tsx +19 -1
- package/src/ui/components/GroupedItem.tsx +1 -29
- package/src/ui/components/Section.tsx +1 -0
- package/src/ui/components/SectionTitle.tsx +0 -1
- package/src/ui/components/fileManagement/FileViewer.tsx +3 -3
- package/src/ui/context/OxyContext.tsx +33 -9
- package/src/ui/context/hooks/useAuthOperations.ts +16 -9
- package/src/ui/context/hooks/useDeviceManagement.ts +1 -1
- package/src/ui/context/hooks/useLanguageManagement.ts +2 -2
- package/src/ui/context/hooks/useSessionManagement.ts +3 -3
- package/src/ui/context/hooks/useStorage.ts +2 -2
- package/src/ui/hooks/queries/useAccountQueries.ts +1 -1
- package/src/ui/hooks/queries/useServicesQueries.ts +1 -1
- package/src/ui/hooks/useSessionSocket.ts +8 -7
- package/src/ui/screens/AccountCenterScreen.tsx +13 -13
- package/src/ui/screens/AccountOverviewScreen.tsx +17 -17
- package/src/ui/screens/AccountSettingsScreen.tsx +2 -2
- package/src/ui/screens/AccountSwitcherScreen.tsx +8 -8
- package/src/ui/screens/AppInfoScreen.tsx +15 -15
- package/src/ui/screens/FeedbackScreen.tsx +1 -1
- package/src/ui/screens/FileManagementScreen.tsx +1 -1
- package/src/ui/screens/HelpSupportScreen.tsx +3 -3
- package/src/ui/screens/HistoryViewScreen.tsx +2 -2
- package/src/ui/screens/LanguageSelectorScreen.tsx +4 -1
- package/src/ui/screens/LegalDocumentsScreen.tsx +4 -4
- package/src/ui/screens/PaymentGatewayScreen.tsx +1 -1
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +0 -1
- package/src/ui/screens/ProfileScreen.tsx +61 -22
- package/src/ui/screens/SavesCollectionsScreen.tsx +10 -1
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +8 -1
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +2 -2
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +9 -6
- package/src/ui/utils/errorHandlers.ts +58 -0
- package/src/ui/utils/sessionHelpers.ts +0 -2
- package/src/utils/languageUtils.ts +11 -11
- package/lib/commonjs/ui/context/utils/errorHandlers.js +0 -100
- package/lib/commonjs/ui/context/utils/errorHandlers.js.map +0 -1
- package/lib/commonjs/ui/context/utils/sessionHelpers.js +0 -103
- package/lib/commonjs/ui/context/utils/sessionHelpers.js.map +0 -1
- package/lib/commonjs/ui/context/utils/storageHelpers.js +0 -119
- package/lib/commonjs/ui/context/utils/storageHelpers.js.map +0 -1
- package/lib/module/ui/context/utils/errorHandlers.js +0 -93
- package/lib/module/ui/context/utils/errorHandlers.js.map +0 -1
- package/lib/module/ui/context/utils/sessionHelpers.js +0 -96
- package/lib/module/ui/context/utils/sessionHelpers.js.map +0 -1
- package/lib/module/ui/context/utils/storageHelpers.js +0 -111
- package/lib/module/ui/context/utils/storageHelpers.js.map +0 -1
- package/lib/typescript/ui/context/utils/errorHandlers.d.ts +0 -30
- package/lib/typescript/ui/context/utils/errorHandlers.d.ts.map +0 -1
- package/lib/typescript/ui/context/utils/sessionHelpers.d.ts +0 -59
- package/lib/typescript/ui/context/utils/sessionHelpers.d.ts.map +0 -1
- package/lib/typescript/ui/context/utils/storageHelpers.d.ts +0 -31
- package/lib/typescript/ui/context/utils/storageHelpers.d.ts.map +0 -1
- package/src/ui/context/utils/errorHandlers.ts +0 -146
- package/src/ui/context/utils/sessionHelpers.ts +0 -146
- package/src/ui/context/utils/storageHelpers.ts +0 -134
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandlers.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/errorHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAgBxD,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAkBD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,
|
|
1
|
+
{"version":3,"file":"errorHandlers.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/errorHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAgBxD,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAkBD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,OA4BtD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,OAAO,KAAG,OA0CxD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO,OAAO,EACd,wBAAoC,KACnC,MAuBF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,OAAO,EACd,kEAOG,sBAAsB,KACxB,MAiBF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessionHelpers.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/sessionHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,UAAU,aAAa;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE;YAAE,QAAQ,IAAI,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gCAAgC;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,aAAa,EAAE,EACzB,mBAAmB,MAAM,EACzB,iBAAiB,MAAM,KACtB,aAAa,EAgBf,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,aAAa,IAAI,CAAC,WAAW,EAAE,mBAAmB,GAAG,wBAAwB,CAAC,EAC9E,WAAW,MAAM,EACjB,gDAIG,gCAAqC,KACvC,OAAO,CAAC,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"sessionHelpers.d.ts","sourceRoot":"","sources":["../../../../src/ui/utils/sessionHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,UAAU,aAAa;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE;YAAE,QAAQ,IAAI,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,gCAAgC;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,aAAa,EAAE,EACzB,mBAAmB,MAAM,EACzB,iBAAiB,MAAM,KACtB,aAAa,EAgBf,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,aAAa,IAAI,CAAC,WAAW,EAAE,mBAAmB,GAAG,wBAAwB,CAAC,EAC9E,WAAW,MAAM,EACjB,gDAIG,gCAAqC,KACvC,OAAO,CAAC,aAAa,EAAE,CAYzB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC/B,aAAa,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,EACjD,YAAY,MAAM,EAAE,EACpB,0CAAoD,2BAAgC,KACnF,OAAO,CAAC,uBAAuB,EAAE,CAuCnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.16.
|
|
3
|
+
"version": "5.16.18",
|
|
4
4
|
"description": "Reusable OxyHQ module to handle authentication, user management, karma system, device-based session management and more 🚀",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"prepublishOnly": "npm run typescript && npm test && npm run build"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
+
"@lottiefiles/dotlottie-react": "^0.13.5",
|
|
92
93
|
"@react-native-async-storage/async-storage": "2.1.2",
|
|
93
94
|
"@react-native-community/netinfo": "^11.4.1",
|
|
94
95
|
"@tanstack/react-query": "^5.59.0",
|
|
@@ -54,6 +54,110 @@ export function OxyServicesPaymentMixin<T extends typeof OxyServicesBase>(Base:
|
|
|
54
54
|
throw this.handleError(error);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get user subscription
|
|
60
|
+
* @param userId - The user ID
|
|
61
|
+
* @returns Subscription object
|
|
62
|
+
*/
|
|
63
|
+
async getSubscription(userId: string): Promise<any> {
|
|
64
|
+
try {
|
|
65
|
+
return await this.makeRequest('GET', `/api/subscription/${userId}`, undefined, {
|
|
66
|
+
cache: true,
|
|
67
|
+
cacheTTL: CACHE_TIMES.MEDIUM,
|
|
68
|
+
});
|
|
69
|
+
} catch (error) {
|
|
70
|
+
throw this.handleError(error);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Get current user's subscription
|
|
76
|
+
* @returns Subscription object
|
|
77
|
+
*/
|
|
78
|
+
async getCurrentUserSubscription(): Promise<any> {
|
|
79
|
+
try {
|
|
80
|
+
const userId = this.getCurrentUserId();
|
|
81
|
+
if (!userId) {
|
|
82
|
+
throw new Error('User not authenticated');
|
|
83
|
+
}
|
|
84
|
+
return await this.getSubscription(userId);
|
|
85
|
+
} catch (error) {
|
|
86
|
+
throw this.handleError(error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get user wallet
|
|
92
|
+
* @param userId - The user ID
|
|
93
|
+
* @returns Wallet object with balance
|
|
94
|
+
*/
|
|
95
|
+
async getWallet(userId: string): Promise<any> {
|
|
96
|
+
try {
|
|
97
|
+
return await this.makeRequest('GET', `/api/wallet/${userId}`, undefined, {
|
|
98
|
+
cache: true,
|
|
99
|
+
cacheTTL: CACHE_TIMES.SHORT, // Cache wallet for short time as balance changes frequently
|
|
100
|
+
});
|
|
101
|
+
} catch (error) {
|
|
102
|
+
throw this.handleError(error);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Get current user's wallet
|
|
108
|
+
* @returns Wallet object with balance
|
|
109
|
+
*/
|
|
110
|
+
async getCurrentUserWallet(): Promise<any> {
|
|
111
|
+
try {
|
|
112
|
+
const userId = this.getCurrentUserId();
|
|
113
|
+
if (!userId) {
|
|
114
|
+
throw new Error('User not authenticated');
|
|
115
|
+
}
|
|
116
|
+
return await this.getWallet(userId);
|
|
117
|
+
} catch (error) {
|
|
118
|
+
throw this.handleError(error);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Get wallet transaction history
|
|
124
|
+
* @param userId - The user ID
|
|
125
|
+
* @param options - Pagination options
|
|
126
|
+
* @returns Transaction history
|
|
127
|
+
*/
|
|
128
|
+
async getWalletTransactions(userId: string, options?: { limit?: number; offset?: number }): Promise<any> {
|
|
129
|
+
try {
|
|
130
|
+
const params = new URLSearchParams();
|
|
131
|
+
if (options?.limit) params.append('limit', options.limit.toString());
|
|
132
|
+
if (options?.offset) params.append('offset', options.offset.toString());
|
|
133
|
+
|
|
134
|
+
const queryString = params.toString();
|
|
135
|
+
const url = `/api/wallet/transactions/${userId}${queryString ? `?${queryString}` : ''}`;
|
|
136
|
+
|
|
137
|
+
return await this.makeRequest('GET', url, undefined, {
|
|
138
|
+
cache: false, // Don't cache transactions - always get fresh data
|
|
139
|
+
});
|
|
140
|
+
} catch (error) {
|
|
141
|
+
throw this.handleError(error);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Get current user's wallet transaction history
|
|
147
|
+
* @param options - Pagination options
|
|
148
|
+
* @returns Transaction history
|
|
149
|
+
*/
|
|
150
|
+
async getCurrentUserWalletTransactions(options?: { limit?: number; offset?: number }): Promise<any> {
|
|
151
|
+
try {
|
|
152
|
+
const userId = this.getCurrentUserId();
|
|
153
|
+
if (!userId) {
|
|
154
|
+
throw new Error('User not authenticated');
|
|
155
|
+
}
|
|
156
|
+
return await this.getWalletTransactions(userId, options);
|
|
157
|
+
} catch (error) {
|
|
158
|
+
throw this.handleError(error);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
57
161
|
};
|
|
58
162
|
}
|
|
59
163
|
|
|
@@ -54,6 +54,50 @@ export function OxyServicesSecurityMixin<T extends typeof OxyServicesBase>(Base:
|
|
|
54
54
|
throw this.handleError(error);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Log private key exported event
|
|
60
|
+
* @param deviceId - Optional device ID for tracking
|
|
61
|
+
* @returns Promise that resolves when event is logged
|
|
62
|
+
*/
|
|
63
|
+
async logPrivateKeyExported(deviceId?: string): Promise<void> {
|
|
64
|
+
try {
|
|
65
|
+
await this.makeRequest<{ success: boolean }>(
|
|
66
|
+
'POST',
|
|
67
|
+
'/api/security/activity/private-key-exported',
|
|
68
|
+
{ deviceId },
|
|
69
|
+
{ cache: false }
|
|
70
|
+
);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
// Don't throw - logging failures shouldn't break user flow
|
|
73
|
+
// But log for monitoring
|
|
74
|
+
if (__DEV__) {
|
|
75
|
+
console.warn('[OxyServices] Failed to log private key exported event:', error);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Log backup created event
|
|
82
|
+
* @param deviceId - Optional device ID for tracking
|
|
83
|
+
* @returns Promise that resolves when event is logged
|
|
84
|
+
*/
|
|
85
|
+
async logBackupCreated(deviceId?: string): Promise<void> {
|
|
86
|
+
try {
|
|
87
|
+
await this.makeRequest<{ success: boolean }>(
|
|
88
|
+
'POST',
|
|
89
|
+
'/api/security/activity/backup-created',
|
|
90
|
+
{ deviceId },
|
|
91
|
+
{ cache: false }
|
|
92
|
+
);
|
|
93
|
+
} catch (error) {
|
|
94
|
+
// Don't throw - logging failures shouldn't break user flow
|
|
95
|
+
// But log for monitoring
|
|
96
|
+
if (__DEV__) {
|
|
97
|
+
console.warn('[OxyServices] Failed to log backup created event:', error);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
57
101
|
};
|
|
58
102
|
}
|
|
59
103
|
|
package/src/crypto/keyManager.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { ec as EC } from 'elliptic';
|
|
9
9
|
import type { ECKeyPair } from 'elliptic';
|
|
10
|
+
import { Platform } from 'react-native';
|
|
10
11
|
|
|
11
12
|
// Lazy imports for React Native specific modules
|
|
12
13
|
let SecureStore: typeof import('expo-secure-store') | null = null;
|
|
@@ -55,6 +56,19 @@ function isNodeJS(): boolean {
|
|
|
55
56
|
return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Check if we're on web platform
|
|
61
|
+
* Identity storage is only available on native platforms (iOS/Android)
|
|
62
|
+
*/
|
|
63
|
+
function isWebPlatform(): boolean {
|
|
64
|
+
try {
|
|
65
|
+
return Platform.OS === 'web';
|
|
66
|
+
} catch {
|
|
67
|
+
// Fallback if Platform is not available
|
|
68
|
+
return typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.product !== 'ReactNative';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
58
72
|
async function initExpoCrypto(): Promise<typeof import('expo-crypto')> {
|
|
59
73
|
if (!ExpoCrypto) {
|
|
60
74
|
ExpoCrypto = await import('expo-crypto');
|
|
@@ -147,6 +161,9 @@ export class KeyManager {
|
|
|
147
161
|
* Returns only the public key (private key is stored securely)
|
|
148
162
|
*/
|
|
149
163
|
static async createIdentity(): Promise<string> {
|
|
164
|
+
if (isWebPlatform()) {
|
|
165
|
+
throw new Error('Identity creation is only available on native platforms (iOS/Android). Please use the native app to create your identity.');
|
|
166
|
+
}
|
|
150
167
|
const store = await initSecureStore();
|
|
151
168
|
const { privateKey, publicKey } = await KeyManager.generateKeyPair();
|
|
152
169
|
|
|
@@ -167,6 +184,9 @@ export class KeyManager {
|
|
|
167
184
|
* Import an existing key pair (e.g., from recovery phrase)
|
|
168
185
|
*/
|
|
169
186
|
static async importKeyPair(privateKey: string): Promise<string> {
|
|
187
|
+
if (isWebPlatform()) {
|
|
188
|
+
throw new Error('Identity import is only available on native platforms (iOS/Android). Please use the native app to import your identity.');
|
|
189
|
+
}
|
|
170
190
|
const store = await initSecureStore();
|
|
171
191
|
|
|
172
192
|
const keyPair = ec.keyFromPrivate(privateKey);
|
|
@@ -189,6 +209,9 @@ export class KeyManager {
|
|
|
189
209
|
* WARNING: Only use this for signing operations within the app
|
|
190
210
|
*/
|
|
191
211
|
static async getPrivateKey(): Promise<string | null> {
|
|
212
|
+
if (isWebPlatform()) {
|
|
213
|
+
return null; // Identity storage is only available on native platforms
|
|
214
|
+
}
|
|
192
215
|
try {
|
|
193
216
|
const store = await initSecureStore();
|
|
194
217
|
return await store.getItemAsync(STORAGE_KEYS.PRIVATE_KEY);
|
|
@@ -206,6 +229,9 @@ export class KeyManager {
|
|
|
206
229
|
* Get the stored public key (cached for performance)
|
|
207
230
|
*/
|
|
208
231
|
static async getPublicKey(): Promise<string | null> {
|
|
232
|
+
if (isWebPlatform()) {
|
|
233
|
+
return null; // Identity storage is only available on native platforms
|
|
234
|
+
}
|
|
209
235
|
if (KeyManager.cachedPublicKey !== null) {
|
|
210
236
|
return KeyManager.cachedPublicKey;
|
|
211
237
|
}
|
|
@@ -233,6 +259,9 @@ export class KeyManager {
|
|
|
233
259
|
* Check if an identity (key pair) exists on this device (cached for performance)
|
|
234
260
|
*/
|
|
235
261
|
static async hasIdentity(): Promise<boolean> {
|
|
262
|
+
if (isWebPlatform()) {
|
|
263
|
+
return false; // Identity storage is only available on native platforms
|
|
264
|
+
}
|
|
236
265
|
if (KeyManager.cachedHasIdentity !== null) {
|
|
237
266
|
return KeyManager.cachedHasIdentity;
|
|
238
267
|
}
|
|
@@ -269,6 +298,9 @@ export class KeyManager {
|
|
|
269
298
|
force: boolean = false,
|
|
270
299
|
userConfirmed: boolean = false
|
|
271
300
|
): Promise<void> {
|
|
301
|
+
if (isWebPlatform()) {
|
|
302
|
+
return; // Identity storage is only available on native platforms, nothing to delete
|
|
303
|
+
}
|
|
272
304
|
// CRITICAL SAFEGUARD: Require explicit user confirmation unless force is true
|
|
273
305
|
if (!force && !userConfirmed) {
|
|
274
306
|
throw new Error('Identity deletion requires explicit user confirmation. This is a safety measure to prevent accidental data loss.');
|
|
@@ -320,6 +352,9 @@ export class KeyManager {
|
|
|
320
352
|
* This provides a recovery mechanism if primary storage fails
|
|
321
353
|
*/
|
|
322
354
|
static async backupIdentity(): Promise<boolean> {
|
|
355
|
+
if (isWebPlatform()) {
|
|
356
|
+
return false; // Identity storage is only available on native platforms
|
|
357
|
+
}
|
|
323
358
|
try {
|
|
324
359
|
const store = await initSecureStore();
|
|
325
360
|
const privateKey = await KeyManager.getPrivateKey();
|
|
@@ -349,6 +384,9 @@ export class KeyManager {
|
|
|
349
384
|
* Verify identity integrity - checks if keys are valid and accessible
|
|
350
385
|
*/
|
|
351
386
|
static async verifyIdentityIntegrity(): Promise<boolean> {
|
|
387
|
+
if (isWebPlatform()) {
|
|
388
|
+
return false; // Identity storage is only available on native platforms
|
|
389
|
+
}
|
|
352
390
|
try {
|
|
353
391
|
const privateKey = await KeyManager.getPrivateKey();
|
|
354
392
|
const publicKey = await KeyManager.getPublicKey();
|
|
@@ -392,6 +430,9 @@ export class KeyManager {
|
|
|
392
430
|
* Restore identity from backup if primary storage is corrupted
|
|
393
431
|
*/
|
|
394
432
|
static async restoreIdentityFromBackup(): Promise<boolean> {
|
|
433
|
+
if (isWebPlatform()) {
|
|
434
|
+
return false; // Identity storage is only available on native platforms
|
|
435
|
+
}
|
|
395
436
|
try {
|
|
396
437
|
const store = await initSecureStore();
|
|
397
438
|
|
|
@@ -447,6 +488,9 @@ export class KeyManager {
|
|
|
447
488
|
* Used internally for signing operations
|
|
448
489
|
*/
|
|
449
490
|
static async getKeyPairObject(): Promise<ECKeyPair | null> {
|
|
491
|
+
if (isWebPlatform()) {
|
|
492
|
+
return null; // Identity storage is only available on native platforms
|
|
493
|
+
}
|
|
450
494
|
const privateKey = await KeyManager.getPrivateKey();
|
|
451
495
|
if (!privateKey) return null;
|
|
452
496
|
return ec.keyFromPrivate(privateKey);
|
package/src/models/interfaces.ts
CHANGED
|
@@ -415,6 +415,8 @@ export type SecurityEventType =
|
|
|
415
415
|
| 'device_removed'
|
|
416
416
|
| 'account_recovery'
|
|
417
417
|
| 'security_settings_changed'
|
|
418
|
+
| 'private_key_exported'
|
|
419
|
+
| 'backup_created'
|
|
418
420
|
| 'suspicious_activity';
|
|
419
421
|
|
|
420
422
|
/**
|
|
@@ -435,6 +437,8 @@ export const SECURITY_EVENT_SEVERITY_MAP: Record<SecurityEventType, SecurityEven
|
|
|
435
437
|
'device_removed': 'medium',
|
|
436
438
|
'security_settings_changed': 'medium',
|
|
437
439
|
'account_recovery': 'high',
|
|
440
|
+
'private_key_exported': 'high',
|
|
441
|
+
'backup_created': 'high',
|
|
438
442
|
'suspicious_activity': 'critical',
|
|
439
443
|
};
|
|
440
444
|
|
|
@@ -53,8 +53,26 @@ const FollowButton: React.FC<FollowButtonProps> = ({
|
|
|
53
53
|
preventParentActions = true,
|
|
54
54
|
theme = 'light',
|
|
55
55
|
}) => {
|
|
56
|
-
const { oxyServices, isAuthenticated } = useOxy();
|
|
56
|
+
const { oxyServices, isAuthenticated, user: currentUser } = useOxy();
|
|
57
57
|
const colors = useThemeColors(theme);
|
|
58
|
+
|
|
59
|
+
// Safety check: Don't render follow button on own profile
|
|
60
|
+
// This provides a fallback in case parent components don't handle this check
|
|
61
|
+
// Normalize IDs by trimming whitespace and comparing as strings
|
|
62
|
+
const normalizeId = (id: string | undefined | null): string => {
|
|
63
|
+
if (!id) return '';
|
|
64
|
+
return String(id).trim();
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const currentUserId = normalizeId(currentUser?.id);
|
|
68
|
+
const targetUserId = normalizeId(userId);
|
|
69
|
+
|
|
70
|
+
// Don't render if:
|
|
71
|
+
// 1. Not authenticated (can't follow anyway)
|
|
72
|
+
// 2. Viewing own profile (currentUser.id matches userId)
|
|
73
|
+
if (!isAuthenticated || (currentUserId && targetUserId && currentUserId === targetUserId)) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
58
76
|
const {
|
|
59
77
|
isFollowing,
|
|
60
78
|
isLoading,
|
|
@@ -9,34 +9,6 @@ import { darkenColor } from '../utils/colorUtils';
|
|
|
9
9
|
import { normalizeColorScheme } from '../utils/themeUtils';
|
|
10
10
|
import { Colors } from '../constants/theme';
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Maps Ionicons-style icon names to valid MaterialCommunityIcons names
|
|
14
|
-
*/
|
|
15
|
-
const mapIconName = (iconName: string): string => {
|
|
16
|
-
const iconMap: Record<string, string> = {
|
|
17
|
-
'person': 'account',
|
|
18
|
-
'person-circle': 'account-circle',
|
|
19
|
-
'person-outline': 'account-outline',
|
|
20
|
-
'person-add': 'account-plus',
|
|
21
|
-
'shield-checkmark': 'shield-check',
|
|
22
|
-
'notifications': 'bell',
|
|
23
|
-
'people': 'account-group',
|
|
24
|
-
'time': 'clock',
|
|
25
|
-
'time-outline': 'clock-outline',
|
|
26
|
-
'trash': 'delete',
|
|
27
|
-
'trash-outline': 'delete-outline',
|
|
28
|
-
'search': 'magnify',
|
|
29
|
-
'language': 'translate',
|
|
30
|
-
'language-outline': 'translate',
|
|
31
|
-
'settings': 'cog',
|
|
32
|
-
'document-text': 'file-document',
|
|
33
|
-
'information-circle': 'information',
|
|
34
|
-
'information-circle-outline': 'information-outline',
|
|
35
|
-
'log-out': 'logout',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return iconMap[iconName] || iconName;
|
|
39
|
-
};
|
|
40
12
|
|
|
41
13
|
interface GroupedItemProps {
|
|
42
14
|
icon?: string;
|
|
@@ -91,7 +63,7 @@ const GroupedItemComponent = ({
|
|
|
91
63
|
<View style={styles.actionIcon}>{customIcon}</View>
|
|
92
64
|
) : icon ? (
|
|
93
65
|
<View style={[styles.iconContainer, { backgroundColor: finalIconColor }]}>
|
|
94
|
-
<MaterialCommunityIcons name={
|
|
66
|
+
<MaterialCommunityIcons name={icon as any} size={22} color={darkenColor(finalIconColor)} />
|
|
95
67
|
</View>
|
|
96
68
|
) : null}
|
|
97
69
|
<View style={styles.actionTextContainer}>
|
|
@@ -105,7 +105,7 @@ export const FileViewer: React.FC<FileViewerProps> = ({
|
|
|
105
105
|
const items = [
|
|
106
106
|
{
|
|
107
107
|
id: 'filename',
|
|
108
|
-
icon: 'document
|
|
108
|
+
icon: 'file-document',
|
|
109
109
|
iconColor: themeStyles.colors.iconSecurity,
|
|
110
110
|
title: 'File Name',
|
|
111
111
|
subtitle: file.filename,
|
|
@@ -119,14 +119,14 @@ export const FileViewer: React.FC<FileViewerProps> = ({
|
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
id: 'type',
|
|
122
|
-
icon: 'code',
|
|
122
|
+
icon: 'code-tags',
|
|
123
123
|
iconColor: themeStyles.colors.iconData,
|
|
124
124
|
title: 'Type',
|
|
125
125
|
subtitle: file.contentType,
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
id: 'uploaded',
|
|
129
|
-
icon: '
|
|
129
|
+
icon: 'clock',
|
|
130
130
|
iconColor: themeStyles.colors.iconPersonalInfo,
|
|
131
131
|
title: 'Uploaded',
|
|
132
132
|
subtitle: new Date(file.uploadDate).toLocaleString(),
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
useState,
|
|
10
10
|
type ReactNode,
|
|
11
11
|
} from 'react';
|
|
12
|
+
import { Platform } from 'react-native';
|
|
12
13
|
import { OxyServices } from '../../core';
|
|
13
14
|
import type { User, ApiError } from '../../models/interfaces';
|
|
14
15
|
import type { ClientSession } from '../../models/session';
|
|
@@ -23,7 +24,7 @@ import { useSessionManagement } from '../hooks/useSessionManagement';
|
|
|
23
24
|
import { useAuthOperations } from './hooks/useAuthOperations';
|
|
24
25
|
import { useDeviceManagement } from '../hooks/useDeviceManagement';
|
|
25
26
|
import { getStorageKeys } from '../utils/storageHelpers';
|
|
26
|
-
import { isInvalidSessionError } from '../utils/errorHandlers';
|
|
27
|
+
import { isInvalidSessionError, isTimeoutOrNetworkError } from '../utils/errorHandlers';
|
|
27
28
|
import type { RouteName } from '../navigation/routes';
|
|
28
29
|
import { showBottomSheet as globalShowBottomSheet } from '../navigation/bottomSheetManager';
|
|
29
30
|
import { useQueryClient } from '@tanstack/react-query';
|
|
@@ -32,6 +33,7 @@ import { KeyManager } from '../../crypto/keyManager';
|
|
|
32
33
|
import { translate } from '../../i18n';
|
|
33
34
|
import { updateAvatarVisibility, updateProfileWithAvatar } from '../utils/avatarUtils';
|
|
34
35
|
import { useAccountStore } from '../stores/accountStore';
|
|
36
|
+
import { logger as loggerUtil } from '../../utils/loggerUtils';
|
|
35
37
|
|
|
36
38
|
export interface OxyContextState {
|
|
37
39
|
user: User | null;
|
|
@@ -114,9 +116,10 @@ const loadUseFollowHook = (): UseFollowHook => {
|
|
|
114
116
|
return cachedUseFollowHook;
|
|
115
117
|
} catch (error) {
|
|
116
118
|
if (__DEV__) {
|
|
117
|
-
|
|
119
|
+
loggerUtil.warn(
|
|
118
120
|
'useFollow hook is not available. Please import useFollow from @oxyhq/services directly.',
|
|
119
|
-
|
|
121
|
+
{ component: 'OxyContext', method: 'loadUseFollowHook' },
|
|
122
|
+
error
|
|
120
123
|
);
|
|
121
124
|
}
|
|
122
125
|
|
|
@@ -196,8 +199,10 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
196
199
|
const { storage, isReady: isStorageReady } = useStorage({ onError, logger });
|
|
197
200
|
|
|
198
201
|
// Identity integrity check and auto-restore on startup
|
|
202
|
+
// Skip on web platform - identity storage is only available on native platforms
|
|
199
203
|
useEffect(() => {
|
|
200
204
|
if (!storage || !isStorageReady) return;
|
|
205
|
+
if (Platform.OS === 'web') return; // Identity operations are native-only
|
|
201
206
|
|
|
202
207
|
const checkAndRestoreIdentity = async () => {
|
|
203
208
|
try {
|
|
@@ -422,8 +427,19 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
422
427
|
await syncIdentity();
|
|
423
428
|
}
|
|
424
429
|
}
|
|
425
|
-
} catch (syncError) {
|
|
426
|
-
|
|
430
|
+
} catch (syncError: any) {
|
|
431
|
+
// Skip sync silently if username is required (expected when offline onboarding)
|
|
432
|
+
if (syncError?.code === 'USERNAME_REQUIRED' || syncError?.message === 'USERNAME_REQUIRED') {
|
|
433
|
+
if (__DEV__) {
|
|
434
|
+
loggerUtil.debug('Sync skipped - username required', { component: 'OxyContext', method: 'checkNetworkAndSync' }, syncError as unknown);
|
|
435
|
+
}
|
|
436
|
+
// Don't log or show error - username will be set later
|
|
437
|
+
} else if (!isTimeoutOrNetworkError(syncError)) {
|
|
438
|
+
// Only log unexpected errors - timeouts/network issues are expected when offline
|
|
439
|
+
logger('Error syncing identity on reconnect', syncError);
|
|
440
|
+
} else if (__DEV__) {
|
|
441
|
+
loggerUtil.debug('Identity sync timeout (expected when offline)', { component: 'OxyContext', method: 'checkNetworkAndSync' }, syncError as unknown);
|
|
442
|
+
}
|
|
427
443
|
}
|
|
428
444
|
|
|
429
445
|
// TanStack Query will automatically retry pending mutations
|
|
@@ -506,10 +522,13 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
506
522
|
});
|
|
507
523
|
}
|
|
508
524
|
} catch (validationError) {
|
|
509
|
-
// Silently handle expected
|
|
525
|
+
// Silently handle expected errors (invalid sessions, timeouts, network issues) during restoration
|
|
510
526
|
// Only log unexpected errors
|
|
511
|
-
if (!isInvalidSessionError(validationError)) {
|
|
527
|
+
if (!isInvalidSessionError(validationError) && !isTimeoutOrNetworkError(validationError)) {
|
|
512
528
|
logger('Session validation failed during init', validationError);
|
|
529
|
+
} else if (__DEV__ && isTimeoutOrNetworkError(validationError)) {
|
|
530
|
+
// Only log timeouts in dev mode for debugging
|
|
531
|
+
loggerUtil.debug('Session validation timeout (expected when offline)', { component: 'OxyContext', method: 'restoreSessionsFromStorage' }, validationError as unknown);
|
|
513
532
|
}
|
|
514
533
|
}
|
|
515
534
|
}
|
|
@@ -523,7 +542,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
523
542
|
try {
|
|
524
543
|
await switchSession(storedActiveSessionId);
|
|
525
544
|
} catch (switchError) {
|
|
526
|
-
// Silently handle expected
|
|
545
|
+
// Silently handle expected errors (invalid sessions, timeouts, network issues)
|
|
527
546
|
if (isInvalidSessionError(switchError)) {
|
|
528
547
|
await storage.removeItem(storageKeys.activeSessionId);
|
|
529
548
|
updateSessions(
|
|
@@ -531,6 +550,11 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
531
550
|
{ merge: false },
|
|
532
551
|
);
|
|
533
552
|
// Don't log expected session errors during restoration
|
|
553
|
+
} else if (isTimeoutOrNetworkError(switchError)) {
|
|
554
|
+
// Timeout/network error - non-critical, don't block
|
|
555
|
+
if (__DEV__) {
|
|
556
|
+
loggerUtil.debug('Active session validation timeout (expected when offline)', { component: 'OxyContext', method: 'restoreSessionsFromStorage' }, switchError as unknown);
|
|
557
|
+
}
|
|
534
558
|
} else {
|
|
535
559
|
// Only log unexpected errors
|
|
536
560
|
logger('Active session validation error', switchError);
|
|
@@ -539,7 +563,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
539
563
|
}
|
|
540
564
|
} catch (error) {
|
|
541
565
|
if (__DEV__) {
|
|
542
|
-
|
|
566
|
+
loggerUtil.error('Auth init error', error instanceof Error ? error : new Error(String(error)), { component: 'OxyContext', method: 'restoreSessionsFromStorage' });
|
|
543
567
|
}
|
|
544
568
|
await clearSessionState();
|
|
545
569
|
} finally {
|
|
@@ -3,9 +3,9 @@ import type { ApiError, User } from '../../../models/interfaces';
|
|
|
3
3
|
import type { AuthState } from '../../stores/authStore';
|
|
4
4
|
import type { ClientSession, SessionLoginResponse } from '../../../models/session';
|
|
5
5
|
import { DeviceManager } from '../../../utils/deviceManager';
|
|
6
|
-
import { fetchSessionsWithFallback, mapSessionsToClient } from '
|
|
7
|
-
import { handleAuthError, isInvalidSessionError } from '
|
|
8
|
-
import type { StorageInterface } from '
|
|
6
|
+
import { fetchSessionsWithFallback, mapSessionsToClient } from '../../utils/sessionHelpers';
|
|
7
|
+
import { handleAuthError, isInvalidSessionError } from '../../utils/errorHandlers';
|
|
8
|
+
import type { StorageInterface } from '../../utils/storageHelpers';
|
|
9
9
|
import type { OxyServices } from '../../../core';
|
|
10
10
|
import { KeyManager, SignatureService, RecoveryPhraseService } from '../../../crypto';
|
|
11
11
|
|
|
@@ -342,7 +342,7 @@ export const useAuthOperations = ({
|
|
|
342
342
|
defaultMessage: 'Failed to create identity',
|
|
343
343
|
code: REGISTER_ERROR_CODE,
|
|
344
344
|
onError,
|
|
345
|
-
setAuthError: (msg) => setAuthState({ error: msg }),
|
|
345
|
+
setAuthError: (msg: string) => setAuthState({ error: msg }),
|
|
346
346
|
logger,
|
|
347
347
|
});
|
|
348
348
|
loginFailure(message);
|
|
@@ -405,6 +405,13 @@ export const useAuthOperations = ({
|
|
|
405
405
|
// Sign in
|
|
406
406
|
const user = await performSignIn(publicKey);
|
|
407
407
|
|
|
408
|
+
// Check if user has username - required for syncing
|
|
409
|
+
if (!user.username) {
|
|
410
|
+
const usernameError = new Error('USERNAME_REQUIRED');
|
|
411
|
+
(usernameError as any).code = 'USERNAME_REQUIRED';
|
|
412
|
+
throw usernameError;
|
|
413
|
+
}
|
|
414
|
+
|
|
408
415
|
// TanStack Query will automatically retry any pending mutations
|
|
409
416
|
|
|
410
417
|
return user;
|
|
@@ -413,7 +420,7 @@ export const useAuthOperations = ({
|
|
|
413
420
|
defaultMessage: 'Failed to sync identity',
|
|
414
421
|
code: REGISTER_ERROR_CODE,
|
|
415
422
|
onError,
|
|
416
|
-
setAuthError: (msg) => setAuthState({ error: msg }),
|
|
423
|
+
setAuthError: (msg: string) => setAuthState({ error: msg }),
|
|
417
424
|
logger,
|
|
418
425
|
});
|
|
419
426
|
loginFailure(message);
|
|
@@ -474,7 +481,7 @@ export const useAuthOperations = ({
|
|
|
474
481
|
defaultMessage: 'Failed to import identity',
|
|
475
482
|
code: REGISTER_ERROR_CODE,
|
|
476
483
|
onError,
|
|
477
|
-
setAuthError: (msg) => setAuthState({ error: msg }),
|
|
484
|
+
setAuthError: (msg: string) => setAuthState({ error: msg }),
|
|
478
485
|
logger,
|
|
479
486
|
});
|
|
480
487
|
loginFailure(message);
|
|
@@ -508,7 +515,7 @@ export const useAuthOperations = ({
|
|
|
508
515
|
defaultMessage: 'Sign in failed',
|
|
509
516
|
code: LOGIN_ERROR_CODE,
|
|
510
517
|
onError,
|
|
511
|
-
setAuthError: (msg) => setAuthState({ error: msg }),
|
|
518
|
+
setAuthError: (msg: string) => setAuthState({ error: msg }),
|
|
512
519
|
logger,
|
|
513
520
|
});
|
|
514
521
|
loginFailure(message);
|
|
@@ -554,7 +561,7 @@ export const useAuthOperations = ({
|
|
|
554
561
|
defaultMessage: 'Logout failed',
|
|
555
562
|
code: LOGOUT_ERROR_CODE,
|
|
556
563
|
onError,
|
|
557
|
-
setAuthError: (msg) => setAuthState({ error: msg }),
|
|
564
|
+
setAuthError: (msg: string) => setAuthState({ error: msg }),
|
|
558
565
|
logger,
|
|
559
566
|
status: isInvalid ? 401 : undefined,
|
|
560
567
|
});
|
|
@@ -592,7 +599,7 @@ export const useAuthOperations = ({
|
|
|
592
599
|
defaultMessage: 'Logout all failed',
|
|
593
600
|
code: LOGOUT_ALL_ERROR_CODE,
|
|
594
601
|
onError,
|
|
595
|
-
setAuthError: (msg) => setAuthState({ error: msg }),
|
|
602
|
+
setAuthError: (msg: string) => setAuthState({ error: msg }),
|
|
596
603
|
logger,
|
|
597
604
|
});
|
|
598
605
|
throw error instanceof Error ? error : new Error('Logout all failed');
|
|
@@ -2,7 +2,7 @@ import { useCallback } from 'react';
|
|
|
2
2
|
import type { ApiError } from '../../../models/interfaces';
|
|
3
3
|
import { DeviceManager } from '../../../utils/deviceManager';
|
|
4
4
|
import type { OxyServices } from '../../../core';
|
|
5
|
-
import { handleAuthError } from '
|
|
5
|
+
import { handleAuthError } from '../../utils/errorHandlers';
|
|
6
6
|
|
|
7
7
|
export interface UseDeviceManagementOptions {
|
|
8
8
|
oxyServices: OxyServices;
|