semantic markup update

This commit is contained in:
2026-01-18 21:29:54 +03:00
parent 11c59fb420
commit 76baeb1038
85 changed files with 7020 additions and 5953 deletions

View File

@@ -4,6 +4,11 @@
const API_BASE = '/api/tasks';
// [DEF:getTasks:Function]
/* @PURPOSE: Fetch a list of tasks with pagination and optional status filter.
@PRE: limit and offset are numbers.
@POST: Returns a promise resolving to a list of tasks.
*/
/**
* Fetch a list of tasks with pagination and optional status filter.
* @param {number} limit - Maximum number of tasks to return.
@@ -26,7 +31,13 @@ export async function getTasks(limit = 10, offset = 0, status = null) {
}
return await response.json();
}
// [/DEF:getTasks:Function]
// [DEF:getTask:Function]
/* @PURPOSE: Fetch details for a specific task.
@PRE: taskId must be provided.
@POST: Returns a promise resolving to task details.
*/
/**
* Fetch details for a specific task.
* @param {string} taskId - The ID of the task.
@@ -39,7 +50,13 @@ export async function getTask(taskId) {
}
return await response.json();
}
// [/DEF:getTask:Function]
// [DEF:getTaskLogs:Function]
/* @PURPOSE: Fetch logs for a specific task.
@PRE: taskId must be provided.
@POST: Returns a promise resolving to a list of log entries.
*/
/**
* Fetch logs for a specific task.
* @param {string} taskId - The ID of the task.
@@ -55,7 +72,13 @@ export async function getTaskLogs(taskId) {
const task = await getTask(taskId);
return task.logs || [];
}
// [/DEF:getTaskLogs:Function]
// [DEF:resumeTask:Function]
/* @PURPOSE: Resume a task that is awaiting input (e.g., passwords).
@PRE: taskId and passwords must be provided.
@POST: Returns a promise resolving to the updated task object.
*/
/**
* Resume a task that is awaiting input (e.g., passwords).
* @param {string} taskId - The ID of the task.
@@ -77,7 +100,13 @@ export async function resumeTask(taskId, passwords) {
}
return await response.json();
}
// [/DEF:resumeTask:Function]
// [DEF:resolveTask:Function]
/* @PURPOSE: Resolve a task that is awaiting mapping.
@PRE: taskId and resolutionParams must be provided.
@POST: Returns a promise resolving to the updated task object.
*/
/**
* Resolve a task that is awaiting mapping.
* @param {string} taskId - The ID of the task.
@@ -99,7 +128,13 @@ export async function resolveTask(taskId, resolutionParams) {
}
return await response.json();
}
// [/DEF:resolveTask:Function]
// [DEF:clearTasks:Function]
/* @PURPOSE: Clear tasks based on status.
@PRE: status is a string or null.
@POST: Returns a promise that resolves when tasks are cleared.
*/
/**
* Clear tasks based on status.
* @param {string|null} status - Filter by task status (optional).
@@ -117,4 +152,5 @@ export async function clearTasks(status = null) {
if (!response.ok) {
throw new Error(`Failed to clear tasks: ${response.statusText}`);
}
}
}
// [/DEF:clearTasks:Function]