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,132 @@
|
|
|
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
|
+
const react_1 = __importDefault(require("react"));
|
|
40
|
+
const react_native_1 = require("react-native");
|
|
41
|
+
const react_native_svg_1 = __importStar(require("react-native-svg"));
|
|
42
|
+
// Components
|
|
43
|
+
const CopyButton_1 = __importDefault(require("./CopyButton"));
|
|
44
|
+
// Custom Hooks
|
|
45
|
+
const useAccordion_1 = __importDefault(require("../customHooks/useAccordion"));
|
|
46
|
+
// Assets
|
|
47
|
+
const NetworkIcons_1 = require("./NetworkIcons");
|
|
48
|
+
// Stylesheet
|
|
49
|
+
const AppColors_1 = require("../styles/AppColors");
|
|
50
|
+
const styles_1 = __importDefault(require("../styles"));
|
|
51
|
+
const SourcePageCard = ({ routeInfo }) => {
|
|
52
|
+
const main = (0, useAccordion_1.default)(true, 600, 280);
|
|
53
|
+
const params = (0, useAccordion_1.default)(false, 800, 260);
|
|
54
|
+
const hasParams = routeInfo.params && Object.keys(routeInfo.params).length > 0;
|
|
55
|
+
return (<react_native_1.View style={styles_1.default.sourcePageCard}>
|
|
56
|
+
<react_native_1.Pressable onPress={main.toggleOpen} hitSlop={12}>
|
|
57
|
+
<react_native_1.View style={styles_1.default.sourcePageAccordionHeader}>
|
|
58
|
+
<react_native_1.View style={styles_1.default.sourcePageTop}>
|
|
59
|
+
<react_native_1.View style={styles_1.default.sourcePageIcon}>
|
|
60
|
+
<react_native_svg_1.default width={14} height={14} viewBox="0 0 24 24" fill="none">
|
|
61
|
+
<react_native_svg_1.Rect x="3" y="3" width="7" height="7" rx="1.5" stroke={AppColors_1.AppColors.purple} strokeWidth="2"/>
|
|
62
|
+
<react_native_svg_1.Rect x="14" y="3" width="7" height="7" rx="1.5" stroke={AppColors_1.AppColors.purple} strokeWidth="2"/>
|
|
63
|
+
<react_native_svg_1.Rect x="3" y="14" width="7" height="7" rx="1.5" stroke={AppColors_1.AppColors.purple} strokeWidth="2"/>
|
|
64
|
+
<react_native_svg_1.Path d="M14 17.5h7M17.5 14v7" stroke={AppColors_1.AppColors.purple} strokeWidth="2" strokeLinecap="round"/>
|
|
65
|
+
</react_native_svg_1.default>
|
|
66
|
+
</react_native_1.View>
|
|
67
|
+
<react_native_1.View style={{ flex: 1 }}>
|
|
68
|
+
<react_native_1.Text style={styles_1.default.sourcePageLabel}>Source Page</react_native_1.Text>
|
|
69
|
+
<react_native_1.Text style={styles_1.default.sourcePageValue} numberOfLines={1}>
|
|
70
|
+
{routeInfo.path}
|
|
71
|
+
</react_native_1.Text>
|
|
72
|
+
</react_native_1.View>
|
|
73
|
+
</react_native_1.View>
|
|
74
|
+
<react_native_1.View style={styles_1.default.sourcePageHeaderRight}>
|
|
75
|
+
<CopyButton_1.default value={routeInfo.path} label="Source Path"/>
|
|
76
|
+
<react_native_1.View style={styles_1.default.iconSquareBtn}>
|
|
77
|
+
<react_native_1.Animated.View style={main.chevronStyle}>
|
|
78
|
+
<NetworkIcons_1.ChevronIcon color={AppColors_1.AppColors.grayTextStrong} size={14}/>
|
|
79
|
+
</react_native_1.Animated.View>
|
|
80
|
+
</react_native_1.View>
|
|
81
|
+
</react_native_1.View>
|
|
82
|
+
</react_native_1.View>
|
|
83
|
+
</react_native_1.Pressable>
|
|
84
|
+
|
|
85
|
+
<react_native_1.Animated.View style={main.bodyStyle}>
|
|
86
|
+
{hasParams && (<react_native_1.View style={styles_1.default.sourceParamsBox}>
|
|
87
|
+
<react_native_1.Pressable onPress={params.toggleOpen} hitSlop={10}>
|
|
88
|
+
<react_native_1.View style={styles_1.default.paramsAccordionHeader}>
|
|
89
|
+
<react_native_1.View style={styles_1.default.paramsAccordionLeft}>
|
|
90
|
+
<react_native_1.Text style={styles_1.default.sourceParamsLabel}>Parameters</react_native_1.Text>
|
|
91
|
+
<react_native_1.View style={styles_1.default.headerCountBadge}>
|
|
92
|
+
<react_native_1.Text style={styles_1.default.headerCountText}>
|
|
93
|
+
{Object.keys(routeInfo.params).length}
|
|
94
|
+
</react_native_1.Text>
|
|
95
|
+
</react_native_1.View>
|
|
96
|
+
</react_native_1.View>
|
|
97
|
+
<react_native_1.View style={styles_1.default.paramsAccordionRight}>
|
|
98
|
+
<CopyButton_1.default value={routeInfo.params} label="Parameters"/>
|
|
99
|
+
<react_native_1.View style={styles_1.default.iconSquareBtn}>
|
|
100
|
+
<react_native_1.Animated.View style={params.chevronStyle}>
|
|
101
|
+
<NetworkIcons_1.ChevronIcon color={AppColors_1.AppColors.grayTextStrong} size={14}/>
|
|
102
|
+
</react_native_1.Animated.View>
|
|
103
|
+
</react_native_1.View>
|
|
104
|
+
</react_native_1.View>
|
|
105
|
+
</react_native_1.View>
|
|
106
|
+
</react_native_1.Pressable>
|
|
107
|
+
|
|
108
|
+
<react_native_1.Animated.View style={params.bodyStyle}>
|
|
109
|
+
<react_native_1.View style={styles_1.default.paramsBody}>
|
|
110
|
+
{Object.entries(routeInfo.params).map(([key, val], i, arr) => (<react_native_1.View key={key} style={[
|
|
111
|
+
styles_1.default.paramRow,
|
|
112
|
+
i < arr.length - 1 ? styles_1.default.paramRowBorder : null,
|
|
113
|
+
]}>
|
|
114
|
+
<react_native_1.Text style={styles_1.default.paramKey}>{key}</react_native_1.Text>
|
|
115
|
+
<react_native_1.View style={styles_1.default.paramValueRow}>
|
|
116
|
+
<react_native_1.Text selectable style={styles_1.default.paramValue}>
|
|
117
|
+
{typeof val === 'object'
|
|
118
|
+
? JSON.stringify(val)
|
|
119
|
+
: String(val)}
|
|
120
|
+
</react_native_1.Text>
|
|
121
|
+
<CopyButton_1.default value={typeof val === 'object'
|
|
122
|
+
? JSON.stringify(val)
|
|
123
|
+
: String(val)} label={key}/>
|
|
124
|
+
</react_native_1.View>
|
|
125
|
+
</react_native_1.View>))}
|
|
126
|
+
</react_native_1.View>
|
|
127
|
+
</react_native_1.Animated.View>
|
|
128
|
+
</react_native_1.View>)}
|
|
129
|
+
</react_native_1.Animated.View>
|
|
130
|
+
</react_native_1.View>);
|
|
131
|
+
};
|
|
132
|
+
exports.default = SourcePageCard;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const TouchableScale: ({ onPress, style, children, hitSlop, disabled, }: {
|
|
3
|
+
onPress?: () => void;
|
|
4
|
+
style?: any;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
hitSlop?: any;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export default TouchableScale;
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
const react_1 = __importStar(require("react"));
|
|
37
|
+
const react_native_1 = require("react-native");
|
|
38
|
+
const TouchableScale = ({ onPress, style, children, hitSlop, disabled, }) => {
|
|
39
|
+
const scale = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
|
|
40
|
+
return (<react_native_1.Pressable disabled={disabled} style={style} onPressIn={() => react_native_1.Animated.spring(scale, { toValue: 0.94, useNativeDriver: true }).start()} onPressOut={() => react_native_1.Animated.spring(scale, { toValue: 1, useNativeDriver: true }).start()} onPress={onPress} hitSlop={hitSlop}>
|
|
41
|
+
<react_native_1.Animated.View style={{ transform: [{ scale }] }}>{children}</react_native_1.Animated.View>
|
|
42
|
+
</react_native_1.Pressable>);
|
|
43
|
+
};
|
|
44
|
+
exports.default = TouchableScale;
|
|
@@ -0,0 +1,140 @@
|
|
|
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
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const react_native_1 = require("react-native");
|
|
41
|
+
// Helpers
|
|
42
|
+
const helpers_1 = require("../helpers");
|
|
43
|
+
// Assets
|
|
44
|
+
const NetworkIcons_1 = require("./NetworkIcons");
|
|
45
|
+
// Stylesheet
|
|
46
|
+
const AppColors_1 = require("../styles/AppColors");
|
|
47
|
+
const styles_1 = __importDefault(require("../styles"));
|
|
48
|
+
const TreeNode = react_1.default.memo(function TreeNode({ data, name, level = 0, search, forceOpen, }) {
|
|
49
|
+
const [localOpen, setLocalOpen] = (0, react_1.useState)(level < 1);
|
|
50
|
+
const open = forceOpen !== undefined ? forceOpen : localOpen;
|
|
51
|
+
const isObject = typeof data === 'object' && data !== null;
|
|
52
|
+
const isArray = Array.isArray(data);
|
|
53
|
+
function renderHighlighted(text) {
|
|
54
|
+
if (text === 'null' || text === 'undefined') {
|
|
55
|
+
return [
|
|
56
|
+
<react_native_1.Text key="nil" style={styles_1.default.codeTextNil}>
|
|
57
|
+
{text}
|
|
58
|
+
</react_native_1.Text>,
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
if (!search) {
|
|
62
|
+
return [
|
|
63
|
+
<react_native_1.Text key="plain" style={styles_1.default.codeText}>
|
|
64
|
+
{text}
|
|
65
|
+
</react_native_1.Text>,
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
const regex = new RegExp(`(${(0, helpers_1.escapeRegex)(search)})`, 'gi');
|
|
69
|
+
const parts = text.split(regex);
|
|
70
|
+
return parts.map((part, i) => part.toLowerCase() === search.toLowerCase() ? (<react_native_1.Text key={i} style={styles_1.default.highlight}>
|
|
71
|
+
{part}
|
|
72
|
+
</react_native_1.Text>) : (<react_native_1.Text key={i} style={styles_1.default.codeText}>
|
|
73
|
+
{part}
|
|
74
|
+
</react_native_1.Text>));
|
|
75
|
+
}
|
|
76
|
+
const indentStyle = { paddingLeft: level * 12 };
|
|
77
|
+
if (isObject && data._isFile) {
|
|
78
|
+
const file = data;
|
|
79
|
+
const isImage = file.type?.includes('image');
|
|
80
|
+
return (<react_native_1.View style={[indentStyle, styles_1.default.filePreviewNode]}>
|
|
81
|
+
{name !== undefined && (<react_native_1.Text style={[styles_1.default.codeKey, { marginBottom: 4 }]}>{`"${String(name)}": `}</react_native_1.Text>)}
|
|
82
|
+
<react_native_1.View style={styles_1.default.filePreviewCard}>
|
|
83
|
+
{isImage ? (<react_native_1.Image source={{ uri: file.uri }} style={styles_1.default.filePreviewThumb} resizeMode="cover"/>) : (<react_native_1.View style={styles_1.default.filePreviewDoc}>
|
|
84
|
+
<react_native_1.Text style={{ fontSize: 20 }}>📄</react_native_1.Text>
|
|
85
|
+
</react_native_1.View>)}
|
|
86
|
+
<react_native_1.View style={{ flex: 1 }}>
|
|
87
|
+
<react_native_1.Text style={styles_1.default.filePreviewName} numberOfLines={1}>
|
|
88
|
+
{file.name}
|
|
89
|
+
</react_native_1.Text>
|
|
90
|
+
<react_native_1.Text style={styles_1.default.filePreviewType}>{file.type}</react_native_1.Text>
|
|
91
|
+
</react_native_1.View>
|
|
92
|
+
</react_native_1.View>
|
|
93
|
+
</react_native_1.View>);
|
|
94
|
+
}
|
|
95
|
+
if (!isObject) {
|
|
96
|
+
const serialized = JSON.stringify(data) ?? String(data);
|
|
97
|
+
const prefix = name !== undefined ? `"${String(name)}": ` : null;
|
|
98
|
+
return (<react_native_1.View style={indentStyle}>
|
|
99
|
+
<react_native_1.Text selectable={true} style={styles_1.default.codeText}>
|
|
100
|
+
<react_native_1.Text style={styles_1.default.codeKey}>{prefix}</react_native_1.Text>
|
|
101
|
+
{renderHighlighted(serialized)}
|
|
102
|
+
</react_native_1.Text>
|
|
103
|
+
</react_native_1.View>);
|
|
104
|
+
}
|
|
105
|
+
const entries = isArray
|
|
106
|
+
? data.map((v, i) => [i, v])
|
|
107
|
+
: Object.entries(data);
|
|
108
|
+
const countLabel = isArray ? `[${entries.length}]` : `{${entries.length}}`;
|
|
109
|
+
const treeChevronAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(open ? 1 : 0)).current;
|
|
110
|
+
(0, react_1.useEffect)(() => {
|
|
111
|
+
react_native_1.Animated.timing(treeChevronAnim, {
|
|
112
|
+
toValue: open ? 1 : 0,
|
|
113
|
+
duration: 160,
|
|
114
|
+
useNativeDriver: true,
|
|
115
|
+
}).start();
|
|
116
|
+
}, [open]);
|
|
117
|
+
const treeChevronRotate = treeChevronAnim.interpolate({
|
|
118
|
+
inputRange: [0, 1],
|
|
119
|
+
outputRange: ['0deg', '180deg'],
|
|
120
|
+
});
|
|
121
|
+
return (<react_native_1.View style={indentStyle}>
|
|
122
|
+
<react_native_1.Pressable style={styles_1.default.treeRow} onPress={() => setLocalOpen(v => !v)} hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}>
|
|
123
|
+
<react_native_1.Animated.View style={{ transform: [{ rotate: treeChevronRotate }], marginRight: 6 }}>
|
|
124
|
+
<NetworkIcons_1.ChevronIcon color={AppColors_1.AppColors.grayTextWeak} size={12}/>
|
|
125
|
+
</react_native_1.Animated.View>
|
|
126
|
+
{name !== undefined && (<react_native_1.Text style={[styles_1.default.codeKey, styles_1.default.treeKeyMargin]}>{`"${String(name)}"`}</react_native_1.Text>)}
|
|
127
|
+
{isArray ? (<react_native_1.View style={styles_1.default.arrayBadge}>
|
|
128
|
+
<react_native_1.Text style={styles_1.default.arrayBadgeText}>{countLabel}</react_native_1.Text>
|
|
129
|
+
</react_native_1.View>) : (<react_native_1.View style={styles_1.default.objectBadge}>
|
|
130
|
+
<react_native_1.Text style={styles_1.default.objectBadgeText}>{countLabel}</react_native_1.Text>
|
|
131
|
+
</react_native_1.View>)}
|
|
132
|
+
</react_native_1.Pressable>
|
|
133
|
+
|
|
134
|
+
{open &&
|
|
135
|
+
entries.map(([k, v]) => (<TreeNode key={String(k)} name={k} data={v} level={level + 1} search={search} forceOpen={forceOpen}/>))}
|
|
136
|
+
|
|
137
|
+
{open && <react_native_1.Text style={styles_1.default.codeSyntax}>{isArray ? ']' : '}'}</react_native_1.Text>}
|
|
138
|
+
</react_native_1.View>);
|
|
139
|
+
});
|
|
140
|
+
exports.default = TreeNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Method } from '../types';
|
|
2
|
+
import { StatusFilter } from '../types';
|
|
3
|
+
export declare const STATUS_FILTERS: StatusFilter[];
|
|
4
|
+
export declare const METHOD_COLORS: Record<Method, string>;
|
|
5
|
+
export declare const DOMAIN_COLORS: string[];
|
|
6
|
+
export declare const DURATION_FAST_MS = 200;
|
|
7
|
+
export declare const DURATION_SLOW_MS = 800;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DURATION_SLOW_MS = exports.DURATION_FAST_MS = exports.DOMAIN_COLORS = exports.METHOD_COLORS = exports.STATUS_FILTERS = void 0;
|
|
4
|
+
// Styles
|
|
5
|
+
const AppColors_1 = require("../styles/AppColors");
|
|
6
|
+
exports.STATUS_FILTERS = [
|
|
7
|
+
'ALL',
|
|
8
|
+
'2xx',
|
|
9
|
+
'3xx',
|
|
10
|
+
'4xx',
|
|
11
|
+
'5xx',
|
|
12
|
+
'Failed',
|
|
13
|
+
];
|
|
14
|
+
exports.METHOD_COLORS = {
|
|
15
|
+
ALL: AppColors_1.AppColors.grayText,
|
|
16
|
+
GET: AppColors_1.AppColors.purple,
|
|
17
|
+
POST: AppColors_1.AppColors.greenColor,
|
|
18
|
+
PUT: AppColors_1.AppColors.lightOrange,
|
|
19
|
+
PATCH: AppColors_1.AppColors.offerPurple,
|
|
20
|
+
DELETE: AppColors_1.AppColors.errorColor,
|
|
21
|
+
};
|
|
22
|
+
exports.DOMAIN_COLORS = [
|
|
23
|
+
'#1a5276',
|
|
24
|
+
'#8e44ad',
|
|
25
|
+
'#1e8449',
|
|
26
|
+
'#c0392b',
|
|
27
|
+
'#d35400',
|
|
28
|
+
'#d68910',
|
|
29
|
+
'#16a085',
|
|
30
|
+
'#27ae60',
|
|
31
|
+
'#2c3e50',
|
|
32
|
+
'#c2185b',
|
|
33
|
+
];
|
|
34
|
+
exports.DURATION_FAST_MS = 200;
|
|
35
|
+
exports.DURATION_SLOW_MS = 800;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AnalyticsEvent } from '../types';
|
|
2
|
+
export declare const subscribeAnalyticsEvents: (callback: (events: AnalyticsEvent[]) => void) => () => void;
|
|
3
|
+
export declare const clearAnalyticsEvents: () => void;
|
|
4
|
+
export declare const getAnalyticsEvents: () => AnalyticsEvent[];
|
|
5
|
+
/**
|
|
6
|
+
* Directly push an event into the inspector without going through Firebase.
|
|
7
|
+
* Useful for custom analytics wrappers or testing.
|
|
8
|
+
*/
|
|
9
|
+
export declare const logAnalyticsEvent: (name: string, params?: Record<string, any>, userProperties?: Record<string, any>) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Monkey-patches a @react-native-firebase/analytics instance so all calls
|
|
12
|
+
* are intercepted and forwarded to the NetworkInspector analytics tab.
|
|
13
|
+
*
|
|
14
|
+
* Pass the result of `analytics()` (the default app instance or any named one).
|
|
15
|
+
* Safe to call multiple times with the same instance — won't double-patch.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* import analytics from '@react-native-firebase/analytics';
|
|
19
|
+
* setupAnalyticsLogger(analytics());
|
|
20
|
+
*/
|
|
21
|
+
export declare const setupAnalyticsLogger: (analyticsInstance: any) => void;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ─── Analytics Logger ─────────────────────────────────────────────────────────
|
|
3
|
+
//
|
|
4
|
+
// Captures @react-native-firebase/analytics events by monkey-patching the
|
|
5
|
+
// analytics instance returned by `analytics()`.
|
|
6
|
+
//
|
|
7
|
+
// Setup (call once at app startup, before any analytics calls):
|
|
8
|
+
//
|
|
9
|
+
// import analytics from '@react-native-firebase/analytics';
|
|
10
|
+
// import { setupAnalyticsLogger } from './network/analyticsLogger';
|
|
11
|
+
//
|
|
12
|
+
// setupAnalyticsLogger(analytics());
|
|
13
|
+
//
|
|
14
|
+
// That's it — every subsequent logEvent / logScreenView / setUserProperty call
|
|
15
|
+
// will be intercepted and shown in the Analytics tab of NetworkInspector.
|
|
16
|
+
//
|
|
17
|
+
// Patched methods:
|
|
18
|
+
// logEvent(name, params)
|
|
19
|
+
// logScreenView({ screen_name, screen_class })
|
|
20
|
+
// setUserProperty(name, value)
|
|
21
|
+
// setUserProperties(properties)
|
|
22
|
+
// setUserId(id)
|
|
23
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.setupAnalyticsLogger = exports.logAnalyticsEvent = exports.getAnalyticsEvents = exports.clearAnalyticsEvents = exports.subscribeAnalyticsEvents = void 0;
|
|
26
|
+
// ─── Internal state ───────────────────────────────────────────────────────────
|
|
27
|
+
let events = [];
|
|
28
|
+
let listeners = [];
|
|
29
|
+
let counter = 0;
|
|
30
|
+
// Running snapshot of user properties set so far — attached to every event
|
|
31
|
+
let currentUserProperties = {};
|
|
32
|
+
let currentUserId;
|
|
33
|
+
// ─── Core helpers ─────────────────────────────────────────────────────────────
|
|
34
|
+
const notify = () => {
|
|
35
|
+
const snapshot = [...events];
|
|
36
|
+
listeners.forEach((cb) => cb(snapshot));
|
|
37
|
+
};
|
|
38
|
+
const addEvent = (event) => {
|
|
39
|
+
events.unshift(event);
|
|
40
|
+
events = events.slice(0, 200);
|
|
41
|
+
notify();
|
|
42
|
+
};
|
|
43
|
+
// ─── Public subscribe / query API ────────────────────────────────────────────
|
|
44
|
+
const subscribeAnalyticsEvents = (callback) => {
|
|
45
|
+
listeners.push(callback);
|
|
46
|
+
callback([...events]);
|
|
47
|
+
return () => {
|
|
48
|
+
listeners = listeners.filter((l) => l !== callback);
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
exports.subscribeAnalyticsEvents = subscribeAnalyticsEvents;
|
|
52
|
+
const clearAnalyticsEvents = () => {
|
|
53
|
+
events = [];
|
|
54
|
+
notify();
|
|
55
|
+
};
|
|
56
|
+
exports.clearAnalyticsEvents = clearAnalyticsEvents;
|
|
57
|
+
const getAnalyticsEvents = () => [...events];
|
|
58
|
+
exports.getAnalyticsEvents = getAnalyticsEvents;
|
|
59
|
+
// ─── Manual logging (escape hatch, rarely needed) ────────────────────────────
|
|
60
|
+
/**
|
|
61
|
+
* Directly push an event into the inspector without going through Firebase.
|
|
62
|
+
* Useful for custom analytics wrappers or testing.
|
|
63
|
+
*/
|
|
64
|
+
const logAnalyticsEvent = (name, params = {}, userProperties = {}) => {
|
|
65
|
+
addEvent({
|
|
66
|
+
id: counter++,
|
|
67
|
+
name,
|
|
68
|
+
params,
|
|
69
|
+
userProperties: { ...currentUserProperties, ...userProperties },
|
|
70
|
+
timestamp: Date.now(),
|
|
71
|
+
source: "manual",
|
|
72
|
+
userId: currentUserId ?? "",
|
|
73
|
+
screenName: "",
|
|
74
|
+
screenClass: "",
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
exports.logAnalyticsEvent = logAnalyticsEvent;
|
|
78
|
+
// ─── Firebase Analytics instance patcher ─────────────────────────────────────
|
|
79
|
+
/**
|
|
80
|
+
* Monkey-patches a @react-native-firebase/analytics instance so all calls
|
|
81
|
+
* are intercepted and forwarded to the NetworkInspector analytics tab.
|
|
82
|
+
*
|
|
83
|
+
* Pass the result of `analytics()` (the default app instance or any named one).
|
|
84
|
+
* Safe to call multiple times with the same instance — won't double-patch.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* import analytics from '@react-native-firebase/analytics';
|
|
88
|
+
* setupAnalyticsLogger(analytics());
|
|
89
|
+
*/
|
|
90
|
+
const setupAnalyticsLogger = (analyticsInstance) => {
|
|
91
|
+
if (!analyticsInstance) {
|
|
92
|
+
console.warn("[AnalyticsLogger] No analytics instance provided — skipping setup.");
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
// Guard against double-patching the same instance
|
|
96
|
+
if (analyticsInstance.__INSPECTOR_PATCHED__)
|
|
97
|
+
return;
|
|
98
|
+
analyticsInstance.__INSPECTOR_PATCHED__ = true;
|
|
99
|
+
// ── logEvent ──────────────────────────────────────────────────────────────
|
|
100
|
+
const originalLogEvent = analyticsInstance.logEvent.bind(analyticsInstance);
|
|
101
|
+
analyticsInstance.logEvent = async (name, params) => {
|
|
102
|
+
addEvent({
|
|
103
|
+
id: counter++,
|
|
104
|
+
name,
|
|
105
|
+
params: params ?? {},
|
|
106
|
+
userProperties: { ...currentUserProperties },
|
|
107
|
+
timestamp: Date.now(),
|
|
108
|
+
source: "firebase",
|
|
109
|
+
userId: currentUserId ?? "",
|
|
110
|
+
screenName: "",
|
|
111
|
+
screenClass: "",
|
|
112
|
+
});
|
|
113
|
+
return originalLogEvent(name, params);
|
|
114
|
+
};
|
|
115
|
+
// ── logScreenView ─────────────────────────────────────────────────────────
|
|
116
|
+
const originalLogScreenView = analyticsInstance.logScreenView.bind(analyticsInstance);
|
|
117
|
+
analyticsInstance.logScreenView = async (params) => {
|
|
118
|
+
addEvent({
|
|
119
|
+
id: counter++,
|
|
120
|
+
name: "screen_view",
|
|
121
|
+
params: params ?? {},
|
|
122
|
+
userProperties: { ...currentUserProperties },
|
|
123
|
+
timestamp: Date.now(),
|
|
124
|
+
source: "firebase",
|
|
125
|
+
screenName: params?.screen_name ?? "",
|
|
126
|
+
screenClass: params?.screen_class ?? "",
|
|
127
|
+
userId: currentUserId ?? "",
|
|
128
|
+
});
|
|
129
|
+
return originalLogScreenView(params);
|
|
130
|
+
};
|
|
131
|
+
// ── setUserProperty ───────────────────────────────────────────────────────
|
|
132
|
+
const originalSetUserProperty = analyticsInstance.setUserProperty.bind(analyticsInstance);
|
|
133
|
+
analyticsInstance.setUserProperty = async (name, value) => {
|
|
134
|
+
if (value === null) {
|
|
135
|
+
delete currentUserProperties[name];
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
currentUserProperties[name] = value;
|
|
139
|
+
}
|
|
140
|
+
return originalSetUserProperty(name, value);
|
|
141
|
+
};
|
|
142
|
+
// ── setUserProperties ─────────────────────────────────────────────────────
|
|
143
|
+
const originalSetUserProperties = analyticsInstance.setUserProperties.bind(analyticsInstance);
|
|
144
|
+
analyticsInstance.setUserProperties = async (properties) => {
|
|
145
|
+
Object.entries(properties).forEach(([k, v]) => {
|
|
146
|
+
if (v === null)
|
|
147
|
+
delete currentUserProperties[k];
|
|
148
|
+
else
|
|
149
|
+
currentUserProperties[k] = v;
|
|
150
|
+
});
|
|
151
|
+
return originalSetUserProperties(properties);
|
|
152
|
+
};
|
|
153
|
+
// ── setUserId ─────────────────────────────────────────────────────────────
|
|
154
|
+
const originalSetUserId = analyticsInstance.setUserId.bind(analyticsInstance);
|
|
155
|
+
analyticsInstance.setUserId = async (id) => {
|
|
156
|
+
currentUserId = id ?? undefined;
|
|
157
|
+
return originalSetUserId(id);
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
exports.setupAnalyticsLogger = setupAnalyticsLogger;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConsoleLog } from '../types';
|
|
2
|
+
export declare const subscribeConsoleLogs: (callback: (logs: ConsoleLog[]) => void) => () => void;
|
|
3
|
+
export declare const clearConsoleLogs: () => void;
|
|
4
|
+
export declare const getConsoleLogs: () => ConsoleLog[];
|
|
5
|
+
export declare const setupConsoleLogger: () => void;
|