@plyaz/types 1.7.17 → 1.7.19
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/api/client/enum.d.ts +12 -0
- package/dist/api/client/index.d.ts +1 -0
- package/dist/api/client/types.d.ts +114 -0
- package/dist/api/config/types.d.ts +56 -8
- package/dist/api/debugger/enums.d.ts +152 -0
- package/dist/api/debugger/factories/index.d.ts +1 -0
- package/dist/api/debugger/factories/types.d.ts +191 -0
- package/dist/api/debugger/index.d.ts +2 -0
- package/dist/api/debugger/types.d.ts +664 -0
- package/dist/api/endpoints/campaigns/index.d.ts +1 -0
- package/dist/api/endpoints/campaigns/types.d.ts +68 -0
- package/dist/api/endpoints/health/index.d.ts +1 -0
- package/dist/api/endpoints/health/types.d.ts +127 -0
- package/dist/api/endpoints/index.d.ts +3 -0
- package/dist/api/endpoints/types.d.ts +5 -0
- package/dist/api/errors/enum.d.ts +182 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/types.d.ts +125 -26
- package/dist/api/events/enum.d.ts +261 -0
- package/dist/api/events/factories/cache/index.d.ts +1 -0
- package/dist/api/events/factories/cache/types.d.ts +60 -0
- package/dist/api/events/factories/client/index.d.ts +1 -0
- package/dist/api/events/factories/client/types.d.ts +120 -0
- package/dist/api/events/factories/config/index.d.ts +1 -0
- package/dist/api/events/factories/config/types.d.ts +79 -0
- package/dist/api/events/factories/debug/index.d.ts +1 -0
- package/dist/api/events/factories/debug/types.d.ts +130 -0
- package/dist/api/events/factories/errors/index.d.ts +1 -0
- package/dist/api/events/factories/errors/types.d.ts +293 -0
- package/dist/api/events/factories/headers/index.d.ts +1 -0
- package/dist/api/events/factories/headers/types.d.ts +256 -0
- package/dist/api/events/factories/index.d.ts +9 -0
- package/dist/api/events/factories/network/index.d.ts +1 -0
- package/dist/api/events/factories/network/types.d.ts +196 -0
- package/dist/api/events/factories/performance/index.d.ts +1 -0
- package/dist/api/events/factories/performance/types.d.ts +150 -0
- package/dist/api/events/factories/types.d.ts +84 -0
- package/dist/api/events/index.d.ts +2 -0
- package/dist/api/events/types.d.ts +4 -657
- package/dist/api/headers/enum.d.ts +34 -0
- package/dist/api/headers/index.d.ts +1 -0
- package/dist/api/headers/types.d.ts +456 -0
- package/dist/api/hooks/index.d.ts +1 -0
- package/dist/api/hooks/types.d.ts +131 -0
- package/dist/api/index.d.ts +6 -1
- package/dist/api/network/enums.d.ts +75 -5
- package/dist/api/network/frameworks/index.d.ts +2 -0
- package/dist/api/network/frameworks/nestjs/index.d.ts +1 -0
- package/dist/api/network/frameworks/nestjs/types.d.ts +47 -0
- package/dist/api/network/frameworks/types.d.ts +76 -0
- package/dist/api/network/index.d.ts +1 -0
- package/dist/api/network/types.d.ts +347 -39
- package/dist/api/performance/types.d.ts +17 -10
- package/dist/api/polling/types.d.ts +1 -1
- package/dist/api/pubsub/enum.d.ts +12 -0
- package/dist/api/pubsub/index.d.ts +2 -0
- package/dist/api/pubsub/types.d.ts +61 -0
- package/dist/api/queue/types.d.ts +69 -0
- package/dist/api/regional/enum.d.ts +75 -0
- package/dist/api/regional/index.d.ts +1 -0
- package/dist/api/regional/types.d.ts +2 -1
- package/dist/api/request/index.d.ts +1 -0
- package/dist/api/request/types.d.ts +44 -0
- package/dist/api/retry/types.d.ts +31 -0
- package/dist/api/strategies/types.d.ts +12 -8
- package/dist/errors/index.cjs +69 -0
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +66 -0
- package/dist/errors/index.js.map +1 -1
- package/dist/features/cache/types.d.ts +5 -0
- package/dist/testing/features/api/types.d.ts +355 -4
- package/package.json +5 -3
|
@@ -0,0 +1,664 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug Event Types
|
|
3
|
+
* Type definitions for all debug-related events and data structures
|
|
4
|
+
*/
|
|
5
|
+
import type { DEBUG_EVENTS, NetworkConfigOverrideEvent, NetworkQualityEvent } from '../events';
|
|
6
|
+
import type { ConfigSource } from '..';
|
|
7
|
+
import type { ApiConfig } from '../config';
|
|
8
|
+
import type { EventTrackingAnalysis } from './factories';
|
|
9
|
+
import type { NETWORK_QUALITY, NetworkClientHints, NetworkInfo } from '../network';
|
|
10
|
+
import type { HEADER_STAGES, HISTORY_TYPES } from './enums';
|
|
11
|
+
export type HistoryType = (typeof HISTORY_TYPES)[keyof typeof HISTORY_TYPES];
|
|
12
|
+
export type HeaderStage = (typeof HEADER_STAGES)[keyof typeof HEADER_STAGES];
|
|
13
|
+
/**
|
|
14
|
+
* Configuration that can be tracked
|
|
15
|
+
*/
|
|
16
|
+
export type TrackableConfig = Partial<ApiConfig> | Record<string, unknown>;
|
|
17
|
+
/**
|
|
18
|
+
* Configuration conflict details
|
|
19
|
+
*/
|
|
20
|
+
export interface ConfigConflict {
|
|
21
|
+
/** Property that has a conflict */
|
|
22
|
+
property: string;
|
|
23
|
+
/** Previous value before conflict */
|
|
24
|
+
previousValue: unknown;
|
|
25
|
+
/** New value after conflict */
|
|
26
|
+
newValue: unknown;
|
|
27
|
+
/** Source of the previous value */
|
|
28
|
+
previousSource: string;
|
|
29
|
+
/** Source of the new value */
|
|
30
|
+
newSource: string;
|
|
31
|
+
/** Reason for precedence */
|
|
32
|
+
precedenceReason?: string;
|
|
33
|
+
/** Timestamp of conflict detection */
|
|
34
|
+
timestamp?: number;
|
|
35
|
+
/** Which source won the conflict resolution */
|
|
36
|
+
resolution?: string;
|
|
37
|
+
/** Severity of the conflict */
|
|
38
|
+
severity?: 'high' | 'medium' | 'low';
|
|
39
|
+
/** Description of the conflict */
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Performance impact metrics
|
|
44
|
+
*/
|
|
45
|
+
export interface PerformanceImpact {
|
|
46
|
+
/** User experience score (0-100) */
|
|
47
|
+
uxScore: number;
|
|
48
|
+
/** Bandwidth score (0-100) */
|
|
49
|
+
bandwidthScore: number;
|
|
50
|
+
/** Latency score (0-100) */
|
|
51
|
+
latencyScore: number;
|
|
52
|
+
/** Overall impact level */
|
|
53
|
+
level: 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
54
|
+
/** Number of requests tracked */
|
|
55
|
+
requestCount?: number;
|
|
56
|
+
/** Latency impact in milliseconds */
|
|
57
|
+
latencyImpact?: number;
|
|
58
|
+
/** Bandwidth impact as percentage */
|
|
59
|
+
bandwidthImpact?: number;
|
|
60
|
+
/** Detailed metrics */
|
|
61
|
+
metrics: {
|
|
62
|
+
avgLatency?: number;
|
|
63
|
+
avgBandwidth?: number;
|
|
64
|
+
errorRate?: number;
|
|
65
|
+
successRate?: number;
|
|
66
|
+
};
|
|
67
|
+
/** Performance recommendations */
|
|
68
|
+
recommendations?: string[];
|
|
69
|
+
/** Cache efficiency impact */
|
|
70
|
+
cacheEfficiencyImpact?: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Active override information
|
|
74
|
+
*/
|
|
75
|
+
export interface ActiveOverride {
|
|
76
|
+
/** Property being overridden */
|
|
77
|
+
property: string;
|
|
78
|
+
/** Original value */
|
|
79
|
+
originalValue: unknown;
|
|
80
|
+
/** Override value */
|
|
81
|
+
overrideValue: unknown;
|
|
82
|
+
/** Source of override */
|
|
83
|
+
source: string;
|
|
84
|
+
/** Reason for override */
|
|
85
|
+
reason: string;
|
|
86
|
+
/** When override was applied */
|
|
87
|
+
appliedAt: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Configuration history entry
|
|
91
|
+
*/
|
|
92
|
+
export interface ConfigHistoryEntry {
|
|
93
|
+
timestamp: number;
|
|
94
|
+
changeType: 'override' | 'restore' | 'preset_change' | 'user_preference' | 'auto_optimization';
|
|
95
|
+
changes?: Array<{
|
|
96
|
+
property: string;
|
|
97
|
+
previousValue: unknown;
|
|
98
|
+
newValue: unknown;
|
|
99
|
+
source: ConfigSource;
|
|
100
|
+
}>;
|
|
101
|
+
networkConditions?: {
|
|
102
|
+
quality: NETWORK_QUALITY;
|
|
103
|
+
info: NetworkInfo;
|
|
104
|
+
};
|
|
105
|
+
trigger?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Debug information structure
|
|
109
|
+
*/
|
|
110
|
+
export interface DebugInfo {
|
|
111
|
+
/** Current timestamp */
|
|
112
|
+
timestamp: number;
|
|
113
|
+
/** Network information */
|
|
114
|
+
networkInfo: NetworkInfo;
|
|
115
|
+
/** Network quality assessment */
|
|
116
|
+
networkQuality: NETWORK_QUALITY;
|
|
117
|
+
/** Active configuration overrides */
|
|
118
|
+
activeOverrides: ActiveOverride[];
|
|
119
|
+
/** Recent configuration conflicts */
|
|
120
|
+
recentConflicts: ConfigConflict[];
|
|
121
|
+
/** Performance impact assessment */
|
|
122
|
+
performanceImpact: PerformanceImpact;
|
|
123
|
+
/** Configuration change history */
|
|
124
|
+
configHistory?: ConfigHistoryEntry[];
|
|
125
|
+
/** Client hints data */
|
|
126
|
+
clientHints?: NetworkClientHints;
|
|
127
|
+
/** Additional context data */
|
|
128
|
+
context: {
|
|
129
|
+
userAgent?: string;
|
|
130
|
+
platform?: string;
|
|
131
|
+
environment?: string;
|
|
132
|
+
[key: string]: unknown;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Debug event listener types
|
|
137
|
+
*/
|
|
138
|
+
export type ConflictHandler = (conflict: ConfigConflict) => void;
|
|
139
|
+
export type ConflictsHandler = (conflicts: ConfigConflict[]) => void;
|
|
140
|
+
export type DebugInfoHandler = (debugInfo: DebugInfo) => void;
|
|
141
|
+
export type ConfigOverrideHandler = (event: NetworkConfigOverrideEvent) => void;
|
|
142
|
+
export type NetworkQualityHandler = (event: NetworkQualityEvent) => void;
|
|
143
|
+
/**
|
|
144
|
+
* Additional handler type definitions for debug events
|
|
145
|
+
*/
|
|
146
|
+
export type ConfigChangeHandler = (event: ConfigChangeEvent) => void;
|
|
147
|
+
export type HeadersTrackedHandler = (event: HeadersTrackedEvent) => void;
|
|
148
|
+
export type NetworkOverrideHandler = (event: NetworkOverrideEvent) => void;
|
|
149
|
+
export type PerformanceImpactHandler = (impact: PerformanceImpact) => void;
|
|
150
|
+
export type MonitoringAlertHandler = (alert: MonitoringAlert) => void;
|
|
151
|
+
export type NetworkStateChangedHandler = (state: {
|
|
152
|
+
online: boolean;
|
|
153
|
+
quality?: string;
|
|
154
|
+
}) => void;
|
|
155
|
+
export type NetworkDataClearedHandler = () => void;
|
|
156
|
+
/**
|
|
157
|
+
* Debug events configuration
|
|
158
|
+
*/
|
|
159
|
+
export interface DebugEventsConfig {
|
|
160
|
+
/** Handler for individual conflicts */
|
|
161
|
+
onConflict?: ConflictHandler | ConflictHandler[];
|
|
162
|
+
/** Handler for batch conflict checks */
|
|
163
|
+
onConflictsCheck?: ConflictsHandler | ConflictsHandler[];
|
|
164
|
+
/** Handler for debug info updates */
|
|
165
|
+
onDebugInfo?: DebugInfoHandler | DebugInfoHandler[];
|
|
166
|
+
/** Handler for configuration overrides */
|
|
167
|
+
onConfigOverride?: ConfigOverrideHandler;
|
|
168
|
+
/** Handler for network quality changes */
|
|
169
|
+
onNetworkQualityChange?: NetworkQualityHandler;
|
|
170
|
+
/** Handler for configuration changes */
|
|
171
|
+
onConfigChange?: ConfigChangeHandler | ConfigChangeHandler[];
|
|
172
|
+
/** Handler for headers being tracked */
|
|
173
|
+
onHeadersTracked?: HeadersTrackedHandler | HeadersTrackedHandler[];
|
|
174
|
+
/** Handler for network overrides */
|
|
175
|
+
onNetworkOverride?: NetworkOverrideHandler | NetworkOverrideHandler[];
|
|
176
|
+
/** Handler for performance impact events */
|
|
177
|
+
onPerformanceImpact?: PerformanceImpactHandler | PerformanceImpactHandler[];
|
|
178
|
+
/** Handler for monitoring alerts */
|
|
179
|
+
onMonitoringAlert?: MonitoringAlertHandler | MonitoringAlertHandler[];
|
|
180
|
+
/** Handler for network state changes */
|
|
181
|
+
onNetworkStateChanged?: NetworkStateChangedHandler | NetworkStateChangedHandler[];
|
|
182
|
+
/** Handler for network data being cleared */
|
|
183
|
+
onNetworkDataCleared?: NetworkDataClearedHandler | NetworkDataClearedHandler[];
|
|
184
|
+
/** Enable automatic conflict checking */
|
|
185
|
+
autoCheckConflicts?: boolean;
|
|
186
|
+
/** Interval for automatic conflict checks (ms) */
|
|
187
|
+
autoCheckInterval?: number;
|
|
188
|
+
/** Enable automatic debug info generation */
|
|
189
|
+
autoGenerateDebugInfo?: boolean;
|
|
190
|
+
/** Interval for debug info generation (ms) */
|
|
191
|
+
debugInfoInterval?: number;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Alert types for monitoring
|
|
195
|
+
*/
|
|
196
|
+
export interface MonitoringAlert {
|
|
197
|
+
/** Alert type */
|
|
198
|
+
type: 'conflict' | 'performance' | 'network';
|
|
199
|
+
/** Alert message */
|
|
200
|
+
message: string;
|
|
201
|
+
/** Alert severity */
|
|
202
|
+
severity?: 'info' | 'warning' | 'error' | 'critical';
|
|
203
|
+
/** Additional alert data */
|
|
204
|
+
data?: ConfigConflict | PerformanceImpact | NetworkQualityEvent['data'];
|
|
205
|
+
/** Alert timestamp */
|
|
206
|
+
timestamp: number;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Factory operation types for type safety
|
|
210
|
+
*/
|
|
211
|
+
export type FactoryOperationType = 'factory_created' | 'factory_accessed' | 'factory_initialized' | 'factories_reset' | 'factory_register' | 'handler_registered' | 'handler_unregistered' | 'scope_listeners_cleared';
|
|
212
|
+
/**
|
|
213
|
+
* Event operation types for pubsub and event system
|
|
214
|
+
*/
|
|
215
|
+
export type EventOperationType = 'on' | 'once' | 'off' | 'emit' | 'emit_across_scopes' | 'removeAllListeners' | 'once_executed' | 'config_update' | 'config_update_failed' | 'global_config_update' | 'global_config_reset' | 'scope_change' | 'factory_create' | 'factory_coordination' | 'handler_strategy' | 'handler_strategy_applied';
|
|
216
|
+
/**
|
|
217
|
+
* Combined operation types for unified tracking
|
|
218
|
+
*/
|
|
219
|
+
export type UnifiedOperationType = FactoryOperationType | EventOperationType;
|
|
220
|
+
/**
|
|
221
|
+
* Debug event types
|
|
222
|
+
*/
|
|
223
|
+
export interface DebugEvent {
|
|
224
|
+
type: string;
|
|
225
|
+
data: unknown;
|
|
226
|
+
timestamp: string;
|
|
227
|
+
}
|
|
228
|
+
export interface ConfigConflictEvent extends DebugEvent {
|
|
229
|
+
type: typeof DEBUG_EVENTS.CONFIG_CONFLICT;
|
|
230
|
+
data: ConfigConflict;
|
|
231
|
+
}
|
|
232
|
+
export interface ConfigChangeEvent extends DebugEvent {
|
|
233
|
+
type: typeof DEBUG_EVENTS.CONFIG_CHANGE;
|
|
234
|
+
data: {
|
|
235
|
+
property: string;
|
|
236
|
+
oldValue: unknown;
|
|
237
|
+
newValue: unknown;
|
|
238
|
+
source: ConfigSource;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
export interface HeadersTrackedEvent extends DebugEvent {
|
|
242
|
+
type: typeof DEBUG_EVENTS.HEADERS_TRACKED;
|
|
243
|
+
data: {
|
|
244
|
+
headers: Record<string, string>;
|
|
245
|
+
source: ConfigSource;
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
export interface NetworkOverrideEvent extends DebugEvent {
|
|
249
|
+
type: typeof DEBUG_EVENTS.NETWORK_OVERRIDE;
|
|
250
|
+
data: {
|
|
251
|
+
overrides: ActiveOverride[];
|
|
252
|
+
reason: string;
|
|
253
|
+
temporary?: boolean;
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
export interface TrackedValue {
|
|
257
|
+
value: unknown;
|
|
258
|
+
source: ConfigSource;
|
|
259
|
+
timestamp: number;
|
|
260
|
+
metadata?: Record<string, unknown>;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Header changes detected between transformations
|
|
264
|
+
*/
|
|
265
|
+
export interface HeaderChanges {
|
|
266
|
+
added?: string[];
|
|
267
|
+
modified?: string[];
|
|
268
|
+
removed?: string[];
|
|
269
|
+
}
|
|
270
|
+
export interface HeaderTransformation {
|
|
271
|
+
stage: HeaderStage;
|
|
272
|
+
headers: Record<string, string>;
|
|
273
|
+
source: ConfigSource;
|
|
274
|
+
timestamp: number;
|
|
275
|
+
changes?: HeaderChanges;
|
|
276
|
+
metadata?: Record<string, unknown>;
|
|
277
|
+
}
|
|
278
|
+
export interface NetworkOverride extends NetworkOverrideParams {
|
|
279
|
+
appliedAt: number;
|
|
280
|
+
active: boolean;
|
|
281
|
+
impact?: number;
|
|
282
|
+
}
|
|
283
|
+
export interface NetworkOverrideParams {
|
|
284
|
+
property: string;
|
|
285
|
+
originalValue: unknown;
|
|
286
|
+
overrideValue: unknown;
|
|
287
|
+
source: ConfigSource;
|
|
288
|
+
reason: string;
|
|
289
|
+
networkInfo?: NetworkInfo;
|
|
290
|
+
networkQuality?: NETWORK_QUALITY;
|
|
291
|
+
temporary?: boolean;
|
|
292
|
+
duration?: number;
|
|
293
|
+
trigger?: string;
|
|
294
|
+
}
|
|
295
|
+
export interface DebugHistoryEntry {
|
|
296
|
+
type: 'config' | 'header' | 'network' | 'performance' | 'event' | 'event_operation';
|
|
297
|
+
timestamp: number;
|
|
298
|
+
source: ConfigSource;
|
|
299
|
+
changes?: Array<{
|
|
300
|
+
property: string;
|
|
301
|
+
oldValue: unknown;
|
|
302
|
+
newValue: unknown;
|
|
303
|
+
source: ConfigSource;
|
|
304
|
+
timestamp: number;
|
|
305
|
+
}>;
|
|
306
|
+
conflicts?: ConfigConflict[];
|
|
307
|
+
stage?: HeaderStage;
|
|
308
|
+
headers?: Record<string, string>;
|
|
309
|
+
metadata?: Record<string, unknown>;
|
|
310
|
+
}
|
|
311
|
+
export interface TrackingResult {
|
|
312
|
+
changes: Array<{
|
|
313
|
+
property: string;
|
|
314
|
+
oldValue: unknown;
|
|
315
|
+
newValue: unknown;
|
|
316
|
+
source: ConfigSource;
|
|
317
|
+
timestamp: number;
|
|
318
|
+
}>;
|
|
319
|
+
conflicts: ConfigConflict[];
|
|
320
|
+
}
|
|
321
|
+
export interface TrackingOptions {
|
|
322
|
+
phase?: 'initialization' | 'runtime' | 'update';
|
|
323
|
+
reason?: string;
|
|
324
|
+
metadata?: Record<string, unknown>;
|
|
325
|
+
trigger?: string;
|
|
326
|
+
preset?: string;
|
|
327
|
+
changeType?: 'override' | 'restore' | 'preset_change' | 'user_preference' | 'auto_optimization';
|
|
328
|
+
skipHistory?: boolean;
|
|
329
|
+
}
|
|
330
|
+
export interface ComplianceReport {
|
|
331
|
+
totalEvents: number;
|
|
332
|
+
configChanges: number;
|
|
333
|
+
headerChanges: number;
|
|
334
|
+
conflicts: number;
|
|
335
|
+
overrides: number;
|
|
336
|
+
compliance: {
|
|
337
|
+
tracking: boolean;
|
|
338
|
+
historyMaintained: boolean;
|
|
339
|
+
conflictsDetected: boolean;
|
|
340
|
+
};
|
|
341
|
+
violations: string[];
|
|
342
|
+
timestamp: number;
|
|
343
|
+
}
|
|
344
|
+
export interface DebugReport {
|
|
345
|
+
activeConfigs: Record<string, TrackedValue>;
|
|
346
|
+
activeOverrides: Record<string, NetworkOverride>;
|
|
347
|
+
headerPipeline: HeaderTransformation[];
|
|
348
|
+
stats: {
|
|
349
|
+
totalChanges: number;
|
|
350
|
+
conflicts: number;
|
|
351
|
+
networkOverrides: number;
|
|
352
|
+
headerTransformations: number;
|
|
353
|
+
};
|
|
354
|
+
recentHistory: DebugHistoryEntry[];
|
|
355
|
+
recentConflicts: ConfigConflict[];
|
|
356
|
+
performanceAnalysis: {
|
|
357
|
+
summary: string;
|
|
358
|
+
score: number;
|
|
359
|
+
issues: string[];
|
|
360
|
+
};
|
|
361
|
+
complianceReport: ComplianceReport;
|
|
362
|
+
recommendations: string[];
|
|
363
|
+
}
|
|
364
|
+
export interface ConfigUpdateStrategy {
|
|
365
|
+
strategy?: 'merge' | 'replace' | 'temporary';
|
|
366
|
+
preserveFields?: string[];
|
|
367
|
+
trackUpdate?: boolean;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Issue priority levels for debugging reports
|
|
371
|
+
*/
|
|
372
|
+
export type IssuePriority = 'critical' | 'high' | 'medium' | 'low';
|
|
373
|
+
/**
|
|
374
|
+
* Detailed issue information with priority and context
|
|
375
|
+
*/
|
|
376
|
+
export interface DetailedIssue {
|
|
377
|
+
id: string;
|
|
378
|
+
title: string;
|
|
379
|
+
description: string;
|
|
380
|
+
priority: IssuePriority;
|
|
381
|
+
category: 'performance' | 'security' | 'compliance' | 'configuration' | 'network';
|
|
382
|
+
impact: string;
|
|
383
|
+
recommendation: string;
|
|
384
|
+
metadata?: Record<string, unknown>;
|
|
385
|
+
timestamp: number;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Issue breakdown by scope with detailed analysis
|
|
389
|
+
*/
|
|
390
|
+
export interface IssueBreakdown {
|
|
391
|
+
scope: string;
|
|
392
|
+
issues: DetailedIssue[];
|
|
393
|
+
summary: {
|
|
394
|
+
total: number;
|
|
395
|
+
critical: number;
|
|
396
|
+
high: number;
|
|
397
|
+
medium: number;
|
|
398
|
+
low: number;
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Enhanced compliance report with detailed issues
|
|
403
|
+
*/
|
|
404
|
+
export interface EnhancedComplianceReport extends ComplianceReport {
|
|
405
|
+
networkCompliance: {
|
|
406
|
+
status: 'compliant' | 'needs-review' | 'non-compliant';
|
|
407
|
+
issues: DetailedIssue[];
|
|
408
|
+
};
|
|
409
|
+
dataCompliance: {
|
|
410
|
+
status: 'compliant' | 'needs-review' | 'non-compliant';
|
|
411
|
+
issues: DetailedIssue[];
|
|
412
|
+
};
|
|
413
|
+
securityHeaders: {
|
|
414
|
+
status: 'compliant' | 'needs-review' | 'non-compliant';
|
|
415
|
+
issues: DetailedIssue[];
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Security analysis for headers
|
|
420
|
+
*/
|
|
421
|
+
export interface HeaderSecurityAnalysis {
|
|
422
|
+
hasAuthHeaders: boolean;
|
|
423
|
+
hasSensitiveData: boolean;
|
|
424
|
+
hasCSPHeaders: boolean;
|
|
425
|
+
hasSecurityHeaders: boolean;
|
|
426
|
+
vulnerabilities: string[];
|
|
427
|
+
recommendations: string[];
|
|
428
|
+
complianceStatus: 'compliant' | 'non-compliant' | 'needs-review';
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Event migration analysis
|
|
432
|
+
*/
|
|
433
|
+
export interface EventMigrationAnalysis {
|
|
434
|
+
oldSystemEvents: string[];
|
|
435
|
+
newSystemEvents: string[];
|
|
436
|
+
migrationStatus: 'complete' | 'in-progress' | 'not-started';
|
|
437
|
+
unmappedEvents: string[];
|
|
438
|
+
deprecatedHandlers: string[];
|
|
439
|
+
recommendations: string[];
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Network adaptation analysis
|
|
443
|
+
*/
|
|
444
|
+
export interface NetworkAdaptationAnalysis {
|
|
445
|
+
currentQuality: NETWORK_QUALITY;
|
|
446
|
+
adaptationHistory: Array<{
|
|
447
|
+
timestamp: number;
|
|
448
|
+
from: NETWORK_QUALITY;
|
|
449
|
+
to: NETWORK_QUALITY;
|
|
450
|
+
reason: string;
|
|
451
|
+
}>;
|
|
452
|
+
effectiveness: number;
|
|
453
|
+
score: number;
|
|
454
|
+
timeInPoorNetwork: number;
|
|
455
|
+
timeInGoodNetwork: number;
|
|
456
|
+
adaptationFrequency: number;
|
|
457
|
+
recommendations: string[];
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Temporary config lifecycle analysis
|
|
461
|
+
*/
|
|
462
|
+
export interface TemporaryConfigAnalysis {
|
|
463
|
+
activeTemporaryConfigs: number;
|
|
464
|
+
averageLifetime: number;
|
|
465
|
+
orphanedConfigs: string[];
|
|
466
|
+
leakRisk: 'low' | 'medium' | 'high';
|
|
467
|
+
cleanupEffectiveness: number;
|
|
468
|
+
recommendations: string[];
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Fetchff interceptor analysis
|
|
472
|
+
*/
|
|
473
|
+
export interface InterceptorChainAnalysis {
|
|
474
|
+
requestInterceptors: string[];
|
|
475
|
+
responseInterceptors: string[];
|
|
476
|
+
errorInterceptors: string[];
|
|
477
|
+
executionOrder: string[];
|
|
478
|
+
averageLatency: number;
|
|
479
|
+
bottlenecks: Array<{
|
|
480
|
+
interceptor: string;
|
|
481
|
+
latency: number;
|
|
482
|
+
impact: 'low' | 'medium' | 'high';
|
|
483
|
+
}>;
|
|
484
|
+
recommendations: string[];
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Event emitter factory analysis
|
|
488
|
+
*/
|
|
489
|
+
export interface EventFactoryAnalysis {
|
|
490
|
+
name: string;
|
|
491
|
+
scope: string;
|
|
492
|
+
listenerCount: number;
|
|
493
|
+
events: string[];
|
|
494
|
+
state: 'active' | 'inactive' | 'error';
|
|
495
|
+
lastActivity?: number;
|
|
496
|
+
memoryFootprint?: number;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Event scope analysis
|
|
500
|
+
*/
|
|
501
|
+
export interface EventScopeAnalysis {
|
|
502
|
+
scope: string;
|
|
503
|
+
eventCount: number;
|
|
504
|
+
listenerCount: number;
|
|
505
|
+
events: Array<{
|
|
506
|
+
name: string;
|
|
507
|
+
listeners: number;
|
|
508
|
+
category: string;
|
|
509
|
+
lastEmitted?: number;
|
|
510
|
+
frequency?: number;
|
|
511
|
+
}>;
|
|
512
|
+
memoryUsage: number;
|
|
513
|
+
recommendations: string[];
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Available events analysis by source
|
|
517
|
+
*/
|
|
518
|
+
export interface AvailableEventsAnalysis {
|
|
519
|
+
sourceType: 'createApiClient' | 'config' | 'updateConfig' | 'manual' | 'pubsub' | 'eventManager' | 'clientEventManager' | 'factory';
|
|
520
|
+
events: Array<{
|
|
521
|
+
name: string;
|
|
522
|
+
category: string;
|
|
523
|
+
scope: string;
|
|
524
|
+
initialized: boolean;
|
|
525
|
+
usage: 'active' | 'passive' | 'inactive' | 'never-used';
|
|
526
|
+
lastUsed?: number;
|
|
527
|
+
emitCount?: number;
|
|
528
|
+
lastEmitted?: number;
|
|
529
|
+
}>;
|
|
530
|
+
initializationSource: string;
|
|
531
|
+
recommendedEvents: string[];
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Event validation report
|
|
535
|
+
*/
|
|
536
|
+
export interface EventValidationReport {
|
|
537
|
+
validEvents: string[];
|
|
538
|
+
invalidEvents: Array<{
|
|
539
|
+
attempted: string;
|
|
540
|
+
reason: string;
|
|
541
|
+
suggestions: string[];
|
|
542
|
+
potentialSources: string[];
|
|
543
|
+
}>;
|
|
544
|
+
missingInitializations: Array<{
|
|
545
|
+
event: string;
|
|
546
|
+
requiredFor: string[];
|
|
547
|
+
initializationOptions: string[];
|
|
548
|
+
}>;
|
|
549
|
+
recommendations: string[];
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* Comprehensive event emitter analysis
|
|
553
|
+
*/
|
|
554
|
+
export interface EventEmitterAnalysis {
|
|
555
|
+
systemOverview: {
|
|
556
|
+
totalEvents: number;
|
|
557
|
+
totalListeners: number;
|
|
558
|
+
totalFactories: number;
|
|
559
|
+
memoryUsage: number;
|
|
560
|
+
healthScore: number;
|
|
561
|
+
};
|
|
562
|
+
factoryDetails: EventFactoryAnalysis[];
|
|
563
|
+
scopeBreakdown: EventScopeAnalysis[];
|
|
564
|
+
availableEvents: AvailableEventsAnalysis[];
|
|
565
|
+
validation: EventValidationReport;
|
|
566
|
+
performanceMetrics: {
|
|
567
|
+
eventEmissionLatency: number;
|
|
568
|
+
listenerExecutionTime: number;
|
|
569
|
+
memoryLeaks: string[];
|
|
570
|
+
optimizationOpportunities: string[];
|
|
571
|
+
};
|
|
572
|
+
recommendations: string[];
|
|
573
|
+
trackingAnalysis?: EventTrackingAnalysis;
|
|
574
|
+
isEnabled: boolean;
|
|
575
|
+
}
|
|
576
|
+
export interface AnalyzeConfigImpact {
|
|
577
|
+
impact: 'positive' | 'negative' | 'neutral';
|
|
578
|
+
factors: string[];
|
|
579
|
+
suggestions: string[];
|
|
580
|
+
}
|
|
581
|
+
export interface ConflictPatterns {
|
|
582
|
+
mostConflictedProperties: Array<{
|
|
583
|
+
property: string;
|
|
584
|
+
count: number;
|
|
585
|
+
}>;
|
|
586
|
+
conflictingSources: Array<{
|
|
587
|
+
source: string;
|
|
588
|
+
count: number;
|
|
589
|
+
}>;
|
|
590
|
+
resolutionPatterns: Array<{
|
|
591
|
+
pattern: string;
|
|
592
|
+
count: number;
|
|
593
|
+
}>;
|
|
594
|
+
recommendations: string[];
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Comprehensive debug report
|
|
598
|
+
*/
|
|
599
|
+
export interface ComprehensiveDebugReport extends DebugReport {
|
|
600
|
+
headerSecurity: HeaderSecurityAnalysis;
|
|
601
|
+
complianceAnalysis: {
|
|
602
|
+
overall: ComplianceReport;
|
|
603
|
+
networkCompliance: 'compliant' | 'non-compliant' | 'needs-review';
|
|
604
|
+
dataCompliance: 'compliant' | 'non-compliant' | 'needs-review';
|
|
605
|
+
autoDetectedIssues: string[];
|
|
606
|
+
};
|
|
607
|
+
eventMigration: EventMigrationAnalysis;
|
|
608
|
+
eventEmitterAnalysis: EventEmitterAnalysis;
|
|
609
|
+
eventStatistics: {
|
|
610
|
+
totalEvents: number;
|
|
611
|
+
eventsPerMinute: number;
|
|
612
|
+
topEvents: Array<{
|
|
613
|
+
event: string;
|
|
614
|
+
count: number;
|
|
615
|
+
}>;
|
|
616
|
+
errorEvents: number;
|
|
617
|
+
droppedEvents: number;
|
|
618
|
+
};
|
|
619
|
+
networkAdaptation: NetworkAdaptationAnalysis;
|
|
620
|
+
performanceBreakdown: {
|
|
621
|
+
networkLatency: number;
|
|
622
|
+
processingTime: number;
|
|
623
|
+
cacheHitRate: number;
|
|
624
|
+
errorRate: number;
|
|
625
|
+
p95ResponseTime: number;
|
|
626
|
+
p99ResponseTime: number;
|
|
627
|
+
};
|
|
628
|
+
temporaryConfigs: TemporaryConfigAnalysis;
|
|
629
|
+
configurationHealth: {
|
|
630
|
+
conflicts: number;
|
|
631
|
+
overrides: number;
|
|
632
|
+
stability: 'stable' | 'unstable' | 'critical';
|
|
633
|
+
driftFromBaseline: number;
|
|
634
|
+
impact?: AnalyzeConfigImpact;
|
|
635
|
+
conflictPatterns?: ConflictPatterns;
|
|
636
|
+
};
|
|
637
|
+
interceptorAnalysis: InterceptorChainAnalysis;
|
|
638
|
+
systemHealth: {
|
|
639
|
+
score: number;
|
|
640
|
+
status: 'healthy' | 'degraded' | 'critical';
|
|
641
|
+
criticalIssues: string[];
|
|
642
|
+
warnings: string[];
|
|
643
|
+
recommendations: string[];
|
|
644
|
+
};
|
|
645
|
+
trends: {
|
|
646
|
+
performanceTrend: 'improving' | 'stable' | 'degrading';
|
|
647
|
+
errorTrend: 'increasing' | 'stable' | 'decreasing';
|
|
648
|
+
networkQualityTrend: 'improving' | 'stable' | 'degrading';
|
|
649
|
+
configStabilityTrend: 'improving' | 'stable' | 'degrading';
|
|
650
|
+
};
|
|
651
|
+
networkContext: {
|
|
652
|
+
networkInfo?: NetworkInfo;
|
|
653
|
+
networkQuality?: NETWORK_QUALITY;
|
|
654
|
+
clientHints?: unknown;
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
export interface EventEmitterLike {
|
|
658
|
+
listenerCount(event?: string): number;
|
|
659
|
+
}
|
|
660
|
+
export interface FactoryLike {
|
|
661
|
+
scope?: string;
|
|
662
|
+
emit?: <T = unknown>(event: string, data?: T) => void;
|
|
663
|
+
lastActivity?: number;
|
|
664
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type * from './types';
|