@profullstack/threatcrush 0.1.16 → 0.2.1

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.
@@ -1,54 +0,0 @@
1
- export type EventSeverity = 'info' | 'low' | 'medium' | 'high' | 'critical';
2
- export type EventCategory = 'auth' | 'web' | 'network' | 'system' | 'scan' | 'pentest';
3
-
4
- export interface ThreatEvent {
5
- id?: number;
6
- timestamp: Date;
7
- module: string;
8
- category: EventCategory;
9
- severity: EventSeverity;
10
- message: string;
11
- source_ip?: string;
12
- details?: Record<string, unknown>;
13
- }
14
-
15
- export interface ParsedLogLine {
16
- timestamp: Date;
17
- raw: string;
18
- source: string;
19
- fields: Record<string, string>;
20
- }
21
-
22
- export interface NginxLogEntry extends ParsedLogLine {
23
- source: 'nginx';
24
- fields: {
25
- ip: string;
26
- method: string;
27
- path: string;
28
- status: string;
29
- size: string;
30
- user_agent: string;
31
- [key: string]: string;
32
- };
33
- }
34
-
35
- export interface AuthLogEntry extends ParsedLogLine {
36
- source: 'auth';
37
- fields: {
38
- process: string;
39
- message: string;
40
- ip?: string;
41
- user?: string;
42
- [key: string]: string;
43
- };
44
- }
45
-
46
- export interface SyslogEntry extends ParsedLogLine {
47
- source: 'syslog';
48
- fields: {
49
- facility: string;
50
- process: string;
51
- message: string;
52
- [key: string]: string;
53
- };
54
- }
@@ -1,42 +0,0 @@
1
- import type { ThreatEvent } from './events.js';
2
- import type { ModuleConfig } from './config.js';
3
-
4
- export interface ModuleContext {
5
- config: ModuleConfig;
6
- logger: ModuleLogger;
7
- emit: (event: ThreatEvent) => void;
8
- getState: (key: string) => unknown;
9
- setState: (key: string, value: unknown) => void;
10
- }
11
-
12
- export interface ModuleLogger {
13
- debug: (msg: string, ...args: unknown[]) => void;
14
- info: (msg: string, ...args: unknown[]) => void;
15
- warn: (msg: string, ...args: unknown[]) => void;
16
- error: (msg: string, ...args: unknown[]) => void;
17
- }
18
-
19
- export interface ThreatCrushModule {
20
- name: string;
21
- version: string;
22
- description?: string;
23
-
24
- init(ctx: ModuleContext): Promise<void>;
25
- start(): Promise<void>;
26
- stop(): Promise<void>;
27
- onEvent?(event: ThreatEvent): Promise<void>;
28
- }
29
-
30
- export interface LoadedModule {
31
- manifest: {
32
- name: string;
33
- version: string;
34
- description: string;
35
- author: string;
36
- };
37
- config: ModuleConfig;
38
- instance?: ThreatCrushModule;
39
- status: 'loaded' | 'running' | 'stopped' | 'error';
40
- eventCount: number;
41
- path: string;
42
- }
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "bundler",
6
- "esModuleInterop": true,
7
- "allowSyntheticDefaultImports": true,
8
- "strict": true,
9
- "skipLibCheck": true,
10
- "outDir": "dist",
11
- "rootDir": "src",
12
- "declaration": true,
13
- "resolveJsonModule": true,
14
- "sourceMap": true,
15
- "types": ["node"]
16
- },
17
- "include": ["src/**/*"],
18
- "exclude": ["node_modules", "dist"]
19
- }
package/tsup.config.ts DELETED
@@ -1,16 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
-
3
- export default defineConfig({
4
- entry: ['src/index.ts'],
5
- format: ['cjs'],
6
- target: 'node20',
7
- platform: 'node',
8
- outDir: 'dist',
9
- clean: true,
10
- splitting: false,
11
- sourcemap: true,
12
- dts: false,
13
-
14
- external: ['better-sqlite3', 'blessed', 'blessed-contrib'],
15
- noExternal: ['chalk', 'ora', '@iarna/toml', 'commander'],
16
- });