From d47db5757e04802b5b44a15eb6e9ff602b261633 Mon Sep 17 00:00:00 2001 From: Ashlynne Mitchell Date: Tue, 20 May 2025 09:08:29 +1000 Subject: [PATCH] feat(lexicon): comment record and custom richtext facets --- .../defs/sh/comet/v0/actor/profile.json | 9 ++-- .../defs/sh/comet/v0/feed/comment.json | 47 +++++++++++++++++++ .../defs/sh/comet/v0/feed/playlist.json | 5 ++ .../lexicons/defs/sh/comet/v0/feed/track.json | 2 +- .../comet/v0/richtext/facet.json} | 13 ++++- 5 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 packages/lexicons/defs/sh/comet/v0/feed/comment.json rename packages/lexicons/defs/{app.bsky.richtext.facet.json => sh/comet/v0/richtext/facet.json} (82%) diff --git a/packages/lexicons/defs/sh/comet/v0/actor/profile.json b/packages/lexicons/defs/sh/comet/v0/actor/profile.json index 7790237..e1df5e5 100644 --- a/packages/lexicons/defs/sh/comet/v0/actor/profile.json +++ b/packages/lexicons/defs/sh/comet/v0/actor/profile.json @@ -23,7 +23,7 @@ "descriptionFacets": { "type": "ref", "description": "Annotations of the user's description.", - "ref": "app.bsky.richtext.facets" + "ref": "sh.comet.v0.richtext.facet" }, "avatar": { "type": "blob", @@ -33,10 +33,9 @@ }, "featured": { "type": "array", - "items": { - "type": "ref", - "ref": "com.atproto.repo.strongRef" - } + "description": "Pinned items to be shown first on the user's profile.", + "maxLength": 5, + "items": { "type": "string", "format": "at-uri" } }, "createdAt": { "type": "string", "format": "datetime" } } diff --git a/packages/lexicons/defs/sh/comet/v0/feed/comment.json b/packages/lexicons/defs/sh/comet/v0/feed/comment.json new file mode 100644 index 0000000..c457b01 --- /dev/null +++ b/packages/lexicons/defs/sh/comet/v0/feed/comment.json @@ -0,0 +1,47 @@ +{ + "lexicon": 1, + "id": "sh.comet.v0.feed.comment", + "defs": { + "main": { + "type": "record", + "description": "A comment on a piece of Comet media.", + "key": "tid", + "record": { + "type": "object", + "required": ["text", "subject", "createdAt"], + "properties": { + "text": { + "type": "string", + "minLength": 1, + "minGraphemes": 1, + "maxLength": 3000, + "maxGraphemes": 300, + "description": "The comment's content." + }, + "subject": { + "type": "string", + "format": "at-uri", + "description": "The piece of media being commented on." + }, + "reply": { + "type": "string", + "format": "at-uri", + "description": "Another sh.comet.v0.feed.comment this is in reply to." + }, + "langs": { + "type": "array", + "description": "Indicates human language of the comment's text content.", + "maxLength": 3, + "items": { "type": "string", "format": "language" } + }, + "facets": { + "type": "array", + "description": "Annotations of text (mentions, URLs, hashtags, etc)", + "items": { "type": "ref", "ref": "sh.comet.v0.richtext.facet" } + }, + "createdAt": { "type": "string", "format": "datetime" } + } + } + } + } +} diff --git a/packages/lexicons/defs/sh/comet/v0/feed/playlist.json b/packages/lexicons/defs/sh/comet/v0/feed/playlist.json index c3dff9d..e9faed7 100644 --- a/packages/lexicons/defs/sh/comet/v0/feed/playlist.json +++ b/packages/lexicons/defs/sh/comet/v0/feed/playlist.json @@ -34,6 +34,11 @@ "maxLength": 20000, "maxGraphemes": 2000 }, + "descriptionFacets": { + "type": "ref", + "description": "Annotations of the playlist's description.", + "ref": "sh.comet.v0.richtext.facets" + }, "type": { "type": "string", "description": "Type of the playlist. Allows differentiating between playlist's different purposes.", diff --git a/packages/lexicons/defs/sh/comet/v0/feed/track.json b/packages/lexicons/defs/sh/comet/v0/feed/track.json index 9d350ab..630db8b 100644 --- a/packages/lexicons/defs/sh/comet/v0/feed/track.json +++ b/packages/lexicons/defs/sh/comet/v0/feed/track.json @@ -38,7 +38,7 @@ "descriptionFacets": { "type": "ref", "description": "Annotations of the track's description.", - "ref": "app.bsky.richtext.facets" + "ref": "sh.comet.v0.richtext.facets" }, "tags": { "type": "array", diff --git a/packages/lexicons/defs/app.bsky.richtext.facet.json b/packages/lexicons/defs/sh/comet/v0/richtext/facet.json similarity index 82% rename from packages/lexicons/defs/app.bsky.richtext.facet.json rename to packages/lexicons/defs/sh/comet/v0/richtext/facet.json index 388a3a5..a211602 100644 --- a/packages/lexicons/defs/app.bsky.richtext.facet.json +++ b/packages/lexicons/defs/sh/comet/v0/richtext/facet.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "app.bsky.richtext.facet", + "id": "sh.comet.v0.richtext.facet", "defs": { "main": { "type": "object", @@ -38,6 +38,17 @@ "tag": { "type": "string", "maxLength": 640, "maxGraphemes": 64 } } }, + "timestamp": { + "type": "object", + "description": "Facet feature for a timestamp in a track. The text usually is in the format of 'hh:mm:ss' with the hour section being omitted if unnecessary.", + "properties": { + "timestamp": { + "type": "integer", + "minimum": 0, + "description": "Reference time, in seconds." + } + } + }, "byteSlice": { "type": "object", "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.", -- 2.51.2