react-native-inapp-inspector 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +11 -0
  2. package/dist/commonjs/components/Inspector/AuditTab.d.ts +3 -0
  3. package/dist/commonjs/components/Inspector/AuditTab.js +741 -0
  4. package/dist/commonjs/components/Inspector/DeviceTab.d.ts +3 -0
  5. package/dist/commonjs/components/Inspector/DeviceTab.js +717 -0
  6. package/dist/commonjs/components/Inspector/InspectorHeader.js +28 -25
  7. package/dist/commonjs/components/Inspector/MainScreen.js +15 -2
  8. package/dist/commonjs/components/Inspector/NetworkDetail.js +15 -0
  9. package/dist/commonjs/components/Inspector/PerformanceHud.d.ts +7 -0
  10. package/dist/commonjs/components/Inspector/PerformanceHud.js +210 -0
  11. package/dist/commonjs/components/Inspector/PerformanceTab.js +30 -18
  12. package/dist/commonjs/components/Inspector/RequestReplayModal.d.ts +9 -0
  13. package/dist/commonjs/components/Inspector/RequestReplayModal.js +792 -0
  14. package/dist/commonjs/components/Inspector/RequestReplayView.d.ts +8 -0
  15. package/dist/commonjs/components/Inspector/RequestReplayView.js +871 -0
  16. package/dist/commonjs/components/Inspector/SettingsPanel.js +326 -15
  17. package/dist/commonjs/components/Inspector/StorageTab.d.ts +3 -0
  18. package/dist/commonjs/components/Inspector/StorageTab.js +610 -0
  19. package/dist/commonjs/components/Inspector/TabBar.js +23 -2
  20. package/dist/commonjs/components/NetworkIcons.d.ts +12 -0
  21. package/dist/commonjs/components/NetworkIcons.js +72 -3
  22. package/dist/commonjs/constants/version.d.ts +1 -1
  23. package/dist/commonjs/constants/version.js +1 -1
  24. package/dist/commonjs/customHooks/storageInspector.d.ts +13 -0
  25. package/dist/commonjs/customHooks/storageInspector.js +179 -0
  26. package/dist/commonjs/helpers/deviceInfo.d.ts +4 -0
  27. package/dist/commonjs/helpers/deviceInfo.js +94 -0
  28. package/dist/commonjs/helpers/index.d.ts +2 -0
  29. package/dist/commonjs/helpers/index.js +12 -1
  30. package/dist/commonjs/helpers/packageAuditor.d.ts +5 -0
  31. package/dist/commonjs/helpers/packageAuditor.js +182 -0
  32. package/dist/commonjs/i18n/locales/en.json +3 -2
  33. package/dist/commonjs/index.d.ts +1 -0
  34. package/dist/commonjs/index.js +113 -9
  35. package/dist/commonjs/native/NativeInspector.d.ts +1 -0
  36. package/dist/commonjs/types/enums.d.ts +7 -0
  37. package/dist/commonjs/types/enums.js +7 -0
  38. package/dist/commonjs/types/interfaces.d.ts +73 -0
  39. package/dist/esm/components/Inspector/AuditTab.d.ts +3 -0
  40. package/dist/esm/components/Inspector/AuditTab.js +702 -0
  41. package/dist/esm/components/Inspector/DeviceTab.d.ts +3 -0
  42. package/dist/esm/components/Inspector/DeviceTab.js +678 -0
  43. package/dist/esm/components/Inspector/InspectorHeader.js +28 -25
  44. package/dist/esm/components/Inspector/MainScreen.js +15 -2
  45. package/dist/esm/components/Inspector/NetworkDetail.js +16 -1
  46. package/dist/esm/components/Inspector/PerformanceHud.d.ts +7 -0
  47. package/dist/esm/components/Inspector/PerformanceHud.js +170 -0
  48. package/dist/esm/components/Inspector/PerformanceTab.js +31 -19
  49. package/dist/esm/components/Inspector/RequestReplayModal.d.ts +9 -0
  50. package/dist/esm/components/Inspector/RequestReplayModal.js +752 -0
  51. package/dist/esm/components/Inspector/RequestReplayView.d.ts +8 -0
  52. package/dist/esm/components/Inspector/RequestReplayView.js +831 -0
  53. package/dist/esm/components/Inspector/SettingsPanel.js +327 -16
  54. package/dist/esm/components/Inspector/StorageTab.d.ts +3 -0
  55. package/dist/esm/components/Inspector/StorageTab.js +571 -0
  56. package/dist/esm/components/Inspector/TabBar.js +24 -3
  57. package/dist/esm/components/NetworkIcons.d.ts +12 -0
  58. package/dist/esm/components/NetworkIcons.js +57 -0
  59. package/dist/esm/constants/version.d.ts +1 -1
  60. package/dist/esm/constants/version.js +1 -1
  61. package/dist/esm/customHooks/storageInspector.d.ts +13 -0
  62. package/dist/esm/customHooks/storageInspector.js +170 -0
  63. package/dist/esm/helpers/deviceInfo.d.ts +4 -0
  64. package/dist/esm/helpers/deviceInfo.js +89 -0
  65. package/dist/esm/helpers/index.d.ts +2 -0
  66. package/dist/esm/helpers/index.js +10 -0
  67. package/dist/esm/helpers/packageAuditor.d.ts +5 -0
  68. package/dist/esm/helpers/packageAuditor.js +173 -0
  69. package/dist/esm/i18n/locales/en.json +3 -2
  70. package/dist/esm/index.d.ts +1 -0
  71. package/dist/esm/index.js +109 -8
  72. package/dist/esm/native/NativeInspector.d.ts +1 -0
  73. package/dist/esm/types/enums.d.ts +7 -0
  74. package/dist/esm/types/enums.js +7 -0
  75. package/dist/esm/types/interfaces.d.ts +73 -0
  76. package/ios/NetworkInspectorModule.mm +12 -5
  77. package/package.json +4 -1
@@ -0,0 +1,792 @@
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.RequestReplayModal = void 0;
40
+ const react_1 = __importStar(require("react"));
41
+ const react_native_1 = require("react-native");
42
+ const TouchableScale_1 = __importDefault(require("../TouchableScale"));
43
+ const CopyButton_1 = __importDefault(require("../CopyButton"));
44
+ const JsonViewer_1 = __importDefault(require("../JsonViewer"));
45
+ const AppColors_1 = require("../../styles/AppColors");
46
+ const AppFonts_1 = require("../../styles/AppFonts");
47
+ const constants_1 = require("../../constants");
48
+ const helpers_1 = require("../../helpers");
49
+ const toast_1 = require("../../helpers/toast");
50
+ const NetworkIcons_1 = require("../NetworkIcons");
51
+ const HTTP_METHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];
52
+ const RequestReplayModal = ({ visible, onClose, request, }) => {
53
+ const [method, setMethod] = (0, react_1.useState)(request.method?.toUpperCase() || 'GET');
54
+ const [url, setUrl] = (0, react_1.useState)(request.url || '');
55
+ const [activeTab, setActiveTab] = (0, react_1.useState)('headers');
56
+ // Initialize headers list from request
57
+ const [headers, setHeaders] = (0, react_1.useState)(() => {
58
+ const rawHeaders = request.requestHeaders || request.headers || {};
59
+ const list = [];
60
+ Object.entries(rawHeaders).forEach(([k, v], idx) => {
61
+ list.push({
62
+ id: `h-${idx}-${Date.now()}`,
63
+ key: k,
64
+ value: typeof v === 'string' ? v : JSON.stringify(v),
65
+ enabled: true,
66
+ });
67
+ });
68
+ if (list.length === 0) {
69
+ list.push({
70
+ id: `h-init-1`,
71
+ key: 'Content-Type',
72
+ value: 'application/json',
73
+ enabled: true,
74
+ });
75
+ }
76
+ return list;
77
+ });
78
+ // Request Body
79
+ const [requestBody, setRequestBody] = (0, react_1.useState)(() => {
80
+ const raw = request.request ?? request.requestBody;
81
+ if (raw == null)
82
+ return '';
83
+ if (typeof raw === 'string') {
84
+ try {
85
+ return JSON.stringify(JSON.parse(raw), null, 2);
86
+ }
87
+ catch {
88
+ return raw;
89
+ }
90
+ }
91
+ try {
92
+ return JSON.stringify(raw, null, 2);
93
+ }
94
+ catch {
95
+ return String(raw);
96
+ }
97
+ });
98
+ const [isExecuting, setIsExecuting] = (0, react_1.useState)(false);
99
+ const [executionResult, setExecutionResult] = (0, react_1.useState)(null);
100
+ const [responseSearch, setResponseSearch] = (0, react_1.useState)('');
101
+ const handleAddHeader = () => {
102
+ setHeaders(prev => [
103
+ ...prev,
104
+ {
105
+ id: `h-${Date.now()}-${Math.random().toString(36).substring(2, 6)}`,
106
+ key: '',
107
+ value: '',
108
+ enabled: true,
109
+ },
110
+ ]);
111
+ };
112
+ const handleToggleHeader = (id) => {
113
+ setHeaders(prev => prev.map(h => (h.id === id ? { ...h, enabled: !h.enabled } : h)));
114
+ };
115
+ const handleUpdateHeader = (id, field, val) => {
116
+ setHeaders(prev => prev.map(h => (h.id === id ? { ...h, [field]: val } : h)));
117
+ };
118
+ const handleDeleteHeader = (id) => {
119
+ setHeaders(prev => prev.filter(h => h.id !== id));
120
+ };
121
+ const handlePrettifyBody = () => {
122
+ if (!requestBody.trim())
123
+ return;
124
+ try {
125
+ const parsed = JSON.parse(requestBody);
126
+ setRequestBody(JSON.stringify(parsed, null, 2));
127
+ (0, toast_1.showToast)('JSON formatted');
128
+ }
129
+ catch (e) {
130
+ react_native_1.Alert.alert('JSON Parse Error', e.message || 'Invalid JSON syntax');
131
+ }
132
+ };
133
+ const handleExecute = async () => {
134
+ if (!url.trim()) {
135
+ react_native_1.Alert.alert('Missing URL', 'Please enter a valid request URL.');
136
+ return;
137
+ }
138
+ setIsExecuting(true);
139
+ const startTime = Date.now();
140
+ const assembledHeaders = {};
141
+ headers.forEach(h => {
142
+ if (h.enabled && h.key.trim()) {
143
+ assembledHeaders[h.key.trim()] = h.value;
144
+ }
145
+ });
146
+ try {
147
+ const options = {
148
+ method,
149
+ headers: assembledHeaders,
150
+ };
151
+ if (method !== 'GET' &&
152
+ requestBody.trim().length > 0) {
153
+ options.body = requestBody;
154
+ }
155
+ const res = await fetch(url.trim(), options);
156
+ const duration = Date.now() - startTime;
157
+ const resHeaders = {};
158
+ res.headers.forEach((val, key) => {
159
+ resHeaders[key] = val;
160
+ });
161
+ const rawText = await res.text();
162
+ const sizeBytes = new Blob([rawText]).size || rawText.length;
163
+ setExecutionResult({
164
+ status: res.status,
165
+ statusText: res.statusText || (res.status === 200 ? 'OK' : ''),
166
+ duration,
167
+ headers: resHeaders,
168
+ body: rawText,
169
+ sizeBytes,
170
+ isError: res.status >= 400 || res.status === 0,
171
+ });
172
+ setActiveTab('response');
173
+ (0, toast_1.showToast)(`Finished: ${res.status} in ${duration}ms`);
174
+ }
175
+ catch (err) {
176
+ const duration = Date.now() - startTime;
177
+ setExecutionResult({
178
+ status: 0,
179
+ statusText: err.message || 'Network Request Failed',
180
+ duration,
181
+ headers: {},
182
+ body: JSON.stringify({
183
+ error: true,
184
+ name: err.name || 'FetchError',
185
+ message: err.message || 'Network Request Failed',
186
+ timestamp: new Date().toISOString(),
187
+ }, null, 2),
188
+ sizeBytes: 0,
189
+ isError: true,
190
+ });
191
+ setActiveTab('response');
192
+ (0, toast_1.showToast)('Network error during replay');
193
+ }
194
+ finally {
195
+ setIsExecuting(false);
196
+ }
197
+ };
198
+ if (!visible)
199
+ return null;
200
+ return (<react_native_1.View style={styles.backdrop}>
201
+ <react_native_1.View style={styles.modalCard}>
202
+ {/* ─── 1. MODAL HEADER ────────────────────────────────────────── */}
203
+ <react_native_1.View style={styles.headerRow}>
204
+ <react_native_1.View style={styles.headerTitleBox}>
205
+ <react_native_1.View style={styles.headerTag}>
206
+ <react_native_1.Text style={styles.headerTagText}>ISOLATED API REPLAY</react_native_1.Text>
207
+ </react_native_1.View>
208
+ <react_native_1.Text style={styles.headerTitle} numberOfLines={1}>
209
+ Edit & Resend Request
210
+ </react_native_1.Text>
211
+ </react_native_1.View>
212
+
213
+ <TouchableScale_1.default onPress={onClose} style={styles.closeBtn}>
214
+ <NetworkIcons_1.CloseWhite size={14} color={AppColors_1.AppColors.grayText}/>
215
+ </TouchableScale_1.default>
216
+ </react_native_1.View>
217
+
218
+ {/* ─── 2. METHOD & URL BAR ────────────────────────────────────── */}
219
+ <react_native_1.View style={styles.urlSection}>
220
+ <react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={false} contentContainerStyle={styles.methodList}>
221
+ {HTTP_METHODS.map(m => {
222
+ const isSelected = method === m;
223
+ const mColor = constants_1.METHOD_COLORS[m] || AppColors_1.AppColors.purple;
224
+ return (<TouchableScale_1.default key={m} onPress={() => setMethod(m)} style={[
225
+ styles.methodPill,
226
+ isSelected && {
227
+ backgroundColor: mColor,
228
+ borderColor: mColor,
229
+ },
230
+ ]}>
231
+ <react_native_1.Text style={[
232
+ styles.methodPillText,
233
+ isSelected && { color: AppColors_1.AppColors.white },
234
+ ]}>
235
+ {m}
236
+ </react_native_1.Text>
237
+ </TouchableScale_1.default>);
238
+ })}
239
+ </react_native_1.ScrollView>
240
+
241
+ <react_native_1.View style={styles.urlInputRow}>
242
+ <react_native_1.TextInput style={styles.urlInput} value={url} onChangeText={setUrl} placeholder="https://api.example.com/endpoint..." placeholderTextColor={AppColors_1.AppColors.grayTextWeak} autoCapitalize="none" autoCorrect={false} multiline={false}/>
243
+ {url.length > 0 && (<TouchableScale_1.default onPress={() => setUrl('')} style={styles.urlClearBtn}>
244
+ <NetworkIcons_1.ClearIcon size={13} color={AppColors_1.AppColors.grayTextWeak}/>
245
+ </TouchableScale_1.default>)}
246
+ </react_native_1.View>
247
+ </react_native_1.View>
248
+
249
+ {/* ─── 3. TAB CONTROLS ────────────────────────────────────────── */}
250
+ <react_native_1.View style={styles.tabBar}>
251
+ <TouchableScale_1.default onPress={() => setActiveTab('headers')} style={[
252
+ styles.tabBtn,
253
+ activeTab === 'headers' && styles.tabBtnActive,
254
+ ]}>
255
+ <NetworkIcons_1.HeadersIcon size={12} color={activeTab === 'headers'
256
+ ? AppColors_1.AppColors.purple
257
+ : AppColors_1.AppColors.grayTextWeak}/>
258
+ <react_native_1.Text style={[
259
+ styles.tabBtnText,
260
+ activeTab === 'headers' && styles.tabBtnTextActive,
261
+ ]}>
262
+ Headers ({headers.filter(h => h.enabled && h.key.trim()).length}
263
+ )
264
+ </react_native_1.Text>
265
+ </TouchableScale_1.default>
266
+
267
+ {method !== 'GET' && (<TouchableScale_1.default onPress={() => setActiveTab('body')} style={[
268
+ styles.tabBtn,
269
+ activeTab === 'body' && styles.tabBtnActive,
270
+ ]}>
271
+ <NetworkIcons_1.RequestIcon size={12} color={activeTab === 'body'
272
+ ? AppColors_1.AppColors.purple
273
+ : AppColors_1.AppColors.grayTextWeak}/>
274
+ <react_native_1.Text style={[
275
+ styles.tabBtnText,
276
+ activeTab === 'body' && styles.tabBtnTextActive,
277
+ ]}>
278
+ Body {requestBody.trim() ? '●' : ''}
279
+ </react_native_1.Text>
280
+ </TouchableScale_1.default>)}
281
+
282
+ <TouchableScale_1.default onPress={() => setActiveTab('response')} style={[
283
+ styles.tabBtn,
284
+ activeTab === 'response' && styles.tabBtnActive,
285
+ ]}>
286
+ <NetworkIcons_1.ResponseIcon size={12} color={activeTab === 'response'
287
+ ? AppColors_1.AppColors.purple
288
+ : AppColors_1.AppColors.grayTextWeak}/>
289
+ <react_native_1.Text style={[
290
+ styles.tabBtnText,
291
+ activeTab === 'response' && styles.tabBtnTextActive,
292
+ ]}>
293
+ Response{' '}
294
+ {executionResult
295
+ ? `(${executionResult.status})`
296
+ : isExecuting
297
+ ? '...'
298
+ : ''}
299
+ </react_native_1.Text>
300
+ </TouchableScale_1.default>
301
+ </react_native_1.View>
302
+
303
+ {/* ─── 4. TAB BODY CONTENT ────────────────────────────────────── */}
304
+ <react_native_1.ScrollView style={styles.contentScroll} contentContainerStyle={styles.contentInner} keyboardShouldPersistTaps="handled">
305
+ {/* ── HEADERS TAB ── */}
306
+ {activeTab === 'headers' && (<react_native_1.View style={styles.headersContainer}>
307
+ <react_native_1.View style={styles.headersHeaderRow}>
308
+ <react_native_1.Text style={styles.sectionHeading}>HTTP HEADERS</react_native_1.Text>
309
+ <TouchableScale_1.default onPress={handleAddHeader} style={styles.addHeaderBtn}>
310
+ <react_native_1.Text style={styles.addHeaderBtnText}>+ Add Header</react_native_1.Text>
311
+ </TouchableScale_1.default>
312
+ </react_native_1.View>
313
+
314
+ {headers.map(h => (<react_native_1.View key={h.id} style={styles.headerRowItem}>
315
+ <TouchableScale_1.default onPress={() => handleToggleHeader(h.id)} style={[
316
+ styles.headerCheck,
317
+ h.enabled && styles.headerCheckActive,
318
+ ]}>
319
+ <react_native_1.Text style={styles.headerCheckText}>
320
+ {h.enabled ? '✓' : ''}
321
+ </react_native_1.Text>
322
+ </TouchableScale_1.default>
323
+
324
+ <react_native_1.TextInput style={[styles.headerKeyInput, !h.enabled && { opacity: 0.5 }]} value={h.key} onChangeText={val => handleUpdateHeader(h.id, 'key', val)} placeholder="Header Key" placeholderTextColor={AppColors_1.AppColors.grayTextWeak} autoCapitalize="none" autoCorrect={false}/>
325
+
326
+ <react_native_1.TextInput style={[
327
+ styles.headerValInput,
328
+ !h.enabled && { opacity: 0.5 },
329
+ ]} value={h.value} onChangeText={val => handleUpdateHeader(h.id, 'value', val)} placeholder="Value" placeholderTextColor={AppColors_1.AppColors.grayTextWeak} autoCapitalize="none" autoCorrect={false}/>
330
+
331
+ <TouchableScale_1.default onPress={() => handleDeleteHeader(h.id)} style={styles.deleteHeaderBtn}>
332
+ <NetworkIcons_1.ClearIcon size={12} color={AppColors_1.AppColors.errorColor}/>
333
+ </TouchableScale_1.default>
334
+ </react_native_1.View>))}
335
+ </react_native_1.View>)}
336
+
337
+ {/* ── BODY TAB ── */}
338
+ {activeTab === 'body' && (<react_native_1.View style={styles.bodyContainer}>
339
+ <react_native_1.View style={styles.bodyActionRow}>
340
+ <react_native_1.Text style={styles.sectionHeading}>REQUEST JSON / RAW PAYLOAD</react_native_1.Text>
341
+ <TouchableScale_1.default onPress={handlePrettifyBody} style={styles.prettifyBtn}>
342
+ <react_native_1.Text style={styles.prettifyBtnText}>✨ Prettify JSON</react_native_1.Text>
343
+ </TouchableScale_1.default>
344
+ </react_native_1.View>
345
+
346
+ <react_native_1.TextInput style={styles.bodyTextInput} value={requestBody} onChangeText={setRequestBody} placeholder={`{\n "key": "value"\n}`} placeholderTextColor={AppColors_1.AppColors.grayTextWeak} multiline autoCapitalize="none" autoCorrect={false} textAlignVertical="top"/>
347
+ </react_native_1.View>)}
348
+
349
+ {/* ── RESPONSE TAB ── */}
350
+ {activeTab === 'response' && (<react_native_1.View style={styles.responseContainer}>
351
+ {isExecuting ? (<react_native_1.View style={styles.loadingBox}>
352
+ <react_native_1.ActivityIndicator size="large" color={AppColors_1.AppColors.purple}/>
353
+ <react_native_1.Text style={styles.loadingText}>
354
+ Sending request to {url}...
355
+ </react_native_1.Text>
356
+ </react_native_1.View>) : executionResult ? (<react_native_1.View style={{ gap: 12 }}>
357
+ {/* Status Pill Card */}
358
+ <react_native_1.View style={styles.resStatusBar}>
359
+ <react_native_1.View style={styles.resStatusLeft}>
360
+ <react_native_1.View style={[
361
+ styles.resStatusPill,
362
+ {
363
+ backgroundColor: `${(0, helpers_1.getStatusColor)(executionResult.status)}16`,
364
+ borderColor: `${(0, helpers_1.getStatusColor)(executionResult.status)}40`,
365
+ },
366
+ ]}>
367
+ <react_native_1.View style={[
368
+ styles.statusDot,
369
+ {
370
+ backgroundColor: (0, helpers_1.getStatusColor)(executionResult.status),
371
+ },
372
+ ]}/>
373
+ <react_native_1.Text style={[
374
+ styles.resStatusText,
375
+ {
376
+ color: (0, helpers_1.getStatusColor)(executionResult.status),
377
+ },
378
+ ]}>
379
+ {executionResult.status}{' '}
380
+ {executionResult.statusText}
381
+ </react_native_1.Text>
382
+ </react_native_1.View>
383
+
384
+ <react_native_1.View style={styles.resMetaPill}>
385
+ <react_native_1.Text style={styles.resMetaPillText}>
386
+ ⏱ {executionResult.duration}ms
387
+ </react_native_1.Text>
388
+ </react_native_1.View>
389
+
390
+ <react_native_1.View style={styles.resMetaPill}>
391
+ <react_native_1.Text style={styles.resMetaPillText}>
392
+ 📦 {(0, helpers_1.getSize)(executionResult.body)}
393
+ </react_native_1.Text>
394
+ </react_native_1.View>
395
+ </react_native_1.View>
396
+
397
+ <CopyButton_1.default value={executionResult.body} label="Copy Body" iconType="copy"/>
398
+ </react_native_1.View>
399
+
400
+ {/* Response Body Output */}
401
+ <react_native_1.View style={styles.responseBox}>
402
+ <JsonViewer_1.default data={executionResult.body} search={responseSearch}/>
403
+ </react_native_1.View>
404
+ </react_native_1.View>) : (<react_native_1.View style={styles.emptyResponseBox}>
405
+ <NetworkIcons_1.TerminalIcon size={32} color={AppColors_1.AppColors.grayTextWeak}/>
406
+ <react_native_1.Text style={styles.emptyResponseTitle}>
407
+ No execution yet
408
+ </react_native_1.Text>
409
+ <react_native_1.Text style={styles.emptyResponseSub}>
410
+ Tap "Send Request" below to trigger this API and view the
411
+ live response.
412
+ </react_native_1.Text>
413
+ </react_native_1.View>)}
414
+ </react_native_1.View>)}
415
+ </react_native_1.ScrollView>
416
+
417
+ {/* ─── 5. BOTTOM EXECUTE BAR ──────────────────────────────────── */}
418
+ <react_native_1.View style={styles.bottomBar}>
419
+ <TouchableScale_1.default onPress={handleExecute} disabled={isExecuting} style={[
420
+ styles.sendBtn,
421
+ isExecuting && { backgroundColor: AppColors_1.AppColors.grayBorderSecondary },
422
+ ]}>
423
+ {isExecuting ? (<react_native_1.ActivityIndicator size="small" color={AppColors_1.AppColors.white}/>) : (<>
424
+ <react_native_1.Text style={styles.sendBtnIcon}>⚡</react_native_1.Text>
425
+ <react_native_1.Text style={styles.sendBtnText}>Send Request</react_native_1.Text>
426
+ </>)}
427
+ </TouchableScale_1.default>
428
+ </react_native_1.View>
429
+ </react_native_1.View>
430
+ </react_native_1.View>);
431
+ };
432
+ exports.RequestReplayModal = RequestReplayModal;
433
+ const styles = react_native_1.StyleSheet.create({
434
+ backdrop: {
435
+ ...react_native_1.StyleSheet.absoluteFillObject,
436
+ backgroundColor: 'rgba(0, 0, 0, 0.65)',
437
+ justifyContent: 'flex-end',
438
+ zIndex: 999999,
439
+ elevation: 999999,
440
+ },
441
+ modalCard: {
442
+ height: '90%',
443
+ backgroundColor: AppColors_1.AppColors.contentBg,
444
+ borderTopLeftRadius: 20,
445
+ borderTopRightRadius: 20,
446
+ overflow: 'hidden',
447
+ },
448
+ headerRow: {
449
+ flexDirection: 'row',
450
+ alignItems: 'center',
451
+ justifyContent: 'space-between',
452
+ paddingHorizontal: 16,
453
+ paddingTop: 14,
454
+ paddingBottom: 10,
455
+ borderBottomWidth: 1,
456
+ borderBottomColor: AppColors_1.AppColors.grayBorderSecondary,
457
+ },
458
+ headerTitleBox: {
459
+ flex: 1,
460
+ },
461
+ headerTag: {
462
+ backgroundColor: `${AppColors_1.AppColors.purple}14`,
463
+ paddingHorizontal: 6,
464
+ paddingVertical: 2,
465
+ borderRadius: 4,
466
+ alignSelf: 'flex-start',
467
+ marginBottom: 4,
468
+ },
469
+ headerTagText: {
470
+ fontFamily: AppFonts_1.AppFonts.interBold,
471
+ fontSize: 9.5,
472
+ color: AppColors_1.AppColors.purple,
473
+ letterSpacing: 0.5,
474
+ },
475
+ headerTitle: {
476
+ fontFamily: AppFonts_1.AppFonts.interBold,
477
+ fontSize: 16,
478
+ color: AppColors_1.AppColors.primaryBlack,
479
+ },
480
+ closeBtn: {
481
+ width: 32,
482
+ height: 32,
483
+ borderRadius: 16,
484
+ backgroundColor: AppColors_1.AppColors.grayBackground,
485
+ alignItems: 'center',
486
+ justifyContent: 'center',
487
+ },
488
+ urlSection: {
489
+ padding: 12,
490
+ backgroundColor: AppColors_1.AppColors.primaryLight,
491
+ borderBottomWidth: 1,
492
+ borderBottomColor: AppColors_1.AppColors.grayBorderSecondary,
493
+ gap: 8,
494
+ },
495
+ methodList: {
496
+ flexDirection: 'row',
497
+ gap: 6,
498
+ },
499
+ methodPill: {
500
+ paddingHorizontal: 10,
501
+ paddingVertical: 5,
502
+ borderRadius: 6,
503
+ borderWidth: 1,
504
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
505
+ backgroundColor: AppColors_1.AppColors.contentBg,
506
+ },
507
+ methodPillText: {
508
+ fontFamily: AppFonts_1.AppFonts.interBold,
509
+ fontSize: 11,
510
+ color: AppColors_1.AppColors.grayText,
511
+ },
512
+ urlInputRow: {
513
+ flexDirection: 'row',
514
+ alignItems: 'center',
515
+ backgroundColor: AppColors_1.AppColors.contentBg,
516
+ borderRadius: 8,
517
+ borderWidth: 1,
518
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
519
+ paddingHorizontal: 10,
520
+ },
521
+ urlInput: {
522
+ flex: 1,
523
+ paddingVertical: 8,
524
+ fontFamily: react_native_1.Platform.OS === 'ios' ? 'Menlo' : 'monospace',
525
+ fontSize: 12,
526
+ color: AppColors_1.AppColors.primaryBlack,
527
+ },
528
+ urlClearBtn: {
529
+ padding: 4,
530
+ },
531
+ tabBar: {
532
+ flexDirection: 'row',
533
+ backgroundColor: AppColors_1.AppColors.grayBackground,
534
+ borderBottomWidth: 1,
535
+ borderBottomColor: AppColors_1.AppColors.grayBorderSecondary,
536
+ },
537
+ tabBtn: {
538
+ flex: 1,
539
+ flexDirection: 'row',
540
+ alignItems: 'center',
541
+ justifyContent: 'center',
542
+ paddingVertical: 10,
543
+ gap: 6,
544
+ borderBottomWidth: 2,
545
+ borderBottomColor: 'transparent',
546
+ },
547
+ tabBtnActive: {
548
+ borderBottomColor: AppColors_1.AppColors.purple,
549
+ backgroundColor: AppColors_1.AppColors.contentBg,
550
+ },
551
+ tabBtnText: {
552
+ fontFamily: AppFonts_1.AppFonts.interMedium,
553
+ fontSize: 12,
554
+ color: AppColors_1.AppColors.grayTextWeak,
555
+ },
556
+ tabBtnTextActive: {
557
+ fontFamily: AppFonts_1.AppFonts.interBold,
558
+ color: AppColors_1.AppColors.purple,
559
+ },
560
+ contentScroll: {
561
+ flex: 1,
562
+ },
563
+ contentInner: {
564
+ padding: 14,
565
+ },
566
+ sectionHeading: {
567
+ fontFamily: AppFonts_1.AppFonts.interBold,
568
+ fontSize: 11,
569
+ color: AppColors_1.AppColors.grayTextWeak,
570
+ letterSpacing: 0.5,
571
+ },
572
+ headersContainer: {
573
+ gap: 8,
574
+ },
575
+ headersHeaderRow: {
576
+ flexDirection: 'row',
577
+ alignItems: 'center',
578
+ justifyContent: 'space-between',
579
+ marginBottom: 4,
580
+ },
581
+ addHeaderBtn: {
582
+ backgroundColor: `${AppColors_1.AppColors.purple}14`,
583
+ paddingHorizontal: 8,
584
+ paddingVertical: 4,
585
+ borderRadius: 6,
586
+ },
587
+ addHeaderBtnText: {
588
+ fontFamily: AppFonts_1.AppFonts.interBold,
589
+ fontSize: 11,
590
+ color: AppColors_1.AppColors.purple,
591
+ },
592
+ headerRowItem: {
593
+ flexDirection: 'row',
594
+ alignItems: 'center',
595
+ gap: 6,
596
+ },
597
+ headerCheck: {
598
+ width: 22,
599
+ height: 22,
600
+ borderRadius: 4,
601
+ borderWidth: 1,
602
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
603
+ alignItems: 'center',
604
+ justifyContent: 'center',
605
+ backgroundColor: AppColors_1.AppColors.contentBg,
606
+ },
607
+ headerCheckActive: {
608
+ backgroundColor: AppColors_1.AppColors.purple,
609
+ borderColor: AppColors_1.AppColors.purple,
610
+ },
611
+ headerCheckText: {
612
+ fontFamily: AppFonts_1.AppFonts.interBold,
613
+ fontSize: 12,
614
+ color: AppColors_1.AppColors.white,
615
+ },
616
+ headerKeyInput: {
617
+ flex: 1,
618
+ backgroundColor: AppColors_1.AppColors.primaryLight,
619
+ borderRadius: 6,
620
+ borderWidth: 1,
621
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
622
+ paddingHorizontal: 8,
623
+ paddingVertical: 6,
624
+ fontFamily: react_native_1.Platform.OS === 'ios' ? 'Menlo' : 'monospace',
625
+ fontSize: 11.5,
626
+ color: AppColors_1.AppColors.primaryBlack,
627
+ },
628
+ headerValInput: {
629
+ flex: 1.5,
630
+ backgroundColor: AppColors_1.AppColors.primaryLight,
631
+ borderRadius: 6,
632
+ borderWidth: 1,
633
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
634
+ paddingHorizontal: 8,
635
+ paddingVertical: 6,
636
+ fontFamily: react_native_1.Platform.OS === 'ios' ? 'Menlo' : 'monospace',
637
+ fontSize: 11.5,
638
+ color: AppColors_1.AppColors.primaryBlack,
639
+ },
640
+ deleteHeaderBtn: {
641
+ padding: 6,
642
+ },
643
+ bodyContainer: {
644
+ gap: 8,
645
+ },
646
+ bodyActionRow: {
647
+ flexDirection: 'row',
648
+ alignItems: 'center',
649
+ justifyContent: 'space-between',
650
+ marginBottom: 4,
651
+ },
652
+ prettifyBtn: {
653
+ backgroundColor: `${AppColors_1.AppColors.purple}14`,
654
+ paddingHorizontal: 8,
655
+ paddingVertical: 4,
656
+ borderRadius: 6,
657
+ },
658
+ prettifyBtnText: {
659
+ fontFamily: AppFonts_1.AppFonts.interBold,
660
+ fontSize: 11,
661
+ color: AppColors_1.AppColors.purple,
662
+ },
663
+ bodyTextInput: {
664
+ height: 260,
665
+ backgroundColor: AppColors_1.AppColors.primaryLight,
666
+ borderRadius: 8,
667
+ borderWidth: 1,
668
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
669
+ padding: 10,
670
+ fontFamily: react_native_1.Platform.OS === 'ios' ? 'Menlo' : 'monospace',
671
+ fontSize: 11.5,
672
+ color: AppColors_1.AppColors.primaryBlack,
673
+ },
674
+ responseContainer: {
675
+ minHeight: 200,
676
+ },
677
+ loadingBox: {
678
+ alignItems: 'center',
679
+ justifyContent: 'center',
680
+ paddingVertical: 40,
681
+ gap: 12,
682
+ },
683
+ loadingText: {
684
+ fontFamily: AppFonts_1.AppFonts.interMedium,
685
+ fontSize: 13,
686
+ color: AppColors_1.AppColors.grayText,
687
+ },
688
+ resStatusBar: {
689
+ flexDirection: 'row',
690
+ alignItems: 'center',
691
+ justifyContent: 'space-between',
692
+ backgroundColor: AppColors_1.AppColors.primaryLight,
693
+ padding: 10,
694
+ borderRadius: 10,
695
+ borderWidth: 1,
696
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
697
+ },
698
+ resStatusLeft: {
699
+ flexDirection: 'row',
700
+ alignItems: 'center',
701
+ gap: 6,
702
+ flexWrap: 'wrap',
703
+ },
704
+ resStatusPill: {
705
+ flexDirection: 'row',
706
+ alignItems: 'center',
707
+ gap: 5,
708
+ paddingHorizontal: 8,
709
+ paddingVertical: 3.5,
710
+ borderRadius: 6,
711
+ borderWidth: 1,
712
+ },
713
+ statusDot: {
714
+ width: 6,
715
+ height: 6,
716
+ borderRadius: 3,
717
+ },
718
+ resStatusText: {
719
+ fontFamily: AppFonts_1.AppFonts.interBold,
720
+ fontSize: 11,
721
+ },
722
+ resMetaPill: {
723
+ backgroundColor: AppColors_1.AppColors.contentBg,
724
+ paddingHorizontal: 6,
725
+ paddingVertical: 3,
726
+ borderRadius: 5,
727
+ borderWidth: 1,
728
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
729
+ },
730
+ resMetaPillText: {
731
+ fontFamily: AppFonts_1.AppFonts.interMedium,
732
+ fontSize: 10.5,
733
+ color: AppColors_1.AppColors.grayText,
734
+ },
735
+ responseBox: {
736
+ backgroundColor: AppColors_1.AppColors.primaryLight,
737
+ borderRadius: 10,
738
+ borderWidth: 1,
739
+ borderColor: AppColors_1.AppColors.grayBorderSecondary,
740
+ padding: 10,
741
+ minHeight: 200,
742
+ },
743
+ emptyResponseBox: {
744
+ alignItems: 'center',
745
+ justifyContent: 'center',
746
+ paddingVertical: 50,
747
+ gap: 8,
748
+ },
749
+ emptyResponseTitle: {
750
+ fontFamily: AppFonts_1.AppFonts.interBold,
751
+ fontSize: 14,
752
+ color: AppColors_1.AppColors.primaryBlack,
753
+ },
754
+ emptyResponseSub: {
755
+ fontFamily: AppFonts_1.AppFonts.interRegular,
756
+ fontSize: 12,
757
+ color: AppColors_1.AppColors.grayTextWeak,
758
+ textAlign: 'center',
759
+ paddingHorizontal: 24,
760
+ },
761
+ bottomBar: {
762
+ paddingHorizontal: 16,
763
+ paddingTop: 12,
764
+ paddingBottom: react_native_1.Platform.OS === 'ios' ? 34 : 16,
765
+ backgroundColor: AppColors_1.AppColors.contentBg,
766
+ borderTopWidth: 1,
767
+ borderTopColor: AppColors_1.AppColors.grayBorderSecondary,
768
+ },
769
+ sendBtn: {
770
+ backgroundColor: AppColors_1.AppColors.purple,
771
+ flexDirection: 'row',
772
+ alignItems: 'center',
773
+ justifyContent: 'center',
774
+ gap: 6,
775
+ paddingVertical: 12,
776
+ borderRadius: 10,
777
+ shadowColor: AppColors_1.AppColors.purple,
778
+ shadowOpacity: 0.3,
779
+ shadowRadius: 6,
780
+ shadowOffset: { width: 0, height: 2 },
781
+ },
782
+ sendBtnIcon: {
783
+ fontSize: 14,
784
+ color: AppColors_1.AppColors.white,
785
+ },
786
+ sendBtnText: {
787
+ fontFamily: AppFonts_1.AppFonts.interBold,
788
+ fontSize: 14,
789
+ color: AppColors_1.AppColors.white,
790
+ },
791
+ });
792
+ exports.default = exports.RequestReplayModal;