-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feed interactions schema #2383
Feed interactions schema #2383
Changes from all commits
dab4b7c
8675460
687d104
027898a
1b291d4
4b396e6
058552a
e354a59
ed16ef4
afb791f
5cee1b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@atproto/api': patch | ||
--- | ||
|
||
Added feed generator interaction lexicons |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,12 @@ | |
"properties": { | ||
"post": { "type": "ref", "ref": "#postView" }, | ||
"reply": { "type": "ref", "ref": "#replyRef" }, | ||
"reason": { "type": "union", "refs": ["#reasonRepost"] } | ||
"reason": { "type": "union", "refs": ["#reasonRepost"] }, | ||
"feedContext": { | ||
"type": "string", | ||
"description": "Context provided by feed generator that may be passed back alongside interactions.", | ||
"maxLength": 2000 | ||
} | ||
} | ||
}, | ||
"replyRef": { | ||
|
@@ -137,6 +142,7 @@ | |
}, | ||
"avatar": { "type": "string", "format": "uri" }, | ||
"likeCount": { "type": "integer", "minimum": 0 }, | ||
"acceptsInteractions": { "type": "boolean" }, | ||
"labels": { | ||
"type": "array", | ||
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" } | ||
|
@@ -156,7 +162,12 @@ | |
"required": ["post"], | ||
"properties": { | ||
"post": { "type": "string", "format": "at-uri" }, | ||
"reason": { "type": "union", "refs": ["#skeletonReasonRepost"] } | ||
"reason": { "type": "union", "refs": ["#skeletonReasonRepost"] }, | ||
"feedContext": { | ||
"type": "string", | ||
"description": "Context that will be passed through to client and may be passed to feed generator back alongside interactions.", | ||
"maxLength": 2000 | ||
} | ||
} | ||
}, | ||
"skeletonReasonRepost": { | ||
|
@@ -177,6 +188,82 @@ | |
"items": { "type": "ref", "ref": "app.bsky.graph.defs#listViewBasic" } | ||
} | ||
} | ||
}, | ||
"interaction": { | ||
"type": "object", | ||
"properties": { | ||
"item": { "type": "string", "format": "at-uri" }, | ||
"event": { | ||
"type": "string", | ||
"knownValues": [ | ||
Comment on lines
+196
to
+198
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you have any thoughts on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup that was my first pass on it but then ended up redoing it this way. Mainly reconsidered because an array of open unions is tough in languages like Go. But also nearly all these interaction types had similar values on them so they were pretty friendly to squash down into a flat object like this so didn't seem like any resolution was lost |
||
"app.bsky.feed.defs#requestLess", | ||
"app.bsky.feed.defs#requestMore", | ||
"app.bsky.feed.defs#clickthroughItem", | ||
"app.bsky.feed.defs#clickthroughAuthor", | ||
"app.bsky.feed.defs#clickthroughReposter", | ||
"app.bsky.feed.defs#clickthroughEmbed", | ||
"app.bsky.feed.defs#interactionSeen", | ||
"app.bsky.feed.defs#interactionLike", | ||
"app.bsky.feed.defs#interactionRepost", | ||
"app.bsky.feed.defs#interactionReply", | ||
"app.bsky.feed.defs#interactionQuote", | ||
"app.bsky.feed.defs#interactionShare" | ||
] | ||
}, | ||
"feedContext": { | ||
"type": "string", | ||
"description": "Context on a feed item that was orginally supplied by the feed generator on getFeedSkeleton.", | ||
"maxLength": 2000 | ||
} | ||
} | ||
}, | ||
"requestLess": { | ||
"type": "token", | ||
"description": "Request that less content like the given feed item be shown in the feed" | ||
}, | ||
"requestMore": { | ||
"type": "token", | ||
"description": "Request that more content like the given feed item be shown in the feed" | ||
}, | ||
"clickthroughItem": { | ||
"type": "token", | ||
"description": "User clicked through to the feed item" | ||
}, | ||
"clickthroughAuthor": { | ||
"type": "token", | ||
"description": "User clicked through to the author of the feed item" | ||
}, | ||
"clickthroughReposter": { | ||
"type": "token", | ||
"description": "User clicked through to the reposter of the feed item" | ||
}, | ||
"clickthroughEmbed": { | ||
"type": "token", | ||
"description": "User clicked through to the embedded content of the feed item" | ||
}, | ||
"interactionSeen": { | ||
"type": "token", | ||
"description": "Feed item was seen by user" | ||
}, | ||
"interactionLike": { | ||
"type": "token", | ||
"description": "User liked the feed item" | ||
}, | ||
"interactionRepost": { | ||
"type": "token", | ||
"description": "User reposted the feed item" | ||
}, | ||
"interactionReply": { | ||
"type": "token", | ||
"description": "User replied to the feed item" | ||
}, | ||
"interactionQuote": { | ||
"type": "token", | ||
"description": "User quoted the feed item" | ||
}, | ||
"interactionShare": { | ||
"type": "token", | ||
"description": "User shared the feed item" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.feed.sendInteractions", | ||
"defs": { | ||
"main": { | ||
"type": "procedure", | ||
"description": "Send information about interactions with feed items back to the feed generator that served them.", | ||
"input": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["interactions"], | ||
"properties": { | ||
"interactions": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "app.bsky.feed.defs#interaction" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"properties": {} | ||
} | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this generally be either a post or repost URI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now I was thinking it would always be the post uri & any repost that got it in there would be associated through the
feedContext
that gets sent around 🤔I left it somewhat vague because I think it's likely we'll start passing down non-post objects in feeds at some point