@deepbounty/sdk 1.1.3 → 1.1.5

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,45 @@
1
+ import { TrafficContext, HttpTraffic } from "./types/burpsuite";
2
+ /**
3
+ * Predefined core events emitted by the server
4
+ * Modules can also emit custom events for inter-module communication
5
+ */
6
+ export interface CoreEvents {
7
+ "http:traffic": HttpTraffic;
8
+ "http:js": {
9
+ context: TrafficContext;
10
+ js: string;
11
+ };
12
+ }
13
+ /**
14
+ * Event handler function signature
15
+ */
16
+ export type EventHandler<T = any> = (data: T) => void | Promise<void>;
17
+ /**
18
+ * Subscription object returned when subscribing to events
19
+ */
20
+ export interface EventSubscription {
21
+ unsubscribe: () => void;
22
+ }
23
+ export interface IEventBus {
24
+ /**
25
+ * Subscribe to an event
26
+ * @param event - Event name (type-safe for CoreEvents, flexible for custom events)
27
+ * @param handler - Async handler function called when event is emitted
28
+ * @returns Subscription object with unsubscribe method
29
+ */
30
+ subscribe<K extends keyof CoreEvents>(event: K, handler: EventHandler<CoreEvents[K]>): EventSubscription;
31
+ subscribe<T = any>(event: string, handler: EventHandler<T>): EventSubscription;
32
+ /**
33
+ * Emit an event with data
34
+ * Non-blocking, async execution with rate limiting and error isolation
35
+ * @param event - Event name
36
+ * @param data - Event data
37
+ */
38
+ emit<K extends keyof CoreEvents>(event: K, data: CoreEvents[K]): void;
39
+ emit<T = any>(event: string, data: T): void;
40
+ /**
41
+ * Clear all listeners for a specific event or all events
42
+ * @param event - Optional event name to clear (clears all if not provided)
43
+ */
44
+ clear(event?: string): void;
45
+ }
package/dist/events.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Alert, ModuleSetting, TaskContent, TaskResult, Tool } from "./types";
2
+ import { IEventBus } from "./events";
2
3
  export interface Logger {
3
4
  info: (...args: any[]) => void;
4
5
  warn: (...args: any[]) => void;
@@ -81,6 +82,7 @@ export interface ServerAPI {
81
82
  logger: Logger;
82
83
  config: ConfigAPI;
83
84
  storage: StorageAPI;
85
+ events: IEventBus;
84
86
  /**
85
87
  * Register a task template that can be scheduled for all targets
86
88
  * @param uniqueKey Unique identifier for this task within the module (e.g., "subdomain-scan")
@@ -120,5 +122,6 @@ export interface PluginLifecycle {
120
122
  stop?(): Promise<void> | void;
121
123
  }
122
124
  export type PluginFactory = (api: ServerAPI) => PluginLifecycle | Promise<PluginLifecycle>;
125
+ export { IEventBus, EventSubscription, CoreEvents, EventHandler, } from "./events";
123
126
  declare const _default: any;
124
127
  export default _default;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * HTTP traffic data from Burp Suite
3
+ */
4
+ export interface TrafficContext {
5
+ url: string;
6
+ method: string;
7
+ statusCode: number;
8
+ mimeType: string;
9
+ }
10
+ export interface TrafficContent {
11
+ requestHeaders: Record<string, string>;
12
+ responseHeaders: Record<string, string>;
13
+ requestBody: string;
14
+ responseBody: string;
15
+ }
16
+ export interface HttpTraffic extends TrafficContext, TrafficContent {
17
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -5,3 +5,4 @@ export * from "./workers.js";
5
5
  export * from "./websockets.js";
6
6
  export * from "./tasks.js";
7
7
  export * from "./tools.js";
8
+ export * from "./notifications.js";
@@ -5,3 +5,4 @@ export * from "./workers.js";
5
5
  export * from "./websockets.js";
6
6
  export * from "./tasks.js";
7
7
  export * from "./tools.js";
8
+ export * from "./notifications.js";
@@ -0,0 +1,30 @@
1
+ export type NotificationService = {
2
+ provider: "discord";
3
+ config: DiscordConfig;
4
+ enabled: boolean;
5
+ } | {
6
+ provider: "ntfysh";
7
+ config: ntfyshConfig;
8
+ enabled: boolean;
9
+ };
10
+ export interface DiscordConfig {
11
+ webhookUrl: string;
12
+ notificationRoleID?: string;
13
+ }
14
+ export interface ntfyshConfig {
15
+ serverRootUrl: string;
16
+ topic: string;
17
+ username?: string;
18
+ password?: string;
19
+ token?: string;
20
+ }
21
+ export interface NotificationConfigField {
22
+ name: string;
23
+ type: "text" | "password";
24
+ placeholder?: string;
25
+ required?: boolean;
26
+ }
27
+ export interface NotificationProvider {
28
+ label: string;
29
+ fields: NotificationConfigField[];
30
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,8 @@ import { TaskExecution } from "./tasks";
2
2
  import { Tool } from "./tools";
3
3
  export interface Worker {
4
4
  id: number;
5
+ ip?: string;
5
6
  currentTasks: TaskExecution[];
6
7
  availableTools: Tool[];
8
+ connectedAt: Date;
7
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepbounty/sdk",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "DeepBounty SDK for module development",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",