react-native-xenon 0.2.1 → 0.3.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/README.md +8 -0
- package/lib/commonjs/assets/icons/bug.png +0 -0
- package/lib/commonjs/contexts/index.js +1 -1
- package/lib/commonjs/hooks/index.js +2 -9
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/useConsoleInterceptor.js +4 -4
- package/lib/commonjs/hooks/useConsoleInterceptor.js.map +1 -1
- package/lib/commonjs/hooks/useNetworkInterceptor.js +14 -14
- package/lib/commonjs/hooks/useNetworkInterceptor.js.map +1 -1
- package/lib/commonjs/icons.js +1 -1
- package/lib/commonjs/icons.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/interceptors/ConsoleInterceptor.js +12 -13
- package/lib/commonjs/interceptors/ConsoleInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/FetchInterceptor.js +12 -13
- package/lib/commonjs/interceptors/FetchInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/HttpInterceptor.js +18 -36
- package/lib/commonjs/interceptors/HttpInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/Interceptor.js +9 -3
- package/lib/commonjs/interceptors/Interceptor.js.map +1 -1
- package/lib/commonjs/interceptors/NetworkInterceptor.js +1 -1
- package/lib/commonjs/interceptors/NetworkInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/WebSocketInterceptor.js +40 -64
- package/lib/commonjs/interceptors/WebSocketInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/XHRInterceptor.js +10 -11
- package/lib/commonjs/interceptors/XHRInterceptor.js.map +1 -1
- package/lib/commonjs/interceptors/index.js +4 -4
- package/lib/commonjs/types/index.js +4 -4
- package/lib/commonjs/ui/Xenon.js +19 -13
- package/lib/commonjs/ui/Xenon.js.map +1 -1
- package/lib/commonjs/ui/components/bubble/Bubble.js +8 -7
- package/lib/commonjs/ui/components/bubble/Bubble.js.map +1 -1
- package/lib/commonjs/ui/components/details/DetailsViewer.js +7 -7
- package/lib/commonjs/ui/components/details/DetailsViewer.js.map +1 -1
- package/lib/commonjs/ui/components/details/LogMessageDetails.js +2 -2
- package/lib/commonjs/ui/components/details/NetworkRequestDetails.js +6 -6
- package/lib/commonjs/ui/components/details/NetworkRequestDetails.js.map +1 -1
- package/lib/commonjs/ui/components/headers/DebuggerHeader.js +10 -10
- package/lib/commonjs/ui/components/headers/DebuggerHeader.js.map +1 -1
- package/lib/commonjs/ui/components/headers/NetworkPanelHeader.js +2 -2
- package/lib/commonjs/ui/components/headers/NetworkPanelHeader.js.map +1 -1
- package/lib/commonjs/ui/components/headers/NetworkRequestDetailsHeader.js +1 -1
- package/lib/commonjs/ui/components/index.js +5 -5
- package/lib/commonjs/ui/components/items/ConsolePanelItem.js +2 -2
- package/lib/commonjs/ui/components/items/DebuggerHeaderItem.js +1 -1
- package/lib/commonjs/ui/components/items/NetworkPanelItem.js +2 -2
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsHeaderItem.js +1 -1
- package/lib/commonjs/ui/components/items/NetworkRequestDetailsItem.js +1 -1
- package/lib/commonjs/ui/components/panels/ConsolePanel.js +8 -10
- package/lib/commonjs/ui/components/panels/ConsolePanel.js.map +1 -1
- package/lib/commonjs/ui/components/panels/NetworkPanel.js +17 -18
- package/lib/commonjs/ui/components/panels/NetworkPanel.js.map +1 -1
- package/lib/commonjs/utils.js +8 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/assets/icons/bug.png +0 -0
- package/lib/module/colors.js +5 -1
- package/lib/module/colors.js.map +1 -1
- package/lib/module/constants.js +5 -1
- package/lib/module/constants.js.map +1 -1
- package/lib/module/contexts/MainContext.js +7 -3
- package/lib/module/contexts/MainContext.js.map +1 -1
- package/lib/module/contexts/index.js +11 -1
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/hooks/index.js +18 -3
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useConsoleInterceptor.js +16 -12
- package/lib/module/hooks/useConsoleInterceptor.js.map +1 -1
- package/lib/module/hooks/useNetworkInterceptor.js +31 -27
- package/lib/module/hooks/useNetworkInterceptor.js.map +1 -1
- package/lib/module/icons.js +6 -2
- package/lib/module/icons.js.map +1 -1
- package/lib/module/index.js +11 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/interceptors/ConsoleInterceptor.js +16 -10
- package/lib/module/interceptors/ConsoleInterceptor.js.map +1 -1
- package/lib/module/interceptors/FetchInterceptor.js +20 -15
- package/lib/module/interceptors/FetchInterceptor.js.map +1 -1
- package/lib/module/interceptors/HttpInterceptor.js +24 -37
- package/lib/module/interceptors/HttpInterceptor.js.map +1 -1
- package/lib/module/interceptors/Interceptor.js +13 -2
- package/lib/module/interceptors/Interceptor.js.map +1 -1
- package/lib/module/interceptors/NetworkInterceptor.js +8 -2
- package/lib/module/interceptors/NetworkInterceptor.js.map +1 -1
- package/lib/module/interceptors/WebSocketInterceptor.js +60 -78
- package/lib/module/interceptors/WebSocketInterceptor.js.map +1 -1
- package/lib/module/interceptors/XHRInterceptor.js +16 -11
- package/lib/module/interceptors/XHRInterceptor.js.map +1 -1
- package/lib/module/interceptors/index.js +32 -4
- package/lib/module/interceptors/index.js.map +1 -1
- package/lib/module/types/common.js +6 -2
- package/lib/module/types/common.js.map +1 -1
- package/lib/module/types/http.js +3 -1
- package/lib/module/types/index.js +47 -4
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/websocket.js +3 -1
- package/lib/module/ui/Xenon.js +45 -34
- package/lib/module/ui/Xenon.js.map +1 -1
- package/lib/module/ui/components/bubble/Bubble.js +24 -18
- package/lib/module/ui/components/bubble/Bubble.js.map +1 -1
- package/lib/module/ui/components/details/DetailsViewer.js +17 -12
- package/lib/module/ui/components/details/DetailsViewer.js.map +1 -1
- package/lib/module/ui/components/details/LogMessageDetails.js +15 -10
- package/lib/module/ui/components/details/LogMessageDetails.js.map +1 -1
- package/lib/module/ui/components/details/NetworkRequestDetails.js +48 -43
- package/lib/module/ui/components/details/NetworkRequestDetails.js.map +1 -1
- package/lib/module/ui/components/headers/DebuggerHeader.js +37 -32
- package/lib/module/ui/components/headers/DebuggerHeader.js.map +1 -1
- package/lib/module/ui/components/headers/NetworkPanelHeader.js +26 -21
- package/lib/module/ui/components/headers/NetworkPanelHeader.js.map +1 -1
- package/lib/module/ui/components/headers/NetworkRequestDetailsHeader.js +14 -9
- package/lib/module/ui/components/headers/NetworkRequestDetailsHeader.js.map +1 -1
- package/lib/module/ui/components/index.js +39 -5
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/components/items/ConsolePanelItem.js +15 -10
- package/lib/module/ui/components/items/ConsolePanelItem.js.map +1 -1
- package/lib/module/ui/components/items/DebuggerHeaderItem.js +17 -12
- package/lib/module/ui/components/items/DebuggerHeaderItem.js.map +1 -1
- package/lib/module/ui/components/items/NetworkPanelItem.js +28 -23
- package/lib/module/ui/components/items/NetworkPanelItem.js.map +1 -1
- package/lib/module/ui/components/items/NetworkRequestDetailsHeaderItem.js +14 -9
- package/lib/module/ui/components/items/NetworkRequestDetailsHeaderItem.js.map +1 -1
- package/lib/module/ui/components/items/NetworkRequestDetailsItem.js +15 -10
- package/lib/module/ui/components/items/NetworkRequestDetailsItem.js.map +1 -1
- package/lib/module/ui/components/panels/ConsolePanel.js +23 -20
- package/lib/module/ui/components/panels/ConsolePanel.js.map +1 -1
- package/lib/module/ui/components/panels/NetworkPanel.js +31 -27
- package/lib/module/ui/components/panels/NetworkPanel.js.map +1 -1
- package/lib/module/utils.js +27 -8
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/commonjs/src/hooks/index.d.ts +0 -1
- package/lib/typescript/commonjs/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useNetworkInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/icons.d.ts +1 -1
- package/lib/typescript/commonjs/src/interceptors/ConsoleInterceptor.d.ts +3 -3
- package/lib/typescript/commonjs/src/interceptors/ConsoleInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/FetchInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/HttpInterceptor.d.ts +8 -17
- package/lib/typescript/commonjs/src/interceptors/HttpInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/Interceptor.d.ts +3 -1
- package/lib/typescript/commonjs/src/interceptors/Interceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/NetworkInterceptor.d.ts +1 -1
- package/lib/typescript/commonjs/src/interceptors/NetworkInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/WebSocketInterceptor.d.ts +6 -18
- package/lib/typescript/commonjs/src/interceptors/WebSocketInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/interceptors/XHRInterceptor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/console.d.ts +3 -0
- package/lib/typescript/commonjs/src/types/console.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/http.d.ts +13 -5
- package/lib/typescript/commonjs/src/types/http.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/websocket.d.ts +17 -7
- package/lib/typescript/commonjs/src/types/websocket.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/Xenon.d.ts +1 -0
- package/lib/typescript/commonjs/src/ui/Xenon.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/bubble/Bubble.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/panels/ConsolePanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/ui/components/panels/NetworkPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/index.d.ts +0 -1
- package/lib/typescript/module/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useNetworkInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/icons.d.ts +1 -1
- package/lib/typescript/module/src/interceptors/ConsoleInterceptor.d.ts +3 -3
- package/lib/typescript/module/src/interceptors/ConsoleInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/FetchInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/HttpInterceptor.d.ts +8 -17
- package/lib/typescript/module/src/interceptors/HttpInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/Interceptor.d.ts +3 -1
- package/lib/typescript/module/src/interceptors/Interceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/NetworkInterceptor.d.ts +1 -1
- package/lib/typescript/module/src/interceptors/NetworkInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/WebSocketInterceptor.d.ts +6 -18
- package/lib/typescript/module/src/interceptors/WebSocketInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/interceptors/XHRInterceptor.d.ts.map +1 -1
- package/lib/typescript/module/src/types/console.d.ts +3 -0
- package/lib/typescript/module/src/types/console.d.ts.map +1 -1
- package/lib/typescript/module/src/types/http.d.ts +13 -5
- package/lib/typescript/module/src/types/http.d.ts.map +1 -1
- package/lib/typescript/module/src/types/websocket.d.ts +17 -7
- package/lib/typescript/module/src/types/websocket.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/Xenon.d.ts +1 -0
- package/lib/typescript/module/src/ui/Xenon.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/bubble/Bubble.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/panels/ConsolePanel.d.ts.map +1 -1
- package/lib/typescript/module/src/ui/components/panels/NetworkPanel.d.ts.map +1 -1
- package/lib/typescript/module/src/utils.d.ts +1 -0
- package/lib/typescript/module/src/utils.d.ts.map +1 -1
- package/package.json +8 -4
- package/src/assets/icons/bug.png +0 -0
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useConsoleInterceptor.ts +1 -1
- package/src/hooks/useNetworkInterceptor.ts +31 -41
- package/src/icons.ts +1 -1
- package/src/interceptors/ConsoleInterceptor.ts +11 -10
- package/src/interceptors/FetchInterceptor.ts +6 -7
- package/src/interceptors/HttpInterceptor.ts +19 -48
- package/src/interceptors/Interceptor.ts +11 -1
- package/src/interceptors/NetworkInterceptor.ts +1 -1
- package/src/interceptors/WebSocketInterceptor.ts +37 -81
- package/src/interceptors/XHRInterceptor.ts +7 -6
- package/src/types/console.ts +4 -0
- package/src/types/http.ts +13 -5
- package/src/types/websocket.ts +17 -9
- package/src/ui/Xenon.tsx +10 -11
- package/src/ui/components/bubble/Bubble.tsx +3 -7
- package/src/ui/components/headers/NetworkPanelHeader.tsx +1 -1
- package/src/ui/components/panels/ConsolePanel.tsx +5 -8
- package/src/ui/components/panels/NetworkPanel.tsx +14 -14
- package/src/utils.ts +6 -0
- package/lib/commonjs/assets/icons/code.png +0 -0
- package/lib/commonjs/hooks/useScrollToBottom.js +0 -23
- package/lib/commonjs/hooks/useScrollToBottom.js.map +0 -1
- package/lib/module/assets/icons/code.png +0 -0
- package/lib/module/hooks/useScrollToBottom.js +0 -19
- package/lib/module/hooks/useScrollToBottom.js.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useScrollToBottom.d.ts +0 -3
- package/lib/typescript/commonjs/src/hooks/useScrollToBottom.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useScrollToBottom.d.ts +0 -3
- package/lib/typescript/module/src/hooks/useScrollToBottom.d.ts.map +0 -1
- package/src/assets/icons/code.png +0 -0
- package/src/hooks/useScrollToBottom.ts +0 -23
@@ -1,38 +1,43 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = NetworkRequestDetailsItem;
|
7
|
+
var _reactNative = require("react-native");
|
8
|
+
var _colors = _interopRequireDefault(require("../../../colors"));
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
11
|
+
function NetworkRequestDetailsItem({
|
7
12
|
label,
|
8
13
|
content,
|
9
14
|
selectable
|
10
15
|
}) {
|
11
16
|
if (label) {
|
12
|
-
return /*#__PURE__*/
|
17
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
13
18
|
style: styles.text,
|
14
19
|
selectable: selectable,
|
15
|
-
children: [/*#__PURE__*/
|
20
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
16
21
|
style: styles.label,
|
17
22
|
children: [label, ': ']
|
18
23
|
}), content]
|
19
24
|
});
|
20
25
|
}
|
21
|
-
return /*#__PURE__*/
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
22
27
|
style: styles.text,
|
23
28
|
selectable: selectable,
|
24
29
|
children: content
|
25
30
|
});
|
26
31
|
}
|
27
|
-
const styles = StyleSheet.create({
|
32
|
+
const styles = _reactNative.StyleSheet.create({
|
28
33
|
text: {
|
29
34
|
fontSize: 14,
|
30
|
-
color:
|
35
|
+
color: _colors.default.black
|
31
36
|
},
|
32
37
|
label: {
|
33
38
|
fontSize: 14,
|
34
39
|
fontWeight: 'bold',
|
35
|
-
color:
|
40
|
+
color: _colors.default.black
|
36
41
|
}
|
37
42
|
});
|
38
43
|
//# sourceMappingURL=NetworkRequestDetailsItem.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_reactNative","require","_colors","_interopRequireDefault","_jsxRuntime","e","__esModule","default","NetworkRequestDetailsItem","label","content","selectable","jsxs","Text","style","styles","text","children","jsx","StyleSheet","create","fontSize","color","colors","black","fontWeight"],"sourceRoot":"../../../../../src","sources":["ui/components/items/NetworkRequestDetailsItem.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA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", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = ConsolePanel;
|
7
|
+
var _react = require("react");
|
8
|
+
var _reactNative = require("react-native");
|
9
|
+
var _colors = _interopRequireDefault(require("../../../colors"));
|
10
|
+
var _contexts = require("../../../contexts");
|
11
|
+
var _ConsolePanelItem = _interopRequireDefault(require("../items/ConsolePanelItem"));
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
14
|
+
const Separator = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
11
15
|
style: styles.divider
|
12
16
|
});
|
13
|
-
|
17
|
+
function ConsolePanel() {
|
14
18
|
const {
|
15
19
|
logInterceptor: {
|
16
20
|
logMessages
|
17
21
|
},
|
18
22
|
setPanelSelected,
|
19
23
|
detailsData
|
20
|
-
} = useContext(MainContext);
|
21
|
-
const
|
22
|
-
const renderItem = useCallback(({
|
24
|
+
} = (0, _react.useContext)(_contexts.MainContext);
|
25
|
+
const renderItem = (0, _react.useCallback)(({
|
23
26
|
item
|
24
27
|
}) => {
|
25
|
-
return /*#__PURE__*/
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConsolePanelItem.default, {
|
26
29
|
...item,
|
27
30
|
onPress: () => {
|
28
31
|
detailsData.current = {
|
@@ -32,23 +35,23 @@ export default function ConsolePanel() {
|
|
32
35
|
}
|
33
36
|
});
|
34
37
|
}, [detailsData, setPanelSelected]);
|
35
|
-
return /*#__PURE__*/
|
36
|
-
|
37
|
-
|
38
|
-
data: logMessages,
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
|
39
|
+
inverted: true,
|
40
|
+
data: logMessages.toReversed(),
|
39
41
|
renderItem: renderItem,
|
42
|
+
keyExtractor: (_, index) => index.toString(),
|
40
43
|
ItemSeparatorComponent: Separator,
|
41
|
-
|
44
|
+
style: styles.container
|
42
45
|
});
|
43
46
|
}
|
44
|
-
const styles = StyleSheet.create({
|
47
|
+
const styles = _reactNative.StyleSheet.create({
|
45
48
|
container: {
|
46
49
|
flex: 1,
|
47
50
|
paddingHorizontal: 8
|
48
51
|
},
|
49
52
|
divider: {
|
50
53
|
height: 1,
|
51
|
-
backgroundColor:
|
54
|
+
backgroundColor: _colors.default.gray
|
52
55
|
}
|
53
56
|
});
|
54
57
|
//# sourceMappingURL=ConsolePanel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_colors","_interopRequireDefault","_contexts","_ConsolePanelItem","_jsxRuntime","e","__esModule","default","Separator","jsx","View","style","styles","divider","ConsolePanel","logInterceptor","logMessages","setPanelSelected","detailsData","useContext","MainContext","renderItem","useCallback","item","onPress","current","console","FlatList","inverted","data","toReversed","keyExtractor","_","index","toString","ItemSeparatorComponent","container","StyleSheet","create","flex","paddingHorizontal","height","backgroundColor","colors","gray"],"sourceRoot":"../../../../../src","sources":["ui/components/panels/ConsolePanel.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAEA,IAAAK,iBAAA,GAAAF,sBAAA,CAAAH,OAAA;AAAyD,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAG,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEzD,MAAMG,SAAS,GAAGA,CAAA,kBAAM,IAAAJ,WAAA,CAAAK,GAAA,EAACV,YAAA,CAAAW,IAAI;EAACC,KAAK,EAAEC,MAAM,CAACC;AAAQ,CAAE,CAAC;AAExC,SAASC,YAAYA,CAAA,EAAG;EACrC,MAAM;IACJC,cAAc,EAAE;MAAEC;IAAY,CAAC;IAC/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.default = NetworkPanel;
|
7
|
+
var _react = require("react");
|
8
|
+
var _reactNative = require("react-native");
|
9
|
+
var _colors = _interopRequireDefault(require("../../../colors"));
|
10
|
+
var _contexts = require("../../../contexts");
|
11
|
+
var _types = require("../../../types");
|
12
|
+
var _NetworkPanelHeader = _interopRequireDefault(require("../headers/NetworkPanelHeader"));
|
13
|
+
var _NetworkPanelItem = _interopRequireDefault(require("../items/NetworkPanelItem"));
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
16
|
+
const Separator = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
13
17
|
style: styles.divider
|
14
18
|
});
|
15
|
-
|
19
|
+
function NetworkPanel() {
|
16
20
|
const {
|
17
21
|
networkInterceptor: {
|
18
22
|
networkRequests
|
19
23
|
},
|
20
24
|
setPanelSelected,
|
21
25
|
detailsData
|
22
|
-
} = useContext(MainContext);
|
23
|
-
const
|
24
|
-
const renderItem = useCallback(({
|
26
|
+
} = (0, _react.useContext)(_contexts.MainContext);
|
27
|
+
const data = (0, _react.useMemo)(() => Array.from(networkRequests).reverse(), [networkRequests]);
|
28
|
+
const renderItem = (0, _react.useCallback)(({
|
25
29
|
item: [_, item]
|
26
30
|
}) => {
|
27
|
-
const isWebSocket = item.type === NetworkType.WS;
|
31
|
+
const isWebSocket = item.type === _types.NetworkType.WS;
|
28
32
|
const onPress = () => {
|
29
33
|
detailsData.current = {
|
30
34
|
network: item
|
31
35
|
};
|
32
36
|
setPanelSelected(null);
|
33
37
|
};
|
34
|
-
return /*#__PURE__*/
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkPanelItem.default, {
|
35
39
|
method: isWebSocket ? undefined : item.method,
|
36
40
|
name: item.url,
|
37
41
|
duration: item.duration,
|
@@ -39,25 +43,25 @@ export default function NetworkPanel() {
|
|
39
43
|
onPress: onPress
|
40
44
|
});
|
41
45
|
}, [detailsData, setPanelSelected]);
|
42
|
-
return /*#__PURE__*/
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
47
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_NetworkPanelHeader.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.FlatList, {
|
48
|
+
inverted: true,
|
49
|
+
data: data,
|
50
|
+
renderItem: renderItem,
|
51
|
+
keyExtractor: ([key]) => key,
|
52
|
+
ItemSeparatorComponent: Separator,
|
53
|
+
style: styles.container
|
54
|
+
})]
|
51
55
|
});
|
52
56
|
}
|
53
|
-
const styles = StyleSheet.create({
|
57
|
+
const styles = _reactNative.StyleSheet.create({
|
54
58
|
container: {
|
55
59
|
flex: 1,
|
56
60
|
paddingHorizontal: 8
|
57
61
|
},
|
58
62
|
divider: {
|
59
63
|
height: 1,
|
60
|
-
backgroundColor:
|
64
|
+
backgroundColor: _colors.default.gray
|
61
65
|
}
|
62
66
|
});
|
63
67
|
//# sourceMappingURL=NetworkPanel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_colors","_interopRequireDefault","_contexts","_types","_NetworkPanelHeader","_NetworkPanelItem","_jsxRuntime","e","__esModule","default","Separator","jsx","View","style","styles","divider","NetworkPanel","networkInterceptor","networkRequests","setPanelSelected","detailsData","useContext","MainContext","data","useMemo","Array","from","reverse","renderItem","useCallback","item","_","isWebSocket","type","NetworkType","WS","onPress","current","network","method","undefined","name","url","duration","status","jsxs","Fragment","children","FlatList","inverted","keyExtractor","key","ItemSeparatorComponent","container","StyleSheet","create","flex","paddingHorizontal","height","backgroundColor","colors","gray"],"sourceRoot":"../../../../../src","sources":["ui/components/panels/NetworkPanel.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,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AAgB;MACf8B,MAAM,EAAEP,WAAW,GAAGQ,SAAS,GAAGV,IAAI,CAACS,MAAO;MAC9CE,IAAI,EAAEX,IAAI,CAACY,GAAI;MACfC,QAAQ,EAAEb,IAAI,CAACa,QAAS;MACxBC,MAAM,EAAEd,IAAI,CAACc,MAAO;MACpBR,OAAO,EAAEA;IAAQ,CAClB,CAAC;EAEN,CAAC,EACD,CAAChB,WAAW,EAAED,gBAAgB,CAChC,CAAC;EAED,oBACE,IAAAb,WAAA,CAAAuC,IAAA,EAAAvC,WAAA,CAAAwC,QAAA;IAAAC,QAAA,gBACE,IAAAzC,WAAA,CAAAK,GAAA,EAACP,mBAAA,CAAAK,OAAkB,IAAE,CAAC,eACtB,IAAAH,WAAA,CAAAK,GAAA,EAACZ,YAAA,CAAAiD,QAAQ;MACPC,QAAQ;MACR1B,IAAI,EAAEA,IAAK;MACXK,UAAU,EAAEA,UAAW;MACvBsB,YAAY,EAAEA,CAAC,CAACC,GAAG,CAAC,KAAKA,GAAI;MAC7BC,sBAAsB,EAAE1C,SAAU;MAClCG,KAAK,EAAEC,MAAM,CAACuC;IAAU,CACzB,CAAC;EAAA,CACF,CAAC;AAEP;AAEA,MAAMvC,MAAM,GAAGwC,uBAAU,CAACC,MAAM,CAAC;EAC/BF,SAAS,EAAE;IACTG,IAAI,EAAE,CAAC;IACPC,iBAAiB,EAAE;EACrB,CAAC;EACD1C,OAAO,EAAE;IACP2C,MAAM,EAAE,CAAC;IACTC,eAAe,EAAEC,eAAM,CAACC;EAC1B;AACF,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/utils.js
CHANGED
@@ -1,26 +1,39 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.formatRequestStatusCode = exports.formatRequestMethod = exports.formatRequestDuration = exports.formatLogMessage = exports.convertToCurl = void 0;
|
7
|
+
exports.frozen = frozen;
|
8
|
+
exports.limitChar = exports.keyValueToString = exports.getHttpInterceptorId = void 0;
|
9
|
+
const limitChar = (value, limit = 5000) => {
|
4
10
|
const stringValue = typeof value === 'string' ? value : JSON.stringify(value ?? '');
|
5
11
|
return stringValue.length > limit ? `${stringValue.slice(0, limit)}\n---LIMITED TO ${limit} CHARACTERS---` : stringValue;
|
6
12
|
};
|
7
|
-
|
13
|
+
exports.limitChar = limitChar;
|
14
|
+
const getHttpInterceptorId = () => {
|
8
15
|
const timestamp = Date.now().toString(36);
|
9
16
|
const randomNum = Math.random().toString(36).substring(2, 10);
|
10
17
|
return timestamp + randomNum;
|
11
18
|
};
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
exports.getHttpInterceptorId = getHttpInterceptorId;
|
20
|
+
const keyValueToString = (key, value) => `${key}: ${limitChar(value)}\n`;
|
21
|
+
exports.keyValueToString = keyValueToString;
|
22
|
+
const formatRequestMethod = method => method ?? 'GET';
|
23
|
+
exports.formatRequestMethod = formatRequestMethod;
|
24
|
+
const formatRequestDuration = duration => duration ? `${duration}ms` : 'pending';
|
25
|
+
exports.formatRequestDuration = formatRequestDuration;
|
26
|
+
const formatRequestStatusCode = statusCode => `${statusCode ?? 'pending'}`;
|
27
|
+
exports.formatRequestStatusCode = formatRequestStatusCode;
|
28
|
+
const formatLogMessage = (type, values) => {
|
17
29
|
const message = values.reduce((pre, cur, index, array) => {
|
18
30
|
const isLastItem = index === array.length - 1;
|
19
31
|
return pre + limitChar(cur) + (isLastItem ? '' : ', ');
|
20
32
|
}, '');
|
21
33
|
return `${type.toUpperCase()}: ${message}`;
|
22
34
|
};
|
23
|
-
|
35
|
+
exports.formatLogMessage = formatLogMessage;
|
36
|
+
const convertToCurl = (method, url, headers, body) => {
|
24
37
|
let curlCommand = `curl -X ${method.toUpperCase()} "${url}"`;
|
25
38
|
if (headers) {
|
26
39
|
for (const [key, value] of Object.entries(headers)) {
|
@@ -33,4 +46,10 @@ export const convertToCurl = (method, url, headers, body) => {
|
|
33
46
|
}
|
34
47
|
return curlCommand;
|
35
48
|
};
|
49
|
+
exports.convertToCurl = convertToCurl;
|
50
|
+
function frozen(_target) {
|
51
|
+
const descriptor = arguments[2];
|
52
|
+
descriptor.configurable = false;
|
53
|
+
descriptor.writable = false;
|
54
|
+
}
|
36
55
|
//# sourceMappingURL=utils.js.map
|
package/lib/module/utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["limitChar","value","limit","stringValue","JSON","stringify","length","slice","getHttpInterceptorId","timestamp","Date","now","toString","randomNum","Math","random","substring","keyValueToString","key","formatRequestMethod","method","formatRequestDuration","duration","formatRequestStatusCode","statusCode","formatLogMessage","type","values","message","reduce","pre","cur","index","array","isLastItem","toUpperCase","convertToCurl","url","headers","body","curlCommand","Object","entries","bodyString"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["limitChar","value","limit","stringValue","JSON","stringify","length","slice","exports","getHttpInterceptorId","timestamp","Date","now","toString","randomNum","Math","random","substring","keyValueToString","key","formatRequestMethod","method","formatRequestDuration","duration","formatRequestStatusCode","statusCode","formatLogMessage","type","values","message","reduce","pre","cur","index","array","isLastItem","toUpperCase","convertToCurl","url","headers","body","curlCommand","Object","entries","bodyString","frozen","_target","descriptor","arguments","configurable","writable"],"sourceRoot":"../../src","sources":["utils.ts"],"mappings":";;;;;;;;AAEO,MAAMA,SAAS,GAAGA,CAACC,KAAU,EAAEC,KAAK,GAAG,IAAI,KAAK;EACrD,MAAMC,WAAW,GAAG,OAAOF,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGG,IAAI,CAACC,SAAS,CAACJ,KAAK,IAAI,EAAE,CAAC;EAEnF,OAAOE,WAAW,CAACG,MAAM,GAAGJ,KAAK,GAC7B,GAAGC,WAAW,CAACI,KAAK,CAAC,CAAC,EAAEL,KAAK,CAAC,mBAAmBA,KAAK,gBAAgB,GACtEC,WAAW;AACjB,CAAC;AAACK,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EAAE,EAAE,CAAC;EAEN,OAAO,GAAGR,IAAI,CAACS,WAAW,CAAC,CAAC,KAAKP,OAAO,EAAE;AAC5C,CAAC;AAACrB,OAAA,CAAAkB,gBAAA,GAAAA,gBAAA;AAEK,MAAMW,aAAa,GAAGA,CAC3BhB,MAA6B,EAC7BiB,GAAuB,EACvBC,OAAsC,EACtCC,IAAyB,KACtB;EACH,IAAIC,WAAW,GAAG,WAAWpB,MAAM,CAACe,WAAW,CAAC,CAAC,KAAKE,GAAG,GAAG;EAE5D,IAAIC,OAAO,EAAE;IACX,KAAK,MAAM,CAACpB,GAAG,EAAElB,KAAK,CAAC,IAAIyC,MAAM,CAACC,OAAO,CAACJ,OAAO,CAAC,EAAE;MAClDE,WAAW,IAAI,QAAQtB,GAAG,KAAKlB,KAAK,GAAG;IACzC;EACF;EAEA,IAAIuC,IAAI,EAAE;IACR,MAAMI,UAAU,GAAG,OAAOJ,IAAI,KAAK,QAAQ,GAAGA,IAAI,GAAGpC,IAAI,CAACC,SAAS,CAACmC,IAAI,CAAC;IACzEC,WAAW,IAAI,QAAQG,UAAU,GAAG;EACtC;EAEA,OAAOH,WAAW;AACpB,CAAC;AAACjC,OAAA,CAAA6B,aAAA,GAAAA,aAAA;AAEK,SAASQ,MAAMA,CAACC,OAAe,EAAE;EACtC,MAAMC,UAA8B,GAAGC,SAAS,CAAC,CAAC,CAAC;EACnDD,UAAU,CAACE,YAAY,GAAG,KAAK;EAC/BF,UAAU,CAACG,QAAQ,GAAG,KAAK;AAC7B","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useNetworkInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useNetworkInterceptor.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useNetworkInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/useNetworkInterceptor.ts"],"names":[],"mappings":"AAcA,UAAU,wBAAwB;IAChC,WAAW,EAAE,OAAO,CAAC;CACtB;AAMD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAAE,WAAW,EAAE,EAAE,wBAAwB;;;;;;EA4OtF"}
|
@@ -1,9 +1,9 @@
|
|
1
|
+
import type { ConsoleHandlers } from '../types';
|
1
2
|
import Interceptor from './Interceptor';
|
2
|
-
export default class ConsoleInterceptor extends Interceptor {
|
3
|
+
export default class ConsoleInterceptor extends Interceptor<ConsoleHandlers> {
|
3
4
|
static readonly instance: ConsoleInterceptor;
|
5
|
+
protected readonly handlers: ConsoleHandlers;
|
4
6
|
private constructor();
|
5
|
-
private callback;
|
6
|
-
setCallback(callback: typeof this.callback): this;
|
7
7
|
enableInterception(): void;
|
8
8
|
disableInterception(): void;
|
9
9
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ConsoleInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/ConsoleInterceptor.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,eAAe,CAAC;AAaxC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,WAAW;
|
1
|
+
{"version":3,"file":"ConsoleInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/ConsoleInterceptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,WAAW,MAAM,eAAe,CAAC;AAaxC,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,WAAW,CAAC,eAAe,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,QAAQ,qBAA4B;IAEpD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAE1C;IAEF,OAAO;IAKP,kBAAkB,IAAI,IAAI;IAqE1B,mBAAmB,IAAI,IAAI;CAkB5B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FetchInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/FetchInterceptor.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAIhD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,eAAe;IAC3D,MAAM,CAAC,QAAQ,CAAC,QAAQ,mBAA0B;IAElD,OAAO;
|
1
|
+
{"version":3,"file":"FetchInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/FetchInterceptor.ts"],"names":[],"mappings":"AAGA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAIhD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,eAAe;IAC3D,MAAM,CAAC,QAAQ,CAAC,QAAQ,mBAA0B;IAElD,OAAO;IAKP,kBAAkB;IAgHlB,mBAAmB;CASpB"}
|
@@ -1,22 +1,13 @@
|
|
1
|
-
import type {
|
1
|
+
import type { HttpHandlers } from '../types';
|
2
2
|
import { NetworkInterceptor } from './NetworkInterceptor';
|
3
|
-
export default abstract class HttpInterceptor extends NetworkInterceptor {
|
4
|
-
protected
|
5
|
-
protected requestHeaderCallback: HttpRequestHeaderCallback;
|
6
|
-
protected sendCallback: HttpSendCallback;
|
7
|
-
protected headerReceivedCallback: HttpHeaderReceivedCallback;
|
8
|
-
protected responseCallback: HttpResponseCallback;
|
9
|
-
setOpenCallback(callback: typeof this.openCallback): this;
|
10
|
-
setRequestHeaderCallback(callback: typeof this.requestHeaderCallback): this;
|
11
|
-
setSendCallback(callback: typeof this.sendCallback): this;
|
12
|
-
setHeaderReceivedCallback(callback: typeof this.headerReceivedCallback): this;
|
13
|
-
setResponseCallback(callback: typeof this.responseCallback): this;
|
3
|
+
export default abstract class HttpInterceptor extends NetworkInterceptor<HttpHandlers> {
|
4
|
+
protected handlers: HttpHandlers;
|
14
5
|
protected getCallbacks(): {
|
15
|
-
openCallback: ((id: import("../types").ID, type: import("../types").HttpRequest["type"], method: string, url: string) => void) |
|
16
|
-
requestHeaderCallback: ((id: import("../types").ID, header: string, value: string) => void) |
|
17
|
-
sendCallback: ((id: import("../types").ID, data?: any) => void) |
|
18
|
-
headerReceivedCallback: ((id: import("../types").ID, responseContentType: string | undefined, responseSize: number | undefined, responseHeaders: string) => void) |
|
19
|
-
responseCallback: ((id: import("../types").ID, status: number | undefined, timeout: number | undefined, duration: number, response: any, responseURL: string | undefined, responseType: string | undefined) => void) |
|
6
|
+
openCallback: ((id: import("../types").ID, type: import("../types").HttpRequest["type"], method: string, url: string) => void) | null;
|
7
|
+
requestHeaderCallback: ((id: import("../types").ID, header: string, value: string) => void) | null;
|
8
|
+
sendCallback: ((id: import("../types").ID, data?: any) => void) | null;
|
9
|
+
headerReceivedCallback: ((id: import("../types").ID, responseContentType: string | undefined, responseSize: number | undefined, responseHeaders: string) => void) | null;
|
10
|
+
responseCallback: ((id: import("../types").ID, status: number | undefined, timeout: number | undefined, duration: number, response: any, responseURL: string | undefined, responseType: string | undefined) => void) | null;
|
20
11
|
};
|
21
12
|
protected clearCallbacks(): void;
|
22
13
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HttpInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/HttpInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"HttpInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/HttpInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,eAAgB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;IACpF,SAAS,CAAC,QAAQ,EAAE,YAAY,CAM9B;IAEF,SAAS,CAAC,YAAY;;;;;;;IAgBtB,SAAS,CAAC,cAAc,IAAI,IAAI;CAOjC"}
|
@@ -1,7 +1,9 @@
|
|
1
|
-
export default abstract class Interceptor {
|
1
|
+
export default abstract class Interceptor<T extends Object> {
|
2
2
|
#private;
|
3
3
|
get isInterceptorEnabled(): boolean;
|
4
4
|
protected set isInterceptorEnabled(value: boolean);
|
5
|
+
protected abstract handlers: T;
|
6
|
+
set<K extends keyof T>(key: K, handler: T[K]): this;
|
5
7
|
abstract enableInterception(): void;
|
6
8
|
abstract disableInterception(): void;
|
7
9
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Interceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/Interceptor.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"Interceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/Interceptor.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,WAAW,CAAC,CAAC,SAAS,MAAM;;IAGxD,IAAI,oBAAoB,IAIkB,OAAO,CAFhD;IAED,SAAS,KAAK,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAEhD;IAED,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAG/B,GAAG,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IAK5C,QAAQ,CAAC,kBAAkB,IAAI,IAAI;IACnC,QAAQ,CAAC,mBAAmB,IAAI,IAAI;CACrC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import Interceptor from './Interceptor';
|
2
|
-
export declare abstract class NetworkInterceptor extends Interceptor {
|
2
|
+
export declare abstract class NetworkInterceptor<T extends Object> extends Interceptor<T> {
|
3
3
|
protected abstract getCallbacks(): any;
|
4
4
|
protected abstract clearCallbacks(): void;
|
5
5
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NetworkInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/NetworkInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,8BAAsB,
|
1
|
+
{"version":3,"file":"NetworkInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/NetworkInterceptor.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,8BAAsB,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IAC/E,SAAS,CAAC,QAAQ,CAAC,YAAY,IAAI,GAAG;IACtC,SAAS,CAAC,QAAQ,CAAC,cAAc,IAAI,IAAI;CAC1C"}
|
@@ -1,25 +1,13 @@
|
|
1
|
+
import type { WebSocketHandlers } from '../types';
|
1
2
|
import { NetworkInterceptor } from './NetworkInterceptor';
|
2
|
-
export default class WebSocketInterceptor extends NetworkInterceptor {
|
3
|
+
export default class WebSocketInterceptor extends NetworkInterceptor<WebSocketHandlers> {
|
3
4
|
static readonly instance: WebSocketInterceptor;
|
5
|
+
protected handlers: WebSocketHandlers;
|
4
6
|
private constructor();
|
5
|
-
private connectCallback;
|
6
|
-
private sendCallback;
|
7
|
-
private closeCallback;
|
8
|
-
private onOpenCallback;
|
9
|
-
private onMessageCallback;
|
10
|
-
private onErrorCallback;
|
11
|
-
private onCloseCallback;
|
12
|
-
setConnectCallback(callback: typeof this.connectCallback): this;
|
13
|
-
setSendCallback(callback: typeof this.sendCallback): this;
|
14
|
-
setCloseCallback(callback: typeof this.closeCallback): this;
|
15
|
-
setOnOpenCallback(callback: typeof this.onOpenCallback): this;
|
16
|
-
setOnMessageCallback(callback: typeof this.onMessageCallback): this;
|
17
|
-
setOnErrorCallback(callback: typeof this.onErrorCallback): this;
|
18
|
-
setOnCloseCallback(callback: typeof this.onCloseCallback): this;
|
19
7
|
protected getCallbacks(): {
|
20
|
-
|
21
|
-
|
22
|
-
|
8
|
+
connect: ((url: string, protocols?: import("../types").WebSocketRequest["protocols"], options?: import("../types").WebSocketRequest["options"], socketId?: number) => void) | null;
|
9
|
+
send: ((data: string, socketId: number) => void) | null;
|
10
|
+
close: ((code: number, reason: string, socketId: number) => void) | null;
|
23
11
|
arrayBufferToString: (data?: string) => string;
|
24
12
|
};
|
25
13
|
protected clearCallbacks(): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WebSocketInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/WebSocketInterceptor.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WebSocketInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/WebSocketInterceptor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAQ1D,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,kBAAkB,CAAC,iBAAiB,CAAC;IACrF,MAAM,CAAC,QAAQ,CAAC,QAAQ,uBAA8B;IAEtD,SAAS,CAAC,QAAQ,EAAE,iBAAiB,CAQnC;IAEF,OAAO;IAIP,SAAS,CAAC,YAAY;;;;qCAuBa,MAAM;;IAdzC,SAAS,CAAC,cAAc,IAAI,IAAI;IAUhC,OAAO,CAAC,YAAY,CAAmC;IACvD,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;IAE5D,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,cAAc;IA2BtB,OAAO,CAAC,gBAAgB;IAOxB,kBAAkB,IAAI,IAAI;IAwC1B,mBAAmB,IAAI,IAAI;CAc5B"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"XHRInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/XHRInterceptor.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAMhD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,eAAe;IACzD,MAAM,CAAC,QAAQ,CAAC,QAAQ,iBAAwB;IAEhD,OAAO;
|
1
|
+
{"version":3,"file":"XHRInterceptor.d.ts","sourceRoot":"","sources":["../../../../../src/interceptors/XHRInterceptor.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAMhD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,eAAe;IACzD,MAAM,CAAC,QAAQ,CAAC,QAAQ,iBAAwB;IAEhD,OAAO;IAKP,kBAAkB;IA4ElB,mBAAmB;CAWpB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../../src/types/console.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,EAAE,CAAC;CACf"}
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../../../src/types/console.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,EAAE,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;CACxD"}
|
@@ -12,9 +12,17 @@ export interface HttpRequest extends NetworkRequest {
|
|
12
12
|
response?: any;
|
13
13
|
responseType?: string;
|
14
14
|
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
type HttpOpenCallback = ((id: ID, type: HttpRequest['type'], method: string, url: string) => void) | null;
|
16
|
+
type HttpRequestHeaderCallback = ((id: ID, header: string, value: string) => void) | null;
|
17
|
+
type HttpSendCallback = ((id: ID, data?: any) => void) | null;
|
18
|
+
type HttpHeaderReceivedCallback = ((id: ID, responseContentType: string | undefined, responseSize: number | undefined, responseHeaders: string) => void) | null;
|
19
|
+
type HttpResponseCallback = ((id: ID, status: number | undefined, timeout: number | undefined, duration: number, response: any, responseURL: string | undefined, responseType: string | undefined) => void) | null;
|
20
|
+
export interface HttpHandlers {
|
21
|
+
open: HttpOpenCallback;
|
22
|
+
requestHeader: HttpRequestHeaderCallback;
|
23
|
+
send: HttpSendCallback;
|
24
|
+
headerReceived: HttpHeaderReceivedCallback;
|
25
|
+
response: HttpResponseCallback;
|
26
|
+
}
|
27
|
+
export {};
|
20
28
|
//# sourceMappingURL=http.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../../src/types/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhE,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,IAAI,EAAE,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,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