@deepbounty/sdk 1.1.7 → 1.1.9
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/events.d.ts +4 -0
- package/dist/index.d.ts +6 -5
- package/dist/types/tasks.d.ts +1 -0
- package/package.json +1 -1
package/dist/events.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -90,11 +90,12 @@ export interface ServerAPI {
|
|
|
90
90
|
* @param description Task description
|
|
91
91
|
* @param taskContent The task content including commands and tools
|
|
92
92
|
* @param interval Interval in seconds between task executions
|
|
93
|
-
* @param schedulingType How to schedule tasks: "TARGET_BASED" (one per target), "GLOBAL" (single instance), or "CUSTOM" (
|
|
94
|
-
* @param onComplete Optional callback executed when
|
|
93
|
+
* @param schedulingType How to schedule tasks: "TARGET_BASED" (one per target), "GLOBAL" (single instance), or "CUSTOM" (callback-based)
|
|
94
|
+
* @param onComplete Optional callback executed when a task instance completes
|
|
95
|
+
* @param onSchedule Optional callback for CUSTOM mode, invoked at interval to create instances
|
|
95
96
|
* @returns The ID of the registered task template
|
|
96
97
|
*/
|
|
97
|
-
registerTaskTemplate(uniqueKey: string, name: string, description: string, taskContent: TaskContent, interval: number, schedulingType?: "TARGET_BASED" | "GLOBAL" | "CUSTOM", onComplete?: (result: TaskResult) => void): Promise<number>;
|
|
98
|
+
registerTaskTemplate(uniqueKey: string, name: string, description: string, taskContent: TaskContent, interval: number, schedulingType?: "TARGET_BASED" | "GLOBAL" | "CUSTOM", onComplete?: (result: TaskResult) => void, onSchedule?: (templateId: number) => void | Promise<void>): Promise<number>;
|
|
98
99
|
/**
|
|
99
100
|
* Unregister a task template
|
|
100
101
|
* @param templateId The ID of the task template to unregister
|
|
@@ -103,13 +104,13 @@ export interface ServerAPI {
|
|
|
103
104
|
unregisterTaskTemplate(templateId: number): Promise<boolean>;
|
|
104
105
|
/**
|
|
105
106
|
* Create a task instance manually (for CUSTOM scheduling type)
|
|
107
|
+
* Task instances are always one-time and automatically deleted after execution.
|
|
106
108
|
* @param templateId The ID of the task template
|
|
107
109
|
* @param targetId Optional target ID for this instance
|
|
108
110
|
* @param customData Optional custom data to attach to this instance (accessible via {{KEY}} placeholders)
|
|
109
|
-
* @param oneTime If true, delete the scheduled task after execution (default: false)
|
|
110
111
|
* @returns The scheduled task ID
|
|
111
112
|
*/
|
|
112
|
-
createTaskInstance(templateId: number, targetId?: number, customData?: Record<string, any
|
|
113
|
+
createTaskInstance(templateId: number, targetId?: number, customData?: Record<string, any>): Promise<number>;
|
|
113
114
|
/** Register a tool
|
|
114
115
|
* @param tool The tool to register
|
|
115
116
|
*/
|
package/dist/types/tasks.d.ts
CHANGED