react-native-inapp-inspector 2.0.7 → 2.2.0

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