@deepbounty/sdk 1.0.9 → 1.1.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.
- package/dist/index.d.ts +11 -8
- package/dist/types/tasks.d.ts +23 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -44,19 +44,22 @@ export interface ServerAPI {
|
|
|
44
44
|
logger: Logger;
|
|
45
45
|
config: ConfigAPI;
|
|
46
46
|
/**
|
|
47
|
-
* Register a
|
|
48
|
-
* @param
|
|
47
|
+
* Register a task template that can be scheduled for all targets
|
|
48
|
+
* @param uniqueKey Unique identifier for this task within the module (e.g., "subdomain-scan")
|
|
49
|
+
* @param name Friendly name for the task
|
|
50
|
+
* @param description Task description
|
|
51
|
+
* @param taskContent The task content including commands and tools
|
|
49
52
|
* @param interval Interval in seconds between task executions
|
|
50
53
|
* @param onComplete Optional callback executed when the task completes
|
|
51
|
-
* @returns The ID of the registered
|
|
54
|
+
* @returns The ID of the registered task template
|
|
52
55
|
*/
|
|
53
|
-
|
|
56
|
+
registerTaskTemplate(uniqueKey: string, name: string, description: string, taskContent: TaskContent, interval: number, onComplete?: (result: TaskResult) => void): Promise<number>;
|
|
54
57
|
/**
|
|
55
|
-
* Unregister a
|
|
56
|
-
* @param
|
|
57
|
-
* @returns true if the
|
|
58
|
+
* Unregister a task template
|
|
59
|
+
* @param templateId The ID of the task template to unregister
|
|
60
|
+
* @returns true if the template was unregistered, false if it didn't exist
|
|
58
61
|
*/
|
|
59
|
-
|
|
62
|
+
unregisterTaskTemplate(templateId: number): Promise<boolean>;
|
|
60
63
|
/** Register a tool
|
|
61
64
|
* @param tool The tool to register
|
|
62
65
|
*/
|
package/dist/types/tasks.d.ts
CHANGED
|
@@ -4,13 +4,27 @@ export interface TaskContent {
|
|
|
4
4
|
requiredTools?: Tool[];
|
|
5
5
|
extractResult?: boolean;
|
|
6
6
|
}
|
|
7
|
+
export interface TaskTemplate {
|
|
8
|
+
id: number;
|
|
9
|
+
moduleId: string;
|
|
10
|
+
uniqueKey: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
content: TaskContent;
|
|
14
|
+
interval: number;
|
|
15
|
+
active: boolean;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
}
|
|
7
18
|
export interface ScheduledTask {
|
|
8
19
|
id: number;
|
|
20
|
+
templateId: number;
|
|
9
21
|
content: TaskContent;
|
|
10
22
|
interval: number;
|
|
11
23
|
moduleId: string;
|
|
24
|
+
targetId?: number;
|
|
12
25
|
lastExecutedAt?: Date;
|
|
13
26
|
nextExecutionAt: Date;
|
|
27
|
+
active: boolean;
|
|
14
28
|
}
|
|
15
29
|
export interface TaskExecution {
|
|
16
30
|
executionId: number;
|
|
@@ -19,6 +33,7 @@ export interface TaskExecution {
|
|
|
19
33
|
status: "pending" | "running" | "completed" | "failed";
|
|
20
34
|
createdAt: Date;
|
|
21
35
|
content: TaskContent;
|
|
36
|
+
targetId?: number;
|
|
22
37
|
}
|
|
23
38
|
export interface TaskResult {
|
|
24
39
|
executionId: number;
|
|
@@ -26,4 +41,12 @@ export interface TaskResult {
|
|
|
26
41
|
success: boolean;
|
|
27
42
|
output?: any;
|
|
28
43
|
error?: string;
|
|
44
|
+
targetId?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface TargetTaskOverride {
|
|
47
|
+
id: number;
|
|
48
|
+
targetId: number;
|
|
49
|
+
taskTemplateId: number;
|
|
50
|
+
active: boolean;
|
|
51
|
+
createdAt: Date;
|
|
29
52
|
}
|