···11+{
22+ "lexicon": 1,
33+ "id": "com.atproto.label.defs",
44+ "defs": {
55+ "label": {
66+ "type": "object",
77+ "description": "Metadata tag on an atproto resource (eg, repo or record).",
88+ "required": ["src", "uri", "val", "cts"],
99+ "properties": {
1010+ "ver": {
1111+ "type": "integer",
1212+ "description": "The AT Protocol version of the label object."
1313+ },
1414+ "src": {
1515+ "type": "string",
1616+ "format": "did",
1717+ "description": "DID of the actor who created this label."
1818+ },
1919+ "uri": {
2020+ "type": "string",
2121+ "format": "uri",
2222+ "description": "AT URI of the record, repository (account), or other resource that this label applies to."
2323+ },
2424+ "cid": {
2525+ "type": "string",
2626+ "format": "cid",
2727+ "description": "Optionally, CID specifying the specific version of 'uri' resource this label applies to."
2828+ },
2929+ "val": {
3030+ "type": "string",
3131+ "maxLength": 128,
3232+ "description": "The short string name of the value or type of this label."
3333+ },
3434+ "neg": {
3535+ "type": "boolean",
3636+ "description": "If true, this is a negation label, overwriting a previous label."
3737+ },
3838+ "cts": {
3939+ "type": "string",
4040+ "format": "datetime",
4141+ "description": "Timestamp when this label was created."
4242+ },
4343+ "exp": {
4444+ "type": "string",
4545+ "format": "datetime",
4646+ "description": "Timestamp at which this label expires (no longer applies)."
4747+ },
4848+ "sig": {
4949+ "type": "bytes",
5050+ "description": "Signature of dag-cbor encoded label."
5151+ }
5252+ }
5353+ },
5454+ "selfLabels": {
5555+ "type": "object",
5656+ "description": "Metadata tags on an atproto record, published by the author within the record.",
5757+ "required": ["values"],
5858+ "properties": {
5959+ "values": {
6060+ "type": "array",
6161+ "items": { "type": "ref", "ref": "#selfLabel" },
6262+ "maxLength": 10
6363+ }
6464+ }
6565+ },
6666+ "selfLabel": {
6767+ "type": "object",
6868+ "description": "Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.",
6969+ "required": ["val"],
7070+ "properties": {
7171+ "val": {
7272+ "type": "string",
7373+ "maxLength": 128,
7474+ "description": "The short string name of the value or type of this label."
7575+ }
7676+ }
7777+ },
7878+ "labelValueDefinition": {
7979+ "type": "object",
8080+ "description": "Declares a label value and its expected interpretations and behaviors.",
8181+ "required": ["identifier", "severity", "blurs", "locales"],
8282+ "properties": {
8383+ "identifier": {
8484+ "type": "string",
8585+ "description": "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
8686+ "maxLength": 100,
8787+ "maxGraphemes": 100
8888+ },
8989+ "severity": {
9090+ "type": "string",
9191+ "description": "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
9292+ "knownValues": ["inform", "alert", "none"]
9393+ },
9494+ "blurs": {
9595+ "type": "string",
9696+ "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.",
9797+ "knownValues": ["content", "media", "none"]
9898+ },
9999+ "defaultSetting": {
100100+ "type": "string",
101101+ "description": "The default setting for this label.",
102102+ "knownValues": ["ignore", "warn", "hide"],
103103+ "default": "warn"
104104+ },
105105+ "adultOnly": {
106106+ "type": "boolean",
107107+ "description": "Does the user need to have adult content enabled in order to configure this label?"
108108+ },
109109+ "locales": {
110110+ "type": "array",
111111+ "items": { "type": "ref", "ref": "#labelValueDefinitionStrings" }
112112+ }
113113+ }
114114+ },
115115+ "labelValueDefinitionStrings": {
116116+ "type": "object",
117117+ "description": "Strings which describe the label in the UI, localized into a specific language.",
118118+ "required": ["lang", "name", "description"],
119119+ "properties": {
120120+ "lang": {
121121+ "type": "string",
122122+ "description": "The code of the language these strings are written in.",
123123+ "format": "language"
124124+ },
125125+ "name": {
126126+ "type": "string",
127127+ "description": "A short human-readable name for the label.",
128128+ "maxGraphemes": 64,
129129+ "maxLength": 640
130130+ },
131131+ "description": {
132132+ "type": "string",
133133+ "description": "A longer description of what the label means and why it might be applied.",
134134+ "maxGraphemes": 10000,
135135+ "maxLength": 100000
136136+ }
137137+ }
138138+ },
139139+ "labelValue": {
140140+ "type": "string",
141141+ "knownValues": [
142142+ "!hide",
143143+ "!no-promote",
144144+ "!warn",
145145+ "!no-unauthenticated",
146146+ "dmca-violation",
147147+ "doxxing",
148148+ "porn",
149149+ "sexual",
150150+ "nudity",
151151+ "nsfl",
152152+ "gore"
153153+ ]
154154+ }
155155+ }
156156+ }
···1818 xrpc: XrpcServer
1919 app: AppNS
2020 xyz: XyzNS
2121+ com: ComNS
21222223 constructor(options?: XrpcOptions) {
2324 this.xrpc = createXrpcServer(schemas, options)
2425 this.app = new AppNS(this)
2526 this.xyz = new XyzNS(this)
2727+ this.com = new ComNS(this)
2628 }
2729}
2830···6567}
66686769export class XyzStatusphereNS {
7070+ _server: Server
7171+7272+ constructor(server: Server) {
7373+ this._server = server
7474+ }
7575+}
7676+7777+export class ComNS {
7878+ _server: Server
7979+ atproto: ComAtprotoNS
8080+8181+ constructor(server: Server) {
8282+ this._server = server
8383+ this.atproto = new ComAtprotoNS(server)
8484+ }
8585+}
8686+8787+export class ComAtprotoNS {
8888+ _server: Server
8989+ repo: ComAtprotoRepoNS
9090+9191+ constructor(server: Server) {
9292+ this._server = server
9393+ this.repo = new ComAtprotoRepoNS(server)
9494+ }
9595+}
9696+9797+export class ComAtprotoRepoNS {
6898 _server: Server
699970100 constructor(server: Server) {
+202
src/lexicon/lexicons.ts
···44import { LexiconDoc, Lexicons } from '@atproto/lexicon'
5566export const schemaDict = {
77+ ComAtprotoLabelDefs: {
88+ lexicon: 1,
99+ id: 'com.atproto.label.defs',
1010+ defs: {
1111+ label: {
1212+ type: 'object',
1313+ description:
1414+ 'Metadata tag on an atproto resource (eg, repo or record).',
1515+ required: ['src', 'uri', 'val', 'cts'],
1616+ properties: {
1717+ ver: {
1818+ type: 'integer',
1919+ description: 'The AT Protocol version of the label object.',
2020+ },
2121+ src: {
2222+ type: 'string',
2323+ format: 'did',
2424+ description: 'DID of the actor who created this label.',
2525+ },
2626+ uri: {
2727+ type: 'string',
2828+ format: 'uri',
2929+ description:
3030+ 'AT URI of the record, repository (account), or other resource that this label applies to.',
3131+ },
3232+ cid: {
3333+ type: 'string',
3434+ format: 'cid',
3535+ description:
3636+ "Optionally, CID specifying the specific version of 'uri' resource this label applies to.",
3737+ },
3838+ val: {
3939+ type: 'string',
4040+ maxLength: 128,
4141+ description:
4242+ 'The short string name of the value or type of this label.',
4343+ },
4444+ neg: {
4545+ type: 'boolean',
4646+ description:
4747+ 'If true, this is a negation label, overwriting a previous label.',
4848+ },
4949+ cts: {
5050+ type: 'string',
5151+ format: 'datetime',
5252+ description: 'Timestamp when this label was created.',
5353+ },
5454+ exp: {
5555+ type: 'string',
5656+ format: 'datetime',
5757+ description:
5858+ 'Timestamp at which this label expires (no longer applies).',
5959+ },
6060+ sig: {
6161+ type: 'bytes',
6262+ description: 'Signature of dag-cbor encoded label.',
6363+ },
6464+ },
6565+ },
6666+ selfLabels: {
6767+ type: 'object',
6868+ description:
6969+ 'Metadata tags on an atproto record, published by the author within the record.',
7070+ required: ['values'],
7171+ properties: {
7272+ values: {
7373+ type: 'array',
7474+ items: {
7575+ type: 'ref',
7676+ ref: 'lex:com.atproto.label.defs#selfLabel',
7777+ },
7878+ maxLength: 10,
7979+ },
8080+ },
8181+ },
8282+ selfLabel: {
8383+ type: 'object',
8484+ description:
8585+ 'Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.',
8686+ required: ['val'],
8787+ properties: {
8888+ val: {
8989+ type: 'string',
9090+ maxLength: 128,
9191+ description:
9292+ 'The short string name of the value or type of this label.',
9393+ },
9494+ },
9595+ },
9696+ labelValueDefinition: {
9797+ type: 'object',
9898+ description:
9999+ 'Declares a label value and its expected interpretations and behaviors.',
100100+ required: ['identifier', 'severity', 'blurs', 'locales'],
101101+ properties: {
102102+ identifier: {
103103+ type: 'string',
104104+ description:
105105+ "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
106106+ maxLength: 100,
107107+ maxGraphemes: 100,
108108+ },
109109+ severity: {
110110+ type: 'string',
111111+ description:
112112+ "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
113113+ knownValues: ['inform', 'alert', 'none'],
114114+ },
115115+ blurs: {
116116+ type: 'string',
117117+ description:
118118+ "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.",
119119+ knownValues: ['content', 'media', 'none'],
120120+ },
121121+ defaultSetting: {
122122+ type: 'string',
123123+ description: 'The default setting for this label.',
124124+ knownValues: ['ignore', 'warn', 'hide'],
125125+ default: 'warn',
126126+ },
127127+ adultOnly: {
128128+ type: 'boolean',
129129+ description:
130130+ 'Does the user need to have adult content enabled in order to configure this label?',
131131+ },
132132+ locales: {
133133+ type: 'array',
134134+ items: {
135135+ type: 'ref',
136136+ ref: 'lex:com.atproto.label.defs#labelValueDefinitionStrings',
137137+ },
138138+ },
139139+ },
140140+ },
141141+ labelValueDefinitionStrings: {
142142+ type: 'object',
143143+ description:
144144+ 'Strings which describe the label in the UI, localized into a specific language.',
145145+ required: ['lang', 'name', 'description'],
146146+ properties: {
147147+ lang: {
148148+ type: 'string',
149149+ description:
150150+ 'The code of the language these strings are written in.',
151151+ format: 'language',
152152+ },
153153+ name: {
154154+ type: 'string',
155155+ description: 'A short human-readable name for the label.',
156156+ maxGraphemes: 64,
157157+ maxLength: 640,
158158+ },
159159+ description: {
160160+ type: 'string',
161161+ description:
162162+ 'A longer description of what the label means and why it might be applied.',
163163+ maxGraphemes: 10000,
164164+ maxLength: 100000,
165165+ },
166166+ },
167167+ },
168168+ labelValue: {
169169+ type: 'string',
170170+ knownValues: [
171171+ '!hide',
172172+ '!no-promote',
173173+ '!warn',
174174+ '!no-unauthenticated',
175175+ 'dmca-violation',
176176+ 'doxxing',
177177+ 'porn',
178178+ 'sexual',
179179+ 'nudity',
180180+ 'nsfl',
181181+ 'gore',
182182+ ],
183183+ },
184184+ },
185185+ },
7186 AppBskyActorProfile: {
8187 lexicon: 1,
9188 id: 'app.bsky.actor.profile',
···85264 },
86265 },
87266 },
267267+ ComAtprotoRepoStrongRef: {
268268+ lexicon: 1,
269269+ id: 'com.atproto.repo.strongRef',
270270+ description: 'A URI with a content-hash fingerprint.',
271271+ defs: {
272272+ main: {
273273+ type: 'object',
274274+ required: ['uri', 'cid'],
275275+ properties: {
276276+ uri: {
277277+ type: 'string',
278278+ format: 'at-uri',
279279+ },
280280+ cid: {
281281+ type: 'string',
282282+ format: 'cid',
283283+ },
284284+ },
285285+ },
286286+ },
287287+ },
88288}
89289export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]
90290export const lexicons: Lexicons = new Lexicons(schemas)
91291export const ids = {
292292+ ComAtprotoLabelDefs: 'com.atproto.label.defs',
92293 AppBskyActorProfile: 'app.bsky.actor.profile',
93294 XyzStatusphereStatus: 'xyz.statusphere.status',
295295+ ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef',
94296}
+151
src/lexicon/types/com/atproto/label/defs.ts
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { ValidationResult, BlobRef } from '@atproto/lexicon'
55+import { lexicons } from '../../../../lexicons'
66+import { isObj, hasProp } from '../../../../util'
77+import { CID } from 'multiformats/cid'
88+99+/** Metadata tag on an atproto resource (eg, repo or record). */
1010+export interface Label {
1111+ /** The AT Protocol version of the label object. */
1212+ ver?: number
1313+ /** DID of the actor who created this label. */
1414+ src: string
1515+ /** AT URI of the record, repository (account), or other resource that this label applies to. */
1616+ uri: string
1717+ /** Optionally, CID specifying the specific version of 'uri' resource this label applies to. */
1818+ cid?: string
1919+ /** The short string name of the value or type of this label. */
2020+ val: string
2121+ /** If true, this is a negation label, overwriting a previous label. */
2222+ neg?: boolean
2323+ /** Timestamp when this label was created. */
2424+ cts: string
2525+ /** Timestamp at which this label expires (no longer applies). */
2626+ exp?: string
2727+ /** Signature of dag-cbor encoded label. */
2828+ sig?: Uint8Array
2929+ [k: string]: unknown
3030+}
3131+3232+export function isLabel(v: unknown): v is Label {
3333+ return (
3434+ isObj(v) &&
3535+ hasProp(v, '$type') &&
3636+ v.$type === 'com.atproto.label.defs#label'
3737+ )
3838+}
3939+4040+export function validateLabel(v: unknown): ValidationResult {
4141+ return lexicons.validate('com.atproto.label.defs#label', v)
4242+}
4343+4444+/** Metadata tags on an atproto record, published by the author within the record. */
4545+export interface SelfLabels {
4646+ values: SelfLabel[]
4747+ [k: string]: unknown
4848+}
4949+5050+export function isSelfLabels(v: unknown): v is SelfLabels {
5151+ return (
5252+ isObj(v) &&
5353+ hasProp(v, '$type') &&
5454+ v.$type === 'com.atproto.label.defs#selfLabels'
5555+ )
5656+}
5757+5858+export function validateSelfLabels(v: unknown): ValidationResult {
5959+ return lexicons.validate('com.atproto.label.defs#selfLabels', v)
6060+}
6161+6262+/** Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. */
6363+export interface SelfLabel {
6464+ /** The short string name of the value or type of this label. */
6565+ val: string
6666+ [k: string]: unknown
6767+}
6868+6969+export function isSelfLabel(v: unknown): v is SelfLabel {
7070+ return (
7171+ isObj(v) &&
7272+ hasProp(v, '$type') &&
7373+ v.$type === 'com.atproto.label.defs#selfLabel'
7474+ )
7575+}
7676+7777+export function validateSelfLabel(v: unknown): ValidationResult {
7878+ return lexicons.validate('com.atproto.label.defs#selfLabel', v)
7979+}
8080+8181+/** Declares a label value and its expected interpretations and behaviors. */
8282+export interface LabelValueDefinition {
8383+ /** The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). */
8484+ identifier: string
8585+ /** How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. */
8686+ severity: 'inform' | 'alert' | 'none' | (string & {})
8787+ /** 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. */
8888+ blurs: 'content' | 'media' | 'none' | (string & {})
8989+ /** The default setting for this label. */
9090+ defaultSetting: 'ignore' | 'warn' | 'hide' | (string & {})
9191+ /** Does the user need to have adult content enabled in order to configure this label? */
9292+ adultOnly?: boolean
9393+ locales: LabelValueDefinitionStrings[]
9494+ [k: string]: unknown
9595+}
9696+9797+export function isLabelValueDefinition(v: unknown): v is LabelValueDefinition {
9898+ return (
9999+ isObj(v) &&
100100+ hasProp(v, '$type') &&
101101+ v.$type === 'com.atproto.label.defs#labelValueDefinition'
102102+ )
103103+}
104104+105105+export function validateLabelValueDefinition(v: unknown): ValidationResult {
106106+ return lexicons.validate('com.atproto.label.defs#labelValueDefinition', v)
107107+}
108108+109109+/** Strings which describe the label in the UI, localized into a specific language. */
110110+export interface LabelValueDefinitionStrings {
111111+ /** The code of the language these strings are written in. */
112112+ lang: string
113113+ /** A short human-readable name for the label. */
114114+ name: string
115115+ /** A longer description of what the label means and why it might be applied. */
116116+ description: string
117117+ [k: string]: unknown
118118+}
119119+120120+export function isLabelValueDefinitionStrings(
121121+ v: unknown,
122122+): v is LabelValueDefinitionStrings {
123123+ return (
124124+ isObj(v) &&
125125+ hasProp(v, '$type') &&
126126+ v.$type === 'com.atproto.label.defs#labelValueDefinitionStrings'
127127+ )
128128+}
129129+130130+export function validateLabelValueDefinitionStrings(
131131+ v: unknown,
132132+): ValidationResult {
133133+ return lexicons.validate(
134134+ 'com.atproto.label.defs#labelValueDefinitionStrings',
135135+ v,
136136+ )
137137+}
138138+139139+export type LabelValue =
140140+ | '!hide'
141141+ | '!no-promote'
142142+ | '!warn'
143143+ | '!no-unauthenticated'
144144+ | 'dmca-violation'
145145+ | 'doxxing'
146146+ | 'porn'
147147+ | 'sexual'
148148+ | 'nudity'
149149+ | 'nsfl'
150150+ | 'gore'
151151+ | (string & {})
+26
src/lexicon/types/com/atproto/repo/strongRef.ts
···11+/**
22+ * GENERATED CODE - DO NOT MODIFY
33+ */
44+import { ValidationResult, BlobRef } from '@atproto/lexicon'
55+import { lexicons } from '../../../../lexicons'
66+import { isObj, hasProp } from '../../../../util'
77+import { CID } from 'multiformats/cid'
88+99+export interface Main {
1010+ uri: string
1111+ cid: string
1212+ [k: string]: unknown
1313+}
1414+1515+export function isMain(v: unknown): v is Main {
1616+ return (
1717+ isObj(v) &&
1818+ hasProp(v, '$type') &&
1919+ (v.$type === 'com.atproto.repo.strongRef#main' ||
2020+ v.$type === 'com.atproto.repo.strongRef')
2121+ )
2222+}
2323+2424+export function validateMain(v: unknown): ValidationResult {
2525+ return lexicons.validate('com.atproto.repo.strongRef#main', v)
2626+}