@deepbounty/sdk 1.2.5 → 1.2.7
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 +10 -1
- package/dist/types/tasks.d.ts +1 -0
- package/dist/types/workers.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -209,6 +209,13 @@ export interface TargetAPI {
|
|
|
209
209
|
* @returns The target ID or null if not found
|
|
210
210
|
*/
|
|
211
211
|
getTargetIdByHostname(hostname: string): Promise<number | null>;
|
|
212
|
+
/**
|
|
213
|
+
* Get all targets with their information
|
|
214
|
+
* Only targets enabled for the given task template are returned.
|
|
215
|
+
* @param taskTemplateId The task template ID
|
|
216
|
+
* @returns Array of targets enabled for the task template
|
|
217
|
+
*/
|
|
218
|
+
getTargetsForTask(taskTemplateId: number): Promise<Target[]>;
|
|
212
219
|
}
|
|
213
220
|
export interface ServerAPI {
|
|
214
221
|
version: string;
|
|
@@ -228,12 +235,14 @@ export interface ServerAPI {
|
|
|
228
235
|
* @param description Task description
|
|
229
236
|
* @param taskContent The task content including commands and tools
|
|
230
237
|
* @param interval Interval in seconds between task executions. For CUSTOM mode: if <= 0, no automatic scheduling (manual mode only)
|
|
238
|
+
* @param aggressive Whether the task is aggressive (only run on worker that allows aggressive tasks)
|
|
231
239
|
* @param schedulingType How to schedule tasks: "TARGET_BASED" (one per target), "GLOBAL" (single instance), or "CUSTOM" (callback-based)
|
|
232
240
|
* @param onComplete Optional callback executed when a task instance completes
|
|
233
241
|
* @param onSchedule Optional callback for CUSTOM mode, invoked at interval to create instances (not called if interval <= 0)
|
|
242
|
+
* @param onManualTrigger Optional callback invoked when a task instance is manually triggered
|
|
234
243
|
* @returns The ID of the registered task template
|
|
235
244
|
*/
|
|
236
|
-
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>;
|
|
245
|
+
registerTaskTemplate(uniqueKey: string, name: string, description: string, taskContent: TaskContent, interval: number, aggressive: boolean, schedulingType?: "TARGET_BASED" | "GLOBAL" | "CUSTOM", onComplete?: (result: TaskResult) => void, onSchedule?: (templateId: number) => void | Promise<void>, onManualTrigger?: (templateId: number, targetId: number) => void | Promise<void>): Promise<number>;
|
|
237
246
|
/**
|
|
238
247
|
* Unregister a task template
|
|
239
248
|
* @param templateId The ID of the task template to unregister
|
package/dist/types/tasks.d.ts
CHANGED
package/dist/types/workers.d.ts
CHANGED