feat(v3): simplify the project to contain only required tools

This commit is contained in:
2026-07-09 04:02:31 +03:30
parent 20a43d5c9a
commit 2112e00982
19 changed files with 482 additions and 508 deletions

View File

@@ -11,6 +11,7 @@ from .services import (
image_session_create,
image_session_process,
image_state_apply_operation,
image_state_delete,
image_state_payload,
image_states_payload,
processing_job_payload,
@@ -105,6 +106,18 @@ class StateOperationView(APIView):
return error_response(str(exc), code)
class StateDetailView(APIView):
def delete(self, request, state_id):
state = image_state_get(state_id=state_id)
if state is None:
return error_response("Image state does not exist.", status.HTTP_404_NOT_FOUND)
try:
image_state_delete(state=state)
return Response(status=status.HTTP_204_NO_CONTENT)
except ProcessingError as exc:
return error_response(str(exc))
class StateCombineView(APIView):
class InputSerializer(serializers.Serializer):
operation = serializers.ChoiceField(choices=["add", "subtract", "dot_product", "average", "and", "or"])