react-native-inapp-inspector 2.0.0 → 2.0.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/README.md +10 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
- package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/9.2.0/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/build/reports/problems/problems-report.html +659 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +33 -24
- package/dist/commonjs/components/ConsoleLogCard.js +5 -5
- package/dist/commonjs/components/EndOfListFooter.js +1 -1
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +19 -71
- package/dist/commonjs/components/Inspector/BundleTab.js +670 -188
- package/dist/commonjs/components/Inspector/ConsoleTab.js +109 -98
- package/dist/commonjs/components/Inspector/CrashTab.js +2 -1
- package/dist/commonjs/components/Inspector/InspectorHeader.js +102 -19
- package/dist/commonjs/components/Inspector/MainScreen.js +151 -17
- package/dist/commonjs/components/Inspector/NetworkTab.js +104 -20
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1111 -1385
- package/dist/commonjs/components/Inspector/TabBar.js +3 -4
- package/dist/commonjs/components/Inspector/TelemetryConsentModal.d.ts +3 -0
- package/dist/commonjs/components/Inspector/TelemetryConsentModal.js +212 -0
- package/dist/commonjs/components/JsonViewer.js +9 -4
- package/dist/commonjs/components/LogCard.js +31 -1
- package/dist/commonjs/components/LogSyntaxHighlighter.d.ts +16 -0
- package/dist/commonjs/components/LogSyntaxHighlighter.js +130 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +2 -0
- package/dist/commonjs/components/NetworkIcons.js +10 -1
- package/dist/commonjs/components/Slider.d.ts +13 -0
- package/dist/commonjs/components/Slider.js +261 -0
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -1
- package/dist/commonjs/customHooks/crashHandler.js +1 -1
- package/dist/commonjs/helpers/index.d.ts +2 -0
- package/dist/commonjs/helpers/index.js +16 -0
- package/dist/commonjs/helpers/searchQueryParser.d.ts +6 -0
- package/dist/commonjs/helpers/searchQueryParser.js +236 -0
- package/dist/commonjs/helpers/settingsStore.js +13 -13
- package/dist/commonjs/helpers/telemetry.d.ts +99 -0
- package/dist/commonjs/helpers/telemetry.js +398 -0
- package/dist/commonjs/index.d.ts +2 -0
- package/dist/commonjs/index.js +30 -21
- package/dist/commonjs/native/NativeInspector.d.ts +5 -0
- package/dist/commonjs/native/NativeInspector.js +3 -2
- package/dist/commonjs/styles/index.js +35 -35
- package/dist/esm/components/ConsoleLogCard.js +5 -5
- package/dist/esm/components/EndOfListFooter.js +2 -2
- package/dist/esm/components/Inspector/AnalyticsTab.js +21 -73
- package/dist/esm/components/Inspector/BundleTab.js +670 -188
- package/dist/esm/components/Inspector/ConsoleTab.js +110 -99
- package/dist/esm/components/Inspector/CrashTab.js +2 -1
- package/dist/esm/components/Inspector/InspectorHeader.js +103 -20
- package/dist/esm/components/Inspector/MainScreen.js +119 -18
- package/dist/esm/components/Inspector/NetworkTab.js +105 -21
- package/dist/esm/components/Inspector/SettingsPanel.js +1114 -1388
- package/dist/esm/components/Inspector/TabBar.js +4 -5
- package/dist/esm/components/Inspector/TelemetryConsentModal.d.ts +3 -0
- package/dist/esm/components/Inspector/TelemetryConsentModal.js +175 -0
- package/dist/esm/components/JsonViewer.js +9 -4
- package/dist/esm/components/LogCard.js +32 -2
- package/dist/esm/components/LogSyntaxHighlighter.d.ts +16 -0
- package/dist/esm/components/LogSyntaxHighlighter.js +123 -0
- package/dist/esm/components/NetworkIcons.d.ts +2 -0
- package/dist/esm/components/NetworkIcons.js +7 -0
- package/dist/esm/components/Slider.d.ts +13 -0
- package/dist/esm/components/Slider.js +222 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.js +1 -1
- package/dist/esm/customHooks/crashHandler.js +1 -1
- package/dist/esm/helpers/index.d.ts +2 -0
- package/dist/esm/helpers/index.js +2 -0
- package/dist/esm/helpers/searchQueryParser.d.ts +6 -0
- package/dist/esm/helpers/searchQueryParser.js +233 -0
- package/dist/esm/helpers/settingsStore.js +13 -13
- package/dist/esm/helpers/telemetry.d.ts +99 -0
- package/dist/esm/helpers/telemetry.js +380 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +20 -21
- package/dist/esm/native/NativeInspector.d.ts +5 -0
- package/dist/esm/native/NativeInspector.js +3 -2
- package/dist/esm/styles/index.js +35 -35
- package/ios/{NetworkInspectorModule.m → NetworkInspectorModule.mm} +193 -97
- package/package.json +2 -2
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
export declare const GA4_MEASUREMENT_ID = "G-XXXXXXXXXX";
|
|
2
|
+
export declare const GA4_API_SECRET = "YOUR_GA4_API_SECRET";
|
|
3
|
+
/**
|
|
4
|
+
* Asynchronously loads host application and device metadata (strictly non-PII/technical).
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadAppDiagnosticsAsync(): Promise<Record<string, any>>;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the developer's telemetry consent status.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getTelemetryConsentStatus(): Promise<'granted' | 'declined' | 'undetermined'>;
|
|
11
|
+
/**
|
|
12
|
+
* Saves the developer's telemetry consent choice.
|
|
13
|
+
*/
|
|
14
|
+
export declare function setTelemetryConsent(granted: boolean): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if the user or environment has opted out of telemetry.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isTelemetryOptedOut(explicitSetting?: boolean): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Track an anonymous event via GA4 Measurement Protocol.
|
|
21
|
+
*/
|
|
22
|
+
export declare function trackTelemetryEvent(eventName: string, params?: Record<string, any>, options?: {
|
|
23
|
+
telemetry?: boolean;
|
|
24
|
+
force?: boolean;
|
|
25
|
+
}): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* 1. Session initialization heartbeat ping.
|
|
28
|
+
*/
|
|
29
|
+
export declare function sendSessionTelemetryPing(options?: {
|
|
30
|
+
telemetry?: boolean;
|
|
31
|
+
environment?: string;
|
|
32
|
+
hasNavigation?: boolean;
|
|
33
|
+
hasAppIcon?: boolean;
|
|
34
|
+
force?: boolean;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* 2. Track when the inspector modal is opened.
|
|
38
|
+
*/
|
|
39
|
+
export declare function trackInspectorOpen(options?: {
|
|
40
|
+
activeTab?: string;
|
|
41
|
+
openSource?: 'fab' | 'shake' | 'programmatic';
|
|
42
|
+
telemetry?: boolean;
|
|
43
|
+
}): void;
|
|
44
|
+
/**
|
|
45
|
+
* 3. Track when the inspector modal is closed.
|
|
46
|
+
*/
|
|
47
|
+
export declare function trackInspectorClose(options?: {
|
|
48
|
+
telemetry?: boolean;
|
|
49
|
+
}): void;
|
|
50
|
+
/**
|
|
51
|
+
* 4. Track tab / page view navigation inside the inspector.
|
|
52
|
+
*/
|
|
53
|
+
export declare function trackTabSwitch(tabName: string, options?: {
|
|
54
|
+
telemetry?: boolean;
|
|
55
|
+
fromTab?: string;
|
|
56
|
+
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* 5. Track network API interaction (inspect details, copy cURL, retry).
|
|
59
|
+
*/
|
|
60
|
+
export declare function trackNetworkInteraction(action: 'view_detail' | 'copy_curl' | 'retry_request' | 'copy_url' | 'clear_logs' | 'export_har', options?: {
|
|
61
|
+
method?: string;
|
|
62
|
+
statusCode?: number;
|
|
63
|
+
durationMs?: number;
|
|
64
|
+
telemetry?: boolean;
|
|
65
|
+
}): void;
|
|
66
|
+
/**
|
|
67
|
+
* 6. Track Redux / State management interaction.
|
|
68
|
+
*/
|
|
69
|
+
export declare function trackReduxInteraction(action: 'view_diff' | 'view_state' | 'view_action' | 'filter_reducer', options?: {
|
|
70
|
+
reducerName?: string;
|
|
71
|
+
telemetry?: boolean;
|
|
72
|
+
}): void;
|
|
73
|
+
/**
|
|
74
|
+
* 7. Track Crash & Exception interaction.
|
|
75
|
+
*/
|
|
76
|
+
export declare function trackCrashInteraction(action: 'view_crash_detail' | 'share_crash_report' | 'copy_stacktrace' | 'clear_crashes', options?: {
|
|
77
|
+
crashType?: string;
|
|
78
|
+
telemetry?: boolean;
|
|
79
|
+
}): void;
|
|
80
|
+
/**
|
|
81
|
+
* 8. Track Performance monitoring tab interaction.
|
|
82
|
+
*/
|
|
83
|
+
export declare function trackPerformanceInteraction(subTab: 'fps' | 'memory' | 'rerenders' | 'bundles', options?: {
|
|
84
|
+
telemetry?: boolean;
|
|
85
|
+
}): void;
|
|
86
|
+
/**
|
|
87
|
+
* 9. Track search queries and filter applications.
|
|
88
|
+
*/
|
|
89
|
+
export declare function trackSearchOrFilter(target: 'apis' | 'console' | 'redux' | 'crashes' | 'analytics', actionType: 'search_query' | 'status_filter' | 'method_filter' | 'tag_filter', options?: {
|
|
90
|
+
filterValue?: string;
|
|
91
|
+
telemetry?: boolean;
|
|
92
|
+
}): void;
|
|
93
|
+
/**
|
|
94
|
+
* 10. Track when logs / reports are exported or shared.
|
|
95
|
+
*/
|
|
96
|
+
export declare function trackLogExport(exportType: 'logs_json' | 'logs_har' | 'curl' | 'crash_report', options?: {
|
|
97
|
+
telemetry?: boolean;
|
|
98
|
+
count?: number;
|
|
99
|
+
}): void;
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ─── Google Analytics 4 (GA4) Measurement Protocol Telemetry ───────────────
|
|
3
|
+
//
|
|
4
|
+
// Comprehensive, anonymous usage telemetry for react-native-inapp-inspector.
|
|
5
|
+
//
|
|
6
|
+
// - NEVER collects user PII, auth tokens, device names, or network payload bodies.
|
|
7
|
+
// - Zero main-thread blocking; 100% fail-safe fire-and-forget.
|
|
8
|
+
// - Full environment diagnostics (Hermes, New Arch, RN version, screen size, UI mode).
|
|
9
|
+
// - Tracks developer interactions: tab switches, page views, search, exports, retries.
|
|
10
|
+
// - Supports opt-out via `telemetry={false}` or `DO_NOT_TRACK=1`.
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.GA4_API_SECRET = exports.GA4_MEASUREMENT_ID = void 0;
|
|
14
|
+
exports.loadAppDiagnosticsAsync = loadAppDiagnosticsAsync;
|
|
15
|
+
exports.getTelemetryConsentStatus = getTelemetryConsentStatus;
|
|
16
|
+
exports.setTelemetryConsent = setTelemetryConsent;
|
|
17
|
+
exports.isTelemetryOptedOut = isTelemetryOptedOut;
|
|
18
|
+
exports.trackTelemetryEvent = trackTelemetryEvent;
|
|
19
|
+
exports.sendSessionTelemetryPing = sendSessionTelemetryPing;
|
|
20
|
+
exports.trackInspectorOpen = trackInspectorOpen;
|
|
21
|
+
exports.trackInspectorClose = trackInspectorClose;
|
|
22
|
+
exports.trackTabSwitch = trackTabSwitch;
|
|
23
|
+
exports.trackNetworkInteraction = trackNetworkInteraction;
|
|
24
|
+
exports.trackReduxInteraction = trackReduxInteraction;
|
|
25
|
+
exports.trackCrashInteraction = trackCrashInteraction;
|
|
26
|
+
exports.trackPerformanceInteraction = trackPerformanceInteraction;
|
|
27
|
+
exports.trackSearchOrFilter = trackSearchOrFilter;
|
|
28
|
+
exports.trackLogExport = trackLogExport;
|
|
29
|
+
const react_native_1 = require("react-native");
|
|
30
|
+
const constants_1 = require("../constants");
|
|
31
|
+
const NativeInspector_1 = require("../native/NativeInspector");
|
|
32
|
+
// ─── GA4 Measurement Protocol Configuration ──────────────────────────────────
|
|
33
|
+
// Automatically replaced at build-time from .env by scripts/inject-telemetry.js
|
|
34
|
+
exports.GA4_MEASUREMENT_ID = 'G-3QGMQVZX5V';
|
|
35
|
+
exports.GA4_API_SECRET = 'C46RQZ3PTfmHDnLnvU3KIg';
|
|
36
|
+
const GA4_ENDPOINT = 'https://www.google-analytics.com/mp/collect';
|
|
37
|
+
const CLIENT_ID_KEY = 'telemetry_client_id';
|
|
38
|
+
// Stable session ID created once per JavaScript runtime instance
|
|
39
|
+
const CURRENT_SESSION_ID = String(Math.floor(Date.now() / 1000));
|
|
40
|
+
let hasPingedSession = false;
|
|
41
|
+
let cachedClientId = null;
|
|
42
|
+
let lastModalOpenTimestamp = 0;
|
|
43
|
+
let cachedAppDiagnostics = null;
|
|
44
|
+
/**
|
|
45
|
+
* Generates an anonymous, pseudorandom UUIDv4-like string for client grouping.
|
|
46
|
+
* Contains zero hardware or personal identifiers.
|
|
47
|
+
*/
|
|
48
|
+
function generateAnonymousClientId() {
|
|
49
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
|
|
50
|
+
const r = (Math.random() * 16) | 0;
|
|
51
|
+
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
52
|
+
return v.toString(16);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves or generates the anonymous client identifier.
|
|
57
|
+
*/
|
|
58
|
+
async function getOrCreateClientId() {
|
|
59
|
+
if (cachedClientId)
|
|
60
|
+
return cachedClientId;
|
|
61
|
+
try {
|
|
62
|
+
const stored = await (0, NativeInspector_1.getNativeStorageItem)(CLIENT_ID_KEY);
|
|
63
|
+
if (stored && typeof stored === 'string' && stored.length > 0) {
|
|
64
|
+
cachedClientId = stored;
|
|
65
|
+
return stored;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// Fallback to memory
|
|
70
|
+
}
|
|
71
|
+
const newId = generateAnonymousClientId();
|
|
72
|
+
cachedClientId = newId;
|
|
73
|
+
try {
|
|
74
|
+
await (0, NativeInspector_1.setNativeStorageItem)(CLIENT_ID_KEY, newId);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Silently ignore storage errors
|
|
78
|
+
}
|
|
79
|
+
return newId;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Asynchronously loads host application and device metadata (strictly non-PII/technical).
|
|
83
|
+
*/
|
|
84
|
+
async function loadAppDiagnosticsAsync() {
|
|
85
|
+
if (cachedAppDiagnostics)
|
|
86
|
+
return cachedAppDiagnostics;
|
|
87
|
+
try {
|
|
88
|
+
const metrics = await (0, NativeInspector_1.getNativeDeviceMetrics)();
|
|
89
|
+
cachedAppDiagnostics = {
|
|
90
|
+
app_name: metrics?.appName ||
|
|
91
|
+
react_native_1.Platform.constants?.appName ||
|
|
92
|
+
'unknown',
|
|
93
|
+
app_version: metrics?.appVersion ||
|
|
94
|
+
react_native_1.Platform.constants?.appVersion ||
|
|
95
|
+
'unknown',
|
|
96
|
+
app_build: metrics?.appBuild || 'unknown',
|
|
97
|
+
app_bundle_id: metrics?.appBundleId || metrics?.appPackageName || 'unknown',
|
|
98
|
+
device_brand: metrics?.deviceBrand ||
|
|
99
|
+
react_native_1.Platform.constants?.Brand ||
|
|
100
|
+
react_native_1.Platform.constants?.systemName ||
|
|
101
|
+
'unknown',
|
|
102
|
+
device_model: metrics?.deviceModel ||
|
|
103
|
+
react_native_1.Platform.constants?.Model ||
|
|
104
|
+
react_native_1.Platform.constants?.interfaceIdiom ||
|
|
105
|
+
'unknown',
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
cachedAppDiagnostics = {
|
|
110
|
+
app_name: react_native_1.Platform.constants?.appName || 'unknown',
|
|
111
|
+
app_version: react_native_1.Platform.constants?.appVersion || 'unknown',
|
|
112
|
+
app_build: 'unknown',
|
|
113
|
+
app_bundle_id: 'unknown',
|
|
114
|
+
device_brand: react_native_1.Platform.constants?.Brand || 'unknown',
|
|
115
|
+
device_model: react_native_1.Platform.constants?.Model || 'unknown',
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return cachedAppDiagnostics;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Extracts React Native framework version string (e.g. "0.81.4").
|
|
122
|
+
*/
|
|
123
|
+
function getReactNativeVersion() {
|
|
124
|
+
try {
|
|
125
|
+
const constants = react_native_1.Platform.constants;
|
|
126
|
+
if (constants && constants.reactNativeVersion) {
|
|
127
|
+
const { major, minor, patch, prerelease } = constants.reactNativeVersion;
|
|
128
|
+
return `${major}.${minor}.${patch}${prerelease ? `-${prerelease}` : ''}`;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
// Fallback
|
|
133
|
+
}
|
|
134
|
+
return 'unknown';
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Collects complete anonymous device, host app & runtime environment diagnostics.
|
|
138
|
+
*/
|
|
139
|
+
function getEnvironmentDiagnostics(extraParams = {}) {
|
|
140
|
+
const isHermes = Boolean(global.HermesInternal);
|
|
141
|
+
const isNewArch = Boolean(global._RN_FABRIC_ENABLED || global.__turboModuleProxy);
|
|
142
|
+
const isNativeLinked = (0, NativeInspector_1.isNativeModuleAvailable)();
|
|
143
|
+
const rnVersion = getReactNativeVersion();
|
|
144
|
+
const isExpo = Boolean(global?.expo?.modules?.ExponentConstants ||
|
|
145
|
+
global?.__expo ||
|
|
146
|
+
(typeof process !== 'undefined' &&
|
|
147
|
+
process?.env?.EXPO_PUBLIC_PROJECT_ROOT));
|
|
148
|
+
let screenResolution = 'unknown';
|
|
149
|
+
let fontScale = 1;
|
|
150
|
+
try {
|
|
151
|
+
const { width, height, scale, fontScale: fs } = react_native_1.Dimensions.get('window');
|
|
152
|
+
screenResolution = `${Math.round(width)}x${Math.round(height)}@${scale}x`;
|
|
153
|
+
fontScale = fs || 1;
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// Ignore dimension errors
|
|
157
|
+
}
|
|
158
|
+
let colorScheme = 'unknown';
|
|
159
|
+
try {
|
|
160
|
+
colorScheme = react_native_1.Appearance.getColorScheme() || 'unspecified';
|
|
161
|
+
}
|
|
162
|
+
catch {
|
|
163
|
+
// Ignore appearance errors
|
|
164
|
+
}
|
|
165
|
+
const appMeta = cachedAppDiagnostics || {
|
|
166
|
+
app_name: react_native_1.Platform.constants?.appName || 'unknown',
|
|
167
|
+
app_version: react_native_1.Platform.constants?.appVersion || 'unknown',
|
|
168
|
+
app_build: 'unknown',
|
|
169
|
+
app_bundle_id: 'unknown',
|
|
170
|
+
device_brand: react_native_1.Platform.constants?.Brand ||
|
|
171
|
+
react_native_1.Platform.constants?.systemName ||
|
|
172
|
+
'unknown',
|
|
173
|
+
device_model: react_native_1.Platform.constants?.Model ||
|
|
174
|
+
react_native_1.Platform.constants?.interfaceIdiom ||
|
|
175
|
+
'unknown',
|
|
176
|
+
};
|
|
177
|
+
return {
|
|
178
|
+
session_id: CURRENT_SESSION_ID,
|
|
179
|
+
engagement_time_msec: 100,
|
|
180
|
+
lib_version: constants_1.LIB_VERSION,
|
|
181
|
+
platform: react_native_1.Platform.OS,
|
|
182
|
+
os_version: String(react_native_1.Platform.Version),
|
|
183
|
+
rn_version: rnVersion,
|
|
184
|
+
is_hermes: isHermes,
|
|
185
|
+
is_new_arch: isNewArch,
|
|
186
|
+
is_native_linked: isNativeLinked,
|
|
187
|
+
is_expo: isExpo,
|
|
188
|
+
is_dev: Boolean(typeof __DEV__ !== 'undefined' && __DEV__),
|
|
189
|
+
screen_resolution: screenResolution,
|
|
190
|
+
font_scale: fontScale,
|
|
191
|
+
color_scheme: colorScheme,
|
|
192
|
+
...appMeta,
|
|
193
|
+
...extraParams,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const CONSENT_STORAGE_KEY = 'telemetry_consent_status';
|
|
197
|
+
let cachedConsentStatus = null;
|
|
198
|
+
/**
|
|
199
|
+
* Returns the developer's telemetry consent status.
|
|
200
|
+
*/
|
|
201
|
+
async function getTelemetryConsentStatus() {
|
|
202
|
+
if (cachedConsentStatus)
|
|
203
|
+
return cachedConsentStatus;
|
|
204
|
+
try {
|
|
205
|
+
const stored = await (0, NativeInspector_1.getNativeStorageItem)(CONSENT_STORAGE_KEY);
|
|
206
|
+
if (stored === 'granted' || stored === 'declined') {
|
|
207
|
+
cachedConsentStatus = stored;
|
|
208
|
+
return stored;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
// Fallback
|
|
213
|
+
}
|
|
214
|
+
return 'undetermined';
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Saves the developer's telemetry consent choice.
|
|
218
|
+
*/
|
|
219
|
+
async function setTelemetryConsent(granted) {
|
|
220
|
+
const status = granted ? 'granted' : 'declined';
|
|
221
|
+
cachedConsentStatus = status;
|
|
222
|
+
try {
|
|
223
|
+
await (0, NativeInspector_1.setNativeStorageItem)(CONSENT_STORAGE_KEY, status);
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
// Ignore storage errors
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Checks if the user or environment has opted out of telemetry.
|
|
231
|
+
*/
|
|
232
|
+
function isTelemetryOptedOut(explicitSetting) {
|
|
233
|
+
if (explicitSetting === false)
|
|
234
|
+
return true;
|
|
235
|
+
if (cachedConsentStatus === 'declined')
|
|
236
|
+
return true;
|
|
237
|
+
try {
|
|
238
|
+
if (typeof process !== 'undefined' &&
|
|
239
|
+
process?.env &&
|
|
240
|
+
(process.env.DO_NOT_TRACK === '1' || process.env.DISABLE_TELEMETRY === '1')) {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
// Ignore environments where process is undefined or restricted
|
|
246
|
+
}
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Track an anonymous event via GA4 Measurement Protocol.
|
|
251
|
+
*/
|
|
252
|
+
async function trackTelemetryEvent(eventName, params = {}, options) {
|
|
253
|
+
if (isTelemetryOptedOut(options?.telemetry))
|
|
254
|
+
return;
|
|
255
|
+
// Don't send if credentials haven't been configured yet
|
|
256
|
+
if (!exports.GA4_MEASUREMENT_ID ||
|
|
257
|
+
exports.GA4_MEASUREMENT_ID === 'G-3QGMQVZX5V' ||
|
|
258
|
+
!exports.GA4_API_SECRET ||
|
|
259
|
+
exports.GA4_API_SECRET === 'C46RQZ3PTfmHDnLnvU3KIg') {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
try {
|
|
263
|
+
const clientId = await getOrCreateClientId();
|
|
264
|
+
await loadAppDiagnosticsAsync();
|
|
265
|
+
const eventParams = getEnvironmentDiagnostics(params);
|
|
266
|
+
const payload = {
|
|
267
|
+
client_id: clientId,
|
|
268
|
+
events: [
|
|
269
|
+
{
|
|
270
|
+
name: eventName,
|
|
271
|
+
params: eventParams,
|
|
272
|
+
},
|
|
273
|
+
],
|
|
274
|
+
};
|
|
275
|
+
const url = `${GA4_ENDPOINT}?measurement_id=${encodeURIComponent(exports.GA4_MEASUREMENT_ID)}&api_secret=${encodeURIComponent(exports.GA4_API_SECRET)}`;
|
|
276
|
+
fetch(url, {
|
|
277
|
+
method: 'POST',
|
|
278
|
+
headers: {
|
|
279
|
+
'Content-Type': 'application/json',
|
|
280
|
+
},
|
|
281
|
+
body: JSON.stringify(payload),
|
|
282
|
+
}).catch(() => {
|
|
283
|
+
// If offline on initial cold start, allow a single delayed retry
|
|
284
|
+
if (eventName === 'inspector_session_init') {
|
|
285
|
+
hasPingedSession = false;
|
|
286
|
+
setTimeout(() => {
|
|
287
|
+
sendSessionTelemetryPing(options);
|
|
288
|
+
}, 8000);
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
// Fail silently
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* 1. Session initialization heartbeat ping.
|
|
298
|
+
*/
|
|
299
|
+
async function sendSessionTelemetryPing(options) {
|
|
300
|
+
if (hasPingedSession && !options?.force)
|
|
301
|
+
return;
|
|
302
|
+
if (isTelemetryOptedOut(options?.telemetry))
|
|
303
|
+
return;
|
|
304
|
+
hasPingedSession = true;
|
|
305
|
+
await trackTelemetryEvent('inspector_session_init', {
|
|
306
|
+
environment: options?.environment || 'unknown',
|
|
307
|
+
has_navigation: Boolean(options?.hasNavigation),
|
|
308
|
+
has_app_icon: Boolean(options?.hasAppIcon),
|
|
309
|
+
}, options);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* 2. Track when the inspector modal is opened.
|
|
313
|
+
*/
|
|
314
|
+
function trackInspectorOpen(options) {
|
|
315
|
+
lastModalOpenTimestamp = Date.now();
|
|
316
|
+
trackTelemetryEvent('inspector_open', {
|
|
317
|
+
open_source: options?.openSource || 'fab',
|
|
318
|
+
active_tab: options?.activeTab || 'apis',
|
|
319
|
+
}, options);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* 3. Track when the inspector modal is closed.
|
|
323
|
+
*/
|
|
324
|
+
function trackInspectorClose(options) {
|
|
325
|
+
const durationSec = lastModalOpenTimestamp > 0
|
|
326
|
+
? Math.round((Date.now() - lastModalOpenTimestamp) / 1000)
|
|
327
|
+
: 0;
|
|
328
|
+
trackTelemetryEvent('inspector_close', {
|
|
329
|
+
open_duration_seconds: durationSec,
|
|
330
|
+
}, options);
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* 4. Track tab / page view navigation inside the inspector.
|
|
334
|
+
*/
|
|
335
|
+
function trackTabSwitch(tabName, options) {
|
|
336
|
+
trackTelemetryEvent('page_view', {
|
|
337
|
+
page_title: `Tab: ${tabName}`,
|
|
338
|
+
page_location: `inapp-inspector://tab/${tabName}`,
|
|
339
|
+
tab_name: tabName,
|
|
340
|
+
from_tab: options?.fromTab || 'unknown',
|
|
341
|
+
}, options);
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* 5. Track network API interaction (inspect details, copy cURL, retry).
|
|
345
|
+
*/
|
|
346
|
+
function trackNetworkInteraction(action, options) {
|
|
347
|
+
trackTelemetryEvent('network_interaction', {
|
|
348
|
+
action_type: action,
|
|
349
|
+
http_method: options?.method || 'GET',
|
|
350
|
+
status_code: options?.statusCode || 0,
|
|
351
|
+
duration_ms: options?.durationMs || 0,
|
|
352
|
+
}, options);
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* 6. Track Redux / State management interaction.
|
|
356
|
+
*/
|
|
357
|
+
function trackReduxInteraction(action, options) {
|
|
358
|
+
trackTelemetryEvent('redux_interaction', {
|
|
359
|
+
action_type: action,
|
|
360
|
+
reducer_name: options?.reducerName || 'root',
|
|
361
|
+
}, options);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* 7. Track Crash & Exception interaction.
|
|
365
|
+
*/
|
|
366
|
+
function trackCrashInteraction(action, options) {
|
|
367
|
+
trackTelemetryEvent('crash_interaction', {
|
|
368
|
+
action_type: action,
|
|
369
|
+
crash_type: options?.crashType || 'js_exception',
|
|
370
|
+
}, options);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* 8. Track Performance monitoring tab interaction.
|
|
374
|
+
*/
|
|
375
|
+
function trackPerformanceInteraction(subTab, options) {
|
|
376
|
+
trackTelemetryEvent('performance_interaction', {
|
|
377
|
+
sub_tab: subTab,
|
|
378
|
+
}, options);
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* 9. Track search queries and filter applications.
|
|
382
|
+
*/
|
|
383
|
+
function trackSearchOrFilter(target, actionType, options) {
|
|
384
|
+
trackTelemetryEvent('search_and_filter', {
|
|
385
|
+
target_tab: target,
|
|
386
|
+
action_type: actionType,
|
|
387
|
+
filter_value: options?.filterValue || 'all',
|
|
388
|
+
}, options);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* 10. Track when logs / reports are exported or shared.
|
|
392
|
+
*/
|
|
393
|
+
function trackLogExport(exportType, options) {
|
|
394
|
+
trackTelemetryEvent('log_export', {
|
|
395
|
+
export_type: exportType,
|
|
396
|
+
item_count: options?.count || 1,
|
|
397
|
+
}, options);
|
|
398
|
+
}
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -13,4 +13,6 @@ export { getEventCategory, registerGAPlugin, type GAPlugin, } from './helpers/ga
|
|
|
13
13
|
export { usePerformanceTracker, useComponentProfiler, useNavigationProfiler, trackComponentRender, trackNavigationTransition, trackHeavyTask, measureAsync, getHermesMemoryStats, registerComponentProfile, subscribeRenderProfiles, getRenderProfiles, logPerformanceEvent, clearPerformanceEvents, subscribePerformanceEvents, getPerformanceEvents, getInitialRenderProfiles, getInitialPerformanceEvents, generateFixSnippet, } from './customHooks/performanceTracker';
|
|
14
14
|
export { InspectLog, InspectTrackTime, InspectCatch, type InspectLogOptions, } from './decorators';
|
|
15
15
|
export { getNativeDeviceMetrics, enableNativeCrashProtection, subscribeNativeCrashes, showNativeFloatingButton, hideNativeFloatingButton, setNativeFloatingButtonBadge, subscribeNativeFloatingButtonPress, subscribeNativeDeviceShake, startNativeFpsMonitoring, stopNativeFpsMonitoring, getNativeFpsMetrics, getNativeStorageItem, setNativeStorageItem, isNativeModuleAvailable, type NativeDeviceMetrics, type NativeCrashEvent, type FloatingButtonOptions, type NativeFpsMetrics, } from './native/NativeInspector';
|
|
16
|
+
export { sendSessionTelemetryPing, trackTelemetryEvent, trackInspectorOpen, trackTabSwitch, trackLogExport, GA4_MEASUREMENT_ID, GA4_API_SECRET, } from './helpers';
|
|
17
|
+
export { BrandSquareIcon, BrandCircleIcon, } from './components/NetworkIcons';
|
|
16
18
|
export { ActiveTab, Method, StatusFilter, SortOrder, LocalFilter, ModalAnimationType, SettingsPage, SettingsSubTab, LogFilter, ConsoleLogType, AnalyticsEventSource, GAEventCategory, StackFrameType, DiffResultType, BundleSubTab, PerformanceSubTab, CrashType, CrashExportFormat, CrashDetailSubTab, CrashFilterType, BreadcrumbType, } from './types';
|
package/dist/commonjs/index.js
CHANGED
|
@@ -37,7 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.registerComponentProfile = exports.getHermesMemoryStats = exports.measureAsync = exports.trackHeavyTask = exports.trackNavigationTransition = exports.trackComponentRender = exports.useNavigationProfiler = exports.useComponentProfiler = exports.usePerformanceTracker = exports.registerGAPlugin = exports.getEventCategory = exports.getLastActionForReducer = exports.clearActionHistory = exports.getActionHistory = exports.subscribeReduxState = exports.getReduxState = exports.inspectorReduxMiddleware = exports.connectReduxStore = exports.ErrorBoundary = exports.CrashTab = exports.computeCrashFingerprint = exports.recordUserActionBreadcrumb = exports.recordReduxBreadcrumb = exports.recordNetworkBreadcrumb = exports.recordNavigationBreadcrumb = exports.addCrashBreadcrumb = exports.recordCustomCrash = exports.parseCrashStackTrace = exports.exportCrashReport = exports.simulateTestCrash = exports.clearCrashRecords = exports.getCrashRecords = exports.emitCrashEvent = exports.subscribeCrashEvents = exports.setupGlobalCrashHandler = exports.getCollectionEnabled = exports.getDefaultEventParameters = exports.getCurrentUserId = exports.getCurrentUserProperties = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = exports.logAnalyticsEvent = exports.setupAnalyticsLogger = exports.subscribeConsoleLogs = exports.clearConsoleLogs = exports.setupConsoleLogger = exports.addAxiosInterceptors = exports.subscribeNetworkLogs = exports.clearNetworkLogs = exports.setupNetworkLogger = void 0;
|
|
40
|
-
exports.
|
|
40
|
+
exports.BundleSubTab = exports.DiffResultType = exports.StackFrameType = exports.GAEventCategory = exports.AnalyticsEventSource = exports.ConsoleLogType = exports.LogFilter = exports.SettingsSubTab = exports.SettingsPage = exports.ModalAnimationType = exports.LocalFilter = exports.SortOrder = exports.StatusFilter = exports.Method = exports.ActiveTab = exports.BrandCircleIcon = exports.BrandSquareIcon = exports.GA4_API_SECRET = exports.GA4_MEASUREMENT_ID = exports.trackLogExport = exports.trackTabSwitch = exports.trackInspectorOpen = exports.trackTelemetryEvent = exports.sendSessionTelemetryPing = exports.isNativeModuleAvailable = exports.setNativeStorageItem = exports.getNativeStorageItem = exports.getNativeFpsMetrics = exports.stopNativeFpsMonitoring = exports.startNativeFpsMonitoring = exports.subscribeNativeDeviceShake = exports.subscribeNativeFloatingButtonPress = exports.setNativeFloatingButtonBadge = exports.hideNativeFloatingButton = exports.showNativeFloatingButton = exports.subscribeNativeCrashes = exports.enableNativeCrashProtection = exports.getNativeDeviceMetrics = exports.InspectCatch = exports.InspectTrackTime = exports.InspectLog = exports.generateFixSnippet = exports.getInitialPerformanceEvents = exports.getInitialRenderProfiles = exports.getPerformanceEvents = exports.subscribePerformanceEvents = exports.clearPerformanceEvents = exports.logPerformanceEvent = exports.getRenderProfiles = exports.subscribeRenderProfiles = void 0;
|
|
41
|
+
exports.BreadcrumbType = exports.CrashFilterType = exports.CrashDetailSubTab = exports.CrashExportFormat = exports.CrashType = exports.PerformanceSubTab = void 0;
|
|
41
42
|
const react_1 = __importStar(require("react"));
|
|
42
43
|
const react_native_1 = require("react-native");
|
|
43
44
|
const native_1 = require("@react-navigation/native");
|
|
@@ -139,7 +140,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
139
140
|
// ─── Crash state ───────────────────────────────────────────────────────────
|
|
140
141
|
const [crashRecords, setCrashRecords] = (0, react_1.useState)(() => (0, crashHandler_1.getCrashRecords)());
|
|
141
142
|
const [selectedCrash, setSelectedCrash] = (0, react_1.useState)(null);
|
|
142
|
-
const [maxCrashLogs, setMaxCrashLogs] = (0, react_1.useState)(
|
|
143
|
+
const [maxCrashLogs, setMaxCrashLogs] = (0, react_1.useState)(50);
|
|
143
144
|
(0, react_1.useEffect)(() => {
|
|
144
145
|
(0, crashHandler_1.setMaxCrashLogsLimit)(maxCrashLogs);
|
|
145
146
|
}, [maxCrashLogs]);
|
|
@@ -171,7 +172,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
171
172
|
setLastReadCrashesCount(crashRecords.length);
|
|
172
173
|
}
|
|
173
174
|
}, [activeTab, crashRecords.length]);
|
|
174
|
-
const [maxConsoleLogs, setMaxConsoleLogs] = (0, react_1.useState)(
|
|
175
|
+
const [maxConsoleLogs, setMaxConsoleLogs] = (0, react_1.useState)(100);
|
|
175
176
|
const [showConsoleLevels, setShowConsoleLevels] = (0, react_1.useState)({
|
|
176
177
|
info: true,
|
|
177
178
|
warn: false,
|
|
@@ -216,7 +217,7 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
216
217
|
crash: false,
|
|
217
218
|
});
|
|
218
219
|
const [maxNetworkLogs, setMaxNetworkLogs] = (0, react_1.useState)(100);
|
|
219
|
-
const [maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit] = (0, react_1.useState)(
|
|
220
|
+
const [maxAnalyticsEventsLimit, setMaxAnalyticsEventsLimit] = (0, react_1.useState)(75);
|
|
220
221
|
const [isAutoRamLimitEnabled, setIsAutoRamLimitEnabled] = (0, react_1.useState)(true);
|
|
221
222
|
const [deviceFreeRamMb, setDeviceFreeRamMb] = (0, react_1.useState)(1800);
|
|
222
223
|
const [reduxAutoRefresh, setReduxAutoRefreshState] = (0, react_1.useState)(true);
|
|
@@ -739,6 +740,14 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
739
740
|
}, [unreadPulseAnim]);
|
|
740
741
|
const isNativeModule = (0, react_1.useMemo)(() => (0, NativeInspector_2.isNativeModuleAvailable)(), []);
|
|
741
742
|
const useNativeFab = (react_native_1.Platform.OS === 'ios' || react_native_1.Platform.OS === 'android') && isNativeModule;
|
|
743
|
+
// Send anonymous initialization heartbeat to GA4 Measurement Protocol
|
|
744
|
+
(0, react_1.useEffect)(() => {
|
|
745
|
+
(0, helpers_1.sendSessionTelemetryPing)({
|
|
746
|
+
environment,
|
|
747
|
+
hasNavigation: Boolean(navigationRef),
|
|
748
|
+
hasAppIcon: Boolean(appIcon),
|
|
749
|
+
});
|
|
750
|
+
}, [environment, navigationRef, appIcon]);
|
|
742
751
|
// 100% Native Main-Thread Floating Button Lifecycle
|
|
743
752
|
(0, react_1.useEffect)(() => {
|
|
744
753
|
if (!useNativeFab || !isEnabled || !enabled) {
|
|
@@ -793,6 +802,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
793
802
|
? defaultTab
|
|
794
803
|
: 'apis';
|
|
795
804
|
setActiveTab(target);
|
|
805
|
+
// Track inspector opened event in GA4
|
|
806
|
+
(0, helpers_1.trackInspectorOpen)({ activeTab: target });
|
|
796
807
|
// Instant synchronization of data collected while modal was closed
|
|
797
808
|
if (latestNetworkLogsRef.current.length > 0) {
|
|
798
809
|
const deduped = (0, helpers_1.deduplicateLogs)(latestNetworkLogsRef.current);
|
|
@@ -1046,23 +1057,10 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1046
1057
|
if (!matchedMethod)
|
|
1047
1058
|
return false;
|
|
1048
1059
|
}
|
|
1049
|
-
//
|
|
1060
|
+
// Advanced Search Query Engine Check (Supports method:POST, is:error, slow:>1s, status:200, headers, body, etc.)
|
|
1050
1061
|
if (search && search.trim().length > 0) {
|
|
1051
|
-
const queryTokens = search.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
1052
1062
|
const routePath = logRouteMapRef.current.get(log.id)?.path || '';
|
|
1053
|
-
const
|
|
1054
|
-
const resStr = typeof log.response === 'string' ? log.response : JSON.stringify(log.response || '');
|
|
1055
|
-
const searchTarget = [
|
|
1056
|
-
log.method || '',
|
|
1057
|
-
log.url || '',
|
|
1058
|
-
String(log.status ?? ''),
|
|
1059
|
-
routePath,
|
|
1060
|
-
reqStr,
|
|
1061
|
-
resStr,
|
|
1062
|
-
JSON.stringify(log.requestHeaders || ''),
|
|
1063
|
-
JSON.stringify(log.responseHeaders || ''),
|
|
1064
|
-
].join(' ').toLowerCase();
|
|
1065
|
-
const isMatch = queryTokens.every(token => searchTarget.includes(token));
|
|
1063
|
+
const isMatch = (0, helpers_1.matchNetworkLogQuery)(log, search, routePath);
|
|
1066
1064
|
if (!isMatch)
|
|
1067
1065
|
return false;
|
|
1068
1066
|
}
|
|
@@ -1366,8 +1364,8 @@ const NetworkInspector = ({ enabled = true, isEnabled = true, storage, navigatio
|
|
|
1366
1364
|
else if (analyticsFilters.sortBy === 'count_desc') {
|
|
1367
1365
|
result = [...result].sort((a, b) => (b.count || 1) - (a.count || 1));
|
|
1368
1366
|
}
|
|
1369
|
-
return result;
|
|
1370
|
-
}, [analyticsEvents, analyticsSearch, analyticsFilters]);
|
|
1367
|
+
return result.slice(0, maxAnalyticsEventsLimit);
|
|
1368
|
+
}, [analyticsEvents, analyticsSearch, analyticsFilters, maxAnalyticsEventsLimit]);
|
|
1371
1369
|
const filteredConsoleLogs = (0, react_1.useMemo)(() => {
|
|
1372
1370
|
let result = visibleConsoleLogs;
|
|
1373
1371
|
// Filters check
|
|
@@ -1868,6 +1866,17 @@ Object.defineProperty(exports, "getNativeFpsMetrics", { enumerable: true, get: f
|
|
|
1868
1866
|
Object.defineProperty(exports, "getNativeStorageItem", { enumerable: true, get: function () { return NativeInspector_3.getNativeStorageItem; } });
|
|
1869
1867
|
Object.defineProperty(exports, "setNativeStorageItem", { enumerable: true, get: function () { return NativeInspector_3.setNativeStorageItem; } });
|
|
1870
1868
|
Object.defineProperty(exports, "isNativeModuleAvailable", { enumerable: true, get: function () { return NativeInspector_3.isNativeModuleAvailable; } });
|
|
1869
|
+
var helpers_2 = require("./helpers");
|
|
1870
|
+
Object.defineProperty(exports, "sendSessionTelemetryPing", { enumerable: true, get: function () { return helpers_2.sendSessionTelemetryPing; } });
|
|
1871
|
+
Object.defineProperty(exports, "trackTelemetryEvent", { enumerable: true, get: function () { return helpers_2.trackTelemetryEvent; } });
|
|
1872
|
+
Object.defineProperty(exports, "trackInspectorOpen", { enumerable: true, get: function () { return helpers_2.trackInspectorOpen; } });
|
|
1873
|
+
Object.defineProperty(exports, "trackTabSwitch", { enumerable: true, get: function () { return helpers_2.trackTabSwitch; } });
|
|
1874
|
+
Object.defineProperty(exports, "trackLogExport", { enumerable: true, get: function () { return helpers_2.trackLogExport; } });
|
|
1875
|
+
Object.defineProperty(exports, "GA4_MEASUREMENT_ID", { enumerable: true, get: function () { return helpers_2.GA4_MEASUREMENT_ID; } });
|
|
1876
|
+
Object.defineProperty(exports, "GA4_API_SECRET", { enumerable: true, get: function () { return helpers_2.GA4_API_SECRET; } });
|
|
1877
|
+
var NetworkIcons_1 = require("./components/NetworkIcons");
|
|
1878
|
+
Object.defineProperty(exports, "BrandSquareIcon", { enumerable: true, get: function () { return NetworkIcons_1.BrandSquareIcon; } });
|
|
1879
|
+
Object.defineProperty(exports, "BrandCircleIcon", { enumerable: true, get: function () { return NetworkIcons_1.BrandCircleIcon; } });
|
|
1871
1880
|
var types_1 = require("./types");
|
|
1872
1881
|
Object.defineProperty(exports, "ActiveTab", { enumerable: true, get: function () { return types_1.ActiveTab; } });
|
|
1873
1882
|
Object.defineProperty(exports, "Method", { enumerable: true, get: function () { return types_1.Method; } });
|
|
@@ -17,6 +17,11 @@ export interface NativeDeviceMetrics {
|
|
|
17
17
|
osVersion?: string;
|
|
18
18
|
apiLevel?: number;
|
|
19
19
|
cpuAbi?: string;
|
|
20
|
+
appName?: string;
|
|
21
|
+
appVersion?: string;
|
|
22
|
+
appBuild?: string;
|
|
23
|
+
appBundleId?: string;
|
|
24
|
+
appPackageName?: string;
|
|
20
25
|
}
|
|
21
26
|
export interface NativeCrashEvent {
|
|
22
27
|
platform: 'android' | 'ios';
|
|
@@ -12,8 +12,9 @@ const isNativeModuleAvailable = () => {
|
|
|
12
12
|
return !!NativeModule;
|
|
13
13
|
};
|
|
14
14
|
exports.isNativeModuleAvailable = isNativeModuleAvailable;
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const eventTarget = react_native_1.NativeModules.NetworkInspectorModule || NativeNetworkInspector_1.default;
|
|
16
|
+
const nativeEmitter = eventTarget
|
|
17
|
+
? new react_native_1.NativeEventEmitter(eventTarget)
|
|
17
18
|
: null;
|
|
18
19
|
/**
|
|
19
20
|
* Retrieves low-level native hardware and system metrics (RAM, Heap, Disk, Battery, CPU).
|