@oxyhq/services 5.26.0 → 5.26.2
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/HttpService.js +3 -3
- package/lib/commonjs/core/HttpService.js.map +1 -1
- package/lib/commonjs/crypto/keyManager.js +16 -21
- package/lib/commonjs/crypto/keyManager.js.map +1 -1
- package/lib/commonjs/index.js +1 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/lib/sonner.js +13 -17
- package/lib/commonjs/lib/sonner.js.map +1 -1
- package/lib/commonjs/lib/sonner.native.js +24 -0
- package/lib/commonjs/lib/sonner.native.js.map +1 -0
- package/lib/commonjs/lib/sonner.web.js +24 -0
- package/lib/commonjs/lib/sonner.web.js.map +1 -0
- package/lib/commonjs/ui/client.js +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +1 -1
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +1 -1
- package/lib/commonjs/ui/hooks/mutations/mutationFactory.js +1 -1
- package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/commonjs/ui/hooks/mutations/useServicesMutations.js +1 -1
- package/lib/commonjs/ui/hooks/useAsyncAction.js +1 -1
- package/lib/commonjs/ui/hooks/useSessionSocket.js +1 -1
- package/lib/commonjs/ui/hooks/useSettingToggle.js +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/commonjs/ui/screens/AppInfoScreen.js +1 -1
- package/lib/commonjs/ui/screens/EditProfileFieldScreen.js +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +1 -1
- package/lib/commonjs/ui/screens/FeedbackScreen.js +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +1 -1
- package/lib/commonjs/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/commonjs/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1 -1
- package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +1 -1
- package/lib/commonjs/utils/platform.js +129 -0
- package/lib/commonjs/utils/platform.js.map +1 -0
- package/lib/commonjs/utils/platformInit.js +13 -0
- package/lib/commonjs/utils/platformInit.js.map +1 -0
- package/lib/commonjs/utils/platformInit.native.js +16 -0
- package/lib/commonjs/utils/platformInit.native.js.map +1 -0
- package/lib/module/core/HttpService.js +3 -3
- package/lib/module/core/HttpService.js.map +1 -1
- package/lib/module/crypto/keyManager.js +16 -21
- package/lib/module/crypto/keyManager.js.map +1 -1
- package/lib/module/index.js +6 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/lib/sonner.js +11 -16
- package/lib/module/lib/sonner.js.map +1 -1
- package/lib/module/lib/sonner.native.js +19 -0
- package/lib/module/lib/sonner.native.js.map +1 -0
- package/lib/module/lib/sonner.web.js +19 -0
- package/lib/module/lib/sonner.web.js.map +1 -0
- package/lib/module/ui/client.js +1 -1
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +1 -1
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +1 -1
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +1 -1
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +1 -1
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js +1 -1
- package/lib/module/ui/hooks/mutations/mutationFactory.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js +1 -1
- package/lib/module/ui/hooks/mutations/useServicesMutations.js.map +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js.map +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js +1 -1
- package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js +1 -1
- package/lib/module/ui/hooks/useSettingToggle.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js +1 -1
- package/lib/module/ui/screens/EditProfileFieldScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +1 -1
- package/lib/module/ui/screens/FAQScreen.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/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js +1 -1
- package/lib/module/ui/screens/LanguageSelectorScreen.js.map +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js +1 -1
- package/lib/module/ui/screens/LegalDocumentsScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js +1 -1
- package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/utils/fileManagement.js +1 -1
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/utils/platform.js +118 -0
- package/lib/module/utils/platform.js.map +1 -0
- package/lib/module/utils/platformInit.js +13 -0
- package/lib/module/utils/platformInit.js.map +1 -0
- package/lib/module/utils/platformInit.native.js +16 -0
- package/lib/module/utils/platformInit.native.js.map +1 -0
- package/lib/typescript/commonjs/crypto/keyManager.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/lib/sonner.d.ts +11 -14
- package/lib/typescript/commonjs/lib/sonner.d.ts.map +1 -1
- package/lib/typescript/commonjs/lib/sonner.native.d.ts +15 -0
- package/lib/typescript/commonjs/lib/sonner.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/lib/sonner.web.d.ts +15 -0
- package/lib/typescript/commonjs/lib/sonner.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/platform.d.ts +41 -0
- package/lib/typescript/commonjs/utils/platform.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/platformInit.d.ts +10 -0
- package/lib/typescript/commonjs/utils/platformInit.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/platformInit.native.d.ts +2 -0
- package/lib/typescript/commonjs/utils/platformInit.native.d.ts.map +1 -0
- package/lib/typescript/module/crypto/keyManager.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/lib/sonner.d.ts +11 -14
- package/lib/typescript/module/lib/sonner.d.ts.map +1 -1
- package/lib/typescript/module/lib/sonner.native.d.ts +15 -0
- package/lib/typescript/module/lib/sonner.native.d.ts.map +1 -0
- package/lib/typescript/module/lib/sonner.web.d.ts +15 -0
- package/lib/typescript/module/lib/sonner.web.d.ts.map +1 -0
- package/lib/typescript/module/utils/platform.d.ts +41 -0
- package/lib/typescript/module/utils/platform.d.ts.map +1 -0
- package/lib/typescript/module/utils/platformInit.d.ts +10 -0
- package/lib/typescript/module/utils/platformInit.d.ts.map +1 -0
- package/lib/typescript/module/utils/platformInit.native.d.ts +2 -0
- package/lib/typescript/module/utils/platformInit.native.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/core/HttpService.ts +3 -3
- package/src/crypto/keyManager.ts +16 -21
- package/src/index.ts +6 -1
- package/src/lib/sonner.native.ts +28 -0
- package/src/lib/sonner.ts +11 -28
- package/src/lib/sonner.web.ts +28 -0
- package/src/utils/platform.ts +117 -0
- package/src/utils/platformInit.native.ts +13 -0
- package/src/utils/platformInit.ts +11 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Initialization - Web/Node.js Version
|
|
3
|
+
*
|
|
4
|
+
* This file is resolved by web bundlers (Vite, Webpack, etc.) and Node.js.
|
|
5
|
+
* It does NOT import from react-native.
|
|
6
|
+
*
|
|
7
|
+
* For React Native, Metro resolves platformInit.native.ts instead.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=platformInit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformInit.d.ts","sourceRoot":"","sources":["../../../../src/utils/platformInit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformInit.native.d.ts","sourceRoot":"","sources":["../../../../src/utils/platformInit.native.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyManager.d.ts","sourceRoot":"","sources":["../../../../src/crypto/keyManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"keyManager.d.ts","sourceRoot":"","sources":["../../../../src/crypto/keyManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAuH1C,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,UAAU;IAErB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAuB;IACrD,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAwB;IACxD,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAuB;IAC3D,OAAO,CAAC,MAAM,CAAC,uBAAuB,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GAAG,IAAI,CAAC;IA2BnD;;OAEG;WACU,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IA2B5C;;;;;;;OAOG;WACU,cAAc,CACzB,UAAU,GAAE,OAAe,EAC3B,KAAK,GAAE,OAAe,EACtB,aAAa,GAAE,OAAe,GAC7B,OAAO,CAAC,IAAI,CAAC;IAkDhB;;;OAGG;WACU,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IA6B/C;;OAEG;WACU,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC;IA2CxD;;OAEG;WACU,yBAAyB,IAAI,OAAO,CAAC,OAAO,CAAC;IAsD1D;;;OAGG;WACU,gBAAgB,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAS1D;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAKlD;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IASnD;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAWrD;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;CAInD;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* - Frontend: Full UI + Core functionality
|
|
6
6
|
* - Backend: Core functionality only (UI components are no-ops)
|
|
7
7
|
*/
|
|
8
|
+
import './utils/platformInit';
|
|
8
9
|
import './crypto/polyfill';
|
|
9
10
|
export { KeyManager, SignatureService, RecoveryPhraseService } from './crypto';
|
|
10
11
|
export { OxyServices, OxyAuthenticationError, OxyAuthenticationTimeoutError } from './core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
export declare const Toaster: ToasterComponent;
|
|
13
|
-
export type ToastT = typeof webToast;
|
|
14
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* Sonner Toast - Platform-Agnostic Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Bundlers resolve platform-specific implementations:
|
|
5
|
+
* - Metro (React Native): resolves to sonner.native.ts
|
|
6
|
+
* - Vite/Webpack (Web): resolves to sonner.web.ts
|
|
7
|
+
* - Node.js/SSR: uses this file (web fallback)
|
|
8
|
+
*
|
|
9
|
+
* This file exports web as the default for /core and /web entry points.
|
|
10
|
+
*/
|
|
11
|
+
export { toast, Toaster, type ToastT } from './sonner.web';
|
|
15
12
|
//# sourceMappingURL=sonner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../../../src/lib/sonner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../../../src/lib/sonner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface ToastFunction {
|
|
2
|
+
(message: string, options?: Record<string, unknown>): void;
|
|
3
|
+
success: (message: string, options?: Record<string, unknown>) => void;
|
|
4
|
+
error: (message: string, options?: Record<string, unknown>) => void;
|
|
5
|
+
info: (message: string, options?: Record<string, unknown>) => void;
|
|
6
|
+
warning: (message: string, options?: Record<string, unknown>) => void;
|
|
7
|
+
loading: (message: string, options?: Record<string, unknown>) => void;
|
|
8
|
+
}
|
|
9
|
+
type ToasterComponent = (props?: Record<string, unknown>) => React.ReactElement | null;
|
|
10
|
+
declare const nativeToast: ToastFunction;
|
|
11
|
+
export declare const toast: ToastFunction;
|
|
12
|
+
export declare const Toaster: ToasterComponent;
|
|
13
|
+
export type ToastT = typeof nativeToast;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=sonner.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.native.d.ts","sourceRoot":"","sources":["../../../../src/lib/sonner.native.ts"],"names":[],"mappings":"AASA,UAAU,aAAa;IACrB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3D,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACtE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACpE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACnE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACtE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACvE;AAED,KAAK,gBAAgB,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AAEvF,QAAA,MAAe,WAAW,eAGzB,CAAC;AAEF,eAAO,MAAM,KAAK,eAAc,CAAC;AACjC,eAAO,MAAM,OAAO,kBAAgB,CAAC;AACrC,MAAM,MAAM,MAAM,GAAG,OAAO,WAAW,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface ToastFunction {
|
|
2
|
+
(message: string, options?: Record<string, unknown>): void;
|
|
3
|
+
success: (message: string, options?: Record<string, unknown>) => void;
|
|
4
|
+
error: (message: string, options?: Record<string, unknown>) => void;
|
|
5
|
+
info: (message: string, options?: Record<string, unknown>) => void;
|
|
6
|
+
warning: (message: string, options?: Record<string, unknown>) => void;
|
|
7
|
+
loading: (message: string, options?: Record<string, unknown>) => void;
|
|
8
|
+
}
|
|
9
|
+
type ToasterComponent = (props?: Record<string, unknown>) => React.ReactElement | null;
|
|
10
|
+
declare const webToast: ToastFunction;
|
|
11
|
+
export declare const toast: ToastFunction;
|
|
12
|
+
export declare const Toaster: ToasterComponent;
|
|
13
|
+
export type ToastT = typeof webToast;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=sonner.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonner.web.d.ts","sourceRoot":"","sources":["../../../../src/lib/sonner.web.ts"],"names":[],"mappings":"AASA,UAAU,aAAa;IACrB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC3D,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACtE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACpE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACnE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACtE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACvE;AAED,KAAK,gBAAgB,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;AAEvF,QAAA,MAAe,QAAQ,eAGtB,CAAC;AAEF,eAAO,MAAM,KAAK,eAAW,CAAC;AAC9B,eAAO,MAAM,OAAO,kBAAa,CAAC;AAClC,MAAM,MAAM,MAAM,GAAG,OAAO,QAAQ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Detection Utility
|
|
3
|
+
*
|
|
4
|
+
* Provides platform detection WITHOUT importing from 'react-native'.
|
|
5
|
+
* This allows core modules to be used in web/Node.js environments
|
|
6
|
+
* without bundlers failing on react-native imports.
|
|
7
|
+
*/
|
|
8
|
+
export type PlatformOS = 'ios' | 'android' | 'web' | 'windows' | 'macos' | 'unknown';
|
|
9
|
+
/**
|
|
10
|
+
* Get the current platform OS
|
|
11
|
+
* Safe to call from any environment (web, Node.js, React Native)
|
|
12
|
+
*/
|
|
13
|
+
export declare function getPlatformOS(): PlatformOS;
|
|
14
|
+
/**
|
|
15
|
+
* Check if running on web platform (browser or Node.js)
|
|
16
|
+
*/
|
|
17
|
+
export declare function isWeb(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Check if running in a native app (iOS or Android)
|
|
20
|
+
*/
|
|
21
|
+
export declare function isNative(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Check if running on iOS
|
|
24
|
+
*/
|
|
25
|
+
export declare function isIOS(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Check if running on Android
|
|
28
|
+
*/
|
|
29
|
+
export declare function isAndroid(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Set the platform OS explicitly
|
|
32
|
+
* Called by React Native entry point to register the platform
|
|
33
|
+
* This allows lazy detection in environments where react-native is available
|
|
34
|
+
*/
|
|
35
|
+
export declare function setPlatformOS(os: PlatformOS): void;
|
|
36
|
+
/**
|
|
37
|
+
* Try to initialize platform from react-native if available
|
|
38
|
+
* This is called lazily when needed, avoiding top-level imports
|
|
39
|
+
*/
|
|
40
|
+
export declare function initPlatformFromReactNative(): Promise<void>;
|
|
41
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/utils/platform.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AA0CrF;;;GAGG;AACH,wBAAgB,aAAa,IAAI,UAAU,CAK1C;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAGlC;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,CAGlD;AAED;;;GAGG;AACH,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAYjE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Initialization - Web/Node.js Version
|
|
3
|
+
*
|
|
4
|
+
* This file is resolved by web bundlers (Vite, Webpack, etc.) and Node.js.
|
|
5
|
+
* It does NOT import from react-native.
|
|
6
|
+
*
|
|
7
|
+
* For React Native, Metro resolves platformInit.native.ts instead.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=platformInit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformInit.d.ts","sourceRoot":"","sources":["../../../../src/utils/platformInit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformInit.native.d.ts","sourceRoot":"","sources":["../../../../src/utils/platformInit.native.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/services",
|
|
3
|
-
"version": "5.26.
|
|
3
|
+
"version": "5.26.2",
|
|
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",
|
package/src/core/HttpService.ts
CHANGED
|
@@ -18,14 +18,14 @@ import { RequestDeduplicator, RequestQueue, SimpleLogger } from '../utils/reques
|
|
|
18
18
|
import { retryAsync } from '../utils/asyncUtils';
|
|
19
19
|
import { handleHttpError } from '../utils/errorUtils';
|
|
20
20
|
import { jwtDecode } from 'jwt-decode';
|
|
21
|
-
import {
|
|
21
|
+
import { isNative, getPlatformOS } from '../utils/platform';
|
|
22
22
|
import type { OxyConfig } from '../models/interfaces';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Check if we're running in a native app environment (React Native, not web)
|
|
26
26
|
* This is used to determine CSRF handling mode
|
|
27
27
|
*/
|
|
28
|
-
const isNativeApp =
|
|
28
|
+
const isNativeApp = isNative();
|
|
29
29
|
|
|
30
30
|
interface JwtPayload {
|
|
31
31
|
exp?: number;
|
|
@@ -284,7 +284,7 @@ export class HttpService {
|
|
|
284
284
|
url,
|
|
285
285
|
method,
|
|
286
286
|
isNativeApp,
|
|
287
|
-
platformOS:
|
|
287
|
+
platformOS: getPlatformOS(),
|
|
288
288
|
hasCsrfToken: !!csrfToken,
|
|
289
289
|
csrfTokenLength: csrfToken?.length,
|
|
290
290
|
hasNativeAppHeader: headers['X-Native-App'] === 'true',
|
package/src/crypto/keyManager.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { ec as EC } from 'elliptic';
|
|
9
9
|
import type { ECKeyPair } from 'elliptic';
|
|
10
|
-
import {
|
|
10
|
+
import { isWeb, isIOS, isAndroid } from '../utils/platform';
|
|
11
11
|
import { logger } from '../utils/loggerUtils';
|
|
12
12
|
|
|
13
13
|
// Lazy imports for React Native specific modules
|
|
@@ -80,12 +80,7 @@ function isNodeJS(): boolean {
|
|
|
80
80
|
* Identity storage is only available on native platforms (iOS/Android)
|
|
81
81
|
*/
|
|
82
82
|
function isWebPlatform(): boolean {
|
|
83
|
-
|
|
84
|
-
return Platform.OS === 'web';
|
|
85
|
-
} catch {
|
|
86
|
-
// Fallback if Platform is not available
|
|
87
|
-
return typeof window !== 'undefined' && typeof navigator !== 'undefined' && navigator.product !== 'ReactNative';
|
|
88
|
-
}
|
|
83
|
+
return isWeb();
|
|
89
84
|
}
|
|
90
85
|
|
|
91
86
|
async function initExpoCrypto(): Promise<typeof import('expo-crypto')> {
|
|
@@ -212,7 +207,7 @@ export class KeyManager {
|
|
|
212
207
|
const store = await initSecureStore();
|
|
213
208
|
const { privateKey, publicKey } = await KeyManager.generateKeyPair();
|
|
214
209
|
|
|
215
|
-
if (
|
|
210
|
+
if (isIOS()) {
|
|
216
211
|
// iOS: Store in shared keychain group
|
|
217
212
|
// Note: keychainAccessGroup requires Keychain Sharing capability in Xcode
|
|
218
213
|
try {
|
|
@@ -229,7 +224,7 @@ export class KeyManager {
|
|
|
229
224
|
`Failed to create shared identity on iOS. Ensure your app has the Keychain Sharing capability enabled with access group "${IOS_KEYCHAIN_GROUP}". Error: ${error}`
|
|
230
225
|
);
|
|
231
226
|
}
|
|
232
|
-
} else if (
|
|
227
|
+
} else if (isAndroid()) {
|
|
233
228
|
// Android: Store in secure store (accessible via sharedUserId)
|
|
234
229
|
// Note: All Oxy apps must have the same sharedUserId in AndroidManifest.xml
|
|
235
230
|
await store.setItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY, privateKey, {
|
|
@@ -269,11 +264,11 @@ export class KeyManager {
|
|
|
269
264
|
const store = await initSecureStore();
|
|
270
265
|
let publicKey: string | null = null;
|
|
271
266
|
|
|
272
|
-
if (
|
|
267
|
+
if (isIOS()) {
|
|
273
268
|
publicKey = await store.getItemAsync(STORAGE_KEYS.SHARED_PUBLIC_KEY, {
|
|
274
269
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
275
270
|
} as any);
|
|
276
|
-
} else if (
|
|
271
|
+
} else if (isAndroid()) {
|
|
277
272
|
publicKey = await store.getItemAsync(STORAGE_KEYS.SHARED_PUBLIC_KEY);
|
|
278
273
|
}
|
|
279
274
|
|
|
@@ -307,11 +302,11 @@ export class KeyManager {
|
|
|
307
302
|
const store = await initSecureStore();
|
|
308
303
|
let privateKey: string | null = null;
|
|
309
304
|
|
|
310
|
-
if (
|
|
305
|
+
if (isIOS()) {
|
|
311
306
|
privateKey = await store.getItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY, {
|
|
312
307
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
313
308
|
} as any);
|
|
314
|
-
} else if (
|
|
309
|
+
} else if (isAndroid()) {
|
|
315
310
|
privateKey = await store.getItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY);
|
|
316
311
|
}
|
|
317
312
|
|
|
@@ -376,7 +371,7 @@ export class KeyManager {
|
|
|
376
371
|
const keyPair = ec.keyFromPrivate(privateKey);
|
|
377
372
|
const publicKey = keyPair.getPublic('hex');
|
|
378
373
|
|
|
379
|
-
if (
|
|
374
|
+
if (isIOS()) {
|
|
380
375
|
await store.setItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY, privateKey, {
|
|
381
376
|
keychainAccessible: store.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
|
|
382
377
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
@@ -385,7 +380,7 @@ export class KeyManager {
|
|
|
385
380
|
await store.setItemAsync(STORAGE_KEYS.SHARED_PUBLIC_KEY, publicKey, {
|
|
386
381
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
387
382
|
} as any);
|
|
388
|
-
} else if (
|
|
383
|
+
} else if (isAndroid()) {
|
|
389
384
|
await store.setItemAsync(STORAGE_KEYS.SHARED_PRIVATE_KEY, privateKey, {
|
|
390
385
|
keychainAccessible: store.WHEN_UNLOCKED_THIS_DEVICE_ONLY,
|
|
391
386
|
});
|
|
@@ -422,7 +417,7 @@ export class KeyManager {
|
|
|
422
417
|
try {
|
|
423
418
|
const store = await initSecureStore();
|
|
424
419
|
|
|
425
|
-
if (
|
|
420
|
+
if (isIOS()) {
|
|
426
421
|
await store.setItemAsync(STORAGE_KEYS.SHARED_SESSION_ID, sessionId, {
|
|
427
422
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
428
423
|
} as any);
|
|
@@ -431,7 +426,7 @@ export class KeyManager {
|
|
|
431
426
|
keychainAccessible: store.WHEN_UNLOCKED,
|
|
432
427
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
433
428
|
} as any);
|
|
434
|
-
} else if (
|
|
429
|
+
} else if (isAndroid()) {
|
|
435
430
|
await store.setItemAsync(STORAGE_KEYS.SHARED_SESSION_ID, sessionId);
|
|
436
431
|
await store.setItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN, accessToken);
|
|
437
432
|
}
|
|
@@ -465,7 +460,7 @@ export class KeyManager {
|
|
|
465
460
|
let sessionId: string | null = null;
|
|
466
461
|
let accessToken: string | null = null;
|
|
467
462
|
|
|
468
|
-
if (
|
|
463
|
+
if (isIOS()) {
|
|
469
464
|
sessionId = await store.getItemAsync(STORAGE_KEYS.SHARED_SESSION_ID, {
|
|
470
465
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
471
466
|
} as any);
|
|
@@ -473,7 +468,7 @@ export class KeyManager {
|
|
|
473
468
|
accessToken = await store.getItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN, {
|
|
474
469
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
475
470
|
} as any);
|
|
476
|
-
} else if (
|
|
471
|
+
} else if (isAndroid()) {
|
|
477
472
|
sessionId = await store.getItemAsync(STORAGE_KEYS.SHARED_SESSION_ID);
|
|
478
473
|
accessToken = await store.getItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN);
|
|
479
474
|
}
|
|
@@ -505,14 +500,14 @@ export class KeyManager {
|
|
|
505
500
|
try {
|
|
506
501
|
const store = await initSecureStore();
|
|
507
502
|
|
|
508
|
-
if (
|
|
503
|
+
if (isIOS()) {
|
|
509
504
|
await store.deleteItemAsync(STORAGE_KEYS.SHARED_SESSION_ID, {
|
|
510
505
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
511
506
|
} as any);
|
|
512
507
|
await store.deleteItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN, {
|
|
513
508
|
keychainAccessGroup: IOS_KEYCHAIN_GROUP,
|
|
514
509
|
} as any);
|
|
515
|
-
} else if (
|
|
510
|
+
} else if (isAndroid()) {
|
|
516
511
|
await store.deleteItemAsync(STORAGE_KEYS.SHARED_SESSION_ID);
|
|
517
512
|
await store.deleteItemAsync(STORAGE_KEYS.SHARED_SESSION_TOKEN);
|
|
518
513
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OxyHQServices Main Export File - Universal (Frontend + Backend)
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* This exports everything but uses environment detection to avoid crashes.
|
|
5
5
|
* - Frontend: Full UI + Core functionality
|
|
6
6
|
* - Backend: Core functionality only (UI components are no-ops)
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
// IMPORTANT: Initialize platform detection first (before any other imports that may use it)
|
|
10
|
+
// This import resolves to platformInit.native.ts in React Native (Metro)
|
|
11
|
+
// or platformInit.ts in web/Node.js (Vite, Webpack, etc.)
|
|
12
|
+
import './utils/platformInit';
|
|
13
|
+
|
|
9
14
|
// IMPORTANT: Import crypto module first to ensure polyfills are loaded
|
|
10
15
|
// before any other code that might use Buffer or other polyfilled APIs
|
|
11
16
|
import './crypto/polyfill';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sonner Toast - Native Implementation
|
|
3
|
+
*
|
|
4
|
+
* This file is resolved by React Native bundlers (Metro)
|
|
5
|
+
* Only imports 'sonner-native', not 'sonner'
|
|
6
|
+
*/
|
|
7
|
+
import * as NativeSonner from 'sonner-native';
|
|
8
|
+
|
|
9
|
+
// Define proper types for the toast components
|
|
10
|
+
interface ToastFunction {
|
|
11
|
+
(message: string, options?: Record<string, unknown>): void;
|
|
12
|
+
success: (message: string, options?: Record<string, unknown>) => void;
|
|
13
|
+
error: (message: string, options?: Record<string, unknown>) => void;
|
|
14
|
+
info: (message: string, options?: Record<string, unknown>) => void;
|
|
15
|
+
warning: (message: string, options?: Record<string, unknown>) => void;
|
|
16
|
+
loading: (message: string, options?: Record<string, unknown>) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type ToasterComponent = (props?: Record<string, unknown>) => React.ReactElement | null;
|
|
20
|
+
|
|
21
|
+
const { toast: nativeToast, Toaster: NativeToaster } = NativeSonner as {
|
|
22
|
+
toast: ToastFunction;
|
|
23
|
+
Toaster: ToasterComponent;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const toast = nativeToast;
|
|
27
|
+
export const Toaster = NativeToaster;
|
|
28
|
+
export type ToastT = typeof nativeToast;
|
package/src/lib/sonner.ts
CHANGED
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
loading: (message: string, options?: Record<string, unknown>) => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
type ToasterComponent = (props?: Record<string, unknown>) => React.ReactElement | null;
|
|
16
|
-
|
|
17
|
-
const { toast: webToast, Toaster: WebToaster } = WebSonner as {
|
|
18
|
-
toast: ToastFunction;
|
|
19
|
-
Toaster: ToasterComponent;
|
|
20
|
-
};
|
|
21
|
-
const { toast: nativeToast, Toaster: NativeToaster } = NativeSonner as {
|
|
22
|
-
toast: ToastFunction;
|
|
23
|
-
Toaster: ToasterComponent;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const toast = Platform.OS === 'web' ? webToast : nativeToast;
|
|
27
|
-
export const Toaster = Platform.OS === 'web' ? WebToaster : NativeToaster;
|
|
28
|
-
export type ToastT = typeof webToast;
|
|
1
|
+
/**
|
|
2
|
+
* Sonner Toast - Platform-Agnostic Entry Point
|
|
3
|
+
*
|
|
4
|
+
* Bundlers resolve platform-specific implementations:
|
|
5
|
+
* - Metro (React Native): resolves to sonner.native.ts
|
|
6
|
+
* - Vite/Webpack (Web): resolves to sonner.web.ts
|
|
7
|
+
* - Node.js/SSR: uses this file (web fallback)
|
|
8
|
+
*
|
|
9
|
+
* This file exports web as the default for /core and /web entry points.
|
|
10
|
+
*/
|
|
11
|
+
export { toast, Toaster, type ToastT } from './sonner.web';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sonner Toast - Web Implementation
|
|
3
|
+
*
|
|
4
|
+
* This file is resolved by web bundlers (Vite, Webpack, etc.)
|
|
5
|
+
* Only imports 'sonner' (web version), not 'sonner-native'
|
|
6
|
+
*/
|
|
7
|
+
import * as WebSonner from 'sonner';
|
|
8
|
+
|
|
9
|
+
// Define proper types for the toast components
|
|
10
|
+
interface ToastFunction {
|
|
11
|
+
(message: string, options?: Record<string, unknown>): void;
|
|
12
|
+
success: (message: string, options?: Record<string, unknown>) => void;
|
|
13
|
+
error: (message: string, options?: Record<string, unknown>) => void;
|
|
14
|
+
info: (message: string, options?: Record<string, unknown>) => void;
|
|
15
|
+
warning: (message: string, options?: Record<string, unknown>) => void;
|
|
16
|
+
loading: (message: string, options?: Record<string, unknown>) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type ToasterComponent = (props?: Record<string, unknown>) => React.ReactElement | null;
|
|
20
|
+
|
|
21
|
+
const { toast: webToast, Toaster: WebToaster } = WebSonner as {
|
|
22
|
+
toast: ToastFunction;
|
|
23
|
+
Toaster: ToasterComponent;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const toast = webToast;
|
|
27
|
+
export const Toaster = WebToaster;
|
|
28
|
+
export type ToastT = typeof webToast;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Detection Utility
|
|
3
|
+
*
|
|
4
|
+
* Provides platform detection WITHOUT importing from 'react-native'.
|
|
5
|
+
* This allows core modules to be used in web/Node.js environments
|
|
6
|
+
* without bundlers failing on react-native imports.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export type PlatformOS = 'ios' | 'android' | 'web' | 'windows' | 'macos' | 'unknown';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Detect the current platform without importing react-native
|
|
13
|
+
*
|
|
14
|
+
* Detection order:
|
|
15
|
+
* 1. Check for React Native's Platform object on globalThis (set by RN runtime)
|
|
16
|
+
* 2. Check for Node.js environment
|
|
17
|
+
* 3. Check for browser environment
|
|
18
|
+
* 4. Fall back to 'unknown'
|
|
19
|
+
*/
|
|
20
|
+
function detectPlatform(): PlatformOS {
|
|
21
|
+
// Check if React Native Platform is available globally (set by RN runtime)
|
|
22
|
+
// This avoids static imports while still detecting RN environment
|
|
23
|
+
const rnPlatform = (globalThis as any).__REACT_NATIVE_PLATFORM__;
|
|
24
|
+
if (rnPlatform) {
|
|
25
|
+
return rnPlatform as PlatformOS;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Check navigator.product for React Native
|
|
29
|
+
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
|
|
30
|
+
// We're in React Native but Platform wasn't set globally
|
|
31
|
+
// Try to get OS from userAgent or default to 'unknown'
|
|
32
|
+
return 'unknown';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Check for Node.js environment
|
|
36
|
+
if (typeof process !== 'undefined' && process.versions?.node) {
|
|
37
|
+
return 'web'; // Treat Node.js as 'web' for compatibility (no native features)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Check for browser/web environment
|
|
41
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
42
|
+
return 'web';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return 'unknown';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Cache the platform detection result
|
|
49
|
+
let cachedPlatform: PlatformOS | null = null;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get the current platform OS
|
|
53
|
+
* Safe to call from any environment (web, Node.js, React Native)
|
|
54
|
+
*/
|
|
55
|
+
export function getPlatformOS(): PlatformOS {
|
|
56
|
+
if (cachedPlatform === null) {
|
|
57
|
+
cachedPlatform = detectPlatform();
|
|
58
|
+
}
|
|
59
|
+
return cachedPlatform;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if running on web platform (browser or Node.js)
|
|
64
|
+
*/
|
|
65
|
+
export function isWeb(): boolean {
|
|
66
|
+
return getPlatformOS() === 'web';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Check if running in a native app (iOS or Android)
|
|
71
|
+
*/
|
|
72
|
+
export function isNative(): boolean {
|
|
73
|
+
const os = getPlatformOS();
|
|
74
|
+
return os === 'ios' || os === 'android';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Check if running on iOS
|
|
79
|
+
*/
|
|
80
|
+
export function isIOS(): boolean {
|
|
81
|
+
return getPlatformOS() === 'ios';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Check if running on Android
|
|
86
|
+
*/
|
|
87
|
+
export function isAndroid(): boolean {
|
|
88
|
+
return getPlatformOS() === 'android';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Set the platform OS explicitly
|
|
93
|
+
* Called by React Native entry point to register the platform
|
|
94
|
+
* This allows lazy detection in environments where react-native is available
|
|
95
|
+
*/
|
|
96
|
+
export function setPlatformOS(os: PlatformOS): void {
|
|
97
|
+
cachedPlatform = os;
|
|
98
|
+
(globalThis as any).__REACT_NATIVE_PLATFORM__ = os;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Try to initialize platform from react-native if available
|
|
103
|
+
* This is called lazily when needed, avoiding top-level imports
|
|
104
|
+
*/
|
|
105
|
+
export async function initPlatformFromReactNative(): Promise<void> {
|
|
106
|
+
if (cachedPlatform !== null && cachedPlatform !== 'unknown') {
|
|
107
|
+
return; // Already initialized
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
// Dynamic import to avoid bundler issues
|
|
112
|
+
const { Platform } = await import('react-native');
|
|
113
|
+
setPlatformOS(Platform.OS as PlatformOS);
|
|
114
|
+
} catch {
|
|
115
|
+
// react-native not available, use detected platform
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Initialization - React Native Version
|
|
3
|
+
*
|
|
4
|
+
* This file is resolved by Metro bundler for React Native apps.
|
|
5
|
+
* It imports from react-native to set up platform detection.
|
|
6
|
+
*
|
|
7
|
+
* For web/Node.js, bundlers resolve platformInit.ts instead (no react-native import).
|
|
8
|
+
*/
|
|
9
|
+
import { Platform } from 'react-native';
|
|
10
|
+
import { setPlatformOS, type PlatformOS } from './platform';
|
|
11
|
+
|
|
12
|
+
// Initialize platform from React Native's Platform module
|
|
13
|
+
setPlatformOS(Platform.OS as PlatformOS);
|