feat(v2): add multiple extra features from the pdf slides

This commit is contained in:
2026-07-09 01:22:02 +03:30
parent ae240e7ac1
commit 20a43d5c9a
16 changed files with 1003 additions and 239 deletions

View File

@@ -18,6 +18,39 @@ export async function uploadImage(file) {
return parseResponse(response);
}
export async function getOperations() {
const response = await fetch(`${API_BASE}/api/operations/`);
return parseResponse(response);
}
export async function listStates(sessionId) {
const response = await fetch(`${API_BASE}/api/sessions/${sessionId}/states/`);
return parseResponse(response);
}
export async function applyStateOperation(stateId, operation, params = {}) {
const response = await fetch(`${API_BASE}/api/states/${stateId}/operations/`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ operation, params })
});
return parseResponse(response);
}
export async function combineStates(operation, stateIds, params = {}) {
const response = await fetch(`${API_BASE}/api/states/combine/`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ operation, state_ids: stateIds, params })
});
return parseResponse(response);
}
export async function getStateHistogram(stateId) {
const response = await fetch(`${API_BASE}/api/states/${stateId}/histogram/`);
return parseResponse(response);
}
export async function processImage(sessionId, operation, params) {
const response = await fetch(`${API_BASE}/api/process/`, {
method: "POST",