Skip to content
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

Lexicons for 3rd-party labelers #2016

Merged
merged 7 commits into from
Jan 9, 2024
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
36 changes: 36 additions & 0 deletions lexicons/app/bsky/actor/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,42 @@
"description": "Show followed users at the top of all replies."
}
}
},
"labelersPref": {
"type": "object",
"required": ["labelers"],
"properties": {
"labelers": {
"type": "array",
"items": {
"type": "object",
"required": ["uri", "enabled", "labelGroupSettings"],
"properties": {
"uri": {
"type": "string",
"format": "at-uri"
},
"enabled": {
"type": "boolean"
},
"labelGroupSettings": {
"type": "array",
"items": {
"type": "object",
"required": ["labelGroup", "visibility"],
"properties": {
"labelGroup": { "type": "string" },
"visibility": {
"type": "string",
"knownValues": ["show", "warn", "hide"]
}
}
}
}
}
}
}
}
}
}
}
3 changes: 2 additions & 1 deletion 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.label.defs#labelerView"
]
}
}
Expand Down
93 changes: 93 additions & 0 deletions lexicons/app/bsky/label/defs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"lexicon": 1,
"id": "app.bsky.label.defs",
"defs": {
"labelerView": {
"type": "object",
"required": ["uri", "cid", "did", "creator", "displayName", "indexedAt"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"did": { "type": "string", "format": "did" },
"creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
"displayName": { "type": "string" },
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"avatar": { "type": "string" },
"likeCount": { "type": "integer", "minimum": 0 },
"viewer": { "type": "ref", "ref": "#labelerViewerState" },
"indexedAt": { "type": "string", "format": "datetime" }
}
},
"labelerViewDetailed": {
"type": "object",
"required": ["uri", "cid", "did", "creator", "displayName", "indexedAt"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"did": { "type": "string", "format": "did" },
"creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
"displayName": { "type": "string" },
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"avatar": { "type": "string" },
"policies": {
"type": "ref",
"ref": "app.bsky.label.defs#labelerPolicies"
},
"likeCount": { "type": "integer", "minimum": 0 },
"viewer": { "type": "ref", "ref": "#labelerViewerState" },
"indexedAt": { "type": "string", "format": "datetime" }
}
},
"labelerViewerState": {
"type": "object",
"properties": {
"like": { "type": "string", "format": "at-uri" }
}
},
"labelerPolicies": {
"type": "object",
"required": ["reportReasons", "labelValues"],
"properties": {
"description": {
pfrazee marked this conversation as resolved.
Show resolved Hide resolved
"type": "string",
"maxGraphemes": 10000,
"maxLength": 100000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"reportReasons": {
"type": "array",
"items": {
"type": "ref",
"ref": "com.atproto.moderation.defs#reasonType"
}
},
"labelValues": {
pfrazee marked this conversation as resolved.
Show resolved Hide resolved
"type": "array",
"items": {
"type": "ref",
"ref": "com.atproto.label.defs#labelValue"
}
}
}
}
}
}
41 changes: 41 additions & 0 deletions lexicons/app/bsky/label/getActorLabelers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"lexicon": 1,
"id": "app.bsky.label.getActorLabelers",
"defs": {
"main": {
"type": "query",
"description": "Get a list of labelers created by the actor.",
"parameters": {
"type": "params",
"required": ["actor"],
"properties": {
"actor": { "type": "string", "format": "at-identifier" },
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": { "type": "string" }
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["labelers"],
"properties": {
"cursor": { "type": "string" },
"labelers": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.label.defs#labelerView"
}
}
}
}
}
}
}
}
30 changes: 30 additions & 0 deletions lexicons/app/bsky/label/getLabeler.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"lexicon": 1,
"id": "app.bsky.label.getLabeler",
"defs": {
"main": {
"type": "query",
"description": "Get information about a labeler.",
"parameters": {
"type": "params",
"required": ["labeler"],
"properties": {
"labeler": { "type": "string", "format": "at-uri" }
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["view"],
"properties": {
"view": {
"type": "ref",
"ref": "app.bsky.label.defs#labelerViewDetailed"
}
}
}
}
}
}
}
36 changes: 36 additions & 0 deletions lexicons/app/bsky/label/getLabelers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"lexicon": 1,
"id": "app.bsky.label.getLabelers",
"defs": {
"main": {
"type": "query",
"description": "Get information about a list of labelers.",
"parameters": {
"type": "params",
"required": ["labelers"],
"properties": {
"labelers": {
"type": "array",
"items": { "type": "string", "format": "at-uri" }
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["labelers"],
"properties": {
"labelers": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.label.defs#labelerView"
}
}
}
}
}
}
}
}
46 changes: 46 additions & 0 deletions lexicons/app/bsky/label/labeler.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"lexicon": 1,
"id": "app.bsky.label.labeler",
"defs": {
"main": {
"type": "record",
"description": "A declaration of the existence of labeler.",
"key": "any",
"record": {
"type": "object",
"required": ["did", "displayName", "policies", "createdAt"],
"properties": {
"did": { "type": "string", "format": "did" },
"displayName": {
"type": "string",
"maxGraphemes": 24,
"maxLength": 240
},
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"avatar": {
"type": "blob",
"accept": ["image/png", "image/jpeg"],
"maxSize": 1000000
},
"policies": {
"type": "ref",
"ref": "app.bsky.label.defs#labelerPolicies"
},
"labels": {
"type": "union",
"refs": ["com.atproto.label.defs#selfLabels"]
},
"createdAt": { "type": "string", "format": "datetime" }
}
}
}
}
}
33 changes: 33 additions & 0 deletions lexicons/com/atproto/label/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,39 @@
"description": "The short string name of the value or type of this label."
}
}
},
"labelValue": {
"type": "string",
"knownValues": [
"!hide",
"!no-promote",
"!warn",
"!no-unauthenticated",
"dmca-violation",
"doxxing",
"porn",
"sexual",
"nudity",
"nsfl",
"corpse",
"gore",
"torture",
"self-harm",
"intolerant-race",
"intolerant-gender",
"intolerant-sexual-orientation",
"intolerant-religion",
"intolerant",
"icon-intolerant",
"threat",
"spoiler",
"spam",
"account-security",
"net-abuse",
"impersonation",
"scam",
"misleading"
]
}
}
}
Loading