@skill-mine/complyment-connectors-sdk 0.1.0

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.
@@ -0,0 +1,2655 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { EventEmitter } from 'events';
3
+ import { z } from 'zod';
4
+
5
+ declare enum AuthType {
6
+ API_KEY = "api_key",
7
+ BASIC = "basic",
8
+ OAUTH2 = "oauth2",
9
+ BEARER = "bearer",
10
+ VAULT = "vault"
11
+ }
12
+ declare enum ConnectorStatus {
13
+ CONNECTED = "connected",
14
+ DISCONNECTED = "disconnected",
15
+ DEGRADED = "degraded",
16
+ ERROR = "error",
17
+ CONNECTING = "connecting"
18
+ }
19
+ declare enum LogLevel$1 {
20
+ DEBUG = "debug",
21
+ INFO = "info",
22
+ WARN = "warn",
23
+ ERROR = "error"
24
+ }
25
+ interface ApiKeyAuthConfig {
26
+ type: AuthType.API_KEY;
27
+ apiKey: string;
28
+ headerName?: string;
29
+ }
30
+ interface BasicAuthConfig {
31
+ type: AuthType.BASIC;
32
+ username: string;
33
+ password: string;
34
+ }
35
+ interface OAuth2Config {
36
+ type: AuthType.OAUTH2;
37
+ clientId: string;
38
+ clientSecret: string;
39
+ tokenUrl: string;
40
+ scope?: string;
41
+ redirectUri?: string;
42
+ }
43
+ interface BearerAuthConfig {
44
+ type: AuthType.BEARER;
45
+ token: string;
46
+ }
47
+ interface VaultAuthConfig {
48
+ type: AuthType.VAULT;
49
+ vaultUrl: string;
50
+ secretPath: string;
51
+ token: string;
52
+ }
53
+ type AuthConfig = ApiKeyAuthConfig | BasicAuthConfig | OAuth2Config | BearerAuthConfig | VaultAuthConfig;
54
+ interface ConnectorConfig {
55
+ name: string;
56
+ baseUrl: string;
57
+ auth: AuthConfig;
58
+ timeout?: number;
59
+ retries?: number;
60
+ rateLimit?: {
61
+ requests: number;
62
+ perSeconds: number;
63
+ };
64
+ cache?: {
65
+ enabled: boolean;
66
+ ttl: number;
67
+ };
68
+ dryRun?: boolean;
69
+ apiVersion?: string;
70
+ telemetry?: boolean;
71
+ logger?: LogLevel$1;
72
+ }
73
+ interface ConnectorResponse<T = unknown> {
74
+ success: boolean;
75
+ data?: T;
76
+ error?: string;
77
+ statusCode?: number;
78
+ timestamp: Date;
79
+ connector: string;
80
+ cached?: boolean;
81
+ dryRun?: boolean;
82
+ }
83
+ interface HealthCheckResult {
84
+ connector: string;
85
+ status: ConnectorStatus;
86
+ latency?: number;
87
+ message?: string;
88
+ checkedAt: Date;
89
+ }
90
+ interface PaginationOptions {
91
+ page?: number;
92
+ limit?: number;
93
+ offset?: number;
94
+ cursor?: string;
95
+ }
96
+ interface PaginatedResponse<T> {
97
+ data: T[];
98
+ total: number;
99
+ page: number;
100
+ limit: number;
101
+ hasMore: boolean;
102
+ nextCursor?: string;
103
+ }
104
+ declare enum ConnectorEvent {
105
+ CONNECTED = "connector.connected",
106
+ DISCONNECTED = "connector.disconnected",
107
+ ERROR = "connector.error",
108
+ DATA_FETCHED = "data.fetched",
109
+ RATE_LIMITED = "connector.rate_limited",
110
+ RETRY = "connector.retry",
111
+ CACHE_HIT = "cache.hit",
112
+ CACHE_MISS = "cache.miss"
113
+ }
114
+ interface NormalizedVulnerability {
115
+ id: string;
116
+ title: string;
117
+ severity: 'critical' | 'high' | 'medium' | 'low' | 'info';
118
+ cvss?: number;
119
+ cve?: string;
120
+ affectedAsset: string;
121
+ source: string;
122
+ detectedAt: Date;
123
+ raw?: unknown;
124
+ }
125
+ interface NormalizedAsset {
126
+ id: string;
127
+ hostname: string;
128
+ ipAddress: string;
129
+ os?: string;
130
+ type: 'server' | 'workstation' | 'network' | 'cloud' | 'unknown';
131
+ source: string;
132
+ lastSeen: Date;
133
+ raw?: unknown;
134
+ }
135
+ interface NormalizedThreat {
136
+ id: string;
137
+ name: string;
138
+ severity: 'critical' | 'high' | 'medium' | 'low';
139
+ status: 'active' | 'resolved' | 'investigating';
140
+ affectedAsset: string;
141
+ source: string;
142
+ detectedAt: Date;
143
+ raw?: unknown;
144
+ }
145
+
146
+ declare abstract class BaseConnector extends EventEmitter {
147
+ protected config: ConnectorConfig;
148
+ protected httpClient: AxiosInstance;
149
+ protected status: ConnectorStatus;
150
+ protected accessToken?: string;
151
+ protected tokenExpiresAt?: Date;
152
+ private circuitBreaker;
153
+ private readonly failureThreshold;
154
+ private readonly recoveryTimeMs;
155
+ private cache;
156
+ private requestTimestamps;
157
+ constructor(config: ConnectorConfig);
158
+ abstract authenticate(): Promise<void>;
159
+ abstract testConnection(): Promise<boolean>;
160
+ private validateConfig;
161
+ private createHttpClient;
162
+ private injectAuthHeaders;
163
+ protected get<T>(url: string, params?: Record<string, unknown>, useCache?: boolean): Promise<ConnectorResponse<T>>;
164
+ protected post<T>(url: string, body?: unknown, useCache?: boolean): Promise<ConnectorResponse<T>>;
165
+ protected put<T>(url: string, body?: unknown): Promise<ConnectorResponse<T>>;
166
+ protected delete<T>(url: string): Promise<ConnectorResponse<T>>;
167
+ private executeWithRetry;
168
+ private checkCircuitBreaker;
169
+ private recordCircuitBreakerFailure;
170
+ private resetCircuitBreaker;
171
+ private checkRateLimit;
172
+ private getFromCache;
173
+ private setCache;
174
+ clearCache(): void;
175
+ healthCheck(): Promise<HealthCheckResult>;
176
+ protected buildPaginatedResponse<T>(data: T[], total: number, options: PaginationOptions): PaginatedResponse<T>;
177
+ protected isTokenExpired(): boolean;
178
+ protected setToken(token: string, expiresInSeconds: number): void;
179
+ private dryRunResponse;
180
+ protected log(level: LogLevel$1, message: string, meta?: unknown): void;
181
+ private sleep;
182
+ getStatus(): ConnectorStatus;
183
+ getConfig(): Omit<ConnectorConfig, 'auth'>;
184
+ }
185
+
186
+ declare class ConnectorRegistry {
187
+ private connectors;
188
+ register(name: string, connector: BaseConnector): void;
189
+ get<T extends BaseConnector>(name: string): T;
190
+ has(name: string): boolean;
191
+ unregister(name: string): void;
192
+ healthCheckAll(): Promise<Record<string, HealthCheckResult>>;
193
+ list(): string[];
194
+ size(): number;
195
+ clear(): void;
196
+ }
197
+ declare const registry: ConnectorRegistry;
198
+
199
+ declare class SDKError extends Error {
200
+ readonly code: string;
201
+ readonly connector?: string | undefined;
202
+ readonly statusCode?: number | undefined;
203
+ constructor(message: string, code: string, connector?: string | undefined, statusCode?: number | undefined);
204
+ }
205
+ declare class AuthenticationError extends SDKError {
206
+ constructor(connector: string, message?: string);
207
+ }
208
+ declare class TokenExpiredError extends SDKError {
209
+ constructor(connector: string);
210
+ }
211
+ declare class InvalidCredentialsError extends SDKError {
212
+ constructor(connector: string);
213
+ }
214
+ declare class ConnectionError extends SDKError {
215
+ constructor(connector: string, message?: string);
216
+ }
217
+ declare class TimeoutError extends SDKError {
218
+ constructor(connector: string, timeoutMs: number);
219
+ }
220
+ declare class RateLimitError extends SDKError {
221
+ readonly retryAfter?: number | undefined;
222
+ constructor(connector: string, retryAfter?: number | undefined);
223
+ }
224
+ declare class ValidationError extends SDKError {
225
+ readonly field?: string | undefined;
226
+ constructor(message: string, field?: string | undefined);
227
+ }
228
+ declare class ConfigurationError extends SDKError {
229
+ constructor(message: string, connector?: string);
230
+ }
231
+ declare class APIError extends SDKError {
232
+ readonly response?: unknown | undefined;
233
+ constructor(connector: string, statusCode: number, message: string, response?: unknown | undefined);
234
+ }
235
+ declare class NotFoundError extends SDKError {
236
+ constructor(connector: string, resource: string);
237
+ }
238
+ declare class CircuitBreakerOpenError extends SDKError {
239
+ constructor(connector: string);
240
+ }
241
+ declare class PluginNotFoundError extends SDKError {
242
+ constructor(connectorName: string);
243
+ }
244
+ declare class DuplicatePluginError extends SDKError {
245
+ constructor(connectorName: string);
246
+ }
247
+
248
+ declare const QUALYS_BASE_URLS: {
249
+ readonly US1: "https://qualysapi.qualys.com";
250
+ readonly US2: "https://qualysapi.qg2.apps.qualys.com";
251
+ readonly US3: "https://qualysapi.qg3.apps.qualys.com";
252
+ readonly EU1: "https://qualysapi.qualys.eu";
253
+ readonly EU2: "https://qualysapi.qg2.apps.qualys.eu";
254
+ readonly IN1: "https://qualysapi.qg1.apps.qualys.in";
255
+ readonly CA1: "https://qualysapi.qg1.apps.qualys.ca";
256
+ readonly AE1: "https://qualysapi.qg1.apps.qualys.ae";
257
+ };
258
+ type QualysRegion = keyof typeof QUALYS_BASE_URLS;
259
+
260
+ declare enum QualysScanStatus {
261
+ RUNNING = "Running",
262
+ PAUSED = "Paused",
263
+ FINISHED = "Finished",
264
+ ERROR = "Error",
265
+ CANCELED = "Canceled",
266
+ QUEUED = "Queued",
267
+ LOADING = "Loading",
268
+ SUBMITTED = "Submitted"
269
+ }
270
+ declare enum QualysScanType {
271
+ VM = "VM",
272
+ WAS = "WAS",
273
+ PC = "PC"
274
+ }
275
+ type QualysSeverity = 1 | 2 | 3 | 4 | 5;
276
+ declare function validateQualysScanStatus(status: string): QualysScanStatus | null;
277
+ declare function isValidQualysScanStatus(status: string): boolean;
278
+ declare function isQualysScanTerminal(status: QualysScanStatus): boolean;
279
+ declare function isQualysScanActive(status: QualysScanStatus): boolean;
280
+ interface QualysConfig {
281
+ baseUrl: string;
282
+ username: string;
283
+ password: string;
284
+ region?: QualysRegion;
285
+ timeout?: number;
286
+ retries?: number;
287
+ cache?: {
288
+ enabled: boolean;
289
+ ttl: number;
290
+ };
291
+ dryRun?: boolean;
292
+ rejectUnauthorized?: boolean;
293
+ }
294
+ interface QualysVulnerability {
295
+ qid: number;
296
+ title: string;
297
+ severity: QualysSeverity;
298
+ ip?: string;
299
+ dns?: string;
300
+ netbios?: string;
301
+ os?: string;
302
+ port?: number;
303
+ protocol?: string;
304
+ ssl?: boolean;
305
+ firstFound?: Date;
306
+ lastFound?: Date;
307
+ lastUpdate?: Date;
308
+ timesFound?: number;
309
+ results?: string;
310
+ status?: string;
311
+ cvssBase?: number;
312
+ cvssTemporal?: number;
313
+ cvss3Base?: number;
314
+ cvss3Temporal?: number;
315
+ cveList?: string[];
316
+ vendorReferenceList?: string[];
317
+ bugtraqList?: string[];
318
+ threat?: string;
319
+ impact?: string;
320
+ solution?: string;
321
+ diagnosis?: string;
322
+ consequence?: string;
323
+ pciFlag?: boolean;
324
+ pciReasons?: string[];
325
+ category?: string;
326
+ exploitability?: string;
327
+ associatedMalware?: string;
328
+ patchable?: boolean;
329
+ }
330
+ interface QualysHostDetection {
331
+ hostId: string;
332
+ ip: string;
333
+ dns?: string;
334
+ netbios?: string;
335
+ os?: string;
336
+ trackingMethod?: string;
337
+ lastScanDatetime?: Date;
338
+ detections: QualysVulnerability[];
339
+ }
340
+ interface QualysAsset {
341
+ id: string;
342
+ hostname: string;
343
+ ipAddress: string;
344
+ os?: string;
345
+ osVersion?: string;
346
+ type: string;
347
+ lastSeen: string;
348
+ tags?: string[];
349
+ netbiosName?: string;
350
+ dnsName?: string;
351
+ agentId?: string;
352
+ vulnerabilityCount?: number;
353
+ }
354
+ interface QualysAssetListResponse {
355
+ assets: QualysAsset[];
356
+ total: number;
357
+ page: number;
358
+ limit: number;
359
+ }
360
+ interface QualysScan {
361
+ id: string;
362
+ scanRef: string;
363
+ title: string;
364
+ status: QualysScanStatus;
365
+ state?: string;
366
+ type: QualysScanType;
367
+ target?: string;
368
+ launchDatetime?: Date;
369
+ startDatetime?: Date;
370
+ endDatetime?: Date;
371
+ duration?: number;
372
+ processed?: number;
373
+ total?: number;
374
+ userLogin?: string;
375
+ assetGroupTitle?: string;
376
+ assetGroupId?: string;
377
+ scannerApplianceType?: string;
378
+ wasScanId?: string;
379
+ wasScanType?: string;
380
+ webAppId?: string;
381
+ webAppName?: string;
382
+ webAppUrl?: string;
383
+ totalVulnerabilities?: number;
384
+ criticalCount?: number;
385
+ highCount?: number;
386
+ mediumCount?: number;
387
+ lowCount?: number;
388
+ infoCount?: number;
389
+ }
390
+ interface QualysScanListResponse {
391
+ scans: QualysScan[];
392
+ total: number;
393
+ }
394
+ interface QualysLaunchScanParams {
395
+ scanTitle: string;
396
+ optionTitle?: string;
397
+ optionId?: number;
398
+ ip?: string;
399
+ assetGroups?: string;
400
+ assetGroupIds?: string;
401
+ excludeIpPerScan?: string;
402
+ priority?: number;
403
+ iscannerName?: string;
404
+ iscannerId?: number;
405
+ defaultScanner?: number;
406
+ }
407
+ interface QualysLaunchScanResponse {
408
+ scanRef: string;
409
+ scanTitle: string;
410
+ status: QualysScanStatus;
411
+ message?: string;
412
+ }
413
+ interface QualysScanStatusResponse {
414
+ scanRef: string;
415
+ status: QualysScanStatus;
416
+ state: string;
417
+ processed: number;
418
+ total: number;
419
+ progress: number;
420
+ startDatetime?: Date;
421
+ endDatetime?: Date;
422
+ duration?: number;
423
+ userLogin?: string;
424
+ }
425
+ interface QualysFetchDetectionsParams {
426
+ scanRef?: string;
427
+ assetId?: string;
428
+ ips?: string;
429
+ agIds?: string;
430
+ showIgs?: number;
431
+ status?: string;
432
+ severities?: string;
433
+ }
434
+ interface QualysFetchKBParams {
435
+ qids: number[];
436
+ details?: 'Basic' | 'All';
437
+ }
438
+ interface QualysReport {
439
+ id: string;
440
+ title: string;
441
+ type: string;
442
+ status: 'Finished' | 'Running' | 'Submitted' | 'Cancelled';
443
+ createdAt: string;
444
+ size?: number;
445
+ format: 'PDF' | 'HTML' | 'XML' | 'CSV' | 'DOCX';
446
+ }
447
+ interface QualysParsedReport {
448
+ scanTitle: string;
449
+ scanDate?: Date;
450
+ hostsScanned: number;
451
+ totalVulnerabilities: number;
452
+ criticalCount: number;
453
+ highCount: number;
454
+ mediumCount: number;
455
+ lowCount: number;
456
+ infoCount: number;
457
+ vulnerabilities: QualysVulnerability[];
458
+ hosts: QualysHostInfo[];
459
+ }
460
+ interface QualysHostInfo {
461
+ id?: string;
462
+ ip?: string;
463
+ dns?: string;
464
+ netbios?: string;
465
+ os?: string;
466
+ trackingMethod?: string;
467
+ lastScanDatetime?: Date;
468
+ url?: string;
469
+ }
470
+ interface QualysComplianceControl {
471
+ id: string;
472
+ title: string;
473
+ status: 'Pass' | 'Fail' | 'Error' | 'Exception';
474
+ severity: QualysSeverity;
475
+ standard: string;
476
+ section: string;
477
+ lastChecked: string;
478
+ }
479
+ interface QualysVulnFilter {
480
+ severity?: QualysSeverity[];
481
+ status?: ('Active' | 'Fixed' | 'New' | 'Re-Opened')[];
482
+ hostname?: string;
483
+ ipAddress?: string;
484
+ cve?: string;
485
+ page?: number;
486
+ limit?: number;
487
+ }
488
+ interface QualysAssetFilter {
489
+ hostname?: string;
490
+ ipAddress?: string;
491
+ os?: string;
492
+ tags?: string[];
493
+ page?: number;
494
+ limit?: number;
495
+ }
496
+ interface QualysScanFilter {
497
+ status?: QualysScanStatus[];
498
+ state?: string;
499
+ type?: QualysScanType;
500
+ scanRef?: string;
501
+ launchedAfterDatetime?: string;
502
+ launchedBeforeDatetime?: string;
503
+ page?: number;
504
+ limit?: number;
505
+ }
506
+ interface QualysWASScan {
507
+ id: string;
508
+ reference: string;
509
+ name: string;
510
+ type: string;
511
+ status: string;
512
+ consolidatedStatus?: string;
513
+ target?: {
514
+ webApp?: {
515
+ id: string;
516
+ name: string;
517
+ url: string;
518
+ };
519
+ };
520
+ launchedDate?: Date;
521
+ launchedBy?: {
522
+ username: string;
523
+ };
524
+ summary?: {
525
+ testDuration?: number;
526
+ nbRequests?: number;
527
+ linksCrawled?: number;
528
+ };
529
+ }
530
+ interface QualysWASFinding {
531
+ id: string;
532
+ uniqueId?: string;
533
+ qid: number;
534
+ name: string;
535
+ type: string;
536
+ severity: QualysSeverity;
537
+ status: string;
538
+ firstDetectedDate?: Date;
539
+ lastDetectedDate?: Date;
540
+ lastTestedDate?: Date;
541
+ potential?: boolean;
542
+ webApp?: {
543
+ id: string;
544
+ name: string;
545
+ url: string;
546
+ };
547
+ }
548
+ interface QualysWASFilter {
549
+ status?: string;
550
+ webAppId?: number;
551
+ severity?: number;
552
+ qid?: number;
553
+ }
554
+ interface QualysKBEntry {
555
+ qid: number;
556
+ title: string;
557
+ vulnType?: string;
558
+ severityLevel: number;
559
+ category?: string;
560
+ publishedDatetime?: string;
561
+ patchable: boolean;
562
+ diagnosis?: string;
563
+ consequence?: string;
564
+ solution?: string;
565
+ cvssBase?: number;
566
+ cvssTemporal?: number;
567
+ cvss3Base?: number;
568
+ cvss3Temporal?: number;
569
+ cveList: string[];
570
+ vendorReferenceList: string[];
571
+ bugtraqList: string[];
572
+ pciFlag: boolean;
573
+ pciReasons: string[];
574
+ exploitability?: string;
575
+ associatedMalware?: string;
576
+ }
577
+ interface QualysVulnListResponse {
578
+ vulnerabilities: QualysVulnerability[];
579
+ total: number;
580
+ page: number;
581
+ limit: number;
582
+ }
583
+ interface QualysAPIResponse<T> {
584
+ success: boolean;
585
+ data?: T;
586
+ error?: string;
587
+ errorDescription?: string;
588
+ }
589
+
590
+ declare class QualysConnector extends BaseConnector {
591
+ private qualysConfig;
592
+ constructor(qualysConfig: QualysConfig);
593
+ authenticate(): Promise<void>;
594
+ testConnection(): Promise<boolean>;
595
+ /**
596
+ * Launch a VM (Vulnerability Management) scan
597
+ */
598
+ launchVMScan(params: QualysLaunchScanParams): Promise<ConnectorResponse<QualysLaunchScanResponse>>;
599
+ /**
600
+ * Get scan status
601
+ */
602
+ getVMScanStatus(scanRef: string): Promise<ConnectorResponse<QualysScanStatusResponse>>;
603
+ /**
604
+ * Cancel a running scan
605
+ */
606
+ cancelVMScan(scanRef: string): Promise<ConnectorResponse<{
607
+ scanRef: string;
608
+ message: string;
609
+ }>>;
610
+ /**
611
+ * List VM scans
612
+ */
613
+ listVMScans(filters?: QualysScanFilter): Promise<ConnectorResponse<{
614
+ scans: QualysScan[];
615
+ }>>;
616
+ /**
617
+ * Fetch host detections (vulnerabilities) from Qualys
618
+ * Uses hybrid approach: QPS API for asset_id, Legacy API for scan_ref
619
+ */
620
+ fetchHostDetections(params: QualysFetchDetectionsParams): Promise<ConnectorResponse<QualysParsedReport>>;
621
+ /**
622
+ * Fetch vulnerability knowledge base data
623
+ */
624
+ fetchVulnerabilityKB(qids: number[]): Promise<ConnectorResponse<Map<number, QualysKBEntry>>>;
625
+ /**
626
+ * List WAS scans
627
+ */
628
+ listWASScans(filters?: QualysWASFilter): Promise<ConnectorResponse<{
629
+ scans: QualysScan[];
630
+ }>>;
631
+ /**
632
+ * List WAS findings (vulnerabilities)
633
+ */
634
+ listWASFindings(filters?: QualysWASFilter): Promise<ConnectorResponse<QualysParsedReport>>;
635
+ /**
636
+ * Get scan results with KB enrichment
637
+ */
638
+ getScanResults(scanRef: string, enrichWithKB?: boolean): Promise<ConnectorResponse<QualysParsedReport>>;
639
+ /**
640
+ * Poll scan until completion
641
+ */
642
+ pollScanUntilComplete(scanRef: string, options?: {
643
+ pollIntervalMs?: number;
644
+ maxAttempts?: number;
645
+ onProgress?: (status: QualysScanStatusResponse) => void;
646
+ }): Promise<ConnectorResponse<QualysScanStatusResponse>>;
647
+ /**
648
+ * Trigger scan and wait for results
649
+ */
650
+ triggerScanAndWait(params: QualysLaunchScanParams, options?: {
651
+ pollIntervalMs?: number;
652
+ maxAttempts?: number;
653
+ enrichWithKB?: boolean;
654
+ onProgress?: (status: QualysScanStatusResponse) => void;
655
+ }): Promise<ConnectorResponse<QualysParsedReport>>;
656
+ getAssets(filter?: QualysAssetFilter): Promise<ConnectorResponse<PaginatedResponse<QualysAsset>>>;
657
+ getAssetById(assetId: string): Promise<ConnectorResponse<QualysAsset>>;
658
+ getVulnerabilities(filter?: QualysVulnFilter): Promise<ConnectorResponse<PaginatedResponse<QualysVulnerability>>>;
659
+ getCriticalVulnerabilities(): Promise<ConnectorResponse<PaginatedResponse<QualysVulnerability>>>;
660
+ getScans(filter?: QualysScanFilter): Promise<ConnectorResponse<PaginatedResponse<QualysScan>>>;
661
+ launchScan(title: string, targetHosts: string[], optionProfileId: string): Promise<ConnectorResponse<QualysScan>>;
662
+ cancelScan(scanId: string): Promise<ConnectorResponse<void>>;
663
+ getReports(): Promise<ConnectorResponse<QualysReport[]>>;
664
+ downloadReport(reportId: string): Promise<ConnectorResponse<Buffer>>;
665
+ getComplianceControls(): Promise<ConnectorResponse<QualysComplianceControl[]>>;
666
+ getNormalizedVulnerabilities(filter?: QualysVulnFilter): Promise<ConnectorResponse<NormalizedVulnerability[]>>;
667
+ getNormalizedAssets(filter?: QualysAssetFilter): Promise<ConnectorResponse<NormalizedAsset[]>>;
668
+ private makeFormRequest;
669
+ private makeQPSRequest;
670
+ private makeWASRequest;
671
+ private postRaw;
672
+ private mapSeverity;
673
+ private delay;
674
+ }
675
+
676
+ interface SentinelOneConfig {
677
+ baseUrl: string;
678
+ apiToken: string;
679
+ timeout?: number;
680
+ retries?: number;
681
+ cache?: {
682
+ enabled: boolean;
683
+ ttl: number;
684
+ };
685
+ dryRun?: boolean;
686
+ }
687
+ type SentinelOneAgentStatus = 'connected' | 'disconnected' | 'degraded';
688
+ interface SentinelOneAgent {
689
+ id: string;
690
+ computerName: string;
691
+ ipAddress: string;
692
+ osName: string;
693
+ osVersion: string;
694
+ status: SentinelOneAgentStatus;
695
+ infected: boolean;
696
+ isActive: boolean;
697
+ lastActiveDate: string;
698
+ agentVersion: string;
699
+ domain?: string;
700
+ siteName?: string;
701
+ groupName?: string;
702
+ tags?: string[];
703
+ networkStatus: 'connected' | 'disconnected' | 'connecting';
704
+ threatCount: number;
705
+ mitigationMode: 'protect' | 'detect' | 'none';
706
+ }
707
+ interface SentinelOneAgentListResponse {
708
+ data: SentinelOneAgent[];
709
+ pagination: {
710
+ totalItems: number;
711
+ nextCursor?: string;
712
+ };
713
+ }
714
+ type SentinelOneThreatStatus = 'active' | 'mitigated' | 'resolved' | 'suspicious' | 'blocked';
715
+ type SentinelOneConfidenceLevel = 'malicious' | 'suspicious' | 'n/a';
716
+ interface SentinelOneThreat {
717
+ id: string;
718
+ threatName: string;
719
+ classification: string;
720
+ confidenceLevel: SentinelOneConfidenceLevel;
721
+ mitigationStatus: SentinelOneThreatStatus;
722
+ agentComputerName: string;
723
+ agentId: string;
724
+ filePath?: string;
725
+ fileHash?: string;
726
+ createdAt: string;
727
+ updatedAt: string;
728
+ siteName?: string;
729
+ severity: 'critical' | 'high' | 'medium' | 'low';
730
+ engines: string[];
731
+ indicators?: string[];
732
+ }
733
+ interface SentinelOneThreatListResponse {
734
+ data: SentinelOneThreat[];
735
+ pagination: {
736
+ totalItems: number;
737
+ nextCursor?: string;
738
+ };
739
+ }
740
+ interface SentinelOneActivity {
741
+ id: string;
742
+ activityType: number;
743
+ agentId?: string;
744
+ agentUpdatedVersion?: string;
745
+ createdAt: string;
746
+ data: Record<string, unknown>;
747
+ siteId?: string;
748
+ threatId?: string;
749
+ userId?: string;
750
+ primaryDescription: string;
751
+ secondaryDescription?: string;
752
+ }
753
+ interface SentinelOneGroup {
754
+ id: string;
755
+ name: string;
756
+ type: 'static' | 'dynamic';
757
+ agentCount: number;
758
+ siteId: string;
759
+ rank?: number;
760
+ }
761
+ interface SentinelOneSite {
762
+ id: string;
763
+ name: string;
764
+ state: 'active' | 'expired' | 'deleted';
765
+ agentCount: number;
766
+ activeLicenses: number;
767
+ totalLicenses: number;
768
+ createdAt: string;
769
+ }
770
+ interface SentinelOneAgentFilter {
771
+ status?: SentinelOneAgentStatus[];
772
+ infected?: boolean;
773
+ osName?: string;
774
+ groupName?: string;
775
+ siteName?: string;
776
+ computerName?: string;
777
+ limit?: number;
778
+ cursor?: string;
779
+ }
780
+ interface SentinelOneThreatFilter {
781
+ status?: SentinelOneThreatStatus[];
782
+ severity?: ('critical' | 'high' | 'medium' | 'low')[];
783
+ confidenceLevel?: SentinelOneConfidenceLevel[];
784
+ agentId?: string;
785
+ limit?: number;
786
+ cursor?: string;
787
+ createdAfter?: string;
788
+ createdBefore?: string;
789
+ }
790
+ type MitigationAction = 'kill' | 'quarantine' | 'remediate' | 'rollback-remediation' | 'un-quarantine';
791
+ interface MitigationRequest {
792
+ threatIds: string[];
793
+ action: MitigationAction;
794
+ }
795
+ interface MitigationResponse {
796
+ affected: number;
797
+ success: boolean;
798
+ }
799
+
800
+ declare class SentinelOneConnector extends BaseConnector {
801
+ constructor(s1Config: SentinelOneConfig);
802
+ authenticate(): Promise<void>;
803
+ testConnection(): Promise<boolean>;
804
+ getAgents(filter?: SentinelOneAgentFilter): Promise<ConnectorResponse<SentinelOneAgentListResponse>>;
805
+ getAgentById(agentId: string): Promise<ConnectorResponse<SentinelOneAgent>>;
806
+ getInfectedAgents(): Promise<ConnectorResponse<SentinelOneAgentListResponse>>;
807
+ disconnectAgentFromNetwork(agentId: string): Promise<ConnectorResponse<void>>;
808
+ reconnectAgentToNetwork(agentId: string): Promise<ConnectorResponse<void>>;
809
+ initiateAgentScan(agentId: string): Promise<ConnectorResponse<void>>;
810
+ getThreats(filter?: SentinelOneThreatFilter): Promise<ConnectorResponse<SentinelOneThreatListResponse>>;
811
+ getActiveThreatCount(): Promise<number>;
812
+ getCriticalThreats(): Promise<ConnectorResponse<SentinelOneThreatListResponse>>;
813
+ mitigateThreats(request: MitigationRequest): Promise<ConnectorResponse<MitigationResponse>>;
814
+ quarantineThreat(threatId: string): Promise<ConnectorResponse<MitigationResponse>>;
815
+ killThreat(threatId: string): Promise<ConnectorResponse<MitigationResponse>>;
816
+ remediateThreat(threatId: string): Promise<ConnectorResponse<MitigationResponse>>;
817
+ getActivities(limit?: number): Promise<ConnectorResponse<SentinelOneActivity[]>>;
818
+ getGroups(): Promise<ConnectorResponse<SentinelOneGroup[]>>;
819
+ getSites(): Promise<ConnectorResponse<SentinelOneSite[]>>;
820
+ getNormalizedThreats(filter?: SentinelOneThreatFilter): Promise<ConnectorResponse<NormalizedThreat[]>>;
821
+ getNormalizedAssets(filter?: SentinelOneAgentFilter): Promise<ConnectorResponse<NormalizedAsset[]>>;
822
+ private mapThreatStatus;
823
+ }
824
+
825
+ interface CheckpointConfig {
826
+ baseUrl: string;
827
+ username: string;
828
+ password: string;
829
+ domain?: string;
830
+ timeout?: number;
831
+ retries?: number;
832
+ cache?: {
833
+ enabled: boolean;
834
+ ttl: number;
835
+ };
836
+ dryRun?: boolean;
837
+ }
838
+ interface CheckpointSession {
839
+ sid: string;
840
+ uid: string;
841
+ url: string;
842
+ sessionTimeout: number;
843
+ lastLoginWasAt: string;
844
+ }
845
+ type CheckpointRuleAction = 'Accept' | 'Drop' | 'Reject' | 'Ask' | 'Inform';
846
+ interface CheckpointRule {
847
+ uid: string;
848
+ name: string;
849
+ enabled: boolean;
850
+ action: CheckpointRuleAction;
851
+ source: string[];
852
+ destination: string[];
853
+ service: string[];
854
+ track: string;
855
+ comments?: string;
856
+ installOn: string[];
857
+ }
858
+ interface CheckpointPolicy {
859
+ uid: string;
860
+ name: string;
861
+ type: string;
862
+ rules: CheckpointRule[];
863
+ installedOn?: string[];
864
+ }
865
+ interface CheckpointHost {
866
+ uid: string;
867
+ name: string;
868
+ ipAddress: string;
869
+ subnetMask?: string;
870
+ comments?: string;
871
+ groups?: string[];
872
+ }
873
+ interface CheckpointNetwork {
874
+ uid: string;
875
+ name: string;
876
+ subnet: string;
877
+ subnetMask: string;
878
+ comments?: string;
879
+ }
880
+ interface CheckpointGroup {
881
+ uid: string;
882
+ name: string;
883
+ members: string[];
884
+ comments?: string;
885
+ }
886
+ type CheckpointThreatSeverity = 'Critical' | 'High' | 'Medium' | 'Low';
887
+ interface CheckpointThreat {
888
+ uid: string;
889
+ name: string;
890
+ severity: CheckpointThreatSeverity;
891
+ confidence: 'High' | 'Medium' | 'Low';
892
+ performanceImpact: 'High' | 'Medium' | 'Low';
893
+ protectionType: string;
894
+ affectedSystems: string[];
895
+ cve?: string[];
896
+ }
897
+ interface CheckpointLog {
898
+ id: string;
899
+ time: string;
900
+ action: string;
901
+ origin: string;
902
+ sourceIp: string;
903
+ destinationIp: string;
904
+ service: string;
905
+ blade: string;
906
+ severity?: CheckpointThreatSeverity;
907
+ description?: string;
908
+ }
909
+ interface CheckpointLogFilter {
910
+ startTime?: string;
911
+ endTime?: string;
912
+ action?: string;
913
+ sourceIp?: string;
914
+ destinationIp?: string;
915
+ severity?: CheckpointThreatSeverity[];
916
+ limit?: number;
917
+ }
918
+ type CheckpointGatewayStatus = 'OK' | 'Warning' | 'Error' | 'Disconnected';
919
+ interface CheckpointGateway {
920
+ uid: string;
921
+ name: string;
922
+ ipAddress: string;
923
+ osName: string;
924
+ version: string;
925
+ status: CheckpointGatewayStatus;
926
+ blades: string[];
927
+ lastUpdateTime: string;
928
+ }
929
+ interface CheckpointRuleFilter {
930
+ policyName?: string;
931
+ enabled?: boolean;
932
+ action?: CheckpointRuleAction;
933
+ limit?: number;
934
+ offset?: number;
935
+ }
936
+ interface CheckpointHostFilter {
937
+ name?: string;
938
+ ipAddress?: string;
939
+ limit?: number;
940
+ offset?: number;
941
+ }
942
+
943
+ declare class CheckpointConnector extends BaseConnector {
944
+ private session?;
945
+ private domain?;
946
+ constructor(cpConfig: CheckpointConfig);
947
+ authenticate(): Promise<void>;
948
+ logout(): Promise<void>;
949
+ testConnection(): Promise<boolean>;
950
+ getPolicies(): Promise<ConnectorResponse<CheckpointPolicy[]>>;
951
+ getRules(filter?: CheckpointRuleFilter): Promise<ConnectorResponse<CheckpointRule[]>>;
952
+ addRule(policyName: string, rule: Partial<CheckpointRule>): Promise<ConnectorResponse<CheckpointRule>>;
953
+ updateRule(ruleUid: string, policyName: string, updates: Partial<CheckpointRule>): Promise<ConnectorResponse<CheckpointRule>>;
954
+ deleteRule(ruleUid: string, policyName: string): Promise<ConnectorResponse<void>>;
955
+ publishChanges(): Promise<ConnectorResponse<void>>;
956
+ discardChanges(): Promise<ConnectorResponse<void>>;
957
+ installPolicy(policyName: string, targets: string[]): Promise<ConnectorResponse<void>>;
958
+ getHosts(filter?: CheckpointHostFilter): Promise<ConnectorResponse<CheckpointHost[]>>;
959
+ addHost(name: string, ipAddress: string, comments?: string): Promise<ConnectorResponse<CheckpointHost>>;
960
+ deleteHost(uid: string): Promise<ConnectorResponse<void>>;
961
+ getNetworks(): Promise<ConnectorResponse<CheckpointNetwork[]>>;
962
+ getGroups(): Promise<ConnectorResponse<CheckpointGroup[]>>;
963
+ getThreats(): Promise<ConnectorResponse<CheckpointThreat[]>>;
964
+ blockThreat(threatUid: string): Promise<ConnectorResponse<void>>;
965
+ getLogs(filter?: CheckpointLogFilter): Promise<ConnectorResponse<CheckpointLog[]>>;
966
+ getGateways(): Promise<ConnectorResponse<CheckpointGateway[]>>;
967
+ getGatewayStatus(gatewayUid: string): Promise<ConnectorResponse<CheckpointGateway>>;
968
+ getNormalizedThreats(): Promise<ConnectorResponse<NormalizedThreat[]>>;
969
+ getNormalizedAssets(): Promise<ConnectorResponse<NormalizedAsset[]>>;
970
+ }
971
+
972
+ interface ManageEngineConfig {
973
+ baseUrl: string;
974
+ clientId: string;
975
+ clientSecret: string;
976
+ refreshToken: string;
977
+ timeout?: number;
978
+ retries?: number;
979
+ cache?: {
980
+ enabled: boolean;
981
+ ttl: number;
982
+ };
983
+ dryRun?: boolean;
984
+ }
985
+ type PatchStatus = 'Missing' | 'Installed' | 'Failed' | 'NotApplicable' | 'Pending';
986
+ type PatchSeverity = 'Critical' | 'Important' | 'Moderate' | 'Low' | 'Unrated';
987
+ interface ManageEnginePatch {
988
+ patchId: string;
989
+ title: string;
990
+ severity: PatchSeverity;
991
+ status: PatchStatus;
992
+ kb?: string;
993
+ cve?: string[];
994
+ releaseDate: string;
995
+ installDate?: string;
996
+ affectedComputers: number;
997
+ bulletinId?: string;
998
+ description?: string;
999
+ rebootRequired: boolean;
1000
+ }
1001
+ interface ManageEnginePatchListResponse {
1002
+ patches: ManageEnginePatch[];
1003
+ total: number;
1004
+ page: number;
1005
+ limit: number;
1006
+ }
1007
+ type ComputerStatus = 'Live' | 'Down' | 'Unknown';
1008
+ interface ManageEngineComputer {
1009
+ computerId: string;
1010
+ computerName: string;
1011
+ ipAddress: string;
1012
+ os: string;
1013
+ osVersion: string;
1014
+ domain?: string;
1015
+ status: ComputerStatus;
1016
+ lastContact: string;
1017
+ agentVersion?: string;
1018
+ missingPatchCount: number;
1019
+ installedPatchCount: number;
1020
+ pendingPatchCount: number;
1021
+ groups?: string[];
1022
+ }
1023
+ interface ManageEngineComputerListResponse {
1024
+ computers: ManageEngineComputer[];
1025
+ total: number;
1026
+ page: number;
1027
+ limit: number;
1028
+ }
1029
+ type DeploymentStatus = 'Success' | 'Failed' | 'InProgress' | 'Pending' | 'Cancelled';
1030
+ interface ManageEngineDeployment {
1031
+ deploymentId: string;
1032
+ name: string;
1033
+ status: DeploymentStatus;
1034
+ patchIds: string[];
1035
+ targetComputers: string[];
1036
+ scheduledAt: string;
1037
+ completedAt?: string;
1038
+ successCount: number;
1039
+ failureCount: number;
1040
+ pendingCount: number;
1041
+ }
1042
+ interface ManageEngineVulnerability {
1043
+ vulnerabilityId: string;
1044
+ title: string;
1045
+ severity: PatchSeverity;
1046
+ cve: string[];
1047
+ affectedComputerId: string;
1048
+ affectedComputerName: string;
1049
+ patchAvailable: boolean;
1050
+ patchId?: string;
1051
+ detectedAt: string;
1052
+ }
1053
+ interface ManageEnginePatchFilter {
1054
+ severity?: PatchSeverity[];
1055
+ status?: PatchStatus[];
1056
+ rebootRequired?: boolean;
1057
+ page?: number;
1058
+ limit?: number;
1059
+ }
1060
+ interface ManageEngineComputerFilter {
1061
+ status?: ComputerStatus[];
1062
+ domain?: string;
1063
+ os?: string;
1064
+ computerName?: string;
1065
+ page?: number;
1066
+ limit?: number;
1067
+ }
1068
+ interface ManageEngineDeploymentFilter {
1069
+ status?: DeploymentStatus[];
1070
+ page?: number;
1071
+ limit?: number;
1072
+ }
1073
+
1074
+ declare class ManageEngineConnector extends BaseConnector {
1075
+ private refreshToken;
1076
+ private clientId;
1077
+ private clientSecret;
1078
+ constructor(meConfig: ManageEngineConfig);
1079
+ authenticate(): Promise<void>;
1080
+ testConnection(): Promise<boolean>;
1081
+ getPatches(filter?: ManageEnginePatchFilter): Promise<ConnectorResponse<ManageEnginePatchListResponse>>;
1082
+ getMissingPatches(computerId?: string): Promise<ConnectorResponse<ManageEnginePatchListResponse>>;
1083
+ getCriticalPatches(): Promise<ConnectorResponse<ManageEnginePatchListResponse>>;
1084
+ getPatchById(patchId: string): Promise<ConnectorResponse<ManageEnginePatch>>;
1085
+ getComputers(meFilter?: ManageEngineComputerFilter): Promise<ConnectorResponse<ManageEngineComputerListResponse>>;
1086
+ }
1087
+
1088
+ interface JiraConfig {
1089
+ baseUrl: string;
1090
+ email: string;
1091
+ apiToken: string;
1092
+ timeout?: number;
1093
+ retries?: number;
1094
+ cache?: {
1095
+ enabled: boolean;
1096
+ ttl: number;
1097
+ };
1098
+ dryRun?: boolean;
1099
+ }
1100
+ interface JiraProject {
1101
+ id: string;
1102
+ key: string;
1103
+ name: string;
1104
+ projectTypeKey: string;
1105
+ style: string;
1106
+ isPrivate: boolean;
1107
+ lead?: {
1108
+ accountId: string;
1109
+ displayName: string;
1110
+ };
1111
+ }
1112
+ type JiraIssuePriority = 'Highest' | 'High' | 'Medium' | 'Low' | 'Lowest';
1113
+ type JiraIssueStatus = 'To Do' | 'In Progress' | 'Done' | 'Blocked' | 'In Review';
1114
+ type JiraIssueType = 'Bug' | 'Task' | 'Story' | 'Epic' | 'Subtask';
1115
+ interface JiraUser {
1116
+ accountId: string;
1117
+ displayName: string;
1118
+ emailAddress?: string;
1119
+ active: boolean;
1120
+ }
1121
+ interface JiraIssue {
1122
+ id: string;
1123
+ key: string;
1124
+ summary: string;
1125
+ description?: string;
1126
+ status: JiraIssueStatus;
1127
+ priority: JiraIssuePriority;
1128
+ issueType: JiraIssueType;
1129
+ projectKey: string;
1130
+ assignee?: JiraUser;
1131
+ reporter?: JiraUser;
1132
+ labels?: string[];
1133
+ createdAt: string;
1134
+ updatedAt: string;
1135
+ dueDate?: string;
1136
+ resolvedAt?: string;
1137
+ components?: string[];
1138
+ customFields?: Record<string, unknown>;
1139
+ }
1140
+ interface JiraIssueListResponse {
1141
+ issues: JiraIssue[];
1142
+ total: number;
1143
+ startAt: number;
1144
+ maxResults: number;
1145
+ }
1146
+ interface JiraCreateIssueRequest {
1147
+ projectKey: string;
1148
+ summary: string;
1149
+ description?: string;
1150
+ issueType: JiraIssueType;
1151
+ priority?: JiraIssuePriority;
1152
+ assigneeAccountId?: string;
1153
+ labels?: string[];
1154
+ dueDate?: string;
1155
+ components?: string[];
1156
+ customFields?: Record<string, unknown>;
1157
+ }
1158
+ interface JiraUpdateIssueRequest {
1159
+ summary?: string;
1160
+ description?: string;
1161
+ priority?: JiraIssuePriority;
1162
+ assigneeAccountId?: string;
1163
+ labels?: string[];
1164
+ dueDate?: string;
1165
+ status?: JiraIssueStatus;
1166
+ }
1167
+ interface JiraComment {
1168
+ id: string;
1169
+ body: string;
1170
+ author: JiraUser;
1171
+ createdAt: string;
1172
+ updatedAt: string;
1173
+ }
1174
+ interface JiraTransition {
1175
+ id: string;
1176
+ name: string;
1177
+ to: {
1178
+ id: string;
1179
+ name: string;
1180
+ };
1181
+ }
1182
+ type JiraSprintState = 'active' | 'closed' | 'future';
1183
+ interface JiraSprint {
1184
+ id: number;
1185
+ name: string;
1186
+ state: JiraSprintState;
1187
+ startDate?: string;
1188
+ endDate?: string;
1189
+ completeDate?: string;
1190
+ goal?: string;
1191
+ }
1192
+ interface JiraIssueFilter {
1193
+ projectKey?: string;
1194
+ status?: JiraIssueStatus[];
1195
+ priority?: JiraIssuePriority[];
1196
+ issueType?: JiraIssueType[];
1197
+ assigneeAccountId?: string;
1198
+ labels?: string[];
1199
+ createdAfter?: string;
1200
+ createdBefore?: string;
1201
+ jql?: string;
1202
+ startAt?: number;
1203
+ maxResults?: number;
1204
+ }
1205
+
1206
+ declare class JiraConnector extends BaseConnector {
1207
+ constructor(jiraConfig: JiraConfig);
1208
+ authenticate(): Promise<void>;
1209
+ testConnection(): Promise<boolean>;
1210
+ getProjects(): Promise<ConnectorResponse<JiraProject[]>>;
1211
+ getProjectByKey(projectKey: string): Promise<ConnectorResponse<JiraProject>>;
1212
+ getIssues(filter?: JiraIssueFilter): Promise<ConnectorResponse<PaginatedResponse<JiraIssue>>>;
1213
+ getIssueByKey(issueKey: string): Promise<ConnectorResponse<JiraIssue>>;
1214
+ createIssue(request: JiraCreateIssueRequest): Promise<ConnectorResponse<JiraIssue>>;
1215
+ updateIssue(issueKey: string, request: JiraUpdateIssueRequest): Promise<ConnectorResponse<void>>;
1216
+ deleteIssue(issueKey: string): Promise<ConnectorResponse<void>>;
1217
+ bulkCreateIssues(requests: JiraCreateIssueRequest[]): Promise<ConnectorResponse<JiraIssue[]>>;
1218
+ getComments(issueKey: string): Promise<ConnectorResponse<JiraComment[]>>;
1219
+ addComment(issueKey: string, body: string): Promise<ConnectorResponse<JiraComment>>;
1220
+ getTransitions(issueKey: string): Promise<ConnectorResponse<JiraTransition[]>>;
1221
+ transitionIssue(issueKey: string, transitionId: string, comment?: string): Promise<ConnectorResponse<void>>;
1222
+ getSprints(boardId: number): Promise<ConnectorResponse<JiraSprint[]>>;
1223
+ getActiveSprint(boardId: number): Promise<ConnectorResponse<JiraSprint | null>>;
1224
+ createSecurityTicket(projectKey: string, title: string, description: string, severity: 'critical' | 'high' | 'medium' | 'low', source: string): Promise<ConnectorResponse<JiraIssue>>;
1225
+ }
1226
+
1227
+ interface ZohoConfig {
1228
+ baseUrl: string;
1229
+ clientId: string;
1230
+ clientSecret: string;
1231
+ refreshToken: string;
1232
+ accountsUrl?: string;
1233
+ timeout?: number;
1234
+ retries?: number;
1235
+ cache?: {
1236
+ enabled: boolean;
1237
+ ttl: number;
1238
+ };
1239
+ dryRun?: boolean;
1240
+ }
1241
+ interface ZohoContact {
1242
+ id: string;
1243
+ firstName?: string;
1244
+ lastName: string;
1245
+ email?: string;
1246
+ phone?: string;
1247
+ mobile?: string;
1248
+ accountName?: string;
1249
+ title?: string;
1250
+ department?: string;
1251
+ leadSource?: string;
1252
+ createdAt: string;
1253
+ updatedAt: string;
1254
+ ownerId?: string;
1255
+ }
1256
+ interface ZohoContactListResponse {
1257
+ data: ZohoContact[];
1258
+ info: {
1259
+ count: number;
1260
+ moreRecords: boolean;
1261
+ page: number;
1262
+ perPage: number;
1263
+ };
1264
+ }
1265
+ type ZohoLeadStatus = 'Not Contacted' | 'Attempted to Contact' | 'Contact in Future' | 'Contacted' | 'Junk Lead' | 'Lost Lead' | 'Not Qualified' | 'Pre-Qualified';
1266
+ interface ZohoLead {
1267
+ id: string;
1268
+ firstName?: string;
1269
+ lastName: string;
1270
+ email?: string;
1271
+ phone?: string;
1272
+ company: string;
1273
+ title?: string;
1274
+ status: ZohoLeadStatus;
1275
+ leadSource?: string;
1276
+ industry?: string;
1277
+ annualRevenue?: number;
1278
+ noOfEmployees?: number;
1279
+ rating?: string;
1280
+ website?: string;
1281
+ createdAt: string;
1282
+ updatedAt: string;
1283
+ }
1284
+ interface ZohoAccount {
1285
+ id: string;
1286
+ accountName: string;
1287
+ website?: string;
1288
+ phone?: string;
1289
+ industry?: string;
1290
+ annualRevenue?: number;
1291
+ noOfEmployees?: number;
1292
+ billingCity?: string;
1293
+ billingCountry?: string;
1294
+ description?: string;
1295
+ createdAt: string;
1296
+ updatedAt: string;
1297
+ }
1298
+ type ZohoDealStage = 'Qualification' | 'Needs Analysis' | 'Value Proposition' | 'Id. Decision Makers' | 'Perception Analysis' | 'Proposal/Price Quote' | 'Negotiation/Review' | 'Closed Won' | 'Closed Lost';
1299
+ interface ZohoDeal {
1300
+ id: string;
1301
+ dealName: string;
1302
+ accountName?: string;
1303
+ stage: ZohoDealStage;
1304
+ amount?: number;
1305
+ closingDate?: string;
1306
+ probability?: number;
1307
+ leadSource?: string;
1308
+ contactName?: string;
1309
+ description?: string;
1310
+ createdAt: string;
1311
+ updatedAt: string;
1312
+ }
1313
+ type ZohoTaskStatus = 'Not Started' | 'Deferred' | 'In Progress' | 'Completed' | 'Waiting for input';
1314
+ interface ZohoTask {
1315
+ id: string;
1316
+ subject: string;
1317
+ status: ZohoTaskStatus;
1318
+ dueDate?: string;
1319
+ priority?: 'High' | 'Medium' | 'Low';
1320
+ description?: string;
1321
+ contactId?: string;
1322
+ accountId?: string;
1323
+ dealId?: string;
1324
+ createdAt: string;
1325
+ updatedAt: string;
1326
+ }
1327
+ interface ZohoContactFilter {
1328
+ page?: number;
1329
+ perPage?: number;
1330
+ searchBy?: string;
1331
+ sortBy?: string;
1332
+ sortOrder?: 'asc' | 'desc';
1333
+ }
1334
+ interface ZohoLeadFilter {
1335
+ page?: number;
1336
+ perPage?: number;
1337
+ status?: ZohoLeadStatus[];
1338
+ searchBy?: string;
1339
+ sortBy?: string;
1340
+ sortOrder?: 'asc' | 'desc';
1341
+ }
1342
+ interface ZohoDealFilter {
1343
+ page?: number;
1344
+ perPage?: number;
1345
+ stage?: ZohoDealStage[];
1346
+ searchBy?: string;
1347
+ sortBy?: string;
1348
+ sortOrder?: 'asc' | 'desc';
1349
+ }
1350
+ interface ZohoSearchResponse<T> {
1351
+ data: T[];
1352
+ info: {
1353
+ count: number;
1354
+ moreRecords: boolean;
1355
+ };
1356
+ }
1357
+
1358
+ declare class ZohoConnector extends BaseConnector {
1359
+ private clientId;
1360
+ private clientSecret;
1361
+ private refreshToken;
1362
+ private accountsUrl;
1363
+ constructor(zohoConfig: ZohoConfig);
1364
+ authenticate(): Promise<void>;
1365
+ testConnection(): Promise<boolean>;
1366
+ getContacts(filter?: ZohoContactFilter): Promise<ConnectorResponse<PaginatedResponse<ZohoContact>>>;
1367
+ getContactById(contactId: string): Promise<ConnectorResponse<ZohoContact>>;
1368
+ createContact(contact: Partial<ZohoContact>): Promise<ConnectorResponse<ZohoContact>>;
1369
+ updateContact(contactId: string, updates: Partial<ZohoContact>): Promise<ConnectorResponse<ZohoContact>>;
1370
+ deleteContact(contactId: string): Promise<ConnectorResponse<void>>;
1371
+ getLeads(filter?: ZohoLeadFilter): Promise<ConnectorResponse<PaginatedResponse<ZohoLead>>>;
1372
+ getLeadById(leadId: string): Promise<ConnectorResponse<ZohoLead>>;
1373
+ createLead(lead: Partial<ZohoLead>): Promise<ConnectorResponse<ZohoLead>>;
1374
+ convertLead(leadId: string, accountName: string): Promise<ConnectorResponse<void>>;
1375
+ getAccounts(page?: number, perPage?: number): Promise<ConnectorResponse<PaginatedResponse<ZohoAccount>>>;
1376
+ getAccountById(accountId: string): Promise<ConnectorResponse<ZohoAccount>>;
1377
+ createAccount(account: Partial<ZohoAccount>): Promise<ConnectorResponse<ZohoAccount>>;
1378
+ getDeals(filter?: ZohoDealFilter): Promise<ConnectorResponse<PaginatedResponse<ZohoDeal>>>;
1379
+ getDealById(dealId: string): Promise<ConnectorResponse<ZohoDeal>>;
1380
+ createDeal(deal: Partial<ZohoDeal>): Promise<ConnectorResponse<ZohoDeal>>;
1381
+ updateDeal(dealId: string, updates: Partial<ZohoDeal>): Promise<ConnectorResponse<ZohoDeal>>;
1382
+ getTasks(): Promise<ConnectorResponse<ZohoTask[]>>;
1383
+ createTask(task: Partial<ZohoTask>): Promise<ConnectorResponse<ZohoTask>>;
1384
+ searchContacts(query: string): Promise<ConnectorResponse<ZohoSearchResponse<ZohoContact>>>;
1385
+ searchLeads(query: string): Promise<ConnectorResponse<ZohoSearchResponse<ZohoLead>>>;
1386
+ searchDeals(query: string): Promise<ConnectorResponse<ZohoSearchResponse<ZohoDeal>>>;
1387
+ bulkCreateContacts(contacts: Partial<ZohoContact>[]): Promise<ConnectorResponse<ZohoContact[]>>;
1388
+ private chunkArray;
1389
+ }
1390
+
1391
+ interface TokenResponse {
1392
+ accessToken: string;
1393
+ tokenType: string;
1394
+ expiresIn: number;
1395
+ refreshToken?: string;
1396
+ scope?: string;
1397
+ }
1398
+ interface OAuth2TokenRequest {
1399
+ grantType: 'client_credentials' | 'authorization_code' | 'refresh_token';
1400
+ clientId: string;
1401
+ clientSecret: string;
1402
+ scope?: string;
1403
+ code?: string;
1404
+ refreshToken?: string;
1405
+ redirectUri?: string;
1406
+ }
1407
+ interface AuthResult {
1408
+ success: boolean;
1409
+ token?: string;
1410
+ expiresIn?: number;
1411
+ error?: string;
1412
+ }
1413
+
1414
+ interface RetryOptions {
1415
+ maxRetries?: number;
1416
+ initialDelayMs?: number;
1417
+ maxDelayMs?: number;
1418
+ backoffMultiplier?: number;
1419
+ retryableStatusCodes?: number[];
1420
+ onRetry?: (attempt: number, error: Error) => void;
1421
+ }
1422
+ declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
1423
+ declare class RetryHandler {
1424
+ private options;
1425
+ constructor(options?: RetryOptions);
1426
+ execute<T>(fn: () => Promise<T>): Promise<T>;
1427
+ updateOptions(options: Partial<RetryOptions>): void;
1428
+ }
1429
+
1430
+ interface RateLimitOptions {
1431
+ maxRequests: number;
1432
+ perSeconds: number;
1433
+ onThrottled?: (waitMs: number) => void;
1434
+ }
1435
+ declare class RateLimiter {
1436
+ private tokens;
1437
+ private lastRefillTime;
1438
+ private readonly maxTokens;
1439
+ private readonly refillRate;
1440
+ private readonly onThrottled?;
1441
+ constructor(options: RateLimitOptions);
1442
+ private refill;
1443
+ acquire(): Promise<void>;
1444
+ tryAcquire(): boolean;
1445
+ getState(): {
1446
+ tokens: number;
1447
+ maxTokens: number;
1448
+ utilization: number;
1449
+ };
1450
+ reset(): void;
1451
+ private sleep;
1452
+ }
1453
+ declare class SlidingWindowRateLimiter {
1454
+ private timestamps;
1455
+ private readonly maxRequests;
1456
+ private readonly windowMs;
1457
+ constructor(options: RateLimitOptions);
1458
+ acquire(): Promise<void>;
1459
+ getRemainingRequests(): number;
1460
+ }
1461
+
1462
+ type CircuitState = 'closed' | 'open' | 'half-open';
1463
+ interface CircuitBreakerOptions {
1464
+ failureThreshold?: number;
1465
+ successThreshold?: number;
1466
+ recoveryTimeMs?: number;
1467
+ onStateChange?: (from: CircuitState, to: CircuitState) => void;
1468
+ onFailure?: (error: Error, failures: number) => void;
1469
+ onSuccess?: () => void;
1470
+ }
1471
+ interface CircuitBreakerStats {
1472
+ state: CircuitState;
1473
+ failures: number;
1474
+ successes: number;
1475
+ totalRequests: number;
1476
+ lastFailureTime?: Date;
1477
+ lastStateChangeTime: Date;
1478
+ }
1479
+ declare class CircuitBreaker {
1480
+ private state;
1481
+ private failures;
1482
+ private successes;
1483
+ private totalRequests;
1484
+ private lastFailureTime?;
1485
+ private lastStateChangeTime;
1486
+ private readonly failureThreshold;
1487
+ private readonly successThreshold;
1488
+ private readonly recoveryTimeMs;
1489
+ private readonly onStateChange?;
1490
+ private readonly onFailure?;
1491
+ private readonly onSuccess?;
1492
+ constructor(options?: CircuitBreakerOptions);
1493
+ execute<T>(fn: () => Promise<T>): Promise<T>;
1494
+ private recordSuccess;
1495
+ private recordFailure;
1496
+ private transitionTo;
1497
+ private canAttemptReset;
1498
+ getState(): CircuitState;
1499
+ getStats(): CircuitBreakerStats;
1500
+ reset(): void;
1501
+ isOpen(): boolean;
1502
+ isClosed(): boolean;
1503
+ }
1504
+
1505
+ interface CacheOptions {
1506
+ ttl: number;
1507
+ maxSize?: number;
1508
+ onHit?: (key: string) => void;
1509
+ onMiss?: (key: string) => void;
1510
+ onEvict?: (key: string) => void;
1511
+ }
1512
+ declare class CacheLayer {
1513
+ private store;
1514
+ private readonly ttlMs;
1515
+ private readonly maxSize;
1516
+ private readonly onHit?;
1517
+ private readonly onMiss?;
1518
+ private readonly onEvict?;
1519
+ private totalHits;
1520
+ private totalMisses;
1521
+ private totalSets;
1522
+ private totalEvictions;
1523
+ constructor(options: CacheOptions);
1524
+ get<T>(key: string): T | null;
1525
+ set<T>(key: string, data: T, ttlSeconds?: number): void;
1526
+ getOrSet<T>(key: string, fetchFn: () => Promise<T>, ttlSeconds?: number): Promise<T>;
1527
+ delete(key: string): boolean;
1528
+ clear(): void;
1529
+ clearByPrefix(prefix: string): number;
1530
+ has(key: string): boolean;
1531
+ private evictLRU;
1532
+ cleanup(): number;
1533
+ getStats(): {
1534
+ size: number;
1535
+ maxSize: number;
1536
+ totalHits: number;
1537
+ totalMisses: number;
1538
+ totalSets: number;
1539
+ totalEvictions: number;
1540
+ hitRate: string;
1541
+ };
1542
+ }
1543
+
1544
+ declare enum LogLevel {
1545
+ DEBUG = 0,
1546
+ INFO = 1,
1547
+ WARN = 2,
1548
+ ERROR = 3,
1549
+ SILENT = 4
1550
+ }
1551
+ interface LogEntry {
1552
+ level: LogLevel;
1553
+ message: string;
1554
+ timestamp: Date;
1555
+ connector?: string;
1556
+ meta?: unknown;
1557
+ traceId?: string;
1558
+ }
1559
+ interface LoggerOptions {
1560
+ level?: LogLevel;
1561
+ connector?: string;
1562
+ enableConsole?: boolean;
1563
+ enableJson?: boolean;
1564
+ onLog?: (entry: LogEntry) => void;
1565
+ }
1566
+ declare class Logger {
1567
+ private level;
1568
+ private connector?;
1569
+ private enableConsole;
1570
+ private enableJson;
1571
+ private onLog?;
1572
+ private logs;
1573
+ constructor(options?: LoggerOptions);
1574
+ private log;
1575
+ private printToConsole;
1576
+ debug(message: string, meta?: unknown, traceId?: string): void;
1577
+ info(message: string, meta?: unknown, traceId?: string): void;
1578
+ warn(message: string, meta?: unknown, traceId?: string): void;
1579
+ error(message: string, meta?: unknown, traceId?: string): void;
1580
+ child(connector: string): Logger;
1581
+ getLogs(level?: LogLevel): LogEntry[];
1582
+ clearLogs(): void;
1583
+ setLevel(level: LogLevel): void;
1584
+ getStats(): {
1585
+ total: number;
1586
+ debug: number;
1587
+ info: number;
1588
+ warn: number;
1589
+ error: number;
1590
+ };
1591
+ }
1592
+ declare const logger: Logger;
1593
+
1594
+ interface SpanOptions {
1595
+ name: string;
1596
+ connector?: string;
1597
+ method?: string;
1598
+ url?: string;
1599
+ attributes?: Record<string, string | number | boolean>;
1600
+ }
1601
+ interface Span {
1602
+ spanId: string;
1603
+ traceId: string;
1604
+ name: string;
1605
+ startTime: Date;
1606
+ endTime?: Date;
1607
+ duration?: number;
1608
+ status: 'ok' | 'error' | 'unset';
1609
+ attributes: Record<string, string | number | boolean>;
1610
+ events: SpanEvent[];
1611
+ error?: Error;
1612
+ }
1613
+ interface SpanEvent {
1614
+ name: string;
1615
+ timestamp: Date;
1616
+ attributes?: Record<string, string | number | boolean>;
1617
+ }
1618
+ interface TelemetryOptions {
1619
+ serviceName?: string;
1620
+ serviceVersion?: string;
1621
+ enabled?: boolean;
1622
+ onSpanEnd?: (span: Span) => void;
1623
+ exportUrl?: string;
1624
+ }
1625
+ declare class Tracer {
1626
+ private spans;
1627
+ private readonly serviceName;
1628
+ private readonly serviceVersion;
1629
+ private readonly enabled;
1630
+ private readonly onSpanEnd?;
1631
+ constructor(options?: TelemetryOptions);
1632
+ startSpan(options: SpanOptions): string;
1633
+ endSpan(spanId: string, error?: Error): void;
1634
+ addEvent(spanId: string, name: string, attributes?: Record<string, string | number | boolean>): void;
1635
+ setAttribute(spanId: string, key: string, value: string | number | boolean): void;
1636
+ trace<T>(options: SpanOptions, fn: (spanId: string) => Promise<T>): Promise<T>;
1637
+ getActiveSpans(): Span[];
1638
+ private generateId;
1639
+ isEnabled(): boolean;
1640
+ }
1641
+ declare const tracer: Tracer;
1642
+
1643
+ type AuditAction = 'connector.connect' | 'connector.disconnect' | 'data.fetch' | 'data.create' | 'data.update' | 'data.delete' | 'auth.login' | 'auth.logout' | 'auth.failed' | 'scan.launch' | 'scan.cancel' | 'threat.mitigate' | 'policy.change' | 'deployment.create' | 'deployment.cancel';
1644
+ type AuditStatus = 'success' | 'failure' | 'pending';
1645
+ interface AuditEntry {
1646
+ id: string;
1647
+ action: AuditAction;
1648
+ connector: string;
1649
+ status: AuditStatus;
1650
+ timestamp: Date;
1651
+ duration?: number;
1652
+ userId?: string;
1653
+ resourceId?: string;
1654
+ resourceType?: string;
1655
+ details?: Record<string, unknown>;
1656
+ error?: string;
1657
+ ipAddress?: string;
1658
+ }
1659
+ interface AuditLoggerOptions {
1660
+ enabled?: boolean;
1661
+ maxEntries?: number;
1662
+ onEntry?: (entry: AuditEntry) => void;
1663
+ storage?: 'memory' | 'custom';
1664
+ }
1665
+ declare class AuditLogger {
1666
+ private entries;
1667
+ private readonly enabled;
1668
+ private readonly maxEntries;
1669
+ private readonly onEntry?;
1670
+ constructor(options?: AuditLoggerOptions);
1671
+ log(entry: Omit<AuditEntry, 'id' | 'timestamp'>): AuditEntry;
1672
+ logSuccess(action: AuditAction, connector: string, details?: Record<string, unknown>, duration?: number): AuditEntry;
1673
+ logFailure(action: AuditAction, connector: string, error: string, details?: Record<string, unknown>): AuditEntry;
1674
+ logDataFetch(connector: string, resourceType: string, resourceId?: string, duration?: number): AuditEntry;
1675
+ getEntries(filter?: {
1676
+ connector?: string;
1677
+ action?: AuditAction;
1678
+ status?: AuditStatus;
1679
+ from?: Date;
1680
+ to?: Date;
1681
+ limit?: number;
1682
+ }): AuditEntry[];
1683
+ getFailures(connector?: string): AuditEntry[];
1684
+ getRecentEntries(limit?: number): AuditEntry[];
1685
+ getStats(connector?: string): {
1686
+ total: number;
1687
+ success: number;
1688
+ failure: number;
1689
+ successRate: string;
1690
+ avgDurationMs: number;
1691
+ };
1692
+ exportAsJson(): string;
1693
+ exportAsCsv(): string;
1694
+ clear(): void;
1695
+ private generateId;
1696
+ }
1697
+ declare const auditLogger: AuditLogger;
1698
+
1699
+ interface NormalizationResult<T> {
1700
+ data: T[];
1701
+ total: number;
1702
+ sources: string[];
1703
+ normalizedAt: Date;
1704
+ errors: NormalizationError[];
1705
+ }
1706
+ interface NormalizationError {
1707
+ source: string;
1708
+ message: string;
1709
+ raw?: unknown;
1710
+ }
1711
+ type UnifiedSeverity = 'critical' | 'high' | 'medium' | 'low' | 'info';
1712
+ interface SeverityMapping {
1713
+ [key: string]: UnifiedSeverity;
1714
+ }
1715
+ declare class NormalizationEngine {
1716
+ normalizeVulnerabilities(sources: Array<{
1717
+ connector: string;
1718
+ data: unknown[];
1719
+ mapper: (item: unknown) => NormalizedVulnerability | null;
1720
+ }>): NormalizationResult<NormalizedVulnerability>;
1721
+ normalizeAssets(sources: Array<{
1722
+ connector: string;
1723
+ data: unknown[];
1724
+ mapper: (item: unknown) => NormalizedAsset | null;
1725
+ }>): NormalizationResult<NormalizedAsset>;
1726
+ normalizeThreats(sources: Array<{
1727
+ connector: string;
1728
+ data: unknown[];
1729
+ mapper: (item: unknown) => NormalizedThreat | null;
1730
+ }>): NormalizationResult<NormalizedThreat>;
1731
+ private deduplicateVulnerabilities;
1732
+ private deduplicateAssets;
1733
+ private severityScore;
1734
+ mapSeverity(value: string, mapping: SeverityMapping): UnifiedSeverity;
1735
+ sortBySeverity<T extends {
1736
+ severity: UnifiedSeverity;
1737
+ }>(items: T[], order?: 'asc' | 'desc'): T[];
1738
+ filterBySeverity<T extends {
1739
+ severity: UnifiedSeverity;
1740
+ }>(items: T[], minSeverity: UnifiedSeverity): T[];
1741
+ getSeverityStats<T extends {
1742
+ severity: UnifiedSeverity;
1743
+ }>(items: T[]): Record<UnifiedSeverity, number>;
1744
+ }
1745
+ declare const normalizationEngine: NormalizationEngine;
1746
+
1747
+ declare const NormalizedVulnerabilitySchema: z.ZodObject<{
1748
+ id: z.ZodString;
1749
+ title: z.ZodString;
1750
+ severity: z.ZodEnum<{
1751
+ info: "info";
1752
+ critical: "critical";
1753
+ high: "high";
1754
+ medium: "medium";
1755
+ low: "low";
1756
+ }>;
1757
+ cvss: z.ZodOptional<z.ZodNumber>;
1758
+ cve: z.ZodOptional<z.ZodString>;
1759
+ affectedAsset: z.ZodString;
1760
+ source: z.ZodString;
1761
+ detectedAt: z.ZodDate;
1762
+ raw: z.ZodOptional<z.ZodUnknown>;
1763
+ }, z.core.$strip>;
1764
+ type ValidatedVulnerability = z.infer<typeof NormalizedVulnerabilitySchema>;
1765
+ interface ValidationResult<T> {
1766
+ valid: T[];
1767
+ invalid: Array<{
1768
+ data: unknown;
1769
+ errors: string[];
1770
+ }>;
1771
+ }
1772
+ declare function validateVulnerabilities(items: unknown[]): ValidationResult<ValidatedVulnerability>;
1773
+ declare function cvssToSeverity(cvss: number): 'critical' | 'high' | 'medium' | 'low' | 'info';
1774
+
1775
+ declare const NormalizedAssetSchema: z.ZodObject<{
1776
+ id: z.ZodString;
1777
+ hostname: z.ZodString;
1778
+ ipAddress: z.ZodString;
1779
+ os: z.ZodOptional<z.ZodString>;
1780
+ type: z.ZodEnum<{
1781
+ server: "server";
1782
+ workstation: "workstation";
1783
+ network: "network";
1784
+ cloud: "cloud";
1785
+ unknown: "unknown";
1786
+ }>;
1787
+ source: z.ZodString;
1788
+ lastSeen: z.ZodDate;
1789
+ raw: z.ZodOptional<z.ZodUnknown>;
1790
+ }, z.core.$strip>;
1791
+ type ValidatedAsset = z.infer<typeof NormalizedAssetSchema>;
1792
+ interface AssetValidationResult {
1793
+ valid: ValidatedAsset[];
1794
+ invalid: Array<{
1795
+ data: unknown;
1796
+ errors: string[];
1797
+ }>;
1798
+ }
1799
+ declare function validateAssets(items: unknown[]): AssetValidationResult;
1800
+ declare function detectAssetType(hostname: string, os?: string): 'server' | 'workstation' | 'network' | 'cloud' | 'unknown';
1801
+ declare function isPrivateIP(ip: string): boolean;
1802
+
1803
+ interface StreamOptions {
1804
+ batchSize?: number;
1805
+ intervalMs?: number;
1806
+ maxItems?: number;
1807
+ onError?: (error: Error) => void;
1808
+ }
1809
+ interface StreamBatch<T> {
1810
+ items: T[];
1811
+ batchNumber: number;
1812
+ isLast: boolean;
1813
+ timestamp: Date;
1814
+ }
1815
+ declare class StreamManager extends EventEmitter {
1816
+ private activeStreams;
1817
+ createStream<T>(fetchFn: (page: number, limit: number) => Promise<{
1818
+ data: T[];
1819
+ hasMore: boolean;
1820
+ }>, options?: StreamOptions): AsyncGenerator<StreamBatch<T>>;
1821
+ startPolling<T>(streamId: string, fetchFn: () => Promise<T[]>, onData: (items: T[]) => void, options?: {
1822
+ intervalMs?: number;
1823
+ onError?: (error: Error) => void;
1824
+ }): Promise<void>;
1825
+ stopPolling(streamId: string): void;
1826
+ stopAllStreams(): void;
1827
+ processBatches<T, R>(items: T[], processFn: (batch: T[]) => Promise<R[]>, batchSize?: number): Promise<R[]>;
1828
+ getActiveStreams(): string[];
1829
+ private sleep;
1830
+ }
1831
+
1832
+ interface VaultConfig {
1833
+ vaultUrl: string;
1834
+ token: string;
1835
+ namespace?: string;
1836
+ timeout?: number;
1837
+ }
1838
+ interface VaultSecret {
1839
+ path: string;
1840
+ data: Record<string, string>;
1841
+ version?: number;
1842
+ createdAt?: Date;
1843
+ expiresAt?: Date;
1844
+ }
1845
+ interface VaultAuthResponse {
1846
+ token: string;
1847
+ leaseDuration: number;
1848
+ renewable: boolean;
1849
+ }
1850
+ declare class VaultHandler {
1851
+ private client;
1852
+ private token;
1853
+ constructor(config: VaultConfig);
1854
+ readSecret(path: string): Promise<VaultSecret>;
1855
+ writeSecret(path: string, data: Record<string, string>): Promise<void>;
1856
+ deleteSecret(path: string): Promise<void>;
1857
+ listSecrets(path: string): Promise<string[]>;
1858
+ getConnectorCredentials(connectorName: string): Promise<Record<string, string>>;
1859
+ healthCheck(): Promise<boolean>;
1860
+ renewToken(): Promise<VaultAuthResponse>;
1861
+ }
1862
+
1863
+ interface ConnectorEnvMap {
1864
+ qualys: {
1865
+ baseUrl: string;
1866
+ username: string;
1867
+ password: string;
1868
+ };
1869
+ sentinelone: {
1870
+ baseUrl: string;
1871
+ apiToken: string;
1872
+ };
1873
+ checkpoint: {
1874
+ baseUrl: string;
1875
+ username: string;
1876
+ password: string;
1877
+ domain?: string;
1878
+ };
1879
+ manageengine: {
1880
+ baseUrl: string;
1881
+ clientId: string;
1882
+ clientSecret: string;
1883
+ refreshToken: string;
1884
+ };
1885
+ jira: {
1886
+ baseUrl: string;
1887
+ email: string;
1888
+ apiToken: string;
1889
+ };
1890
+ zoho: {
1891
+ baseUrl: string;
1892
+ clientId: string;
1893
+ clientSecret: string;
1894
+ refreshToken: string;
1895
+ };
1896
+ }
1897
+ declare class EnvHandler {
1898
+ private prefix;
1899
+ constructor(prefix?: string);
1900
+ get(key: string, required?: boolean): string | undefined;
1901
+ getRequired(key: string): string;
1902
+ getQualysCredentials(): ConnectorEnvMap['qualys'];
1903
+ getSentinelOneCredentials(): ConnectorEnvMap['sentinelone'];
1904
+ getCheckpointCredentials(): ConnectorEnvMap['checkpoint'];
1905
+ getManageEngineCredentials(): ConnectorEnvMap['manageengine'];
1906
+ getJiraCredentials(): ConnectorEnvMap['jira'];
1907
+ getZohoCredentials(): ConnectorEnvMap['zoho'];
1908
+ validateConnector(connectorName: keyof ConnectorEnvMap): boolean;
1909
+ static getEnvExample(): string;
1910
+ }
1911
+ declare const envHandler: EnvHandler;
1912
+
1913
+ type WebhookEventType = 'threat.detected' | 'threat.resolved' | 'vulnerability.found' | 'vulnerability.fixed' | 'scan.completed' | 'agent.offline' | 'agent.online' | 'policy.changed' | 'patch.missing' | 'patch.installed';
1914
+ interface WebhookEvent {
1915
+ id: string;
1916
+ type: WebhookEventType;
1917
+ connector: string;
1918
+ timestamp: Date;
1919
+ payload: Record<string, unknown>;
1920
+ signature?: string;
1921
+ }
1922
+ interface WebhookEndpoint {
1923
+ id: string;
1924
+ connector: string;
1925
+ secret?: string;
1926
+ enabled: boolean;
1927
+ events: WebhookEventType[];
1928
+ receivedCount: number;
1929
+ lastReceivedAt?: Date;
1930
+ }
1931
+ declare class WebhookManager extends EventEmitter {
1932
+ private handlers;
1933
+ private endpoints;
1934
+ private eventHistory;
1935
+ private readonly maxHistory;
1936
+ constructor(options?: {
1937
+ maxHistory?: number;
1938
+ });
1939
+ registerEndpoint(config: Omit<WebhookEndpoint, 'receivedCount'>): void;
1940
+ on(eventType: WebhookEventType | '*', handler: (event: WebhookEvent) => void): this;
1941
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
1942
+ onConnector(connector: string, eventType: WebhookEventType | '*', handler: (event: WebhookEvent) => void | Promise<void>): void;
1943
+ processWebhook(endpointId: string, payload: Record<string, unknown>, signature?: string): Promise<{
1944
+ success: boolean;
1945
+ error?: string;
1946
+ }>;
1947
+ private dispatchEvent;
1948
+ private verifySignature;
1949
+ static generateSecret(): string;
1950
+ getHistory(filter?: {
1951
+ connector?: string;
1952
+ eventType?: WebhookEventType;
1953
+ limit?: number;
1954
+ }): WebhookEvent[];
1955
+ getStats(): {
1956
+ totalEvents: number;
1957
+ registeredEndpoints: number;
1958
+ registeredHandlers: number;
1959
+ byConnector: Record<string, number>;
1960
+ byType: Record<string, number>;
1961
+ };
1962
+ getEndpoints(): WebhookEndpoint[];
1963
+ private generateId;
1964
+ }
1965
+
1966
+ interface MCPTool {
1967
+ name: string;
1968
+ description: string;
1969
+ inputSchema: {
1970
+ type: 'object';
1971
+ properties: Record<string, MCPToolProperty>;
1972
+ required?: string[];
1973
+ };
1974
+ handler: (input: Record<string, unknown>) => Promise<MCPToolResult>;
1975
+ }
1976
+ interface MCPToolProperty {
1977
+ type: 'string' | 'number' | 'boolean' | 'array' | 'object';
1978
+ description: string;
1979
+ enum?: string[];
1980
+ items?: {
1981
+ type: string;
1982
+ };
1983
+ }
1984
+ interface MCPToolResult {
1985
+ content: Array<{
1986
+ type: 'text' | 'json';
1987
+ text?: string;
1988
+ data?: unknown;
1989
+ }>;
1990
+ isError?: boolean;
1991
+ }
1992
+ interface MCPServerOptions {
1993
+ name?: string;
1994
+ version?: string;
1995
+ description?: string;
1996
+ }
1997
+ declare class MCPServer {
1998
+ private tools;
1999
+ private readonly name;
2000
+ private readonly version;
2001
+ private readonly description;
2002
+ constructor(options?: MCPServerOptions);
2003
+ registerTool(tool: MCPTool): void;
2004
+ registerConnectorTools(connectorName: string, methods: Array<{
2005
+ name: string;
2006
+ description: string;
2007
+ params?: Record<string, MCPToolProperty>;
2008
+ handler: (params: Record<string, unknown>) => Promise<unknown>;
2009
+ }>): void;
2010
+ executeTool(name: string, input: Record<string, unknown>): Promise<MCPToolResult>;
2011
+ listTools(): MCPTool[];
2012
+ getToolByName(name: string): MCPTool | undefined;
2013
+ getServerInfo(): {
2014
+ name: string;
2015
+ version: string;
2016
+ description: string;
2017
+ toolCount: number;
2018
+ };
2019
+ generateManifest(): {
2020
+ schema_version: string;
2021
+ name_for_human: string;
2022
+ name_for_model: string;
2023
+ description_for_human: string;
2024
+ description_for_model: string;
2025
+ api: {
2026
+ type: string;
2027
+ version: string;
2028
+ };
2029
+ tools: {
2030
+ name: string;
2031
+ description: string;
2032
+ input_schema: {
2033
+ type: "object";
2034
+ properties: Record<string, MCPToolProperty>;
2035
+ required?: string[];
2036
+ };
2037
+ }[];
2038
+ };
2039
+ }
2040
+ declare function createQualysMCPTools(qualysConnector: {
2041
+ getAssets: (filter?: unknown) => Promise<unknown>;
2042
+ getVulnerabilities: (filter?: unknown) => Promise<unknown>;
2043
+ getCriticalVulnerabilities: () => Promise<unknown>;
2044
+ getScans: (filter?: unknown) => Promise<unknown>;
2045
+ healthCheck: () => Promise<unknown>;
2046
+ }): ({
2047
+ name: string;
2048
+ description: string;
2049
+ params: {
2050
+ limit: {
2051
+ type: "number";
2052
+ description: string;
2053
+ };
2054
+ hostname: {
2055
+ type: "string";
2056
+ description: string;
2057
+ };
2058
+ severity?: undefined;
2059
+ status?: undefined;
2060
+ };
2061
+ handler: (params: Record<string, unknown>) => Promise<unknown>;
2062
+ } | {
2063
+ name: string;
2064
+ description: string;
2065
+ params: {
2066
+ severity: {
2067
+ type: "array";
2068
+ description: string;
2069
+ items: {
2070
+ type: string;
2071
+ };
2072
+ };
2073
+ status: {
2074
+ type: "string";
2075
+ description: string;
2076
+ };
2077
+ limit?: undefined;
2078
+ hostname?: undefined;
2079
+ };
2080
+ handler: (params: Record<string, unknown>) => Promise<unknown>;
2081
+ } | {
2082
+ name: string;
2083
+ description: string;
2084
+ handler: () => Promise<unknown>;
2085
+ params?: undefined;
2086
+ })[];
2087
+ declare function createSentinelOneMCPTools(s1Connector: {
2088
+ getAgents: (filter?: unknown) => Promise<unknown>;
2089
+ getThreats: (filter?: unknown) => Promise<unknown>;
2090
+ getCriticalThreats: () => Promise<unknown>;
2091
+ quarantineThreat: (id: string) => Promise<unknown>;
2092
+ healthCheck: () => Promise<unknown>;
2093
+ }): ({
2094
+ name: string;
2095
+ description: string;
2096
+ params: {
2097
+ infected: {
2098
+ type: "boolean";
2099
+ description: string;
2100
+ };
2101
+ limit: {
2102
+ type: "number";
2103
+ description: string;
2104
+ };
2105
+ severity?: undefined;
2106
+ status?: undefined;
2107
+ threatId?: undefined;
2108
+ };
2109
+ handler: (params: Record<string, unknown>) => Promise<unknown>;
2110
+ } | {
2111
+ name: string;
2112
+ description: string;
2113
+ params: {
2114
+ severity: {
2115
+ type: "string";
2116
+ description: string;
2117
+ };
2118
+ status: {
2119
+ type: "string";
2120
+ description: string;
2121
+ };
2122
+ infected?: undefined;
2123
+ limit?: undefined;
2124
+ threatId?: undefined;
2125
+ };
2126
+ handler: (params: Record<string, unknown>) => Promise<unknown>;
2127
+ } | {
2128
+ name: string;
2129
+ description: string;
2130
+ params: {
2131
+ threatId: {
2132
+ type: "string";
2133
+ description: string;
2134
+ };
2135
+ infected?: undefined;
2136
+ limit?: undefined;
2137
+ severity?: undefined;
2138
+ status?: undefined;
2139
+ };
2140
+ handler: (params: Record<string, unknown>) => Promise<unknown>;
2141
+ } | {
2142
+ name: string;
2143
+ description: string;
2144
+ handler: () => Promise<unknown>;
2145
+ params?: undefined;
2146
+ })[];
2147
+ declare const mcpServer: MCPServer;
2148
+
2149
+ interface LangChainToolSchema {
2150
+ name: string;
2151
+ description: string;
2152
+ schema: {
2153
+ type: 'object';
2154
+ properties: Record<string, {
2155
+ type: string;
2156
+ description: string;
2157
+ enum?: string[];
2158
+ }>;
2159
+ required?: string[];
2160
+ };
2161
+ }
2162
+ interface LangChainTool {
2163
+ name: string;
2164
+ description: string;
2165
+ schema: LangChainToolSchema['schema'];
2166
+ call: (input: string | Record<string, unknown>) => Promise<string>;
2167
+ }
2168
+ declare class LangChainAdapter {
2169
+ static createTool(options: {
2170
+ name: string;
2171
+ description: string;
2172
+ schema?: LangChainToolSchema['schema'];
2173
+ handler: (input: Record<string, unknown>) => Promise<unknown>;
2174
+ }): LangChainTool;
2175
+ static createQualysTools(qualysConnector: {
2176
+ getAssets: (filter?: unknown) => Promise<unknown>;
2177
+ getVulnerabilities: (filter?: unknown) => Promise<unknown>;
2178
+ getCriticalVulnerabilities: () => Promise<unknown>;
2179
+ getNormalizedVulnerabilities: (filter?: unknown) => Promise<unknown>;
2180
+ healthCheck: () => Promise<unknown>;
2181
+ }): LangChainTool[];
2182
+ static createSentinelOneTools(s1Connector: {
2183
+ getAgents: (filter?: unknown) => Promise<unknown>;
2184
+ getThreats: (filter?: unknown) => Promise<unknown>;
2185
+ getCriticalThreats: () => Promise<unknown>;
2186
+ getActiveThreatCount: () => Promise<unknown>;
2187
+ quarantineThreat: (id: string) => Promise<unknown>;
2188
+ killThreat: (id: string) => Promise<unknown>;
2189
+ getNormalizedThreats: (filter?: unknown) => Promise<unknown>;
2190
+ healthCheck: () => Promise<unknown>;
2191
+ }): LangChainTool[];
2192
+ static createJiraTools(jiraConnector: {
2193
+ getIssues: (filter?: unknown) => Promise<unknown>;
2194
+ createIssue: (request: unknown) => Promise<unknown>;
2195
+ createSecurityTicket: (projectKey: string, title: string, description: string, severity: string, source: string) => Promise<unknown>;
2196
+ updateIssue: (issueKey: string, request: unknown) => Promise<unknown>;
2197
+ addComment: (issueKey: string, body: string) => Promise<unknown>;
2198
+ transitionIssue: (issueKey: string, transitionId: string) => Promise<unknown>;
2199
+ healthCheck: () => Promise<unknown>;
2200
+ }): LangChainTool[];
2201
+ static createAllTools(connectors: {
2202
+ qualys?: Parameters<typeof LangChainAdapter.createQualysTools>[0];
2203
+ sentinelone?: Parameters<typeof LangChainAdapter.createSentinelOneTools>[0];
2204
+ jira?: Parameters<typeof LangChainAdapter.createJiraTools>[0];
2205
+ }): LangChainTool[];
2206
+ }
2207
+
2208
+ interface VercelAITool {
2209
+ description: string;
2210
+ parameters: any;
2211
+ execute: (args: any) => Promise<any>;
2212
+ }
2213
+ type VercelAIToolSet = Record<string, VercelAITool>;
2214
+ /**
2215
+ * Adapter for Vercel AI SDK (ai)
2216
+ */
2217
+ declare class VercelAIAdapter {
2218
+ /**
2219
+ * Create a tool for Vercel AI SDK
2220
+ */
2221
+ static createTool(options: {
2222
+ description: string;
2223
+ parameters: any;
2224
+ execute: (args: any) => Promise<any>;
2225
+ }): VercelAITool;
2226
+ /**
2227
+ * Create a set of tools for a connector
2228
+ */
2229
+ static createToolkit(tools: VercelAIToolSet): VercelAIToolSet;
2230
+ /**
2231
+ * Create Qualys-specific tools for Vercel AI SDK
2232
+ */
2233
+ static createQualysTools(qualysConnector: {
2234
+ getAssets: (filter?: unknown) => Promise<unknown>;
2235
+ getVulnerabilities: (filter?: unknown) => Promise<unknown>;
2236
+ getCriticalVulnerabilities: () => Promise<unknown>;
2237
+ getNormalizedVulnerabilities: (filter?: unknown) => Promise<unknown>;
2238
+ getScans: (filter?: unknown) => Promise<unknown>;
2239
+ healthCheck: () => Promise<unknown>;
2240
+ }): VercelAIToolSet;
2241
+ /**
2242
+ * Create SentinelOne-specific tools for Vercel AI SDK
2243
+ */
2244
+ static createSentinelOneTools(s1Connector: {
2245
+ getAgents: (filter?: unknown) => Promise<unknown>;
2246
+ getThreats: (filter?: unknown) => Promise<unknown>;
2247
+ getCriticalThreats: () => Promise<unknown>;
2248
+ quarantineThreat: (id: string) => Promise<unknown>;
2249
+ healthCheck: () => Promise<unknown>;
2250
+ }): VercelAIToolSet;
2251
+ /**
2252
+ * Create Jira-specific tools for Vercel AI SDK
2253
+ */
2254
+ static createJiraTools(jiraConnector: {
2255
+ getIssues: (filter?: unknown) => Promise<unknown>;
2256
+ createIssue: (request: unknown) => Promise<unknown>;
2257
+ createSecurityTicket: (projectKey: string, title: string, description: string, severity: string, source: string) => Promise<unknown>;
2258
+ updateIssue: (issueKey: string, request: unknown) => Promise<unknown>;
2259
+ addComment: (issueKey: string, body: string) => Promise<unknown>;
2260
+ transitionIssue: (issueKey: string, transitionId: string) => Promise<unknown>;
2261
+ healthCheck: () => Promise<unknown>;
2262
+ }): VercelAIToolSet;
2263
+ /**
2264
+ * Create a full set of tools from multiple connectors
2265
+ */
2266
+ static createFullToolSet(connectors: {
2267
+ qualys?: Parameters<typeof VercelAIAdapter.createQualysTools>[0];
2268
+ sentinelone?: Parameters<typeof VercelAIAdapter.createSentinelOneTools>[0];
2269
+ jira?: Parameters<typeof VercelAIAdapter.createJiraTools>[0];
2270
+ }): VercelAIToolSet;
2271
+ }
2272
+
2273
+ interface OpenAIAgentTool {
2274
+ type: 'function';
2275
+ function: {
2276
+ name: string;
2277
+ description: string;
2278
+ parameters: {
2279
+ type: 'object';
2280
+ properties: Record<string, OpenAIToolProperty>;
2281
+ required?: string[];
2282
+ };
2283
+ strict?: boolean;
2284
+ };
2285
+ execute: (params: Record<string, unknown>) => Promise<string>;
2286
+ }
2287
+ interface OpenAIToolProperty {
2288
+ type: 'string' | 'number' | 'boolean' | 'array' | 'object';
2289
+ description: string;
2290
+ enum?: string[];
2291
+ items?: {
2292
+ type: string;
2293
+ };
2294
+ }
2295
+ interface OpenAIAgentDefinition {
2296
+ name: string;
2297
+ instructions: string;
2298
+ tools: OpenAIAgentTool[];
2299
+ model?: string;
2300
+ }
2301
+ declare class OpenAIAgentsAdapter {
2302
+ static createTool(options: {
2303
+ name: string;
2304
+ description: string;
2305
+ parameters?: Record<string, OpenAIToolProperty>;
2306
+ required?: string[];
2307
+ strict?: boolean;
2308
+ execute: (params: Record<string, unknown>) => Promise<unknown>;
2309
+ }): OpenAIAgentTool;
2310
+ static createSecurityAnalystAgent(connectors: {
2311
+ qualys?: {
2312
+ getVulnerabilities: (filter?: unknown) => Promise<unknown>;
2313
+ getCriticalVulnerabilities: () => Promise<unknown>;
2314
+ getAssets: (filter?: unknown) => Promise<unknown>;
2315
+ };
2316
+ sentinelone?: {
2317
+ getThreats: (filter?: unknown) => Promise<unknown>;
2318
+ getCriticalThreats: () => Promise<unknown>;
2319
+ quarantineThreat: (id: string) => Promise<unknown>;
2320
+ };
2321
+ jira?: {
2322
+ createSecurityTicket: (projectKey: string, title: string, description: string, severity: string, source: string) => Promise<unknown>;
2323
+ };
2324
+ }): OpenAIAgentDefinition;
2325
+ static createComplianceAgent(connectors: {
2326
+ qualys?: {
2327
+ getComplianceControls: () => Promise<unknown>;
2328
+ getVulnerabilities: (filter?: unknown) => Promise<unknown>;
2329
+ };
2330
+ manageengine?: {
2331
+ getMissingPatches: () => Promise<unknown>;
2332
+ getCriticalPatches: () => Promise<unknown>;
2333
+ };
2334
+ jira?: {
2335
+ createSecurityTicket: (projectKey: string, title: string, description: string, severity: string, source: string) => Promise<unknown>;
2336
+ };
2337
+ }): OpenAIAgentDefinition;
2338
+ static toOpenAIFormat(tools: OpenAIAgentTool[]): Array<{
2339
+ type: 'function';
2340
+ function: OpenAIAgentTool['function'];
2341
+ }>;
2342
+ }
2343
+
2344
+ type HITLActionType = 'threat.quarantine' | 'threat.kill' | 'threat.remediate' | 'policy.change' | 'policy.delete' | 'deployment.create' | 'deployment.cancel' | 'agent.disconnect' | 'rule.add' | 'rule.delete' | 'scan.launch';
2345
+ type HITLStatus = 'pending' | 'approved' | 'rejected' | 'expired' | 'executing' | 'completed' | 'failed';
2346
+ type HITLRiskLevel = 'low' | 'medium' | 'high' | 'critical';
2347
+ interface HITLRequest {
2348
+ id: string;
2349
+ actionType: HITLActionType;
2350
+ connector: string;
2351
+ description: string;
2352
+ riskLevel: HITLRiskLevel;
2353
+ params: Record<string, unknown>;
2354
+ requestedBy: string;
2355
+ requestedAt: Date;
2356
+ expiresAt: Date;
2357
+ status: HITLStatus;
2358
+ approvedBy?: string;
2359
+ approvedAt?: Date;
2360
+ rejectedBy?: string;
2361
+ rejectedReason?: string;
2362
+ executedAt?: Date;
2363
+ result?: unknown;
2364
+ error?: string;
2365
+ }
2366
+ interface HITLManagerOptions {
2367
+ defaultTimeoutMs?: number;
2368
+ autoApproveRiskLevels?: HITLRiskLevel[];
2369
+ onApprovalRequired?: (request: HITLRequest) => void;
2370
+ onApproved?: (request: HITLRequest) => void;
2371
+ onRejected?: (request: HITLRequest) => void;
2372
+ onExpired?: (request: HITLRequest) => void;
2373
+ onCompleted?: (request: HITLRequest) => void;
2374
+ }
2375
+ declare class HITLManager {
2376
+ private requests;
2377
+ private handlers;
2378
+ private readonly defaultTimeoutMs;
2379
+ private readonly autoApproveRiskLevels;
2380
+ private readonly onApprovalRequired?;
2381
+ private readonly onApproved?;
2382
+ private readonly onRejected?;
2383
+ private readonly onExpired?;
2384
+ private readonly onCompleted?;
2385
+ constructor(options?: HITLManagerOptions);
2386
+ registerHandler(actionType: HITLActionType, handler: (params: Record<string, unknown>) => Promise<unknown>): void;
2387
+ requestApproval(options: {
2388
+ actionType: HITLActionType;
2389
+ connector: string;
2390
+ description: string;
2391
+ riskLevel: HITLRiskLevel;
2392
+ params: Record<string, unknown>;
2393
+ requestedBy: string;
2394
+ timeoutMs?: number;
2395
+ }): Promise<HITLRequest>;
2396
+ approve(requestId: string, approvedBy: string): Promise<HITLRequest>;
2397
+ reject(requestId: string, rejectedBy: string, reason: string): HITLRequest;
2398
+ private execute;
2399
+ waitForApproval(requestId: string, pollIntervalMs?: number): Promise<HITLRequest>;
2400
+ getPendingRequests(): HITLRequest[];
2401
+ getRequestById(id: string): HITLRequest | undefined;
2402
+ getRequestsByConnector(connector: string): HITLRequest[];
2403
+ getRequestsByStatus(status: HITLStatus): HITLRequest[];
2404
+ getStats(): {
2405
+ total: number;
2406
+ pending: number;
2407
+ approved: number;
2408
+ rejected: number;
2409
+ completed: number;
2410
+ failed: number;
2411
+ expired: number;
2412
+ };
2413
+ static getRiskLevel(actionType: HITLActionType): HITLRiskLevel;
2414
+ private generateId;
2415
+ }
2416
+ declare const hitlManager: HITLManager;
2417
+
2418
+ type WorkflowStepType = 'fetch' | 'analyze' | 'filter' | 'transform' | 'action' | 'notify' | 'condition' | 'parallel';
2419
+ type WorkflowStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
2420
+ interface WorkflowStep {
2421
+ id: string;
2422
+ name: string;
2423
+ type: WorkflowStepType;
2424
+ connector?: string;
2425
+ method?: string;
2426
+ params?: Record<string, unknown>;
2427
+ condition?: (context: WorkflowContext) => boolean;
2428
+ transform?: (data: unknown, context: WorkflowContext) => unknown;
2429
+ onSuccess?: (result: unknown, context: WorkflowContext) => void;
2430
+ onError?: (error: Error, context: WorkflowContext) => void;
2431
+ dependsOn?: string[];
2432
+ retries?: number;
2433
+ timeoutMs?: number;
2434
+ }
2435
+ interface WorkflowContext {
2436
+ workflowId: string;
2437
+ results: Map<string, unknown>;
2438
+ errors: Map<string, Error>;
2439
+ startedAt: Date;
2440
+ metadata: Record<string, unknown>;
2441
+ }
2442
+ interface WorkflowDefinition {
2443
+ id: string;
2444
+ name: string;
2445
+ description?: string;
2446
+ steps: WorkflowStep[];
2447
+ onComplete?: (context: WorkflowContext) => void;
2448
+ onError?: (error: Error, context: WorkflowContext) => void;
2449
+ }
2450
+ interface WorkflowExecution {
2451
+ executionId: string;
2452
+ workflowId: string;
2453
+ status: WorkflowStatus;
2454
+ startedAt: Date;
2455
+ completedAt?: Date;
2456
+ context: WorkflowContext;
2457
+ stepResults: Map<string, StepResult>;
2458
+ error?: string;
2459
+ }
2460
+ interface StepResult {
2461
+ stepId: string;
2462
+ status: 'pending' | 'running' | 'completed' | 'failed' | 'skipped';
2463
+ startedAt?: Date;
2464
+ completedAt?: Date;
2465
+ data?: unknown;
2466
+ error?: string;
2467
+ retryCount: number;
2468
+ }
2469
+ declare class AgentOrchestrator {
2470
+ private workflows;
2471
+ private executions;
2472
+ private connectors;
2473
+ registerConnector(name: string, connector: Record<string, (...args: unknown[]) => Promise<unknown>>): void;
2474
+ registerWorkflow(workflow: WorkflowDefinition): void;
2475
+ executeWorkflow(workflowId: string, metadata?: Record<string, unknown>): Promise<WorkflowExecution>;
2476
+ private executeSteps;
2477
+ private executeStep;
2478
+ private executeConnectorStep;
2479
+ private executeFilterStep;
2480
+ private executeParallelStep;
2481
+ private resolveParams;
2482
+ createVulnerabilityResponseWorkflow(): WorkflowDefinition;
2483
+ createThreatResponseWorkflow(): WorkflowDefinition;
2484
+ getExecution(executionId: string): WorkflowExecution | undefined;
2485
+ getExecutionsByWorkflow(workflowId: string): WorkflowExecution[];
2486
+ getStats(): {
2487
+ totalExecutions: number;
2488
+ completed: number;
2489
+ failed: number;
2490
+ running: number;
2491
+ registeredWorkflows: number;
2492
+ registeredConnectors: number;
2493
+ };
2494
+ private sleep;
2495
+ private generateId;
2496
+ }
2497
+ declare const orchestrator: AgentOrchestrator;
2498
+
2499
+ interface SemanticDocument {
2500
+ id: string;
2501
+ content: string;
2502
+ metadata: {
2503
+ connector: string;
2504
+ type: 'vulnerability' | 'asset' | 'threat' | 'log' | 'policy';
2505
+ severity?: string;
2506
+ source?: string;
2507
+ timestamp?: Date;
2508
+ [key: string]: unknown;
2509
+ };
2510
+ embedding?: number[];
2511
+ }
2512
+ interface SemanticSearchResult {
2513
+ document: SemanticDocument;
2514
+ score: number;
2515
+ highlights?: string[];
2516
+ }
2517
+ interface SemanticSearchOptions {
2518
+ topK?: number;
2519
+ minScore?: number;
2520
+ connector?: string;
2521
+ type?: SemanticDocument['metadata']['type'];
2522
+ filters?: Record<string, unknown>;
2523
+ }
2524
+ interface EmbeddingProvider {
2525
+ embed: (text: string) => Promise<number[]>;
2526
+ embedBatch: (texts: string[]) => Promise<number[][]>;
2527
+ }
2528
+ declare class SemanticSearch {
2529
+ private documents;
2530
+ private tfidfIndex;
2531
+ private embeddingProvider?;
2532
+ private readonly useVectorSearch;
2533
+ constructor(options?: {
2534
+ embeddingProvider?: EmbeddingProvider;
2535
+ useVectorSearch?: boolean;
2536
+ });
2537
+ indexDocument(doc: SemanticDocument): Promise<void>;
2538
+ indexBatch(docs: SemanticDocument[]): Promise<void>;
2539
+ search(query: string, options?: SemanticSearchOptions): Promise<SemanticSearchResult[]>;
2540
+ private keywordSearch;
2541
+ private vectorSearch;
2542
+ indexVulnerabilities(vulnerabilities: Array<{
2543
+ id: string;
2544
+ title: string;
2545
+ severity: string;
2546
+ cve?: string;
2547
+ affectedAsset: string;
2548
+ source: string;
2549
+ }>): void;
2550
+ indexThreats(threats: Array<{
2551
+ id: string;
2552
+ name: string;
2553
+ severity: string;
2554
+ affectedAsset: string;
2555
+ source: string;
2556
+ }>): void;
2557
+ indexAssets(assets: Array<{
2558
+ id: string;
2559
+ hostname: string;
2560
+ ipAddress: string;
2561
+ os?: string;
2562
+ source: string;
2563
+ }>): void;
2564
+ findCriticalThreats(): Promise<SemanticSearchResult[]>;
2565
+ findVulnerableAssets(hostname: string): Promise<SemanticSearchResult[]>;
2566
+ findByKeyword(keyword: string): Promise<SemanticSearchResult[]>;
2567
+ private extractHighlights;
2568
+ getStats(): {
2569
+ totalDocuments: number;
2570
+ byConnector: Record<string, number>;
2571
+ byType: Record<string, number>;
2572
+ vectorSearchEnabled: boolean;
2573
+ };
2574
+ clearIndex(): void;
2575
+ }
2576
+ declare const semanticSearch: SemanticSearch;
2577
+
2578
+ interface AgentWorkflowOptions {
2579
+ hitlManager?: HITLManager;
2580
+ orchestrator?: AgentOrchestrator;
2581
+ semanticSearch?: SemanticSearch;
2582
+ auditLogger?: AuditLogger;
2583
+ requireApproval?: boolean;
2584
+ agentName?: string;
2585
+ }
2586
+ interface WorkflowResult {
2587
+ workflowName: string;
2588
+ status: 'success' | 'failed' | 'pending_approval';
2589
+ startedAt: Date;
2590
+ completedAt?: Date;
2591
+ steps: Array<{
2592
+ name: string;
2593
+ status: 'success' | 'failed' | 'skipped';
2594
+ data?: unknown;
2595
+ error?: string;
2596
+ }>;
2597
+ summary?: string;
2598
+ requiresAction?: string[];
2599
+ }
2600
+ declare class AgentWorkflow {
2601
+ private hitlManager?;
2602
+ private orchestrator?;
2603
+ private semanticSearch?;
2604
+ private auditLogger?;
2605
+ private requireApproval;
2606
+ private agentName;
2607
+ constructor(options?: AgentWorkflowOptions);
2608
+ runSecurityPostureAssessment(connectors: {
2609
+ qualys?: {
2610
+ getCriticalVulnerabilities: () => Promise<unknown>;
2611
+ getAssets: () => Promise<unknown>;
2612
+ healthCheck: () => Promise<unknown>;
2613
+ };
2614
+ sentinelone?: {
2615
+ getCriticalThreats: () => Promise<unknown>;
2616
+ getInfectedAgents: () => Promise<unknown>;
2617
+ healthCheck: () => Promise<unknown>;
2618
+ };
2619
+ checkpoint?: {
2620
+ getGateways: () => Promise<unknown>;
2621
+ healthCheck: () => Promise<unknown>;
2622
+ };
2623
+ }): Promise<WorkflowResult>;
2624
+ runThreatResponse(threatId: string, connectors: {
2625
+ sentinelone: {
2626
+ getThreats: (filter: unknown) => Promise<unknown>;
2627
+ quarantineThreat: (id: string) => Promise<unknown>;
2628
+ killThreat: (id: string) => Promise<unknown>;
2629
+ };
2630
+ jira?: {
2631
+ createSecurityTicket: (projectKey: string, title: string, description: string, severity: string, source: string) => Promise<unknown>;
2632
+ };
2633
+ }, jiraProjectKey?: string): Promise<WorkflowResult>;
2634
+ runPatchComplianceCheck(connectors: {
2635
+ manageengine: {
2636
+ getCriticalPatches: () => Promise<unknown>;
2637
+ getMissingPatches: () => Promise<unknown>;
2638
+ getComputers: () => Promise<unknown>;
2639
+ };
2640
+ jira?: {
2641
+ createSecurityTicket: (projectKey: string, title: string, description: string, severity: string, source: string) => Promise<unknown>;
2642
+ };
2643
+ }): Promise<WorkflowResult>;
2644
+ runNLQuery(query: string, options?: {
2645
+ topK?: number;
2646
+ type?: string;
2647
+ }): Promise<WorkflowResult>;
2648
+ private generateAssessmentSummary;
2649
+ }
2650
+ declare const agentWorkflow: AgentWorkflow;
2651
+
2652
+ declare const SDK_VERSION = "0.1.0";
2653
+ declare const SDK_NAME = "@skill-mine/complyment-connectors-sdk";
2654
+
2655
+ export { APIError, AgentOrchestrator, AgentWorkflow, type ApiKeyAuthConfig, type AuditAction, type AuditEntry, AuditLogger, type AuditStatus, type AuthConfig, type AuthResult, AuthType, AuthenticationError, BaseConnector, type BasicAuthConfig, type BearerAuthConfig, CacheLayer, type CacheOptions, type CheckpointConfig, CheckpointConnector, type CheckpointGateway, type CheckpointGatewayStatus, type CheckpointGroup, type CheckpointHost, type CheckpointHostFilter, type CheckpointLog, type CheckpointLogFilter, type CheckpointNetwork, type CheckpointPolicy, type CheckpointRule, type CheckpointRuleAction, type CheckpointRuleFilter, type CheckpointSession, type CheckpointThreat, type CheckpointThreatSeverity, CircuitBreaker, CircuitBreakerOpenError, type CircuitBreakerOptions, type CircuitBreakerStats, type CircuitState, type ComputerStatus, ConfigurationError, ConnectionError, type ConnectorConfig, ConnectorEvent, ConnectorRegistry, type ConnectorResponse, ConnectorStatus, type DeploymentStatus, DuplicatePluginError, EnvHandler, HITLManager, type HITLRequest, type HITLRiskLevel, type HITLStatus, type HealthCheckResult, InvalidCredentialsError, type JiraComment, type JiraConfig, JiraConnector, type JiraCreateIssueRequest, type JiraIssue, type JiraIssueFilter, type JiraIssueListResponse, type JiraIssuePriority, type JiraIssueStatus, type JiraIssueType, type JiraProject, type JiraSprint, type JiraSprintState, type JiraTransition, type JiraUpdateIssueRequest, type JiraUser, LangChainAdapter, type LangChainTool, type LogEntry, LogLevel, Logger, type LoggerOptions, MCPServer, type MCPTool, type MCPToolResult, type ManageEngineComputer, type ManageEngineComputerFilter, type ManageEngineComputerListResponse, type ManageEngineConfig, ManageEngineConnector, type ManageEngineDeployment, type ManageEngineDeploymentFilter, type ManageEnginePatch, type ManageEnginePatchFilter, type ManageEnginePatchListResponse, type ManageEngineVulnerability, type MitigationAction, type MitigationRequest, type MitigationResponse, NormalizationEngine, type NormalizationResult, type NormalizedAsset, type NormalizedThreat, type NormalizedVulnerability, NotFoundError, type OAuth2Config, type OAuth2TokenRequest, type OpenAIAgentDefinition, type OpenAIAgentTool, OpenAIAgentsAdapter, type PaginatedResponse, type PaginationOptions, type PatchSeverity, type PatchStatus, PluginNotFoundError, type QualysAPIResponse, type QualysAsset, type QualysAssetFilter, type QualysAssetListResponse, type QualysComplianceControl, type QualysConfig, QualysConnector, type QualysFetchDetectionsParams, type QualysFetchKBParams, type QualysHostDetection, type QualysHostInfo, type QualysKBEntry, type QualysLaunchScanParams, type QualysLaunchScanResponse, type QualysParsedReport, type QualysReport, type QualysScan, type QualysScanFilter, type QualysScanListResponse, QualysScanStatus, type QualysScanStatusResponse, QualysScanType, type QualysSeverity, type QualysVulnFilter, type QualysVulnListResponse, type QualysVulnerability, type QualysWASFilter, type QualysWASFinding, type QualysWASScan, RateLimitError, type RateLimitOptions, RateLimiter, RetryHandler, type RetryOptions, SDKError, SDK_NAME, SDK_VERSION, type SemanticDocument, SemanticSearch, type SemanticSearchResult, type SentinelOneActivity, type SentinelOneAgent, type SentinelOneAgentFilter, type SentinelOneAgentListResponse, type SentinelOneAgentStatus, type SentinelOneConfidenceLevel, type SentinelOneConfig, SentinelOneConnector, type SentinelOneGroup, type SentinelOneSite, type SentinelOneThreat, type SentinelOneThreatFilter, type SentinelOneThreatListResponse, type SentinelOneThreatStatus, SlidingWindowRateLimiter, type Span, type SpanOptions, StreamManager, type TelemetryOptions, TimeoutError, TokenExpiredError, type TokenResponse, Tracer, ValidationError, type VaultAuthConfig, VaultHandler, VercelAIAdapter, type VercelAITool, type VercelAIToolSet, WebhookManager, type WorkflowDefinition, type WorkflowExecution, type WorkflowResult, type ZohoAccount, type ZohoConfig, ZohoConnector, type ZohoContact, type ZohoContactFilter, type ZohoContactListResponse, type ZohoDeal, type ZohoDealFilter, type ZohoDealStage, type ZohoLead, type ZohoLeadFilter, type ZohoLeadStatus, type ZohoSearchResponse, type ZohoTask, type ZohoTaskStatus, agentWorkflow, auditLogger, createQualysMCPTools, createSentinelOneMCPTools, cvssToSeverity, detectAssetType, envHandler, hitlManager, isPrivateIP, isQualysScanActive, isQualysScanTerminal, isValidQualysScanStatus, logger, mcpServer, normalizationEngine, orchestrator, registry, semanticSearch, tracer, validateAssets, validateQualysScanStatus, validateVulnerabilities, withRetry };