@shieldaai/security-watch 0.0.0-stage → 0.1.0-alpha.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.
- package/CONTRIBUTING.md +90 -0
- package/LICENSE +202 -0
- package/README.md +269 -2
- package/SECURITY.md +47 -0
- package/dist/assessment.d.ts +5 -0
- package/dist/assessment.js +398 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +792 -0
- package/dist/config.d.ts +242 -0
- package/dist/config.js +298 -0
- package/dist/cve-now.d.ts +5 -0
- package/dist/cve-now.js +413 -0
- package/dist/delivery.d.ts +26 -0
- package/dist/delivery.js +394 -0
- package/dist/ecosystems.d.ts +25 -0
- package/dist/ecosystems.js +254 -0
- package/dist/engine.d.ts +26 -0
- package/dist/engine.js +307 -0
- package/dist/health.d.ts +17 -0
- package/dist/health.js +70 -0
- package/dist/heartbeat.d.ts +13 -0
- package/dist/heartbeat.js +74 -0
- package/dist/http.d.ts +8 -0
- package/dist/http.js +251 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +15 -0
- package/dist/inventory.d.ts +3 -0
- package/dist/inventory.js +143 -0
- package/dist/lock.d.ts +3 -0
- package/dist/lock.js +112 -0
- package/dist/maintenance.d.ts +43 -0
- package/dist/maintenance.js +227 -0
- package/dist/models.d.ts +20 -0
- package/dist/models.js +602 -0
- package/dist/operations.d.ts +17 -0
- package/dist/operations.js +117 -0
- package/dist/providers.d.ts +209 -0
- package/dist/providers.js +459 -0
- package/dist/setup.d.ts +113 -0
- package/dist/setup.js +100 -0
- package/dist/source-error.d.ts +22 -0
- package/dist/source-error.js +56 -0
- package/dist/sources.d.ts +3 -0
- package/dist/sources.js +1071 -0
- package/dist/store.d.ts +71 -0
- package/dist/store.js +651 -0
- package/dist/types.d.ts +247 -0
- package/dist/types.js +1 -0
- package/dist/util.d.ts +6 -0
- package/dist/util.js +14 -0
- package/dist/vendor-sources.d.ts +24 -0
- package/dist/vendor-sources.js +56 -0
- package/docs/configuration.md +406 -0
- package/docs/quality-review.md +104 -0
- package/examples/advisories.json +17 -0
- package/examples/common-systems.yaml +243 -0
- package/examples/libraries.example.txt +16 -0
- package/examples/libraries.example.yaml +38 -0
- package/examples/library-watch.example.yaml +27 -0
- package/examples/security-watch.example.yaml +86 -0
- package/examples/systems.example.yaml +31 -0
- package/package.json +69 -4
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { Assessment, Config, Decision, Evidence, Notification } from './types.js';
|
|
2
|
+
import { type PruneReport, type RetentionPolicy } from './maintenance.js';
|
|
3
|
+
export declare const SCHEMA_VERSION = 5;
|
|
4
|
+
/** Durable state for one local worker. Stores evidence and results, never provider credentials. */
|
|
5
|
+
export declare class Store {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(path: string, options?: {
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
migrate?: boolean;
|
|
10
|
+
});
|
|
11
|
+
close(): void;
|
|
12
|
+
saveEvidence(evidence: Evidence[], checkpoints: Record<string, string>): void;
|
|
13
|
+
evidence(): Evidence[];
|
|
14
|
+
getEvidence(ids: readonly string[]): Evidence[];
|
|
15
|
+
evidenceHistory(source: string, id: string): {
|
|
16
|
+
content_hash: string;
|
|
17
|
+
evidence: Evidence;
|
|
18
|
+
recorded_at: number;
|
|
19
|
+
}[];
|
|
20
|
+
checkpoints(): Record<string, string>;
|
|
21
|
+
saveAssessment(assessment: Assessment, decision: Decision, now?: number, digestMs?: number): void;
|
|
22
|
+
findings(): Assessment[];
|
|
23
|
+
getFinding(id: string): Assessment | undefined;
|
|
24
|
+
controls(id: string, now?: number): {
|
|
25
|
+
revision: number;
|
|
26
|
+
acknowledged: boolean;
|
|
27
|
+
acknowledged_revision: number | null;
|
|
28
|
+
suppressed: boolean;
|
|
29
|
+
suppressed_until: number | null;
|
|
30
|
+
suppression_reason: string | null;
|
|
31
|
+
} | undefined;
|
|
32
|
+
summary(): {
|
|
33
|
+
active_findings: number;
|
|
34
|
+
delivery_states: Record<string, number>;
|
|
35
|
+
pending: number;
|
|
36
|
+
next_pending_at: number | null;
|
|
37
|
+
};
|
|
38
|
+
deliveryIssues(now?: number, maxPendingAgeMs?: number, config?: Config): {
|
|
39
|
+
failed: number;
|
|
40
|
+
unknown: number;
|
|
41
|
+
overdue_pending: number;
|
|
42
|
+
};
|
|
43
|
+
history(id: string): {
|
|
44
|
+
revision: number;
|
|
45
|
+
assessment: Assessment;
|
|
46
|
+
decision: Decision;
|
|
47
|
+
recorded_at: number;
|
|
48
|
+
}[];
|
|
49
|
+
jobs(): Notification[];
|
|
50
|
+
claimDue(now?: number, excludedChannels?: Notification['channel'][]): Notification | undefined;
|
|
51
|
+
claimAdditionalDigest(channel: Notification['channel'], now?: number, limit?: number): Notification[];
|
|
52
|
+
completeJob(id: string, status: 'accepted' | 'unknown' | 'failed' | 'pending', nextAt: number, error?: string): void;
|
|
53
|
+
deferJob(id: string, nextAt: number, reason?: string): void;
|
|
54
|
+
retryJob(id: string, now?: number): void;
|
|
55
|
+
recoverSending(now?: number): void;
|
|
56
|
+
acknowledge(id: string): void;
|
|
57
|
+
suppress(id: string, until: number, reason: string): void;
|
|
58
|
+
getMeta(key: string): string | undefined;
|
|
59
|
+
setMeta(key: string, value: string, now?: number): void;
|
|
60
|
+
prune(policy: RetentionPolicy, now?: number, apply?: boolean): PruneReport;
|
|
61
|
+
reserveBudget(day: string, maxRequests: number, maxTokens: number, maxUsd: number | undefined, tokens: number, usd: number | undefined): boolean;
|
|
62
|
+
budgets(): {
|
|
63
|
+
day: string;
|
|
64
|
+
requests: number;
|
|
65
|
+
tokens: number;
|
|
66
|
+
usd: number | null;
|
|
67
|
+
known_usd?: number;
|
|
68
|
+
unpriced_requests?: number;
|
|
69
|
+
}[];
|
|
70
|
+
backup(path: string): Promise<void>;
|
|
71
|
+
}
|