From 559c55145fea2159e52fad069bc9c35fb93a1847 Mon Sep 17 00:00:00 2001 From: penny Date: Fri, 11 Jul 2025 18:10:29 -0400 Subject: [PATCH] [lexicons] create blanks for new fetcher APIs --- lexdocs/social/clippr/actor/getPreferences.json | 0 lexdocs/social/clippr/feed/defs.json | 7 +++++++ lexdocs/social/clippr/feed/getClips.json | 0 lexdocs/social/clippr/feed/getProfileFeed.json | 0 lexdocs/social/clippr/feed/getTagList.json | 0 lexdocs/social/clippr/feed/getTags.json | 0 6 files changed, 7 insertions(+) create mode 100644 lexdocs/social/clippr/actor/getPreferences.json create mode 100644 lexdocs/social/clippr/feed/defs.json create mode 100644 lexdocs/social/clippr/feed/getClips.json create mode 100644 lexdocs/social/clippr/feed/getProfileFeed.json create mode 100644 lexdocs/social/clippr/feed/getTagList.json create mode 100644 lexdocs/social/clippr/feed/getTags.json diff --git a/lexdocs/social/clippr/actor/getPreferences.json b/lexdocs/social/clippr/actor/getPreferences.json new file mode 100644 index 0000000..e69de29 diff --git a/lexdocs/social/clippr/feed/defs.json b/lexdocs/social/clippr/feed/defs.json new file mode 100644 index 0000000..770056a --- /dev/null +++ b/lexdocs/social/clippr/feed/defs.json @@ -0,0 +1,7 @@ +{ + "lexicon": 1, + "id": "social.clippr.feed.defs", + "defs": { + + } +} \ No newline at end of file diff --git a/lexdocs/social/clippr/feed/getClips.json b/lexdocs/social/clippr/feed/getClips.json new file mode 100644 index 0000000..e69de29 diff --git a/lexdocs/social/clippr/feed/getProfileFeed.json b/lexdocs/social/clippr/feed/getProfileFeed.json new file mode 100644 index 0000000..e69de29 diff --git a/lexdocs/social/clippr/feed/getTagList.json b/lexdocs/social/clippr/feed/getTagList.json new file mode 100644 index 0000000..e69de29 diff --git a/lexdocs/social/clippr/feed/getTags.json b/lexdocs/social/clippr/feed/getTags.json new file mode 100644 index 0000000..e69de29 -- 2.43.0 From 8542f900bfcd9326af1de00c3087ac8126f362b0 Mon Sep 17 00:00:00 2001 From: penny Date: Fri, 11 Jul 2025 18:13:17 -0400 Subject: [PATCH] [lexicons] create blanks for a few PUT APIs --- lexdocs/social/clippr/actor/putPreferences.json | 0 lexdocs/social/clippr/actor/putProfile.json | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 lexdocs/social/clippr/actor/putPreferences.json create mode 100644 lexdocs/social/clippr/actor/putProfile.json diff --git a/lexdocs/social/clippr/actor/putPreferences.json b/lexdocs/social/clippr/actor/putPreferences.json new file mode 100644 index 0000000..e69de29 diff --git a/lexdocs/social/clippr/actor/putProfile.json b/lexdocs/social/clippr/actor/putProfile.json new file mode 100644 index 0000000..e69de29 -- 2.43.0 From ce00b6b0e546731c26fde450dc15ed85e1af381a Mon Sep 17 00:00:00 2001 From: penny Date: Fri, 11 Jul 2025 18:13:27 -0400 Subject: [PATCH] [lexicons] create blanks for some search APIs --- lexdocs/social/clippr/actor/searchProfiles.json | 0 lexdocs/social/clippr/feed/searchClips.json | 0 lexdocs/social/clippr/feed/searchTags.json | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 lexdocs/social/clippr/actor/searchProfiles.json create mode 100644 lexdocs/social/clippr/feed/searchClips.json create mode 100644 lexdocs/social/clippr/feed/searchTags.json diff --git a/lexdocs/social/clippr/actor/searchProfiles.json b/lexdocs/social/clippr/actor/searchProfiles.json new file mode 100644 index 0000000..e69de29 diff --git a/lexdocs/social/clippr/feed/searchClips.json b/lexdocs/social/clippr/feed/searchClips.json new file mode 100644 index 0000000..e69de29 diff --git a/lexdocs/social/clippr/feed/searchTags.json b/lexdocs/social/clippr/feed/searchTags.json new file mode 100644 index 0000000..e69de29 -- 2.43.0 From de9c15a86e74a9ae1458d2cec7776d334080a4d5 Mon Sep 17 00:00:00 2001 From: penny Date: Fri, 11 Jul 2025 20:37:11 -0400 Subject: [PATCH] [lexicons] finish up actor lexicons --- lexdocs/social/clippr/actor/defs.json | 24 +++++++++++ .../social/clippr/actor/getPreferences.json | 29 +++++++++++++ .../social/clippr/actor/putPreferences.json | 23 ++++++++++ lexdocs/social/clippr/actor/putProfile.json | 0 .../social/clippr/actor/searchProfiles.json | 43 +++++++++++++++++++ 5 files changed, 119 insertions(+) delete mode 100644 lexdocs/social/clippr/actor/putProfile.json diff --git a/lexdocs/social/clippr/actor/defs.json b/lexdocs/social/clippr/actor/defs.json index 6ff3e8a..9843567 100644 --- a/lexdocs/social/clippr/actor/defs.json +++ b/lexdocs/social/clippr/actor/defs.json @@ -38,6 +38,30 @@ "format": "datetime" } } + }, + "preferences": { + "type": "array", + "description": "An array of preference types", + "refs": [ + "#publishingScopesPref" + ] + }, + "publishingScopesPref": { + "type": "object", + "description": "Preferences for an user's publishing scopes", + "required": [ + "defaultScope" + ], + "properties": { + "defaultScope": { + "type": "string", + "knownValues": [ + "public", + "unlisted" + ], + "description": "What publishing scope to mark a clip as by default." + } + } } } } diff --git a/lexdocs/social/clippr/actor/getPreferences.json b/lexdocs/social/clippr/actor/getPreferences.json index e69de29..203d693 100644 --- a/lexdocs/social/clippr/actor/getPreferences.json +++ b/lexdocs/social/clippr/actor/getPreferences.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "social.clippr.actor.getPreferences", + "defs": { + "main": { + "type": "query", + "description": "Get the private user preferences associated to the account.", + "parameters": { + "type": "params", + "properties": {} + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "preferences" + ], + "properties": { + "preferences": { + "type": "ref", + "ref": "social.clippr.actor.defs#preferences" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/lexdocs/social/clippr/actor/putPreferences.json b/lexdocs/social/clippr/actor/putPreferences.json index e69de29..60f1aec 100644 --- a/lexdocs/social/clippr/actor/putPreferences.json +++ b/lexdocs/social/clippr/actor/putPreferences.json @@ -0,0 +1,23 @@ +{ + "lexicon": 1, + "id": "social.clippr.actor.putPreferences", + "defs": { + "main": { + "type": "procedure", + "description": "Set the private preferences attached to the account.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["preferences"], + "properties": { + "preferences": { + "type": "ref", + "ref": "social.clippr.actor.defs#preferences" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/lexdocs/social/clippr/actor/putProfile.json b/lexdocs/social/clippr/actor/putProfile.json deleted file mode 100644 index e69de29..0000000 diff --git a/lexdocs/social/clippr/actor/searchProfiles.json b/lexdocs/social/clippr/actor/searchProfiles.json index e69de29..79fc882 100644 --- a/lexdocs/social/clippr/actor/searchProfiles.json +++ b/lexdocs/social/clippr/actor/searchProfiles.json @@ -0,0 +1,43 @@ +{ + "lexicon": 1, + "id": "social.clippr.actor.searchProfiles", + "defs": { + "main": { + "type": "query", + "description": "Find profiles matching search criteria. Does not require auth.", + "parameters": { + "type": "params", + "properties": { + "q": { + "type": "string", + "description": "Search query string." + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 25 + }, + "cursor": { "type": "string" } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["actors"], + "properties": { + "cursor": { "type": "string" }, + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "social.clippr.actor.defs#profileView" + } + } + } + } + } + } + } +} \ No newline at end of file -- 2.43.0 From 9965b6c49cdd5c2afd00c224333ff730252a200f Mon Sep 17 00:00:00 2001 From: penny Date: Sat, 19 Jul 2025 02:01:10 -0400 Subject: [PATCH] [lexicons] add json schema for lexicons (thanks to @justdavi.dev!) --- .idea/jsonSchemas.xml | 27 +++++++++++++++++++++++++++ backend/README.md | 6 +++--- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .idea/jsonSchemas.xml diff --git a/.idea/jsonSchemas.xml b/.idea/jsonSchemas.xml new file mode 100644 index 0000000..1fc07ba --- /dev/null +++ b/.idea/jsonSchemas.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/backend/README.md b/backend/README.md index 42bc1d8..369d7a1 100644 --- a/backend/README.md +++ b/backend/README.md @@ -24,9 +24,9 @@ pnpm run start ## current status right now we're not running on bun because there are -[some issues with partysocket](https://github.com/oven-sh/bun/issues/18807), which haven't -been fixed yet and which the jetstream library we use depends on for the moment. once it has been fixed, we do plan -to use bun over node in the future. +[some issues with partysocket](https://github.com/oven-sh/bun/issues/18807), which haven't been +fixed yet and which the jetstream library we use depends on for the moment. once it has been fixed, +we do plan to use bun over node in the future. ### checklist before it's usable -- 2.43.0 From b8ddef8851560a7251ef9eba5756d65b8e9afb81 Mon Sep 17 00:00:00 2001 From: penny Date: Sun, 20 Jul 2025 07:26:51 -0400 Subject: [PATCH] [lexdocs] create all remaining lexicons --- lexdocs/social/clippr/actor/defs.json | 32 ++-- .../social/clippr/actor/getPreferences.json | 7 +- lexdocs/social/clippr/actor/getProfile.json | 57 +++--- lexdocs/social/clippr/actor/profile.json | 91 ++++----- .../social/clippr/actor/putPreferences.json | 9 +- .../social/clippr/actor/searchProfiles.json | 93 +++++----- lexdocs/social/clippr/feed/clip.json | 172 +++++++++--------- lexdocs/social/clippr/feed/defs.json | 77 +++++++- lexdocs/social/clippr/feed/getClips.json | 46 +++++ .../social/clippr/feed/getProfileClips.json | 65 +++++++ .../social/clippr/feed/getProfileFeed.json | 0 .../social/clippr/feed/getProfileTags.json | 55 ++++++ lexdocs/social/clippr/feed/getTagList.json | 39 ++++ lexdocs/social/clippr/feed/getTags.json | 46 +++++ lexdocs/social/clippr/feed/searchClips.json | 61 +++++++ lexdocs/social/clippr/feed/searchTags.json | 61 +++++++ lexdocs/social/clippr/feed/tag.json | 86 +++++---- 17 files changed, 738 insertions(+), 259 deletions(-) create mode 100644 lexdocs/social/clippr/feed/getProfileClips.json delete mode 100644 lexdocs/social/clippr/feed/getProfileFeed.json create mode 100644 lexdocs/social/clippr/feed/getProfileTags.json diff --git a/lexdocs/social/clippr/actor/defs.json b/lexdocs/social/clippr/actor/defs.json index 9843567..01ae094 100644 --- a/lexdocs/social/clippr/actor/defs.json +++ b/lexdocs/social/clippr/actor/defs.json @@ -4,6 +4,7 @@ "defs": { "profileView": { "type": "object", + "description": "A view of an actor's profile.", "required": [ "did", "handle" @@ -11,40 +12,49 @@ "properties": { "did": { "type": "string", - "format": "did" + "format": "did", + "description": "The DID of the profile" }, "handle": { "type": "string", - "format": "handle" + "format": "handle", + "description": "The handle of the profile" }, "displayName": { "type": "string", "minGraphemes": 1, "minLength": 10, "maxGraphemes": 64, - "maxLength": 640 + "maxLength": 640, + "description": "The display name associated to the profile" }, "description": { "type": "string", "maxGraphemes": 500, - "maxLength": 5000 + "maxLength": 5000, + "description": "The biography associated to the profile" }, "avatar": { "type": "string", - "format": "uri" + "format": "uri", + "description": "A link to the profile's avatar" }, "createdAt": { "type": "string", - "format": "datetime" + "format": "datetime", + "description": "When the profile record was first created" } } }, "preferences": { "type": "array", - "description": "An array of preference types", - "refs": [ - "#publishingScopesPref" - ] + "description": "An array of refs to various preferences", + "items": { + "type": "union", + "refs": [ + "#publishingScopesPref" + ] + } }, "publishingScopesPref": { "type": "object", @@ -59,7 +69,7 @@ "public", "unlisted" ], - "description": "What publishing scope to mark a clip as by default." + "description": "What publishing scope to mark a clip as by default" } } } diff --git a/lexdocs/social/clippr/actor/getPreferences.json b/lexdocs/social/clippr/actor/getPreferences.json index 203d693..ac85cfd 100644 --- a/lexdocs/social/clippr/actor/getPreferences.json +++ b/lexdocs/social/clippr/actor/getPreferences.json @@ -4,7 +4,7 @@ "defs": { "main": { "type": "query", - "description": "Get the private user preferences associated to the account.", + "description": "Get the private user preferences associated to the account.", "parameters": { "type": "params", "properties": {} @@ -19,11 +19,12 @@ "properties": { "preferences": { "type": "ref", - "ref": "social.clippr.actor.defs#preferences" + "ref": "social.clippr.actor.defs#preferences", + "description": "A ref to the user's preferences" } } } } } } -} \ No newline at end of file +} diff --git a/lexdocs/social/clippr/actor/getProfile.json b/lexdocs/social/clippr/actor/getProfile.json index 90e2965..107f11c 100644 --- a/lexdocs/social/clippr/actor/getProfile.json +++ b/lexdocs/social/clippr/actor/getProfile.json @@ -1,30 +1,31 @@ { - "lexicon": 1, - "id": "social.clippr.actor.getProfile", - "defs": { - "main": { - "type": "query", - "description": "Get profile view of an actor. Does not require auth.", - "parameters": { - "type": "params", - "required": [ - "actor" - ], - "properties": { - "actor": { - "type": "string", - "format": "at-identifier", - "description": "Handle or DID of account to fetch profile of." - } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "ref", - "ref": "social.clippr.actor.defs#profileView" - } - } - } - } + "lexicon": 1, + "id": "social.clippr.actor.getProfile", + "defs": { + "main": { + "type": "query", + "description": "Get profile view of an actor. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier", + "description": "Handle or DID of account to fetch profile of" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "social.clippr.actor.defs#profileView", + "description": "A reference to the profile view of the actor" + } + } + } + } } diff --git a/lexdocs/social/clippr/actor/profile.json b/lexdocs/social/clippr/actor/profile.json index e87ec27..98cd286 100644 --- a/lexdocs/social/clippr/actor/profile.json +++ b/lexdocs/social/clippr/actor/profile.json @@ -1,47 +1,48 @@ { - "lexicon": 1, - "id": "social.clippr.actor.profile", - "defs": { - "main": { - "type": "record", - "description": "A declaration of a Clippr account's profile.", - "key": "literal:self", - "record": { - "type": "object", - "required": [ - "createdAt", - "displayName" - ], - "properties": { - "displayName": { - "type": "string", - "description": "A display name to be shown on a profile.", - "minGraphemes": 1, - "minLength": 10, - "maxGraphemes": 64, - "maxLength": 640 - }, - "description": { - "type": "string", - "description": "Text for user to describe themselves", - "maxGraphemes": 500, - "maxLength": 5000 - }, - "avatar": { - "type": "blob", - "description": "Image to show on user's profiles.", - "accept": [ - "image/png", - "image/jpeg" - ], - "maxSize": 1000000 - }, - "createdAt": { - "type": "string", - "format": "datetime" - } - } - } - } - } + "lexicon": 1, + "id": "social.clippr.actor.profile", + "defs": { + "main": { + "type": "record", + "description": "A declaration of a Clippr account's profile.", + "key": "literal:self", + "record": { + "type": "object", + "required": [ + "createdAt", + "displayName" + ], + "properties": { + "displayName": { + "type": "string", + "description": "A display name to be shown on a profile", + "minGraphemes": 1, + "minLength": 10, + "maxGraphemes": 64, + "maxLength": 640 + }, + "description": { + "type": "string", + "description": "Text for user to describe themselves", + "maxGraphemes": 500, + "maxLength": 5000 + }, + "avatar": { + "type": "blob", + "description": "Image to show on user's profiles", + "accept": [ + "image/png", + "image/jpeg" + ], + "maxSize": 1000000 + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "The creation date of the profile" + } + } + } + } + } } diff --git a/lexdocs/social/clippr/actor/putPreferences.json b/lexdocs/social/clippr/actor/putPreferences.json index 60f1aec..08e20fc 100644 --- a/lexdocs/social/clippr/actor/putPreferences.json +++ b/lexdocs/social/clippr/actor/putPreferences.json @@ -9,15 +9,18 @@ "encoding": "application/json", "schema": { "type": "object", - "required": ["preferences"], + "required": [ + "preferences" + ], "properties": { "preferences": { "type": "ref", - "ref": "social.clippr.actor.defs#preferences" + "ref": "social.clippr.actor.defs#preferences", + "description": "A ref to the user's preferences" } } } } } } -} \ No newline at end of file +} diff --git a/lexdocs/social/clippr/actor/searchProfiles.json b/lexdocs/social/clippr/actor/searchProfiles.json index 79fc882..b5c8fc0 100644 --- a/lexdocs/social/clippr/actor/searchProfiles.json +++ b/lexdocs/social/clippr/actor/searchProfiles.json @@ -1,43 +1,52 @@ { - "lexicon": 1, - "id": "social.clippr.actor.searchProfiles", - "defs": { - "main": { - "type": "query", - "description": "Find profiles matching search criteria. Does not require auth.", - "parameters": { - "type": "params", - "properties": { - "q": { - "type": "string", - "description": "Search query string." - }, - "limit": { - "type": "integer", - "minimum": 1, - "maximum": 100, - "default": 25 - }, - "cursor": { "type": "string" } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": ["actors"], - "properties": { - "cursor": { "type": "string" }, - "actors": { - "type": "array", - "items": { - "type": "ref", - "ref": "social.clippr.actor.defs#profileView" - } - } - } - } - } - } - } -} \ No newline at end of file + "lexicon": 1, + "id": "social.clippr.actor.searchProfiles", + "defs": { + "main": { + "type": "query", + "description": "Find profiles matching search criteria. Does not require auth.", + "parameters": { + "type": "params", + "properties": { + "q": { + "type": "string", + "description": "Search query string" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 25, + "description": "The number of profiles to be returned in the query" + }, + "cursor": { + "type": "string", + "description": "A parameter used for pagination" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actors" + ], + "properties": { + "cursor": { + "type": "string", + "description": "A parameter used for pagination" + }, + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "social.clippr.actor.defs#profileView" + } + } + } + } + } + } + } +} diff --git a/lexdocs/social/clippr/feed/clip.json b/lexdocs/social/clippr/feed/clip.json index a5e55d3..b616832 100644 --- a/lexdocs/social/clippr/feed/clip.json +++ b/lexdocs/social/clippr/feed/clip.json @@ -1,88 +1,88 @@ { - "lexicon": 1, - "id": "social.clippr.feed.clip", - "defs": { - "main": { - "type": "record", - "description": "Record containing a bookmark item, or 'clip'.", - "key": "any", - "record": { - "type": "object", - "required": [ - "url", - "title", - "description", - "unlisted", - "createdAt" - ], - "properties": { - "url": { - "type": "string", - "format": "uri", - "description": "The URL of the bookmark. Cannot be left empty or be modified after creation.", - "minGraphemes": 3, - "minLength": 30, - "maxGraphemes": 2000, - "maxLength": 20000 - }, - "title": { - "type": "string", - "description": "The title of the bookmark. If left empty, reuse the URL.", - "minGraphemes": 1, - "minLength": 10, - "maxGraphemes": 2048, - "maxLength": 20480 - }, - "description": { - "type": "string", - "description": "A description of the bookmark's content. This should be ripped from the URL metadata and be static for all records using the URL.", - "minGraphemes": 1, - "minLength": 10, - "maxGraphemes": 4096, - "maxLength": 40960 - }, - "notes": { - "type": "string", - "description": "User-written notes for the bookmark. Public and personal.", - "minGraphemes": 1, - "minLength": 10, - "maxGraphemes": 10000, - "maxLength": 100000 - }, - "tags": { - "type": "array", - "description": "An array of tags. A format of solely alphanumeric characters and dashes should be used.", - "items": { - "type": "ref", - "ref": "com.atproto.repo.strongRef" - } - }, - "unlisted": { - "type": "boolean", - "description": "Whether the bookmark can be used for feed indexing and aggregation.", - "default": false - }, - "unread": { - "type": "boolean", - "description": "Whether the bookmark has been read by the user.", - "default": true - }, - "languages": { - "type": "array", - "description": "Indicates human language of the given URL.", - "maxLength": 5, - "items": { - "type": "string", - "format": "language" - } - }, - "createdAt": { - "type": "string", - "description": "Client-declared timestamp when the bookmark is created.", - "format": "datetime" - } - } - } - } - } + "lexicon": 1, + "id": "social.clippr.feed.clip", + "defs": { + "main": { + "type": "record", + "description": "Record containing a bookmarked item, or 'clip'.", + "key": "any", + "record": { + "type": "object", + "required": [ + "url", + "title", + "description", + "unlisted", + "createdAt" + ], + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the bookmark. Cannot be left empty or be modified after creation.", + "minGraphemes": 3, + "minLength": 30, + "maxGraphemes": 2000, + "maxLength": 20000 + }, + "title": { + "type": "string", + "description": "The title of the bookmark. If left empty, reuse the URL.", + "minGraphemes": 1, + "minLength": 10, + "maxGraphemes": 2048, + "maxLength": 20480 + }, + "description": { + "type": "string", + "description": "A description of the bookmark's content. This should be ripped from the URL metadata and be static for all records using the URL.", + "minGraphemes": 1, + "minLength": 10, + "maxGraphemes": 4096, + "maxLength": 40960 + }, + "notes": { + "type": "string", + "description": "User-written notes for the bookmark. Public and personal.", + "minGraphemes": 1, + "minLength": 10, + "maxGraphemes": 10000, + "maxLength": 100000 + }, + "tags": { + "type": "array", + "description": "An array of tags. A format of solely alphanumeric characters and dashes should be used.", + "items": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + }, + "unlisted": { + "type": "boolean", + "description": "Whether the bookmark can be used for feed indexing and aggregation", + "default": false + }, + "unread": { + "type": "boolean", + "description": "Whether the bookmark has been read by the user", + "default": true + }, + "languages": { + "type": "array", + "description": "Indicates human language of the given URL", + "maxLength": 5, + "items": { + "type": "string", + "format": "language" + } + }, + "createdAt": { + "type": "string", + "description": "Client-declared timestamp when the bookmark is created", + "format": "datetime" + } + } + } + } + } } diff --git a/lexdocs/social/clippr/feed/defs.json b/lexdocs/social/clippr/feed/defs.json index 770056a..64d0eaf 100644 --- a/lexdocs/social/clippr/feed/defs.json +++ b/lexdocs/social/clippr/feed/defs.json @@ -2,6 +2,79 @@ "lexicon": 1, "id": "social.clippr.feed.defs", "defs": { - + "clipView": { + "type": "object", + "description": "A view of a single bookmark (or 'clip').", + "required": [ + "uri", + "cid", + "author", + "record", + "indexedAt" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri", + "description": "The AT-URI of the clip" + }, + "cid": { + "type": "string", + "format": "cid", + "description": "The CID of the clip" + }, + "author": { + "type": "ref", + "ref": "social.clippr.actor.defs#profileView", + "description": "A reference to the actor's profile" + }, + "record": { + "type": "unknown", + "description": "The raw record of the clip" + }, + "indexedAt": { + "type": "string", + "format": "datetime", + "description": "The time in which the clip's record was indexed by the AppView" + } + } + }, + "tagView": { + "type": "object", + "description": "A view of a single tag.", + "required": [ + "uri", + "cid", + "author", + "record", + "indexedAt" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri", + "description": "The AT-URI to the tag" + }, + "cid": { + "type": "string", + "format": "cid", + "description": "The CID of the tag" + }, + "author": { + "type": "ref", + "ref": "social.clippr.actor.defs#profileView", + "description": "A reference to the actor's profile" + }, + "record": { + "type": "unknown", + "description": "The raw record of the tag" + }, + "indexedAt": { + "type": "string", + "format": "datetime", + "description": "The time in which the tag's recoord was indexed by the AppView" + } + } + } } -} \ No newline at end of file +} diff --git a/lexdocs/social/clippr/feed/getClips.json b/lexdocs/social/clippr/feed/getClips.json index e69de29..64d0570 100644 --- a/lexdocs/social/clippr/feed/getClips.json +++ b/lexdocs/social/clippr/feed/getClips.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "social.clippr.feed.getClips", + "defs": { + "main": { + "type": "query", + "description": "Get a list of clips. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "uris" + ], + "properties": { + "uris": { + "type": "array", + "description": "List of clip AT-URIs to return hydrated views for.", + "items": { + "type": "string", + "format": "at-uri" + }, + "maxLength": 25 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "clips" + ], + "properties": { + "clips": { + "type": "array", + "items": { + "type": "ref", + "ref": "social.clippr.feed.defs#clipView" + }, + "description": "An array of hydrated clip views" + } + } + } + } + } + } +} diff --git a/lexdocs/social/clippr/feed/getProfileClips.json b/lexdocs/social/clippr/feed/getProfileClips.json new file mode 100644 index 0000000..73d5fe2 --- /dev/null +++ b/lexdocs/social/clippr/feed/getProfileClips.json @@ -0,0 +1,65 @@ +{ + "lexicon": 1, + "id": "social.clippr.feed.getProfileClips", + "defs": { + "main": { + "type": "query", + "description": "Get a view of a profile's reverse-chronological clips feed. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier", + "description": "An actor to get feed data from" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50, + "description": "How many results to return with the query" + }, + "cursor": { + "type": "string", + "description": "A parameter to paginate results" + }, + "filter": { + "type": "string", + "knownValues": [ + "all_clips", + "tagged_clips", + "untagged_clips" + ], + "default": "all_clips", + "description": "What types to include in response" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "array", + "items": { + "type": "ref", + "ref": "social.clippr.feed.defs#clipView" + } + } + } + } + } + } + } +} diff --git a/lexdocs/social/clippr/feed/getProfileFeed.json b/lexdocs/social/clippr/feed/getProfileFeed.json deleted file mode 100644 index e69de29..0000000 diff --git a/lexdocs/social/clippr/feed/getProfileTags.json b/lexdocs/social/clippr/feed/getProfileTags.json new file mode 100644 index 0000000..49ae99c --- /dev/null +++ b/lexdocs/social/clippr/feed/getProfileTags.json @@ -0,0 +1,55 @@ +{ + "lexicon": 1, + "id": "social.clippr.feed.getProfileTags", + "defs": { + "main": { + "type": "query", + "description": "Get a view of a profile's reverse-chronological clips feed. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier", + "description": "An actor to get feed data from" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50, + "description": "How many results to return with the query" + }, + "cursor": { + "type": "string", + "description": "A parameter to paginate results" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "array", + "items": { + "type": "ref", + "ref": "social.clippr.feed.defs#tagView" + } + } + } + } + } + } + } +} diff --git a/lexdocs/social/clippr/feed/getTagList.json b/lexdocs/social/clippr/feed/getTagList.json index e69de29..66dc998 100644 --- a/lexdocs/social/clippr/feed/getTagList.json +++ b/lexdocs/social/clippr/feed/getTagList.json @@ -0,0 +1,39 @@ +{ + "lexicon": 1, + "id": "social.clippr.feed.getTagList", + "defs": { + "main": { + "type": "query", + "description": "Get a user's list of tags. Does not require auth.", + "parameters": { + "type": "params", + "properties": { + "actor": { + "type": "string", + "format": "at-identifier", + "description": "An actor to fetch the tag list from" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "tags" + ], + "properties": { + "tags": { + "type": "array", + "items": { + "type": "ref", + "ref": "social.clippr.feed.defs#tagView" + }, + "description": "A list of tags and their associated details" + } + } + } + } + } + } +} diff --git a/lexdocs/social/clippr/feed/getTags.json b/lexdocs/social/clippr/feed/getTags.json index e69de29..9020927 100644 --- a/lexdocs/social/clippr/feed/getTags.json +++ b/lexdocs/social/clippr/feed/getTags.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "social.clippr.feed.getClips", + "defs": { + "main": { + "type": "query", + "description": "Get a list of tags. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "uris" + ], + "properties": { + "uris": { + "type": "array", + "description": "List of tag AT-URIs to return hydrated views for", + "items": { + "type": "string", + "format": "at-uri" + }, + "maxLength": 25 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "tags" + ], + "properties": { + "tags": { + "type": "array", + "items": { + "type": "ref", + "ref": "social.clippr.feed.defs#tagView" + }, + "description": "An array of hydrated tag views" + } + } + } + } + } + } +} diff --git a/lexdocs/social/clippr/feed/searchClips.json b/lexdocs/social/clippr/feed/searchClips.json index e69de29..d44ae94 100644 --- a/lexdocs/social/clippr/feed/searchClips.json +++ b/lexdocs/social/clippr/feed/searchClips.json @@ -0,0 +1,61 @@ +{ + "lexicon": 1, + "id": "social.clippr.actor.searchClips", + "defs": { + "main": { + "type": "query", + "description": "Find clips matching search criteria. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "q": { + "type": "string", + "description": "Search query string" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 25, + "description": "How many clips to return in the query output" + }, + "actor": { + "type": "string", + "format": "at-identifier", + "description": "An actor to filter results to" + }, + "cursor": { + "type": "string", + "description": "A parameter to paginate results" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "clips" + ], + "properties": { + "cursor": { + "type": "string", + "description": "A parameter to paginate results" + }, + "clips": { + "type": "array", + "items": { + "type": "ref", + "ref": "social.clippr.feed.defs#clipView" + }, + "description": "A list of clips and their associated details" + } + } + } + } + } + } +} diff --git a/lexdocs/social/clippr/feed/searchTags.json b/lexdocs/social/clippr/feed/searchTags.json index e69de29..bc4448d 100644 --- a/lexdocs/social/clippr/feed/searchTags.json +++ b/lexdocs/social/clippr/feed/searchTags.json @@ -0,0 +1,61 @@ +{ + "lexicon": 1, + "id": "social.clippr.actor.searchTags", + "defs": { + "main": { + "type": "query", + "description": "Find tags matching search criteria. Does not require auth.", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "q": { + "type": "string", + "description": "Search query string" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 25, + "description": "How many tags to return in the query output" + }, + "actor": { + "type": "string", + "format": "at-identifier", + "description": "An actor to filter results to" + }, + "cursor": { + "type": "string", + "description": "A parameter to paginate results" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "tags" + ], + "properties": { + "cursor": { + "type": "string", + "description": "A parameter to paginate results" + }, + "tags": { + "type": "array", + "items": { + "type": "ref", + "ref": "social.clippr.feed.defs#tagView" + }, + "description": "A list of tags and their associated details" + } + } + } + } + } + } +} diff --git a/lexdocs/social/clippr/feed/tag.json b/lexdocs/social/clippr/feed/tag.json index 2d12a81..a4bc920 100644 --- a/lexdocs/social/clippr/feed/tag.json +++ b/lexdocs/social/clippr/feed/tag.json @@ -1,41 +1,49 @@ { - "lexicon": 1, - "id": "social.clippr.feed.tag", - "defs": { - "main": { - "type": "record", - "description": "A record containing a bookmark tag for organization.", - "key": "any", - "record": { - "type": "object", - "required": [ - "name", - "createdAt" - ], - "properties": { - "name": { - "type": "string", - "description": "A de-duplicated string containing the name of the tag.", - "minGraphemes": 1, - "minLength": 10, - "maxGraphemes": 64, - "maxLength": 640 - }, - "color": { - "type": "string", - "description": "A hexadecimal color code.", - "minGraphemes": 4, - "minLength": 40, - "maxGraphemes": 7, - "maxLength": 70 - }, - "createdAt": { - "type": "string", - "description": "A client-defined timestamp for the creation of the tag.", - "format": "datetime" - } - } - } - } - } + "lexicon": 1, + "id": "social.clippr.feed.tag", + "defs": { + "main": { + "type": "record", + "description": "A record containing a bookmark tag for organization.", + "key": "any", + "record": { + "type": "object", + "required": [ + "name", + "createdAt" + ], + "properties": { + "name": { + "type": "string", + "minGraphemes": 1, + "minLength": 10, + "maxGraphemes": 64, + "maxLength": 640, + "description": "A de-duplicated string containing the name of the tag" + }, + "color": { + "type": "string", + "minGraphemes": 4, + "minLength": 40, + "maxGraphemes": 7, + "maxLength": 70, + "description": "A hexadecimal color code" + }, + "description": { + "type": "string", + "minGraphemes": 1, + "minLength": 10, + "maxGraphemes": 5000, + "maxLength": 50000, + "description": "A description of the tag for additional context" + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "A client-defined timestamp for the creation of the tag" + } + } + } + } + } } -- 2.43.0 From a2fc4cba4a6de902f89c9602de23970ffb1b2cd9 Mon Sep 17 00:00:00 2001 From: penny Date: Sun, 20 Jul 2025 07:27:28 -0400 Subject: [PATCH] [lexicons] generate new lexicon schemas --- lexicons/lex.config.js | 32 +++++------ lexicons/lib/lexicons/index.ts | 10 ++++ .../types/social/clippr/actor/defs.ts | 20 +++++++ .../social/clippr/actor/getPreferences.ts | 40 +++++++++++++ .../social/clippr/actor/putPreferences.ts | 41 ++++++++++++++ .../types/social/clippr/actor/searchClips.ts | 48 ++++++++++++++++ .../social/clippr/actor/searchProfiles.ts | 50 +++++++++++++++++ .../types/social/clippr/actor/searchTags.ts | 48 ++++++++++++++++ .../lexicons/types/social/clippr/feed/defs.ts | 46 +++++++++++++++ .../types/social/clippr/feed/getClips.ts | 42 ++++++++++++++ .../social/clippr/feed/getProfileClips.ts | 56 +++++++++++++++++++ .../social/clippr/feed/getProfileTags.ts | 47 ++++++++++++++++ .../types/social/clippr/feed/getTagList.ts | 39 +++++++++++++ .../lexicons/types/social/clippr/feed/tag.ts | 6 ++ lexicons/package.json | 2 +- 15 files changed, 510 insertions(+), 17 deletions(-) create mode 100644 lexicons/lib/lexicons/types/social/clippr/actor/getPreferences.ts create mode 100644 lexicons/lib/lexicons/types/social/clippr/actor/putPreferences.ts create mode 100644 lexicons/lib/lexicons/types/social/clippr/actor/searchClips.ts create mode 100644 lexicons/lib/lexicons/types/social/clippr/actor/searchProfiles.ts create mode 100644 lexicons/lib/lexicons/types/social/clippr/actor/searchTags.ts create mode 100644 lexicons/lib/lexicons/types/social/clippr/feed/defs.ts create mode 100644 lexicons/lib/lexicons/types/social/clippr/feed/getClips.ts create mode 100644 lexicons/lib/lexicons/types/social/clippr/feed/getProfileClips.ts create mode 100644 lexicons/lib/lexicons/types/social/clippr/feed/getProfileTags.ts create mode 100644 lexicons/lib/lexicons/types/social/clippr/feed/getTagList.ts diff --git a/lexicons/lex.config.js b/lexicons/lex.config.js index c1237d4..9243811 100644 --- a/lexicons/lex.config.js +++ b/lexicons/lex.config.js @@ -8,20 +8,20 @@ import {defineLexiconConfig} from "@atcute/lex-cli"; export default defineLexiconConfig({ - files: ["../lexdocs/**/*.json"], - outdir: "lib/lexicons", - mappings: [ - { - nsid: ["com.atproto.*"], - imports: (nsid) => { - const specifier = nsid - .slice("com.atproto.".length) - .replaceAll(".", "/"); - return { - type: "namespace", - from: `@atcute/atproto/types/${specifier}`, - }; - }, - }, - ], + files: ["../lexdocs/**/*.json"], + outdir: "lib/lexicons", + mappings: [ + { + nsid: ["com.atproto.*"], + imports: (nsid) => { + const specifier = nsid + .slice("com.atproto.".length) + .replaceAll(".", "/"); + return { + type: "namespace", + from: `@atcute/atproto/types/${specifier}`, + }; + }, + }, + ], }); diff --git a/lexicons/lib/lexicons/index.ts b/lexicons/lib/lexicons/index.ts index 21f360a..881c7a6 100644 --- a/lexicons/lib/lexicons/index.ts +++ b/lexicons/lib/lexicons/index.ts @@ -5,7 +5,17 @@ */ export * as SocialClipprActorDefs from "./types/social/clippr/actor/defs.js"; +export * as SocialClipprActorGetPreferences from "./types/social/clippr/actor/getPreferences.js"; export * as SocialClipprActorGetProfile from "./types/social/clippr/actor/getProfile.js"; export * as SocialClipprActorProfile from "./types/social/clippr/actor/profile.js"; +export * as SocialClipprActorPutPreferences from "./types/social/clippr/actor/putPreferences.js"; +export * as SocialClipprActorSearchClips from "./types/social/clippr/actor/searchClips.js"; +export * as SocialClipprActorSearchProfiles from "./types/social/clippr/actor/searchProfiles.js"; +export * as SocialClipprActorSearchTags from "./types/social/clippr/actor/searchTags.js"; export * as SocialClipprFeedClip from "./types/social/clippr/feed/clip.js"; +export * as SocialClipprFeedDefs from "./types/social/clippr/feed/defs.js"; +export * as SocialClipprFeedGetClips from "./types/social/clippr/feed/getClips.js"; +export * as SocialClipprFeedGetProfileClips from "./types/social/clippr/feed/getProfileClips.js"; +export * as SocialClipprFeedGetProfileTags from "./types/social/clippr/feed/getProfileTags.js"; +export * as SocialClipprFeedGetTagList from "./types/social/clippr/feed/getTagList.js"; export * as SocialClipprFeedTag from "./types/social/clippr/feed/tag.js"; diff --git a/lexicons/lib/lexicons/types/social/clippr/actor/defs.ts b/lexicons/lib/lexicons/types/social/clippr/actor/defs.ts index c310e76..6aa9124 100644 --- a/lexicons/lib/lexicons/types/social/clippr/actor/defs.ts +++ b/lexicons/lib/lexicons/types/social/clippr/actor/defs.ts @@ -7,6 +7,9 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; +const _preferencesSchema = /*#__PURE__*/ v.array(() => { + return /*#__PURE__*/ v.variant([publishingScopesPrefSchema]); +}); const _profileViewSchema = /*#__PURE__*/ v.object({ $type: /*#__PURE__*/ v.optional( /*#__PURE__*/ v.literal("social.clippr.actor.defs#profileView"), @@ -28,11 +31,28 @@ const _profileViewSchema = /*#__PURE__*/ v.object({ ), handle: /*#__PURE__*/ v.handleString(), }); +const _publishingScopesPrefSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("social.clippr.actor.defs#publishingScopesPref"), + ), + defaultScope: /*#__PURE__*/ v.string<"public" | "unlisted" | (string & {})>(), +}); +type preferences$schematype = typeof _preferencesSchema; type profileView$schematype = typeof _profileViewSchema; +type publishingScopesPref$schematype = typeof _publishingScopesPrefSchema; +export interface preferencesSchema extends preferences$schematype {} export interface profileViewSchema extends profileView$schematype {} +export interface publishingScopesPrefSchema + extends publishingScopesPref$schematype {} +export const preferencesSchema = _preferencesSchema as preferencesSchema; export const profileViewSchema = _profileViewSchema as profileViewSchema; +export const publishingScopesPrefSchema = + _publishingScopesPrefSchema as publishingScopesPrefSchema; +export interface Preferences extends v.InferInput {} export interface ProfileView extends v.InferInput {} +export interface PublishingScopesPref + extends v.InferInput {} diff --git a/lexicons/lib/lexicons/types/social/clippr/actor/getPreferences.ts b/lexicons/lib/lexicons/types/social/clippr/actor/getPreferences.ts new file mode 100644 index 0000000..f2dac68 --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/actor/getPreferences.ts @@ -0,0 +1,40 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as SocialClipprActorDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query( + "social.clippr.actor.getPreferences", + { + params: /*#__PURE__*/ v.object({}), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get preferences() { + return SocialClipprActorDefs.preferencesSchema; + }, + }), + }, + }, +); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "social.clippr.actor.getPreferences": mainSchema; + } +} diff --git a/lexicons/lib/lexicons/types/social/clippr/actor/putPreferences.ts b/lexicons/lib/lexicons/types/social/clippr/actor/putPreferences.ts new file mode 100644 index 0000000..d567210 --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/actor/putPreferences.ts @@ -0,0 +1,41 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as SocialClipprActorDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.procedure( + "social.clippr.actor.putPreferences", + { + params: null, + input: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get preferences() { + return SocialClipprActorDefs.preferencesSchema; + }, + }), + }, + output: null, + }, +); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params {} +export interface $input extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCProcedures { + "social.clippr.actor.putPreferences": mainSchema; + } +} diff --git a/lexicons/lib/lexicons/types/social/clippr/actor/searchClips.ts b/lexicons/lib/lexicons/types/social/clippr/actor/searchClips.ts new file mode 100644 index 0000000..3427229 --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/actor/searchClips.ts @@ -0,0 +1,48 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as SocialClipprFeedDefs from "../feed/defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("social.clippr.actor.searchClips", { + params: /*#__PURE__*/ v.object({ + actor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.actorIdentifierString()), + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 100), + ]), + 25, + ), + q: /*#__PURE__*/ v.string(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get clips() { + return /*#__PURE__*/ v.array(SocialClipprFeedDefs.clipViewSchema); + }, + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "social.clippr.actor.searchClips": mainSchema; + } +} diff --git a/lexicons/lib/lexicons/types/social/clippr/actor/searchProfiles.ts b/lexicons/lib/lexicons/types/social/clippr/actor/searchProfiles.ts new file mode 100644 index 0000000..8436faa --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/actor/searchProfiles.ts @@ -0,0 +1,50 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as SocialClipprActorDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query( + "social.clippr.actor.searchProfiles", + { + params: /*#__PURE__*/ v.object({ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 100), + ]), + 25, + ), + q: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get actors() { + return /*#__PURE__*/ v.array(SocialClipprActorDefs.profileViewSchema); + }, + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + }), + }, + }, +); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "social.clippr.actor.searchProfiles": mainSchema; + } +} diff --git a/lexicons/lib/lexicons/types/social/clippr/actor/searchTags.ts b/lexicons/lib/lexicons/types/social/clippr/actor/searchTags.ts new file mode 100644 index 0000000..b4f833f --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/actor/searchTags.ts @@ -0,0 +1,48 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as SocialClipprFeedDefs from "../feed/defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("social.clippr.actor.searchTags", { + params: /*#__PURE__*/ v.object({ + actor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.actorIdentifierString()), + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 100), + ]), + 25, + ), + q: /*#__PURE__*/ v.string(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + get tags() { + return /*#__PURE__*/ v.array(SocialClipprFeedDefs.tagViewSchema); + }, + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "social.clippr.actor.searchTags": mainSchema; + } +} diff --git a/lexicons/lib/lexicons/types/social/clippr/feed/defs.ts b/lexicons/lib/lexicons/types/social/clippr/feed/defs.ts new file mode 100644 index 0000000..a1ba40c --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/feed/defs.ts @@ -0,0 +1,46 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import * as SocialClipprActorDefs from "../actor/defs.js"; + +const _clipViewSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("social.clippr.feed.defs#clipView"), + ), + get author() { + return SocialClipprActorDefs.profileViewSchema; + }, + cid: /*#__PURE__*/ v.cidString(), + indexedAt: /*#__PURE__*/ v.datetimeString(), + record: /*#__PURE__*/ v.unknown(), + uri: /*#__PURE__*/ v.resourceUriString(), +}); +const _tagViewSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("social.clippr.feed.defs#tagView"), + ), + get author() { + return SocialClipprActorDefs.profileViewSchema; + }, + cid: /*#__PURE__*/ v.cidString(), + indexedAt: /*#__PURE__*/ v.datetimeString(), + record: /*#__PURE__*/ v.unknown(), + uri: /*#__PURE__*/ v.resourceUriString(), +}); + +type clipView$schematype = typeof _clipViewSchema; +type tagView$schematype = typeof _tagViewSchema; + +export interface clipViewSchema extends clipView$schematype {} +export interface tagViewSchema extends tagView$schematype {} + +export const clipViewSchema = _clipViewSchema as clipViewSchema; +export const tagViewSchema = _tagViewSchema as tagViewSchema; + +export interface ClipView extends v.InferInput {} +export interface TagView extends v.InferInput {} diff --git a/lexicons/lib/lexicons/types/social/clippr/feed/getClips.ts b/lexicons/lib/lexicons/types/social/clippr/feed/getClips.ts new file mode 100644 index 0000000..319dc8b --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/feed/getClips.ts @@ -0,0 +1,42 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as SocialClipprFeedDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("social.clippr.feed.getClips", { + params: /*#__PURE__*/ v.object({ + uris: /*#__PURE__*/ v.constrain( + /*#__PURE__*/ v.array(/*#__PURE__*/ v.resourceUriString()), + [/*#__PURE__*/ v.arrayLength(1, 25)], + ), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get tags() { + return /*#__PURE__*/ v.array(SocialClipprFeedDefs.tagViewSchema); + }, + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "social.clippr.feed.getClips": mainSchema; + } +} diff --git a/lexicons/lib/lexicons/types/social/clippr/feed/getProfileClips.ts b/lexicons/lib/lexicons/types/social/clippr/feed/getProfileClips.ts new file mode 100644 index 0000000..f6b67c9 --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/feed/getProfileClips.ts @@ -0,0 +1,56 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as SocialClipprFeedDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query( + "social.clippr.feed.getProfileClips", + { + params: /*#__PURE__*/ v.object({ + actor: /*#__PURE__*/ v.actorIdentifierString(), + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + filter: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.string< + "all_clips" | "tagged_clips" | "untagged_clips" | (string & {}) + >(), + "all_clips", + ), + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 100), + ]), + 50, + ), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + get feed() { + return /*#__PURE__*/ v.array(SocialClipprFeedDefs.clipViewSchema); + }, + }), + }, + }, +); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "social.clippr.feed.getProfileClips": mainSchema; + } +} diff --git a/lexicons/lib/lexicons/types/social/clippr/feed/getProfileTags.ts b/lexicons/lib/lexicons/types/social/clippr/feed/getProfileTags.ts new file mode 100644 index 0000000..9e1b07a --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/feed/getProfileTags.ts @@ -0,0 +1,47 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as SocialClipprFeedDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("social.clippr.feed.getProfileTags", { + params: /*#__PURE__*/ v.object({ + actor: /*#__PURE__*/ v.actorIdentifierString(), + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 100), + ]), + 50, + ), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + get feed() { + return /*#__PURE__*/ v.array(SocialClipprFeedDefs.tagViewSchema); + }, + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "social.clippr.feed.getProfileTags": mainSchema; + } +} diff --git a/lexicons/lib/lexicons/types/social/clippr/feed/getTagList.ts b/lexicons/lib/lexicons/types/social/clippr/feed/getTagList.ts new file mode 100644 index 0000000..e0c3755 --- /dev/null +++ b/lexicons/lib/lexicons/types/social/clippr/feed/getTagList.ts @@ -0,0 +1,39 @@ +/* + * clippr: a social bookmarking service for the AT Protocol + * Copyright (c) 2025 clippr contributors. + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as SocialClipprFeedDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("social.clippr.feed.getTagList", { + params: /*#__PURE__*/ v.object({ + actor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.actorIdentifierString()), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get tags() { + return /*#__PURE__*/ v.array(SocialClipprFeedDefs.tagViewSchema); + }, + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "social.clippr.feed.getTagList": mainSchema; + } +} diff --git a/lexicons/lib/lexicons/types/social/clippr/feed/tag.ts b/lexicons/lib/lexicons/types/social/clippr/feed/tag.ts index f8b855f..26d51b9 100644 --- a/lexicons/lib/lexicons/types/social/clippr/feed/tag.ts +++ b/lexicons/lib/lexicons/types/social/clippr/feed/tag.ts @@ -19,6 +19,12 @@ const _mainSchema = /*#__PURE__*/ v.record( ]), ), createdAt: /*#__PURE__*/ v.datetimeString(), + description: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [ + /*#__PURE__*/ v.stringLength(10, 50000), + /*#__PURE__*/ v.stringGraphemes(1, 5000), + ]), + ), name: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [ /*#__PURE__*/ v.stringLength(10, 640), /*#__PURE__*/ v.stringGraphemes(1, 64), diff --git a/lexicons/package.json b/lexicons/package.json index a8909f8..88dcbfb 100644 --- a/lexicons/package.json +++ b/lexicons/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "@clipprjs/lexicons", - "version": "0.1.4", + "version": "1.0.0", "description": "Clippr schema definitions", "license": "AGPL-3.0-only", "private": false, -- 2.43.0 From 44269b4063fd54c1c6f68d7e8b6905aa0cc1e415 Mon Sep 17 00:00:00 2001 From: penny Date: Sun, 20 Jul 2025 07:42:56 -0400 Subject: [PATCH] [lexicons] Add changelog, modify readme --- lexicons/CHANGELOG.md | 31 +++++++++++++++++++++++++++++++ lexicons/README.md | 4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 lexicons/CHANGELOG.md diff --git a/lexicons/CHANGELOG.md b/lexicons/CHANGELOG.md new file mode 100644 index 0000000..429e41d --- /dev/null +++ b/lexicons/CHANGELOG.md @@ -0,0 +1,31 @@ +# changelog for @clipprjs/lexicons + +## v1.0.0 + +> this version should be considered as the starting point for a usable Lexicon API. previous versions should be ignored. + +* added search queries for clips, tags and profiles +* added `social.clippr.actor.defs#preferences` with an accompanying query and procedure lexicon +* added more inline documentation to previously existing lexicons +* added query lexicons for having a clip and tag feed on a profile +* added general query lexicons for at:// URIs linking to clips and tags + +## v0.1.4 + +* added length constraints to more strings in record lexicons + +## v0.1.3 + +* made `displayName` required for profile records + +## v0.1.2 + +* added npm tags.. i guess + +## v0.1.1 + +* something(?) + +## v0.1.0 + +* initial record and `social.clippr.actor.getProfile` query lexicons \ No newline at end of file diff --git a/lexicons/README.md b/lexicons/README.md index e0dcc4d..3ecf6c9 100644 --- a/lexicons/README.md +++ b/lexicons/README.md @@ -2,9 +2,9 @@ Lexicon package auto-generated with `@atcute/lex-cli` -> This package is *very* unstable. Lexicon attributes can be modified at any moment. +> This package is *somewhat* unstable. Lexicon attributes can be modified at any moment. > Please do not use this package for anything until the [Clippr server](https://tangled.sh/@hexmani.ac/clippr) has been -> deployed for either public or developer consumption. +> deployed for either public or developer usage. ## Usage -- 2.43.0