feat: public text items, wall, and detail API
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
TTLOption = Literal["1h", "24h", "7d", "never"]
|
||||
|
||||
|
||||
class ItemCreate(BaseModel):
|
||||
body: str = Field(min_length=1)
|
||||
title: str | None = None
|
||||
is_public: bool = True
|
||||
burn_after_read: bool = False
|
||||
ttl: TTLOption = "24h"
|
||||
|
||||
|
||||
class ItemOut(BaseModel):
|
||||
slug: str
|
||||
kind: str
|
||||
title: str
|
||||
body: str | None = None
|
||||
file_name: str | None = None
|
||||
mime: str | None = None
|
||||
size_bytes: int | None = None
|
||||
is_public: bool
|
||||
burn_after_read: bool
|
||||
expires_at: datetime | None
|
||||
created_at: datetime
|
||||
view_count: int
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class WallResponse(BaseModel):
|
||||
items: list[ItemOut]
|
||||
page: int
|
||||
page_size: int
|
||||
total: int
|
||||
Reference in New Issue
Block a user