driftdetect-galaxy 0.4.2
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/dist/audio/index.d.ts +8 -0
- package/dist/audio/index.d.ts.map +1 -0
- package/dist/audio/index.js +8 -0
- package/dist/audio/index.js.map +1 -0
- package/dist/audio/sound-effects.d.ts +78 -0
- package/dist/audio/sound-effects.d.ts.map +1 -0
- package/dist/audio/sound-effects.js +660 -0
- package/dist/audio/sound-effects.js.map +1 -0
- package/dist/audio/useGalaxySound.d.ts +70 -0
- package/dist/audio/useGalaxySound.d.ts.map +1 -0
- package/dist/audio/useGalaxySound.js +127 -0
- package/dist/audio/useGalaxySound.js.map +1 -0
- package/dist/components/canvas/GalaxyCamera.d.ts +16 -0
- package/dist/components/canvas/GalaxyCamera.d.ts.map +1 -0
- package/dist/components/canvas/GalaxyCamera.js +74 -0
- package/dist/components/canvas/GalaxyCamera.js.map +1 -0
- package/dist/components/canvas/GalaxyCanvas.d.ts +16 -0
- package/dist/components/canvas/GalaxyCanvas.d.ts.map +1 -0
- package/dist/components/canvas/GalaxyCanvas.js +104 -0
- package/dist/components/canvas/GalaxyCanvas.js.map +1 -0
- package/dist/components/canvas/GalaxyLighting.d.ts +8 -0
- package/dist/components/canvas/GalaxyLighting.d.ts.map +1 -0
- package/dist/components/canvas/GalaxyLighting.js +36 -0
- package/dist/components/canvas/GalaxyLighting.js.map +1 -0
- package/dist/components/canvas/index.d.ts +11 -0
- package/dist/components/canvas/index.d.ts.map +1 -0
- package/dist/components/canvas/index.js +9 -0
- package/dist/components/canvas/index.js.map +1 -0
- package/dist/components/connections/DataPathLane.d.ts +26 -0
- package/dist/components/connections/DataPathLane.d.ts.map +1 -0
- package/dist/components/connections/DataPathLane.js +71 -0
- package/dist/components/connections/DataPathLane.js.map +1 -0
- package/dist/components/connections/TableRelationship.d.ts +19 -0
- package/dist/components/connections/TableRelationship.d.ts.map +1 -0
- package/dist/components/connections/TableRelationship.js +46 -0
- package/dist/components/connections/TableRelationship.js.map +1 -0
- package/dist/components/connections/index.d.ts +10 -0
- package/dist/components/connections/index.d.ts.map +1 -0
- package/dist/components/connections/index.js +8 -0
- package/dist/components/connections/index.js.map +1 -0
- package/dist/components/effects/AccessPulse.d.ts +23 -0
- package/dist/components/effects/AccessPulse.d.ts.map +1 -0
- package/dist/components/effects/AccessPulse.js +72 -0
- package/dist/components/effects/AccessPulse.js.map +1 -0
- package/dist/components/effects/GalaxyBloom.d.ts +8 -0
- package/dist/components/effects/GalaxyBloom.d.ts.map +1 -0
- package/dist/components/effects/GalaxyBloom.js +23 -0
- package/dist/components/effects/GalaxyBloom.js.map +1 -0
- package/dist/components/effects/StarField.d.ts +18 -0
- package/dist/components/effects/StarField.d.ts.map +1 -0
- package/dist/components/effects/StarField.js +86 -0
- package/dist/components/effects/StarField.js.map +1 -0
- package/dist/components/effects/index.d.ts +11 -0
- package/dist/components/effects/index.d.ts.map +1 -0
- package/dist/components/effects/index.js +9 -0
- package/dist/components/effects/index.js.map +1 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +16 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/nodes/EntryPointStation.d.ts +22 -0
- package/dist/components/nodes/EntryPointStation.d.ts.map +1 -0
- package/dist/components/nodes/EntryPointStation.js +120 -0
- package/dist/components/nodes/EntryPointStation.js.map +1 -0
- package/dist/components/nodes/FieldMoon.d.ts +30 -0
- package/dist/components/nodes/FieldMoon.d.ts.map +1 -0
- package/dist/components/nodes/FieldMoon.js +92 -0
- package/dist/components/nodes/FieldMoon.js.map +1 -0
- package/dist/components/nodes/TablePlanet.d.ts +22 -0
- package/dist/components/nodes/TablePlanet.d.ts.map +1 -0
- package/dist/components/nodes/TablePlanet.js +101 -0
- package/dist/components/nodes/TablePlanet.js.map +1 -0
- package/dist/components/nodes/index.d.ts +12 -0
- package/dist/components/nodes/index.d.ts.map +1 -0
- package/dist/components/nodes/index.js +9 -0
- package/dist/components/nodes/index.js.map +1 -0
- package/dist/components/ui/ControlsPanel.d.ts +7 -0
- package/dist/components/ui/ControlsPanel.d.ts.map +1 -0
- package/dist/components/ui/ControlsPanel.js +59 -0
- package/dist/components/ui/ControlsPanel.js.map +1 -0
- package/dist/components/ui/DetailsPanel.d.ts +8 -0
- package/dist/components/ui/DetailsPanel.d.ts.map +1 -0
- package/dist/components/ui/DetailsPanel.js +44 -0
- package/dist/components/ui/DetailsPanel.js.map +1 -0
- package/dist/components/ui/SearchOverlay.d.ts +7 -0
- package/dist/components/ui/SearchOverlay.d.ts.map +1 -0
- package/dist/components/ui/SearchOverlay.js +68 -0
- package/dist/components/ui/SearchOverlay.js.map +1 -0
- package/dist/components/ui/SecurityPanel.d.ts +8 -0
- package/dist/components/ui/SecurityPanel.d.ts.map +1 -0
- package/dist/components/ui/SecurityPanel.js +65 -0
- package/dist/components/ui/SecurityPanel.js.map +1 -0
- package/dist/components/ui/StatsOverlay.d.ts +7 -0
- package/dist/components/ui/StatsOverlay.d.ts.map +1 -0
- package/dist/components/ui/StatsOverlay.js +29 -0
- package/dist/components/ui/StatsOverlay.js.map +1 -0
- package/dist/components/ui/index.d.ts +11 -0
- package/dist/components/ui/index.d.ts.map +1 -0
- package/dist/components/ui/index.js +11 -0
- package/dist/components/ui/index.js.map +1 -0
- package/dist/constants/index.d.ts +244 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +289 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +8 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useAccessStream.d.ts +23 -0
- package/dist/hooks/useAccessStream.d.ts.map +1 -0
- package/dist/hooks/useAccessStream.js +86 -0
- package/dist/hooks/useAccessStream.js.map +1 -0
- package/dist/hooks/useGalaxyData.d.ts +83 -0
- package/dist/hooks/useGalaxyData.d.ts.map +1 -0
- package/dist/hooks/useGalaxyData.js +176 -0
- package/dist/hooks/useGalaxyData.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/store/galaxy-store.d.ts +85 -0
- package/dist/store/galaxy-store.d.ts.map +1 -0
- package/dist/store/galaxy-store.js +254 -0
- package/dist/store/galaxy-store.js.map +1 -0
- package/dist/store/index.d.ts +5 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +5 -0
- package/dist/store/index.js.map +1 -0
- package/dist/types/index.d.ts +337 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/color-utils.d.ts +100 -0
- package/dist/utils/color-utils.d.ts.map +1 -0
- package/dist/utils/color-utils.js +217 -0
- package/dist/utils/color-utils.js.map +1 -0
- package/dist/utils/geometry-utils.d.ts +97 -0
- package/dist/utils/geometry-utils.d.ts.map +1 -0
- package/dist/utils/geometry-utils.js +245 -0
- package/dist/utils/geometry-utils.js.map +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +7 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/layout-engine.d.ts +40 -0
- package/dist/utils/layout-engine.d.ts.map +1 -0
- package/dist/utils/layout-engine.js +343 -0
- package/dist/utils/layout-engine.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Galaxy Constants
|
|
3
|
+
*
|
|
4
|
+
* Centralized configuration for colors, sizes, and visual parameters.
|
|
5
|
+
* All values are tuned for optimal visual clarity and performance.
|
|
6
|
+
*/
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// Color Palettes
|
|
9
|
+
// ============================================================================
|
|
10
|
+
/**
|
|
11
|
+
* Sensitivity level colors (hex)
|
|
12
|
+
* Designed for dark background with high contrast
|
|
13
|
+
*/
|
|
14
|
+
export const SENSITIVITY_COLORS = {
|
|
15
|
+
critical: '#ff3366', // Bright red-pink (credentials, secrets)
|
|
16
|
+
high: '#ff9933', // Orange (financial, health)
|
|
17
|
+
medium: '#ffcc00', // Yellow (PII)
|
|
18
|
+
low: '#33ccff', // Cyan (internal)
|
|
19
|
+
public: '#66ff99', // Green (safe)
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Sensitivity level emissive intensity (glow strength)
|
|
23
|
+
*/
|
|
24
|
+
export const SENSITIVITY_EMISSIVE = {
|
|
25
|
+
critical: 0.8,
|
|
26
|
+
high: 0.6,
|
|
27
|
+
medium: 0.4,
|
|
28
|
+
low: 0.2,
|
|
29
|
+
public: 0.1,
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Security tier colors
|
|
33
|
+
*/
|
|
34
|
+
export const SECURITY_TIER_COLORS = {
|
|
35
|
+
P0: '#ff0000', // Red - Critical
|
|
36
|
+
P1: '#ff6600', // Orange - High
|
|
37
|
+
P2: '#ffcc00', // Yellow - Medium
|
|
38
|
+
P3: '#66ccff', // Light blue - Low
|
|
39
|
+
P4: '#99ff99', // Light green - Minimal
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Authentication level colors for entry points
|
|
43
|
+
*/
|
|
44
|
+
export const AUTH_LEVEL_COLORS = {
|
|
45
|
+
public: '#ff3333', // Red - Dangerous
|
|
46
|
+
authenticated: '#ffcc00', // Yellow - Caution
|
|
47
|
+
admin: '#33cc33', // Green - Protected
|
|
48
|
+
internal: '#3366ff', // Blue - Internal only
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Data operation colors for paths
|
|
52
|
+
*/
|
|
53
|
+
export const OPERATION_COLORS = {
|
|
54
|
+
read: '#33ccff', // Cyan - Read
|
|
55
|
+
write: '#ff9933', // Orange - Write
|
|
56
|
+
delete: '#ff3366', // Red - Delete
|
|
57
|
+
unknown: '#999999', // Gray - Unknown
|
|
58
|
+
};
|
|
59
|
+
// ============================================================================
|
|
60
|
+
// Size Constants
|
|
61
|
+
// ============================================================================
|
|
62
|
+
/**
|
|
63
|
+
* Table (planet) size configuration
|
|
64
|
+
*/
|
|
65
|
+
export const TABLE_SIZE = {
|
|
66
|
+
/** Minimum radius */
|
|
67
|
+
MIN_RADIUS: 0.5,
|
|
68
|
+
/** Maximum radius */
|
|
69
|
+
MAX_RADIUS: 3.0,
|
|
70
|
+
/** Base radius for average tables */
|
|
71
|
+
BASE_RADIUS: 1.0,
|
|
72
|
+
/** Scale factor for row count */
|
|
73
|
+
ROW_COUNT_SCALE: 0.0001,
|
|
74
|
+
/** Scale factor for access frequency */
|
|
75
|
+
ACCESS_SCALE: 0.01,
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Field (moon) size configuration
|
|
79
|
+
*/
|
|
80
|
+
export const FIELD_SIZE = {
|
|
81
|
+
/** Base radius */
|
|
82
|
+
RADIUS: 0.15,
|
|
83
|
+
/** Orbit radius from parent table */
|
|
84
|
+
ORBIT_RADIUS: 2.0,
|
|
85
|
+
/** Orbit speed (radians per second) */
|
|
86
|
+
ORBIT_SPEED: 0.5,
|
|
87
|
+
/** Sensitive field scale multiplier */
|
|
88
|
+
SENSITIVE_SCALE: 1.5,
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Entry point (space station) size configuration
|
|
92
|
+
*/
|
|
93
|
+
export const ENTRY_POINT_SIZE = {
|
|
94
|
+
/** Base scale */
|
|
95
|
+
SCALE: 0.8,
|
|
96
|
+
/** Distance from galaxy center */
|
|
97
|
+
ORBIT_RADIUS: 50,
|
|
98
|
+
/** Height variation */
|
|
99
|
+
HEIGHT_VARIANCE: 10,
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Data path (hyperspace lane) configuration
|
|
103
|
+
*/
|
|
104
|
+
export const PATH_CONFIG = {
|
|
105
|
+
/** Base line width */
|
|
106
|
+
BASE_WIDTH: 0.05,
|
|
107
|
+
/** Max line width */
|
|
108
|
+
MAX_WIDTH: 0.3,
|
|
109
|
+
/** Curve segments */
|
|
110
|
+
CURVE_SEGMENTS: 50,
|
|
111
|
+
/** Animation speed */
|
|
112
|
+
FLOW_SPEED: 2.0,
|
|
113
|
+
/** Dash size */
|
|
114
|
+
DASH_SIZE: 0.5,
|
|
115
|
+
/** Gap size */
|
|
116
|
+
GAP_SIZE: 0.3,
|
|
117
|
+
};
|
|
118
|
+
// ============================================================================
|
|
119
|
+
// Layout Constants
|
|
120
|
+
// ============================================================================
|
|
121
|
+
/**
|
|
122
|
+
* Galaxy layout configuration
|
|
123
|
+
*/
|
|
124
|
+
export const GALAXY_LAYOUT = {
|
|
125
|
+
/** Galaxy radius */
|
|
126
|
+
RADIUS: 40,
|
|
127
|
+
/** Vertical spread */
|
|
128
|
+
HEIGHT: 15,
|
|
129
|
+
/** Cluster separation */
|
|
130
|
+
CLUSTER_SEPARATION: 20,
|
|
131
|
+
/** Minimum distance between tables */
|
|
132
|
+
MIN_TABLE_DISTANCE: 5,
|
|
133
|
+
/** Force simulation iterations */
|
|
134
|
+
SIMULATION_ITERATIONS: 300,
|
|
135
|
+
/** Force strength */
|
|
136
|
+
FORCE_STRENGTH: -30,
|
|
137
|
+
/** Link distance */
|
|
138
|
+
LINK_DISTANCE: 10,
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Camera configuration
|
|
142
|
+
*/
|
|
143
|
+
export const CAMERA_CONFIG = {
|
|
144
|
+
/** Default position */
|
|
145
|
+
DEFAULT_POSITION: { x: 0, y: 30, z: 60 },
|
|
146
|
+
/** Default target */
|
|
147
|
+
DEFAULT_TARGET: { x: 0, y: 0, z: 0 },
|
|
148
|
+
/** Field of view */
|
|
149
|
+
FOV: 60,
|
|
150
|
+
/** Near clipping plane */
|
|
151
|
+
NEAR: 0.1,
|
|
152
|
+
/** Far clipping plane */
|
|
153
|
+
FAR: 1000,
|
|
154
|
+
/** Zoom limits */
|
|
155
|
+
MIN_ZOOM: 0.5,
|
|
156
|
+
MAX_ZOOM: 5,
|
|
157
|
+
/** Pan limits */
|
|
158
|
+
PAN_LIMIT: 100,
|
|
159
|
+
/** Rotation speed */
|
|
160
|
+
ROTATION_SPEED: 0.5,
|
|
161
|
+
/** Zoom speed */
|
|
162
|
+
ZOOM_SPEED: 1.2,
|
|
163
|
+
/** Animation duration (ms) */
|
|
164
|
+
ANIMATION_DURATION: 1000,
|
|
165
|
+
};
|
|
166
|
+
// ============================================================================
|
|
167
|
+
// Visual Effects
|
|
168
|
+
// ============================================================================
|
|
169
|
+
/**
|
|
170
|
+
* Bloom effect configuration
|
|
171
|
+
*/
|
|
172
|
+
export const BLOOM_CONFIG = {
|
|
173
|
+
/** Intensity */
|
|
174
|
+
INTENSITY: 1.5,
|
|
175
|
+
/** Luminance threshold */
|
|
176
|
+
LUMINANCE_THRESHOLD: 0.2,
|
|
177
|
+
/** Luminance smoothing */
|
|
178
|
+
LUMINANCE_SMOOTHING: 0.9,
|
|
179
|
+
/** Blur passes */
|
|
180
|
+
BLUR_PASSES: 5,
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Particle effect configuration
|
|
184
|
+
*/
|
|
185
|
+
export const PARTICLE_CONFIG = {
|
|
186
|
+
/** Star field count */
|
|
187
|
+
STAR_COUNT: 5000,
|
|
188
|
+
/** Star size */
|
|
189
|
+
STAR_SIZE: 0.1,
|
|
190
|
+
/** Access pulse duration (ms) */
|
|
191
|
+
PULSE_DURATION: 500,
|
|
192
|
+
/** Trail length */
|
|
193
|
+
TRAIL_LENGTH: 20,
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Animation configuration
|
|
197
|
+
*/
|
|
198
|
+
export const ANIMATION_CONFIG = {
|
|
199
|
+
/** Hover scale */
|
|
200
|
+
HOVER_SCALE: 1.2,
|
|
201
|
+
/** Selection scale */
|
|
202
|
+
SELECTION_SCALE: 1.3,
|
|
203
|
+
/** Pulse frequency (Hz) */
|
|
204
|
+
PULSE_FREQUENCY: 2,
|
|
205
|
+
/** Rotation speed for idle animation */
|
|
206
|
+
IDLE_ROTATION: 0.001,
|
|
207
|
+
/** Transition duration (ms) */
|
|
208
|
+
TRANSITION_DURATION: 300,
|
|
209
|
+
};
|
|
210
|
+
// ============================================================================
|
|
211
|
+
// UI Constants
|
|
212
|
+
// ============================================================================
|
|
213
|
+
/**
|
|
214
|
+
* Tooltip configuration
|
|
215
|
+
*/
|
|
216
|
+
export const TOOLTIP_CONFIG = {
|
|
217
|
+
/** Offset from cursor */
|
|
218
|
+
OFFSET: { x: 15, y: 15 },
|
|
219
|
+
/** Show delay (ms) */
|
|
220
|
+
SHOW_DELAY: 200,
|
|
221
|
+
/** Hide delay (ms) */
|
|
222
|
+
HIDE_DELAY: 100,
|
|
223
|
+
/** Max width */
|
|
224
|
+
MAX_WIDTH: 300,
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* Label configuration
|
|
228
|
+
*/
|
|
229
|
+
export const LABEL_CONFIG = {
|
|
230
|
+
/** Font size */
|
|
231
|
+
FONT_SIZE: 12,
|
|
232
|
+
/** Font family */
|
|
233
|
+
FONT_FAMILY: 'Inter, system-ui, sans-serif',
|
|
234
|
+
/** Background opacity */
|
|
235
|
+
BG_OPACITY: 0.8,
|
|
236
|
+
/** Padding */
|
|
237
|
+
PADDING: 4,
|
|
238
|
+
/** Distance from node */
|
|
239
|
+
OFFSET: 0.5,
|
|
240
|
+
/** Fade distance */
|
|
241
|
+
FADE_DISTANCE: 30,
|
|
242
|
+
};
|
|
243
|
+
// ============================================================================
|
|
244
|
+
// Performance Constants
|
|
245
|
+
// ============================================================================
|
|
246
|
+
/**
|
|
247
|
+
* Performance thresholds
|
|
248
|
+
*/
|
|
249
|
+
export const PERFORMANCE_CONFIG = {
|
|
250
|
+
/** Max visible tables before LOD kicks in */
|
|
251
|
+
MAX_DETAILED_TABLES: 50,
|
|
252
|
+
/** Max visible paths before simplification */
|
|
253
|
+
MAX_DETAILED_PATHS: 200,
|
|
254
|
+
/** Max visible fields */
|
|
255
|
+
MAX_VISIBLE_FIELDS: 500,
|
|
256
|
+
/** Frame rate target */
|
|
257
|
+
TARGET_FPS: 60,
|
|
258
|
+
/** Frustum culling margin */
|
|
259
|
+
CULLING_MARGIN: 1.5,
|
|
260
|
+
/** LOD distance thresholds */
|
|
261
|
+
LOD_DISTANCES: [20, 50, 100],
|
|
262
|
+
};
|
|
263
|
+
// ============================================================================
|
|
264
|
+
// Cluster Names (Domain Groupings)
|
|
265
|
+
// ============================================================================
|
|
266
|
+
/**
|
|
267
|
+
* Common domain clusters for auto-grouping tables
|
|
268
|
+
*/
|
|
269
|
+
export const DOMAIN_CLUSTERS = {
|
|
270
|
+
auth: ['users', 'accounts', 'sessions', 'tokens', 'permissions', 'roles'],
|
|
271
|
+
commerce: ['orders', 'products', 'carts', 'payments', 'invoices', 'subscriptions'],
|
|
272
|
+
content: ['posts', 'comments', 'media', 'files', 'documents', 'attachments'],
|
|
273
|
+
messaging: ['messages', 'notifications', 'emails', 'chats', 'threads'],
|
|
274
|
+
analytics: ['events', 'logs', 'metrics', 'analytics', 'tracking'],
|
|
275
|
+
config: ['settings', 'preferences', 'configurations', 'features', 'flags'],
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Cluster colors
|
|
279
|
+
*/
|
|
280
|
+
export const CLUSTER_COLORS = {
|
|
281
|
+
auth: '#ff6b6b',
|
|
282
|
+
commerce: '#4ecdc4',
|
|
283
|
+
content: '#45b7d1',
|
|
284
|
+
messaging: '#96ceb4',
|
|
285
|
+
analytics: '#dda0dd',
|
|
286
|
+
config: '#98d8c8',
|
|
287
|
+
other: '#7f8c8d',
|
|
288
|
+
};
|
|
289
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,+EAA+E;AAC/E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eAAe,GAAG;IAC7B,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC;IACzE,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,CAAC;IAClF,OAAO,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC;IAC5E,SAAS,EAAE,CAAC,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;IACtE,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAC;IACjE,MAAM,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,CAAC;CAClE,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;CACR,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks Index
|
|
3
|
+
*
|
|
4
|
+
* Exports all custom hooks for the galaxy visualization.
|
|
5
|
+
*/
|
|
6
|
+
export { useGalaxyData } from './useGalaxyData.js';
|
|
7
|
+
export type { UseGalaxyDataOptions, RawGalaxyData } from './useGalaxyData.js';
|
|
8
|
+
export { useAccessStream } from './useAccessStream.js';
|
|
9
|
+
export type { UseAccessStreamOptions } from './useAccessStream.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAccessStream Hook
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to real-time data access events for live visualization.
|
|
5
|
+
*/
|
|
6
|
+
export interface UseAccessStreamOptions {
|
|
7
|
+
/** WebSocket URL for event stream */
|
|
8
|
+
url?: string;
|
|
9
|
+
/** Auto-connect on mount */
|
|
10
|
+
autoConnect?: boolean;
|
|
11
|
+
/** Reconnect on disconnect */
|
|
12
|
+
autoReconnect?: boolean;
|
|
13
|
+
/** Reconnect delay in ms */
|
|
14
|
+
reconnectDelay?: number;
|
|
15
|
+
/** Max events to keep in memory */
|
|
16
|
+
maxEvents?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function useAccessStream(options?: UseAccessStreamOptions): {
|
|
19
|
+
isConnected: boolean;
|
|
20
|
+
connect: () => void;
|
|
21
|
+
disconnect: () => void;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useAccessStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccessStream.d.ts","sourceRoot":"","sources":["../../src/hooks/useAccessStream.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8BAA8B;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4BAA4B;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B;;;;EA8FnE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAccessStream Hook
|
|
3
|
+
*
|
|
4
|
+
* Subscribes to real-time data access events for live visualization.
|
|
5
|
+
*/
|
|
6
|
+
import { useEffect, useCallback, useRef } from 'react';
|
|
7
|
+
import { useGalaxyStore } from '../store/index.js';
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Hook Implementation
|
|
10
|
+
// ============================================================================
|
|
11
|
+
export function useAccessStream(options = {}) {
|
|
12
|
+
const { url = 'ws://localhost:3001/events', autoConnect = false, autoReconnect = true, reconnectDelay = 3000, maxEvents = 100, } = options;
|
|
13
|
+
const { addEvent, setLiveMode, isLiveMode } = useGalaxyStore();
|
|
14
|
+
const wsRef = useRef(null);
|
|
15
|
+
const reconnectTimeoutRef = useRef(null);
|
|
16
|
+
// Connect to WebSocket
|
|
17
|
+
const connect = useCallback(() => {
|
|
18
|
+
if (wsRef.current?.readyState === WebSocket.OPEN)
|
|
19
|
+
return;
|
|
20
|
+
try {
|
|
21
|
+
const ws = new WebSocket(url);
|
|
22
|
+
ws.onopen = () => {
|
|
23
|
+
setLiveMode(true);
|
|
24
|
+
console.log('[Galaxy] Connected to event stream');
|
|
25
|
+
};
|
|
26
|
+
ws.onmessage = (event) => {
|
|
27
|
+
try {
|
|
28
|
+
const data = JSON.parse(event.data);
|
|
29
|
+
// Transform to GalaxyEvent
|
|
30
|
+
const galaxyEvent = {
|
|
31
|
+
type: data.type || 'access',
|
|
32
|
+
targetId: data.tableId || data.targetId,
|
|
33
|
+
data: data,
|
|
34
|
+
timestamp: data.timestamp || new Date().toISOString(),
|
|
35
|
+
};
|
|
36
|
+
addEvent(galaxyEvent);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
console.warn('[Galaxy] Failed to parse event:', err);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
ws.onclose = () => {
|
|
43
|
+
setLiveMode(false);
|
|
44
|
+
console.log('[Galaxy] Disconnected from event stream');
|
|
45
|
+
// Auto-reconnect
|
|
46
|
+
if (autoReconnect) {
|
|
47
|
+
reconnectTimeoutRef.current = setTimeout(connect, reconnectDelay);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
ws.onerror = (err) => {
|
|
51
|
+
console.error('[Galaxy] WebSocket error:', err);
|
|
52
|
+
};
|
|
53
|
+
wsRef.current = ws;
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
console.error('[Galaxy] Failed to connect:', err);
|
|
57
|
+
}
|
|
58
|
+
}, [url, autoReconnect, reconnectDelay, addEvent, setLiveMode]);
|
|
59
|
+
// Disconnect from WebSocket
|
|
60
|
+
const disconnect = useCallback(() => {
|
|
61
|
+
if (reconnectTimeoutRef.current) {
|
|
62
|
+
clearTimeout(reconnectTimeoutRef.current);
|
|
63
|
+
reconnectTimeoutRef.current = null;
|
|
64
|
+
}
|
|
65
|
+
if (wsRef.current) {
|
|
66
|
+
wsRef.current.close();
|
|
67
|
+
wsRef.current = null;
|
|
68
|
+
}
|
|
69
|
+
setLiveMode(false);
|
|
70
|
+
}, [setLiveMode]);
|
|
71
|
+
// Auto-connect on mount
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (autoConnect) {
|
|
74
|
+
connect();
|
|
75
|
+
}
|
|
76
|
+
return () => {
|
|
77
|
+
disconnect();
|
|
78
|
+
};
|
|
79
|
+
}, [autoConnect, connect, disconnect]);
|
|
80
|
+
return {
|
|
81
|
+
isConnected: isLiveMode,
|
|
82
|
+
connect,
|
|
83
|
+
disconnect,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=useAccessStream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccessStream.js","sourceRoot":"","sources":["../../src/hooks/useAccessStream.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAoBnD,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E,MAAM,UAAU,eAAe,CAAC,UAAkC,EAAE;IAClE,MAAM,EACJ,GAAG,GAAG,4BAA4B,EAClC,WAAW,GAAG,KAAK,EACnB,aAAa,GAAG,IAAI,EACpB,cAAc,GAAG,IAAI,EACrB,SAAS,GAAG,GAAG,GAChB,GAAG,OAAO,CAAC;IAEZ,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/D,MAAM,KAAK,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAC7C,MAAM,mBAAmB,GAAG,MAAM,CAAwB,IAAI,CAAC,CAAC;IAEhE,uBAAuB;IACvB,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,IAAI,KAAK,CAAC,OAAO,EAAE,UAAU,KAAK,SAAS,CAAC,IAAI;YAAE,OAAO;QAEzD,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC;YAE9B,EAAE,CAAC,MAAM,GAAG,GAAG,EAAE;gBACf,WAAW,CAAC,IAAI,CAAC,CAAC;gBAClB,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;YACpD,CAAC,CAAC;YAEF,EAAE,C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QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;IAEhE,4BAA4B;IAC5B,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE;QAClC,IAAI,mBAAmB,CAAC,OAAO,EAAE,CAAC;YAChC,YAAY,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAC1C,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC;QACrC,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACtB,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;QACvB,CAAC;QAED,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,wBAAwB;IACxB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,GAAG,EAAE;YACV,UAAU,EAAE,CAAC;QACf,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IAEvC,OAAO;QACL,WAAW,EAAE,UAAU;QACvB,OAAO;QACP,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useGalaxyData Hook
|
|
3
|
+
*
|
|
4
|
+
* Fetches and transforms data from Drift's boundary scanner and call graph
|
|
5
|
+
* into the galaxy visualization format.
|
|
6
|
+
*/
|
|
7
|
+
import type { GalaxyData } from '../types/index.js';
|
|
8
|
+
export interface UseGalaxyDataOptions {
|
|
9
|
+
/** Auto-fetch on mount */
|
|
10
|
+
autoFetch?: boolean;
|
|
11
|
+
/** Refresh interval in ms (0 = disabled) */
|
|
12
|
+
refreshInterval?: number;
|
|
13
|
+
/** Data source endpoint or function */
|
|
14
|
+
dataSource?: string | (() => Promise<RawGalaxyData>);
|
|
15
|
+
}
|
|
16
|
+
export interface RawGalaxyData {
|
|
17
|
+
tables: RawTable[];
|
|
18
|
+
entryPoints: RawEntryPoint[];
|
|
19
|
+
dataPaths: RawDataPath[];
|
|
20
|
+
relationships?: RawRelationship[];
|
|
21
|
+
}
|
|
22
|
+
interface RawTable {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
schema?: string;
|
|
26
|
+
rowCount?: number;
|
|
27
|
+
accessCount?: number;
|
|
28
|
+
sensitivity?: string;
|
|
29
|
+
securityTier?: string;
|
|
30
|
+
cluster?: string;
|
|
31
|
+
fields: RawField[];
|
|
32
|
+
}
|
|
33
|
+
interface RawField {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
dataType: string;
|
|
37
|
+
sensitivity?: string;
|
|
38
|
+
isPrimaryKey?: boolean;
|
|
39
|
+
isForeignKey?: boolean;
|
|
40
|
+
foreignKeyTarget?: string;
|
|
41
|
+
accessCount?: number;
|
|
42
|
+
isTested?: boolean;
|
|
43
|
+
}
|
|
44
|
+
interface RawEntryPoint {
|
|
45
|
+
id: string;
|
|
46
|
+
path: string;
|
|
47
|
+
method: string;
|
|
48
|
+
authLevel?: string;
|
|
49
|
+
securityTier?: string;
|
|
50
|
+
file: string;
|
|
51
|
+
line: number;
|
|
52
|
+
framework?: string;
|
|
53
|
+
reachableTables?: string[];
|
|
54
|
+
}
|
|
55
|
+
interface RawDataPath {
|
|
56
|
+
id: string;
|
|
57
|
+
sourceId: string;
|
|
58
|
+
sourceType: string;
|
|
59
|
+
targetTableId: string;
|
|
60
|
+
targetFieldId?: string;
|
|
61
|
+
operation?: string;
|
|
62
|
+
frequency?: number;
|
|
63
|
+
depth?: number;
|
|
64
|
+
isTested?: boolean;
|
|
65
|
+
callChain?: string[];
|
|
66
|
+
sensitivity?: string;
|
|
67
|
+
}
|
|
68
|
+
interface RawRelationship {
|
|
69
|
+
id: string;
|
|
70
|
+
sourceTableId: string;
|
|
71
|
+
sourceFieldId: string;
|
|
72
|
+
targetTableId: string;
|
|
73
|
+
targetFieldId: string;
|
|
74
|
+
type?: string;
|
|
75
|
+
}
|
|
76
|
+
export declare function useGalaxyData(options?: UseGalaxyDataOptions): {
|
|
77
|
+
data: GalaxyData | null;
|
|
78
|
+
isLoading: boolean;
|
|
79
|
+
error: string | null;
|
|
80
|
+
refetch: () => Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=useGalaxyData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGalaxyData.d.ts","sourceRoot":"","sources":["../../src/hooks/useGalaxyData.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAuE,MAAM,mBAAmB,CAAC;AAMzH,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;CACtD;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,SAAS,EAAE,WAAW,EAAE,CAAC;IACzB,aAAa,CAAC,EAAE,eAAe,EAAE,CAAC;CACnC;AAED,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,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