@deepbounty/sdk 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -8,13 +8,8 @@ The official SDK for developing modules for the DeepBounty project.
8
8
  npm install @deepbounty/sdk
9
9
  ```
10
10
 
11
- ## 🔧 Build & Publish
11
+ ## 📤 Publish
12
12
 
13
- 1. Build the SDK:
14
- ```bash
15
- npm run build
16
- ```
17
- 2. Publish to npm:
18
- ```bash
19
- npm publish --access public
20
- ```
13
+ ```bash
14
+ npm publish --access public
15
+ ```
@@ -0,0 +1,31 @@
1
+ import { ModuleSetting, TaskContent, TaskResult } from "./types";
2
+ export interface Logger {
3
+ info: (...args: any[]) => void;
4
+ warn: (...args: any[]) => void;
5
+ error: (...args: any[]) => void;
6
+ }
7
+ export interface ConfigAPI {
8
+ get<T = any>(key: string, defaultValue?: T): Promise<T>;
9
+ set<T = any>(key: string, value: T): Promise<void>;
10
+ remove(key: string): Promise<void>;
11
+ getAll(): Promise<Record<string, any>>;
12
+ getSetting(name: string): Promise<ModuleSetting>;
13
+ setSetting(name: string, value: any): Promise<void>;
14
+ getAllSettings(): Promise<ModuleSetting[]>;
15
+ }
16
+ export interface TasksAPI {
17
+ submit(taskContent: TaskContent): Promise<TaskResult>;
18
+ }
19
+ export interface ServerAPI {
20
+ version: string;
21
+ logger: Logger;
22
+ config: ConfigAPI;
23
+ tasks: TasksAPI;
24
+ }
25
+ export interface PluginLifecycle {
26
+ run?(api: ServerAPI): Promise<void> | void;
27
+ stop?(): Promise<void> | void;
28
+ }
29
+ export type PluginFactory = (api: ServerAPI) => PluginLifecycle | Promise<PluginLifecycle>;
30
+ declare const _default: any;
31
+ export default _default;
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export default {}; // Type-only module for plugins to import types during compile
@@ -0,0 +1,12 @@
1
+ export interface Alert {
2
+ id: number;
3
+ name: string;
4
+ targetName: string;
5
+ domain: string;
6
+ subdomain: string;
7
+ score: number;
8
+ confirmed: boolean;
9
+ description: string;
10
+ endpoint: string;
11
+ createdAt: string;
12
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export * from "./modules.js";
2
+ export * from "./targets.js";
3
+ export * from "./alerts.js";
4
+ export * from "./workers.js";
5
+ export * from "./websockets.js";
6
+ export * from "./tasks.js";
7
+ export * from "./tools.js";
@@ -0,0 +1,7 @@
1
+ export * from "./modules.js";
2
+ export * from "./targets.js";
3
+ export * from "./alerts.js";
4
+ export * from "./workers.js";
5
+ export * from "./websockets.js";
6
+ export * from "./tasks.js";
7
+ export * from "./tools.js";
@@ -0,0 +1,22 @@
1
+ import { Tool } from "./tools";
2
+ export interface Module {
3
+ id: string;
4
+ name: string;
5
+ version: string;
6
+ entry: string;
7
+ description?: string;
8
+ settings?: ModuleSetting[];
9
+ tools?: Tool[];
10
+ }
11
+ export interface ModuleSetting {
12
+ name: string;
13
+ type: "checkbox" | "text" | "select" | "info";
14
+ default: string | boolean;
15
+ label: string;
16
+ value?: string | boolean;
17
+ options?: string[];
18
+ }
19
+ export interface LoadedModule extends Module {
20
+ run: () => Promise<any>;
21
+ tools?: Tool[];
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ export interface Target {
2
+ id: number;
3
+ name: string;
4
+ domain: string;
5
+ subdomains: string[];
6
+ activeScan: boolean;
7
+ settings?: {
8
+ userAgent?: string;
9
+ customHeader?: string;
10
+ };
11
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import { Tool } from "./tools";
2
+ export interface TaskContent {
3
+ commands: string[];
4
+ requiredTools?: Tool[];
5
+ }
6
+ export interface Task extends TaskContent {
7
+ id: number;
8
+ }
9
+ export interface ServerTask extends Task {
10
+ workerId?: number;
11
+ status: "pending" | "running" | "completed" | "failed";
12
+ createdAt: Date;
13
+ }
14
+ export interface TaskResult {
15
+ taskId: number;
16
+ success: boolean;
17
+ output?: any;
18
+ error?: string;
19
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface Tool {
2
+ name: string;
3
+ version: string;
4
+ description?: string;
5
+ downloadUrl: string;
6
+ preInstallCommands?: string[];
7
+ postInstallCommands?: string[];
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface WebSocketMessage {
2
+ type: string;
3
+ data: any;
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ServerTask } from "./tasks";
2
+ import { Tool } from "./tools";
3
+ export interface Worker {
4
+ id: number;
5
+ currentTasks: ServerTask[];
6
+ availableTools: Tool[];
7
+ loadFactor: number;
8
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepbounty/sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "DeepBounty SDK for module development",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -24,8 +24,7 @@
24
24
  ],
25
25
  "scripts": {
26
26
  "build": "tsc",
27
- "prepublishOnly": "npm run build",
28
- "publish": "npm publish --access public"
27
+ "prepublishOnly": "npm run build"
29
28
  },
30
29
  "keywords": [
31
30
  "deepbounty",