Skip to content

Commit

Permalink
Starter packs (bluesky-social#2553)
Browse files Browse the repository at this point in the history
* lexicon: initial starter pack record lexicons

* lexicon: first pass on views for starter packs

* lexicon: add starter pack query endpoints, misc fixes

* lexicon: add starter pack related fields to profile views

* lexicon: codegen

* api prerelease

* bsky: protos for starter packs

* appview: implement starter pack endpoints in dataplane, protos update

* appview: starter pack hydration and view, mock dataplane indexing

* appview: wire-up starter pack graph endpoints

* appview: test basic starter packs functionality, update dev-env

* fix snaps for profile createdAt

* appview: fix list item count for starter packs in dataplane

* fix ozone snaps, tidy

* appview: reorg list aggs for starter packs

* appview: starter pack lexicon and proto tweaks, move around aggregations

* appview: fix views and snaps

* api prerelease

* fix snaps

* appview: misc proto updates for starter packs, snaps

* appview: add starter pack counts to profile detail

* build

* api prerelease

* pds: starter pack slur detection

* lexicon: starter pack notifications and batch fetch

* appview: starter pack notification and batch fetch

* appview: add starterpack-joined notif to dataplane and test

* api prerelease

* ozone: fix snaps

* pds build

* ✨ Proxy starterpack requests through ozone and include takedowns (bluesky-social#2594)

* ✨ Proxy starterpack requests through ozone and include takedowns

* 🧹 Cleanup

* ✅ Commit snapshots

* ✅ Update snapshot

* lexicon: move starterpacks back to TIDs

* changeset

---------

Co-authored-by: Foysal Ahamed <[email protected]>
devinivy and foysalit authored Jun 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent fc10881 commit af7d391
Showing 114 changed files with 5,935 additions and 42 deletions.
9 changes: 9 additions & 0 deletions .changeset/lemon-peaches-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@atproto/dev-env": patch
"@atproto/ozone": patch
"@atproto/bsky": patch
"@atproto/api": patch
"@atproto/pds": patch
---

Support for starter packs (app.bsky.graph.starterpack)
1 change: 1 addition & 0 deletions .github/workflows/build-and-push-bsky-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ on:
push:
branches:
- main
- divy/starter-packs
env:
REGISTRY: ghcr.io
USERNAME: ${{ github.actor }}
1 change: 1 addition & 0 deletions .github/workflows/build-and-push-pds-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ on:
push:
branches:
- main
- divy/starter-packs
env:
REGISTRY: ghcr.io
USERNAME: ${{ github.actor }}
10 changes: 9 additions & 1 deletion lexicons/app/bsky/actor/defs.json
Original file line number Diff line number Diff line change
@@ -22,7 +22,8 @@
"labels": {
"type": "array",
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
}
},
"createdAt": { "type": "string", "format": "datetime" }
}
},
"profileView": {
@@ -47,6 +48,7 @@
"ref": "#profileAssociated"
},
"indexedAt": { "type": "string", "format": "datetime" },
"createdAt": { "type": "string", "format": "datetime" },
"viewer": { "type": "ref", "ref": "#viewerState" },
"labels": {
"type": "array",
@@ -79,7 +81,12 @@
"type": "ref",
"ref": "#profileAssociated"
},
"joinedViaStarterPack": {
"type": "ref",
"ref": "app.bsky.graph.defs#starterPackViewBasic"
},
"indexedAt": { "type": "string", "format": "datetime" },
"createdAt": { "type": "string", "format": "datetime" },
"viewer": { "type": "ref", "ref": "#viewerState" },
"labels": {
"type": "array",
@@ -92,6 +99,7 @@
"properties": {
"lists": { "type": "integer" },
"feedgens": { "type": "integer" },
"starterPacks": { "type": "integer" },
"labeler": { "type": "boolean" },
"chat": { "type": "ref", "ref": "#profileAssociatedChat" }
}
7 changes: 6 additions & 1 deletion lexicons/app/bsky/actor/profile.json
Original file line number Diff line number Diff line change
@@ -36,7 +36,12 @@
"type": "union",
"description": "Self-label values, specific to the Bluesky application, on the overall account.",
"refs": ["com.atproto.label.defs#selfLabels"]
}
},
"joinedViaStarterPack": {
"type": "ref",
"ref": "com.atproto.repo.strongRef"
},
"createdAt": { "type": "string", "format": "datetime" }
}
}
}
61 changes: 60 additions & 1 deletion lexicons/app/bsky/graph/defs.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
"name": { "type": "string", "maxLength": 64, "minLength": 1 },
"purpose": { "type": "ref", "ref": "#listPurpose" },
"avatar": { "type": "string", "format": "uri" },
"listItemCount": { "type": "integer", "minimum": 0 },
"labels": {
"type": "array",
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
@@ -38,6 +39,7 @@
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"avatar": { "type": "string", "format": "uri" },
"listItemCount": { "type": "integer", "minimum": 0 },
"labels": {
"type": "array",
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
@@ -54,11 +56,64 @@
"subject": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" }
}
},
"starterPackView": {
"type": "object",
"required": ["uri", "cid", "record", "creator", "indexedAt"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"record": { "type": "unknown" },
"creator": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileViewBasic"
},
"list": { "type": "ref", "ref": "#listViewBasic" },
"listItemsSample": {
"type": "array",
"maxLength": 12,
"items": { "type": "ref", "ref": "#listItemView" }
},
"feeds": {
"type": "array",
"maxLength": 3,
"items": { "type": "ref", "ref": "app.bsky.feed.defs#generatorView" }
},
"joinedWeekCount": { "type": "integer", "minimum": 0 },
"joinedAllTimeCount": { "type": "integer", "minimum": 0 },
"labels": {
"type": "array",
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
},
"indexedAt": { "type": "string", "format": "datetime" }
}
},
"starterPackViewBasic": {
"type": "object",
"required": ["uri", "cid", "record", "creator", "indexedAt"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"record": { "type": "unknown" },
"creator": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileViewBasic"
},
"listItemCount": { "type": "integer", "minimum": 0 },
"joinedWeekCount": { "type": "integer", "minimum": 0 },
"joinedAllTimeCount": { "type": "integer", "minimum": 0 },
"labels": {
"type": "array",
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
},
"indexedAt": { "type": "string", "format": "datetime" }
}
},
"listPurpose": {
"type": "string",
"knownValues": [
"app.bsky.graph.defs#modlist",
"app.bsky.graph.defs#curatelist"
"app.bsky.graph.defs#curatelist",
"app.bsky.graph.defs#referencelist"
]
},
"modlist": {
@@ -69,6 +124,10 @@
"type": "token",
"description": "A list of actors used for curation purposes such as list feeds or interaction gating."
},
"referencelist": {
"type": "token",
"description": "A list of actors used for only for reference purposes such as within a starter pack."
},
"listViewerState": {
"type": "object",
"properties": {
41 changes: 41 additions & 0 deletions lexicons/app/bsky/graph/getActorStarterPacks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"lexicon": 1,
"id": "app.bsky.graph.getActorStarterPacks",
"defs": {
"main": {
"type": "query",
"description": "Get a list of starter packs created by the actor.",
"parameters": {
"type": "params",
"required": ["actor"],
"properties": {
"actor": { "type": "string", "format": "at-identifier" },
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": { "type": "string" }
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["starterPacks"],
"properties": {
"cursor": { "type": "string" },
"starterPacks": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.graph.defs#starterPackViewBasic"
}
}
}
}
}
}
}
}
34 changes: 34 additions & 0 deletions lexicons/app/bsky/graph/getStarterPack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"lexicon": 1,
"id": "app.bsky.graph.getStarterPack",
"defs": {
"main": {
"type": "query",
"description": "Gets a view of a starter pack.",
"parameters": {
"type": "params",
"required": ["starterPack"],
"properties": {
"starterPack": {
"type": "string",
"format": "at-uri",
"description": "Reference (AT-URI) of the starter pack record."
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["starterPack"],
"properties": {
"starterPack": {
"type": "ref",
"ref": "app.bsky.graph.defs#starterPackView"
}
}
}
}
}
}
}
37 changes: 37 additions & 0 deletions lexicons/app/bsky/graph/getStarterPacks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"lexicon": 1,
"id": "app.bsky.graph.getStarterPacks",
"defs": {
"main": {
"type": "query",
"description": "Get views for a list of starter packs.",
"parameters": {
"type": "params",
"required": ["uris"],
"properties": {
"uris": {
"type": "array",
"items": { "type": "string", "format": "at-uri" },
"maxLength": 25
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["starterPacks"],
"properties": {
"starterPacks": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.graph.defs#starterPackViewBasic"
}
}
}
}
}
}
}
}
51 changes: 51 additions & 0 deletions lexicons/app/bsky/graph/starterpack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"lexicon": 1,
"id": "app.bsky.graph.starterpack",
"defs": {
"main": {
"type": "record",
"description": "Record defining a starter pack of actors and feeds for new users.",
"key": "tid",
"record": {
"type": "object",
"required": ["name", "list", "createdAt"],
"properties": {
"name": {
"type": "string",
"maxGraphemes": 50,
"maxLength": 500,
"minLength": 1,
"description": "Display name for starter pack; can not be empty."
},
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"list": {
"type": "string",
"format": "at-uri",
"description": "Reference (AT-URI) to the list record."
},
"feeds": {
"type": "array",
"maxLength": 3,
"items": { "type": "ref", "ref": "#feedItem" }
},
"createdAt": { "type": "string", "format": "datetime" }
}
}
},
"feedItem": {
"type": "object",
"required": ["uri"],
"properties": {
"uri": { "type": "string", "format": "at-uri" }
}
}
}
}
5 changes: 3 additions & 2 deletions lexicons/app/bsky/notification/listNotifications.json
Original file line number Diff line number Diff line change
@@ -51,14 +51,15 @@
"author": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
"reason": {
"type": "string",
"description": "Expected values are 'like', 'repost', 'follow', 'mention', 'reply', and 'quote'.",
"description": "Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', and 'starterpack-joined'.",
"knownValues": [
"like",
"repost",
"follow",
"mention",
"reply",
"quote"
"quote",
"starterpack-joined"
]
},
"reasonSubject": { "type": "string", "format": "at-uri" },
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@atproto/api",
"version": "0.12.21",
"version": "0.12.22-next.0",
"license": "MIT",
"description": "Client library for atproto and Bluesky",
"keywords": [
Loading

0 comments on commit af7d391

Please sign in to comment.