semantic markup update
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
|
||||
const API_BASE = '/api/tasks';
|
||||
|
||||
// [DEF:runTask:Function]
|
||||
/* @PURPOSE: Start a new task for a given plugin.
|
||||
@PRE: pluginId and params must be provided.
|
||||
@POST: Returns a promise resolving to the task instance.
|
||||
*/
|
||||
/**
|
||||
* Start a new task for a given plugin.
|
||||
* @param {string} pluginId - The ID of the plugin to run.
|
||||
@@ -25,7 +30,13 @@ export async function runTask(pluginId, params) {
|
||||
}
|
||||
return await response.json();
|
||||
}
|
||||
// [/DEF:runTask:Function]
|
||||
|
||||
// [DEF:getTaskStatus:Function]
|
||||
/* @PURPOSE: Fetch details for a specific task (to poll status or get result).
|
||||
@PRE: taskId must be provided.
|
||||
@POST: Returns a promise resolving to task details.
|
||||
*/
|
||||
/**
|
||||
* Fetch details for a specific task (to poll status or get result).
|
||||
* @param {string} taskId - The ID of the task.
|
||||
@@ -37,4 +48,5 @@ export async function getTaskStatus(taskId) {
|
||||
throw new Error(`Failed to fetch task ${taskId}: ${response.statusText}`);
|
||||
}
|
||||
return await response.json();
|
||||
}
|
||||
}
|
||||
// [/DEF:getTaskStatus:Function]
|
||||
Reference in New Issue
Block a user