feat: geräte-tokens im konto, neuester clip für kurzbefehle
Token-Verwaltung unter "Konto" (einmalige Anzeige, letzte Nutzung, Widerruf), GET /api/clips/latest für iPhone-Kurzbefehle und Skripte, README mit Anleitung für die Kurzbefehle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d8377c8a04
commit
223eb4eb45
10 files changed
+505
-1
No files matched your search
@@ -90,6 +90,16 @@ def list_clips(
|
||||
return list(items), total or 0
|
||||
|
||||
|
||||
def latest_text_clip(db: Session, user_id: int) -> Clip | None:
|
||||
"""The most recently changed visible text or code clip, ignoring pinning."""
|
||||
return db.scalar(
|
||||
select(Clip)
|
||||
.where(visible_clip(user_id), Clip.kind != ClipKind.FILE)
|
||||
.order_by(Clip.updated_at.desc(), Clip.id.desc())
|
||||
.limit(1)
|
||||
)
|
||||
|
||||
|
||||
def get_clip(db: Session, user_id: int, clip_id: int) -> Clip | None:
|
||||
"""A clip the user may see (own or in a shared project), else None."""
|
||||
return db.scalar(select(Clip).where(Clip.id == clip_id, visible_clip(user_id)))
|
||||
|
||||
Reference in new issue
Block a user