From 5bf7a98b2fae77e7ec2e0ca6452193d03eb5511c Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Tue, 21 Jul 2026 15:55:29 +0900 Subject: [PATCH] lexicons: `feed.getTimeline` Signed-off-by: Seongmin Lee --- lexicons/actor/defs.json | 37 +++++++++++++ lexicons/feed/getTimeline.json | 98 ++++++++++++++++++++++++++++++++++ lexicons/repo/defs.json | 27 ++++++++++ 3 files changed, 162 insertions(+) create mode 100644 lexicons/actor/defs.json create mode 100644 lexicons/feed/getTimeline.json create mode 100644 lexicons/repo/defs.json diff --git a/lexicons/actor/defs.json b/lexicons/actor/defs.json new file mode 100644 index 00000000..6d58715e --- /dev/null +++ b/lexicons/actor/defs.json @@ -0,0 +1,37 @@ +{ + "lexicon": 1, + "id": "sh.tangled.actor.defs", + "defs": { + "profileViewBasic": { + "type": "object", + "required": ["did", "handle"], + "properties": { + "did": { "type": "string", "format": "did" }, + "handle": { "type": "string", "format": "handle" }, + "avatar": { "type": "string", "format": "uri" }, + "viewer": { "type": "ref", "ref": "#viewerState" } + } + }, + "profileViewDetailed": { + "type": "object", + "description": "profileViewBaisc + follow counts", + "required": ["did", "handle"], + "properties": { + "did": { "type": "string", "format": "did" }, + "handle": { "type": "string", "format": "handle" }, + "avatar": { "type": "string", "format": "uri" }, + "followersCount": { "type": "integer" }, + "followsCount": { "type": "integer" }, + "viewer": { "type": "ref", "ref": "#viewerState" } + } + }, + "viewerState": { + "type": "object", + "description": "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.", + "properties": { + "following": { "type": "string", "format": "at-uri" }, + "followedBy": { "type": "string", "format": "at-uri" } + } + } + } +} diff --git a/lexicons/feed/getTimeline.json b/lexicons/feed/getTimeline.json new file mode 100644 index 00000000..8536fbb4 --- /dev/null +++ b/lexicons/feed/getTimeline.json @@ -0,0 +1,98 @@ +{ + "lexicon": 1, + "id": "sh.tangled.feed.getTimeline", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "properties": { + "viewer": { + "type": "string", + "format": "did", + "description": "TODO: deprecate this and use auth instead." + }, + "followingOnly": { "type": "boolean" }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50 + }, + "cursor": { "type": "string" } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["feed"], + "properties": { + "feed": { + "type": "array", + "items": { "type": "ref", "ref": "#timelineItem" } + }, + "cursor": { "type": "string" } + } + } + }, + "errors": [] + }, + "timelineItem": { + "type": "object", + "required": ["eventAt", "event"], + "properties": { + "eventAt": { "type": "string", "format": "datetime" }, + "event": { + "type": "union", + "refs": ["#repoEvent", "#starEvent", "#followEvent"] + } + } + }, + "repoEvent": { + "type": "object", + "description": "A repository was created (or forked). The actor is repo.owner.", + "required": ["uri", "cid", "repo"], + "properties": { + "uri": { "type": "string", "format": "at-uri" }, + "cid": { "type": "string", "format": "cid" }, + "repo": { "type": "ref", "ref": "sh.tangled.repo.defs#repoViewBasic" }, + "source": { + "type": "ref", + "ref": "sh.tangled.repo.defs#repoViewBasic", + "description": "Fork parent, present only if this repo is a fork." + } + } + }, + "starEvent": { + "type": "object", + "description": "A repository was starred.", + "required": ["uri", "cid", "actor", "repo"], + "properties": { + "uri": { "type": "string", "format": "at-uri" }, + "cid": { "type": "string", "format": "cid" }, + "actor": { + "type": "ref", + "ref": "sh.tangled.actor.defs#profileViewBasic", + "description": "Who starred." + }, + "repo": { + "type": "ref", + "ref": "sh.tangled.repo.defs#repoViewBasic", + "description": "The starred repo." + } + } + }, + "followEvent": { + "type": "object", + "description": "A user followed another user.", + "required": ["uri", "cid", "actor", "subject"], + "properties": { + "uri": { "type": "string", "format": "at-uri" }, + "cid": { "type": "string", "format": "cid" }, + "actor": { "type": "ref", "ref": "sh.tangled.actor.defs#profileViewBasic" }, + "subject": { "type": "ref", "ref": "sh.tangled.actor.defs#profileViewDetailed" } + } + } + } +} diff --git a/lexicons/repo/defs.json b/lexicons/repo/defs.json new file mode 100644 index 00000000..61494df5 --- /dev/null +++ b/lexicons/repo/defs.json @@ -0,0 +1,27 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.defs", + "defs": { + "repoViewBasic": { + "type": "object", + "required": ["did", "owner", "slug", "createdAt"], + "properties": { + "did": { "type": "string", "format": "did" }, + "owner": { "type": "ref", "ref": "sh.tangled.actor.defs#profileViewBasic" }, + "slug": { "type": "string" }, + "description": { "type": "string" }, + "createdAt": { "type": "string", "format": "datetime" }, + "starCount": { "type": "integer" }, + "viewer": { "type": "ref", "ref": "#viewerState" }, + "isStarred": { "type": "boolean" } + } + }, + "viewerState": { + "type": "object", + "description": "Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.", + "properties": { + "star": { "type": "string", "format": "at-uri" } + } + } + } +} -- 2.51.2