···1+{
2+ "lexicon": 1,
3+ "id": "com.atproto.label.defs",
4+ "defs": {
5+ "label": {
6+ "type": "object",
7+ "description": "Metadata tag on an atproto resource (eg, repo or record).",
8+ "required": ["src", "uri", "val", "cts"],
9+ "properties": {
10+ "ver": {
11+ "type": "integer",
12+ "description": "The AT Protocol version of the label object."
13+ },
14+ "src": {
15+ "type": "string",
16+ "format": "did",
17+ "description": "DID of the actor who created this label."
18+ },
19+ "uri": {
20+ "type": "string",
21+ "format": "uri",
22+ "description": "AT URI of the record, repository (account), or other resource that this label applies to."
23+ },
24+ "cid": {
25+ "type": "string",
26+ "format": "cid",
27+ "description": "Optionally, CID specifying the specific version of 'uri' resource this label applies to."
28+ },
29+ "val": {
30+ "type": "string",
31+ "maxLength": 128,
32+ "description": "The short string name of the value or type of this label."
33+ },
34+ "neg": {
35+ "type": "boolean",
36+ "description": "If true, this is a negation label, overwriting a previous label."
37+ },
38+ "cts": {
39+ "type": "string",
40+ "format": "datetime",
41+ "description": "Timestamp when this label was created."
42+ },
43+ "exp": {
44+ "type": "string",
45+ "format": "datetime",
46+ "description": "Timestamp at which this label expires (no longer applies)."
47+ },
48+ "sig": {
49+ "type": "bytes",
50+ "description": "Signature of dag-cbor encoded label."
51+ }
52+ }
53+ },
54+ "selfLabels": {
55+ "type": "object",
56+ "description": "Metadata tags on an atproto record, published by the author within the record.",
57+ "required": ["values"],
58+ "properties": {
59+ "values": {
60+ "type": "array",
61+ "items": { "type": "ref", "ref": "#selfLabel" },
62+ "maxLength": 10
63+ }
64+ }
65+ },
66+ "selfLabel": {
67+ "type": "object",
68+ "description": "Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel.",
69+ "required": ["val"],
70+ "properties": {
71+ "val": {
72+ "type": "string",
73+ "maxLength": 128,
74+ "description": "The short string name of the value or type of this label."
75+ }
76+ }
77+ },
78+ "labelValueDefinition": {
79+ "type": "object",
80+ "description": "Declares a label value and its expected interpretations and behaviors.",
81+ "required": ["identifier", "severity", "blurs", "locales"],
82+ "properties": {
83+ "identifier": {
84+ "type": "string",
85+ "description": "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
86+ "maxLength": 100,
87+ "maxGraphemes": 100
88+ },
89+ "severity": {
90+ "type": "string",
91+ "description": "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
92+ "knownValues": ["inform", "alert", "none"]
93+ },
94+ "blurs": {
95+ "type": "string",
96+ "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.",
97+ "knownValues": ["content", "media", "none"]
98+ },
99+ "defaultSetting": {
100+ "type": "string",
101+ "description": "The default setting for this label.",
102+ "knownValues": ["ignore", "warn", "hide"],
103+ "default": "warn"
104+ },
105+ "adultOnly": {
106+ "type": "boolean",
107+ "description": "Does the user need to have adult content enabled in order to configure this label?"
108+ },
109+ "locales": {
110+ "type": "array",
111+ "items": { "type": "ref", "ref": "#labelValueDefinitionStrings" }
112+ }
113+ }
114+ },
115+ "labelValueDefinitionStrings": {
116+ "type": "object",
117+ "description": "Strings which describe the label in the UI, localized into a specific language.",
118+ "required": ["lang", "name", "description"],
119+ "properties": {
120+ "lang": {
121+ "type": "string",
122+ "description": "The code of the language these strings are written in.",
123+ "format": "language"
124+ },
125+ "name": {
126+ "type": "string",
127+ "description": "A short human-readable name for the label.",
128+ "maxGraphemes": 64,
129+ "maxLength": 640
130+ },
131+ "description": {
132+ "type": "string",
133+ "description": "A longer description of what the label means and why it might be applied.",
134+ "maxGraphemes": 10000,
135+ "maxLength": 100000
136+ }
137+ }
138+ },
139+ "labelValue": {
140+ "type": "string",
141+ "knownValues": [
142+ "!hide",
143+ "!no-promote",
144+ "!warn",
145+ "!no-unauthenticated",
146+ "dmca-violation",
147+ "doxxing",
148+ "porn",
149+ "sexual",
150+ "nudity",
151+ "nsfl",
152+ "gore"
153+ ]
154+ }
155+ }
156+ }
···1+/**
2+ * GENERATED CODE - DO NOT MODIFY
3+ */
4+import { ValidationResult, BlobRef } from '@atproto/lexicon'
5+import { lexicons } from '../../../../lexicons'
6+import { isObj, hasProp } from '../../../../util'
7+import { CID } from 'multiformats/cid'
8+9+/** Metadata tag on an atproto resource (eg, repo or record). */
10+export interface Label {
11+ /** The AT Protocol version of the label object. */
12+ ver?: number
13+ /** DID of the actor who created this label. */
14+ src: string
15+ /** AT URI of the record, repository (account), or other resource that this label applies to. */
16+ uri: string
17+ /** Optionally, CID specifying the specific version of 'uri' resource this label applies to. */
18+ cid?: string
19+ /** The short string name of the value or type of this label. */
20+ val: string
21+ /** If true, this is a negation label, overwriting a previous label. */
22+ neg?: boolean
23+ /** Timestamp when this label was created. */
24+ cts: string
25+ /** Timestamp at which this label expires (no longer applies). */
26+ exp?: string
27+ /** Signature of dag-cbor encoded label. */
28+ sig?: Uint8Array
29+ [k: string]: unknown
30+}
31+32+export function isLabel(v: unknown): v is Label {
33+ return (
34+ isObj(v) &&
35+ hasProp(v, '$type') &&
36+ v.$type === 'com.atproto.label.defs#label'
37+ )
38+}
39+40+export function validateLabel(v: unknown): ValidationResult {
41+ return lexicons.validate('com.atproto.label.defs#label', v)
42+}
43+44+/** Metadata tags on an atproto record, published by the author within the record. */
45+export interface SelfLabels {
46+ values: SelfLabel[]
47+ [k: string]: unknown
48+}
49+50+export function isSelfLabels(v: unknown): v is SelfLabels {
51+ return (
52+ isObj(v) &&
53+ hasProp(v, '$type') &&
54+ v.$type === 'com.atproto.label.defs#selfLabels'
55+ )
56+}
57+58+export function validateSelfLabels(v: unknown): ValidationResult {
59+ return lexicons.validate('com.atproto.label.defs#selfLabels', v)
60+}
61+62+/** Metadata tag on an atproto record, published by the author within the record. Note that schemas should use #selfLabels, not #selfLabel. */
63+export interface SelfLabel {
64+ /** The short string name of the value or type of this label. */
65+ val: string
66+ [k: string]: unknown
67+}
68+69+export function isSelfLabel(v: unknown): v is SelfLabel {
70+ return (
71+ isObj(v) &&
72+ hasProp(v, '$type') &&
73+ v.$type === 'com.atproto.label.defs#selfLabel'
74+ )
75+}
76+77+export function validateSelfLabel(v: unknown): ValidationResult {
78+ return lexicons.validate('com.atproto.label.defs#selfLabel', v)
79+}
80+81+/** Declares a label value and its expected interpretations and behaviors. */
82+export interface LabelValueDefinition {
83+ /** The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). */
84+ identifier: string
85+ /** How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing. */
86+ severity: 'inform' | 'alert' | 'none' | (string & {})
87+ /** 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. */
88+ blurs: 'content' | 'media' | 'none' | (string & {})
89+ /** The default setting for this label. */
90+ defaultSetting: 'ignore' | 'warn' | 'hide' | (string & {})
91+ /** Does the user need to have adult content enabled in order to configure this label? */
92+ adultOnly?: boolean
93+ locales: LabelValueDefinitionStrings[]
94+ [k: string]: unknown
95+}
96+97+export function isLabelValueDefinition(v: unknown): v is LabelValueDefinition {
98+ return (
99+ isObj(v) &&
100+ hasProp(v, '$type') &&
101+ v.$type === 'com.atproto.label.defs#labelValueDefinition'
102+ )
103+}
104+105+export function validateLabelValueDefinition(v: unknown): ValidationResult {
106+ return lexicons.validate('com.atproto.label.defs#labelValueDefinition', v)
107+}
108+109+/** Strings which describe the label in the UI, localized into a specific language. */
110+export interface LabelValueDefinitionStrings {
111+ /** The code of the language these strings are written in. */
112+ lang: string
113+ /** A short human-readable name for the label. */
114+ name: string
115+ /** A longer description of what the label means and why it might be applied. */
116+ description: string
117+ [k: string]: unknown
118+}
119+120+export function isLabelValueDefinitionStrings(
121+ v: unknown,
122+): v is LabelValueDefinitionStrings {
123+ return (
124+ isObj(v) &&
125+ hasProp(v, '$type') &&
126+ v.$type === 'com.atproto.label.defs#labelValueDefinitionStrings'
127+ )
128+}
129+130+export function validateLabelValueDefinitionStrings(
131+ v: unknown,
132+): ValidationResult {
133+ return lexicons.validate(
134+ 'com.atproto.label.defs#labelValueDefinitionStrings',
135+ v,
136+ )
137+}
138+139+export type LabelValue =
140+ | '!hide'
141+ | '!no-promote'
142+ | '!warn'
143+ | '!no-unauthenticated'
144+ | 'dmca-violation'
145+ | 'doxxing'
146+ | 'porn'
147+ | 'sexual'
148+ | 'nudity'
149+ | 'nsfl'
150+ | 'gore'
151+ | (string & {})
+26
src/lexicon/types/com/atproto/repo/strongRef.ts
···00000000000000000000000000
···1+/**
2+ * GENERATED CODE - DO NOT MODIFY
3+ */
4+import { ValidationResult, BlobRef } from '@atproto/lexicon'
5+import { lexicons } from '../../../../lexicons'
6+import { isObj, hasProp } from '../../../../util'
7+import { CID } from 'multiformats/cid'
8+9+export interface Main {
10+ uri: string
11+ cid: string
12+ [k: string]: unknown
13+}
14+15+export function isMain(v: unknown): v is Main {
16+ return (
17+ isObj(v) &&
18+ hasProp(v, '$type') &&
19+ (v.$type === 'com.atproto.repo.strongRef#main' ||
20+ v.$type === 'com.atproto.repo.strongRef')
21+ )
22+}
23+24+export function validateMain(v: unknown): ValidationResult {
25+ return lexicons.validate('com.atproto.repo.strongRef#main', v)
26+}