.. AUTO-GENERATED FILE. DO NOT EDIT. DELETE /store/async-delete/store-auth-login-attempts-delete-one =============================================================== Summary ------- - **Source repository:** ``jef-systems/jef-store-backend`` - **Source SHA:** ``8bcbcdd91addfe886db8507bc0c40969f3cd03b6`` - **Source run id:** ``29187995843`` - **Lambda function:** ``jef-store-delete-003`` - **Lambda ARN:** ``arn:aws:lambda:ap-southeast-1:246715082475:function:jef-store-delete-003`` - **HTTP method:** ``DELETE`` - **Operation:** ``delete-one`` - **Invoke mode:** ``asynchronous`` - **Public DELETE endpoint:** ``https://api.jefoffice.com/store/async-delete/store-auth-login-attempts-delete-one`` - **Public status endpoint:** ``https://api.jefoffice.com/store/async-delete/store-auth-login-attempts-delete-one/status`` - **Public DELETE path:** ``/store/async-delete/store-auth-login-attempts-delete-one`` - **Public status path:** ``/store/async-delete/store-auth-login-attempts-delete-one/status`` - **AWS DELETE path:** ``/store-auth-login-attempts-delete-one`` - **AWS status path:** ``/store-auth-login-attempts-delete-one/status`` - **Cloudflare origin:** ``https://api.jefoffice.com`` - **Cloudflare operation base URL:** ``https://api.jefoffice.com/store/async-delete`` - **Cloudflare module path:** ``/store`` - **Cloudflare operation path:** ``/async-delete`` - **Cloudflare parent path:** ``/store/async-delete`` - **Cloudflare mode:** ``one-worker-for-lambda-async-delete`` - **Shared Cloudflare Worker:** ``jef-store-backend-lambda-async-delete`` - **Cloudflare route host:** ``api.jefoffice.com`` - **Cloudflare route pattern:** ``api.jefoffice.com/store/async-delete/\*`` - **DynamoDB table:** ``jef-store-auth-login-attempts`` - **Primary key:** ``login\_attempt\_id`` - **Cascade mode:** ``durable-job`` - **No-scan cascade:** ``true`` - **Throttle safe:** ``true`` Shared Worker Note ------------------ This endpoint is documented separately for clarity, but it is not deployed as a separate Cloudflare Worker. It is routed through the shared async DELETE Worker. Required Input -------------- The DELETE request must include the primary key. The Lambda accepts the real primary key field name, ``primary_key_value``, or ``id``. Accepted primary key aliases: - ``login\_attempt\_id`` - ``primary_key_value`` - ``id`` Optional fields: - ``cascade_delete``: defaults to ``true``. When true, the Lambda creates a durable async delete job. - ``delete_job_id``: used only when polling the status endpoint. DELETE Request Body Example --------------------------- .. code-block:: json { "login_attempt_id": "00000000-0000-4000-8000-000000000000", "cascade_delete": true } Alternative Body Example ------------------------ .. code-block:: json { "primary_key_value": "00000000-0000-4000-8000-000000000000", "cascade_delete": true } Query Example ------------- .. code-block:: text DELETE /store/async-delete/store-auth-login-attempts-delete-one?login_attempt_id=00000000-0000-4000-8000-000000000000&cascade_delete=true CMD curl -------- .. code-block:: bat curl -X DELETE "https://api.jefoffice.com/store/async-delete/store-auth-login-attempts-delete-one" -H "Content-Type: application/json" --data-raw '{"login_attempt_id": "00000000-0000-4000-8000-000000000000", "cascade_delete": true}' PowerShell curl --------------- .. code-block:: powershell curl.exe -X DELETE "https://api.jefoffice.com/store/async-delete/store-auth-login-attempts-delete-one" -H "Content-Type: application/json" --data-raw "{\"login_attempt_id\": \"00000000-0000-4000-8000-000000000000\", \"cascade_delete\": true}" Status Polling -------------- After a cascade delete returns ``202 Accepted``, poll the status endpoint with the returned ``delete_job_id``. .. code-block:: json { "delete_job_id": "" } Status curl: .. code-block:: bat curl "https://api.jefoffice.com/store/async-delete/store-auth-login-attempts-delete-one/status?delete_job_id=" Status PowerShell curl: .. code-block:: powershell curl.exe "https://api.jefoffice.com/store/async-delete/store-auth-login-attempts-delete-one/status?delete_job_id=" Accepted Async Response ----------------------- .. code-block:: json { "ok": true, "is_deleted": false, "is_committed": false, "is_async": true, "operation": "delete-one", "method": "DELETE", "primary_key": "login_attempt_id", "primary_key_value": "00000000-0000-4000-8000-000000000000", "cascade_delete": true, "cascade_mode": "durable-job", "delete_job_id": "", "status": "running", "status_path": "/store/async-delete/store-auth-login-attempts-delete-one/status", "message": "Cascade delete job accepted." } Expected Responses ------------------ .. list-table:: :header-rows: 1 :widths: 15 85 * - Status - Meaning * - 202 - Cascade delete job accepted. Use ``delete_job_id`` to poll status. * - 200 - Direct delete completed, or status endpoint returned the current job state. * - 400 - Missing primary key, missing ``delete_job_id`` on status check, or invalid payload. * - 404 - Item or delete job not found. * - 409 - Delete blocked because child records exist and cascade was not requested. * - 405 - Wrong HTTP method. * - 500 - Unexpected delete error. Cloudflare Worker Behavior -------------------------- All async DELETE endpoints from this backend are routed through one shared Cloudflare Worker. The Worker matches the public path, forwards the request to the correct AWS API Gateway DELETE or status endpoint, and injects the internal AWS API key. Public clients call the Cloudflare URL only, so public examples must not include the AWS API key header. Durable Cascade Notes --------------------- - Cascade deletion uses a durable job with ``delete_job_id``. - Child-record checks must be query-backed. Table scans are not allowed for cascade safety. - Large cascades continue through status polling instead of a single blocking request.