MCPcopy Create free account
hub / github.com/bywwcnll/StreamPanel / getAllConnectionsExportData

Function getAllConnectionsExportData

devtools/modules/exportManager.js:70–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68}
69
70export function getAllConnectionsExportData() {
71 const connections = Object.values(state.connections);
72 if (connections.length === 0) {
73 return null;
74 }
75
76 return {
77 connections: connections.map(conn => {
78 const messages = getVisibleMessages(conn.messages);
79 return {
80 ...getConnectionExportInfo(conn),
81 messages: messages.map(msg => ({
82 id: msg.id,
83 eventType: msg.eventType,
84 data: msg.data,
85 lastEventId: msg.lastEventId,
86 timestamp: formatTimestampForExport(msg.timestamp)
87 })),
88 messageCount: messages.length,
89 totalMessageCount: conn.messages.length
90 };
91 }),
92 exportedAt: new Date().toISOString(),
93 totalConnections: connections.length,
94 totalMessages: connections.reduce((sum, conn) => sum + getVisibleMessages(conn.messages).length, 0),
95 totalRawMessages: connections.reduce((sum, conn) => sum + conn.messages.length, 0),
96 appliedFilters: getAppliedFiltersMetadata()
97 };
98}
99
100export function exportToJSON(data, filename) {
101 const jsonStr = JSON.stringify(data, null, 2);

Callers 1

handleExportFunction · 0.70

Calls 4

formatTimestampForExportFunction · 0.90
getVisibleMessagesFunction · 0.70
getConnectionExportInfoFunction · 0.70

Tested by

no test coverage detected