@oxyhq/core 1.2.0 → 1.2.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/dist/cjs/index.js CHANGED
@@ -29,8 +29,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
29
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
30
30
  };
31
31
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.createCircuitBreakerState = exports.DEFAULT_CIRCUIT_BREAKER_CONFIG = exports.isRetryableError = exports.isNetworkError = exports.isServerError = exports.isRateLimitError = exports.isNotFoundError = exports.isForbiddenError = exports.isUnauthorizedError = exports.isAlreadyRegisteredError = exports.getErrorMessage = exports.getErrorStatus = exports.HttpStatus = exports.getSystemColorScheme = exports.systemPrefersDarkMode = exports.getOppositeTheme = exports.normalizeColorScheme = exports.normalizeTheme = exports.getContrastTextColor = exports.isLightColor = exports.withOpacity = exports.rgbToHex = exports.hexToRgb = exports.lightenColor = exports.darkenColor = exports.initPlatformFromReactNative = exports.isAndroid = exports.isIOS = exports.isNative = exports.isWeb = exports.setPlatformOS = exports.getPlatformOS = exports.normalizeLanguageCode = exports.getNativeLanguageName = exports.getLanguageName = exports.getLanguageMetadata = exports.SUPPORTED_LANGUAGES = exports.DeviceManager = exports.RecoveryPhraseService = exports.SignatureService = exports.KeyManager = exports.createCrossDomainAuth = exports.CrossDomainAuth = exports.createAuthManager = exports.AuthManager = exports.oxyClient = exports.OXY_CLOUD_URL = exports.OxyAuthenticationTimeoutError = exports.OxyAuthenticationError = exports.OxyServices = void 0;
33
- exports.logPerformance = exports.logPayment = exports.logDevice = exports.logUser = exports.logSession = exports.logApi = exports.logAuth = exports.LogLevel = exports.logger = exports.retryAsync = exports.validateRequiredFields = exports.handleHttpError = exports.createApiError = exports.ErrorCodes = exports.packageInfo = exports.sessionsArraysEqual = exports.normalizeAndSortSessions = exports.mergeSessions = exports.translate = exports.createDebugLogger = exports.debugError = exports.debugWarn = exports.debugLog = exports.isDev = exports.withRetry = exports.delay = exports.shouldAllowRequest = exports.recordSuccess = exports.recordFailure = exports.calculateBackoffInterval = void 0;
32
+ exports.calculateBackoffInterval = exports.createCircuitBreakerState = exports.DEFAULT_CIRCUIT_BREAKER_CONFIG = exports.isRetryableError = exports.isNetworkError = exports.isServerError = exports.isRateLimitError = exports.isNotFoundError = exports.isForbiddenError = exports.isUnauthorizedError = exports.isAlreadyRegisteredError = exports.getErrorMessage = exports.getErrorStatus = exports.HttpStatus = exports.getSystemColorScheme = exports.systemPrefersDarkMode = exports.getOppositeTheme = exports.normalizeColorScheme = exports.normalizeTheme = exports.getContrastTextColor = exports.isLightColor = exports.withOpacity = exports.rgbToHex = exports.hexToRgb = exports.lightenColor = exports.darkenColor = exports.isAndroid = exports.isIOS = exports.isNative = exports.isWeb = exports.setPlatformOS = exports.getPlatformOS = exports.normalizeLanguageCode = exports.getNativeLanguageName = exports.getLanguageName = exports.getLanguageMetadata = exports.SUPPORTED_LANGUAGES = exports.DeviceManager = exports.RecoveryPhraseService = exports.SignatureService = exports.KeyManager = exports.createCrossDomainAuth = exports.CrossDomainAuth = exports.createAuthManager = exports.AuthManager = exports.oxyClient = exports.OXY_CLOUD_URL = exports.OxyAuthenticationTimeoutError = exports.OxyAuthenticationError = exports.OxyServices = void 0;
33
+ exports.logPerformance = exports.logPayment = exports.logDevice = exports.logUser = exports.logSession = exports.logApi = exports.logAuth = exports.LogLevel = exports.logger = exports.retryAsync = exports.validateRequiredFields = exports.handleHttpError = exports.createApiError = exports.ErrorCodes = exports.packageInfo = exports.sessionsArraysEqual = exports.normalizeAndSortSessions = exports.mergeSessions = exports.translate = exports.createDebugLogger = exports.debugError = exports.debugWarn = exports.debugLog = exports.isDev = exports.withRetry = exports.delay = exports.shouldAllowRequest = exports.recordSuccess = exports.recordFailure = void 0;
34
34
  // Ensure crypto polyfills are loaded before anything else
35
35
  require("./crypto/polyfill");
36
36
  // --- Core API Client ---
@@ -74,7 +74,6 @@ Object.defineProperty(exports, "isWeb", { enumerable: true, get: function () { r
74
74
  Object.defineProperty(exports, "isNative", { enumerable: true, get: function () { return platform_1.isNative; } });
75
75
  Object.defineProperty(exports, "isIOS", { enumerable: true, get: function () { return platform_1.isIOS; } });
76
76
  Object.defineProperty(exports, "isAndroid", { enumerable: true, get: function () { return platform_1.isAndroid; } });
77
- Object.defineProperty(exports, "initPlatformFromReactNative", { enumerable: true, get: function () { return platform_1.initPlatformFromReactNative; } });
78
77
  // --- Shared Utilities ---
79
78
  var colorUtils_1 = require("./shared/utils/colorUtils");
80
79
  Object.defineProperty(exports, "darkenColor", { enumerable: true, get: function () { return colorUtils_1.darkenColor; } });
@@ -6,39 +6,6 @@
6
6
  * This allows core modules to be used in web/Node.js environments
7
7
  * without bundlers failing on react-native imports.
8
8
  */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
9
  Object.defineProperty(exports, "__esModule", { value: true });
43
10
  exports.getPlatformOS = getPlatformOS;
44
11
  exports.isWeb = isWeb;
@@ -46,7 +13,6 @@ exports.isNative = isNative;
46
13
  exports.isIOS = isIOS;
47
14
  exports.isAndroid = isAndroid;
48
15
  exports.setPlatformOS = setPlatformOS;
49
- exports.initPlatformFromReactNative = initPlatformFromReactNative;
50
16
  /**
51
17
  * Detect the current platform without importing react-native
52
18
  *
@@ -125,21 +91,3 @@ function setPlatformOS(os) {
125
91
  cachedPlatform = os;
126
92
  globalThis.__REACT_NATIVE_PLATFORM__ = os;
127
93
  }
128
- /**
129
- * Try to initialize platform from react-native if available
130
- * This is called lazily when needed, avoiding top-level imports
131
- */
132
- async function initPlatformFromReactNative() {
133
- if (cachedPlatform !== null && cachedPlatform !== 'unknown') {
134
- return; // Already initialized
135
- }
136
- try {
137
- // Variable indirection prevents bundlers (Vite, webpack) from statically resolving this
138
- const moduleName = 'react-native';
139
- const { Platform } = await Promise.resolve(`${moduleName}`).then(s => __importStar(require(s)));
140
- setPlatformOS(Platform.OS);
141
- }
142
- catch {
143
- // react-native not available, use detected platform
144
- }
145
- }
package/dist/esm/index.js CHANGED
@@ -31,7 +31,7 @@ export { DeviceManager } from './utils/deviceManager';
31
31
  // --- Language Utilities ---
32
32
  export { SUPPORTED_LANGUAGES, getLanguageMetadata, getLanguageName, getNativeLanguageName, normalizeLanguageCode, } from './utils/languageUtils';
33
33
  // --- Platform Detection ---
34
- export { getPlatformOS, setPlatformOS, isWeb, isNative, isIOS, isAndroid, initPlatformFromReactNative, } from './utils/platform';
34
+ export { getPlatformOS, setPlatformOS, isWeb, isNative, isIOS, isAndroid, } from './utils/platform';
35
35
  // --- Shared Utilities ---
36
36
  export { darkenColor, lightenColor, hexToRgb, rgbToHex, withOpacity, isLightColor, getContrastTextColor, } from './shared/utils/colorUtils';
37
37
  export { normalizeTheme, normalizeColorScheme, getOppositeTheme, systemPrefersDarkMode, getSystemColorScheme, } from './shared/utils/themeUtils';
@@ -83,21 +83,3 @@ export function setPlatformOS(os) {
83
83
  cachedPlatform = os;
84
84
  globalThis.__REACT_NATIVE_PLATFORM__ = os;
85
85
  }
86
- /**
87
- * Try to initialize platform from react-native if available
88
- * This is called lazily when needed, avoiding top-level imports
89
- */
90
- export async function initPlatformFromReactNative() {
91
- if (cachedPlatform !== null && cachedPlatform !== 'unknown') {
92
- return; // Already initialized
93
- }
94
- try {
95
- // Variable indirection prevents bundlers (Vite, webpack) from statically resolving this
96
- const moduleName = 'react-native';
97
- const { Platform } = await import(moduleName);
98
- setPlatformOS(Platform.OS);
99
- }
100
- catch {
101
- // react-native not available, use detected platform
102
- }
103
- }
@@ -31,7 +31,7 @@ export { DeviceManager } from './utils/deviceManager';
31
31
  export type { DeviceFingerprint, StoredDeviceInfo } from './utils/deviceManager';
32
32
  export { SUPPORTED_LANGUAGES, getLanguageMetadata, getLanguageName, getNativeLanguageName, normalizeLanguageCode, } from './utils/languageUtils';
33
33
  export type { LanguageMetadata } from './utils/languageUtils';
34
- export { getPlatformOS, setPlatformOS, isWeb, isNative, isIOS, isAndroid, initPlatformFromReactNative, } from './utils/platform';
34
+ export { getPlatformOS, setPlatformOS, isWeb, isNative, isIOS, isAndroid, } from './utils/platform';
35
35
  export type { PlatformOS } from './utils/platform';
36
36
  export { darkenColor, lightenColor, hexToRgb, rgbToHex, withOpacity, isLightColor, getContrastTextColor, } from './shared/utils/colorUtils';
37
37
  export { normalizeTheme, normalizeColorScheme, getOppositeTheme, systemPrefersDarkMode, getSystemColorScheme, } from './shared/utils/themeUtils';
@@ -33,8 +33,3 @@ export declare function isAndroid(): boolean;
33
33
  * This allows lazy detection in environments where react-native is available
34
34
  */
35
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/core",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "OxyHQ SDK Foundation — API client, authentication, cryptographic identity, and shared utilities",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/index.ts CHANGED
@@ -61,7 +61,6 @@ export {
61
61
  isNative,
62
62
  isIOS,
63
63
  isAndroid,
64
- initPlatformFromReactNative,
65
64
  } from './utils/platform';
66
65
  export type { PlatformOS } from './utils/platform';
67
66
 
@@ -98,21 +98,3 @@ export function setPlatformOS(os: PlatformOS): void {
98
98
  (globalThis as any).__REACT_NATIVE_PLATFORM__ = os;
99
99
  }
100
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
- // Variable indirection prevents bundlers (Vite, webpack) from statically resolving this
112
- const moduleName = 'react-native';
113
- const { Platform } = await import(moduleName);
114
- setPlatformOS(Platform.OS as PlatformOS);
115
- } catch {
116
- // react-native not available, use detected platform
117
- }
118
- }