@buoy-gg/network 2.1.16 → 3.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/lib/commonjs/index.js +7 -0
- package/lib/commonjs/network/sync/networkSyncAdapter.js +25 -0
- package/lib/module/index.js +5 -0
- package/lib/module/network/sync/networkSyncAdapter.js +22 -0
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/network/sync/networkSyncAdapter.d.ts +17 -0
- package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +1 -0
- package/package.json +2 -2
package/lib/commonjs/index.js
CHANGED
|
@@ -69,6 +69,12 @@ Object.defineProperty(exports, "networkListener", {
|
|
|
69
69
|
return _networkListener.networkListener;
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "networkSyncAdapter", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _networkSyncAdapter.networkSyncAdapter;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
72
78
|
Object.defineProperty(exports, "networkToolPreset", {
|
|
73
79
|
enumerable: true,
|
|
74
80
|
get: function () {
|
|
@@ -100,5 +106,6 @@ var _NetworkEventItemCompact = require("./network/components/NetworkEventItemCom
|
|
|
100
106
|
var _useNetworkEvents = require("./network/hooks/useNetworkEvents");
|
|
101
107
|
var _useTickEveryMinute = require("./network/hooks/useTickEveryMinute");
|
|
102
108
|
var _formatting = require("./network/utils/formatting");
|
|
109
|
+
var _networkSyncAdapter = require("./network/sync/networkSyncAdapter");
|
|
103
110
|
var _networkEventStore = require("./network/utils/networkEventStore");
|
|
104
111
|
var _networkListener = require("./network/utils/networkListener");
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.networkSyncAdapter = void 0;
|
|
7
|
+
var _networkEventStore = require("../utils/networkEventStore");
|
|
8
|
+
/**
|
|
9
|
+
* Sync adapter for the network tool, consumed by @buoy-gg/external-sync's
|
|
10
|
+
* `useExternalSync` (structurally matches its ToolSyncAdapter interface so
|
|
11
|
+
* this package doesn't need a dependency on it).
|
|
12
|
+
*
|
|
13
|
+
* Subscribing starts the network interceptor, so requests are only captured
|
|
14
|
+
* while a dashboard is watching the network panel.
|
|
15
|
+
*/
|
|
16
|
+
const networkSyncAdapter = exports.networkSyncAdapter = {
|
|
17
|
+
version: 1,
|
|
18
|
+
getSnapshot: () => _networkEventStore.networkEventStore.getEvents(),
|
|
19
|
+
subscribe: onChange => _networkEventStore.networkEventStore.subscribeToEvents(onChange),
|
|
20
|
+
actions: {
|
|
21
|
+
clearEvents: () => {
|
|
22
|
+
_networkEventStore.networkEventStore.clearEvents();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
package/lib/module/index.js
CHANGED
|
@@ -37,6 +37,11 @@ export { formatBytes, formatDuration, formatHttpStatus } from "./network/utils/f
|
|
|
37
37
|
// TYPES (For TypeScript users)
|
|
38
38
|
// =============================================================================
|
|
39
39
|
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// EXTERNAL SYNC (Adapter for @buoy-gg/external-sync's useExternalSync)
|
|
42
|
+
// =============================================================================
|
|
43
|
+
export { networkSyncAdapter } from "./network/sync/networkSyncAdapter";
|
|
44
|
+
|
|
40
45
|
// =============================================================================
|
|
41
46
|
// INTERNAL EXPORTS (For @buoy-gg/* packages only - not part of public API)
|
|
42
47
|
// These are re-exported for cross-package communication within the monorepo.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { networkEventStore } from "../utils/networkEventStore";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Sync adapter for the network tool, consumed by @buoy-gg/external-sync's
|
|
7
|
+
* `useExternalSync` (structurally matches its ToolSyncAdapter interface so
|
|
8
|
+
* this package doesn't need a dependency on it).
|
|
9
|
+
*
|
|
10
|
+
* Subscribing starts the network interceptor, so requests are only captured
|
|
11
|
+
* while a dashboard is watching the network panel.
|
|
12
|
+
*/
|
|
13
|
+
export const networkSyncAdapter = {
|
|
14
|
+
version: 1,
|
|
15
|
+
getSnapshot: () => networkEventStore.getEvents(),
|
|
16
|
+
subscribe: onChange => networkEventStore.subscribeToEvents(onChange),
|
|
17
|
+
actions: {
|
|
18
|
+
clearEvents: () => {
|
|
19
|
+
networkEventStore.clearEvents();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -15,6 +15,7 @@ export { useNetworkEvents } from "./network/hooks/useNetworkEvents";
|
|
|
15
15
|
export { TickProvider, useTickEveryMinute } from "./network/hooks/useTickEveryMinute";
|
|
16
16
|
export { formatBytes, formatDuration, formatHttpStatus, } from "./network/utils/formatting";
|
|
17
17
|
export type { NetworkEvent, NetworkStats, NetworkFilter, NetworkEventStatus, NetworkInsight, } from "./network/types";
|
|
18
|
+
export { networkSyncAdapter } from "./network/sync/networkSyncAdapter";
|
|
18
19
|
/** @internal */
|
|
19
20
|
export { networkEventStore } from "./network/utils/networkEventStore";
|
|
20
21
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAKhE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAKvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAKtF,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAKpC,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,cAAc,GACf,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAKhE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAKvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAKtF,OAAO,EACL,WAAW,EACX,cAAc,EACd,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AAKpC,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,cAAc,GACf,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAOvE,gBAAgB;AAChB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,gBAAgB;AAChB,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync adapter for the network tool, consumed by @buoy-gg/external-sync's
|
|
3
|
+
* `useExternalSync` (structurally matches its ToolSyncAdapter interface so
|
|
4
|
+
* this package doesn't need a dependency on it).
|
|
5
|
+
*
|
|
6
|
+
* Subscribing starts the network interceptor, so requests are only captured
|
|
7
|
+
* while a dashboard is watching the network panel.
|
|
8
|
+
*/
|
|
9
|
+
export declare const networkSyncAdapter: {
|
|
10
|
+
version: number;
|
|
11
|
+
getSnapshot: () => import("..").NetworkEvent[];
|
|
12
|
+
subscribe: (onChange: () => void) => () => void;
|
|
13
|
+
actions: {
|
|
14
|
+
clearEvents: () => void;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=networkSyncAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkSyncAdapter.d.ts","sourceRoot":"","sources":["../../../../src/network/sync/networkSyncAdapter.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;0BAGP,MAAM,IAAI;;;;CAOjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/network",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "network package",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@buoy-gg/shared-ui": "
|
|
29
|
+
"@buoy-gg/shared-ui": "3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": "*",
|