Skip to content

Commit

Permalink
Import newest lexicons.
Browse files Browse the repository at this point in the history
  • Loading branch information
christiandeange committed Mar 10, 2024
1 parent 12beb29 commit 06758c1
Show file tree
Hide file tree
Showing 9 changed files with 739 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,11 @@ private fun RecordViewRecordUnion.toEmbedPost(): EmbedPost {
uri = value.uri,
)
}
is RecordViewRecordUnion.LabelerLabelerView -> {
// TODO support labeler views.
InvisibleEmbedPost(
uri = value.uri,
)
}
}
}
481 changes: 455 additions & 26 deletions bluesky/api/bluesky.api

Large diffs are not rendered by default.

45 changes: 43 additions & 2 deletions bluesky/lexicons/app/bsky/actor/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
"followersCount": { "type": "integer" },
"followsCount": { "type": "integer" },
"postsCount": { "type": "integer" },
"associated": {
"type": "ref",
"ref": "#profileAssociated"
},
"indexedAt": { "type": "string", "format": "datetime" },
"viewer": { "type": "ref", "ref": "#viewerState" },
"labels": {
Expand All @@ -75,6 +79,14 @@
}
}
},
"profileAssociated": {
"type": "object",
"properties": {
"lists": { "type": "integer" },
"feedgens": { "type": "integer" },
"labeler": { "type": "boolean" }
}
},
"viewerState": {
"type": "object",
"description": "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.",
Expand Down Expand Up @@ -122,10 +134,15 @@
"type": "object",
"required": ["label", "visibility"],
"properties": {
"labelerDid": {
"type": "string",
"description": "Which labeler does this preference apply to? If undefined, applies globally.",
"format": "did"
},
"label": { "type": "string" },
"visibility": {
"type": "string",
"knownValues": ["show", "warn", "hide"]
"knownValues": ["ignore", "show", "warn", "hide"]
}
}
},
Expand Down Expand Up @@ -176,7 +193,8 @@
},
"hideRepliesByUnfollowed": {
"type": "boolean",
"description": "Hide replies in the feed if they are not by followed users."
"description": "Hide replies in the feed if they are not by followed users.",
"default": true
},
"hideRepliesByLikeCount": {
"type": "integer",
Expand Down Expand Up @@ -269,6 +287,29 @@
"description": "A list of URIs of posts the account owner has hidden."
}
}
},
"modsPref": {
"type": "object",
"required": ["mods"],
"properties": {
"mods": {
"type": "array",
"items": {
"type": "ref",
"ref": "#modPrefItem"
}
}
}
},
"modPrefItem": {
"type": "object",
"required": ["did"],
"properties": {
"did": {
"type": "string",
"format": "did"
}
}
}
}
}
3 changes: 2 additions & 1 deletion bluesky/lexicons/app/bsky/embed/record.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"#viewNotFound",
"#viewBlocked",
"app.bsky.feed.defs#generatorView",
"app.bsky.graph.defs#listView"
"app.bsky.graph.defs#listView",
"app.bsky.labeler.defs#labelerView"
]
}
}
Expand Down
70 changes: 70 additions & 0 deletions bluesky/lexicons/app/bsky/labeler/defs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"lexicon": 1,
"id": "app.bsky.labeler.defs",
"defs": {
"labelerView": {
"type": "object",
"required": ["uri", "cid", "creator", "indexedAt"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
"likeCount": { "type": "integer", "minimum": 0 },
"viewer": { "type": "ref", "ref": "#labelerViewerState" },
"indexedAt": { "type": "string", "format": "datetime" },
"labels": {
"type": "array",
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
}
}
},
"labelerViewDetailed": {
"type": "object",
"required": ["uri", "cid", "creator", "policies", "indexedAt"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
"policies": {
"type": "ref",
"ref": "app.bsky.labeler.defs#labelerPolicies"
},
"likeCount": { "type": "integer", "minimum": 0 },
"viewer": { "type": "ref", "ref": "#labelerViewerState" },
"indexedAt": { "type": "string", "format": "datetime" },
"labels": {
"type": "array",
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
}
}
},
"labelerViewerState": {
"type": "object",
"properties": {
"like": { "type": "string", "format": "at-uri" }
}
},
"labelerPolicies": {
"type": "object",
"required": ["labelValues"],
"properties": {
"labelValues": {
"type": "array",
"description": "The label values which this labeler publishes. May include global or custom labels.",
"items": {
"type": "ref",
"ref": "com.atproto.label.defs#labelValue"
}
},
"labelValueDefinitions": {
"type": "array",
"description": "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.",
"items": {
"type": "ref",
"ref": "com.atproto.label.defs#labelValueDefinition"
}
}
}
}
}
}
43 changes: 43 additions & 0 deletions bluesky/lexicons/app/bsky/labeler/getServices.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"lexicon": 1,
"id": "app.bsky.labeler.getServices",
"defs": {
"main": {
"type": "query",
"description": "Get information about a list of labeler services.",
"parameters": {
"type": "params",
"required": ["dids"],
"properties": {
"dids": {
"type": "array",
"items": { "type": "string", "format": "did" }
},
"detailed": {
"type": "boolean",
"default": false
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["views"],
"properties": {
"views": {
"type": "array",
"items": {
"type": "union",
"refs": [
"app.bsky.labeler.defs#labelerView",
"app.bsky.labeler.defs#labelerViewDetailed"
]
}
}
}
}
}
}
}
}
26 changes: 26 additions & 0 deletions bluesky/lexicons/app/bsky/labeler/service.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"lexicon": 1,
"id": "app.bsky.labeler.service",
"defs": {
"main": {
"type": "record",
"description": "A declaration of the existence of labeler service.",
"key": "literal:self",
"record": {
"type": "object",
"required": ["policies", "createdAt"],
"properties": {
"policies": {
"type": "ref",
"ref": "app.bsky.labeler.defs#labelerPolicies"
},
"labels": {
"type": "union",
"refs": ["com.atproto.label.defs#selfLabels"]
},
"createdAt": { "type": "string", "format": "datetime" }
}
}
}
}
}
15 changes: 14 additions & 1 deletion bluesky/lexicons/com/atproto/admin/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,12 @@
},
"subjectReviewState": {
"type": "string",
"knownValues": ["#reviewOpen", "#reviewEscalated", "#reviewClosed"]
"knownValues": [
"#reviewOpen",
"#reviewEscalated",
"#reviewClosed",
"#reviewNone"
]
},
"reviewOpen": {
"type": "token",
Expand All @@ -463,6 +468,10 @@
"type": "token",
"description": "Moderator review status of a subject: Closed. Indicates that the subject was already reviewed and resolved by a moderator"
},
"reviewNone": {
"type": "token",
"description": "Moderator review status of a subject: Unnecessary. Indicates that the subject does not need a review at the moment but there is probably some moderation related metadata available for it"
},
"modEventTakedown": {
"type": "object",
"description": "Take down a subject permanently or temporarily",
Expand Down Expand Up @@ -585,6 +594,10 @@
"type": "string",
"description": "The subject line of the email sent to the user."
},
"content": {
"type": "string",
"description": "The content of the email sent to the user."
},
"comment": {
"type": "string",
"description": "Additional comment about the outgoing comm."
Expand Down
80 changes: 80 additions & 0 deletions bluesky/lexicons/com/atproto/label/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"description": "Metadata tag on an atproto resource (eg, repo or record).",
"required": ["src", "uri", "val", "cts"],
"properties": {
"ver": {
"type": "integer",
"description": "The AT Protocol version of the label object."
},
"src": {
"type": "string",
"format": "did",
Expand Down Expand Up @@ -35,6 +39,15 @@
"type": "string",
"format": "datetime",
"description": "Timestamp when this label was created."
},
"exp": {
"type": "string",
"format": "datetime",
"description": "Timestamp at which this label expires (no longer applies)."
},
"sig": {
"type": "bytes",
"description": "Signature of dag-cbor encoded label."
}
}
},
Expand All @@ -61,6 +74,73 @@
"description": "The short string name of the value or type of this label."
}
}
},
"labelValueDefinition": {
"type": "object",
"description": "Declares a label value and its expected interpertations and behaviors.",
"required": ["identifier", "severity", "blurs", "locales"],
"properties": {
"identifier": {
"type": "string",
"description": "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
"maxLength": 100,
"maxGraphemes": 100
},
"severity": {
"type": "string",
"description": "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
"knownValues": ["inform", "alert", "none"]
},
"blurs": {
"type": "string",
"description": "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",
"knownValues": ["content", "media", "none"]
},
"locales": {
"type": "array",
"items": { "type": "ref", "ref": "#labelValueDefinitionStrings" }
}
}
},
"labelValueDefinitionStrings": {
"type": "object",
"description": "Strings which describe the label in the UI, localized into a specific language.",
"required": ["lang", "name", "description"],
"properties": {
"lang": {
"type": "string",
"description": "The code of the language these strings are written in.",
"format": "language"
},
"name": {
"type": "string",
"description": "A short human-readable name for the label.",
"maxGraphemes": 64,
"maxLength": 640
},
"description": {
"type": "string",
"description": "A longer description of what the label means and why it might be applied.",
"maxGraphemes": 10000,
"maxLength": 100000
}
}
},
"labelValue": {
"type": "string",
"knownValues": [
"!hide",
"!no-promote",
"!warn",
"!no-unauthenticated",
"dmca-violation",
"doxxing",
"porn",
"sexual",
"nudity",
"nsfl",
"gore"
]
}
}
}

0 comments on commit 06758c1

Please sign in to comment.