From b1b5e6444cbc74fd10361166e5c2a310a24aa379 Mon Sep 17 00:00:00 2001 From: Bretton Date: Thu, 3 Jul 2025 17:10:02 -0700 Subject: [PATCH] Ensuring DID community references, simplifying error handling --- .../atproto/lexicon/social/coves/actor/blockUser.json | 8 ++++---- .../atproto/lexicon/social/coves/actor/membership.json | 4 ++-- internal/atproto/lexicon/social/coves/actor/saveItem.json | 8 ++++---- .../atproto/lexicon/social/coves/actor/subscription.json | 4 ++-- .../atproto/lexicon/social/coves/community/search.json | 2 +- .../atproto/lexicon/social/coves/community/subscribe.json | 8 ++++---- internal/atproto/lexicon/social/coves/moderation/ban.json | 4 ++-- .../atproto/lexicon/social/coves/moderation/banUser.json | 4 ++-- .../lexicon/social/coves/moderation/getBanStatus.json | 4 ++-- .../atproto/lexicon/social/coves/moderation/listBans.json | 4 ++-- .../lexicon/social/coves/moderation/ruleProposal.json | 4 ++-- .../lexicon/social/coves/moderation/unbanUser.json | 4 ++-- internal/atproto/lexicon/social/coves/post/article.json | 4 ++-- internal/atproto/lexicon/social/coves/post/create.json | 4 ++-- internal/atproto/lexicon/social/coves/post/getFeed.json | 2 +- internal/atproto/lexicon/social/coves/post/image.json | 4 ++-- internal/atproto/lexicon/social/coves/post/microblog.json | 4 ++-- internal/atproto/lexicon/social/coves/post/search.json | 2 +- internal/atproto/lexicon/social/coves/post/text.json | 4 ++-- internal/atproto/lexicon/social/coves/post/video.json | 4 ++-- 20 files changed, 43 insertions(+), 43 deletions(-) diff --git a/internal/atproto/lexicon/social/coves/actor/blockUser.json b/internal/atproto/lexicon/social/coves/actor/blockUser.json index 653d0a7..1a58bc7 100644 --- a/internal/atproto/lexicon/social/coves/actor/blockUser.json +++ b/internal/atproto/lexicon/social/coves/actor/blockUser.json @@ -40,6 +40,10 @@ "type": "string", "format": "cid", "description": "CID of the created block record" + }, + "existing": { + "type": "boolean", + "description": "True if user was already blocked" } } } @@ -48,10 +52,6 @@ { "name": "SubjectNotFound", "description": "Subject user not found" - }, - { - "name": "AlreadyBlocked", - "description": "User is already blocked" } ] } diff --git a/internal/atproto/lexicon/social/coves/actor/membership.json b/internal/atproto/lexicon/social/coves/actor/membership.json index 2ec5497..f3d33b7 100644 --- a/internal/atproto/lexicon/social/coves/actor/membership.json +++ b/internal/atproto/lexicon/social/coves/actor/membership.json @@ -12,8 +12,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community (DID-based)" + "format": "at-identifier", + "description": "DID or handle of the community" }, "reputation": { "type": "integer", diff --git a/internal/atproto/lexicon/social/coves/actor/saveItem.json b/internal/atproto/lexicon/social/coves/actor/saveItem.json index 90dcab1..6d1f629 100644 --- a/internal/atproto/lexicon/social/coves/actor/saveItem.json +++ b/internal/atproto/lexicon/social/coves/actor/saveItem.json @@ -44,6 +44,10 @@ "type": "string", "format": "cid", "description": "CID of the created saved record" + }, + "existing": { + "type": "boolean", + "description": "True if item was already saved" } } } @@ -52,10 +56,6 @@ { "name": "SubjectNotFound", "description": "The post or comment to save was not found" - }, - { - "name": "AlreadySaved", - "description": "Item is already saved" } ] } diff --git a/internal/atproto/lexicon/social/coves/actor/subscription.json b/internal/atproto/lexicon/social/coves/actor/subscription.json index 81b4537..37419b9 100644 --- a/internal/atproto/lexicon/social/coves/actor/subscription.json +++ b/internal/atproto/lexicon/social/coves/actor/subscription.json @@ -12,8 +12,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community (DID-based)" + "format": "at-identifier", + "description": "DID or handle of the community" }, "createdAt": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/community/search.json b/internal/atproto/lexicon/social/coves/community/search.json index 0e4d64c..98b203a 100644 --- a/internal/atproto/lexicon/social/coves/community/search.json +++ b/internal/atproto/lexicon/social/coves/community/search.json @@ -17,7 +17,7 @@ "type": "integer", "minimum": 1, "maximum": 100, - "default": 25 + "default": 50 }, "cursor": { "type": "string" diff --git a/internal/atproto/lexicon/social/coves/community/subscribe.json b/internal/atproto/lexicon/social/coves/community/subscribe.json index d0c5adb..4f56246 100644 --- a/internal/atproto/lexicon/social/coves/community/subscribe.json +++ b/internal/atproto/lexicon/social/coves/community/subscribe.json @@ -34,6 +34,10 @@ "type": "string", "format": "cid", "description": "CID of the created subscription record" + }, + "existing": { + "type": "boolean", + "description": "True if item was already subscribed" } } } @@ -43,10 +47,6 @@ "name": "CommunityNotFound", "description": "Community not found" }, - { - "name": "AlreadySubscribed", - "description": "Already subscribed to this community" - }, { "name": "Blocked", "description": "Cannot subscribe - you are blocked from this community" diff --git a/internal/atproto/lexicon/social/coves/moderation/ban.json b/internal/atproto/lexicon/social/coves/moderation/ban.json index 0515889..2a893d8 100644 --- a/internal/atproto/lexicon/social/coves/moderation/ban.json +++ b/internal/atproto/lexicon/social/coves/moderation/ban.json @@ -12,8 +12,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community" + "format": "at-identifier", + "description": "DID or handle of the community" }, "subject": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/moderation/banUser.json b/internal/atproto/lexicon/social/coves/moderation/banUser.json index cd35b46..4d307bb 100644 --- a/internal/atproto/lexicon/social/coves/moderation/banUser.json +++ b/internal/atproto/lexicon/social/coves/moderation/banUser.json @@ -13,8 +13,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community" + "format": "at-identifier", + "description": "DID or handle of the community" }, "subject": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/moderation/getBanStatus.json b/internal/atproto/lexicon/social/coves/moderation/getBanStatus.json index a01cd3e..7818cff 100644 --- a/internal/atproto/lexicon/social/coves/moderation/getBanStatus.json +++ b/internal/atproto/lexicon/social/coves/moderation/getBanStatus.json @@ -11,8 +11,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community" + "format": "at-identifier", + "description": "DID or handle of the community" }, "subject": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/moderation/listBans.json b/internal/atproto/lexicon/social/coves/moderation/listBans.json index 14510bc..0c2aeb9 100644 --- a/internal/atproto/lexicon/social/coves/moderation/listBans.json +++ b/internal/atproto/lexicon/social/coves/moderation/listBans.json @@ -11,8 +11,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community" + "format": "at-identifier", + "description": "DID or handle of the community" }, "status": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/moderation/ruleProposal.json b/internal/atproto/lexicon/social/coves/moderation/ruleProposal.json index 3448e14..768a989 100644 --- a/internal/atproto/lexicon/social/coves/moderation/ruleProposal.json +++ b/internal/atproto/lexicon/social/coves/moderation/ruleProposal.json @@ -12,8 +12,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community" + "format": "at-identifier", + "description": "DID or handle of the community" }, "proposalType": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/moderation/unbanUser.json b/internal/atproto/lexicon/social/coves/moderation/unbanUser.json index 724e3d7..bf63d21 100644 --- a/internal/atproto/lexicon/social/coves/moderation/unbanUser.json +++ b/internal/atproto/lexicon/social/coves/moderation/unbanUser.json @@ -13,8 +13,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community" + "format": "at-identifier", + "description": "DID or handle of the community" }, "subject": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/post/article.json b/internal/atproto/lexicon/social/coves/post/article.json index 7c7b63c..1e2a494 100644 --- a/internal/atproto/lexicon/social/coves/post/article.json +++ b/internal/atproto/lexicon/social/coves/post/article.json @@ -12,8 +12,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community this was posted to" + "format": "at-identifier", + "description": "DID or handle of the community this was posted to" }, "title": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/post/create.json b/internal/atproto/lexicon/social/coves/post/create.json index c0bbe1f..743aa2e 100644 --- a/internal/atproto/lexicon/social/coves/post/create.json +++ b/internal/atproto/lexicon/social/coves/post/create.json @@ -9,7 +9,7 @@ "encoding": "application/json", "schema": { "type": "object", - "required": ["community", "type"], + "required": ["community", "type", "title"], "properties": { "community": { "type": "string", @@ -30,7 +30,7 @@ "text": { "type": "string", "maxGraphemes": 10000, - "maxLength": 100000, + "maxLength": 40000, "description": "Post body text" }, "textMarkup": { diff --git a/internal/atproto/lexicon/social/coves/post/getFeed.json b/internal/atproto/lexicon/social/coves/post/getFeed.json index 58b6333..c63a4fe 100644 --- a/internal/atproto/lexicon/social/coves/post/getFeed.json +++ b/internal/atproto/lexicon/social/coves/post/getFeed.json @@ -29,7 +29,7 @@ "type": "integer", "minimum": 1, "maximum": 100, - "default": 25 + "default": 15 }, "cursor": { "type": "string" diff --git a/internal/atproto/lexicon/social/coves/post/image.json b/internal/atproto/lexicon/social/coves/post/image.json index c1339d5..f1a5f2f 100644 --- a/internal/atproto/lexicon/social/coves/post/image.json +++ b/internal/atproto/lexicon/social/coves/post/image.json @@ -12,8 +12,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community this was posted to" + "format": "at-identifier", + "description": "DID or handle of the community this was posted to" }, "title": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/post/microblog.json b/internal/atproto/lexicon/social/coves/post/microblog.json index 2b908a5..2704049 100644 --- a/internal/atproto/lexicon/social/coves/post/microblog.json +++ b/internal/atproto/lexicon/social/coves/post/microblog.json @@ -12,8 +12,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community this was posted to" + "format": "at-identifier", + "description": "DID or handle of the community this was posted to" }, "content": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/post/search.json b/internal/atproto/lexicon/social/coves/post/search.json index 6d8e683..1a83b75 100644 --- a/internal/atproto/lexicon/social/coves/post/search.json +++ b/internal/atproto/lexicon/social/coves/post/search.json @@ -49,7 +49,7 @@ "type": "integer", "minimum": 1, "maximum": 100, - "default": 25 + "default": 50 }, "cursor": { "type": "string" diff --git a/internal/atproto/lexicon/social/coves/post/text.json b/internal/atproto/lexicon/social/coves/post/text.json index 3a98bf8..0928f51 100644 --- a/internal/atproto/lexicon/social/coves/post/text.json +++ b/internal/atproto/lexicon/social/coves/post/text.json @@ -12,8 +12,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community this was posted to" + "format": "at-identifier", + "description": "DID or handle of the community this was posted to" }, "title": { "type": "string", diff --git a/internal/atproto/lexicon/social/coves/post/video.json b/internal/atproto/lexicon/social/coves/post/video.json index 331e793..c9aa247 100644 --- a/internal/atproto/lexicon/social/coves/post/video.json +++ b/internal/atproto/lexicon/social/coves/post/video.json @@ -12,8 +12,8 @@ "properties": { "community": { "type": "string", - "format": "at-uri", - "description": "AT-URI of the community this was posted to" + "format": "at-identifier", + "description": "DID or handle of the community this was posted to" }, "title": { "type": "string", -- 2.51.2