@buoy-gg/network 2.1.9 → 2.1.11
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/lib/commonjs/network/components/NetworkEventDetailView.js +3 -1
- package/lib/commonjs/network/components/NetworkModal.js +9 -3
- package/lib/commonjs/network/hooks/useTickEveryMinute.js +13 -26
- package/lib/module/network/components/NetworkEventDetailView.js +3 -1
- package/lib/module/network/components/NetworkModal.js +9 -3
- package/lib/module/network/hooks/useTickEveryMinute.js +7 -25
- package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +1 -1
- package/lib/typescript/network/components/NetworkModal.d.ts.map +1 -1
- package/lib/typescript/network/hooks/useTickEveryMinute.d.ts +1 -7
- package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +1 -1
- package/package.json +12 -11
- package/LICENSE +0 -58
|
@@ -156,7 +156,9 @@ const UrlBreakdown = ({
|
|
|
156
156
|
}), showParams ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_dataViewer.DataViewer, {
|
|
157
157
|
title: "",
|
|
158
158
|
data: urlParts.params,
|
|
159
|
-
showTypeFilter:
|
|
159
|
+
showTypeFilter: true,
|
|
160
|
+
rawMode: true,
|
|
161
|
+
initialExpanded: true
|
|
160
162
|
}) : null]
|
|
161
163
|
}) : null]
|
|
162
164
|
});
|
|
@@ -45,6 +45,7 @@ function NetworkModalInner({
|
|
|
45
45
|
} = (0, _sharedUi.useFeatureGate)();
|
|
46
46
|
const {
|
|
47
47
|
events,
|
|
48
|
+
allEvents,
|
|
48
49
|
stats,
|
|
49
50
|
filter,
|
|
50
51
|
setFilter,
|
|
@@ -332,12 +333,17 @@ function NetworkModalInner({
|
|
|
332
333
|
return generateCopyText();
|
|
333
334
|
}, [filteredEvents.length, generateCopyText]);
|
|
334
335
|
|
|
335
|
-
// Compute badge stats from
|
|
336
|
+
// Compute badge stats from all events (before status filtering) with ignored patterns applied.
|
|
337
|
+
// This ensures counts stay stable when toggling between status filters.
|
|
336
338
|
const badgeStats = (0, _react.useMemo)(() => {
|
|
337
339
|
let successful = 0;
|
|
338
340
|
let failed = 0;
|
|
339
341
|
let pending = 0;
|
|
340
|
-
|
|
342
|
+
const eventsForStats = ignoredPatterns.size === 0 ? allEvents : allEvents.filter(event => {
|
|
343
|
+
const url = event.url.toLowerCase();
|
|
344
|
+
return !Array.from(ignoredPatterns).some(pattern => url.includes(pattern.toLowerCase()));
|
|
345
|
+
});
|
|
346
|
+
for (const event of eventsForStats) {
|
|
341
347
|
if (event.status && event.status >= 200 && event.status < 300) {
|
|
342
348
|
successful++;
|
|
343
349
|
} else if (event.error || event.status && event.status >= 400) {
|
|
@@ -351,7 +357,7 @@ function NetworkModalInner({
|
|
|
351
357
|
failed,
|
|
352
358
|
pending
|
|
353
359
|
};
|
|
354
|
-
}, [
|
|
360
|
+
}, [allEvents, ignoredPatterns]);
|
|
355
361
|
|
|
356
362
|
// FlatList optimization - only keep what's needed for FlatList performance
|
|
357
363
|
const keyExtractor = item => item.id;
|
|
@@ -3,32 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
Object.defineProperty(exports, "TickProvider", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _sharedUi.TickProvider;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
7
12
|
exports.useTickEveryMinute = useTickEveryMinute;
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
const TickContext = /*#__PURE__*/(0, _react.createContext)(Date.now());
|
|
11
|
-
function TickProvider({
|
|
12
|
-
children,
|
|
13
|
-
intervalMs = 60_000
|
|
14
|
-
}) {
|
|
15
|
-
const [tick, setTick] = (0, _react.useState)(() => Date.now());
|
|
16
|
-
(0, _react.useEffect)(() => {
|
|
17
|
-
const id = setInterval(() => {
|
|
18
|
-
setTick(Date.now());
|
|
19
|
-
}, intervalMs);
|
|
20
|
-
return () => {
|
|
21
|
-
clearInterval(id);
|
|
22
|
-
};
|
|
23
|
-
}, [intervalMs]);
|
|
24
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(TickContext.Provider, {
|
|
25
|
-
value: tick,
|
|
26
|
-
children: children
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
function useTickEveryMinute() {
|
|
30
|
-
const tick = (0, _react.useContext)(TickContext);
|
|
13
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
14
|
+
// Re-export TickProvider from shared package
|
|
31
15
|
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
// Re-export useTick as useTickEveryMinute for backward compatibility.
|
|
17
|
+
// Falls back to Date.now() when no provider is present (matches original behavior).
|
|
18
|
+
|
|
19
|
+
function useTickEveryMinute() {
|
|
20
|
+
return (0, _sharedUi.useTick)() ?? Date.now();
|
|
34
21
|
}
|
|
@@ -153,7 +153,9 @@ const UrlBreakdown = ({
|
|
|
153
153
|
}), showParams ? /*#__PURE__*/_jsx(DataViewer, {
|
|
154
154
|
title: "",
|
|
155
155
|
data: urlParts.params,
|
|
156
|
-
showTypeFilter:
|
|
156
|
+
showTypeFilter: true,
|
|
157
|
+
rawMode: true,
|
|
158
|
+
initialExpanded: true
|
|
157
159
|
}) : null]
|
|
158
160
|
}) : null]
|
|
159
161
|
});
|
|
@@ -41,6 +41,7 @@ function NetworkModalInner({
|
|
|
41
41
|
} = useFeatureGate();
|
|
42
42
|
const {
|
|
43
43
|
events,
|
|
44
|
+
allEvents,
|
|
44
45
|
stats,
|
|
45
46
|
filter,
|
|
46
47
|
setFilter,
|
|
@@ -328,12 +329,17 @@ function NetworkModalInner({
|
|
|
328
329
|
return generateCopyText();
|
|
329
330
|
}, [filteredEvents.length, generateCopyText]);
|
|
330
331
|
|
|
331
|
-
// Compute badge stats from
|
|
332
|
+
// Compute badge stats from all events (before status filtering) with ignored patterns applied.
|
|
333
|
+
// This ensures counts stay stable when toggling between status filters.
|
|
332
334
|
const badgeStats = useMemo(() => {
|
|
333
335
|
let successful = 0;
|
|
334
336
|
let failed = 0;
|
|
335
337
|
let pending = 0;
|
|
336
|
-
|
|
338
|
+
const eventsForStats = ignoredPatterns.size === 0 ? allEvents : allEvents.filter(event => {
|
|
339
|
+
const url = event.url.toLowerCase();
|
|
340
|
+
return !Array.from(ignoredPatterns).some(pattern => url.includes(pattern.toLowerCase()));
|
|
341
|
+
});
|
|
342
|
+
for (const event of eventsForStats) {
|
|
337
343
|
if (event.status && event.status >= 200 && event.status < 300) {
|
|
338
344
|
successful++;
|
|
339
345
|
} else if (event.error || event.status && event.status >= 400) {
|
|
@@ -347,7 +353,7 @@ function NetworkModalInner({
|
|
|
347
353
|
failed,
|
|
348
354
|
pending
|
|
349
355
|
};
|
|
350
|
-
}, [
|
|
356
|
+
}, [allEvents, ignoredPatterns]);
|
|
351
357
|
|
|
352
358
|
// FlatList optimization - only keep what's needed for FlatList performance
|
|
353
359
|
const keyExtractor = item => item.id;
|
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const TickContext = /*#__PURE__*/createContext(Date.now());
|
|
6
|
-
export function TickProvider({
|
|
7
|
-
children,
|
|
8
|
-
intervalMs = 60_000
|
|
9
|
-
}) {
|
|
10
|
-
const [tick, setTick] = useState(() => Date.now());
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
const id = setInterval(() => {
|
|
13
|
-
setTick(Date.now());
|
|
14
|
-
}, intervalMs);
|
|
15
|
-
return () => {
|
|
16
|
-
clearInterval(id);
|
|
17
|
-
};
|
|
18
|
-
}, [intervalMs]);
|
|
19
|
-
return /*#__PURE__*/_jsx(TickContext.Provider, {
|
|
20
|
-
value: tick,
|
|
21
|
-
children: children
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
export function useTickEveryMinute() {
|
|
25
|
-
const tick = useContext(TickContext);
|
|
3
|
+
// Re-export TickProvider from shared package
|
|
4
|
+
export { TickProvider } from "@buoy-gg/shared-ui";
|
|
26
5
|
|
|
27
|
-
|
|
28
|
-
|
|
6
|
+
// Re-export useTick as useTickEveryMinute for backward compatibility.
|
|
7
|
+
// Falls back to Date.now() when no provider is present (matches original behavior).
|
|
8
|
+
import { useTick } from "@buoy-gg/shared-ui";
|
|
9
|
+
export function useTickEveryMinute() {
|
|
10
|
+
return useTick() ?? Date.now();
|
|
29
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkEventDetailView.d.ts","sourceRoot":"","sources":["../../../../src/network/components/NetworkEventDetailView.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAU7C,UAAU,2BAA2B;IACnC,KAAK,EAAE,YAAY,CAAC;IACpB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;
|
|
1
|
+
{"version":3,"file":"NetworkEventDetailView.d.ts","sourceRoot":"","sources":["../../../../src/network/components/NetworkEventDetailView.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAU7C,UAAU,2BAA2B;IACnC,KAAK,EAAE,YAAY,CAAC;IACpB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAqKD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,eAA2B,EAC3B,eAA0B,GAC3B,EAAE,2BAA2B,+BAkZ7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkModal.d.ts","sourceRoot":"","sources":["../../../../src/network/components/NetworkModal.tsx"],"names":[],"mappings":"AA4CA,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;
|
|
1
|
+
{"version":3,"file":"NetworkModal.d.ts","sourceRoot":"","sources":["../../../../src/network/components/NetworkModal.tsx"],"names":[],"mappings":"AA4CA,UAAU,iBAAiB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAsjCD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAMpD"}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
interface TickProviderProps {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
intervalMs?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function TickProvider({ children, intervalMs, }: TickProviderProps): import("react").JSX.Element;
|
|
1
|
+
export { TickProvider } from "@buoy-gg/shared-ui";
|
|
7
2
|
export declare function useTickEveryMinute(): number;
|
|
8
|
-
export {};
|
|
9
3
|
//# sourceMappingURL=useTickEveryMinute.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTickEveryMinute.d.ts","sourceRoot":"","sources":["../../../../src/network/hooks/useTickEveryMinute.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTickEveryMinute.d.ts","sourceRoot":"","sources":["../../../../src/network/hooks/useTickEveryMinute.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMlD,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/network",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.11",
|
|
4
4
|
"description": "network package",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -25,8 +25,17 @@
|
|
|
25
25
|
"lib"
|
|
26
26
|
],
|
|
27
27
|
"sideEffects": false,
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "bob build",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"prepublishOnly": "bob build",
|
|
32
|
+
"clean": "rimraf lib",
|
|
33
|
+
"test": "pnpm run typecheck",
|
|
34
|
+
"test:interceptor": "node test-network-interceptor.js",
|
|
35
|
+
"test:comprehensive": "node test-comprehensive.js"
|
|
36
|
+
},
|
|
28
37
|
"dependencies": {
|
|
29
|
-
"@buoy-gg/shared-ui": "
|
|
38
|
+
"@buoy-gg/shared-ui": "workspace:*"
|
|
30
39
|
},
|
|
31
40
|
"peerDependencies": {
|
|
32
41
|
"react": "*",
|
|
@@ -69,13 +78,5 @@
|
|
|
69
78
|
"publishConfig": {
|
|
70
79
|
"access": "public",
|
|
71
80
|
"tag": "latest"
|
|
72
|
-
},
|
|
73
|
-
"scripts": {
|
|
74
|
-
"build": "bob build",
|
|
75
|
-
"typecheck": "tsc --noEmit",
|
|
76
|
-
"clean": "rimraf lib",
|
|
77
|
-
"test": "pnpm run typecheck",
|
|
78
|
-
"test:interceptor": "node test-network-interceptor.js",
|
|
79
|
-
"test:comprehensive": "node test-comprehensive.js"
|
|
80
81
|
}
|
|
81
|
-
}
|
|
82
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
PROPRIETARY SOFTWARE LICENSE
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024-present Buoy. All rights reserved.
|
|
4
|
-
|
|
5
|
-
This software and its source code are proprietary and confidential.
|
|
6
|
-
|
|
7
|
-
NOTICE: This is NOT open source software. This software is licensed,
|
|
8
|
-
not sold, and is protected by copyright laws and international treaties.
|
|
9
|
-
|
|
10
|
-
TERMS AND CONDITIONS:
|
|
11
|
-
|
|
12
|
-
1. LICENSE GRANT
|
|
13
|
-
Subject to the terms of this Agreement and payment of applicable fees,
|
|
14
|
-
Buoy grants you a limited, non-exclusive, non-transferable license
|
|
15
|
-
to use the compiled software packages in your applications.
|
|
16
|
-
|
|
17
|
-
2. RESTRICTIONS
|
|
18
|
-
You may NOT:
|
|
19
|
-
- Copy, modify, or distribute the source code
|
|
20
|
-
- Reverse engineer, decompile, or disassemble the software
|
|
21
|
-
- Remove or alter any proprietary notices or labels
|
|
22
|
-
- Sublicense, rent, lease, or lend the software
|
|
23
|
-
- Use the software to create competing products
|
|
24
|
-
- Share access credentials with unauthorized parties
|
|
25
|
-
|
|
26
|
-
3. OWNERSHIP
|
|
27
|
-
React Buoy retains all right, title, and interest in the software,
|
|
28
|
-
including all intellectual property rights. This license does not
|
|
29
|
-
grant you any rights to trademarks or service marks.
|
|
30
|
-
|
|
31
|
-
4. TERMINATION
|
|
32
|
-
This license is effective until terminated. Your rights under this
|
|
33
|
-
license will terminate automatically without notice if you fail to
|
|
34
|
-
comply with any of its terms. Upon termination, you must cease all
|
|
35
|
-
use and destroy all copies of the software.
|
|
36
|
-
|
|
37
|
-
5. DISCLAIMER OF WARRANTIES
|
|
38
|
-
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
|
|
39
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
40
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
41
|
-
|
|
42
|
-
6. LIMITATION OF LIABILITY
|
|
43
|
-
IN NO EVENT SHALL BUOY BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
|
|
44
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN
|
|
45
|
-
CONNECTION WITH THIS LICENSE OR THE USE OF THE SOFTWARE.
|
|
46
|
-
|
|
47
|
-
7. GOVERNING LAW
|
|
48
|
-
This Agreement shall be governed by and construed in accordance with
|
|
49
|
-
the laws of the United States, without regard to its conflict of
|
|
50
|
-
law provisions.
|
|
51
|
-
|
|
52
|
-
For licensing inquiries and subscription information:
|
|
53
|
-
- Website: https://buoy.gg
|
|
54
|
-
- Email: AustinLovesWorking@gmail.com
|
|
55
|
-
|
|
56
|
-
Unauthorized reproduction or distribution of this software, or any
|
|
57
|
-
portion of it, may result in severe civil and criminal penalties,
|
|
58
|
-
and will be prosecuted to the maximum extent possible under the law.
|