@oxyhq/services 5.4.4 → 5.4.6

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.
Files changed (105) hide show
  1. package/lib/commonjs/core/index.js +81 -3
  2. package/lib/commonjs/core/index.js.map +1 -1
  3. package/lib/commonjs/index.js +50 -1
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/commonjs/ui/components/FollowButton.js +94 -31
  6. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  7. package/lib/commonjs/ui/components/OxySignInButton.js +2 -2
  8. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  9. package/lib/commonjs/ui/context/OxyContext.js +11 -1
  10. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  11. package/lib/commonjs/ui/hooks/index.js +13 -0
  12. package/lib/commonjs/ui/hooks/index.js.map +1 -0
  13. package/lib/commonjs/ui/hooks/useFollow.js +203 -0
  14. package/lib/commonjs/ui/hooks/useFollow.js.map +1 -0
  15. package/lib/commonjs/ui/index.js +25 -1
  16. package/lib/commonjs/ui/index.js.map +1 -1
  17. package/lib/commonjs/ui/screens/AccountCenterScreen.js +4 -3
  18. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  19. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +7 -6
  20. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  21. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +3 -2
  22. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  23. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +3 -2
  24. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  25. package/lib/commonjs/ui/screens/AppInfoScreen.js +25 -45
  26. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  27. package/lib/commonjs/ui/screens/FileManagementScreen.js +9 -27
  28. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  29. package/lib/commonjs/ui/screens/SignInScreen.js +1 -1
  30. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  31. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +5 -4
  32. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  33. package/lib/commonjs/ui/store/index.js +223 -4
  34. package/lib/commonjs/ui/store/index.js.map +1 -1
  35. package/lib/module/core/index.js +81 -3
  36. package/lib/module/core/index.js.map +1 -1
  37. package/lib/module/index.js +6 -2
  38. package/lib/module/index.js.map +1 -1
  39. package/lib/module/ui/components/FollowButton.js +95 -32
  40. package/lib/module/ui/components/FollowButton.js.map +1 -1
  41. package/lib/module/ui/components/OxySignInButton.js +2 -2
  42. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  43. package/lib/module/ui/context/OxyContext.js +11 -1
  44. package/lib/module/ui/context/OxyContext.js.map +1 -1
  45. package/lib/module/ui/hooks/index.js +4 -0
  46. package/lib/module/ui/hooks/index.js.map +1 -0
  47. package/lib/module/ui/hooks/useFollow.js +199 -0
  48. package/lib/module/ui/hooks/useFollow.js.map +1 -0
  49. package/lib/module/ui/index.js +9 -0
  50. package/lib/module/ui/index.js.map +1 -1
  51. package/lib/module/ui/screens/AccountCenterScreen.js +4 -3
  52. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  53. package/lib/module/ui/screens/AccountOverviewScreen.js +7 -6
  54. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  55. package/lib/module/ui/screens/AccountSettingsScreen.js +3 -2
  56. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  57. package/lib/module/ui/screens/AccountSwitcherScreen.js +3 -2
  58. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  59. package/lib/module/ui/screens/AppInfoScreen.js +25 -45
  60. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  61. package/lib/module/ui/screens/FileManagementScreen.js +9 -27
  62. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  63. package/lib/module/ui/screens/SignInScreen.js +1 -1
  64. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  65. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +5 -4
  66. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  67. package/lib/module/ui/store/index.js +219 -4
  68. package/lib/module/ui/store/index.js.map +1 -1
  69. package/lib/typescript/core/index.d.ts +44 -3
  70. package/lib/typescript/core/index.d.ts.map +1 -1
  71. package/lib/typescript/index.d.ts +4 -2
  72. package/lib/typescript/index.d.ts.map +1 -1
  73. package/lib/typescript/ui/components/FollowButton.d.ts +1 -0
  74. package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
  75. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  76. package/lib/typescript/ui/hooks/index.d.ts +2 -0
  77. package/lib/typescript/ui/hooks/index.d.ts.map +1 -0
  78. package/lib/typescript/ui/hooks/useFollow.d.ts +43 -0
  79. package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -0
  80. package/lib/typescript/ui/index.d.ts +3 -0
  81. package/lib/typescript/ui/index.d.ts.map +1 -1
  82. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  83. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  84. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
  85. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
  86. package/lib/typescript/ui/store/index.d.ts +47 -0
  87. package/lib/typescript/ui/store/index.d.ts.map +1 -1
  88. package/package.json +1 -1
  89. package/src/core/index.ts +88 -3
  90. package/src/index.ts +19 -3
  91. package/src/ui/components/FollowButton.tsx +128 -56
  92. package/src/ui/components/OxySignInButton.tsx +2 -2
  93. package/src/ui/context/OxyContext.tsx +12 -2
  94. package/src/ui/hooks/index.ts +1 -0
  95. package/src/ui/hooks/useFollow.ts +193 -0
  96. package/src/ui/index.ts +9 -0
  97. package/src/ui/screens/AccountCenterScreen.tsx +17 -15
  98. package/src/ui/screens/AccountOverviewScreen.tsx +25 -25
  99. package/src/ui/screens/AccountSettingsScreen.tsx +30 -30
  100. package/src/ui/screens/AccountSwitcherScreen.tsx +34 -33
  101. package/src/ui/screens/AppInfoScreen.tsx +173 -192
  102. package/src/ui/screens/FileManagementScreen.tsx +248 -268
  103. package/src/ui/screens/SignInScreen.tsx +2 -2
  104. package/src/ui/screens/karma/KarmaCenterScreen.tsx +4 -4
  105. package/src/ui/store/index.ts +202 -3
@@ -36,7 +36,7 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
36
36
  theme,
37
37
  navigate,
38
38
  }) => {
39
- const { user, sessions, oxyServices } = useOxy();
39
+ const { user, sessions, oxyServices, isAuthenticated } = useOxy();
40
40
  const [systemInfo, setSystemInfo] = useState<SystemInfo | null>(null);
41
41
  const [isRunningSystemCheck, setIsRunningSystemCheck] = useState(false);
42
42
  const [connectionStatus, setConnectionStatus] = useState<'checking' | 'connected' | 'disconnected' | 'unknown'>('unknown');
@@ -69,18 +69,15 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
69
69
  // Check API connection on mount
70
70
  const checkConnection = async () => {
71
71
  setConnectionStatus('checking');
72
- const apiBaseUrl = oxyServices?.getBaseURL() || 'https://api.oxy.so';
72
+
73
+ if (!oxyServices) {
74
+ setConnectionStatus('disconnected');
75
+ return;
76
+ }
77
+
73
78
  try {
74
- const response = await fetch(`${apiBaseUrl}/`, {
75
- method: 'GET',
76
- timeout: 3000,
77
- } as any);
78
-
79
- if (response.ok) {
80
- setConnectionStatus('connected');
81
- } else {
82
- setConnectionStatus('disconnected');
83
- }
79
+ await oxyServices.healthCheck();
80
+ setConnectionStatus('connected');
84
81
  } catch (error) {
85
82
  setConnectionStatus('disconnected');
86
83
  }
@@ -111,32 +108,21 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
111
108
 
112
109
  setIsRunningSystemCheck(true);
113
110
  const checks = [];
114
-
111
+
115
112
  // Get the API base URL from the services instance
116
113
  const apiBaseUrl = oxyServices?.getBaseURL() || 'https://api.oxy.so'; // Default for now, could be made configurable
117
-
114
+
118
115
  try {
119
116
  // Check 1: API Server Health
120
117
  checks.push('🔍 Checking API server connection...');
121
118
  toast.info('Running system checks...', { duration: 2000 });
122
-
119
+
123
120
  try {
124
- const response = await fetch(`${apiBaseUrl}/`, {
125
- method: 'GET',
126
- timeout: 5000,
127
- } as any);
128
-
129
- if (response.ok) {
130
- const data = await response.json();
131
- checks.push('✅ API server is responding');
132
- checks.push(`📊 Server stats: ${data.users || 0} users`);
133
- checks.push(`🌐 API URL: ${apiBaseUrl}`);
134
- setConnectionStatus('connected');
135
- } else {
136
- checks.push('❌ API server returned error status');
137
- checks.push(` Status: ${response.status} ${response.statusText}`);
138
- setConnectionStatus('disconnected');
139
- }
121
+ const data = await oxyServices.healthCheck();
122
+ checks.push('✅ API server is responding');
123
+ checks.push(`📊 Server stats: ${data.users || 0} users`);
124
+ checks.push(`🌐 API URL: ${apiBaseUrl}`);
125
+ setConnectionStatus('connected');
140
126
  } catch (error) {
141
127
  checks.push('❌ API server connection failed');
142
128
  checks.push(` Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
@@ -146,9 +132,9 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
146
132
 
147
133
  // Check 2: Authentication Status
148
134
  checks.push('🔍 Checking authentication...');
149
- if (oxyServices.isAuthenticated()) {
150
- checks.push('✅ User is authenticated');
151
-
135
+ checks.push(`🔐 Authentication Status: ${isAuthenticated ? '✅ Authenticated' : '❌ Not authenticated'}`);
136
+
137
+ if (isAuthenticated) {
152
138
  // Check 3: Token Validation
153
139
  try {
154
140
  const isValid = await oxyServices.validate();
@@ -161,8 +147,6 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
161
147
  checks.push('❌ Token validation failed');
162
148
  checks.push(` Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
163
149
  }
164
- } else {
165
- checks.push('⚠️ User is not authenticated');
166
150
  }
167
151
 
168
152
  // Check 4: Session Validation (if user has active sessions)
@@ -187,7 +171,7 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
187
171
  // Check 6: Package Information
188
172
  checks.push('🔍 Checking package information...');
189
173
  checks.push(`✅ Package: ${packageInfo.name}@${packageInfo.version}`);
190
-
174
+
191
175
  // Check 7: Memory and Performance (basic)
192
176
  checks.push('🔍 Checking performance metrics...');
193
177
  const memoryUsage = (performance as any).memory;
@@ -202,7 +186,7 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
202
186
  // Final summary
203
187
  const errorCount = checks.filter(check => check.includes('❌')).length;
204
188
  const warningCount = checks.filter(check => check.includes('⚠️')).length;
205
-
189
+
206
190
  checks.push('');
207
191
  checks.push('📋 SYSTEM CHECK SUMMARY:');
208
192
  if (errorCount === 0 && warningCount === 0) {
@@ -266,9 +250,9 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
266
250
  copyToClipboard(report, 'Full application report');
267
251
  };
268
252
 
269
- const InfoRow: React.FC<{
270
- label: string;
271
- value: string;
253
+ const InfoRow: React.FC<{
254
+ label: string;
255
+ value: string;
272
256
  copyable?: boolean;
273
257
  icon?: string;
274
258
  iconComponent?: React.ReactNode;
@@ -277,9 +261,9 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
277
261
  isLast?: boolean;
278
262
  onPress?: () => void;
279
263
  showChevron?: boolean;
280
- }> = ({
281
- label,
282
- value,
264
+ }> = ({
265
+ label,
266
+ value,
283
267
  copyable = false,
284
268
  icon = 'information-circle',
285
269
  iconComponent,
@@ -289,47 +273,47 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
289
273
  onPress,
290
274
  showChevron = false,
291
275
  }) => {
292
- const handlePress = () => {
293
- if (onPress) {
294
- onPress();
295
- } else if (copyable) {
296
- copyToClipboard(value, label);
297
- }
298
- };
299
-
300
- const isInteractive = copyable || !!onPress;
301
-
302
- return (
303
- <TouchableOpacity
304
- style={[
305
- styles.settingItem,
306
- isFirst && styles.firstSettingItem,
307
- isLast && styles.lastSettingItem,
308
- ]}
309
- onPress={isInteractive ? handlePress : undefined}
310
- disabled={!isInteractive}
311
- >
312
- <View style={styles.settingInfo}>
313
- {iconComponent ? (
314
- React.cloneElement(iconComponent as React.ReactElement, { style: styles.settingIcon })
315
- ) : (
316
- <OxyIcon name={icon} size={20} color={color} style={styles.settingIcon} />
317
- )}
318
- <View style={styles.settingDetails}>
319
- <Text style={styles.settingLabel}>{label}</Text>
320
- <Text style={[
321
- styles.settingValue,
322
- (copyable || onPress) && { color: primaryColor }
323
- ]}>
324
- {value}
325
- </Text>
276
+ const handlePress = () => {
277
+ if (onPress) {
278
+ onPress();
279
+ } else if (copyable) {
280
+ copyToClipboard(value, label);
281
+ }
282
+ };
283
+
284
+ const isInteractive = copyable || !!onPress;
285
+
286
+ return (
287
+ <TouchableOpacity
288
+ style={[
289
+ styles.settingItem,
290
+ isFirst && styles.firstSettingItem,
291
+ isLast && styles.lastSettingItem,
292
+ ]}
293
+ onPress={isInteractive ? handlePress : undefined}
294
+ disabled={!isInteractive}
295
+ >
296
+ <View style={styles.settingInfo}>
297
+ {iconComponent ? (
298
+ React.cloneElement(iconComponent as React.ReactElement, { style: styles.settingIcon })
299
+ ) : (
300
+ <OxyIcon name={icon} size={20} color={color} style={styles.settingIcon} />
301
+ )}
302
+ <View style={styles.settingDetails}>
303
+ <Text style={styles.settingLabel}>{label}</Text>
304
+ <Text style={[
305
+ styles.settingValue,
306
+ (copyable || onPress) && { color: primaryColor }
307
+ ]}>
308
+ {value}
309
+ </Text>
310
+ </View>
326
311
  </View>
327
- </View>
328
- {copyable && <OxyIcon name="copy" size={16} color="#ccc" />}
329
- {showChevron && <OxyIcon name="chevron-forward" size={16} color="#ccc" />}
330
- </TouchableOpacity>
331
- );
332
- };
312
+ {copyable && <OxyIcon name="copy" size={16} color="#ccc" />}
313
+ {showChevron && <OxyIcon name="chevron-forward" size={16} color="#ccc" />}
314
+ </TouchableOpacity>
315
+ );
316
+ };
333
317
 
334
318
  return (
335
319
  <View style={[styles.container, { backgroundColor }]}>
@@ -346,43 +330,43 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
346
330
  {/* Package Information */}
347
331
  <View style={styles.section}>
348
332
  <Text style={styles.sectionTitle}>Package Information</Text>
349
-
350
- <InfoRow
351
- label="Name"
352
- value={packageInfo.name}
353
- copyable
333
+
334
+ <InfoRow
335
+ label="Name"
336
+ value={packageInfo.name}
337
+ copyable
354
338
  iconComponent={<OxyServicesLogo width={20} height={20} />}
355
339
  color="#007AFF"
356
340
  isFirst
357
341
  />
358
- <InfoRow
359
- label="Version"
360
- value={packageInfo.version}
361
- copyable
342
+ <InfoRow
343
+ label="Version"
344
+ value={packageInfo.version}
345
+ copyable
362
346
  icon="pricetag"
363
347
  color="#5856D6"
364
348
  />
365
- <InfoRow
366
- label="Description"
367
- value={packageInfo.description || 'No description'}
349
+ <InfoRow
350
+ label="Description"
351
+ value={packageInfo.description || 'No description'}
368
352
  icon="document-text"
369
353
  color="#34C759"
370
354
  />
371
- <InfoRow
372
- label="Main Entry"
373
- value={packageInfo.main || 'N/A'}
355
+ <InfoRow
356
+ label="Main Entry"
357
+ value={packageInfo.main || 'N/A'}
374
358
  icon="code"
375
359
  color="#FF9500"
376
360
  />
377
- <InfoRow
378
- label="Module Entry"
379
- value={packageInfo.module || 'N/A'}
361
+ <InfoRow
362
+ label="Module Entry"
363
+ value={packageInfo.module || 'N/A'}
380
364
  icon="library"
381
365
  color="#FF3B30"
382
366
  />
383
- <InfoRow
384
- label="Types Entry"
385
- value={packageInfo.types || 'N/A'}
367
+ <InfoRow
368
+ label="Types Entry"
369
+ value={packageInfo.types || 'N/A'}
386
370
  icon="construct"
387
371
  color="#32D74B"
388
372
  isLast
@@ -392,35 +376,35 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
392
376
  {/* System Information */}
393
377
  <View style={styles.section}>
394
378
  <Text style={styles.sectionTitle}>System Information</Text>
395
-
396
- <InfoRow
397
- label="Platform"
398
- value={Platform.OS}
379
+
380
+ <InfoRow
381
+ label="Platform"
382
+ value={Platform.OS}
399
383
  icon="phone-portrait"
400
384
  color="#007AFF"
401
385
  isFirst
402
386
  />
403
- <InfoRow
404
- label="Platform Version"
405
- value={systemInfo?.version || 'Loading...'}
387
+ <InfoRow
388
+ label="Platform Version"
389
+ value={systemInfo?.version || 'Loading...'}
406
390
  icon="hardware-chip"
407
391
  color="#5856D6"
408
392
  />
409
- <InfoRow
410
- label="Screen Width"
411
- value={`${systemInfo?.screenDimensions.width || 0}px`}
393
+ <InfoRow
394
+ label="Screen Width"
395
+ value={`${systemInfo?.screenDimensions.width || 0}px`}
412
396
  icon="resize"
413
397
  color="#FF9500"
414
398
  />
415
- <InfoRow
416
- label="Screen Height"
417
- value={`${systemInfo?.screenDimensions.height || 0}px`}
399
+ <InfoRow
400
+ label="Screen Height"
401
+ value={`${systemInfo?.screenDimensions.height || 0}px`}
418
402
  icon="resize"
419
403
  color="#FF3B30"
420
404
  />
421
- <InfoRow
422
- label="Environment"
423
- value={__DEV__ ? 'Development' : 'Production'}
405
+ <InfoRow
406
+ label="Environment"
407
+ value={__DEV__ ? 'Development' : 'Production'}
424
408
  icon="settings"
425
409
  color="#34C759"
426
410
  isLast
@@ -430,26 +414,26 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
430
414
  {/* User Information */}
431
415
  <View style={styles.section}>
432
416
  <Text style={styles.sectionTitle}>User Information</Text>
433
-
434
- <InfoRow
435
- label="Authentication Status"
436
- value={user ? 'Authenticated' : 'Not Authenticated'}
417
+
418
+ <InfoRow
419
+ label="Authentication Status"
420
+ value={isAuthenticated ? 'Authenticated' : 'Not Authenticated'}
437
421
  icon="shield-checkmark"
438
- color={user ? '#34C759' : '#FF3B30'}
422
+ color={isAuthenticated ? '#34C759' : '#FF3B30'}
439
423
  isFirst
440
424
  />
441
425
  {user && (
442
426
  <>
443
- <InfoRow
444
- label="User ID"
445
- value={user.id}
446
- copyable
427
+ <InfoRow
428
+ label="User ID"
429
+ value={user.id}
430
+ copyable
447
431
  icon="person"
448
432
  color="#007AFF"
449
433
  />
450
- <InfoRow
451
- label="Username"
452
- value={user.username || 'N/A'}
434
+ <InfoRow
435
+ label="Username"
436
+ value={user.username || 'N/A'}
453
437
  icon="at"
454
438
  color="#5856D6"
455
439
  onPress={() => {
@@ -461,23 +445,23 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
461
445
  }}
462
446
  showChevron={true}
463
447
  />
464
- <InfoRow
465
- label="Email"
466
- value={user.email || 'N/A'}
448
+ <InfoRow
449
+ label="Email"
450
+ value={user.email || 'N/A'}
467
451
  icon="mail"
468
452
  color="#FF9500"
469
453
  />
470
- <InfoRow
471
- label="Premium Status"
472
- value={user.isPremium ? 'Premium' : 'Standard'}
454
+ <InfoRow
455
+ label="Premium Status"
456
+ value={user.isPremium ? 'Premium' : 'Standard'}
473
457
  icon="star"
474
458
  color={user.isPremium ? '#FFD700' : '#8E8E93'}
475
459
  />
476
460
  </>
477
461
  )}
478
- <InfoRow
479
- label="Total Active Sessions"
480
- value={sessions?.length?.toString() || '0'}
462
+ <InfoRow
463
+ label="Total Active Sessions"
464
+ value={sessions?.length?.toString() || '0'}
481
465
  icon="people"
482
466
  color="#32D74B"
483
467
  isLast
@@ -487,49 +471,46 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
487
471
  {/* API Configuration */}
488
472
  <View style={styles.section}>
489
473
  <Text style={styles.sectionTitle}>API Configuration</Text>
490
-
491
- <InfoRow
492
- label="API Base URL"
493
- value={oxyServices?.getBaseURL() || 'Not configured'}
494
- copyable
474
+
475
+ <InfoRow
476
+ label="API Base URL"
477
+ value={oxyServices?.getBaseURL() || 'Not configured'}
478
+ copyable
495
479
  icon="server"
496
480
  color="#007AFF"
497
481
  isFirst
498
482
  />
499
- <InfoRow
500
- label="Connection Status"
483
+ <InfoRow
484
+ label="Connection Status"
501
485
  value={
502
486
  connectionStatus === 'checking' ? 'Checking...' :
503
- connectionStatus === 'connected' ? 'Connected' :
504
- connectionStatus === 'disconnected' ? 'Disconnected' :
505
- 'Unknown'
487
+ connectionStatus === 'connected' ? 'Connected' :
488
+ connectionStatus === 'disconnected' ? 'Disconnected' :
489
+ 'Unknown'
506
490
  }
507
491
  icon={
508
492
  connectionStatus === 'checking' ? 'sync' :
509
- connectionStatus === 'connected' ? 'wifi' :
510
- 'wifi-off'
493
+ connectionStatus === 'connected' ? 'wifi' :
494
+ 'wifi-off'
511
495
  }
512
496
  color={
513
497
  connectionStatus === 'checking' ? '#FF9500' :
514
- connectionStatus === 'connected' ? '#34C759' :
515
- '#FF3B30'
498
+ connectionStatus === 'connected' ? '#34C759' :
499
+ '#FF3B30'
516
500
  }
517
501
  onPress={async () => {
518
502
  setConnectionStatus('checking');
519
- const apiBaseUrl = oxyServices?.getBaseURL() || 'https://api.oxy.so';
503
+
504
+ if (!oxyServices) {
505
+ setConnectionStatus('disconnected');
506
+ toast.error('OxyServices not initialized');
507
+ return;
508
+ }
509
+
520
510
  try {
521
- const response = await fetch(`${apiBaseUrl}/`, {
522
- method: 'GET',
523
- timeout: 3000,
524
- } as any);
525
-
526
- if (response.ok) {
527
- setConnectionStatus('connected');
528
- toast.success('API connection successful');
529
- } else {
530
- setConnectionStatus('disconnected');
531
- toast.error(`API server error: ${response.status}`);
532
- }
511
+ await oxyServices.healthCheck();
512
+ setConnectionStatus('connected');
513
+ toast.success('API connection successful');
533
514
  } catch (error) {
534
515
  setConnectionStatus('disconnected');
535
516
  toast.error('Failed to connect to API server');
@@ -543,24 +524,24 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
543
524
  {/* Build Information */}
544
525
  <View style={styles.section}>
545
526
  <Text style={styles.sectionTitle}>Build Information</Text>
546
-
547
- <InfoRow
548
- label="Build Timestamp"
549
- value={systemInfo?.timestamp || 'Loading...'}
550
- copyable
527
+
528
+ <InfoRow
529
+ label="Build Timestamp"
530
+ value={systemInfo?.timestamp || 'Loading...'}
531
+ copyable
551
532
  icon="time"
552
533
  color="#007AFF"
553
534
  isFirst
554
535
  />
555
- <InfoRow
556
- label="React Native"
557
- value="Expo/React Native"
536
+ <InfoRow
537
+ label="React Native"
538
+ value="Expo/React Native"
558
539
  icon="logo-react"
559
540
  color="#61DAFB"
560
541
  />
561
- <InfoRow
562
- label="JavaScript Engine"
563
- value="Hermes"
542
+ <InfoRow
543
+ label="JavaScript Engine"
544
+ value="Hermes"
564
545
  icon="flash"
565
546
  color="#FF3B30"
566
547
  isLast
@@ -570,8 +551,8 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
570
551
  {/* Quick Actions */}
571
552
  <View style={styles.section}>
572
553
  <Text style={styles.sectionTitle}>Quick Actions</Text>
573
-
574
- <TouchableOpacity
554
+
555
+ <TouchableOpacity
575
556
  style={[styles.settingItem, styles.firstSettingItem]}
576
557
  onPress={handleCopyFullReport}
577
558
  >
@@ -586,10 +567,10 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
586
567
  </View>
587
568
  <OxyIcon name="chevron-forward" size={16} color="#ccc" />
588
569
  </TouchableOpacity>
589
-
590
- <TouchableOpacity
570
+
571
+ <TouchableOpacity
591
572
  style={[
592
- styles.settingItem,
573
+ styles.settingItem,
593
574
  styles.lastSettingItem,
594
575
  isRunningSystemCheck && styles.disabledSettingItem
595
576
  ]}
@@ -597,22 +578,22 @@ const AppInfoScreen: React.FC<BaseScreenProps> = ({
597
578
  disabled={isRunningSystemCheck}
598
579
  >
599
580
  <View style={styles.settingInfo}>
600
- <OxyIcon
601
- name={isRunningSystemCheck ? "sync" : "checkmark-circle"}
602
- size={20}
603
- color={isRunningSystemCheck ? "#FF9500" : "#34C759"}
581
+ <OxyIcon
582
+ name={isRunningSystemCheck ? "sync" : "checkmark-circle"}
583
+ size={20}
584
+ color={isRunningSystemCheck ? "#FF9500" : "#34C759"}
604
585
  style={[
605
586
  styles.settingIcon,
606
587
  isRunningSystemCheck && styles.spinningIcon
607
- ]}
588
+ ]}
608
589
  />
609
590
  <View style={styles.settingDetails}>
610
591
  <Text style={styles.settingLabel}>
611
592
  {isRunningSystemCheck ? 'Running System Check...' : 'Run System Check'}
612
593
  </Text>
613
594
  <Text style={styles.settingDescription}>
614
- {isRunningSystemCheck
615
- ? 'Checking API, authentication, and platform status...'
595
+ {isRunningSystemCheck
596
+ ? 'Checking API, authentication, and platform status...'
616
597
  : 'Verify application health and status'
617
598
  }
618
599
  </Text>