Skip to content

Commit 6be6bd1

Browse files
committed
Fix socket analytics blessed import
1 parent 87c7c2d commit 6be6bd1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/commands/analytics/display-analytics.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import fs from 'node:fs/promises'
22

3-
import { Widgets } from 'blessed'
3+
// @ts-ignore
4+
import ScreenWidget from 'blessed/lib/widgets/screen'
45
import contrib from 'blessed-contrib'
56

67
import { Spinner } from '@socketsecurity/registry/lib/spinner'
78

89
import { handleApiCall, handleUnsuccessfulApiResponse } from '../../utils/api'
910
import { setupSdk } from '../../utils/sdk'
1011

12+
import type { Widgets } from 'blessed' // Note: Widgets does not seem to actually work as code :'(
13+
1114
type FormattedData = {
1215
top_five_alert_types: { [key: string]: number }
1316
total_critical_alerts: { [key: string]: number }
@@ -98,7 +101,7 @@ export async function displayAnalytics({
98101
}
99102

100103
function displayAnalyticsScreen(data: FormattedData): void {
101-
const screen = new Widgets.Screen({})
104+
const screen: Widgets.Screen = new ScreenWidget({})
102105
const grid = new contrib.grid({ rows: 5, cols: 4, screen })
103106

104107
renderLineCharts(

0 commit comments

Comments
 (0)