@oxyhq/services 5.16.17 → 5.16.19
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/README.md +7 -8
- 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/index.js +0 -7
- package/lib/commonjs/crypto/index.js.map +1 -1
- package/lib/commonjs/crypto/keyManager.js +2 -2
- package/lib/commonjs/crypto/polyfill.js +4 -4
- package/lib/commonjs/i18n/locales/en-US.json +1 -1
- package/lib/commonjs/index.js +0 -7
- package/lib/commonjs/index.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 +61 -9
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/context/hooks/useAuthOperations.js +65 -17
- 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/useIdentityMutations.js +4 -4
- package/lib/commonjs/ui/hooks/useIdentityMutations.js.map +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.security.js +42 -0
- package/lib/module/core/mixins/OxyServices.security.js.map +1 -1
- package/lib/module/crypto/index.js +2 -3
- package/lib/module/crypto/index.js.map +1 -1
- package/lib/module/crypto/keyManager.js +2 -2
- package/lib/module/crypto/polyfill.js +4 -4
- package/lib/module/i18n/locales/en-US.json +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.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 +62 -10
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/context/hooks/useAuthOperations.js +65 -18
- 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/useIdentityMutations.js +4 -4
- package/lib/module/ui/hooks/useIdentityMutations.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.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 +2 -0
- package/lib/typescript/core/mixins/index.d.ts.map +1 -1
- package/lib/typescript/crypto/index.d.ts +1 -2
- package/lib/typescript/crypto/index.d.ts.map +1 -1
- package/lib/typescript/crypto/keyManager.d.ts +2 -2
- package/lib/typescript/crypto/polyfill.d.ts +2 -2
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/index.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 +6 -2
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +8 -4
- 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/useIdentityMutations.d.ts +15 -3
- package/lib/typescript/ui/hooks/useIdentityMutations.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 +1 -2
- package/src/core/mixins/OxyServices.security.ts +44 -0
- package/src/crypto/index.ts +2 -6
- package/src/crypto/keyManager.ts +2 -2
- package/src/crypto/polyfill.ts +4 -4
- package/src/i18n/locales/en-US.json +1 -1
- package/src/index.ts +2 -4
- 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 +53 -14
- package/src/ui/context/hooks/useAuthOperations.ts +83 -26
- 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/useIdentityMutations.ts +6 -6
- 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/crypto/recoveryPhrase.js +0 -152
- package/lib/commonjs/crypto/recoveryPhrase.js.map +0 -1
- 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/crypto/recoveryPhrase.js +0 -147
- package/lib/module/crypto/recoveryPhrase.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/crypto/recoveryPhrase.d.ts +0 -59
- package/lib/typescript/crypto/recoveryPhrase.d.ts.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/crypto/recoveryPhrase.ts +0 -166
- 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
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { User } from '../../models/interfaces';
|
|
7
7
|
export interface CreateIdentityResult {
|
|
8
|
-
recoveryPhrase: string[];
|
|
9
8
|
synced: boolean;
|
|
10
9
|
}
|
|
11
10
|
export interface ImportIdentityResult {
|
|
@@ -17,10 +16,23 @@ export interface ImportIdentityResult {
|
|
|
17
16
|
*/
|
|
18
17
|
export declare function useCreateIdentity(createIdentityFn: () => Promise<CreateIdentityResult>): import("@tanstack/react-query").UseMutationResult<CreateIdentityResult, Error, void, unknown>;
|
|
19
18
|
/**
|
|
20
|
-
* Hook for importing an identity from
|
|
19
|
+
* Hook for importing an identity from backup file
|
|
21
20
|
* Never deletes identity on error - preserves user data
|
|
22
21
|
*/
|
|
23
|
-
export declare function useImportIdentity(importIdentityFn: (
|
|
22
|
+
export declare function useImportIdentity(importIdentityFn: (backupData: {
|
|
23
|
+
encrypted: string;
|
|
24
|
+
salt: string;
|
|
25
|
+
iv: string;
|
|
26
|
+
publicKey: string;
|
|
27
|
+
}, password: string) => Promise<ImportIdentityResult>): import("@tanstack/react-query").UseMutationResult<ImportIdentityResult, Error, {
|
|
28
|
+
backupData: {
|
|
29
|
+
encrypted: string;
|
|
30
|
+
salt: string;
|
|
31
|
+
iv: string;
|
|
32
|
+
publicKey: string;
|
|
33
|
+
};
|
|
34
|
+
password: string;
|
|
35
|
+
}, unknown>;
|
|
24
36
|
/**
|
|
25
37
|
* Hook for syncing identity with server
|
|
26
38
|
* Never deletes identity on error - only logs and allows retry
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIdentityMutations.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useIdentityMutations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,
|
|
1
|
+
{"version":3,"file":"useIdentityMutations.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useIdentityMutations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,MAAM,OAAO,CAAC,oBAAoB,CAAC,iGAqBtD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,CAAC,UAAU,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC;gBAK7G;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE;cAAY,MAAM;YAe7H;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,iFAoCpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionSocket.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useSessionSocket.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSessionSocket.d.ts","sourceRoot":"","sources":["../../../../src/ui/hooks/useSessionSocket.ts"],"names":[],"mappings":"AAKA,UAAU,qBAAqB;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,EAAE,qBAAqB,QA4N3L"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageSelectorScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/LanguageSelectorScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LanguageSelectorScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/LanguageSelectorScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAS9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAY3D,UAAU,2BAA4B,SAAQ,eAAe;CAAI;;AA6LjE,wBAAkD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PremiumSubscriptionScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/PremiumSubscriptionScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAqD3D,QAAA,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0jCxD,CAAC;
|
|
1
|
+
{"version":3,"file":"PremiumSubscriptionScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/PremiumSubscriptionScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAqD3D,QAAA,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0jCxD,CAAC;AAmdF,eAAe,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/ProfileScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProfileScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/ProfileScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAY3D,UAAU,kBAAmB,SAAQ,eAAe;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAYD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4T/C,CAAC;AAiGF,eAAe,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SavesCollectionsScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/SavesCollectionsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAQnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;;
|
|
1
|
+
{"version":3,"file":"SavesCollectionsScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/SavesCollectionsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAQnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;;AAsM3D,wBAAkD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KarmaAboutScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/karma/KarmaAboutScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"KarmaAboutScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/karma/KarmaAboutScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQ9D,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwC/C,CAAC;AAwBF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KarmaRewardsScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/karma/KarmaRewardsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"KarmaRewardsScreen.d.ts","sourceRoot":"","sources":["../../../../../src/ui/screens/karma/KarmaRewardsScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAwB9D,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiZjD,CAAC;AA6MF,eAAe,kBAAkB,CAAC"}
|
|
@@ -12,6 +12,11 @@ export interface HandleAuthErrorOptions {
|
|
|
12
12
|
* This centralizes 401 detection across different fetch clients.
|
|
13
13
|
*/
|
|
14
14
|
export declare const isInvalidSessionError: (error: unknown) => boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Determine whether the error represents a timeout or network error.
|
|
17
|
+
* These are expected when the device is offline or has poor connectivity.
|
|
18
|
+
*/
|
|
19
|
+
export declare const isTimeoutOrNetworkError: (error: unknown) => boolean;
|
|
15
20
|
/**
|
|
16
21
|
* Extract a consistent error message from unknown error shapes.
|
|
17
22
|
*
|
|
@@ -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.19",
|
|
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",
|
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
"@react-native-community/netinfo": "^11.4.1",
|
|
95
95
|
"@tanstack/react-query": "^5.59.0",
|
|
96
96
|
"axios": "^1.9.0",
|
|
97
|
-
"bip39": "^3.1.0",
|
|
98
97
|
"buffer": "^6.0.3",
|
|
99
98
|
"elliptic": "^6.6.1",
|
|
100
99
|
"expo-blur": "~15.0.8",
|
|
@@ -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/index.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Oxy Crypto Module
|
|
3
3
|
*
|
|
4
4
|
* Provides cryptographic identity management for the Oxy ecosystem.
|
|
5
|
-
* Handles key generation, secure storage, digital signatures
|
|
5
|
+
* Handles key generation, secure storage, and digital signatures.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
// Import polyfills first - this ensures Buffer is available for
|
|
8
|
+
// Import polyfills first - this ensures Buffer is available for crypto libraries
|
|
9
9
|
import './polyfill';
|
|
10
10
|
|
|
11
11
|
export { KeyManager, type KeyPair } from './keyManager';
|
|
@@ -14,10 +14,6 @@ export {
|
|
|
14
14
|
type SignedMessage,
|
|
15
15
|
type AuthChallenge
|
|
16
16
|
} from './signatureService';
|
|
17
|
-
export {
|
|
18
|
-
RecoveryPhraseService,
|
|
19
|
-
type RecoveryPhraseResult
|
|
20
|
-
} from './recoveryPhrase';
|
|
21
17
|
|
|
22
18
|
// Re-export for convenience
|
|
23
19
|
export { KeyManager as default } from './keyManager';
|
package/src/crypto/keyManager.ts
CHANGED
|
@@ -181,7 +181,7 @@ export class KeyManager {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
|
-
* Import an existing key pair (e.g., from
|
|
184
|
+
* Import an existing key pair (e.g., from backup file)
|
|
185
185
|
*/
|
|
186
186
|
static async importKeyPair(privateKey: string): Promise<string> {
|
|
187
187
|
if (isWebPlatform()) {
|
|
@@ -287,7 +287,7 @@ export class KeyManager {
|
|
|
287
287
|
|
|
288
288
|
/**
|
|
289
289
|
* Delete the stored identity (both keys)
|
|
290
|
-
* Use with EXTREME caution - this is irreversible without a
|
|
290
|
+
* Use with EXTREME caution - this is irreversible without a backup file
|
|
291
291
|
* This should ONLY be called when explicitly requested by the user
|
|
292
292
|
* @param skipBackup - If true, skip backup before deletion (default: false)
|
|
293
293
|
* @param force - If true, skip confirmation checks (default: false)
|
package/src/crypto/polyfill.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* before any crypto operations are performed.
|
|
6
6
|
*
|
|
7
7
|
* Polyfills included:
|
|
8
|
-
* - Buffer: Required by
|
|
9
|
-
* - crypto.getRandomValues: Required
|
|
8
|
+
* - Buffer: Required by crypto libraries
|
|
9
|
+
* - crypto.getRandomValues: Required for secure random number generation
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
// Import Buffer polyfill for React Native compatibility
|
|
13
|
-
//
|
|
13
|
+
// Some crypto libraries depend on Buffer which isn't available in React Native
|
|
14
14
|
import { Buffer } from 'buffer';
|
|
15
15
|
|
|
16
16
|
// Get the global object in a cross-platform way
|
|
@@ -30,7 +30,7 @@ if (!globalObject.Buffer) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// Polyfill crypto.getRandomValues for React Native
|
|
33
|
-
// This is required by
|
|
33
|
+
// This is required by crypto libraries for secure random number generation
|
|
34
34
|
type CryptoLike = {
|
|
35
35
|
getRandomValues: <T extends ArrayBufferView>(array: T) => T;
|
|
36
36
|
};
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
"enterCode": "Enter the 6‑digit code from your authenticator app.",
|
|
238
238
|
"newPassword": "Set New Password",
|
|
239
239
|
"resetSuccess": "Your password has been reset! You can now sign in.",
|
|
240
|
-
"noEmail": "We no longer send recovery emails. Please use your
|
|
240
|
+
"noEmail": "We no longer send recovery emails. Please use your backup file to restore your identity. Contact support if you need assistance.",
|
|
241
241
|
"password": {
|
|
242
242
|
"minLength": "Password must be at least 8 characters long",
|
|
243
243
|
"mismatch": "Passwords do not match",
|
package/src/index.ts
CHANGED
|
@@ -13,8 +13,7 @@ import './crypto/polyfill';
|
|
|
13
13
|
// Crypto/Identity exports (must be before core to ensure polyfills are available)
|
|
14
14
|
export {
|
|
15
15
|
KeyManager,
|
|
16
|
-
SignatureService
|
|
17
|
-
RecoveryPhraseService
|
|
16
|
+
SignatureService
|
|
18
17
|
} from './crypto';
|
|
19
18
|
|
|
20
19
|
// Core exports
|
|
@@ -23,8 +22,7 @@ export { OXY_CLOUD_URL, oxyClient } from './core';
|
|
|
23
22
|
export type {
|
|
24
23
|
KeyPair,
|
|
25
24
|
SignedMessage,
|
|
26
|
-
AuthChallenge
|
|
27
|
-
RecoveryPhraseResult
|
|
25
|
+
AuthChallenge
|
|
28
26
|
} from './crypto';
|
|
29
27
|
|
|
30
28
|
// React context
|
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(),
|
|
@@ -24,7 +24,7 @@ import { useSessionManagement } from '../hooks/useSessionManagement';
|
|
|
24
24
|
import { useAuthOperations } from './hooks/useAuthOperations';
|
|
25
25
|
import { useDeviceManagement } from '../hooks/useDeviceManagement';
|
|
26
26
|
import { getStorageKeys } from '../utils/storageHelpers';
|
|
27
|
-
import { isInvalidSessionError } from '../utils/errorHandlers';
|
|
27
|
+
import { isInvalidSessionError, isTimeoutOrNetworkError } from '../utils/errorHandlers';
|
|
28
28
|
import type { RouteName } from '../navigation/routes';
|
|
29
29
|
import { showBottomSheet as globalShowBottomSheet } from '../navigation/bottomSheetManager';
|
|
30
30
|
import { useQueryClient } from '@tanstack/react-query';
|
|
@@ -33,6 +33,7 @@ import { KeyManager } from '../../crypto/keyManager';
|
|
|
33
33
|
import { translate } from '../../i18n';
|
|
34
34
|
import { updateAvatarVisibility, updateProfileWithAvatar } from '../utils/avatarUtils';
|
|
35
35
|
import { useAccountStore } from '../stores/accountStore';
|
|
36
|
+
import { logger as loggerUtil } from '../../utils/loggerUtils';
|
|
36
37
|
|
|
37
38
|
export interface OxyContextState {
|
|
38
39
|
user: User | null;
|
|
@@ -49,8 +50,8 @@ export interface OxyContextState {
|
|
|
49
50
|
currentNativeLanguageName: string;
|
|
50
51
|
|
|
51
52
|
// Identity management (public key authentication - offline-first)
|
|
52
|
-
createIdentity: () => Promise<{
|
|
53
|
-
importIdentity: (
|
|
53
|
+
createIdentity: () => Promise<{ synced: boolean }>;
|
|
54
|
+
importIdentity: (backupData: { encrypted: string; salt: string; iv: string; publicKey: string }, password: string) => Promise<{ synced: boolean }>;
|
|
54
55
|
signIn: (deviceName?: string) => Promise<User>;
|
|
55
56
|
hasIdentity: () => Promise<boolean>;
|
|
56
57
|
getPublicKey: () => Promise<string | null>;
|
|
@@ -115,9 +116,10 @@ const loadUseFollowHook = (): UseFollowHook => {
|
|
|
115
116
|
return cachedUseFollowHook;
|
|
116
117
|
} catch (error) {
|
|
117
118
|
if (__DEV__) {
|
|
118
|
-
|
|
119
|
+
loggerUtil.warn(
|
|
119
120
|
'useFollow hook is not available. Please import useFollow from @oxyhq/services directly.',
|
|
120
|
-
|
|
121
|
+
{ component: 'OxyContext', method: 'loadUseFollowHook' },
|
|
122
|
+
error
|
|
121
123
|
);
|
|
122
124
|
}
|
|
123
125
|
|
|
@@ -214,7 +216,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
214
216
|
if (__DEV__) {
|
|
215
217
|
logger(restored
|
|
216
218
|
? 'Identity restored from backup successfully'
|
|
217
|
-
: 'Identity integrity check failed - user may need to restore from
|
|
219
|
+
: 'Identity integrity check failed - user may need to restore from backup file'
|
|
218
220
|
);
|
|
219
221
|
}
|
|
220
222
|
} else {
|
|
@@ -232,7 +234,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
232
234
|
if (__DEV__) {
|
|
233
235
|
logger('Error during identity integrity check', error);
|
|
234
236
|
}
|
|
235
|
-
// Don't block app startup - user can recover with
|
|
237
|
+
// Don't block app startup - user can recover with backup file
|
|
236
238
|
}
|
|
237
239
|
};
|
|
238
240
|
|
|
@@ -285,7 +287,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
285
287
|
|
|
286
288
|
const {
|
|
287
289
|
createIdentity,
|
|
288
|
-
importIdentity,
|
|
290
|
+
importIdentity: importIdentityBase,
|
|
289
291
|
signIn,
|
|
290
292
|
logout,
|
|
291
293
|
logoutAll,
|
|
@@ -318,6 +320,24 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
318
320
|
// syncIdentity - TanStack Query handles offline mutations automatically
|
|
319
321
|
const syncIdentity = useCallback(() => syncIdentityBase(), [syncIdentityBase]);
|
|
320
322
|
|
|
323
|
+
// Wrapper for importIdentity to handle legacy calls gracefully
|
|
324
|
+
const importIdentity = useCallback(
|
|
325
|
+
async (backupData: { encrypted: string; salt: string; iv: string; publicKey: string } | string, password?: string): Promise<{ synced: boolean }> => {
|
|
326
|
+
// Handle legacy calls with single string argument (old recovery phrase signature)
|
|
327
|
+
if (typeof backupData === 'string') {
|
|
328
|
+
throw new Error('Recovery phrase import is no longer supported. Please use backup file import or QR code transfer instead.');
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Validate that password is provided
|
|
332
|
+
if (!password || typeof password !== 'string') {
|
|
333
|
+
throw new Error('Password is required for backup file import.');
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return importIdentityBase(backupData, password);
|
|
337
|
+
},
|
|
338
|
+
[importIdentityBase]
|
|
339
|
+
);
|
|
340
|
+
|
|
321
341
|
// Clear all account data when identity is lost (for accounts app)
|
|
322
342
|
// In accounts app, identity = account, so losing identity means losing everything
|
|
323
343
|
const clearAllAccountData = useCallback(async (): Promise<void> => {
|
|
@@ -425,8 +445,19 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
425
445
|
await syncIdentity();
|
|
426
446
|
}
|
|
427
447
|
}
|
|
428
|
-
} catch (syncError) {
|
|
429
|
-
|
|
448
|
+
} catch (syncError: any) {
|
|
449
|
+
// Skip sync silently if username is required (expected when offline onboarding)
|
|
450
|
+
if (syncError?.code === 'USERNAME_REQUIRED' || syncError?.message === 'USERNAME_REQUIRED') {
|
|
451
|
+
if (__DEV__) {
|
|
452
|
+
loggerUtil.debug('Sync skipped - username required', { component: 'OxyContext', method: 'checkNetworkAndSync' }, syncError as unknown);
|
|
453
|
+
}
|
|
454
|
+
// Don't log or show error - username will be set later
|
|
455
|
+
} else if (!isTimeoutOrNetworkError(syncError)) {
|
|
456
|
+
// Only log unexpected errors - timeouts/network issues are expected when offline
|
|
457
|
+
logger('Error syncing identity on reconnect', syncError);
|
|
458
|
+
} else if (__DEV__) {
|
|
459
|
+
loggerUtil.debug('Identity sync timeout (expected when offline)', { component: 'OxyContext', method: 'checkNetworkAndSync' }, syncError as unknown);
|
|
460
|
+
}
|
|
430
461
|
}
|
|
431
462
|
|
|
432
463
|
// TanStack Query will automatically retry pending mutations
|
|
@@ -509,10 +540,13 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
509
540
|
});
|
|
510
541
|
}
|
|
511
542
|
} catch (validationError) {
|
|
512
|
-
// Silently handle expected
|
|
543
|
+
// Silently handle expected errors (invalid sessions, timeouts, network issues) during restoration
|
|
513
544
|
// Only log unexpected errors
|
|
514
|
-
if (!isInvalidSessionError(validationError)) {
|
|
545
|
+
if (!isInvalidSessionError(validationError) && !isTimeoutOrNetworkError(validationError)) {
|
|
515
546
|
logger('Session validation failed during init', validationError);
|
|
547
|
+
} else if (__DEV__ && isTimeoutOrNetworkError(validationError)) {
|
|
548
|
+
// Only log timeouts in dev mode for debugging
|
|
549
|
+
loggerUtil.debug('Session validation timeout (expected when offline)', { component: 'OxyContext', method: 'restoreSessionsFromStorage' }, validationError as unknown);
|
|
516
550
|
}
|
|
517
551
|
}
|
|
518
552
|
}
|
|
@@ -526,7 +560,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
526
560
|
try {
|
|
527
561
|
await switchSession(storedActiveSessionId);
|
|
528
562
|
} catch (switchError) {
|
|
529
|
-
// Silently handle expected
|
|
563
|
+
// Silently handle expected errors (invalid sessions, timeouts, network issues)
|
|
530
564
|
if (isInvalidSessionError(switchError)) {
|
|
531
565
|
await storage.removeItem(storageKeys.activeSessionId);
|
|
532
566
|
updateSessions(
|
|
@@ -534,6 +568,11 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
534
568
|
{ merge: false },
|
|
535
569
|
);
|
|
536
570
|
// Don't log expected session errors during restoration
|
|
571
|
+
} else if (isTimeoutOrNetworkError(switchError)) {
|
|
572
|
+
// Timeout/network error - non-critical, don't block
|
|
573
|
+
if (__DEV__) {
|
|
574
|
+
loggerUtil.debug('Active session validation timeout (expected when offline)', { component: 'OxyContext', method: 'restoreSessionsFromStorage' }, switchError as unknown);
|
|
575
|
+
}
|
|
537
576
|
} else {
|
|
538
577
|
// Only log unexpected errors
|
|
539
578
|
logger('Active session validation error', switchError);
|
|
@@ -542,7 +581,7 @@ export const OxyProvider: React.FC<OxyContextProviderProps> = ({
|
|
|
542
581
|
}
|
|
543
582
|
} catch (error) {
|
|
544
583
|
if (__DEV__) {
|
|
545
|
-
|
|
584
|
+
loggerUtil.error('Auth init error', error instanceof Error ? error : new Error(String(error)), { component: 'OxyContext', method: 'restoreSessionsFromStorage' });
|
|
546
585
|
}
|
|
547
586
|
await clearSessionState();
|
|
548
587
|
} finally {
|