fix: remove handle_ prefix from OpenAPI operation IDs and add missing delete endpoint
Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -19,6 +19,7 @@ use crate::common::is_binary::is_binary;
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/api/item/",
|
||||
operation_id = "list_items",
|
||||
summary = "List stored items",
|
||||
description = "Retrieve a paginated list of stored items with their metadata and tags. Items can be filtered by tags and sorted by creation time. Each item includes comprehensive metadata extracted during storage such as file type, encoding, size, and custom tags for organization.",
|
||||
responses(
|
||||
@@ -124,6 +125,7 @@ pub async fn handle_list_items(
|
||||
#[utoipa::path(
|
||||
post,
|
||||
path = "/api/item/",
|
||||
operation_id = "post_item",
|
||||
summary = "Store new item",
|
||||
description = "Create a new item by uploading content. The content will be automatically compressed, analyzed for metadata (file type, encoding, etc.), and stored with a unique identifier. Binary detection is performed automatically, and various metadata plugins extract information like line counts, file types, and system information.",
|
||||
responses(
|
||||
@@ -162,6 +164,7 @@ pub async fn handle_post_item(
|
||||
#[utoipa::path(
|
||||
delete,
|
||||
path = "/api/item/{item_id}",
|
||||
operation_id = "delete_item",
|
||||
summary = "Delete stored item",
|
||||
description = "Permanently delete an item and all its associated metadata, tags, and stored content. This operation cannot be undone. The item's compressed data file and all database records will be removed.",
|
||||
responses(
|
||||
@@ -210,6 +213,7 @@ pub async fn handle_delete_item(
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/api/item/latest",
|
||||
operation_id = "get_item_latest",
|
||||
summary = "Get latest item with content",
|
||||
description = "Retrieve the most recently stored item including its content and metadata. If tags are specified, returns the latest item that matches ALL the given tags. For text content, the actual content is included in the response. For binary content, only metadata is returned unless allow_binary is true.",
|
||||
responses(
|
||||
@@ -276,6 +280,7 @@ pub async fn handle_get_item_latest(
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/api/item/{item_id}",
|
||||
operation_id = "get_item",
|
||||
summary = "Get item with content",
|
||||
description = "Retrieve a specific item by its ID including both content and metadata. The content is automatically decompressed and returned as a string for text files. Binary files return only metadata unless allow_binary is explicitly set to true.",
|
||||
responses(
|
||||
@@ -337,6 +342,7 @@ pub async fn handle_get_item(
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/api/item/latest/content",
|
||||
operation_id = "get_item_latest_content",
|
||||
summary = "Download latest item content",
|
||||
description = "Download the raw content of the most recently stored item. The content is automatically decompressed and returned with the appropriate MIME type header for proper browser handling. If tags are specified, returns the latest item matching ALL the given tags.",
|
||||
responses(
|
||||
@@ -397,6 +403,7 @@ pub async fn handle_get_item_latest_content(
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/api/item/{item_id}/content",
|
||||
operation_id = "get_item_content",
|
||||
summary = "Download item content",
|
||||
description = "Download the raw content of a specific item by its ID. The content is automatically decompressed and returned with the appropriate MIME type header for proper browser handling. This endpoint is ideal for downloading files or viewing content directly in the browser.",
|
||||
responses(
|
||||
@@ -556,6 +563,7 @@ async fn get_item_raw_content(item: &db::Item, data_dir: &PathBuf, conn: &mut ru
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/api/item/latest/meta",
|
||||
operation_id = "get_item_latest_meta",
|
||||
summary = "Get latest item metadata",
|
||||
description = "Retrieve comprehensive metadata for the most recently stored item. Metadata includes automatically extracted information such as file type, MIME type, encoding, line counts, file size, system information (user, hostname, etc.), and cryptographic hashes. If tags are specified, returns metadata for the latest item matching ALL the given tags.",
|
||||
responses(
|
||||
@@ -618,6 +626,7 @@ pub async fn handle_get_item_latest_meta(
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/api/item/{item_id}/meta",
|
||||
operation_id = "get_item_meta",
|
||||
summary = "Get item metadata",
|
||||
description = "Retrieve comprehensive metadata for a specific item by its ID. Metadata includes automatically extracted information such as file type, MIME type, encoding, line counts, file size, system information (user, hostname, process ID, etc.), cryptographic hashes (SHA256, MD5), and performance metrics (read time, read rate).",
|
||||
responses(
|
||||
|
||||
Reference in New Issue
Block a user