@plyaz/types 1.7.18 → 1.7.20

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.
Files changed (73) hide show
  1. package/dist/api/client/enum.d.ts +12 -0
  2. package/dist/api/client/index.d.ts +1 -0
  3. package/dist/api/client/types.d.ts +114 -0
  4. package/dist/api/config/types.d.ts +56 -9
  5. package/dist/api/debugger/enums.d.ts +153 -0
  6. package/dist/api/debugger/factories/index.d.ts +1 -0
  7. package/dist/api/debugger/factories/types.d.ts +191 -0
  8. package/dist/api/debugger/index.d.ts +2 -0
  9. package/dist/api/debugger/types.d.ts +628 -0
  10. package/dist/api/endpoints/campaigns/index.d.ts +1 -0
  11. package/dist/api/endpoints/campaigns/types.d.ts +68 -0
  12. package/dist/api/endpoints/health/index.d.ts +1 -0
  13. package/dist/api/endpoints/health/types.d.ts +127 -0
  14. package/dist/api/endpoints/index.d.ts +3 -0
  15. package/dist/api/endpoints/types.d.ts +5 -0
  16. package/dist/api/errors/enum.d.ts +182 -0
  17. package/dist/api/errors/index.d.ts +1 -0
  18. package/dist/api/errors/types.d.ts +126 -27
  19. package/dist/api/events/enum.d.ts +262 -0
  20. package/dist/api/events/factories/cache/index.d.ts +1 -0
  21. package/dist/api/events/factories/cache/types.d.ts +60 -0
  22. package/dist/api/events/factories/client/index.d.ts +1 -0
  23. package/dist/api/events/factories/client/types.d.ts +120 -0
  24. package/dist/api/events/factories/config/index.d.ts +1 -0
  25. package/dist/api/events/factories/config/types.d.ts +77 -0
  26. package/dist/api/events/factories/debug/index.d.ts +1 -0
  27. package/dist/api/events/factories/debug/types.d.ts +131 -0
  28. package/dist/api/events/factories/errors/index.d.ts +1 -0
  29. package/dist/api/events/factories/errors/types.d.ts +293 -0
  30. package/dist/api/events/factories/headers/index.d.ts +1 -0
  31. package/dist/api/events/factories/headers/types.d.ts +256 -0
  32. package/dist/api/events/factories/index.d.ts +9 -0
  33. package/dist/api/events/factories/network/index.d.ts +1 -0
  34. package/dist/api/events/factories/network/types.d.ts +196 -0
  35. package/dist/api/events/factories/performance/index.d.ts +1 -0
  36. package/dist/api/events/factories/performance/types.d.ts +150 -0
  37. package/dist/api/events/factories/types.d.ts +84 -0
  38. package/dist/api/events/index.d.ts +2 -0
  39. package/dist/api/events/types.d.ts +1 -730
  40. package/dist/api/headers/enum.d.ts +34 -0
  41. package/dist/api/headers/index.d.ts +1 -0
  42. package/dist/api/headers/types.d.ts +456 -0
  43. package/dist/api/hooks/index.d.ts +1 -0
  44. package/dist/api/hooks/types.d.ts +131 -0
  45. package/dist/api/index.d.ts +7 -1
  46. package/dist/api/network/enums.d.ts +75 -5
  47. package/dist/api/network/frameworks/index.d.ts +2 -0
  48. package/dist/api/network/frameworks/nestjs/index.d.ts +1 -0
  49. package/dist/api/network/frameworks/nestjs/types.d.ts +47 -0
  50. package/dist/api/network/frameworks/types.d.ts +76 -0
  51. package/dist/api/network/index.d.ts +1 -0
  52. package/dist/api/network/types.d.ts +346 -39
  53. package/dist/api/performance/types.d.ts +17 -10
  54. package/dist/api/polling/types.d.ts +6 -4
  55. package/dist/api/pubsub/enum.d.ts +12 -0
  56. package/dist/api/pubsub/index.d.ts +2 -0
  57. package/dist/api/pubsub/types.d.ts +61 -0
  58. package/dist/api/queue/types.d.ts +69 -0
  59. package/dist/api/regional/enum.d.ts +75 -0
  60. package/dist/api/regional/index.d.ts +1 -0
  61. package/dist/api/regional/types.d.ts +2 -1
  62. package/dist/api/request/index.d.ts +1 -0
  63. package/dist/api/request/types.d.ts +44 -0
  64. package/dist/api/retry/types.d.ts +31 -0
  65. package/dist/api/strategies/types.d.ts +12 -8
  66. package/dist/errors/index.cjs +69 -0
  67. package/dist/errors/index.cjs.map +1 -1
  68. package/dist/errors/index.d.ts +1 -1
  69. package/dist/errors/index.js +66 -0
  70. package/dist/errors/index.js.map +1 -1
  71. package/dist/features/cache/types.d.ts +5 -0
  72. package/dist/testing/features/api/types.d.ts +355 -4
  73. package/package.json +5 -3
@@ -0,0 +1,628 @@
1
+ /**
2
+ * Debug Event Types
3
+ * Type definitions for all debug-related events and data structures
4
+ */
5
+ import type { ConfigChangeEvent, HeadersTrackedEvent, NetworkConfigOverrideEvent, NetworkOverrideEvent, NetworkQualityEvent } from '../events';
6
+ import type { DebuggerConfigSource } 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: DebuggerConfigSource;
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
+ export interface TrackedValue {
221
+ value: unknown;
222
+ source: DebuggerConfigSource;
223
+ timestamp: number;
224
+ metadata?: Record<string, unknown>;
225
+ }
226
+ /**
227
+ * Header changes detected between transformations
228
+ */
229
+ export interface HeaderChanges {
230
+ added?: string[];
231
+ modified?: string[];
232
+ removed?: string[];
233
+ }
234
+ export interface HeaderTransformation {
235
+ stage: HeaderStage;
236
+ headers: Record<string, string>;
237
+ source: DebuggerConfigSource;
238
+ timestamp: number;
239
+ changes?: HeaderChanges;
240
+ metadata?: Record<string, unknown>;
241
+ }
242
+ export interface NetworkOverride extends NetworkOverrideParams {
243
+ appliedAt: number;
244
+ active: boolean;
245
+ impact?: number;
246
+ }
247
+ export interface NetworkOverrideParams {
248
+ property: string;
249
+ originalValue: unknown;
250
+ overrideValue: unknown;
251
+ source: DebuggerConfigSource;
252
+ reason: string;
253
+ networkInfo?: NetworkInfo;
254
+ networkQuality?: NETWORK_QUALITY;
255
+ temporary?: boolean;
256
+ duration?: number;
257
+ trigger?: string;
258
+ }
259
+ export interface DebugHistoryEntry {
260
+ type: 'config' | 'header' | 'network' | 'performance' | 'event' | 'event_operation';
261
+ timestamp: number;
262
+ source: DebuggerConfigSource;
263
+ changes?: Array<{
264
+ property: string;
265
+ oldValue: unknown;
266
+ newValue: unknown;
267
+ source: DebuggerConfigSource;
268
+ timestamp: number;
269
+ }>;
270
+ conflicts?: ConfigConflict[];
271
+ stage?: HeaderStage;
272
+ headers?: Record<string, string>;
273
+ metadata?: Record<string, unknown>;
274
+ }
275
+ export interface TrackingResult {
276
+ changes: Array<{
277
+ property: string;
278
+ oldValue: unknown;
279
+ newValue: unknown;
280
+ source: DebuggerConfigSource;
281
+ timestamp: number;
282
+ }>;
283
+ conflicts: ConfigConflict[];
284
+ }
285
+ export interface TrackingOptions {
286
+ phase?: 'initialization' | 'runtime' | 'update';
287
+ reason?: string;
288
+ metadata?: Record<string, unknown>;
289
+ trigger?: string;
290
+ preset?: string;
291
+ changeType?: 'override' | 'restore' | 'preset_change' | 'user_preference' | 'auto_optimization';
292
+ skipHistory?: boolean;
293
+ }
294
+ export interface ComplianceReport {
295
+ totalEvents: number;
296
+ configChanges: number;
297
+ headerChanges: number;
298
+ conflicts: number;
299
+ overrides: number;
300
+ compliance: {
301
+ tracking: boolean;
302
+ historyMaintained: boolean;
303
+ conflictsDetected: boolean;
304
+ };
305
+ violations: string[];
306
+ timestamp: number;
307
+ }
308
+ export interface DebugReport {
309
+ activeConfigs: Record<string, TrackedValue>;
310
+ activeOverrides: Record<string, NetworkOverride>;
311
+ headerPipeline: HeaderTransformation[];
312
+ stats: {
313
+ totalChanges: number;
314
+ conflicts: number;
315
+ networkOverrides: number;
316
+ headerTransformations: number;
317
+ };
318
+ recentHistory: DebugHistoryEntry[];
319
+ recentConflicts: ConfigConflict[];
320
+ performanceAnalysis: {
321
+ summary: string;
322
+ score: number;
323
+ issues: string[];
324
+ };
325
+ complianceReport: ComplianceReport;
326
+ recommendations: string[];
327
+ }
328
+ export interface DebuggerConfigUpdateStrategy {
329
+ strategy?: 'merge' | 'replace' | 'temporary';
330
+ preserveFields?: string[];
331
+ trackUpdate?: boolean;
332
+ }
333
+ /**
334
+ * Issue priority levels for debugging reports
335
+ */
336
+ export type IssuePriority = 'critical' | 'high' | 'medium' | 'low';
337
+ /**
338
+ * Detailed issue information with priority and context
339
+ */
340
+ export interface DetailedIssue {
341
+ id: string;
342
+ title: string;
343
+ description: string;
344
+ priority: IssuePriority;
345
+ category: 'performance' | 'security' | 'compliance' | 'configuration' | 'network';
346
+ impact: string;
347
+ recommendation: string;
348
+ metadata?: Record<string, unknown>;
349
+ timestamp: number;
350
+ }
351
+ /**
352
+ * Issue breakdown by scope with detailed analysis
353
+ */
354
+ export interface IssueBreakdown {
355
+ scope: string;
356
+ issues: DetailedIssue[];
357
+ summary: {
358
+ total: number;
359
+ critical: number;
360
+ high: number;
361
+ medium: number;
362
+ low: number;
363
+ };
364
+ }
365
+ /**
366
+ * Enhanced compliance report with detailed issues
367
+ */
368
+ export interface EnhancedComplianceReport extends ComplianceReport {
369
+ networkCompliance: {
370
+ status: 'compliant' | 'needs-review' | 'non-compliant';
371
+ issues: DetailedIssue[];
372
+ };
373
+ dataCompliance: {
374
+ status: 'compliant' | 'needs-review' | 'non-compliant';
375
+ issues: DetailedIssue[];
376
+ };
377
+ securityHeaders: {
378
+ status: 'compliant' | 'needs-review' | 'non-compliant';
379
+ issues: DetailedIssue[];
380
+ };
381
+ }
382
+ /**
383
+ * Security analysis for headers
384
+ */
385
+ export interface HeaderSecurityAnalysis {
386
+ hasAuthHeaders: boolean;
387
+ hasSensitiveData: boolean;
388
+ hasCSPHeaders: boolean;
389
+ hasSecurityHeaders: boolean;
390
+ vulnerabilities: string[];
391
+ recommendations: string[];
392
+ complianceStatus: 'compliant' | 'non-compliant' | 'needs-review';
393
+ }
394
+ /**
395
+ * Event migration analysis
396
+ */
397
+ export interface EventMigrationAnalysis {
398
+ oldSystemEvents: string[];
399
+ newSystemEvents: string[];
400
+ migrationStatus: 'complete' | 'in-progress' | 'not-started';
401
+ unmappedEvents: string[];
402
+ deprecatedHandlers: string[];
403
+ recommendations: string[];
404
+ }
405
+ /**
406
+ * Network adaptation analysis
407
+ */
408
+ export interface NetworkAdaptationAnalysis {
409
+ currentQuality: NETWORK_QUALITY;
410
+ adaptationHistory: Array<{
411
+ timestamp: number;
412
+ from: NETWORK_QUALITY;
413
+ to: NETWORK_QUALITY;
414
+ reason: string;
415
+ }>;
416
+ effectiveness: number;
417
+ score: number;
418
+ timeInPoorNetwork: number;
419
+ timeInGoodNetwork: number;
420
+ adaptationFrequency: number;
421
+ recommendations: string[];
422
+ }
423
+ /**
424
+ * Temporary config lifecycle analysis
425
+ */
426
+ export interface TemporaryConfigAnalysis {
427
+ activeTemporaryConfigs: number;
428
+ averageLifetime: number;
429
+ orphanedConfigs: string[];
430
+ leakRisk: 'low' | 'medium' | 'high';
431
+ cleanupEffectiveness: number;
432
+ recommendations: string[];
433
+ }
434
+ /**
435
+ * Fetchff interceptor analysis
436
+ */
437
+ export interface InterceptorChainAnalysis {
438
+ requestInterceptors: string[];
439
+ responseInterceptors: string[];
440
+ errorInterceptors: string[];
441
+ executionOrder: string[];
442
+ averageLatency: number;
443
+ bottlenecks: Array<{
444
+ interceptor: string;
445
+ latency: number;
446
+ impact: 'low' | 'medium' | 'high';
447
+ }>;
448
+ recommendations: string[];
449
+ }
450
+ /**
451
+ * Event emitter factory analysis
452
+ */
453
+ export interface EventFactoryAnalysis {
454
+ name: string;
455
+ scope: string;
456
+ listenerCount: number;
457
+ events: string[];
458
+ state: 'active' | 'inactive' | 'error';
459
+ lastActivity?: number;
460
+ memoryFootprint?: number;
461
+ }
462
+ /**
463
+ * Event scope analysis
464
+ */
465
+ export interface EventScopeAnalysis {
466
+ scope: string;
467
+ eventCount: number;
468
+ listenerCount: number;
469
+ events: Array<{
470
+ name: string;
471
+ listeners: number;
472
+ category: string;
473
+ lastEmitted?: number;
474
+ frequency?: number;
475
+ }>;
476
+ memoryUsage: number;
477
+ recommendations: string[];
478
+ }
479
+ /**
480
+ * Available events analysis by source
481
+ */
482
+ export interface AvailableEventsAnalysis {
483
+ sourceType: 'createApiClient' | 'config' | 'updateConfig' | 'manual' | 'pubsub' | 'eventManager' | 'clientEventManager' | 'factory';
484
+ events: Array<{
485
+ name: string;
486
+ category: string;
487
+ scope: string;
488
+ initialized: boolean;
489
+ usage: 'active' | 'passive' | 'inactive' | 'never-used';
490
+ lastUsed?: number;
491
+ emitCount?: number;
492
+ lastEmitted?: number;
493
+ }>;
494
+ initializationSource: string;
495
+ recommendedEvents: string[];
496
+ }
497
+ /**
498
+ * Event validation report
499
+ */
500
+ export interface EventValidationReport {
501
+ validEvents: string[];
502
+ invalidEvents: Array<{
503
+ attempted: string;
504
+ reason: string;
505
+ suggestions: string[];
506
+ potentialSources: string[];
507
+ }>;
508
+ missingInitializations: Array<{
509
+ event: string;
510
+ requiredFor: string[];
511
+ initializationOptions: string[];
512
+ }>;
513
+ recommendations: string[];
514
+ }
515
+ /**
516
+ * Comprehensive event emitter analysis
517
+ */
518
+ export interface EventEmitterAnalysis {
519
+ systemOverview: {
520
+ totalEvents: number;
521
+ totalListeners: number;
522
+ totalFactories: number;
523
+ memoryUsage: number;
524
+ healthScore: number;
525
+ };
526
+ factoryDetails: EventFactoryAnalysis[];
527
+ scopeBreakdown: EventScopeAnalysis[];
528
+ availableEvents: AvailableEventsAnalysis[];
529
+ validation: EventValidationReport;
530
+ performanceMetrics: {
531
+ eventEmissionLatency: number;
532
+ listenerExecutionTime: number;
533
+ memoryLeaks: string[];
534
+ optimizationOpportunities: string[];
535
+ };
536
+ recommendations: string[];
537
+ trackingAnalysis?: EventTrackingAnalysis;
538
+ isEnabled: boolean;
539
+ }
540
+ export interface AnalyzeConfigImpact {
541
+ impact: 'positive' | 'negative' | 'neutral';
542
+ factors: string[];
543
+ suggestions: string[];
544
+ }
545
+ export interface ConflictPatterns {
546
+ mostConflictedProperties: Array<{
547
+ property: string;
548
+ count: number;
549
+ }>;
550
+ conflictingSources: Array<{
551
+ source: string;
552
+ count: number;
553
+ }>;
554
+ resolutionPatterns: Array<{
555
+ pattern: string;
556
+ count: number;
557
+ }>;
558
+ recommendations: string[];
559
+ }
560
+ /**
561
+ * Comprehensive debug report
562
+ */
563
+ export interface ComprehensiveDebugReport extends DebugReport {
564
+ headerSecurity: HeaderSecurityAnalysis;
565
+ complianceAnalysis: {
566
+ overall: ComplianceReport;
567
+ networkCompliance: 'compliant' | 'non-compliant' | 'needs-review';
568
+ dataCompliance: 'compliant' | 'non-compliant' | 'needs-review';
569
+ autoDetectedIssues: string[];
570
+ };
571
+ eventMigration: EventMigrationAnalysis;
572
+ eventEmitterAnalysis: EventEmitterAnalysis;
573
+ eventStatistics: {
574
+ totalEvents: number;
575
+ eventsPerMinute: number;
576
+ topEvents: Array<{
577
+ event: string;
578
+ count: number;
579
+ }>;
580
+ errorEvents: number;
581
+ droppedEvents: number;
582
+ };
583
+ networkAdaptation: NetworkAdaptationAnalysis;
584
+ performanceBreakdown: {
585
+ networkLatency: number;
586
+ processingTime: number;
587
+ cacheHitRate: number;
588
+ errorRate: number;
589
+ p95ResponseTime: number;
590
+ p99ResponseTime: number;
591
+ };
592
+ temporaryConfigs: TemporaryConfigAnalysis;
593
+ configurationHealth: {
594
+ conflicts: number;
595
+ overrides: number;
596
+ stability: 'stable' | 'unstable' | 'critical';
597
+ driftFromBaseline: number;
598
+ impact?: AnalyzeConfigImpact;
599
+ conflictPatterns?: ConflictPatterns;
600
+ };
601
+ interceptorAnalysis: InterceptorChainAnalysis;
602
+ systemHealth: {
603
+ score: number;
604
+ status: 'healthy' | 'degraded' | 'critical';
605
+ criticalIssues: string[];
606
+ warnings: string[];
607
+ recommendations: string[];
608
+ };
609
+ trends: {
610
+ performanceTrend: 'improving' | 'stable' | 'degrading';
611
+ errorTrend: 'increasing' | 'stable' | 'decreasing';
612
+ networkQualityTrend: 'improving' | 'stable' | 'degrading';
613
+ configStabilityTrend: 'improving' | 'stable' | 'degrading';
614
+ };
615
+ networkContext: {
616
+ networkInfo?: NetworkInfo;
617
+ networkQuality?: NETWORK_QUALITY;
618
+ clientHints?: unknown;
619
+ };
620
+ }
621
+ export interface EventEmitterLike {
622
+ listenerCount(event?: string): number;
623
+ }
624
+ export interface FactoryLike {
625
+ scope?: string;
626
+ emit?: <T = unknown>(event: string, data?: T) => void;
627
+ lastActivity?: number;
628
+ }
@@ -0,0 +1 @@
1
+ export type * from './types';
@@ -0,0 +1,68 @@
1
+ import type { Endpoint, Req } from 'fetchff';
2
+ interface Campaign {
3
+ id: string;
4
+ name: string;
5
+ description: string;
6
+ status: 'draft' | 'active' | 'paused' | 'completed';
7
+ startDate: string;
8
+ endDate: string;
9
+ athleteIds: string[];
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ }
13
+ interface CampaignStats {
14
+ totalParticipants: number;
15
+ totalViews: number;
16
+ engagement: number;
17
+ performance: Record<string, unknown>;
18
+ }
19
+ interface CampaignListParams {
20
+ limit?: number;
21
+ offset?: number;
22
+ status?: Campaign['status'];
23
+ athleteId?: string;
24
+ }
25
+ interface CampaignCreateBody {
26
+ name: string;
27
+ description: string;
28
+ startDate: string;
29
+ endDate: string;
30
+ athleteIds?: string[];
31
+ }
32
+ interface CampaignUpdateBody {
33
+ name?: string;
34
+ description?: string;
35
+ status?: Campaign['status'];
36
+ startDate?: string;
37
+ endDate?: string;
38
+ }
39
+ interface CampaignPathParams {
40
+ id: string;
41
+ }
42
+ interface JoinCampaignBody {
43
+ athleteId: string;
44
+ }
45
+ /**
46
+ * Campaign endpoint types for TypeScript
47
+ * Using fetchff's Req type to properly define endpoints
48
+ */
49
+ export interface CampaignEndpointTypes {
50
+ getCampaign: Endpoint<Req<Campaign, never, never, CampaignPathParams>>;
51
+ listCampaigns: Endpoint<Req<Campaign[], never, CampaignListParams>>;
52
+ createCampaign: Endpoint<Req<Campaign, CampaignCreateBody>>;
53
+ updateCampaign: Endpoint<Req<Campaign, CampaignUpdateBody, never, CampaignPathParams>>;
54
+ deleteCampaign: Endpoint<Req<{
55
+ success: boolean;
56
+ }, never, never, CampaignPathParams>>;
57
+ getCampaignStats: Endpoint<Req<CampaignStats, never, never, CampaignPathParams>>;
58
+ getCampaignParticipants: Endpoint<Req<{
59
+ athleteIds: string[];
60
+ }, never, never, CampaignPathParams>>;
61
+ joinCampaign: Endpoint<Req<{
62
+ success: boolean;
63
+ }, JoinCampaignBody, never, CampaignPathParams>>;
64
+ leaveCampaign: Endpoint<Req<{
65
+ success: boolean;
66
+ }, JoinCampaignBody, never, CampaignPathParams>>;
67
+ }
68
+ export {};
@@ -0,0 +1 @@
1
+ export type * from './types';