react-native-inapp-inspector 2.0.7 → 2.2.0

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 (85) hide show
  1. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +0 -11
  2. package/dist/commonjs/components/Inspector/InspectorHeader.js +25 -28
  3. package/dist/commonjs/components/Inspector/MainScreen.js +2 -19
  4. package/dist/commonjs/components/Inspector/NetworkDetail.js +0 -15
  5. package/dist/commonjs/components/Inspector/PerformanceTab.js +18 -30
  6. package/dist/commonjs/components/Inspector/SettingsPanel.js +49 -448
  7. package/dist/commonjs/components/Inspector/TabBar.js +2 -23
  8. package/dist/commonjs/components/NetworkIcons.d.ts +0 -12
  9. package/dist/commonjs/components/NetworkIcons.js +3 -72
  10. package/dist/commonjs/constants/version.d.ts +1 -1
  11. package/dist/commonjs/constants/version.js +1 -1
  12. package/dist/commonjs/helpers/index.d.ts +0 -2
  13. package/dist/commonjs/helpers/index.js +1 -12
  14. package/dist/commonjs/helpers/settingsStore.d.ts +1 -1
  15. package/dist/commonjs/helpers/settingsStore.js +2 -4
  16. package/dist/commonjs/i18n/locales/en.json +2 -3
  17. package/dist/commonjs/index.d.ts +0 -1
  18. package/dist/commonjs/index.js +9 -127
  19. package/dist/commonjs/native/NativeInspector.d.ts +0 -1
  20. package/dist/commonjs/types/enums.d.ts +0 -7
  21. package/dist/commonjs/types/enums.js +0 -7
  22. package/dist/commonjs/types/interfaces.d.ts +0 -77
  23. package/dist/esm/components/Inspector/InspectorHeader.js +25 -28
  24. package/dist/esm/components/Inspector/MainScreen.js +2 -19
  25. package/dist/esm/components/Inspector/NetworkDetail.js +1 -16
  26. package/dist/esm/components/Inspector/PerformanceTab.js +19 -31
  27. package/dist/esm/components/Inspector/SettingsPanel.js +50 -449
  28. package/dist/esm/components/Inspector/TabBar.js +3 -24
  29. package/dist/esm/components/NetworkIcons.d.ts +0 -12
  30. package/dist/esm/components/NetworkIcons.js +0 -57
  31. package/dist/esm/constants/version.d.ts +1 -1
  32. package/dist/esm/constants/version.js +1 -1
  33. package/dist/esm/helpers/index.d.ts +0 -2
  34. package/dist/esm/helpers/index.js +0 -10
  35. package/dist/esm/helpers/settingsStore.d.ts +1 -1
  36. package/dist/esm/helpers/settingsStore.js +2 -4
  37. package/dist/esm/i18n/locales/en.json +2 -3
  38. package/dist/esm/index.d.ts +0 -1
  39. package/dist/esm/index.js +8 -123
  40. package/dist/esm/native/NativeInspector.d.ts +0 -1
  41. package/dist/esm/types/enums.d.ts +0 -7
  42. package/dist/esm/types/enums.js +0 -7
  43. package/dist/esm/types/interfaces.d.ts +0 -77
  44. package/ios/NetworkInspectorModule.mm +5 -12
  45. package/package.json +1 -4
  46. package/dist/commonjs/components/Inspector/AuditTab.d.ts +0 -3
  47. package/dist/commonjs/components/Inspector/AuditTab.js +0 -741
  48. package/dist/commonjs/components/Inspector/DeviceTab.d.ts +0 -3
  49. package/dist/commonjs/components/Inspector/DeviceTab.js +0 -717
  50. package/dist/commonjs/components/Inspector/FirstTimeWalkthroughModal.d.ts +0 -7
  51. package/dist/commonjs/components/Inspector/FirstTimeWalkthroughModal.js +0 -600
  52. package/dist/commonjs/components/Inspector/PerformanceHud.d.ts +0 -7
  53. package/dist/commonjs/components/Inspector/PerformanceHud.js +0 -210
  54. package/dist/commonjs/components/Inspector/RequestReplayModal.d.ts +0 -9
  55. package/dist/commonjs/components/Inspector/RequestReplayModal.js +0 -792
  56. package/dist/commonjs/components/Inspector/RequestReplayView.d.ts +0 -8
  57. package/dist/commonjs/components/Inspector/RequestReplayView.js +0 -871
  58. package/dist/commonjs/components/Inspector/StorageTab.d.ts +0 -3
  59. package/dist/commonjs/components/Inspector/StorageTab.js +0 -610
  60. package/dist/commonjs/customHooks/storageInspector.d.ts +0 -13
  61. package/dist/commonjs/customHooks/storageInspector.js +0 -179
  62. package/dist/commonjs/helpers/deviceInfo.d.ts +0 -4
  63. package/dist/commonjs/helpers/deviceInfo.js +0 -94
  64. package/dist/commonjs/helpers/packageAuditor.d.ts +0 -5
  65. package/dist/commonjs/helpers/packageAuditor.js +0 -182
  66. package/dist/esm/components/Inspector/AuditTab.d.ts +0 -3
  67. package/dist/esm/components/Inspector/AuditTab.js +0 -702
  68. package/dist/esm/components/Inspector/DeviceTab.d.ts +0 -3
  69. package/dist/esm/components/Inspector/DeviceTab.js +0 -678
  70. package/dist/esm/components/Inspector/FirstTimeWalkthroughModal.d.ts +0 -7
  71. package/dist/esm/components/Inspector/FirstTimeWalkthroughModal.js +0 -560
  72. package/dist/esm/components/Inspector/PerformanceHud.d.ts +0 -7
  73. package/dist/esm/components/Inspector/PerformanceHud.js +0 -170
  74. package/dist/esm/components/Inspector/RequestReplayModal.d.ts +0 -9
  75. package/dist/esm/components/Inspector/RequestReplayModal.js +0 -752
  76. package/dist/esm/components/Inspector/RequestReplayView.d.ts +0 -8
  77. package/dist/esm/components/Inspector/RequestReplayView.js +0 -831
  78. package/dist/esm/components/Inspector/StorageTab.d.ts +0 -3
  79. package/dist/esm/components/Inspector/StorageTab.js +0 -571
  80. package/dist/esm/customHooks/storageInspector.d.ts +0 -13
  81. package/dist/esm/customHooks/storageInspector.js +0 -170
  82. package/dist/esm/helpers/deviceInfo.d.ts +0 -4
  83. package/dist/esm/helpers/deviceInfo.js +0 -89
  84. package/dist/esm/helpers/packageAuditor.d.ts +0 -5
  85. package/dist/esm/helpers/packageAuditor.js +0 -173
@@ -1,179 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setCustomStorageAdapter = setCustomStorageAdapter;
4
- exports.subscribeStorageChanges = subscribeStorageChanges;
5
- exports.notifyStorageChange = notifyStorageChange;
6
- exports.fetchAllStorageEntries = fetchAllStorageEntries;
7
- exports.setStorageItem = setStorageItem;
8
- exports.removeStorageItem = removeStorageItem;
9
- exports.clearAllStorage = clearAllStorage;
10
- let customStorageAdapter = null;
11
- // Dynamic check for AsyncStorage
12
- function getAsyncStorage() {
13
- if (customStorageAdapter)
14
- return customStorageAdapter;
15
- try {
16
- // Attempt to require @react-native-async-storage/async-storage
17
- const mod = require('@react-native-async-storage/async-storage');
18
- return mod.default || mod;
19
- }
20
- catch {
21
- // Fallback: check global AsyncStorage or in-memory map
22
- if (typeof global.AsyncStorage !== 'undefined') {
23
- return global.AsyncStorage;
24
- }
25
- }
26
- return null;
27
- }
28
- // In-memory fallback if AsyncStorage is not installed
29
- const inMemoryStore = new Map([
30
- [
31
- '@app_session_token',
32
- 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTYiLCJuYW1lIjoiRGV2IFVzZXIiLCJyb2xlIjoiYWRtaW4ifQ',
33
- ],
34
- ['@user_theme_preference', 'dark'],
35
- [
36
- '@user_profile',
37
- JSON.stringify({
38
- id: 'usr_8829',
39
- username: 'dev_tester',
40
- email: 'dev@example.com',
41
- notificationsEnabled: true,
42
- roles: ['admin', 'beta_tester'],
43
- }),
44
- ],
45
- ['@app_launch_count', '14'],
46
- ['@has_completed_onboarding', 'true'],
47
- ]);
48
- const storageListeners = new Set();
49
- function setCustomStorageAdapter(adapter) {
50
- customStorageAdapter = adapter;
51
- notifyStorageChange();
52
- }
53
- function subscribeStorageChanges(listener) {
54
- storageListeners.add(listener);
55
- return () => {
56
- storageListeners.delete(listener);
57
- };
58
- }
59
- function notifyStorageChange() {
60
- storageListeners.forEach(fn => {
61
- try {
62
- fn();
63
- }
64
- catch { }
65
- });
66
- }
67
- /**
68
- * Reads all entries from on-device storage (AsyncStorage or fallback store).
69
- */
70
- async function fetchAllStorageEntries() {
71
- const storage = getAsyncStorage();
72
- const entries = [];
73
- try {
74
- if (storage && typeof storage.getAllKeys === 'function') {
75
- const keys = await storage.getAllKeys();
76
- if (keys && keys.length > 0) {
77
- const keyValPairs = await storage.multiGet(keys);
78
- for (const [key, val] of keyValPairs) {
79
- const rawVal = val ?? '';
80
- let isJson = false;
81
- let parsedJson = undefined;
82
- try {
83
- if ((rawVal.startsWith('{') && rawVal.endsWith('}')) ||
84
- (rawVal.startsWith('[') && rawVal.endsWith(']'))) {
85
- parsedJson = JSON.parse(rawVal);
86
- isJson = true;
87
- }
88
- }
89
- catch { }
90
- entries.push({
91
- key,
92
- value: rawVal,
93
- sizeBytes: new Blob([rawVal]).size || rawVal.length,
94
- isJson,
95
- parsedJson,
96
- updatedAt: Date.now(),
97
- });
98
- }
99
- }
100
- }
101
- else {
102
- // In-memory fallback
103
- for (const [key, rawVal] of inMemoryStore.entries()) {
104
- let isJson = false;
105
- let parsedJson = undefined;
106
- try {
107
- if ((rawVal.startsWith('{') && rawVal.endsWith('}')) ||
108
- (rawVal.startsWith('[') && rawVal.endsWith(']'))) {
109
- parsedJson = JSON.parse(rawVal);
110
- isJson = true;
111
- }
112
- }
113
- catch { }
114
- entries.push({
115
- key,
116
- value: rawVal,
117
- sizeBytes: rawVal.length,
118
- isJson,
119
- parsedJson,
120
- updatedAt: Date.now(),
121
- });
122
- }
123
- }
124
- }
125
- catch (err) {
126
- console.warn('[Inspector Storage] Failed to read entries:', err);
127
- }
128
- // Sort keys alphabetically
129
- entries.sort((a, b) => a.key.localeCompare(b.key));
130
- return entries;
131
- }
132
- async function setStorageItem(key, value) {
133
- const storage = getAsyncStorage();
134
- try {
135
- if (storage && typeof storage.setItem === 'function') {
136
- await storage.setItem(key, value);
137
- }
138
- else {
139
- inMemoryStore.set(key, value);
140
- }
141
- notifyStorageChange();
142
- }
143
- catch (err) {
144
- console.warn(`[Inspector Storage] Failed to set key "${key}":`, err);
145
- throw err;
146
- }
147
- }
148
- async function removeStorageItem(key) {
149
- const storage = getAsyncStorage();
150
- try {
151
- if (storage && typeof storage.removeItem === 'function') {
152
- await storage.removeItem(key);
153
- }
154
- else {
155
- inMemoryStore.delete(key);
156
- }
157
- notifyStorageChange();
158
- }
159
- catch (err) {
160
- console.warn(`[Inspector Storage] Failed to remove key "${key}":`, err);
161
- throw err;
162
- }
163
- }
164
- async function clearAllStorage() {
165
- const storage = getAsyncStorage();
166
- try {
167
- if (storage && typeof storage.clear === 'function') {
168
- await storage.clear();
169
- }
170
- else {
171
- inMemoryStore.clear();
172
- }
173
- notifyStorageChange();
174
- }
175
- catch (err) {
176
- console.warn('[Inspector Storage] Failed to clear storage:', err);
177
- throw err;
178
- }
179
- }
@@ -1,4 +0,0 @@
1
- import { DeviceInfoData } from '../types';
2
- export declare function getFallbackDeviceId(): string;
3
- export declare function setResolvedDeviceId(id: string): void;
4
- export declare function getSystemDiagnostics(): DeviceInfoData;
@@ -1,94 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFallbackDeviceId = getFallbackDeviceId;
4
- exports.setResolvedDeviceId = setResolvedDeviceId;
5
- exports.getSystemDiagnostics = getSystemDiagnostics;
6
- const react_native_1 = require("react-native");
7
- const index_1 = require("./index");
8
- let cachedDeviceId = null;
9
- function getFallbackDeviceId() {
10
- if (cachedDeviceId)
11
- return cachedDeviceId;
12
- const raw = `${react_native_1.Platform.OS}-${react_native_1.Platform.Version}-${react_native_1.PixelRatio.get()}-${react_native_1.Dimensions.get('screen').width}x${react_native_1.Dimensions.get('screen').height}`;
13
- // Generate deterministic UUID-like string
14
- let hash = 0;
15
- for (let i = 0; i < raw.length; i++) {
16
- hash = ((hash << 5) - hash) + raw.charCodeAt(i);
17
- hash |= 0;
18
- }
19
- const hex = Math.abs(hash).toString(16).padStart(8, '0');
20
- cachedDeviceId = react_native_1.Platform.OS === 'ios'
21
- ? `SIM-IOS-${hex.toUpperCase()}`
22
- : `SIM-AND-${hex.toUpperCase()}`;
23
- return cachedDeviceId;
24
- }
25
- function setResolvedDeviceId(id) {
26
- if (id)
27
- cachedDeviceId = id;
28
- }
29
- function getSystemDiagnostics() {
30
- const window = react_native_1.Dimensions.get('window');
31
- const screen = react_native_1.Dimensions.get('screen');
32
- // Detect JavaScript Engine
33
- const isHermes = Boolean(global.HermesInternal);
34
- let jsEngine = isHermes ? 'Hermes' : 'JavaScriptCore (JSC)';
35
- if (global._v8runtime) {
36
- jsEngine = 'V8';
37
- }
38
- // Detect New Architecture (Fabric & TurboModules)
39
- const isFabric = Boolean(global.nativeFabricUIManager ||
40
- react_native_1.Platform.constants?.reactNativeVersion?.major >= 1);
41
- const isTurboModule = Boolean(global.__turboModuleProxy != null);
42
- // React Native Version
43
- const rnVer = react_native_1.Platform.constants?.reactNativeVersion;
44
- const reactNativeVersion = rnVer
45
- ? `${rnVer.major}.${rnVer.minor}.${rnVer.patch}${rnVer.prerelease ? `-${rnVer.prerelease}` : ''}`
46
- : '0.78.0';
47
- // Device Model & OS info
48
- let deviceModel = 'iPhone Simulator';
49
- if (react_native_1.Platform.OS === 'android') {
50
- deviceModel = react_native_1.Platform.constants?.Model || 'Android Device';
51
- }
52
- else if (react_native_1.Platform.OS === 'ios') {
53
- deviceModel =
54
- react_native_1.Platform.constants?.systemName ||
55
- (react_native_1.Platform.isPad ? 'iPad' : 'iPhone');
56
- }
57
- const isDevice = !react_native_1.Platform.constants?.isTesting;
58
- // Timezone & Locale
59
- let locale = 'en_US';
60
- let timeZone = 'UTC';
61
- try {
62
- timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC';
63
- locale = Intl.DateTimeFormat().resolvedOptions().locale || 'en_US';
64
- }
65
- catch { }
66
- const statusBarHeight = react_native_1.Platform.OS === 'android' ? react_native_1.StatusBar.currentHeight || 24 : 44;
67
- return {
68
- appName: (0, index_1.getAppName)(),
69
- bundleId: (0, index_1.getBundleIdentifier)(),
70
- appVersion: '1.0.0',
71
- buildNumber: '1',
72
- reactNativeVersion,
73
- jsEngine,
74
- isHermes,
75
- isFabric,
76
- isTurboModule,
77
- platform: react_native_1.Platform.OS,
78
- osVersion: String(react_native_1.Platform.Version),
79
- deviceModel,
80
- deviceId: cachedDeviceId || getFallbackDeviceId(),
81
- isDevice,
82
- screenWidth: Math.round(screen.width),
83
- screenHeight: Math.round(screen.height),
84
- screenScale: react_native_1.PixelRatio.get(),
85
- screenFontScale: react_native_1.PixelRatio.getFontScale(),
86
- statusBarHeight,
87
- memoryMb: performance?.memory?.jsHeapSizeLimit
88
- ? Math.round(performance.memory.jsHeapSizeLimit / (1024 * 1024))
89
- : undefined,
90
- arch: react_native_1.Platform.constants?.arch || 'arm64',
91
- locale,
92
- timeZone,
93
- };
94
- }
@@ -1,5 +0,0 @@
1
- import { AuditIssue, PackageHealthReport } from '../types';
2
- export declare function subscribeAuditChanges(listener: (report: PackageHealthReport) => void): () => void;
3
- export declare function logCodeQualityIssue(issue: Omit<AuditIssue, 'id' | 'timestamp'>): void;
4
- export declare function clearCustomAuditIssues(): void;
5
- export declare function runLivePackageAudit(): PackageHealthReport;
@@ -1,182 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.subscribeAuditChanges = subscribeAuditChanges;
7
- exports.logCodeQualityIssue = logCodeQualityIssue;
8
- exports.clearCustomAuditIssues = clearCustomAuditIssues;
9
- exports.runLivePackageAudit = runLivePackageAudit;
10
- const react_1 = __importDefault(require("react"));
11
- const react_native_1 = require("react-native");
12
- let customIssues = [];
13
- let listeners = [];
14
- function notifyListeners(report) {
15
- listeners.forEach(fn => fn(report));
16
- }
17
- function subscribeAuditChanges(listener) {
18
- listeners.push(listener);
19
- return () => {
20
- listeners = listeners.filter(l => l !== listener);
21
- };
22
- }
23
- function logCodeQualityIssue(issue) {
24
- const newIssue = {
25
- id: `audit_${Date.now()}_${Math.random().toString(36).substr(2, 6)}`,
26
- timestamp: Date.now(),
27
- ...issue,
28
- };
29
- customIssues.unshift(newIssue);
30
- if (customIssues.length > 50) {
31
- customIssues.pop();
32
- }
33
- notifyListeners(runLivePackageAudit());
34
- }
35
- function clearCustomAuditIssues() {
36
- customIssues = [];
37
- notifyListeners(runLivePackageAudit());
38
- }
39
- function runLivePackageAudit() {
40
- const issues = [...customIssues];
41
- const rnVer = react_native_1.Platform.constants?.reactNativeVersion;
42
- const rnVerString = rnVer ? `${rnVer.major}.${rnVer.minor}.${rnVer.patch}` : '0.78.0';
43
- const isHermes = Boolean(global.HermesInternal);
44
- const isFabric = Boolean(global.nativeFabricUIManager ||
45
- react_native_1.Platform.constants?.reactNativeVersion?.major >= 1);
46
- const reactVer = react_1.default?.version || '19.2.3';
47
- // ═══════════════════════════════════════════════════════════════════════════════
48
- // 1. PACKAGES & PEERS AUDIT
49
- // ═══════════════════════════════════════════════════════════════════════════════
50
- // Check React 19 / 18 Peer Alignment
51
- issues.push({
52
- id: 'audit_react_peer_alignment',
53
- title: 'React & React Native Core Alignment',
54
- message: `React v${reactVer} and React Native v${rnVerString} are aligned with active core dependencies.`,
55
- severity: 'optimal',
56
- category: 'peer',
57
- packageName: 'react',
58
- currentVersion: reactVer,
59
- requiredVersion: '>=18.2.0',
60
- timestamp: Date.now(),
61
- });
62
- // Check Duplicate or Deprecated Package Signatures
63
- issues.push({
64
- id: 'audit_no_deprecated_packages',
65
- title: 'Deprecated Community Packages Scan',
66
- message: 'No legacy packages detected (e.g. deprecated @react-native-community/async-storage or legacy art/push-notification modules).',
67
- severity: 'optimal',
68
- category: 'dependency',
69
- packageName: 'react-native-ecosystem',
70
- timestamp: Date.now(),
71
- });
72
- // ═══════════════════════════════════════════════════════════════════════════════
73
- // 2. RUNTIME & TYPESCRIPT AUDIT
74
- // ═══════════════════════════════════════════════════════════════════════════════
75
- // TypeScript Strictness & Type Safety
76
- issues.push({
77
- id: 'audit_ts_strict_check',
78
- title: 'TypeScript Typecheck & Schema Validation',
79
- message: 'All source types, interfaces, and component prop definitions passed TypeScript validation with 0 emit errors.',
80
- severity: 'optimal',
81
- category: 'typescript',
82
- packageName: 'typescript',
83
- fixCommand: 'npm run typecheck',
84
- timestamp: Date.now(),
85
- });
86
- // Global Exception & Unhandled Promise Listener Status
87
- issues.push({
88
- id: 'audit_unhandled_promise_guard',
89
- title: 'Global Exception & Promise Rejection Guard',
90
- message: 'Active crash protection error boundary is guarding against unhandled async Promise rejections and fatal JS crashes.',
91
- severity: 'optimal',
92
- category: 'typescript',
93
- timestamp: Date.now(),
94
- });
95
- // ═══════════════════════════════════════════════════════════════════════════════
96
- // 3. BEST PRACTICES & PERFORMANCE AUDIT
97
- // ═══════════════════════════════════════════════════════════════════════════════
98
- if (isHermes) {
99
- issues.push({
100
- id: 'audit_hermes_status',
101
- title: 'Hermes Bytecode AOT Engine Active',
102
- message: 'Hermes ahead-of-time bytecode compilation and garbage collector are optimized for instant TTIR and reduced RAM overhead.',
103
- severity: 'optimal',
104
- category: 'performance',
105
- packageName: 'hermes-engine',
106
- timestamp: Date.now(),
107
- });
108
- }
109
- else {
110
- issues.push({
111
- id: 'audit_hermes_disabled',
112
- title: 'Hermes Engine Disabled',
113
- message: 'Your application is running on JavaScriptCore. Enabling Hermes improves app launch time, decreases memory footprint, and shrinks bundle size.',
114
- severity: 'warning',
115
- category: 'performance',
116
- packageName: 'hermes-engine',
117
- fixCommand: 'Enable hermesEnabled=true in android/gradle.properties or Podfile',
118
- timestamp: Date.now(),
119
- });
120
- }
121
- if (isFabric) {
122
- issues.push({
123
- id: 'audit_fabric_status',
124
- title: 'New Architecture (Fabric + TurboModules)',
125
- message: 'New Architecture is active with direct C++ synchronous bindings and concurrent React 19 rendering.',
126
- severity: 'optimal',
127
- category: 'performance',
128
- packageName: 'react-native',
129
- timestamp: Date.now(),
130
- });
131
- }
132
- else {
133
- issues.push({
134
- id: 'audit_fabric_notice',
135
- title: 'Legacy Bridge Architecture (Paper)',
136
- message: 'App is utilizing standard asynchronous JSON bridge. Upgrading to New Architecture (Fabric) unlocks direct C++ TurboModules.',
137
- severity: 'info',
138
- category: 'performance',
139
- packageName: 'react-native',
140
- fixCommand: 'Enable newArchEnabled=true in android/gradle.properties / Podfile',
141
- timestamp: Date.now(),
142
- });
143
- }
144
- // ═══════════════════════════════════════════════════════════════════════════════
145
- // 4. SECURITY & TRANSPORT AUDIT
146
- // ═══════════════════════════════════════════════════════════════════════════════
147
- issues.push({
148
- id: 'audit_secure_transport',
149
- title: 'Secure HTTPS / TLS Transport Compliance',
150
- message: 'All monitored network calls and telemetry payloads use secure TLS encrypted channels.',
151
- severity: 'optimal',
152
- category: 'security',
153
- timestamp: Date.now(),
154
- });
155
- // ─── Calculate Overall Health Score & Grade ─────────────────────────────────
156
- const criticalCount = issues.filter(i => i.severity === 'critical').length;
157
- const warningCount = issues.filter(i => i.severity === 'warning').length;
158
- const infoCount = issues.filter(i => i.severity === 'info').length;
159
- let score = 100 - (criticalCount * 25) - (warningCount * 8);
160
- score = Math.max(0, Math.min(100, score));
161
- let grade = 'A+';
162
- if (score >= 95)
163
- grade = 'A+';
164
- else if (score >= 85)
165
- grade = 'A';
166
- else if (score >= 70)
167
- grade = 'B';
168
- else if (score >= 50)
169
- grade = 'C';
170
- else
171
- grade = 'D';
172
- return {
173
- score,
174
- grade,
175
- totalIssues: issues.length,
176
- criticalCount,
177
- warningCount,
178
- infoCount,
179
- issues,
180
- scannedAt: Date.now(),
181
- };
182
- }
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const AuditTab: React.MemoExoticComponent<() => React.JSX.Element>;
3
- export default AuditTab;