~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/pds.js

An atproto PDS in JavaScript, for Cloudflare Workers and Node

0
0
main
3819 lines · 104.3 KB Raw History
/**
 * Lexicons for the record types this PDS enforces, and every schema they
 * reference. Generated by scripts/gen-bundled-lexicons.mjs.
 *
 * The resolver preloads these so the common write path costs no network calls.
 * Each one carries the resolver's TTL like any other cache entry, so the
 * network answer replaces it once the entry goes stale. Enforcement comes from
 * known-records.js, not from this file.
 *
 * Do not edit by hand.
 */

/** @type {import('@bigmoves/lexicon').Lexicon[]} */
export const publishedSchemas = [
  {
    id: 'app.bsky.actor.defs',
    defs: {
      nux: {
        type: 'object',
        required: ['id', 'completed'],
        properties: {
          id: {
            type: 'string',
            maxLength: 100,
          },
          data: {
            type: 'string',
            maxLength: 3000,
            description:
              'Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.',
            maxGraphemes: 300,
          },
          completed: {
            type: 'boolean',
            default: false,
          },
          expiresAt: {
            type: 'string',
            format: 'datetime',
            description:
              'The date and time at which the NUX will expire and should be considered completed.',
          },
        },
        description: 'A new user experiences (NUX) storage object',
      },
      mutedWord: {
        type: 'object',
        required: ['value', 'targets'],
        properties: {
          id: {
            type: 'string',
          },
          value: {
            type: 'string',
            maxLength: 10000,
            description: 'The muted word itself.',
            maxGraphemes: 1000,
          },
          targets: {
            type: 'array',
            items: {
              ref: 'app.bsky.actor.defs#mutedWordTarget',
              type: 'ref',
            },
            description: 'The intended targets of the muted word.',
          },
          expiresAt: {
            type: 'string',
            format: 'datetime',
            description:
              'The date and time at which the muted word will expire and no longer be applied.',
          },
          actorTarget: {
            type: 'string',
            default: 'all',
            description:
              'Groups of users to apply the muted word to. If undefined, applies to all users.',
            knownValues: ['all', 'exclude-following'],
          },
        },
        description: 'A word that the account owner has muted.',
      },
      savedFeed: {
        type: 'object',
        required: ['id', 'type', 'value', 'pinned'],
        properties: {
          id: {
            type: 'string',
          },
          type: {
            type: 'string',
            knownValues: ['feed', 'list', 'timeline'],
          },
          value: {
            type: 'string',
          },
          pinned: {
            type: 'boolean',
          },
        },
      },
      statusView: {
        type: 'object',
        required: ['status', 'record'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          embed: {
            refs: ['app.bsky.embed.external#view'],
            type: 'union',
            description: 'An optional embed associated with the status.',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          record: {
            type: 'unknown',
          },
          status: {
            type: 'string',
            description: 'The status for the account.',
            knownValues: ['app.bsky.actor.status#live'],
          },
          isActive: {
            type: 'boolean',
            description:
              'True if the status is not expired, false if it is expired. Only present if expiration was set.',
          },
          expiresAt: {
            type: 'string',
            format: 'datetime',
            description:
              'The date when this status will expire. The application might choose to no longer return the status after expiration.',
          },
          isDisabled: {
            type: 'boolean',
            description:
              "True if the user's go-live access has been disabled by a moderator, false otherwise.",
          },
        },
      },
      preferences: {
        type: 'array',
        items: {
          refs: [
            '#adultContentPref',
            '#contentLabelPref',
            '#savedFeedsPref',
            '#savedFeedsPrefV2',
            '#personalDetailsPref',
            '#declaredAgePref',
            '#feedViewPref',
            '#threadViewPref',
            '#interestsPref',
            '#mutedWordsPref',
            '#hiddenPostsPref',
            '#bskyAppStatePref',
            '#labelersPref',
            '#postInteractionSettingsPref',
            '#verificationPrefs',
            '#liveEventPreferences',
          ],
          type: 'union',
        },
      },
      profileView: {
        type: 'object',
        required: ['did', 'handle'],
        properties: {
          did: {
            type: 'string',
            format: 'did',
          },
          debug: {
            type: 'unknown',
            description: 'Debug information for internal development',
          },
          avatar: {
            type: 'string',
            format: 'uri',
          },
          handle: {
            type: 'string',
            format: 'handle',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          status: {
            ref: '#statusView',
            type: 'ref',
          },
          viewer: {
            ref: '#viewerState',
            type: 'ref',
          },
          pronouns: {
            type: 'string',
          },
          createdAt: {
            type: 'string',
            format: 'datetime',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          associated: {
            ref: '#profileAssociated',
            type: 'ref',
          },
          description: {
            type: 'string',
            maxLength: 2560,
            maxGraphemes: 256,
          },
          displayName: {
            type: 'string',
            maxLength: 640,
            maxGraphemes: 64,
          },
          verification: {
            ref: '#verificationState',
            type: 'ref',
          },
        },
      },
      viewerState: {
        type: 'object',
        properties: {
          muted: {
            type: 'boolean',
            description:
              'Whether the account is fully muted, directly or via a mutelist. False when the mute is scoped to specific kinds; see mutedOnlyReposts and mutedOnlyQuoteposts.',
          },
          blocking: {
            type: 'string',
            format: 'at-uri',
          },
          blockedBy: {
            type: 'boolean',
          },
          following: {
            type: 'string',
            format: 'at-uri',
          },
          followedBy: {
            type: 'string',
            format: 'at-uri',
          },
          mutedByList: {
            ref: 'app.bsky.graph.defs#listViewBasic',
            type: 'ref',
          },
          blockingByList: {
            ref: 'app.bsky.graph.defs#listViewBasic',
            type: 'ref',
          },
          knownFollowers: {
            ref: '#knownFollowers',
            type: 'ref',
            description:
              'This property is present only in selected cases, as an optimization.',
          },
          mutedOnlyReposts: {
            type: 'boolean',
            description:
              "Whether the account's reposts are muted. Scoped mutes are exclusive with muted: this can be true while muted is false. If muted is true, this will be false.",
          },
          mutedOnlyQuoteposts: {
            type: 'boolean',
            description:
              "Whether the account's quote posts are muted. Scoped mutes are exclusive with muted: this can be true while muted is false. If muted is true, this will be false.",
          },
          activitySubscription: {
            ref: 'app.bsky.notification.defs#activitySubscription',
            type: 'ref',
            description:
              'This property is present only in selected cases, as an optimization.',
          },
        },
        description:
          "Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.",
      },
      feedViewPref: {
        type: 'object',
        required: ['feed'],
        properties: {
          feed: {
            type: 'string',
            description:
              'The URI of the feed, or an identifier which describes the feed.',
          },
          hideReplies: {
            type: 'boolean',
            description: 'Hide replies in the feed.',
          },
          hideReposts: {
            type: 'boolean',
            description: 'Hide reposts in the feed.',
          },
          hideQuotePosts: {
            type: 'boolean',
            description: 'Hide quote posts in the feed.',
          },
          hideRepliesByLikeCount: {
            type: 'integer',
            description:
              'Hide replies in the feed if they do not have this number of likes.',
          },
          hideRepliesByUnfollowed: {
            type: 'boolean',
            default: true,
            description:
              'Hide replies in the feed if they are not by followed users.',
          },
        },
      },
      labelersPref: {
        type: 'object',
        required: ['labelers'],
        properties: {
          labelers: {
            type: 'array',
            items: {
              ref: '#labelerPrefItem',
              type: 'ref',
            },
          },
        },
      },
      interestsPref: {
        type: 'object',
        required: ['tags'],
        properties: {
          tags: {
            type: 'array',
            items: {
              type: 'string',
              maxLength: 640,
              maxGraphemes: 64,
            },
            maxLength: 100,
            description:
              "A list of tags which describe the account owner's interests gathered during onboarding.",
          },
        },
      },
      knownFollowers: {
        type: 'object',
        required: ['count', 'followers'],
        properties: {
          count: {
            type: 'integer',
          },
          followers: {
            type: 'array',
            items: {
              ref: '#profileViewBasic',
              type: 'ref',
            },
            maxLength: 5,
            minLength: 0,
          },
        },
        description: "The subject's followers whom you also follow",
      },
      mutedWordsPref: {
        type: 'object',
        required: ['items'],
        properties: {
          items: {
            type: 'array',
            items: {
              ref: 'app.bsky.actor.defs#mutedWord',
              type: 'ref',
            },
            description: 'A list of words the account owner has muted.',
          },
        },
      },
      savedFeedsPref: {
        type: 'object',
        required: ['pinned', 'saved'],
        properties: {
          saved: {
            type: 'array',
            items: {
              type: 'string',
              format: 'at-uri',
            },
          },
          pinned: {
            type: 'array',
            items: {
              type: 'string',
              format: 'at-uri',
            },
          },
          timelineIndex: {
            type: 'integer',
          },
        },
      },
      threadViewPref: {
        type: 'object',
        properties: {
          sort: {
            type: 'string',
            description: 'Sorting mode for threads.',
            knownValues: [
              'oldest',
              'newest',
              'most-likes',
              'random',
              'hotness',
            ],
          },
        },
      },
      declaredAgePref: {
        type: 'object',
        properties: {
          isOverAge13: {
            type: 'boolean',
            description:
              'Indicates if the user has declared that they are over 13 years of age.',
          },
          isOverAge16: {
            type: 'boolean',
            description:
              'Indicates if the user has declared that they are over 16 years of age.',
          },
          isOverAge18: {
            type: 'boolean',
            description:
              'Indicates if the user has declared that they are over 18 years of age.',
          },
        },
        description:
          "Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration.",
      },
      hiddenPostsPref: {
        type: 'object',
        required: ['items'],
        properties: {
          items: {
            type: 'array',
            items: {
              type: 'string',
              format: 'at-uri',
            },
            description:
              'A list of URIs of posts the account owner has hidden.',
          },
        },
      },
      labelerPrefItem: {
        type: 'object',
        required: ['did'],
        properties: {
          did: {
            type: 'string',
            format: 'did',
          },
        },
      },
      mutedWordTarget: {
        type: 'string',
        maxLength: 640,
        knownValues: ['content', 'tag'],
        maxGraphemes: 64,
      },
      adultContentPref: {
        type: 'object',
        required: ['enabled'],
        properties: {
          enabled: {
            type: 'boolean',
            default: false,
          },
        },
      },
      bskyAppStatePref: {
        type: 'object',
        properties: {
          nuxs: {
            type: 'array',
            items: {
              ref: 'app.bsky.actor.defs#nux',
              type: 'ref',
            },
            maxLength: 100,
            description: 'Storage for NUXs the user has encountered.',
          },
          isBetaUser: {
            type: 'boolean',
            description:
              'Indicates if the user is participating in the beta features program.',
          },
          queuedNudges: {
            type: 'array',
            items: {
              type: 'string',
              maxLength: 100,
            },
            maxLength: 1000,
            description:
              'An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.',
          },
          activeProgressGuide: {
            ref: '#bskyAppProgressGuide',
            type: 'ref',
          },
        },
        description:
          "A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.",
      },
      contentLabelPref: {
        type: 'object',
        required: ['label', 'visibility'],
        properties: {
          label: {
            type: 'string',
          },
          labelerDid: {
            type: 'string',
            format: 'did',
            description:
              'Which labeler does this preference apply to? If undefined, applies globally.',
          },
          visibility: {
            type: 'string',
            knownValues: ['ignore', 'show', 'warn', 'hide'],
          },
        },
      },
      profileViewBasic: {
        type: 'object',
        required: ['did', 'handle'],
        properties: {
          did: {
            type: 'string',
            format: 'did',
          },
          debug: {
            type: 'unknown',
            description: 'Debug information for internal development',
          },
          avatar: {
            type: 'string',
            format: 'uri',
          },
          handle: {
            type: 'string',
            format: 'handle',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          status: {
            ref: '#statusView',
            type: 'ref',
          },
          viewer: {
            ref: '#viewerState',
            type: 'ref',
          },
          pronouns: {
            type: 'string',
          },
          createdAt: {
            type: 'string',
            format: 'datetime',
          },
          associated: {
            ref: '#profileAssociated',
            type: 'ref',
          },
          displayName: {
            type: 'string',
            maxLength: 640,
            maxGraphemes: 64,
          },
          verification: {
            ref: '#verificationState',
            type: 'ref',
          },
        },
      },
      savedFeedsPrefV2: {
        type: 'object',
        required: ['items'],
        properties: {
          items: {
            type: 'array',
            items: {
              ref: 'app.bsky.actor.defs#savedFeed',
              type: 'ref',
            },
          },
        },
      },
      verificationView: {
        type: 'object',
        required: ['issuer', 'uri', 'isValid', 'createdAt'],
        properties: {
          uri: {
            type: 'string',
            format: 'at-uri',
            description: 'The AT-URI of the verification record.',
          },
          issuer: {
            type: 'string',
            format: 'did',
            description: 'The user who issued this verification.',
          },
          isValid: {
            type: 'boolean',
            description:
              'True if the verification passes validation, otherwise false.',
          },
          createdAt: {
            type: 'string',
            format: 'datetime',
            description: 'Timestamp when the verification was created.',
          },
          issuerHandle: {
            type: 'string',
            format: 'handle',
            description: 'The handle of the issuer.',
          },
          issuerDisplayName: {
            type: 'string',
            description: 'The display name of the issuer.',
          },
        },
        description: 'An individual verification for an associated subject.',
      },
      profileAssociated: {
        type: 'object',
        properties: {
          chat: {
            ref: '#profileAssociatedChat',
            type: 'ref',
          },
          germ: {
            ref: '#profileAssociatedGerm',
            type: 'ref',
          },
          lists: {
            type: 'integer',
          },
          labeler: {
            type: 'boolean',
          },
          feedgens: {
            type: 'integer',
          },
          starterPacks: {
            type: 'integer',
          },
          activitySubscription: {
            ref: '#profileAssociatedActivitySubscription',
            type: 'ref',
          },
        },
      },
      verificationPrefs: {
        type: 'object',
        required: [],
        properties: {
          hideBadges: {
            type: 'boolean',
            default: false,
            description:
              'Hide the blue check badges for verified accounts and trusted verifiers.',
          },
        },
        description: 'Preferences for how verified accounts appear in the app.',
      },
      verificationState: {
        type: 'object',
        required: ['verifications', 'verifiedStatus', 'trustedVerifierStatus'],
        properties: {
          verifications: {
            type: 'array',
            items: {
              ref: '#verificationView',
              type: 'ref',
            },
            description:
              'All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.',
          },
          verifiedStatus: {
            type: 'string',
            description: "The user's status as a verified account.",
            knownValues: ['valid', 'invalid', 'none'],
          },
          trustedVerifierStatus: {
            type: 'string',
            description: "The user's status as a trusted verifier.",
            knownValues: ['valid', 'invalid', 'none'],
          },
        },
        description:
          'Represents the verification information about the user this object is attached to.',
      },
      personalDetailsPref: {
        type: 'object',
        properties: {
          birthDate: {
            type: 'string',
            format: 'datetime',
            description: 'The birth date of account owner.',
          },
        },
      },
      profileViewDetailed: {
        type: 'object',
        required: ['did', 'handle'],
        properties: {
          did: {
            type: 'string',
            format: 'did',
          },
          debug: {
            type: 'unknown',
            description: 'Debug information for internal development',
          },
          avatar: {
            type: 'string',
            format: 'uri',
          },
          banner: {
            type: 'string',
            format: 'uri',
          },
          handle: {
            type: 'string',
            format: 'handle',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          status: {
            ref: '#statusView',
            type: 'ref',
          },
          viewer: {
            ref: '#viewerState',
            type: 'ref',
          },
          website: {
            type: 'string',
            format: 'uri',
          },
          pronouns: {
            type: 'string',
          },
          createdAt: {
            type: 'string',
            format: 'datetime',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          associated: {
            ref: '#profileAssociated',
            type: 'ref',
          },
          pinnedPost: {
            ref: 'com.atproto.repo.strongRef',
            type: 'ref',
          },
          postsCount: {
            type: 'integer',
          },
          description: {
            type: 'string',
            maxLength: 2560,
            maxGraphemes: 256,
          },
          displayName: {
            type: 'string',
            maxLength: 640,
            maxGraphemes: 64,
          },
          followsCount: {
            type: 'integer',
          },
          verification: {
            ref: '#verificationState',
            type: 'ref',
          },
          followersCount: {
            type: 'integer',
          },
          joinedViaStarterPack: {
            ref: 'app.bsky.graph.defs#starterPackViewBasic',
            type: 'ref',
          },
        },
      },
      bskyAppProgressGuide: {
        type: 'object',
        required: ['guide'],
        properties: {
          guide: {
            type: 'string',
            maxLength: 100,
          },
        },
        description:
          'If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.',
      },
      liveEventPreferences: {
        type: 'object',
        properties: {
          hideAllFeeds: {
            type: 'boolean',
            default: false,
            description: 'Whether to hide all feeds from live events.',
          },
          hiddenFeedIds: {
            type: 'array',
            items: {
              type: 'string',
            },
            description:
              'A list of feed IDs that the user has hidden from live events.',
          },
        },
        description: 'Preferences for live events.',
      },
      profileAssociatedChat: {
        type: 'object',
        required: ['allowIncoming'],
        properties: {
          allowIncoming: {
            type: 'string',
            knownValues: ['all', 'none', 'following'],
          },
          allowGroupInvites: {
            type: 'string',
            knownValues: ['all', 'none', 'following'],
          },
        },
      },
      profileAssociatedGerm: {
        type: 'object',
        required: ['showButtonTo', 'messageMeUrl'],
        properties: {
          messageMeUrl: {
            type: 'string',
            format: 'uri',
          },
          showButtonTo: {
            type: 'string',
            knownValues: ['usersIFollow', 'everyone'],
          },
        },
      },
      postInteractionSettingsPref: {
        type: 'object',
        required: [],
        properties: {
          threadgateAllowRules: {
            type: 'array',
            items: {
              refs: [
                'app.bsky.feed.threadgate#mentionRule',
                'app.bsky.feed.threadgate#followerRule',
                'app.bsky.feed.threadgate#followingRule',
                'app.bsky.feed.threadgate#listRule',
              ],
              type: 'union',
            },
            maxLength: 5,
            description:
              'Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.',
          },
          postgateEmbeddingRules: {
            type: 'array',
            items: {
              refs: ['app.bsky.feed.postgate#disableRule'],
              type: 'union',
            },
            maxLength: 5,
            description:
              'Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.',
          },
        },
        description:
          'Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.',
      },
      profileAssociatedActivitySubscription: {
        type: 'object',
        required: ['allowSubscriptions'],
        properties: {
          allowSubscriptions: {
            type: 'string',
            knownValues: ['followers', 'mutuals', 'none'],
          },
        },
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.actor.profile',
    defs: {
      main: {
        key: 'literal:self',
        type: 'record',
        record: {
          type: 'object',
          properties: {
            avatar: {
              type: 'blob',
              accept: ['image/png', 'image/jpeg'],
              maxSize: 1000000,
              description:
                "Small image to be displayed next to posts from account. AKA, 'profile picture'",
            },
            banner: {
              type: 'blob',
              accept: ['image/png', 'image/jpeg'],
              maxSize: 1000000,
              description:
                'Larger horizontal image to display behind profile view.',
            },
            labels: {
              refs: ['com.atproto.label.defs#selfLabels'],
              type: 'union',
              description:
                'Self-label values, specific to the Bluesky application, on the overall account.',
            },
            website: {
              type: 'string',
              format: 'uri',
            },
            pronouns: {
              type: 'string',
              maxLength: 200,
              description: 'Free-form pronouns text.',
              maxGraphemes: 20,
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
            pinnedPost: {
              ref: 'com.atproto.repo.strongRef',
              type: 'ref',
            },
            description: {
              type: 'string',
              maxLength: 2560,
              description: 'Free-form profile description text.',
              maxGraphemes: 256,
            },
            displayName: {
              type: 'string',
              maxLength: 640,
              maxGraphemes: 64,
            },
            joinedViaStarterPack: {
              ref: 'com.atproto.repo.strongRef',
              type: 'ref',
            },
          },
        },
        description: 'A declaration of a Bluesky account profile.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.actor.status',
    defs: {
      live: {
        type: 'token',
        description:
          'Advertises an account as currently offering live content.',
      },
      main: {
        key: 'literal:self',
        type: 'record',
        record: {
          type: 'object',
          required: ['status', 'createdAt'],
          properties: {
            embed: {
              refs: ['app.bsky.embed.external'],
              type: 'union',
              description: 'An optional embed associated with the status.',
            },
            status: {
              type: 'string',
              description: 'The status for the account.',
              knownValues: ['app.bsky.actor.status#live'],
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
            durationMinutes: {
              type: 'integer',
              minimum: 1,
              description:
                'The duration of the status in minutes. Applications can choose to impose minimum and maximum limits.',
            },
          },
        },
        description: 'A declaration of a Bluesky account status.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.embed.defs',
    defs: {
      aspectRatio: {
        type: 'object',
        required: ['width', 'height'],
        properties: {
          width: {
            type: 'integer',
            minimum: 1,
          },
          height: {
            type: 'integer',
            minimum: 1,
          },
        },
        description:
          'width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.embed.external',
    defs: {
      main: {
        type: 'object',
        required: ['external'],
        properties: {
          external: {
            ref: '#external',
            type: 'ref',
          },
        },
        description:
          "A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).",
      },
      view: {
        type: 'object',
        required: ['external'],
        properties: {
          external: {
            ref: '#viewExternal',
            type: 'ref',
          },
        },
      },
      colorRGB: {
        type: 'object',
        required: ['r', 'g', 'b'],
        properties: {
          b: {
            type: 'integer',
            maximum: 255,
            minimum: 0,
          },
          g: {
            type: 'integer',
            maximum: 255,
            minimum: 0,
          },
          r: {
            type: 'integer',
            maximum: 255,
            minimum: 0,
          },
        },
        description:
          'RGB color definition, inspired by site.standard.theme.color#rgb',
      },
      external: {
        type: 'object',
        required: ['uri', 'title', 'description'],
        properties: {
          uri: {
            type: 'string',
            format: 'uri',
          },
          thumb: {
            type: 'blob',
            accept: ['image/*'],
            maxSize: 1000000,
          },
          title: {
            type: 'string',
          },
          description: {
            type: 'string',
          },
          associatedRefs: {
            type: 'array',
            items: {
              ref: 'com.atproto.repo.strongRef',
              type: 'ref',
            },
            description:
              'StrongRefs (uri+cid) of the Atmosphere records that backed this view.',
          },
        },
      },
      viewExternal: {
        type: 'object',
        required: ['uri', 'title', 'description'],
        properties: {
          uri: {
            type: 'string',
            format: 'uri',
          },
          thumb: {
            type: 'string',
            format: 'uri',
          },
          title: {
            type: 'string',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          source: {
            ref: '#viewExternalSource',
            type: 'ref',
          },
          createdAt: {
            type: 'string',
            format: 'datetime',
            description:
              'When the external content was created, if available. Example: a publication date, for an article.',
          },
          updatedAt: {
            type: 'string',
            format: 'datetime',
            description: 'When the external content was updated, if available.',
          },
          description: {
            type: 'string',
          },
          readingTime: {
            type: 'integer',
            description:
              'Estimated reading time in minutes, if applicable and available.',
          },
          associatedRefs: {
            type: 'array',
            items: {
              ref: 'com.atproto.repo.strongRef',
              type: 'ref',
            },
            description:
              'StrongRefs (uri+cid) of the Atmosphere records that backed this view.',
          },
          associatedProfiles: {
            type: 'array',
            items: {
              ref: 'app.bsky.actor.defs#profileViewBasic',
              type: 'ref',
            },
            description:
              'Profiles of the owners of the Atmosphere records that backed this view.',
          },
        },
      },
      viewExternalSource: {
        type: 'object',
        required: ['uri', 'title'],
        properties: {
          uri: {
            type: 'string',
            format: 'uri',
            description:
              'URI of the source, if available. Example: the https:// URL of a site.standard.publication record.',
          },
          icon: {
            type: 'string',
            format: 'uri',
            description:
              'Fully-qualified URL where an icon representing the source can be fetched. For example, CDN location provided by the App View.',
          },
          theme: {
            ref: '#viewExternalSourceTheme',
            type: 'ref',
          },
          title: {
            type: 'string',
          },
          description: {
            type: 'string',
          },
        },
        description:
          'The source of an external embed, such as a standard.site publication.',
      },
      viewExternalSourceTheme: {
        type: 'object',
        properties: {
          accentRGB: {
            ref: '#colorRGB',
            type: 'ref',
          },
          backgroundRGB: {
            ref: '#colorRGB',
            type: 'ref',
          },
          foregroundRGB: {
            ref: '#colorRGB',
            type: 'ref',
          },
          accentForegroundRGB: {
            ref: '#colorRGB',
            type: 'ref',
          },
        },
        description:
          'The theme colors of an external source, such as a site.standard.publication. These colors may be used when rendering an embed from that source.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.embed.gallery',
    defs: {
      main: {
        type: 'object',
        required: ['items'],
        properties: {
          items: {
            type: 'array',
            items: {
              refs: ['#image'],
              type: 'union',
              description:
                'The media items in the gallery. Each item may be of a different type, but all types must be supported by the client.',
            },
            maxLength: 20,
            description:
              'The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs.',
          },
        },
      },
      view: {
        type: 'object',
        required: ['items'],
        properties: {
          items: {
            type: 'array',
            items: {
              refs: ['#viewImage'],
              type: 'union',
            },
          },
        },
      },
      image: {
        type: 'object',
        required: ['image', 'alt', 'aspectRatio'],
        properties: {
          alt: {
            type: 'string',
            description:
              'Alt text description of the image, for accessibility.',
          },
          image: {
            type: 'blob',
            accept: ['image/*'],
            maxSize: 2000000,
          },
          aspectRatio: {
            ref: 'app.bsky.embed.defs#aspectRatio',
            type: 'ref',
          },
        },
      },
      viewImage: {
        type: 'object',
        required: ['thumbnail', 'fullsize', 'alt', 'aspectRatio'],
        properties: {
          alt: {
            type: 'string',
            description:
              'Alt text description of the image, for accessibility.',
          },
          fullsize: {
            type: 'string',
            format: 'uri',
            description:
              'Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.',
          },
          thumbnail: {
            type: 'string',
            format: 'uri',
            description:
              'Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.',
          },
          aspectRatio: {
            ref: 'app.bsky.embed.defs#aspectRatio',
            type: 'ref',
          },
        },
      },
    },
    lexicon: 1,
    description:
      'An assortment of media embedded in a Bluesky record (eg, a post).',
  },
  {
    id: 'app.bsky.embed.images',
    defs: {
      main: {
        type: 'object',
        required: ['images'],
        properties: {
          images: {
            type: 'array',
            items: {
              ref: '#image',
              type: 'ref',
            },
            maxLength: 4,
          },
        },
      },
      view: {
        type: 'object',
        required: ['images'],
        properties: {
          images: {
            type: 'array',
            items: {
              ref: '#viewImage',
              type: 'ref',
            },
            maxLength: 4,
          },
        },
      },
      image: {
        type: 'object',
        required: ['image', 'alt'],
        properties: {
          alt: {
            type: 'string',
            description:
              'Alt text description of the image, for accessibility.',
          },
          image: {
            type: 'blob',
            accept: ['image/*'],
            maxSize: 2000000,
            description:
              'The raw image file. May be up to 2 MB, formerly limited to 1 MB.',
          },
          aspectRatio: {
            ref: 'app.bsky.embed.defs#aspectRatio',
            type: 'ref',
          },
        },
      },
      viewImage: {
        type: 'object',
        required: ['thumb', 'fullsize', 'alt'],
        properties: {
          alt: {
            type: 'string',
            description:
              'Alt text description of the image, for accessibility.',
          },
          thumb: {
            type: 'string',
            format: 'uri',
            description:
              'Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.',
          },
          fullsize: {
            type: 'string',
            format: 'uri',
            description:
              'Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.',
          },
          aspectRatio: {
            ref: 'app.bsky.embed.defs#aspectRatio',
            type: 'ref',
          },
        },
      },
    },
    lexicon: 1,
    description: 'A set of images embedded in a Bluesky record (eg, a post).',
  },
  {
    id: 'app.bsky.embed.record',
    defs: {
      main: {
        type: 'object',
        required: ['record'],
        properties: {
          record: {
            ref: 'com.atproto.repo.strongRef',
            type: 'ref',
          },
        },
      },
      view: {
        type: 'object',
        required: ['record'],
        properties: {
          record: {
            refs: [
              '#viewRecord',
              '#viewNotFound',
              '#viewBlocked',
              '#viewDetached',
              'app.bsky.feed.defs#generatorView',
              'app.bsky.graph.defs#listView',
              'app.bsky.labeler.defs#labelerView',
              'app.bsky.graph.defs#starterPackViewBasic',
            ],
            type: 'union',
          },
        },
      },
      viewRecord: {
        type: 'object',
        required: ['uri', 'cid', 'author', 'value', 'indexedAt'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          value: {
            type: 'unknown',
            description: 'The record data itself.',
          },
          author: {
            ref: 'app.bsky.actor.defs#profileViewBasic',
            type: 'ref',
          },
          embeds: {
            type: 'array',
            items: {
              refs: [
                'app.bsky.embed.images#view',
                'app.bsky.embed.video#view',
                'app.bsky.embed.gallery#view',
                'app.bsky.embed.external#view',
                'app.bsky.embed.record#view',
                'app.bsky.embed.recordWithMedia#view',
              ],
              type: 'union',
            },
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          likeCount: {
            type: 'integer',
          },
          quoteCount: {
            type: 'integer',
          },
          replyCount: {
            type: 'integer',
          },
          repostCount: {
            type: 'integer',
          },
        },
      },
      viewBlocked: {
        type: 'object',
        required: ['uri', 'blocked', 'author'],
        properties: {
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          author: {
            ref: 'app.bsky.feed.defs#blockedAuthor',
            type: 'ref',
          },
          blocked: {
            type: 'boolean',
            const: true,
          },
        },
      },
      viewDetached: {
        type: 'object',
        required: ['uri', 'detached'],
        properties: {
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          detached: {
            type: 'boolean',
            const: true,
          },
        },
      },
      viewNotFound: {
        type: 'object',
        required: ['uri', 'notFound'],
        properties: {
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          notFound: {
            type: 'boolean',
            const: true,
          },
        },
      },
    },
    lexicon: 1,
    description:
      'A representation of a record embedded in a Bluesky record (eg, a post). For example, a quote-post, or sharing a feed generator record.',
  },
  {
    id: 'app.bsky.embed.recordWithMedia',
    defs: {
      main: {
        type: 'object',
        required: ['record', 'media'],
        properties: {
          media: {
            refs: [
              'app.bsky.embed.images',
              'app.bsky.embed.video',
              'app.bsky.embed.gallery',
              'app.bsky.embed.external',
            ],
            type: 'union',
          },
          record: {
            ref: 'app.bsky.embed.record',
            type: 'ref',
          },
        },
      },
      view: {
        type: 'object',
        required: ['record', 'media'],
        properties: {
          media: {
            refs: [
              'app.bsky.embed.images#view',
              'app.bsky.embed.video#view',
              'app.bsky.embed.gallery#view',
              'app.bsky.embed.external#view',
            ],
            type: 'union',
          },
          record: {
            ref: 'app.bsky.embed.record#view',
            type: 'ref',
          },
        },
      },
    },
    lexicon: 1,
    description:
      'A representation of a record embedded in a Bluesky record (eg, a post), alongside other compatible embeds. For example, a quote post and image, or a quote post and external URL card.',
  },
  {
    id: 'app.bsky.embed.video',
    defs: {
      main: {
        type: 'object',
        required: ['video'],
        properties: {
          alt: {
            type: 'string',
            maxLength: 10000,
            description:
              'Alt text description of the video, for accessibility.',
            maxGraphemes: 1000,
          },
          video: {
            type: 'blob',
            accept: ['video/mp4'],
            maxSize: 300000000,
            description:
              'The mp4 video file. May be up to 300mb, formerly limited to 100mb.',
          },
          captions: {
            type: 'array',
            items: {
              ref: '#caption',
              type: 'ref',
            },
            maxLength: 20,
          },
          aspectRatio: {
            ref: 'app.bsky.embed.defs#aspectRatio',
            type: 'ref',
          },
          presentation: {
            type: 'string',
            description: 'A hint to the client about how to present the video.',
            knownValues: ['default', 'gif'],
          },
        },
      },
      view: {
        type: 'object',
        required: ['cid', 'playlist'],
        properties: {
          alt: {
            type: 'string',
            maxLength: 10000,
            maxGraphemes: 1000,
          },
          cid: {
            type: 'string',
            format: 'cid',
          },
          playlist: {
            type: 'string',
            format: 'uri',
          },
          thumbnail: {
            type: 'string',
            format: 'uri',
          },
          aspectRatio: {
            ref: 'app.bsky.embed.defs#aspectRatio',
            type: 'ref',
          },
          presentation: {
            type: 'string',
            description: 'A hint to the client about how to present the video.',
            knownValues: ['default', 'gif'],
          },
        },
      },
      caption: {
        type: 'object',
        required: ['lang', 'file'],
        properties: {
          file: {
            type: 'blob',
            accept: ['text/vtt'],
            maxSize: 20000,
          },
          lang: {
            type: 'string',
            format: 'language',
          },
        },
      },
    },
    lexicon: 1,
    description: 'A video embedded in a Bluesky record (eg, a post).',
  },
  {
    id: 'app.bsky.feed.defs',
    defs: {
      postView: {
        type: 'object',
        required: ['uri', 'cid', 'author', 'record', 'indexedAt'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          debug: {
            type: 'unknown',
            description: 'Debug information for internal development',
          },
          embed: {
            refs: [
              'app.bsky.embed.images#view',
              'app.bsky.embed.video#view',
              'app.bsky.embed.gallery#view',
              'app.bsky.embed.external#view',
              'app.bsky.embed.record#view',
              'app.bsky.embed.recordWithMedia#view',
            ],
            type: 'union',
          },
          author: {
            ref: 'app.bsky.actor.defs#profileViewBasic',
            type: 'ref',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          record: {
            type: 'unknown',
          },
          viewer: {
            ref: '#viewerState',
            type: 'ref',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          likeCount: {
            type: 'integer',
          },
          quoteCount: {
            type: 'integer',
          },
          replyCount: {
            type: 'integer',
          },
          threadgate: {
            ref: '#threadgateView',
            type: 'ref',
          },
          repostCount: {
            type: 'integer',
          },
          bookmarkCount: {
            type: 'integer',
          },
        },
      },
      replyRef: {
        type: 'object',
        required: ['root', 'parent'],
        properties: {
          root: {
            refs: ['#postView', '#notFoundPost', '#blockedPost'],
            type: 'union',
          },
          parent: {
            refs: ['#postView', '#notFoundPost', '#blockedPost'],
            type: 'union',
          },
          grandparentAuthor: {
            ref: 'app.bsky.actor.defs#profileViewBasic',
            type: 'ref',
            description:
              'When parent is a reply to another post, this is the author of that post.',
          },
        },
      },
      reasonPin: {
        type: 'object',
        properties: {},
      },
      blockedPost: {
        type: 'object',
        required: ['uri', 'blocked', 'author'],
        properties: {
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          author: {
            ref: '#blockedAuthor',
            type: 'ref',
          },
          blocked: {
            type: 'boolean',
            const: true,
          },
        },
      },
      interaction: {
        type: 'object',
        properties: {
          item: {
            type: 'string',
            format: 'at-uri',
          },
          event: {
            type: 'string',
            knownValues: [
              'app.bsky.feed.defs#requestLess',
              'app.bsky.feed.defs#requestMore',
              'app.bsky.feed.defs#clickthroughItem',
              'app.bsky.feed.defs#clickthroughAuthor',
              'app.bsky.feed.defs#clickthroughReposter',
              'app.bsky.feed.defs#clickthroughEmbed',
              'app.bsky.feed.defs#interactionSeen',
              'app.bsky.feed.defs#interactionLike',
              'app.bsky.feed.defs#interactionRepost',
              'app.bsky.feed.defs#interactionReply',
              'app.bsky.feed.defs#interactionQuote',
              'app.bsky.feed.defs#interactionShare',
            ],
          },
          reqId: {
            type: 'string',
            maxLength: 100,
            description:
              'Unique identifier per request that may be passed back alongside interactions.',
          },
          feedContext: {
            type: 'string',
            maxLength: 2000,
            description:
              'Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.',
          },
        },
      },
      knownLikers: {
        type: 'object',
        required: ['count', 'actors'],
        properties: {
          count: {
            type: 'integer',
          },
          actors: {
            type: 'array',
            items: {
              ref: 'app.bsky.actor.defs#profileViewBasic',
              type: 'ref',
            },
            maxLength: 5,
            minLength: 0,
          },
        },
        description: "The post's likers whom you also follow",
      },
      requestLess: {
        type: 'token',
        description:
          'Request that less content like the given feed item be shown in the feed',
      },
      requestMore: {
        type: 'token',
        description:
          'Request that more content like the given feed item be shown in the feed',
      },
      viewerState: {
        type: 'object',
        properties: {
          like: {
            type: 'string',
            format: 'at-uri',
          },
          pinned: {
            type: 'boolean',
          },
          repost: {
            type: 'string',
            format: 'at-uri',
          },
          bookmarked: {
            type: 'boolean',
          },
          knownLikers: {
            ref: '#knownLikers',
            type: 'ref',
            description:
              'This property is present only in selected cases, as an optimization.',
          },
          threadMuted: {
            type: 'boolean',
          },
          replyDisabled: {
            type: 'boolean',
          },
          embeddingDisabled: {
            type: 'boolean',
          },
        },
        description:
          "Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.",
      },
      feedViewPost: {
        type: 'object',
        required: ['post'],
        properties: {
          post: {
            ref: '#postView',
            type: 'ref',
          },
          reply: {
            ref: '#replyRef',
            type: 'ref',
          },
          reqId: {
            type: 'string',
            maxLength: 100,
            description:
              'Unique identifier per request that may be passed back alongside interactions.',
          },
          reason: {
            refs: ['#reasonRepost', '#reasonPin'],
            type: 'union',
          },
          feedContext: {
            type: 'string',
            maxLength: 2000,
            description:
              'Context provided by feed generator that may be passed back alongside interactions.',
          },
        },
      },
      notFoundPost: {
        type: 'object',
        required: ['uri', 'notFound'],
        properties: {
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          notFound: {
            type: 'boolean',
            const: true,
          },
        },
      },
      reasonRepost: {
        type: 'object',
        required: ['by', 'indexedAt'],
        properties: {
          by: {
            ref: 'app.bsky.actor.defs#profileViewBasic',
            type: 'ref',
          },
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
        },
      },
      blockedAuthor: {
        type: 'object',
        required: ['did'],
        properties: {
          did: {
            type: 'string',
            format: 'did',
          },
          viewer: {
            ref: 'app.bsky.actor.defs#viewerState',
            type: 'ref',
          },
        },
      },
      generatorView: {
        type: 'object',
        required: ['uri', 'cid', 'did', 'creator', 'displayName', 'indexedAt'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          did: {
            type: 'string',
            format: 'did',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          avatar: {
            type: 'string',
            format: 'uri',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          viewer: {
            ref: '#generatorViewerState',
            type: 'ref',
          },
          creator: {
            ref: 'app.bsky.actor.defs#profileView',
            type: 'ref',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          likeCount: {
            type: 'integer',
            minimum: 0,
          },
          contentMode: {
            type: 'string',
            knownValues: [
              'app.bsky.feed.defs#contentModeUnspecified',
              'app.bsky.feed.defs#contentModeVideo',
            ],
          },
          description: {
            type: 'string',
            maxLength: 3000,
            maxGraphemes: 300,
          },
          displayName: {
            type: 'string',
          },
          descriptionFacets: {
            type: 'array',
            items: {
              ref: 'app.bsky.richtext.facet',
              type: 'ref',
            },
          },
          acceptsInteractions: {
            type: 'boolean',
          },
        },
      },
      threadContext: {
        type: 'object',
        properties: {
          rootAuthorLike: {
            type: 'string',
            format: 'at-uri',
          },
        },
        description:
          'Metadata about this post within the context of the thread it is in.',
      },
      threadViewPost: {
        type: 'object',
        required: ['post'],
        properties: {
          post: {
            ref: '#postView',
            type: 'ref',
          },
          parent: {
            refs: ['#threadViewPost', '#notFoundPost', '#blockedPost'],
            type: 'union',
          },
          replies: {
            type: 'array',
            items: {
              refs: ['#threadViewPost', '#notFoundPost', '#blockedPost'],
              type: 'union',
            },
          },
          threadContext: {
            ref: '#threadContext',
            type: 'ref',
          },
        },
      },
      threadgateView: {
        type: 'object',
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          lists: {
            type: 'array',
            items: {
              ref: 'app.bsky.graph.defs#listViewBasic',
              type: 'ref',
            },
          },
          record: {
            type: 'unknown',
          },
        },
      },
      interactionLike: {
        type: 'token',
        description: 'User liked the feed item',
      },
      interactionSeen: {
        type: 'token',
        description: 'Feed item was seen by user',
      },
      clickthroughItem: {
        type: 'token',
        description: 'User clicked through to the feed item',
      },
      contentModeVideo: {
        type: 'token',
        description:
          'Declares the feed generator returns posts containing app.bsky.embed.video embeds.',
      },
      interactionQuote: {
        type: 'token',
        description: 'User quoted the feed item',
      },
      interactionReply: {
        type: 'token',
        description: 'User replied to the feed item',
      },
      interactionShare: {
        type: 'token',
        description: 'User shared the feed item',
      },
      skeletonFeedPost: {
        type: 'object',
        required: ['post'],
        properties: {
          post: {
            type: 'string',
            format: 'at-uri',
          },
          reason: {
            refs: ['#skeletonReasonRepost', '#skeletonReasonPin'],
            type: 'union',
          },
          feedContext: {
            type: 'string',
            maxLength: 2000,
            description:
              'Context that will be passed through to client and may be passed to feed generator back alongside interactions.',
          },
        },
      },
      clickthroughEmbed: {
        type: 'token',
        description:
          'User clicked through to the embedded content of the feed item',
      },
      interactionRepost: {
        type: 'token',
        description: 'User reposted the feed item',
      },
      skeletonReasonPin: {
        type: 'object',
        properties: {},
      },
      clickthroughAuthor: {
        type: 'token',
        description: 'User clicked through to the author of the feed item',
      },
      clickthroughReposter: {
        type: 'token',
        description: 'User clicked through to the reposter of the feed item',
      },
      generatorViewerState: {
        type: 'object',
        properties: {
          like: {
            type: 'string',
            format: 'at-uri',
          },
        },
      },
      skeletonReasonRepost: {
        type: 'object',
        required: ['repost'],
        properties: {
          repost: {
            type: 'string',
            format: 'at-uri',
          },
        },
      },
      contentModeUnspecified: {
        type: 'token',
        description: 'Declares the feed generator returns any types of posts.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.feed.generator',
    defs: {
      main: {
        key: 'any',
        type: 'record',
        record: {
          type: 'object',
          required: ['did', 'displayName', 'createdAt'],
          properties: {
            did: {
              type: 'string',
              format: 'did',
            },
            avatar: {
              type: 'blob',
              accept: ['image/png', 'image/jpeg'],
              maxSize: 1000000,
            },
            labels: {
              refs: ['com.atproto.label.defs#selfLabels'],
              type: 'union',
              description: 'Self-label values',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
            contentMode: {
              type: 'string',
              knownValues: [
                'app.bsky.feed.defs#contentModeUnspecified',
                'app.bsky.feed.defs#contentModeVideo',
              ],
            },
            description: {
              type: 'string',
              maxLength: 3000,
              maxGraphemes: 300,
            },
            displayName: {
              type: 'string',
              maxLength: 240,
              maxGraphemes: 24,
            },
            descriptionFacets: {
              type: 'array',
              items: {
                ref: 'app.bsky.richtext.facet',
                type: 'ref',
              },
            },
            acceptsInteractions: {
              type: 'boolean',
              description:
                'Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions',
            },
          },
        },
        description:
          'Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.feed.like',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['subject', 'createdAt'],
          properties: {
            via: {
              ref: 'com.atproto.repo.strongRef',
              type: 'ref',
            },
            subject: {
              ref: 'com.atproto.repo.strongRef',
              type: 'ref',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
          },
        },
        description: "Record declaring a 'like' of a piece of subject content.",
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.feed.post',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['text', 'createdAt'],
          properties: {
            tags: {
              type: 'array',
              items: {
                type: 'string',
                maxLength: 640,
                maxGraphemes: 64,
              },
              maxLength: 8,
              description:
                'Additional hashtags, in addition to any included in post text and facets.',
            },
            text: {
              type: 'string',
              maxLength: 3000,
              description:
                'The primary post content. May be an empty string, if there are embeds.',
              maxGraphemes: 300,
            },
            embed: {
              refs: [
                'app.bsky.embed.images',
                'app.bsky.embed.video',
                'app.bsky.embed.gallery',
                'app.bsky.embed.external',
                'app.bsky.embed.record',
                'app.bsky.embed.recordWithMedia',
              ],
              type: 'union',
            },
            langs: {
              type: 'array',
              items: {
                type: 'string',
                format: 'language',
              },
              maxLength: 3,
              description:
                'Indicates human language of post primary text content.',
            },
            reply: {
              ref: '#replyRef',
              type: 'ref',
            },
            facets: {
              type: 'array',
              items: {
                ref: 'app.bsky.richtext.facet',
                type: 'ref',
              },
              description:
                'Annotations of text (mentions, URLs, hashtags, etc)',
            },
            labels: {
              refs: ['com.atproto.label.defs#selfLabels'],
              type: 'union',
              description:
                'Self-label values for this post. Effectively content warnings.',
            },
            entities: {
              type: 'array',
              items: {
                ref: '#entity',
                type: 'ref',
              },
              description: 'DEPRECATED: replaced by app.bsky.richtext.facet.',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
              description:
                'Client-declared timestamp when this post was originally created.',
            },
          },
        },
        description: 'Record containing a Bluesky post.',
      },
      entity: {
        type: 'object',
        required: ['index', 'type', 'value'],
        properties: {
          type: {
            type: 'string',
            description: "Expected values are 'mention' and 'link'.",
          },
          index: {
            ref: '#textSlice',
            type: 'ref',
          },
          value: {
            type: 'string',
          },
        },
        description: 'Deprecated: use facets instead.',
      },
      replyRef: {
        type: 'object',
        required: ['root', 'parent'],
        properties: {
          root: {
            ref: 'com.atproto.repo.strongRef',
            type: 'ref',
          },
          parent: {
            ref: 'com.atproto.repo.strongRef',
            type: 'ref',
          },
        },
      },
      textSlice: {
        type: 'object',
        required: ['start', 'end'],
        properties: {
          end: {
            type: 'integer',
            minimum: 0,
          },
          start: {
            type: 'integer',
            minimum: 0,
          },
        },
        description:
          'Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.feed.postgate',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['post', 'createdAt'],
          properties: {
            post: {
              type: 'string',
              format: 'at-uri',
              description: 'Reference (AT-URI) to the post record.',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
            embeddingRules: {
              type: 'array',
              items: {
                refs: ['#disableRule'],
                type: 'union',
              },
              maxLength: 5,
              description:
                'List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed.',
            },
            detachedEmbeddingUris: {
              type: 'array',
              items: {
                type: 'string',
                format: 'at-uri',
              },
              maxLength: 50,
              description:
                'List of AT-URIs embedding this post that the author has detached from.',
            },
          },
        },
        description:
          'Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository.',
      },
      disableRule: {
        type: 'object',
        properties: {},
        description: 'Disables embedding of this post.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.feed.repost',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['subject', 'createdAt'],
          properties: {
            via: {
              ref: 'com.atproto.repo.strongRef',
              type: 'ref',
            },
            subject: {
              ref: 'com.atproto.repo.strongRef',
              type: 'ref',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
          },
        },
        description:
          "Record representing a 'repost' of an existing Bluesky post.",
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.feed.threadgate',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['post', 'createdAt'],
          properties: {
            post: {
              type: 'string',
              format: 'at-uri',
              description: 'Reference (AT-URI) to the post record.',
            },
            allow: {
              type: 'array',
              items: {
                refs: [
                  '#mentionRule',
                  '#followerRule',
                  '#followingRule',
                  '#listRule',
                ],
                type: 'union',
              },
              maxLength: 5,
              description:
                'List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply.',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
            hiddenReplies: {
              type: 'array',
              items: {
                type: 'string',
                format: 'at-uri',
              },
              maxLength: 300,
              description: 'List of hidden reply URIs.',
            },
          },
        },
        description:
          "Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.",
      },
      listRule: {
        type: 'object',
        required: ['list'],
        properties: {
          list: {
            type: 'string',
            format: 'at-uri',
          },
        },
        description: 'Allow replies from actors on a list.',
      },
      mentionRule: {
        type: 'object',
        properties: {},
        description: 'Allow replies from actors mentioned in your post.',
      },
      followerRule: {
        type: 'object',
        properties: {},
        description: 'Allow replies from actors who follow you.',
      },
      followingRule: {
        type: 'object',
        properties: {},
        description: 'Allow replies from actors you follow.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.graph.block',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['subject', 'createdAt'],
          properties: {
            subject: {
              type: 'string',
              format: 'did',
              description: 'DID of the account to be blocked.',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
          },
        },
        description:
          "Record declaring a 'block' relationship against another account. NOTE: blocks are public in Bluesky; see blog posts for details.",
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.graph.defs',
    defs: {
      modlist: {
        type: 'token',
        description:
          'A list of actors to apply an aggregate moderation action (mute/block) on.',
      },
      listView: {
        type: 'object',
        required: ['uri', 'cid', 'creator', 'name', 'purpose', 'indexedAt'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          name: {
            type: 'string',
            maxLength: 64,
            minLength: 1,
          },
          avatar: {
            type: 'string',
            format: 'uri',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          viewer: {
            ref: '#listViewerState',
            type: 'ref',
          },
          creator: {
            ref: 'app.bsky.actor.defs#profileView',
            type: 'ref',
          },
          purpose: {
            ref: '#listPurpose',
            type: 'ref',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          description: {
            type: 'string',
            maxLength: 3000,
            maxGraphemes: 300,
          },
          listItemCount: {
            type: 'integer',
            minimum: 0,
          },
          descriptionFacets: {
            type: 'array',
            items: {
              ref: 'app.bsky.richtext.facet',
              type: 'ref',
            },
          },
        },
      },
      curatelist: {
        type: 'token',
        description:
          'A list of actors used for curation purposes such as list feeds or interaction gating.',
      },
      listPurpose: {
        type: 'string',
        knownValues: [
          'app.bsky.graph.defs#modlist',
          'app.bsky.graph.defs#curatelist',
          'app.bsky.graph.defs#referencelist',
        ],
      },
      listItemView: {
        type: 'object',
        required: ['uri', 'subject'],
        properties: {
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          subject: {
            ref: 'app.bsky.actor.defs#profileView',
            type: 'ref',
          },
          subjectOptedOut: {
            type: 'boolean',
            const: true,
            description:
              'Set to true when the subject has opted out of appearing in the reference list. Only set when the viewer owns the list.',
          },
        },
      },
      relationship: {
        type: 'object',
        required: ['did'],
        properties: {
          did: {
            type: 'string',
            format: 'did',
          },
          blocking: {
            type: 'string',
            format: 'at-uri',
            description:
              'if the actor blocks this DID, this is the AT-URI of the block record',
          },
          blockedBy: {
            type: 'string',
            format: 'at-uri',
            description:
              'if the actor is blocked by this DID, contains the AT-URI of the block record',
          },
          following: {
            type: 'string',
            format: 'at-uri',
            description:
              'if the actor follows this DID, this is the AT-URI of the follow record',
          },
          followedBy: {
            type: 'string',
            format: 'at-uri',
            description:
              'if the actor is followed by this DID, contains the AT-URI of the follow record',
          },
          blockedByList: {
            type: 'string',
            format: 'at-uri',
            description:
              'if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record',
          },
          blockingByList: {
            type: 'string',
            format: 'at-uri',
            description:
              'if the actor blocks this DID via a block list, this is the AT-URI of the listblock record',
          },
        },
        description:
          'lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)',
      },
      listViewBasic: {
        type: 'object',
        required: ['uri', 'cid', 'name', 'purpose'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          name: {
            type: 'string',
            maxLength: 64,
            minLength: 1,
          },
          avatar: {
            type: 'string',
            format: 'uri',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          viewer: {
            ref: '#listViewerState',
            type: 'ref',
          },
          purpose: {
            ref: '#listPurpose',
            type: 'ref',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          listItemCount: {
            type: 'integer',
            minimum: 0,
          },
        },
      },
      notFoundActor: {
        type: 'object',
        required: ['actor', 'notFound'],
        properties: {
          actor: {
            type: 'string',
            format: 'at-identifier',
          },
          notFound: {
            type: 'boolean',
            const: true,
          },
        },
        description: 'indicates that a handle or DID could not be resolved',
      },
      referencelist: {
        type: 'token',
        description:
          'A list of actors used for only for reference purposes such as within a starter pack.',
      },
      listViewerState: {
        type: 'object',
        properties: {
          muted: {
            type: 'boolean',
          },
          blocked: {
            type: 'string',
            format: 'at-uri',
          },
          referenceListOptOut: {
            type: 'string',
            format: 'at-uri',
            description:
              "The authenticated viewer's app.bsky.graph.referencelistoptout record URI for this reference list. Only set for reference lists. A client can delete this record to undo the opt-out.",
          },
        },
      },
      starterPackView: {
        type: 'object',
        required: ['uri', 'cid', 'record', 'creator', 'indexedAt'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          list: {
            ref: '#listViewBasic',
            type: 'ref',
          },
          feeds: {
            type: 'array',
            items: {
              ref: 'app.bsky.feed.defs#generatorView',
              type: 'ref',
            },
            maxLength: 3,
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          record: {
            type: 'unknown',
          },
          creator: {
            ref: 'app.bsky.actor.defs#profileViewBasic',
            type: 'ref',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          joinedWeekCount: {
            type: 'integer',
            minimum: 0,
          },
          listItemsSample: {
            type: 'array',
            items: {
              ref: '#listItemView',
              type: 'ref',
            },
            maxLength: 12,
          },
          joinedAllTimeCount: {
            type: 'integer',
            minimum: 0,
          },
        },
      },
      starterPackViewBasic: {
        type: 'object',
        required: ['uri', 'cid', 'record', 'creator', 'indexedAt'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          record: {
            type: 'unknown',
          },
          creator: {
            ref: 'app.bsky.actor.defs#profileViewBasic',
            type: 'ref',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          listItemCount: {
            type: 'integer',
            minimum: 0,
          },
          joinedWeekCount: {
            type: 'integer',
            minimum: 0,
          },
          joinedAllTimeCount: {
            type: 'integer',
            minimum: 0,
          },
        },
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.graph.follow',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['subject', 'createdAt'],
          properties: {
            via: {
              ref: 'com.atproto.repo.strongRef',
              type: 'ref',
            },
            subject: {
              type: 'string',
              format: 'did',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
          },
        },
        description:
          "Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView.",
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.graph.list',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['name', 'purpose', 'createdAt'],
          properties: {
            name: {
              type: 'string',
              maxLength: 64,
              minLength: 1,
              description: 'Display name for list; can not be empty.',
            },
            avatar: {
              type: 'blob',
              accept: ['image/png', 'image/jpeg'],
              maxSize: 1000000,
            },
            labels: {
              refs: ['com.atproto.label.defs#selfLabels'],
              type: 'union',
            },
            purpose: {
              ref: 'app.bsky.graph.defs#listPurpose',
              type: 'ref',
              description:
                'Defines the purpose of the list (aka, moderation-oriented or curration-oriented)',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
            description: {
              type: 'string',
              maxLength: 3000,
              maxGraphemes: 300,
            },
            descriptionFacets: {
              type: 'array',
              items: {
                ref: 'app.bsky.richtext.facet',
                type: 'ref',
              },
            },
          },
        },
        description:
          'Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.graph.listblock',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['subject', 'createdAt'],
          properties: {
            subject: {
              type: 'string',
              format: 'at-uri',
              description: 'Reference (AT-URI) to the mod list record.',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
          },
        },
        description:
          'Record representing a block relationship against an entire an entire list of accounts (actors).',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.graph.listitem',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['subject', 'list', 'createdAt'],
          properties: {
            list: {
              type: 'string',
              format: 'at-uri',
              description:
                'Reference (AT-URI) to the list record (app.bsky.graph.list).',
            },
            subject: {
              type: 'string',
              format: 'did',
              description: 'The account which is included on the list.',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
          },
        },
        description:
          "Record representing an account's inclusion on a specific list. The AppView will ignore duplicate listitem records.",
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.graph.starterpack',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['name', 'list', 'createdAt'],
          properties: {
            list: {
              type: 'string',
              format: 'at-uri',
              description: 'Reference (AT-URI) to the list record.',
            },
            name: {
              type: 'string',
              maxLength: 500,
              minLength: 1,
              description: 'Display name for starter pack; can not be empty.',
              maxGraphemes: 50,
            },
            feeds: {
              type: 'array',
              items: {
                ref: '#feedItem',
                type: 'ref',
              },
              maxLength: 3,
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
            description: {
              type: 'string',
              maxLength: 3000,
              maxGraphemes: 300,
            },
            descriptionFacets: {
              type: 'array',
              items: {
                ref: 'app.bsky.richtext.facet',
                type: 'ref',
              },
            },
          },
        },
        description:
          'Record defining a starter pack of actors and feeds for new users.',
      },
      feedItem: {
        type: 'object',
        required: ['uri'],
        properties: {
          uri: {
            type: 'string',
            format: 'at-uri',
          },
        },
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.graph.verification',
    defs: {
      main: {
        key: 'tid',
        type: 'record',
        record: {
          type: 'object',
          required: ['subject', 'handle', 'displayName', 'createdAt'],
          properties: {
            handle: {
              type: 'string',
              format: 'handle',
              description:
                'Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.',
            },
            subject: {
              type: 'string',
              format: 'did',
              description: 'DID of the subject the verification applies to.',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
              description: 'Date of when the verification was created.',
            },
            displayName: {
              type: 'string',
              description:
                'Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying.',
            },
          },
        },
        description:
          'Record declaring a verification relationship between two accounts. Verifications are only considered valid by an app if issued by an account the app considers trusted.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.labeler.defs',
    defs: {
      labelerView: {
        type: 'object',
        required: ['uri', 'cid', 'creator', 'indexedAt'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          viewer: {
            ref: '#labelerViewerState',
            type: 'ref',
          },
          creator: {
            ref: 'app.bsky.actor.defs#profileView',
            type: 'ref',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          likeCount: {
            type: 'integer',
            minimum: 0,
          },
        },
      },
      labelerPolicies: {
        type: 'object',
        required: ['labelValues'],
        properties: {
          labelValues: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#labelValue',
              type: 'ref',
            },
            description:
              'The label values which this labeler publishes. May include global or custom labels.',
          },
          labelValueDefinitions: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#labelValueDefinition',
              type: 'ref',
            },
            description:
              'Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.',
          },
        },
      },
      labelerViewerState: {
        type: 'object',
        properties: {
          like: {
            type: 'string',
            format: 'at-uri',
          },
        },
      },
      labelerViewDetailed: {
        type: 'object',
        required: ['uri', 'cid', 'creator', 'policies', 'indexedAt'],
        properties: {
          cid: {
            type: 'string',
            format: 'cid',
          },
          uri: {
            type: 'string',
            format: 'at-uri',
          },
          labels: {
            type: 'array',
            items: {
              ref: 'com.atproto.label.defs#label',
              type: 'ref',
            },
          },
          viewer: {
            ref: '#labelerViewerState',
            type: 'ref',
          },
          creator: {
            ref: 'app.bsky.actor.defs#profileView',
            type: 'ref',
          },
          policies: {
            ref: 'app.bsky.labeler.defs#labelerPolicies',
            type: 'ref',
          },
          indexedAt: {
            type: 'string',
            format: 'datetime',
          },
          likeCount: {
            type: 'integer',
            minimum: 0,
          },
          reasonTypes: {
            type: 'array',
            items: {
              ref: 'com.atproto.moderation.defs#reasonType',
              type: 'ref',
            },
            description:
              "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.",
          },
          subjectTypes: {
            type: 'array',
            items: {
              ref: 'com.atproto.moderation.defs#subjectType',
              type: 'ref',
            },
            description:
              'The set of subject types (account, record, etc) this service accepts reports on.',
          },
          subjectCollections: {
            type: 'array',
            items: {
              type: 'string',
              format: 'nsid',
            },
            description:
              'Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.',
          },
        },
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.labeler.service',
    defs: {
      main: {
        key: 'literal:self',
        type: 'record',
        record: {
          type: 'object',
          required: ['policies', 'createdAt'],
          properties: {
            labels: {
              refs: ['com.atproto.label.defs#selfLabels'],
              type: 'union',
            },
            policies: {
              ref: 'app.bsky.labeler.defs#labelerPolicies',
              type: 'ref',
            },
            createdAt: {
              type: 'string',
              format: 'datetime',
            },
            reasonTypes: {
              type: 'array',
              items: {
                ref: 'com.atproto.moderation.defs#reasonType',
                type: 'ref',
              },
              description:
                "The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed.",
            },
            subjectTypes: {
              type: 'array',
              items: {
                ref: 'com.atproto.moderation.defs#subjectType',
                type: 'ref',
              },
              description:
                'The set of subject types (account, record, etc) this service accepts reports on.',
            },
            subjectCollections: {
              type: 'array',
              items: {
                type: 'string',
                format: 'nsid',
              },
              description:
                'Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type.',
            },
          },
        },
        description: 'A declaration of the existence of labeler service.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.notification.declaration',
    defs: {
      main: {
        key: 'literal:self',
        type: 'record',
        record: {
          type: 'object',
          required: ['allowSubscriptions'],
          properties: {
            allowSubscriptions: {
              type: 'string',
              description:
                "A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'.",
              knownValues: ['followers', 'mutuals', 'none'],
            },
          },
        },
        description:
          "A declaration of the user's choices related to notifications that can be produced by them.",
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.notification.defs',
    defs: {
      preference: {
        type: 'object',
        required: ['list', 'push'],
        properties: {
          list: {
            type: 'boolean',
          },
          push: {
            type: 'boolean',
          },
        },
      },
      preferences: {
        type: 'object',
        required: [
          'chat',
          'follow',
          'like',
          'likeViaRepost',
          'mention',
          'quote',
          'reply',
          'repost',
          'repostViaRepost',
          'starterpackJoined',
          'subscribedPost',
          'unverified',
          'verified',
        ],
        properties: {
          chat: {
            ref: '#chatPreference',
            type: 'ref',
            description:
              'Deprecated: use chat.bsky.notification preferences instead. This will only return a default value.',
          },
          like: {
            ref: '#filterablePreference',
            type: 'ref',
          },
          quote: {
            ref: '#filterablePreference',
            type: 'ref',
          },
          reply: {
            ref: '#filterablePreference',
            type: 'ref',
          },
          follow: {
            ref: '#filterablePreference',
            type: 'ref',
          },
          repost: {
            ref: '#filterablePreference',
            type: 'ref',
          },
          mention: {
            ref: '#filterablePreference',
            type: 'ref',
          },
          verified: {
            ref: '#preference',
            type: 'ref',
          },
          unverified: {
            ref: '#preference',
            type: 'ref',
          },
          likeViaRepost: {
            ref: '#filterablePreference',
            type: 'ref',
          },
          subscribedPost: {
            ref: '#preference',
            type: 'ref',
          },
          repostViaRepost: {
            ref: '#filterablePreference',
            type: 'ref',
          },
          starterpackJoined: {
            ref: '#preference',
            type: 'ref',
          },
        },
      },
      recordDeleted: {
        type: 'object',
        properties: {},
      },
      chatPreference: {
        type: 'object',
        required: ['include', 'push'],
        properties: {
          push: {
            type: 'boolean',
          },
          include: {
            type: 'string',
            knownValues: ['all', 'accepted'],
          },
        },
        description:
          'Deprecated: use chat.bsky.notification preferences instead. This will only return a default value.',
      },
      activitySubscription: {
        type: 'object',
        required: ['post', 'reply'],
        properties: {
          post: {
            type: 'boolean',
          },
          reply: {
            type: 'boolean',
          },
        },
      },
      filterablePreference: {
        type: 'object',
        required: ['include', 'list', 'push'],
        properties: {
          list: {
            type: 'boolean',
          },
          push: {
            type: 'boolean',
          },
          include: {
            type: 'string',
            knownValues: ['all', 'follows'],
          },
        },
      },
      subjectActivitySubscription: {
        type: 'object',
        required: ['subject', 'activitySubscription'],
        properties: {
          subject: {
            type: 'string',
            format: 'did',
          },
          activitySubscription: {
            ref: '#activitySubscription',
            type: 'ref',
          },
        },
        description:
          'Object used to store activity subscription data in stash.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'app.bsky.richtext.facet',
    defs: {
      tag: {
        type: 'object',
        required: ['tag'],
        properties: {
          tag: {
            type: 'string',
            maxLength: 640,
            maxGraphemes: 64,
          },
        },
        description:
          "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').",
      },
      link: {
        type: 'object',
        required: ['uri'],
        properties: {
          uri: {
            type: 'string',
            format: 'uri',
          },
        },
        description:
          'Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.',
      },
      main: {
        type: 'object',
        required: ['index', 'features'],
        properties: {
          index: {
            ref: '#byteSlice',
            type: 'ref',
          },
          features: {
            type: 'array',
            items: {
              refs: ['#mention', '#link', '#tag'],
              type: 'union',
            },
          },
        },
        description: 'Annotation of a sub-string within rich text.',
      },
      mention: {
        type: 'object',
        required: ['did'],
        properties: {
          did: {
            type: 'string',
            format: 'did',
          },
        },
        description:
          "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.",
      },
      byteSlice: {
        type: 'object',
        required: ['byteStart', 'byteEnd'],
        properties: {
          byteEnd: {
            type: 'integer',
            minimum: 0,
          },
          byteStart: {
            type: 'integer',
            minimum: 0,
          },
        },
        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.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'chat.bsky.actor.declaration',
    defs: {
      main: {
        key: 'literal:self',
        type: 'record',
        record: {
          type: 'object',
          required: ['allowIncoming'],
          properties: {
            allowIncoming: {
              type: 'string',
              knownValues: ['all', 'none', 'following'],
            },
            allowGroupInvites: {
              type: 'string',
              description:
                'Declaration about group chat invitation preferences for the record owner.',
              knownValues: ['all', 'none', 'following'],
            },
          },
        },
        description: 'A declaration of a Bluesky chat account.',
      },
    },
    lexicon: 1,
  },
  {
    id: 'com.atproto.lexicon.schema',
    defs: {
      main: {
        key: 'nsid',
        type: 'record',
        record: {
          type: 'object',
          required: ['lexicon'],
          properties: {
            lexicon: {
              type: 'integer',
              description:
                "Indicates the 'version' of the Lexicon language. Must be '1' for the current atproto/Lexicon schema system.",
            },
          },
        },
        description:
          "Representation of Lexicon schemas themselves, when published as atproto records. Note that the schema language is not defined in Lexicon; this meta schema currently only includes a single version field ('lexicon'). See the atproto specifications for description of the other expected top-level fields ('id', 'defs', etc).",
      },
    },
    lexicon: 1,
  },
  {
    id: 'com.germnetwork.declaration',
    defs: {
      main: {
        key: 'literal:self',
        type: 'record',
        record: {
          type: 'object',
          required: ['version', 'currentKey'],
          properties: {
            version: {
              type: 'string',
              maxLength: 14,
              minLength: 5,
              description:
                'Semver version number, without pre-release or build information, for the format of opaque content',
            },
            messageMe: {
              ref: '#messageMe',
              type: 'ref',
              description: 'Controls who can message this account',
            },
            currentKey: {
              type: 'bytes',
              description:
                'Opaque value, an ed25519 public key prefixed with a byte enum',
            },
            keyPackage: {
              type: 'bytes',
              description:
                'Opaque value, contains MLS KeyPackage(s), and other signature data, and is signed by the currentKey',
            },
            continuityProofs: {
              type: 'array',
              items: {
                type: 'bytes',
              },
              maxLength: 1000,
              description: 'Array of opaque values to allow for key rolling',
            },
          },
        },
        description: 'A declaration of a Germ Network account',
      },
      messageMe: {
        type: 'object',
        required: ['showButtonTo', 'messageMeUrl'],
        properties: {
          messageMeUrl: {
            type: 'string',
            format: 'uri',
            maxLength: 2047,
            minLength: 1,
            description:
              'A URL to present to an account that does not have its own com.germnetwork.declaration record, must have an empty fragment component, where the app should fill in the fragment component with the DIDs of the two accounts who wish to message each other',
          },
          showButtonTo: {
            type: 'string',
            maxLength: 100,
            minLength: 1,
            description:
              "The policy of who can message the account, this value is included in the keyPackage, but is duplicated here to allow applications to decide if they should show a 'Message on Germ' button to the viewer.",
            knownValues: ['none', 'usersIFollow', 'everyone'],
          },
        },
      },
    },
    lexicon: 1,
  },
];