8000 Subscribe to activity lexicons by rafaelbsky · Pull Request #3990 · bluesky-social/atproto · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Subscribe to activity lexicons #3990

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

Merged
merged 3 commits into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/red-lies-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@atproto/ozone": patch
"@atproto/bsky": patch
"@atproto/api": patch
"@atproto/pds": patch
---

Add activity subscription lexicons
20 changes: 19 additions & 1 deletion lexicons/app/bsky/actor/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@
"feedgens": { "type": "integer" },
"starterPacks": { "type": "integer" },
"labeler": { "type": "boolean" },
"chat": { "type": "ref", "ref": "#profileAssociatedChat" }
"chat": { "type": "ref", "ref": "#profileAssociatedChat" },
"activitySubscription": {
"type": "ref",
"ref": "#profileAssociatedActivitySubscription"
}
}
},
"profileAssociatedChat": {
Expand All @@ -142,6 +146,16 @@
}
}
},
"profileAssociatedActivitySubscription": {
"type": "object",
"required": ["allowSubscriptions"],
"properties": {
"allowSubscriptions": {
"type": "string",
"knownValues": ["followers", "mutuals", "none"]
}
}
},
"viewerState": {
"type": "object",
"description": "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.",
Expand All @@ -162,6 +176,10 @@
"knownFollowers": {
"type": "ref",
"ref": "#knownFollowers"
},
"activitySubscription": {
"type": "ref",
"ref": "app.bsky.notification.defs#activitySubscription"
}
}
},
Expand Down
22 changes: 22 additions & 0 deletions lexicons/app/bsky/notification/declaration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"lexicon": 1,
"id": "app.bsky.notification.declaration",
"defs": {
"main": {
"type": "record",
"description": "A declaration of the user's choices related to notifications that can be produced by them.",
"key": "literal:self",
"record": {
"type": "object",
"required": ["allowSubscriptions"],
"properties": {
"allowSubscriptions": {
"type": "string",
"description": "A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'.",
"knownValues": ["followers", "mutuals", "none"]
}
}
}
}
}
}
20 changes: 20 additions & 0 deletions lexicons/app/bsky/notification/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@
"unverified": { "type": "ref", "ref": "#preference" },
"verified": { "type": "ref", "ref": "#preference" }
}
},
"activitySubscription": {
"type": "object",
"required": ["post", "reply"],
"properties": {
"post": { "type": "boolean" },
"reply": { "type": "boolean" }
}
},
"subjectActivitySubscription": {
"description": "Object used to store activity subscription data in stash.",
"type": "object",
"required": ["subject", "activitySubscription"],
"properties": {
"subject": { "type": "string", "format": "did" },
"activitySubscription": {
"type": "ref",
"ref": "#activitySubscription"
}
}
}
}
}
39 changes: 39 additions & 0 deletions lexicons/app/bsky/notification/listActivitySubscriptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"lexicon": 1,
"id": "app.bsky.notification.listActivitySubscriptions",
"defs": {
"main": {
"type": "query",
"description": "Enumerate all accounts to which the requesting account is subscribed to receive notifications for. Requires auth.",
"parameters": {
"type": "params",
"properties": {
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": { "type": "string" }
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["subscriptions"],
"properties": {
"cursor": { "type": "string" },
"subscriptions": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileView"
}
}
}
}
}
}
}
}
38 changes: 38 additions & 0 deletions lexicons/app/bsky/notification/putActivitySubscription.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"lexicon": 1,
"id": "app.bsky.notification.putActivitySubscription",
"defs": {
"main": {
"type": "procedure",
"description": "Puts an activity subscription entry. The key should be omitted for creation and provided for updates. Requires auth.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["subject", "activitySubscription"],
"properties": {
"subject": { "type": "string", "format": "did" },
"activitySubscription": {
"type": "ref",
"ref": "app.bsky.notification.defs#activitySubscription"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["subject"],
"properties": {
"subject": { "type": "string", "format": "did" },
"activitySubscription": {
"type": "ref",
"ref": "app.bsky.notification.defs#activitySubscription"
}
}
}
}
}
}
}
120 changes: 111 additions & 9 deletions packages/api/src/client/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
0