react-native-inapp-inspector 2.3.15 → 2.3.16
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 +1 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +0 -22
- package/dist/commonjs/components/Inspector/ConsoleTab.js +0 -22
- package/dist/commonjs/components/Inspector/CrashTab.js +0 -23
- package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/FeedbackModal.js +552 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +56 -4
- package/dist/commonjs/components/Inspector/MainScreen.js +45 -3
- package/dist/commonjs/components/Inspector/NetworkTab.js +27 -38
- package/dist/commonjs/components/Inspector/NpmStarPrompt.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +494 -0
- package/dist/commonjs/components/Inspector/PerformanceTab.js +8 -1
- package/dist/commonjs/components/Inspector/ReduxTab.js +0 -22
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1035 -173
- package/dist/commonjs/components/Inspector/StorageTab.js +0 -23
- package/dist/commonjs/components/Inspector/TabBar.js +50 -15
- package/dist/commonjs/components/NetworkIcons.d.ts +5 -0
- package/dist/commonjs/components/NetworkIcons.js +33 -2
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +1 -0
- package/dist/commonjs/helpers/remoteConfig.d.ts +4 -0
- package/dist/commonjs/helpers/remoteConfig.js +165 -0
- package/dist/commonjs/helpers/searchQueryParser.js +2 -0
- package/dist/commonjs/helpers/telemetry.d.ts +5 -0
- package/dist/commonjs/helpers/telemetry.js +339 -8
- package/dist/commonjs/index.d.ts +1 -0
- package/dist/commonjs/index.js +32 -2
- package/dist/commonjs/styles/AppFonts.d.ts +2 -0
- package/dist/commonjs/styles/AppFonts.js +1 -0
- package/dist/commonjs/styles/index.d.ts +22 -0
- package/dist/commonjs/styles/index.js +19 -0
- package/dist/commonjs/types/enums.d.ts +1 -0
- package/dist/commonjs/types/enums.js +1 -0
- package/dist/commonjs/types/interfaces.d.ts +12 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +1 -23
- package/dist/esm/components/Inspector/ConsoleTab.js +1 -23
- package/dist/esm/components/Inspector/CrashTab.js +1 -24
- package/dist/esm/components/Inspector/FeedbackModal.d.ts +7 -0
- package/dist/esm/components/Inspector/FeedbackModal.js +515 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +57 -5
- package/dist/esm/components/Inspector/MainScreen.js +46 -4
- package/dist/esm/components/Inspector/NetworkTab.js +28 -39
- package/dist/esm/components/Inspector/NpmStarPrompt.d.ts +3 -0
- package/dist/esm/components/Inspector/NpmStarPrompt.js +454 -0
- package/dist/esm/components/Inspector/PerformanceTab.js +8 -1
- package/dist/esm/components/Inspector/ReduxTab.js +1 -23
- package/dist/esm/components/Inspector/SettingsPanel.js +1038 -176
- package/dist/esm/components/Inspector/StorageTab.js +0 -23
- package/dist/esm/components/Inspector/TabBar.js +50 -15
- package/dist/esm/components/NetworkIcons.d.ts +5 -0
- package/dist/esm/components/NetworkIcons.js +26 -0
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/helpers/remoteConfig.d.ts +4 -0
- package/dist/esm/helpers/remoteConfig.js +160 -0
- package/dist/esm/helpers/searchQueryParser.js +2 -0
- package/dist/esm/helpers/telemetry.d.ts +5 -0
- package/dist/esm/helpers/telemetry.js +332 -9
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +30 -2
- package/dist/esm/styles/AppFonts.d.ts +2 -0
- package/dist/esm/styles/AppFonts.js +1 -0
- package/dist/esm/styles/index.d.ts +22 -0
- package/dist/esm/styles/index.js +19 -0
- package/dist/esm/types/enums.d.ts +1 -0
- package/dist/esm/types/enums.js +1 -0
- package/dist/esm/types/interfaces.d.ts +12 -0
- package/package.json +1 -1
- package/src/components/Inspector/AnalyticsTab.tsx +0 -23
- package/src/components/Inspector/ConsoleTab.tsx +0 -23
- package/src/components/Inspector/CrashTab.tsx +0 -23
- package/src/components/Inspector/FeedbackModal.tsx +626 -0
- package/src/components/Inspector/InspectorHeader.tsx +78 -2
- package/src/components/Inspector/MainScreen.tsx +59 -3
- package/src/components/Inspector/NetworkTab.tsx +69 -78
- package/src/components/Inspector/NpmStarPrompt.tsx +532 -0
- package/src/components/Inspector/PerformanceTab.tsx +8 -1
- package/src/components/Inspector/ReduxTab.tsx +0 -23
- package/src/components/Inspector/SettingsPanel.tsx +1162 -197
- package/src/components/Inspector/StorageTab.tsx +0 -23
- package/src/components/Inspector/TabBar.tsx +57 -20
- package/src/components/NetworkIcons.tsx +92 -0
- package/src/constants/version.ts +1 -1
- package/src/helpers/index.ts +1 -0
- package/src/helpers/remoteConfig.ts +212 -0
- package/src/helpers/searchQueryParser.ts +3 -0
- package/src/helpers/telemetry.ts +381 -10
- package/src/index.tsx +42 -0
- package/src/styles/AppFonts.ts +2 -0
- package/src/styles/index.ts +20 -1
- package/src/types/enums.ts +1 -0
- package/src/types/interfaces.ts +12 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
|
2
2
|
import { View, Text, ScrollView, FlatList, TextInput, Modal, Alert, StyleSheet, ActivityIndicator, Platform, } from 'react-native';
|
|
3
3
|
import TouchableScale from '../TouchableScale';
|
|
4
|
-
import globalStyles from '../../styles';
|
|
5
4
|
import { AppColors } from '../../styles/AppColors';
|
|
6
5
|
import { AppFonts } from '../../styles/AppFonts';
|
|
7
6
|
import { useTranslation } from '../../i18n';
|
|
@@ -397,28 +396,6 @@ export const StorageTab = React.memo(() => {
|
|
|
397
396
|
</Text>
|
|
398
397
|
</TouchableScale>)}
|
|
399
398
|
</View>} ListFooterComponent={<View style={{ height: 60 }}/>}/>
|
|
400
|
-
|
|
401
|
-
<TouchableScale onPress={() => {
|
|
402
|
-
try {
|
|
403
|
-
listRef.current?.scrollToOffset({
|
|
404
|
-
offset: 0,
|
|
405
|
-
animated: true,
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
catch {
|
|
409
|
-
try {
|
|
410
|
-
listRef.current?.scrollToIndex({
|
|
411
|
-
index: 0,
|
|
412
|
-
animated: true,
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
catch { }
|
|
416
|
-
}
|
|
417
|
-
}} hitSlop={12} style={globalStyles.scrollTopBtn}>
|
|
418
|
-
<View style={{ transform: [{ rotate: '180deg' }] }}>
|
|
419
|
-
<ChevronIcon color={AppColors.white} size={18}/>
|
|
420
|
-
</View>
|
|
421
|
-
</TouchableScale>
|
|
422
399
|
</>)}
|
|
423
400
|
|
|
424
401
|
|
|
@@ -3,6 +3,7 @@ import { Animated, Platform, ScrollView, Text, View, } from 'react-native';
|
|
|
3
3
|
import { useInspector } from './InspectorContext';
|
|
4
4
|
import styles from '../../styles';
|
|
5
5
|
import { AppColors } from '../../styles/AppColors';
|
|
6
|
+
import { AppFonts } from '../../styles/AppFonts';
|
|
6
7
|
import TouchableScale from '../TouchableScale';
|
|
7
8
|
import { SignalIcon, TerminalIcon, AnalyticsIcon, PackageIcon, ReduxIcon, PerformanceIcon, CrashIcon, SmartphoneIcon, DatabaseIcon, QrCodeIcon, } from '../NetworkIcons';
|
|
8
9
|
import { isReduxConnected } from '../../customHooks/reduxLogger';
|
|
@@ -16,60 +17,70 @@ const TabBar = React.memo(() => {
|
|
|
16
17
|
<ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={{ paddingRight: 16 }}>
|
|
17
18
|
{[
|
|
18
19
|
{
|
|
20
|
+
id: 1,
|
|
19
21
|
key: 'apis',
|
|
20
22
|
label: 'APIs',
|
|
21
23
|
count: logs.length,
|
|
22
24
|
icon: 'apis',
|
|
23
25
|
},
|
|
24
26
|
{
|
|
27
|
+
id: 2,
|
|
25
28
|
key: 'logs',
|
|
26
29
|
label: 'Logs',
|
|
27
30
|
count: consoleLogs.length,
|
|
28
31
|
icon: 'logs',
|
|
29
32
|
},
|
|
30
33
|
{
|
|
34
|
+
id: 3,
|
|
31
35
|
key: 'analytics',
|
|
32
36
|
label: 'Analytics',
|
|
33
37
|
count: analyticsEvents.length,
|
|
34
38
|
icon: 'analytics',
|
|
35
39
|
},
|
|
36
40
|
{
|
|
41
|
+
id: 4,
|
|
37
42
|
key: 'redux',
|
|
38
43
|
label: 'Redux',
|
|
39
44
|
count: 0,
|
|
40
45
|
icon: 'redux',
|
|
41
46
|
},
|
|
42
47
|
{
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
id: 5,
|
|
49
|
+
key: 'storage',
|
|
50
|
+
label: 'Storage',
|
|
45
51
|
count: 0,
|
|
46
|
-
icon: '
|
|
52
|
+
icon: 'storage',
|
|
47
53
|
},
|
|
48
54
|
{
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
id: 6,
|
|
56
|
+
key: 'device',
|
|
57
|
+
label: 'Device',
|
|
51
58
|
count: 0,
|
|
52
|
-
icon: '
|
|
59
|
+
icon: 'device',
|
|
53
60
|
},
|
|
54
61
|
{
|
|
62
|
+
id: 7,
|
|
55
63
|
key: 'crash',
|
|
56
64
|
label: 'Crash',
|
|
57
65
|
count: crashRecords?.length || 0,
|
|
58
66
|
icon: 'crash',
|
|
59
67
|
},
|
|
60
68
|
{
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
id: 8,
|
|
70
|
+
key: 'bundle',
|
|
71
|
+
label: 'Bundle',
|
|
63
72
|
count: 0,
|
|
64
|
-
icon: '
|
|
73
|
+
icon: 'bundle',
|
|
65
74
|
},
|
|
66
75
|
{
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
id: 9,
|
|
77
|
+
key: 'performance',
|
|
78
|
+
label: 'Performance',
|
|
69
79
|
count: 0,
|
|
70
|
-
icon: '
|
|
80
|
+
icon: 'performance',
|
|
71
81
|
},
|
|
72
82
|
{
|
|
83
|
+
id: 10,
|
|
73
84
|
key: 'debugging',
|
|
74
85
|
label: 'Debugging',
|
|
75
86
|
count: 0,
|
|
@@ -119,12 +130,36 @@ const TabBar = React.memo(() => {
|
|
|
119
130
|
{tab.icon === 'logs' && (<TerminalIcon color={iconColor} size={14}/>)}
|
|
120
131
|
{tab.icon === 'analytics' && (<AnalyticsIcon color={iconColor} size={14}/>)}
|
|
121
132
|
{tab.icon === 'redux' && (<ReduxIcon color={iconColor} size={14}/>)}
|
|
133
|
+
{tab.icon === 'storage' && (<DatabaseIcon color={iconColor} size={14}/>)}
|
|
134
|
+
{tab.icon === 'device' && (<SmartphoneIcon color={iconColor} size={14}/>)}
|
|
135
|
+
{tab.icon === 'crash' && (<CrashIcon color={iconColor} size={14}/>)}
|
|
122
136
|
{tab.icon === 'bundle' && (<PackageIcon color={iconColor} size={14}/>)}
|
|
123
137
|
{tab.icon === 'performance' && (<PerformanceIcon color={iconColor} size={14}/>)}
|
|
124
|
-
{tab.icon === 'crash' && (<CrashIcon color={iconColor} size={14}/>)}
|
|
125
|
-
{tab.icon === 'device' && (<SmartphoneIcon color={iconColor} size={14}/>)}
|
|
126
|
-
{tab.icon === 'storage' && (<DatabaseIcon color={iconColor} size={14}/>)}
|
|
127
138
|
{tab.icon === 'debugging' && (<QrCodeIcon color={iconColor} size={14}/>)}
|
|
139
|
+
<View style={{
|
|
140
|
+
minWidth: 20,
|
|
141
|
+
height: 20,
|
|
142
|
+
paddingHorizontal: 4,
|
|
143
|
+
borderRadius: 10,
|
|
144
|
+
backgroundColor: isActive
|
|
145
|
+
? `${AppColors.white}33`
|
|
146
|
+
: `${AppColors.purple}1F`,
|
|
147
|
+
borderWidth: 1,
|
|
148
|
+
borderColor: isActive
|
|
149
|
+
? `${AppColors.white}66`
|
|
150
|
+
: `${AppColors.purple}40`,
|
|
151
|
+
alignItems: 'center',
|
|
152
|
+
justifyContent: 'center',
|
|
153
|
+
}}>
|
|
154
|
+
<Text style={{
|
|
155
|
+
fontFamily: AppFonts.interBold,
|
|
156
|
+
fontSize: 9.5,
|
|
157
|
+
lineHeight: 12,
|
|
158
|
+
color: isActive ? AppColors.white : AppColors.purple,
|
|
159
|
+
}}>
|
|
160
|
+
#{tab.id}
|
|
161
|
+
</Text>
|
|
162
|
+
</View>
|
|
128
163
|
<Text numberOfLines={1} ellipsizeMode="tail" style={[
|
|
129
164
|
styles.contentTabButtonText,
|
|
130
165
|
isActive &&
|
|
@@ -91,6 +91,7 @@ export declare const CartIcon: ({ color, size }: IconProps) => React.JSX.Element
|
|
|
91
91
|
export declare const MoneyIcon: ({ color, size }: IconProps) => React.JSX.Element;
|
|
92
92
|
export declare const ExternalLinkIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
93
93
|
export declare const PackageBoxIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
94
|
+
export declare const StarIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
94
95
|
export declare const GitHubIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
95
96
|
export declare const LinkChainIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
96
97
|
export declare const AppleIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
@@ -138,3 +139,7 @@ export declare const QrCodeIcon: ({ color, size, }: IconProps) => React.JSX.Elem
|
|
|
138
139
|
export declare const UnlockIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
139
140
|
export declare const RocketIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
140
141
|
export declare const TurtleIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
142
|
+
export declare const HeadphonesIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
143
|
+
export declare const HelpCircleIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
144
|
+
export declare const SendIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
145
|
+
export declare const LifeBuoyIcon: ({ color, size, }: IconProps) => React.JSX.Element;
|
|
@@ -510,6 +510,11 @@ export const PackageBoxIcon = ({ color = AppColors.grayTextWeak, size = 14, }) =
|
|
|
510
510
|
<Path d="M3.27 6.96L12 12.01l8.73-5.05M12 22.08V12" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
511
511
|
</Svg>);
|
|
512
512
|
};
|
|
513
|
+
export const StarIcon = ({ color = '#F59E0B', size = 14, }) => {
|
|
514
|
+
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill={color}>
|
|
515
|
+
<Path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" stroke={color} strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
516
|
+
</Svg>);
|
|
517
|
+
};
|
|
513
518
|
export const GitHubIcon = ({ color = AppColors.grayTextWeak, size = 14, }) => {
|
|
514
519
|
return (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
515
520
|
<Path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22" stroke={color} strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
@@ -760,3 +765,24 @@ export const TurtleIcon = ({ color = AppColors.grayTextWeak, size = 14, }) => (<
|
|
|
760
765
|
<Circle cx="12" cy="6" r="3" stroke={color} strokeWidth="2"/>
|
|
761
766
|
<Path d="M5 12l-2-2M19 12l2-2M6 18l-2 2M18 18l2 2" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
762
767
|
</Svg>);
|
|
768
|
+
export const HeadphonesIcon = ({ color = AppColors.white, size = 20, }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
769
|
+
<Path d="M3 18v-6a9 9 0 0 1 18 0v6" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
770
|
+
<Path d="M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3v5zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3v5z" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
771
|
+
</Svg>);
|
|
772
|
+
export const HelpCircleIcon = ({ color = AppColors.white, size = 20, }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
773
|
+
<Circle cx="12" cy="12" r="10" stroke={color} strokeWidth="2"/>
|
|
774
|
+
<Path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
775
|
+
<Line x1="12" y1="17" x2="12.01" y2="17" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
776
|
+
</Svg>);
|
|
777
|
+
export const SendIcon = ({ color = AppColors.white, size = 18, }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
778
|
+
<Path d="M22 2L11 13" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
779
|
+
<Path d="M22 2L15 22L11 13L2 9L22 2Z" stroke={color} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
780
|
+
</Svg>);
|
|
781
|
+
export const LifeBuoyIcon = ({ color = AppColors.white, size = 20, }) => (<Svg width={size} height={size} viewBox="0 0 24 24" fill="none">
|
|
782
|
+
<Circle cx="12" cy="12" r="10" stroke={color} strokeWidth="2"/>
|
|
783
|
+
<Circle cx="12" cy="12" r="4" stroke={color} strokeWidth="2"/>
|
|
784
|
+
<Line x1="4.93" y1="4.93" x2="9.17" y2="9.17" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
785
|
+
<Line x1="14.83" y1="9.17" x2="19.07" y2="4.93" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
786
|
+
<Line x1="14.83" y1="14.83" x2="19.07" y2="19.07" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
787
|
+
<Line x1="4.93" y1="19.07" x2="9.17" y2="14.83" stroke={color} strokeWidth="2" strokeLinecap="round"/>
|
|
788
|
+
</Svg>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "2.3.
|
|
1
|
+
export declare const LIB_VERSION = "2.3.16";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = '2.3.
|
|
1
|
+
export const LIB_VERSION = '2.3.16';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NetworkLog, RouteInfo, DiffResult, JsonContent, StackFrameType } from '../types';
|
|
2
2
|
export * from './searchQueryParser';
|
|
3
3
|
export * from './memoryManager';
|
|
4
|
+
export * from './toast';
|
|
4
5
|
export declare const isLocalDebugEnvironment: () => boolean;
|
|
5
6
|
export declare const getDomainColor: (domain: string) => string;
|
|
6
7
|
export declare const formatDateTime: (timestamp: number) => string;
|
|
@@ -5,6 +5,7 @@ import { AppColors } from '../styles/AppColors';
|
|
|
5
5
|
import { DOMAIN_COLORS, DURATION_FAST_MS, DURATION_SLOW_MS } from '../constants';
|
|
6
6
|
export * from './searchQueryParser';
|
|
7
7
|
export * from './memoryManager';
|
|
8
|
+
export * from './toast';
|
|
8
9
|
export const isLocalDebugEnvironment = () => {
|
|
9
10
|
const isDev = typeof __DEV__ !== 'undefined' && Boolean(__DEV__);
|
|
10
11
|
const scriptURL = NativeModules.SourceCode?.scriptURL || '';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ActiveTab } from '../types';
|
|
2
|
+
export declare function getFirebaseRemoteConfig(customInstance?: any): any;
|
|
3
|
+
export declare function isFirebaseRemoteConfigAvailable(customInstance?: any): boolean;
|
|
4
|
+
export declare function fetchRemoteConfigModuleStatus(customInstance?: any, fetchTimeoutMs?: number): Promise<Partial<Record<ActiveTab, boolean>> | null>;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
const MODULE_KEYS = [
|
|
2
|
+
'apis',
|
|
3
|
+
'logs',
|
|
4
|
+
'analytics',
|
|
5
|
+
'redux',
|
|
6
|
+
'storage',
|
|
7
|
+
'device',
|
|
8
|
+
'crash',
|
|
9
|
+
'bundle',
|
|
10
|
+
'performance',
|
|
11
|
+
'debugging',
|
|
12
|
+
];
|
|
13
|
+
let cachedRemoteConfigInstance = null;
|
|
14
|
+
export function getFirebaseRemoteConfig(customInstance) {
|
|
15
|
+
if (customInstance && typeof customInstance === 'object') {
|
|
16
|
+
cachedRemoteConfigInstance = customInstance;
|
|
17
|
+
return customInstance;
|
|
18
|
+
}
|
|
19
|
+
if (cachedRemoteConfigInstance) {
|
|
20
|
+
return cachedRemoteConfigInstance;
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
const rcModule = require('@react-native-firebase/remote-config');
|
|
24
|
+
const instance = typeof rcModule.default === 'function'
|
|
25
|
+
? rcModule.default()
|
|
26
|
+
: typeof rcModule === 'function'
|
|
27
|
+
? rcModule()
|
|
28
|
+
: rcModule;
|
|
29
|
+
cachedRemoteConfigInstance = instance;
|
|
30
|
+
return instance;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function isFirebaseRemoteConfigAvailable(customInstance) {
|
|
37
|
+
return Boolean(getFirebaseRemoteConfig(customInstance));
|
|
38
|
+
}
|
|
39
|
+
function extractValue(val) {
|
|
40
|
+
if (val === null || val === undefined)
|
|
41
|
+
return undefined;
|
|
42
|
+
if (typeof val === 'boolean')
|
|
43
|
+
return val;
|
|
44
|
+
if (typeof val === 'number')
|
|
45
|
+
return val !== 0;
|
|
46
|
+
if (typeof val === 'string') {
|
|
47
|
+
const lower = val.trim().toLowerCase();
|
|
48
|
+
if (lower === 'true' || lower === '1' || lower === 'enabled' || lower === 'on')
|
|
49
|
+
return true;
|
|
50
|
+
if (lower === 'false' || lower === '0' || lower === 'disabled' || lower === 'off')
|
|
51
|
+
return false;
|
|
52
|
+
try {
|
|
53
|
+
return JSON.parse(val);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (typeof val.asBoolean === 'function') {
|
|
60
|
+
return val.asBoolean();
|
|
61
|
+
}
|
|
62
|
+
if (typeof val.asString === 'function') {
|
|
63
|
+
const str = val.asString();
|
|
64
|
+
const lower = str.trim().toLowerCase();
|
|
65
|
+
if (lower === 'true' || lower === '1' || lower === 'enabled' || lower === 'on')
|
|
66
|
+
return true;
|
|
67
|
+
if (lower === 'false' || lower === '0' || lower === 'disabled' || lower === 'off')
|
|
68
|
+
return false;
|
|
69
|
+
try {
|
|
70
|
+
return JSON.parse(str);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
export async function fetchRemoteConfigModuleStatus(customInstance, fetchTimeoutMs = 8000) {
|
|
79
|
+
const rc = getFirebaseRemoteConfig(customInstance);
|
|
80
|
+
if (!rc) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const fetchPromise = (async () => {
|
|
85
|
+
if (typeof rc.fetchAndActivate === 'function') {
|
|
86
|
+
await rc.fetchAndActivate();
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
if (typeof rc.fetch === 'function') {
|
|
90
|
+
await rc.fetch();
|
|
91
|
+
}
|
|
92
|
+
if (typeof rc.activate === 'function') {
|
|
93
|
+
await rc.activate();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
})();
|
|
97
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error('Remote Config fetch timeout')), fetchTimeoutMs));
|
|
98
|
+
await Promise.race([fetchPromise, timeoutPromise]).catch(() => {
|
|
99
|
+
});
|
|
100
|
+
const result = {};
|
|
101
|
+
const jsonKeys = [
|
|
102
|
+
'inspector_modules',
|
|
103
|
+
'inapp_inspector_modules',
|
|
104
|
+
'react_native_inapp_inspector_modules',
|
|
105
|
+
];
|
|
106
|
+
for (const jKey of jsonKeys) {
|
|
107
|
+
let rawVal;
|
|
108
|
+
if (typeof rc.getValue === 'function') {
|
|
109
|
+
try {
|
|
110
|
+
rawVal = rc.getValue(jKey);
|
|
111
|
+
}
|
|
112
|
+
catch { }
|
|
113
|
+
}
|
|
114
|
+
else if (rc[jKey] !== undefined) {
|
|
115
|
+
rawVal = rc[jKey];
|
|
116
|
+
}
|
|
117
|
+
const parsed = extractValue(rawVal);
|
|
118
|
+
if (parsed && typeof parsed === 'object') {
|
|
119
|
+
for (const modKey of MODULE_KEYS) {
|
|
120
|
+
if (typeof parsed[modKey] === 'boolean') {
|
|
121
|
+
result[modKey] = parsed[modKey];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
for (const modKey of MODULE_KEYS) {
|
|
127
|
+
const paramKeys = [
|
|
128
|
+
`inspector_module_${modKey}`,
|
|
129
|
+
`inapp_inspector_${modKey}`,
|
|
130
|
+
`inspector_${modKey}`,
|
|
131
|
+
`inapp_inspector_module_${modKey}`,
|
|
132
|
+
`rn_inspector_${modKey}`,
|
|
133
|
+
];
|
|
134
|
+
for (const pKey of paramKeys) {
|
|
135
|
+
let rawVal;
|
|
136
|
+
if (typeof rc.getValue === 'function') {
|
|
137
|
+
try {
|
|
138
|
+
rawVal = rc.getValue(pKey);
|
|
139
|
+
}
|
|
140
|
+
catch { }
|
|
141
|
+
}
|
|
142
|
+
else if (rc[pKey] !== undefined) {
|
|
143
|
+
rawVal = rc[pKey];
|
|
144
|
+
}
|
|
145
|
+
const boolVal = extractValue(rawVal);
|
|
146
|
+
if (typeof boolVal === 'boolean') {
|
|
147
|
+
result[modKey] = boolVal;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (result.apis === undefined) {
|
|
153
|
+
result.apis = true;
|
|
154
|
+
}
|
|
155
|
+
return Object.keys(result).length > 0 ? result : null;
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { markSearchFilterUsed } from './telemetry';
|
|
1
2
|
export function matchNetworkLogQuery(log, searchQuery, routePath, _options) {
|
|
2
3
|
if (!searchQuery || searchQuery.trim().length === 0)
|
|
3
4
|
return true;
|
|
5
|
+
markSearchFilterUsed();
|
|
4
6
|
const rawTokens = searchQuery.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
5
7
|
if (rawTokens.length === 0)
|
|
6
8
|
return true;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare function setTelemetryEnabled(enabled: boolean): void;
|
|
2
|
+
export declare function markSearchFilterUsed(): void;
|
|
2
3
|
export declare function trackActiveTelemetryHeartbeat(telemetryEnabled?: boolean, environment?: string): Promise<void>;
|
|
4
|
+
export declare function trackTelemetryEvent(eventName: string, eventParams?: Record<string, any>): Promise<void>;
|
|
5
|
+
export declare function trackInspectorTabView(tabName: string): void;
|
|
6
|
+
export declare function trackInspectorScreenView(screenName: string): void;
|
|
7
|
+
export declare function trackInspectorScreenRecord(action: 'start' | 'stop' | 'toggle', recordingType?: string): void;
|