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.
Files changed (95) hide show
  1. package/README.md +10 -0
  2. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  3. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  4. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  5. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  6. package/android/.gradle/8.9/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  8. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  9. package/android/.gradle/8.9/gc.properties +0 -0
  10. package/android/.gradle/9.2.0/checksums/checksums.lock +0 -0
  11. package/android/.gradle/9.2.0/fileChanges/last-build.bin +0 -0
  12. package/android/.gradle/9.2.0/fileHashes/fileHashes.bin +0 -0
  13. package/android/.gradle/9.2.0/fileHashes/fileHashes.lock +0 -0
  14. package/android/.gradle/9.2.0/gc.properties +0 -0
  15. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  16. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  17. package/android/.gradle/vcs-1/gc.properties +0 -0
  18. package/android/build/reports/problems/problems-report.html +659 -0
  19. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +33 -24
  20. package/dist/commonjs/components/ConsoleLogCard.js +5 -5
  21. package/dist/commonjs/components/EndOfListFooter.js +1 -1
  22. package/dist/commonjs/components/Inspector/AnalyticsTab.js +19 -71
  23. package/dist/commonjs/components/Inspector/BundleTab.js +670 -188
  24. package/dist/commonjs/components/Inspector/ConsoleTab.js +109 -98
  25. package/dist/commonjs/components/Inspector/CrashTab.js +2 -1
  26. package/dist/commonjs/components/Inspector/InspectorHeader.js +102 -19
  27. package/dist/commonjs/components/Inspector/MainScreen.js +151 -17
  28. package/dist/commonjs/components/Inspector/NetworkTab.js +104 -20
  29. package/dist/commonjs/components/Inspector/SettingsPanel.js +1111 -1385
  30. package/dist/commonjs/components/Inspector/TabBar.js +3 -4
  31. package/dist/commonjs/components/Inspector/TelemetryConsentModal.d.ts +3 -0
  32. package/dist/commonjs/components/Inspector/TelemetryConsentModal.js +212 -0
  33. package/dist/commonjs/components/JsonViewer.js +9 -4
  34. package/dist/commonjs/components/LogCard.js +31 -1
  35. package/dist/commonjs/components/LogSyntaxHighlighter.d.ts +16 -0
  36. package/dist/commonjs/components/LogSyntaxHighlighter.js +130 -0
  37. package/dist/commonjs/components/NetworkIcons.d.ts +2 -0
  38. package/dist/commonjs/components/NetworkIcons.js +10 -1
  39. package/dist/commonjs/components/Slider.d.ts +13 -0
  40. package/dist/commonjs/components/Slider.js +261 -0
  41. package/dist/commonjs/constants/version.d.ts +1 -1
  42. package/dist/commonjs/constants/version.js +1 -1
  43. package/dist/commonjs/customHooks/analyticsLogger.js +1 -1
  44. package/dist/commonjs/customHooks/crashHandler.js +1 -1
  45. package/dist/commonjs/helpers/index.d.ts +2 -0
  46. package/dist/commonjs/helpers/index.js +16 -0
  47. package/dist/commonjs/helpers/searchQueryParser.d.ts +6 -0
  48. package/dist/commonjs/helpers/searchQueryParser.js +236 -0
  49. package/dist/commonjs/helpers/settingsStore.js +13 -13
  50. package/dist/commonjs/helpers/telemetry.d.ts +99 -0
  51. package/dist/commonjs/helpers/telemetry.js +398 -0
  52. package/dist/commonjs/index.d.ts +2 -0
  53. package/dist/commonjs/index.js +30 -21
  54. package/dist/commonjs/native/NativeInspector.d.ts +5 -0
  55. package/dist/commonjs/native/NativeInspector.js +3 -2
  56. package/dist/commonjs/styles/index.js +35 -35
  57. package/dist/esm/components/ConsoleLogCard.js +5 -5
  58. package/dist/esm/components/EndOfListFooter.js +2 -2
  59. package/dist/esm/components/Inspector/AnalyticsTab.js +21 -73
  60. package/dist/esm/components/Inspector/BundleTab.js +670 -188
  61. package/dist/esm/components/Inspector/ConsoleTab.js +110 -99
  62. package/dist/esm/components/Inspector/CrashTab.js +2 -1
  63. package/dist/esm/components/Inspector/InspectorHeader.js +103 -20
  64. package/dist/esm/components/Inspector/MainScreen.js +119 -18
  65. package/dist/esm/components/Inspector/NetworkTab.js +105 -21
  66. package/dist/esm/components/Inspector/SettingsPanel.js +1114 -1388
  67. package/dist/esm/components/Inspector/TabBar.js +4 -5
  68. package/dist/esm/components/Inspector/TelemetryConsentModal.d.ts +3 -0
  69. package/dist/esm/components/Inspector/TelemetryConsentModal.js +175 -0
  70. package/dist/esm/components/JsonViewer.js +9 -4
  71. package/dist/esm/components/LogCard.js +32 -2
  72. package/dist/esm/components/LogSyntaxHighlighter.d.ts +16 -0
  73. package/dist/esm/components/LogSyntaxHighlighter.js +123 -0
  74. package/dist/esm/components/NetworkIcons.d.ts +2 -0
  75. package/dist/esm/components/NetworkIcons.js +7 -0
  76. package/dist/esm/components/Slider.d.ts +13 -0
  77. package/dist/esm/components/Slider.js +222 -0
  78. package/dist/esm/constants/version.d.ts +1 -1
  79. package/dist/esm/constants/version.js +1 -1
  80. package/dist/esm/customHooks/analyticsLogger.js +1 -1
  81. package/dist/esm/customHooks/crashHandler.js +1 -1
  82. package/dist/esm/helpers/index.d.ts +2 -0
  83. package/dist/esm/helpers/index.js +2 -0
  84. package/dist/esm/helpers/searchQueryParser.d.ts +6 -0
  85. package/dist/esm/helpers/searchQueryParser.js +233 -0
  86. package/dist/esm/helpers/settingsStore.js +13 -13
  87. package/dist/esm/helpers/telemetry.d.ts +99 -0
  88. package/dist/esm/helpers/telemetry.js +380 -0
  89. package/dist/esm/index.d.ts +2 -0
  90. package/dist/esm/index.js +20 -21
  91. package/dist/esm/native/NativeInspector.d.ts +5 -0
  92. package/dist/esm/native/NativeInspector.js +3 -2
  93. package/dist/esm/styles/index.js +35 -35
  94. package/ios/{NetworkInspectorModule.m → NetworkInspectorModule.mm} +193 -97
  95. package/package.json +2 -2
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Slider = void 0;
40
+ const react_1 = __importStar(require("react"));
41
+ const react_native_1 = require("react-native");
42
+ const AppColors_1 = require("../styles/AppColors");
43
+ const AppFonts_1 = require("../styles/AppFonts");
44
+ const TouchableScale_1 = __importDefault(require("./TouchableScale"));
45
+ exports.Slider = react_1.default.memo(({ value, onValueChange, min = 50, max = 90, step = 5, formatLabel = val => `${Math.round(val)}%`, quickPresets = [50, 60, 70, 80, 90], disabled = false, }) => {
46
+ const trackWidthRef = (0, react_1.useRef)(0);
47
+ const [trackWidth, setTrackWidth] = (0, react_1.useState)(0);
48
+ const [isDragging, setIsDragging] = (0, react_1.useState)(false);
49
+ const clampedValue = Math.max(min, Math.min(max, value));
50
+ const percentage = (clampedValue - min) / (max - min || 1);
51
+ const updateValueFromPosition = (0, react_1.useCallback)((pageX, trackPageX) => {
52
+ if (trackWidthRef.current <= 0)
53
+ return;
54
+ const relativeX = Math.max(0, Math.min(trackWidthRef.current, pageX - trackPageX));
55
+ const rawRatio = relativeX / trackWidthRef.current;
56
+ let newValue = min + rawRatio * (max - min);
57
+ if (step > 0) {
58
+ newValue = Math.round(newValue / step) * step;
59
+ }
60
+ newValue = Math.max(min, Math.min(max, newValue));
61
+ onValueChange(newValue);
62
+ }, [min, max, step, onValueChange]);
63
+ const trackContainerRef = (0, react_1.useRef)(null);
64
+ const trackPageXRef = (0, react_1.useRef)(0);
65
+ const measureTrack = (0, react_1.useCallback)(() => {
66
+ if (trackContainerRef.current) {
67
+ trackContainerRef.current.measure((_x, _y, _width, _height, pageX) => {
68
+ trackPageXRef.current = pageX;
69
+ });
70
+ }
71
+ }, []);
72
+ const panResponder = (0, react_1.useMemo)(() => react_native_1.PanResponder.create({
73
+ onStartShouldSetPanResponder: () => !disabled,
74
+ onMoveShouldSetPanResponder: () => !disabled,
75
+ onPanResponderGrant: (evt) => {
76
+ setIsDragging(true);
77
+ measureTrack();
78
+ updateValueFromPosition(evt.nativeEvent.pageX, trackPageXRef.current);
79
+ },
80
+ onPanResponderMove: (evt, _gestureState) => {
81
+ updateValueFromPosition(evt.nativeEvent.pageX, trackPageXRef.current);
82
+ },
83
+ onPanResponderRelease: () => {
84
+ setIsDragging(false);
85
+ },
86
+ onPanResponderTerminate: () => {
87
+ setIsDragging(false);
88
+ },
89
+ }), [disabled, measureTrack, updateValueFromPosition]);
90
+ const handleLayout = (e) => {
91
+ const w = e.nativeEvent.layout.width;
92
+ trackWidthRef.current = w;
93
+ setTrackWidth(w);
94
+ measureTrack();
95
+ };
96
+ const thumbPosition = percentage * (trackWidth || 0);
97
+ return (<react_native_1.View style={styles.container}>
98
+ {/* Value Display Row */}
99
+ <react_native_1.View style={styles.valueRow}>
100
+ <react_native_1.Text style={styles.rangeText}>{min}%</react_native_1.Text>
101
+ <react_native_1.View style={[
102
+ styles.currentValueBadge,
103
+ isDragging && styles.currentValueBadgeActive,
104
+ ]}>
105
+ <react_native_1.Text style={styles.currentValueText}>{formatLabel(clampedValue)}</react_native_1.Text>
106
+ </react_native_1.View>
107
+ <react_native_1.Text style={styles.rangeText}>{max}%</react_native_1.Text>
108
+ </react_native_1.View>
109
+
110
+ {/* Interactive Track Area */}
111
+ <react_native_1.View ref={trackContainerRef} onLayout={handleLayout} {...panResponder.panHandlers} style={styles.touchArea}>
112
+ {/* Background Rail */}
113
+ <react_native_1.View style={styles.rail}>
114
+ {/* Active Filled Bar */}
115
+ <react_native_1.View style={[
116
+ styles.fillBar,
117
+ { width: `${Math.round(percentage * 100)}%` },
118
+ ]}/>
119
+ </react_native_1.View>
120
+
121
+ {/* Draggable Thumb */}
122
+ <react_native_1.View style={[
123
+ styles.thumb,
124
+ {
125
+ left: Math.max(0, Math.min((trackWidth || 0) - 24, thumbPosition - 12)),
126
+ },
127
+ isDragging && styles.thumbActive,
128
+ ]}>
129
+ <react_native_1.View style={styles.thumbCenterDot}/>
130
+ </react_native_1.View>
131
+ </react_native_1.View>
132
+
133
+ {/* Quick Presets */}
134
+ {quickPresets && quickPresets.length > 0 && (<react_native_1.View style={styles.presetRow}>
135
+ {quickPresets.map(preset => {
136
+ const isSelected = Math.round(clampedValue) === preset;
137
+ return (<TouchableScale_1.default key={preset} onPress={() => onValueChange(preset)} style={[
138
+ styles.presetButton,
139
+ isSelected && styles.presetButtonActive,
140
+ ]}>
141
+ <react_native_1.Text style={[
142
+ styles.presetText,
143
+ isSelected && styles.presetTextActive,
144
+ ]}>
145
+ {preset}%
146
+ </react_native_1.Text>
147
+ </TouchableScale_1.default>);
148
+ })}
149
+ </react_native_1.View>)}
150
+ </react_native_1.View>);
151
+ });
152
+ const styles = react_native_1.StyleSheet.create({
153
+ container: {
154
+ paddingVertical: 4,
155
+ gap: 8,
156
+ },
157
+ valueRow: {
158
+ flexDirection: 'row',
159
+ alignItems: 'center',
160
+ justifyContent: 'space-between',
161
+ paddingHorizontal: 2,
162
+ },
163
+ rangeText: {
164
+ fontFamily: AppFonts_1.AppFonts.interMedium,
165
+ fontSize: 11,
166
+ color: AppColors_1.AppColors.grayText,
167
+ },
168
+ currentValueBadge: {
169
+ backgroundColor: `${AppColors_1.AppColors.purple}1A`,
170
+ borderColor: `${AppColors_1.AppColors.purple}33`,
171
+ borderWidth: 1,
172
+ borderRadius: 8,
173
+ paddingHorizontal: 10,
174
+ paddingVertical: 2.5,
175
+ },
176
+ currentValueBadgeActive: {
177
+ backgroundColor: AppColors_1.AppColors.purple,
178
+ borderColor: AppColors_1.AppColors.purple,
179
+ transform: [{ scale: 1.05 }],
180
+ },
181
+ currentValueText: {
182
+ fontFamily: AppFonts_1.AppFonts.interBold,
183
+ fontSize: 12,
184
+ color: AppColors_1.AppColors.purple,
185
+ },
186
+ touchArea: {
187
+ height: 36,
188
+ justifyContent: 'center',
189
+ position: 'relative',
190
+ },
191
+ rail: {
192
+ height: 8,
193
+ backgroundColor: `${AppColors_1.AppColors.grayTextWeak}2B`,
194
+ borderRadius: 4,
195
+ overflow: 'hidden',
196
+ position: 'relative',
197
+ },
198
+ fillBar: {
199
+ height: '100%',
200
+ backgroundColor: AppColors_1.AppColors.purple,
201
+ borderRadius: 4,
202
+ },
203
+ thumb: {
204
+ position: 'absolute',
205
+ width: 24,
206
+ height: 24,
207
+ borderRadius: 12,
208
+ backgroundColor: AppColors_1.AppColors.white,
209
+ borderWidth: 2.5,
210
+ borderColor: AppColors_1.AppColors.purple,
211
+ alignItems: 'center',
212
+ justifyContent: 'center',
213
+ shadowColor: AppColors_1.AppColors.black,
214
+ shadowOffset: { width: 0, height: 2 },
215
+ shadowOpacity: 0.18,
216
+ shadowRadius: 3.5,
217
+ elevation: 4,
218
+ },
219
+ thumbActive: {
220
+ transform: [{ scale: 1.15 }],
221
+ shadowOpacity: 0.28,
222
+ shadowRadius: 5,
223
+ elevation: 6,
224
+ borderColor: AppColors_1.AppColors.purple,
225
+ },
226
+ thumbCenterDot: {
227
+ width: 6,
228
+ height: 6,
229
+ borderRadius: 3,
230
+ backgroundColor: AppColors_1.AppColors.purple,
231
+ },
232
+ presetRow: {
233
+ flexDirection: 'row',
234
+ alignItems: 'center',
235
+ justifyContent: 'space-between',
236
+ gap: 8,
237
+ marginTop: 2,
238
+ },
239
+ presetButton: {
240
+ flex: 1,
241
+ paddingVertical: 5,
242
+ borderRadius: 7,
243
+ alignItems: 'center',
244
+ backgroundColor: AppColors_1.AppColors.grayBackground,
245
+ borderWidth: 1,
246
+ borderColor: AppColors_1.AppColors.dividerColor,
247
+ },
248
+ presetButtonActive: {
249
+ backgroundColor: `${AppColors_1.AppColors.purple}20`,
250
+ borderColor: AppColors_1.AppColors.purple,
251
+ },
252
+ presetText: {
253
+ fontFamily: AppFonts_1.AppFonts.interBold,
254
+ fontSize: 10.5,
255
+ color: AppColors_1.AppColors.grayText,
256
+ },
257
+ presetTextActive: {
258
+ color: AppColors_1.AppColors.purple,
259
+ },
260
+ });
261
+ exports.default = exports.Slider;
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "2.0.0";
1
+ export declare const LIB_VERSION = "2.0.2";
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LIB_VERSION = void 0;
4
4
  // AUTO-GENERATED FILE — do not edit by hand.
5
5
  // Regenerated from package.json on every build by scripts/gen-version.js.
6
- exports.LIB_VERSION = '2.0.0';
6
+ exports.LIB_VERSION = '2.0.2';
@@ -48,7 +48,7 @@ const addEvent = (event) => {
48
48
  if (!isAnalyticsModuleEnabled)
49
49
  return;
50
50
  events.unshift(event);
51
- events = events.slice(0, 200);
51
+ events = events.slice(0, 75);
52
52
  notify();
53
53
  };
54
54
  // ─── Public subscribe / query API ────────────────────────────────────────────
@@ -13,7 +13,7 @@ let lastHandledErrorTimestamp = 0;
13
13
  let crashRecordsStore = [];
14
14
  let breadcrumbsStore = [];
15
15
  const MAX_BREADCRUMBS = 50;
16
- let maxStoredCrashes = 100;
16
+ let maxStoredCrashes = 50;
17
17
  const appStartTime = Date.now();
18
18
  let isCrashModuleEnabled = false;
19
19
  const setCrashModuleEnabled = (enabled) => {
@@ -1,4 +1,6 @@
1
1
  import { NetworkLog, RouteInfo, DiffResult, JsonContent, StackFrameType } from '../types';
2
+ export * from './searchQueryParser';
3
+ export * from './telemetry';
2
4
  export declare const getDomainColor: (domain: string) => string;
3
5
  export declare const formatDateTime: (timestamp: number) => string;
4
6
  export declare const formatTimestamp: (timestamp: number) => string;
@@ -1,4 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
18
  };
@@ -11,6 +25,8 @@ const toast_1 = require("./toast");
11
25
  const AppColors_1 = require("../styles/AppColors");
12
26
  // Constants
13
27
  const constants_1 = require("../constants");
28
+ __exportStar(require("./searchQueryParser"), exports);
29
+ __exportStar(require("./telemetry"), exports);
14
30
  const getDomainColor = (domain) => {
15
31
  if (!domain)
16
32
  return constants_1.DOMAIN_COLORS[0];
@@ -0,0 +1,6 @@
1
+ import { NetworkLog } from '../types';
2
+ /**
3
+ * Parses query strings like `method:POST is:error slow:>1s status:200 auth`
4
+ * and checks whether a given NetworkLog matches all tokens.
5
+ */
6
+ export declare function matchNetworkLogQuery(log: NetworkLog, searchQuery: string, routePath?: string): boolean;
@@ -0,0 +1,236 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.matchNetworkLogQuery = matchNetworkLogQuery;
4
+ /**
5
+ * Parses query strings like `method:POST is:error slow:>1s status:200 auth`
6
+ * and checks whether a given NetworkLog matches all tokens.
7
+ */
8
+ function matchNetworkLogQuery(log, searchQuery, routePath) {
9
+ if (!searchQuery || searchQuery.trim().length === 0)
10
+ return true;
11
+ const rawTokens = searchQuery
12
+ .trim()
13
+ .match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g) || [];
14
+ if (rawTokens.length === 0)
15
+ return true;
16
+ const methodStr = (log.method || '').toLowerCase();
17
+ const urlStr = (log.url || '').toLowerCase();
18
+ const statusNum = typeof log.status === 'number' ? log.status : parseInt(String(log.status || 0), 10);
19
+ const statusStr = String(log.status ?? '');
20
+ const durationNum = log.duration || 0;
21
+ const clientStr = (log.client || '').toLowerCase();
22
+ const reqStr = typeof log.request === 'string' ? log.request : JSON.stringify(log.request || '');
23
+ const resStr = typeof log.response === 'string' ? log.response : JSON.stringify(log.response || '');
24
+ const reqHeadersStr = JSON.stringify(log.requestHeaders || '').toLowerCase();
25
+ const resHeadersStr = JSON.stringify(log.responseHeaders || '').toLowerCase();
26
+ const pathStr = routePath ? routePath.toLowerCase() : '';
27
+ const fullSearchCorpus = [
28
+ methodStr,
29
+ urlStr,
30
+ statusStr,
31
+ pathStr,
32
+ clientStr,
33
+ reqStr.toLowerCase(),
34
+ resStr.toLowerCase(),
35
+ reqHeadersStr,
36
+ resHeadersStr,
37
+ ].join(' ');
38
+ for (const rawToken of rawTokens) {
39
+ const token = rawToken.replace(/^["']|["']$/g, '').trim();
40
+ if (!token)
41
+ continue;
42
+ const lowerToken = token.toLowerCase();
43
+ // 1. method:<VAL> or m:<VAL>
44
+ if (lowerToken.startsWith('method:') || lowerToken.startsWith('m:')) {
45
+ const targetMethod = lowerToken.replace(/^(method:|m:)/, '').trim();
46
+ if (targetMethod.startsWith('!')) {
47
+ if (methodStr === targetMethod.slice(1))
48
+ return false;
49
+ }
50
+ else {
51
+ if (methodStr !== targetMethod)
52
+ return false;
53
+ }
54
+ continue;
55
+ }
56
+ // 2. status:<VAL> or s:<VAL>
57
+ if (lowerToken.startsWith('status:') || lowerToken.startsWith('s:')) {
58
+ const val = lowerToken.replace(/^(status:|s:)/, '').trim();
59
+ if (val.startsWith('>=')) {
60
+ const threshold = parseInt(val.slice(2), 10);
61
+ if (isNaN(threshold) || statusNum < threshold)
62
+ return false;
63
+ }
64
+ else if (val.startsWith('>')) {
65
+ const threshold = parseInt(val.slice(1), 10);
66
+ if (isNaN(threshold) || statusNum <= threshold)
67
+ return false;
68
+ }
69
+ else if (val.startsWith('<=')) {
70
+ const threshold = parseInt(val.slice(2), 10);
71
+ if (isNaN(threshold) || statusNum > threshold)
72
+ return false;
73
+ }
74
+ else if (val.startsWith('<')) {
75
+ const threshold = parseInt(val.slice(1), 10);
76
+ if (isNaN(threshold) || statusNum >= threshold)
77
+ return false;
78
+ }
79
+ else if (val.endsWith('xx') || val.endsWith('x')) {
80
+ const prefix = val.replace(/x/g, '');
81
+ if (!statusStr.startsWith(prefix))
82
+ return false;
83
+ }
84
+ else {
85
+ const targetCode = parseInt(val, 10);
86
+ if (!isNaN(targetCode)) {
87
+ if (statusNum !== targetCode)
88
+ return false;
89
+ }
90
+ else if (!statusStr.includes(val)) {
91
+ return false;
92
+ }
93
+ }
94
+ continue;
95
+ }
96
+ // 3. is:<FLAG>
97
+ if (lowerToken.startsWith('is:')) {
98
+ const flag = lowerToken.slice(3).trim();
99
+ if (flag === 'error' || flag === 'failed' || flag === 'err' || flag === 'fail') {
100
+ const isErr = log.status === 0 || log.status == null || statusNum >= 400;
101
+ if (!isErr)
102
+ return false;
103
+ }
104
+ else if (flag === 'success' || flag === 'ok' || flag === '2xx') {
105
+ const isSuccess = statusNum >= 200 && statusNum < 300;
106
+ if (!isSuccess)
107
+ return false;
108
+ }
109
+ else if (flag === 'slow') {
110
+ if (durationNum < 1000)
111
+ return false;
112
+ }
113
+ else if (flag === 'fast') {
114
+ if (durationNum >= 200)
115
+ return false;
116
+ }
117
+ else if (flag === 'graphql' || flag === 'gql') {
118
+ const isGql = urlStr.includes('graphql') ||
119
+ clientStr === 'graphql' ||
120
+ clientStr === 'apollo';
121
+ if (!isGql)
122
+ return false;
123
+ }
124
+ else if (flag === 'https') {
125
+ if (!urlStr.startsWith('https'))
126
+ return false;
127
+ }
128
+ else if (flag === 'http') {
129
+ if (urlStr.startsWith('https') || !urlStr.startsWith('http'))
130
+ return false;
131
+ }
132
+ else if (flag === 'json') {
133
+ const isJson = reqHeadersStr.includes('application/json') ||
134
+ resHeadersStr.includes('application/json') ||
135
+ urlStr.includes('.json');
136
+ if (!isJson)
137
+ return false;
138
+ }
139
+ continue;
140
+ }
141
+ // 4. slow:<DURATION> or dur:<DURATION> or duration:<DURATION>
142
+ if (lowerToken.startsWith('slow:') ||
143
+ lowerToken.startsWith('dur:') ||
144
+ lowerToken.startsWith('duration:')) {
145
+ const val = lowerToken.replace(/^(slow:|dur:|duration:)/, '').trim();
146
+ let thresholdMs = 0;
147
+ let isGreater = true;
148
+ let cleanVal = val;
149
+ if (val.startsWith('>=')) {
150
+ isGreater = true;
151
+ cleanVal = val.slice(2);
152
+ }
153
+ else if (val.startsWith('>')) {
154
+ isGreater = true;
155
+ cleanVal = val.slice(1);
156
+ }
157
+ else if (val.startsWith('<=')) {
158
+ isGreater = false;
159
+ cleanVal = val.slice(2);
160
+ }
161
+ else if (val.startsWith('<')) {
162
+ isGreater = false;
163
+ cleanVal = val.slice(1);
164
+ }
165
+ if (cleanVal.endsWith('s') && !cleanVal.endsWith('ms')) {
166
+ thresholdMs = parseFloat(cleanVal.slice(0, -1)) * 1000;
167
+ }
168
+ else if (cleanVal.endsWith('ms')) {
169
+ thresholdMs = parseFloat(cleanVal.slice(0, -2));
170
+ }
171
+ else {
172
+ thresholdMs = parseFloat(cleanVal);
173
+ }
174
+ if (!isNaN(thresholdMs)) {
175
+ if (isGreater) {
176
+ if (durationNum < thresholdMs)
177
+ return false;
178
+ }
179
+ else {
180
+ if (durationNum > thresholdMs)
181
+ return false;
182
+ }
183
+ }
184
+ continue;
185
+ }
186
+ // 5. client:<CLIENT> or c:<CLIENT>
187
+ if (lowerToken.startsWith('client:') || lowerToken.startsWith('c:')) {
188
+ const targetClient = lowerToken.replace(/^(client:|c:)/, '').trim();
189
+ if (!clientStr.includes(targetClient))
190
+ return false;
191
+ continue;
192
+ }
193
+ // 6. domain:<DOMAIN> or d:<DOMAIN>
194
+ if (lowerToken.startsWith('domain:') || lowerToken.startsWith('d:')) {
195
+ const targetDomain = lowerToken.replace(/^(domain:|d:)/, '').trim();
196
+ if (!urlStr.includes(targetDomain))
197
+ return false;
198
+ continue;
199
+ }
200
+ // 7. path:<PATH> or p:<PATH>
201
+ if (lowerToken.startsWith('path:') || lowerToken.startsWith('p:')) {
202
+ const targetPath = lowerToken.replace(/^(path:|p:)/, '').trim();
203
+ if (!urlStr.includes(targetPath) && !pathStr.includes(targetPath)) {
204
+ return false;
205
+ }
206
+ continue;
207
+ }
208
+ // 8. req:<TERM> or body:<TERM>
209
+ if (lowerToken.startsWith('req:') || lowerToken.startsWith('body:')) {
210
+ const target = lowerToken.replace(/^(req:|body:)/, '').trim();
211
+ if (!reqStr.toLowerCase().includes(target))
212
+ return false;
213
+ continue;
214
+ }
215
+ // 9. res:<TERM>
216
+ if (lowerToken.startsWith('res:')) {
217
+ const target = lowerToken.slice(4).trim();
218
+ if (!resStr.toLowerCase().includes(target))
219
+ return false;
220
+ continue;
221
+ }
222
+ // 10. header:<TERM> or h:<TERM>
223
+ if (lowerToken.startsWith('header:') || lowerToken.startsWith('h:')) {
224
+ const target = lowerToken.replace(/^(header:|h:)/, '').trim();
225
+ if (!reqHeadersStr.includes(target) && !resHeadersStr.includes(target)) {
226
+ return false;
227
+ }
228
+ continue;
229
+ }
230
+ // 11. Generic Plain Substring Match
231
+ if (!fullSearchCorpus.includes(lowerToken)) {
232
+ return false;
233
+ }
234
+ }
235
+ return true;
236
+ }
@@ -111,19 +111,19 @@ function getCustomStorage() {
111
111
  function calculateRamBasedLimits(freeRamMb) {
112
112
  if (freeRamMb >= 3000) {
113
113
  return {
114
- maxNetworkLogs: 1000,
115
- maxConsoleLogs: 1500,
116
- maxAnalyticsEvents: 500,
117
- maxCrashRecords: 100,
114
+ maxNetworkLogs: 100,
115
+ maxConsoleLogs: 100,
116
+ maxAnalyticsEvents: 75,
117
+ maxCrashRecords: 50,
118
118
  profileName: 'High-End',
119
119
  freeRamMb,
120
120
  };
121
121
  }
122
122
  else if (freeRamMb >= 1500) {
123
123
  return {
124
- maxNetworkLogs: 500,
125
- maxConsoleLogs: 750,
126
- maxAnalyticsEvents: 250,
124
+ maxNetworkLogs: 100,
125
+ maxConsoleLogs: 100,
126
+ maxAnalyticsEvents: 75,
127
127
  maxCrashRecords: 50,
128
128
  profileName: 'Standard',
129
129
  freeRamMb,
@@ -131,9 +131,9 @@ function calculateRamBasedLimits(freeRamMb) {
131
131
  }
132
132
  else if (freeRamMb >= 600) {
133
133
  return {
134
- maxNetworkLogs: 200,
135
- maxConsoleLogs: 300,
136
- maxAnalyticsEvents: 100,
134
+ maxNetworkLogs: 100,
135
+ maxConsoleLogs: 100,
136
+ maxAnalyticsEvents: 50,
137
137
  maxCrashRecords: 25,
138
138
  profileName: 'Compact',
139
139
  freeRamMb,
@@ -141,9 +141,9 @@ function calculateRamBasedLimits(freeRamMb) {
141
141
  }
142
142
  else {
143
143
  return {
144
- maxNetworkLogs: 100,
145
- maxConsoleLogs: 150,
146
- maxAnalyticsEvents: 50,
144
+ maxNetworkLogs: 50,
145
+ maxConsoleLogs: 50,
146
+ maxAnalyticsEvents: 25,
147
147
  maxCrashRecords: 15,
148
148
  profileName: 'Ultra-Light',
149
149
  freeRamMb,