react-native-inapp-inspector 1.0.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.
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/commonjs/components/AnalyticsDetail.d.ts +6 -0
- package/dist/commonjs/components/AnalyticsDetail.js +558 -0
- package/dist/commonjs/components/AnalyticsEventCard.d.ts +18 -0
- package/dist/commonjs/components/AnalyticsEventCard.js +327 -0
- package/dist/commonjs/components/AnalyticsGraph.d.ts +8 -0
- package/dist/commonjs/components/AnalyticsGraph.js +416 -0
- package/dist/commonjs/components/CodeSnippet.d.ts +8 -0
- package/dist/commonjs/components/CodeSnippet.js +427 -0
- package/dist/commonjs/components/ConsoleLogCard.d.ts +10 -0
- package/dist/commonjs/components/ConsoleLogCard.js +401 -0
- package/dist/commonjs/components/CopyButton.d.ts +4 -0
- package/dist/commonjs/components/CopyButton.js +69 -0
- package/dist/commonjs/components/DiffViewer.d.ts +7 -0
- package/dist/commonjs/components/DiffViewer.js +86 -0
- package/dist/commonjs/components/DomainHeader.d.ts +18 -0
- package/dist/commonjs/components/DomainHeader.js +136 -0
- package/dist/commonjs/components/EmptyState.d.ts +5 -0
- package/dist/commonjs/components/EmptyState.js +40 -0
- package/dist/commonjs/components/HeadersSection.d.ts +4 -0
- package/dist/commonjs/components/HeadersSection.js +155 -0
- package/dist/commonjs/components/HighlightText.d.ts +3 -0
- package/dist/commonjs/components/HighlightText.js +57 -0
- package/dist/commonjs/components/JsonViewer.d.ts +7 -0
- package/dist/commonjs/components/JsonViewer.js +19 -0
- package/dist/commonjs/components/LogCard.d.ts +4 -0
- package/dist/commonjs/components/LogCard.js +179 -0
- package/dist/commonjs/components/MetaAccordion.d.ts +4 -0
- package/dist/commonjs/components/MetaAccordion.js +113 -0
- package/dist/commonjs/components/MiniBarChart.d.ts +7 -0
- package/dist/commonjs/components/MiniBarChart.js +56 -0
- package/dist/commonjs/components/MiniLineChart.d.ts +6 -0
- package/dist/commonjs/components/MiniLineChart.js +58 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +31 -0
- package/dist/commonjs/components/NetworkIcons.js +245 -0
- package/dist/commonjs/components/SectionHeader.d.ts +4 -0
- package/dist/commonjs/components/SectionHeader.js +87 -0
- package/dist/commonjs/components/SourcePageCard.d.ts +4 -0
- package/dist/commonjs/components/SourcePageCard.js +132 -0
- package/dist/commonjs/components/TouchableScale.d.ts +9 -0
- package/dist/commonjs/components/TouchableScale.js +44 -0
- package/dist/commonjs/components/TreeNode.d.ts +4 -0
- package/dist/commonjs/components/TreeNode.js +140 -0
- package/dist/commonjs/constants/index.d.ts +7 -0
- package/dist/commonjs/constants/index.js +35 -0
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +21 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +160 -0
- package/dist/commonjs/customHooks/consoleLogger.d.ts +5 -0
- package/dist/commonjs/customHooks/consoleLogger.js +141 -0
- package/dist/commonjs/customHooks/logFilters.d.ts +5 -0
- package/dist/commonjs/customHooks/logFilters.js +34 -0
- package/dist/commonjs/customHooks/networkLogger.d.ts +20 -0
- package/dist/commonjs/customHooks/networkLogger.js +272 -0
- package/dist/commonjs/customHooks/useAccordion.d.ts +17 -0
- package/dist/commonjs/customHooks/useAccordion.js +48 -0
- package/dist/commonjs/customHooks/webViewLogger.d.ts +22 -0
- package/dist/commonjs/customHooks/webViewLogger.js +412 -0
- package/dist/commonjs/helpers/index.d.ts +20 -0
- package/dist/commonjs/helpers/index.js +229 -0
- package/dist/commonjs/index.d.ts +7 -0
- package/dist/commonjs/index.js +2668 -0
- package/dist/commonjs/styles/AppColors.d.ts +27 -0
- package/dist/commonjs/styles/AppColors.js +30 -0
- package/dist/commonjs/styles/AppFonts.d.ts +7 -0
- package/dist/commonjs/styles/AppFonts.js +10 -0
- package/dist/commonjs/styles/index.d.ts +1488 -0
- package/dist/commonjs/styles/index.js +1357 -0
- package/dist/commonjs/types/index.d.ts +127 -0
- package/dist/commonjs/types/index.js +2 -0
- package/dist/esm/components/AnalyticsDetail.d.ts +6 -0
- package/dist/esm/components/AnalyticsDetail.js +520 -0
- package/dist/esm/components/AnalyticsEventCard.d.ts +18 -0
- package/dist/esm/components/AnalyticsEventCard.js +288 -0
- package/dist/esm/components/AnalyticsGraph.d.ts +8 -0
- package/dist/esm/components/AnalyticsGraph.js +378 -0
- package/dist/esm/components/CodeSnippet.d.ts +8 -0
- package/dist/esm/components/CodeSnippet.js +392 -0
- package/dist/esm/components/ConsoleLogCard.d.ts +10 -0
- package/dist/esm/components/ConsoleLogCard.js +362 -0
- package/dist/esm/components/CopyButton.d.ts +4 -0
- package/dist/esm/components/CopyButton.js +31 -0
- package/dist/esm/components/DiffViewer.d.ts +7 -0
- package/dist/esm/components/DiffViewer.js +48 -0
- package/dist/esm/components/DomainHeader.d.ts +18 -0
- package/dist/esm/components/DomainHeader.js +98 -0
- package/dist/esm/components/EmptyState.d.ts +5 -0
- package/dist/esm/components/EmptyState.js +35 -0
- package/dist/esm/components/HeadersSection.d.ts +4 -0
- package/dist/esm/components/HeadersSection.js +117 -0
- package/dist/esm/components/HighlightText.d.ts +3 -0
- package/dist/esm/components/HighlightText.js +52 -0
- package/dist/esm/components/JsonViewer.d.ts +7 -0
- package/dist/esm/components/JsonViewer.js +14 -0
- package/dist/esm/components/LogCard.d.ts +4 -0
- package/dist/esm/components/LogCard.js +141 -0
- package/dist/esm/components/MetaAccordion.d.ts +4 -0
- package/dist/esm/components/MetaAccordion.js +108 -0
- package/dist/esm/components/MiniBarChart.d.ts +7 -0
- package/dist/esm/components/MiniBarChart.js +18 -0
- package/dist/esm/components/MiniLineChart.d.ts +6 -0
- package/dist/esm/components/MiniLineChart.js +20 -0
- package/dist/esm/components/NetworkIcons.d.ts +31 -0
- package/dist/esm/components/NetworkIcons.js +176 -0
- package/dist/esm/components/SectionHeader.d.ts +4 -0
- package/dist/esm/components/SectionHeader.js +49 -0
- package/dist/esm/components/SourcePageCard.d.ts +4 -0
- package/dist/esm/components/SourcePageCard.js +94 -0
- package/dist/esm/components/TouchableScale.d.ts +9 -0
- package/dist/esm/components/TouchableScale.js +9 -0
- package/dist/esm/components/TreeNode.d.ts +4 -0
- package/dist/esm/components/TreeNode.js +102 -0
- package/dist/esm/constants/index.d.ts +7 -0
- package/dist/esm/constants/index.js +32 -0
- package/dist/esm/customHooks/analyticsLogger.d.ts +21 -0
- package/dist/esm/customHooks/analyticsLogger.js +152 -0
- package/dist/esm/customHooks/consoleLogger.d.ts +5 -0
- package/dist/esm/customHooks/consoleLogger.js +134 -0
- package/dist/esm/customHooks/logFilters.d.ts +5 -0
- package/dist/esm/customHooks/logFilters.js +31 -0
- package/dist/esm/customHooks/networkLogger.d.ts +20 -0
- package/dist/esm/customHooks/networkLogger.js +264 -0
- package/dist/esm/customHooks/useAccordion.d.ts +17 -0
- package/dist/esm/customHooks/useAccordion.js +46 -0
- package/dist/esm/customHooks/webViewLogger.d.ts +22 -0
- package/dist/esm/customHooks/webViewLogger.js +365 -0
- package/dist/esm/helpers/index.d.ts +20 -0
- package/dist/esm/helpers/index.js +207 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +2611 -0
- package/dist/esm/styles/AppColors.d.ts +27 -0
- package/dist/esm/styles/AppColors.js +27 -0
- package/dist/esm/styles/AppFonts.d.ts +7 -0
- package/dist/esm/styles/AppFonts.js +7 -0
- package/dist/esm/styles/index.d.ts +1488 -0
- package/dist/esm/styles/index.js +1355 -0
- package/dist/esm/types/index.d.ts +127 -0
- package/dist/esm/types/index.js +1 -0
- package/fonts/Inter/Inter.ttc +0 -0
- package/fonts/Inter/InterVariable-Italic.ttf +0 -0
- package/fonts/Inter/InterVariable.ttf +0 -0
- package/fonts/Inter/LICENSE.txt +92 -0
- package/fonts/Inter/extras/otf/Inter-Black.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-BlackItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Bold.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-BoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraBold.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraLight.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ExtraLightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Italic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Light.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-LightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Medium.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-MediumItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Regular.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-SemiBold.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-SemiBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-Thin.otf +0 -0
- package/fonts/Inter/extras/otf/Inter-ThinItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Black.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-BlackItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Bold.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-BoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraBold.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraLight.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ExtraLightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Italic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Light.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-LightItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Medium.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-MediumItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Regular.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-SemiBold.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-SemiBoldItalic.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-Thin.otf +0 -0
- package/fonts/Inter/extras/otf/InterDisplay-ThinItalic.otf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Black.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-BlackItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Bold.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-BoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraLight.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ExtraLightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Italic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Light.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-LightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Medium.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-MediumItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Regular.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-SemiBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-SemiBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-Thin.ttf +0 -0
- package/fonts/Inter/extras/ttf/Inter-ThinItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Black.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-BlackItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Bold.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-BoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraLight.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ExtraLightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Italic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Light.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-LightItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Medium.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-MediumItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Regular.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-SemiBold.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-SemiBoldItalic.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-Thin.ttf +0 -0
- package/fonts/Inter/extras/ttf/InterDisplay-ThinItalic.ttf +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Black.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Bold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Italic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Light.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Medium.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Regular.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-Thin.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Black.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-BlackItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Bold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-BoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraLight.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Italic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Light.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-LightItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Medium.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-MediumItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Regular.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-SemiBold.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-Thin.woff2 +0 -0
- package/fonts/Inter/extras/woff-hinted/InterDisplay-ThinItalic.woff2 +0 -0
- package/fonts/Inter/help.txt +165 -0
- package/fonts/Inter/web/Inter-Black.woff2 +0 -0
- package/fonts/Inter/web/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Bold.woff2 +0 -0
- package/fonts/Inter/web/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter/web/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Italic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Light.woff2 +0 -0
- package/fonts/Inter/web/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Medium.woff2 +0 -0
- package/fonts/Inter/web/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Regular.woff2 +0 -0
- package/fonts/Inter/web/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter/web/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/Inter-Thin.woff2 +0 -0
- package/fonts/Inter/web/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Black.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-BlackItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Bold.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-BoldItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraBold.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraLight.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Italic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Light.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-LightItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Medium.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-MediumItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Regular.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-SemiBold.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-Thin.woff2 +0 -0
- package/fonts/Inter/web/InterDisplay-ThinItalic.woff2 +0 -0
- package/fonts/Inter/web/InterVariable-Italic.woff2 +0 -0
- package/fonts/Inter/web/InterVariable.woff2 +0 -0
- package/fonts/Inter/web/inter.css +148 -0
- package/package.json +52 -0
|
@@ -0,0 +1,412 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.subscribeWebView = exports.clearWebViewData = exports.getWebViewHtmlUrl = exports.getWebViewJs = exports.getWebViewCss = exports.getWebViewHtml = exports.getWebViewNavHistory = exports.getWebViewLogs = exports.addWebViewHtml = exports.addWebViewNav = exports.addWebViewLog = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
// Intercept react-native-webview exports to capture console logs and URL navigation changes globally
|
|
39
|
+
try {
|
|
40
|
+
const RNWebView = require('react-native-webview');
|
|
41
|
+
const OriginalWebView = RNWebView.WebView || RNWebView.default;
|
|
42
|
+
if (OriginalWebView) {
|
|
43
|
+
const injectJS = `
|
|
44
|
+
(function() {
|
|
45
|
+
if (!window.__webview_console_overridden__) {
|
|
46
|
+
window.__webview_console_overridden__ = true;
|
|
47
|
+
var originalLog = console.log;
|
|
48
|
+
var originalWarn = console.warn;
|
|
49
|
+
var originalError = console.error;
|
|
50
|
+
var originalInfo = console.info;
|
|
51
|
+
|
|
52
|
+
var sendToRN = function(type, args) {
|
|
53
|
+
if (window.ReactNativeWebView && window.ReactNativeWebView.postMessage) {
|
|
54
|
+
var messageStr = '';
|
|
55
|
+
try {
|
|
56
|
+
var argsList = [];
|
|
57
|
+
for (var i = 0; i < args.length; i++) {
|
|
58
|
+
var arg = args[i];
|
|
59
|
+
if (typeof arg === 'object') {
|
|
60
|
+
try {
|
|
61
|
+
argsList.push(JSON.stringify(arg));
|
|
62
|
+
} catch (e) {
|
|
63
|
+
argsList.push(String(arg));
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
argsList.push(String(arg));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
messageStr = argsList.join(' ');
|
|
70
|
+
} catch (err) {
|
|
71
|
+
messageStr = String(args);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
76
|
+
type: 'webview-log',
|
|
77
|
+
logType: type,
|
|
78
|
+
message: messageStr
|
|
79
|
+
}));
|
|
80
|
+
} catch (postErr) {}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
console.log = function() {
|
|
85
|
+
if (originalLog) {
|
|
86
|
+
originalLog.apply(console, arguments);
|
|
87
|
+
}
|
|
88
|
+
sendToRN('log', arguments);
|
|
89
|
+
};
|
|
90
|
+
console.warn = function() {
|
|
91
|
+
if (originalWarn) {
|
|
92
|
+
originalWarn.apply(console, arguments);
|
|
93
|
+
}
|
|
94
|
+
sendToRN('warn', arguments);
|
|
95
|
+
};
|
|
96
|
+
console.error = function() {
|
|
97
|
+
if (originalError) {
|
|
98
|
+
originalError.apply(console, arguments);
|
|
99
|
+
}
|
|
100
|
+
sendToRN('error', arguments);
|
|
101
|
+
};
|
|
102
|
+
console.info = function() {
|
|
103
|
+
if (originalInfo) {
|
|
104
|
+
originalInfo.apply(console, arguments);
|
|
105
|
+
}
|
|
106
|
+
sendToRN('info', arguments);
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (!window.__webview_html_capture_setup__) {
|
|
111
|
+
window.__webview_html_capture_setup__ = true;
|
|
112
|
+
|
|
113
|
+
var sendHtmlRetries = 0;
|
|
114
|
+
window.__webview_send_html__ = function() {
|
|
115
|
+
if (window.ReactNativeWebView && window.ReactNativeWebView.postMessage) {
|
|
116
|
+
try {
|
|
117
|
+
var html = '';
|
|
118
|
+
try {
|
|
119
|
+
if (document && document.documentElement) {
|
|
120
|
+
html = document.documentElement.outerHTML || '';
|
|
121
|
+
}
|
|
122
|
+
} catch (e) {}
|
|
123
|
+
|
|
124
|
+
// Get CSS
|
|
125
|
+
var css = '';
|
|
126
|
+
try {
|
|
127
|
+
var sheets = document.styleSheets;
|
|
128
|
+
if (sheets) {
|
|
129
|
+
for (var i = 0; i < sheets.length; i++) {
|
|
130
|
+
var sheet = sheets[i];
|
|
131
|
+
try {
|
|
132
|
+
var rules = sheet.cssRules || sheet.rules;
|
|
133
|
+
if (rules) {
|
|
134
|
+
for (var j = 0; j < rules.length; j++) {
|
|
135
|
+
css += rules[j].cssText + String.fromCharCode(10);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
} catch (e) {
|
|
139
|
+
if (sheet.href) {
|
|
140
|
+
css += '/* External stylesheet: ' + sheet.href + ' */' + String.fromCharCode(10);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
} catch (e) {}
|
|
146
|
+
|
|
147
|
+
try {
|
|
148
|
+
var styles = document.querySelectorAll('style');
|
|
149
|
+
if (styles) {
|
|
150
|
+
for (var i = 0; i < styles.length; i++) {
|
|
151
|
+
var style = styles[i];
|
|
152
|
+
if (style && style.textContent) {
|
|
153
|
+
if (css.indexOf(style.textContent) === -1) {
|
|
154
|
+
css += style.textContent + String.fromCharCode(10);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
} catch (e) {}
|
|
160
|
+
|
|
161
|
+
// Get JS
|
|
162
|
+
var js = '';
|
|
163
|
+
try {
|
|
164
|
+
var scripts = document.querySelectorAll('script');
|
|
165
|
+
if (scripts) {
|
|
166
|
+
for (var i = 0; i < scripts.length; i++) {
|
|
167
|
+
var script = scripts[i];
|
|
168
|
+
if (script) {
|
|
169
|
+
if (script.src) {
|
|
170
|
+
js += '// External Script: ' + script.src + String.fromCharCode(10);
|
|
171
|
+
} else if (script.textContent) {
|
|
172
|
+
js += script.textContent + String.fromCharCode(10);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
} catch (e) {}
|
|
178
|
+
|
|
179
|
+
try {
|
|
180
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
181
|
+
type: 'webview-html',
|
|
182
|
+
html: html,
|
|
183
|
+
css: css,
|
|
184
|
+
js: js,
|
|
185
|
+
url: window.location.href
|
|
186
|
+
}));
|
|
187
|
+
} catch (postError) {
|
|
188
|
+
try {
|
|
189
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
190
|
+
type: 'webview-html',
|
|
191
|
+
html: html,
|
|
192
|
+
css: '/* CSS truncated due to size limit */',
|
|
193
|
+
js: '/* JS truncated due to size limit */',
|
|
194
|
+
url: window.location.href
|
|
195
|
+
}));
|
|
196
|
+
} catch (htmlOnlyError) {
|
|
197
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
198
|
+
type: 'webview-html',
|
|
199
|
+
html: '<h1>Page source too large to capture</h1>',
|
|
200
|
+
url: window.location.href
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
} catch (err) {}
|
|
205
|
+
} else if (sendHtmlRetries < 50) {
|
|
206
|
+
sendHtmlRetries++;
|
|
207
|
+
setTimeout(window.__webview_send_html__, 100);
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
var debounceTimeout = null;
|
|
212
|
+
window.__webview_debounced_send_html__ = function() {
|
|
213
|
+
if (debounceTimeout) {
|
|
214
|
+
clearTimeout(debounceTimeout);
|
|
215
|
+
}
|
|
216
|
+
debounceTimeout = setTimeout(window.__webview_send_html__, 500);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
// Setup MutationObserver for SPAs
|
|
220
|
+
try {
|
|
221
|
+
var observer = new MutationObserver(function() {
|
|
222
|
+
window.__webview_debounced_send_html__();
|
|
223
|
+
});
|
|
224
|
+
observer.observe(document.documentElement, {
|
|
225
|
+
attributes: true,
|
|
226
|
+
childList: true,
|
|
227
|
+
subtree: true
|
|
228
|
+
});
|
|
229
|
+
} catch (e) {}
|
|
230
|
+
|
|
231
|
+
// Setup SPA router state changes
|
|
232
|
+
try {
|
|
233
|
+
var originalPushState = history.pushState;
|
|
234
|
+
history.pushState = function() {
|
|
235
|
+
originalPushState.apply(this, arguments);
|
|
236
|
+
window.__webview_debounced_send_html__();
|
|
237
|
+
};
|
|
238
|
+
var originalReplaceState = history.replaceState;
|
|
239
|
+
history.replaceState = function() {
|
|
240
|
+
originalReplaceState.apply(this, arguments);
|
|
241
|
+
window.__webview_debounced_send_html__();
|
|
242
|
+
};
|
|
243
|
+
window.addEventListener('popstate', window.__webview_debounced_send_html__);
|
|
244
|
+
window.addEventListener('hashchange', window.__webview_debounced_send_html__);
|
|
245
|
+
} catch (e) {}
|
|
246
|
+
|
|
247
|
+
window.addEventListener('DOMContentLoaded', window.__webview_send_html__);
|
|
248
|
+
window.addEventListener('load', window.__webview_send_html__);
|
|
249
|
+
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
|
250
|
+
window.__webview_send_html__();
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
if (window.__webview_send_html__) {
|
|
254
|
+
window.__webview_send_html__();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
})();
|
|
258
|
+
true;
|
|
259
|
+
`;
|
|
260
|
+
const InterceptedWebView = (0, react_1.forwardRef)((props, ref) => {
|
|
261
|
+
const handleMessage = (event) => {
|
|
262
|
+
try {
|
|
263
|
+
const data = JSON.parse(event.nativeEvent.data);
|
|
264
|
+
if (data.type === 'webview-log') {
|
|
265
|
+
(0, exports.addWebViewLog)(data.logType, data.message);
|
|
266
|
+
}
|
|
267
|
+
else if (data.type === 'webview-html') {
|
|
268
|
+
(0, exports.addWebViewHtml)(data.url, data.html, data.css, data.js);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
catch (e) { }
|
|
272
|
+
if (props.onMessage) {
|
|
273
|
+
props.onMessage(event);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
const handleNavigationStateChange = (navState) => {
|
|
277
|
+
(0, exports.addWebViewNav)(navState.url, navState.title);
|
|
278
|
+
if (props.onNavigationStateChange) {
|
|
279
|
+
props.onNavigationStateChange(navState);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
// Register initial URL
|
|
283
|
+
react_1.default.useEffect(() => {
|
|
284
|
+
if (props.source && props.source.uri) {
|
|
285
|
+
(0, exports.addWebViewNav)(props.source.uri, 'Initial Page');
|
|
286
|
+
}
|
|
287
|
+
}, [props.source?.uri]);
|
|
288
|
+
const combinedInjectedJSBefore = props.injectedJavaScriptBeforeContentLoaded
|
|
289
|
+
? `${injectJS}\n${props.injectedJavaScriptBeforeContentLoaded}`
|
|
290
|
+
: injectJS;
|
|
291
|
+
const combinedInjectedJS = props.injectedJavaScript
|
|
292
|
+
? `${injectJS}\n${props.injectedJavaScript}`
|
|
293
|
+
: injectJS;
|
|
294
|
+
return react_1.default.createElement(OriginalWebView, {
|
|
295
|
+
...props,
|
|
296
|
+
ref: ref,
|
|
297
|
+
injectedJavaScriptBeforeContentLoaded: combinedInjectedJSBefore,
|
|
298
|
+
injectedJavaScript: combinedInjectedJS,
|
|
299
|
+
onMessage: handleMessage,
|
|
300
|
+
onNavigationStateChange: handleNavigationStateChange,
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
// Replace properties on required module singleton to redirect all imports globally
|
|
304
|
+
const defineProp = (obj, prop, value) => {
|
|
305
|
+
try {
|
|
306
|
+
Object.defineProperty(obj, prop, {
|
|
307
|
+
value: value,
|
|
308
|
+
configurable: true,
|
|
309
|
+
writable: true,
|
|
310
|
+
enumerable: true,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
catch (e) {
|
|
314
|
+
try {
|
|
315
|
+
obj[prop] = value;
|
|
316
|
+
}
|
|
317
|
+
catch (err) { }
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
if (RNWebView.WebView) {
|
|
321
|
+
defineProp(RNWebView, 'WebView', InterceptedWebView);
|
|
322
|
+
}
|
|
323
|
+
if (RNWebView.default) {
|
|
324
|
+
if (RNWebView.default.WebView) {
|
|
325
|
+
defineProp(RNWebView.default, 'WebView', InterceptedWebView);
|
|
326
|
+
}
|
|
327
|
+
defineProp(RNWebView, 'default', InterceptedWebView);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
catch (e) {
|
|
332
|
+
// Silent fail if react-native-webview is not resolved
|
|
333
|
+
}
|
|
334
|
+
let logs = [];
|
|
335
|
+
let navHistory = [];
|
|
336
|
+
let currentHtml = '';
|
|
337
|
+
let currentCss = '';
|
|
338
|
+
let currentJs = '';
|
|
339
|
+
let currentHtmlUrl = '';
|
|
340
|
+
let listeners = [];
|
|
341
|
+
let counter = 0;
|
|
342
|
+
const notify = () => {
|
|
343
|
+
const snapshotLogs = [...logs];
|
|
344
|
+
const snapshotHistory = [...navHistory];
|
|
345
|
+
listeners.forEach(cb => cb());
|
|
346
|
+
};
|
|
347
|
+
const addWebViewLog = (type, message) => {
|
|
348
|
+
logs.unshift({
|
|
349
|
+
id: counter++,
|
|
350
|
+
type,
|
|
351
|
+
message,
|
|
352
|
+
timestamp: Date.now(),
|
|
353
|
+
});
|
|
354
|
+
logs = logs.slice(0, 100);
|
|
355
|
+
notify();
|
|
356
|
+
};
|
|
357
|
+
exports.addWebViewLog = addWebViewLog;
|
|
358
|
+
const addWebViewNav = (url, title) => {
|
|
359
|
+
// Prevent duplicate consecutive navigation events for the same URL
|
|
360
|
+
if (navHistory.length > 0 && navHistory[0].url === url) {
|
|
361
|
+
if (title && !navHistory[0].title) {
|
|
362
|
+
navHistory[0].title = title;
|
|
363
|
+
notify();
|
|
364
|
+
}
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
navHistory.unshift({
|
|
368
|
+
url,
|
|
369
|
+
title,
|
|
370
|
+
timestamp: Date.now(),
|
|
371
|
+
});
|
|
372
|
+
navHistory = navHistory.slice(0, 50);
|
|
373
|
+
notify();
|
|
374
|
+
};
|
|
375
|
+
exports.addWebViewNav = addWebViewNav;
|
|
376
|
+
const addWebViewHtml = (url, html, css, js) => {
|
|
377
|
+
currentHtml = html;
|
|
378
|
+
currentCss = css || '';
|
|
379
|
+
currentJs = js || '';
|
|
380
|
+
currentHtmlUrl = url;
|
|
381
|
+
notify();
|
|
382
|
+
};
|
|
383
|
+
exports.addWebViewHtml = addWebViewHtml;
|
|
384
|
+
const getWebViewLogs = () => [...logs];
|
|
385
|
+
exports.getWebViewLogs = getWebViewLogs;
|
|
386
|
+
const getWebViewNavHistory = () => [...navHistory];
|
|
387
|
+
exports.getWebViewNavHistory = getWebViewNavHistory;
|
|
388
|
+
const getWebViewHtml = () => currentHtml;
|
|
389
|
+
exports.getWebViewHtml = getWebViewHtml;
|
|
390
|
+
const getWebViewCss = () => currentCss;
|
|
391
|
+
exports.getWebViewCss = getWebViewCss;
|
|
392
|
+
const getWebViewJs = () => currentJs;
|
|
393
|
+
exports.getWebViewJs = getWebViewJs;
|
|
394
|
+
const getWebViewHtmlUrl = () => currentHtmlUrl;
|
|
395
|
+
exports.getWebViewHtmlUrl = getWebViewHtmlUrl;
|
|
396
|
+
const clearWebViewData = () => {
|
|
397
|
+
logs = [];
|
|
398
|
+
navHistory = [];
|
|
399
|
+
currentHtml = '';
|
|
400
|
+
currentCss = '';
|
|
401
|
+
currentJs = '';
|
|
402
|
+
currentHtmlUrl = '';
|
|
403
|
+
notify();
|
|
404
|
+
};
|
|
405
|
+
exports.clearWebViewData = clearWebViewData;
|
|
406
|
+
const subscribeWebView = (cb) => {
|
|
407
|
+
listeners.push(cb);
|
|
408
|
+
return () => {
|
|
409
|
+
listeners = listeners.filter(l => l !== cb);
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
exports.subscribeWebView = subscribeWebView;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NetworkLog, RouteInfo, DiffResult } from '../types';
|
|
2
|
+
export declare const getDomainColor: (domain: string) => string;
|
|
3
|
+
export declare const formatDateTime: (timestamp: number) => string;
|
|
4
|
+
export declare const getStatusColor: (status: number | null) => string;
|
|
5
|
+
export declare const getDurationColor: (duration: number | null) => string;
|
|
6
|
+
export declare const getSize: (data: unknown) => string;
|
|
7
|
+
export declare const copyToClipboard: (value: unknown, label: string) => void;
|
|
8
|
+
export declare const getPath: (url: string) => string;
|
|
9
|
+
export declare const getCurlCommand: (log: NetworkLog) => string;
|
|
10
|
+
export declare const getFetchCommand: (log: NetworkLog) => string;
|
|
11
|
+
export declare const deduplicateLogs: (raw: NetworkLog[]) => NetworkLog[];
|
|
12
|
+
export declare const escapeRegex: (str: string) => string;
|
|
13
|
+
export declare const getNavigationInfo: (state: any, path?: string[]) => RouteInfo;
|
|
14
|
+
export declare const flattenObject: (obj: any, prefix?: string) => Record<string, any>;
|
|
15
|
+
export declare const getDiff: (oldObj: any, newObj: any) => DiffResult[];
|
|
16
|
+
export declare const formatDisplayUrl: (url: string) => string;
|
|
17
|
+
export declare const getLocalizedFilePath: (path: string | any, country: string | any, language: string | any) => any;
|
|
18
|
+
export declare const getLocalizedFilePathWithSlash: (path: string | any, country: string | any, language: string | any) => any;
|
|
19
|
+
export declare const isAllValuesEmpty: (obj: Record<string, any>) => boolean;
|
|
20
|
+
export declare const formatDateTimeToAnalytics: (ts: number) => string;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatDateTimeToAnalytics = exports.isAllValuesEmpty = exports.getLocalizedFilePathWithSlash = exports.getLocalizedFilePath = exports.formatDisplayUrl = exports.getDiff = exports.flattenObject = exports.getNavigationInfo = exports.escapeRegex = exports.deduplicateLogs = exports.getFetchCommand = exports.getCurlCommand = exports.getPath = exports.copyToClipboard = exports.getSize = exports.getDurationColor = exports.getStatusColor = exports.formatDateTime = exports.getDomainColor = void 0;
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
// Stylesheet
|
|
6
|
+
const AppColors_1 = require("../styles/AppColors");
|
|
7
|
+
// Constants
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
const getDomainColor = (domain) => {
|
|
10
|
+
if (!domain)
|
|
11
|
+
return constants_1.DOMAIN_COLORS[0];
|
|
12
|
+
let hash = 0;
|
|
13
|
+
for (let i = 0; i < domain.length; i++) {
|
|
14
|
+
hash = domain.charCodeAt(i) + ((hash << 5) - hash);
|
|
15
|
+
}
|
|
16
|
+
return constants_1.DOMAIN_COLORS[Math.abs(hash) % constants_1.DOMAIN_COLORS.length];
|
|
17
|
+
};
|
|
18
|
+
exports.getDomainColor = getDomainColor;
|
|
19
|
+
const formatDateTime = (timestamp) => {
|
|
20
|
+
const date = new Date(timestamp);
|
|
21
|
+
const pad = (n, len = 2) => String(n).padStart(len, '0');
|
|
22
|
+
const day = pad(date.getDate());
|
|
23
|
+
const month = pad(date.getMonth() + 1);
|
|
24
|
+
const year = date.getFullYear();
|
|
25
|
+
const hours = pad(date.getHours());
|
|
26
|
+
const minutes = pad(date.getMinutes());
|
|
27
|
+
const seconds = pad(date.getSeconds());
|
|
28
|
+
return `${day}/${month}/${year} ${hours}:${minutes}:${seconds}`;
|
|
29
|
+
};
|
|
30
|
+
exports.formatDateTime = formatDateTime;
|
|
31
|
+
const getStatusColor = (status) => {
|
|
32
|
+
if (!status || status === 0)
|
|
33
|
+
return AppColors_1.AppColors.errorColor;
|
|
34
|
+
if (status >= 500)
|
|
35
|
+
return AppColors_1.AppColors.errorColor;
|
|
36
|
+
if (status >= 400)
|
|
37
|
+
return AppColors_1.AppColors.darkOrange;
|
|
38
|
+
if (status >= 300)
|
|
39
|
+
return AppColors_1.AppColors.warningIconGold;
|
|
40
|
+
return AppColors_1.AppColors.greenColor;
|
|
41
|
+
};
|
|
42
|
+
exports.getStatusColor = getStatusColor;
|
|
43
|
+
const getDurationColor = (duration) => {
|
|
44
|
+
if (duration == null)
|
|
45
|
+
return AppColors_1.AppColors.grayTextWeak;
|
|
46
|
+
if (duration < constants_1.DURATION_FAST_MS)
|
|
47
|
+
return AppColors_1.AppColors.greenColor;
|
|
48
|
+
if (duration < constants_1.DURATION_SLOW_MS)
|
|
49
|
+
return AppColors_1.AppColors.lightOrange;
|
|
50
|
+
return AppColors_1.AppColors.errorColor;
|
|
51
|
+
};
|
|
52
|
+
exports.getDurationColor = getDurationColor;
|
|
53
|
+
const getSize = (data) => {
|
|
54
|
+
try {
|
|
55
|
+
const bytes = JSON.stringify(data)?.length ?? 0;
|
|
56
|
+
return bytes < 1024 ? `${bytes} B` : `${(bytes / 1024).toFixed(1)} KB`;
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return '—';
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.getSize = getSize;
|
|
63
|
+
const copyToClipboard = (value, label) => {
|
|
64
|
+
const text = typeof value === 'string' ? value : JSON.stringify(value, null, 2);
|
|
65
|
+
react_native_1.Clipboard.setString(text ?? '');
|
|
66
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
67
|
+
react_native_1.ToastAndroid.show(`${label} copied`, react_native_1.ToastAndroid.SHORT);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
react_native_1.Alert.alert('Copied', `${label} copied to clipboard`, [{ text: 'OK' }]);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
exports.copyToClipboard = copyToClipboard;
|
|
74
|
+
const getPath = (url) => {
|
|
75
|
+
try {
|
|
76
|
+
const u = new URL(url);
|
|
77
|
+
return u.pathname + (u.search ? u.search : '');
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
const withoutDomain = url.replace(/^https?:\/\/[^/?#]+/, '');
|
|
81
|
+
return withoutDomain || '/';
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
exports.getPath = getPath;
|
|
85
|
+
const getCurlCommand = (log) => {
|
|
86
|
+
let cmd = `curl -X ${log.method} "${log.url}"`;
|
|
87
|
+
if (log.requestHeaders) {
|
|
88
|
+
Object.entries(log.requestHeaders).forEach(([k, v]) => {
|
|
89
|
+
cmd += ` \\\n -H "${k}: ${v}"`;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (log.request && log.method !== 'GET') {
|
|
93
|
+
const body = typeof log.request === 'string'
|
|
94
|
+
? log.request
|
|
95
|
+
: JSON.stringify(log.request);
|
|
96
|
+
cmd += ` \\\n -d '${body.replace(/'/g, "'\\''")}'`;
|
|
97
|
+
}
|
|
98
|
+
return cmd;
|
|
99
|
+
};
|
|
100
|
+
exports.getCurlCommand = getCurlCommand;
|
|
101
|
+
const getFetchCommand = (log) => {
|
|
102
|
+
const opts = { method: log.method };
|
|
103
|
+
if (log.requestHeaders && Object.keys(log.requestHeaders).length > 0) {
|
|
104
|
+
opts.headers = log.requestHeaders;
|
|
105
|
+
}
|
|
106
|
+
if (log.request && log.method !== 'GET') {
|
|
107
|
+
opts.body = JSON.stringify(log.request);
|
|
108
|
+
}
|
|
109
|
+
return `fetch("${log.url}", ${JSON.stringify(opts, null, 2)})`;
|
|
110
|
+
};
|
|
111
|
+
exports.getFetchCommand = getFetchCommand;
|
|
112
|
+
const deduplicateLogs = (raw) => {
|
|
113
|
+
const map = new Map();
|
|
114
|
+
raw.forEach(entry => {
|
|
115
|
+
if (!map.has(entry.id) || entry.status != null) {
|
|
116
|
+
map.set(entry.id, entry);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
return Array.from(map.values()).sort((a, b) => b.id - a.id);
|
|
120
|
+
};
|
|
121
|
+
exports.deduplicateLogs = deduplicateLogs;
|
|
122
|
+
const escapeRegex = (str) => {
|
|
123
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
124
|
+
};
|
|
125
|
+
exports.escapeRegex = escapeRegex;
|
|
126
|
+
const getNavigationInfo = (state, path = []) => {
|
|
127
|
+
if (!state?.routes) {
|
|
128
|
+
return {
|
|
129
|
+
path: path.length > 0 ? path.join(' ➔ ') : 'Navigators',
|
|
130
|
+
params: null,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const route = state.routes[state.index ?? 0];
|
|
134
|
+
if (!route) {
|
|
135
|
+
return {
|
|
136
|
+
path: path.length > 0 ? path.join(' ➔ ') : 'Navigators',
|
|
137
|
+
params: null,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
const currentPath = route.name ? [...path, route.name] : path;
|
|
141
|
+
if (route?.state) {
|
|
142
|
+
return (0, exports.getNavigationInfo)(route.state, currentPath);
|
|
143
|
+
}
|
|
144
|
+
const resolved = currentPath.length > 0 ? currentPath.join(' ➔ ') : 'Navigators';
|
|
145
|
+
return { path: resolved, params: route.params || null };
|
|
146
|
+
};
|
|
147
|
+
exports.getNavigationInfo = getNavigationInfo;
|
|
148
|
+
const flattenObject = (obj, prefix = '') => {
|
|
149
|
+
let result = {};
|
|
150
|
+
if (typeof obj === 'object' && obj !== null) {
|
|
151
|
+
if (Array.isArray(obj)) {
|
|
152
|
+
obj.forEach((v, i) => {
|
|
153
|
+
Object.assign(result, (0, exports.flattenObject)(v, prefix ? `${prefix}[${i}]` : `[${i}]`));
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
Object.keys(obj).forEach(k => {
|
|
158
|
+
Object.assign(result, (0, exports.flattenObject)(obj[k], prefix ? `${prefix}.${k}` : k));
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
result[prefix || 'root'] = obj;
|
|
164
|
+
}
|
|
165
|
+
return result;
|
|
166
|
+
};
|
|
167
|
+
exports.flattenObject = flattenObject;
|
|
168
|
+
const getDiff = (oldObj, newObj) => {
|
|
169
|
+
const oldFlat = (0, exports.flattenObject)(oldObj);
|
|
170
|
+
const newFlat = (0, exports.flattenObject)(newObj);
|
|
171
|
+
const diff = [];
|
|
172
|
+
const allKeys = new Set([...Object.keys(oldFlat), ...Object.keys(newFlat)]);
|
|
173
|
+
allKeys.forEach(k => {
|
|
174
|
+
if (!(k in oldFlat)) {
|
|
175
|
+
diff.push({ type: 'added', path: k, newVal: newFlat[k] });
|
|
176
|
+
}
|
|
177
|
+
else if (!(k in newFlat)) {
|
|
178
|
+
diff.push({ type: 'removed', path: k, oldVal: oldFlat[k] });
|
|
179
|
+
}
|
|
180
|
+
else if (oldFlat[k] !== newFlat[k]) {
|
|
181
|
+
diff.push({
|
|
182
|
+
type: 'changed',
|
|
183
|
+
path: k,
|
|
184
|
+
oldVal: oldFlat[k],
|
|
185
|
+
newVal: newFlat[k],
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
return diff.sort((a, b) => a.path.localeCompare(b.path));
|
|
190
|
+
};
|
|
191
|
+
exports.getDiff = getDiff;
|
|
192
|
+
const formatDisplayUrl = (url) => {
|
|
193
|
+
if (!url)
|
|
194
|
+
return '';
|
|
195
|
+
if (url.startsWith('http://') || url.startsWith('https://'))
|
|
196
|
+
return url;
|
|
197
|
+
return `https://${url}`;
|
|
198
|
+
};
|
|
199
|
+
exports.formatDisplayUrl = formatDisplayUrl;
|
|
200
|
+
const getLocalizedFilePath = (path, country, language) => {
|
|
201
|
+
const url = path.replace('country-language', `${country?.toLowerCase()}-${language?.toLowerCase()}`);
|
|
202
|
+
return url;
|
|
203
|
+
};
|
|
204
|
+
exports.getLocalizedFilePath = getLocalizedFilePath;
|
|
205
|
+
const getLocalizedFilePathWithSlash = (path, country, language) => {
|
|
206
|
+
const url = path.replace('country/language', `${country?.toLowerCase()}/${language?.toLowerCase()}`);
|
|
207
|
+
return url;
|
|
208
|
+
};
|
|
209
|
+
exports.getLocalizedFilePathWithSlash = getLocalizedFilePathWithSlash;
|
|
210
|
+
const isAllValuesEmpty = (obj) => {
|
|
211
|
+
if (!obj || typeof obj !== 'object')
|
|
212
|
+
return true;
|
|
213
|
+
return Object.values(obj).every(value => value &&
|
|
214
|
+
typeof value === 'object' &&
|
|
215
|
+
!Array.isArray(value) &&
|
|
216
|
+
Object.keys(value).length === 0);
|
|
217
|
+
};
|
|
218
|
+
exports.isAllValuesEmpty = isAllValuesEmpty;
|
|
219
|
+
const formatDateTimeToAnalytics = (ts) => {
|
|
220
|
+
const d = new Date(ts);
|
|
221
|
+
return d?.toLocaleString(undefined, {
|
|
222
|
+
month: 'short',
|
|
223
|
+
day: 'numeric',
|
|
224
|
+
hour: '2-digit',
|
|
225
|
+
minute: '2-digit',
|
|
226
|
+
second: '2-digit',
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
exports.formatDateTimeToAnalytics = formatDateTimeToAnalytics;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const NetworkInspector: () => React.JSX.Element;
|
|
3
|
+
export default NetworkInspector;
|
|
4
|
+
export { setupNetworkLogger, clearNetworkLogs, subscribeNetworkLogs, } from './customHooks/networkLogger';
|
|
5
|
+
export { setupConsoleLogger, clearConsoleLogs, subscribeConsoleLogs, } from './customHooks/consoleLogger';
|
|
6
|
+
export { setupAnalyticsLogger, logAnalyticsEvent, subscribeAnalyticsEvents, clearAnalyticsEvents, } from './customHooks/analyticsLogger';
|
|
7
|
+
export { getWebViewLogs, getWebViewNavHistory, getWebViewHtml, getWebViewCss, getWebViewJs, getWebViewHtmlUrl, clearWebViewData, subscribeWebView, } from './customHooks/webViewLogger';
|