Improve codegen typings ()

* Make codegen types stricter
* Add .js file extension to import statements in generated code
* Fixes a bug that would clear interests prefs when updating hidden posts prefs.
This commit is contained in:
Matthieu Sieben 2025-02-13 15:21:00 +01:00 committed by GitHub
parent f90eedc865
commit c53d943c8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1014 changed files with 18484 additions and 15645 deletions
.changeset
.prettierignore
packages/api

@ -0,0 +1,5 @@
---
"@atproto/api": patch
---
Fixes a bug that would clear interests prefs when updating hidden posts

@ -0,0 +1,10 @@
---
"@atproto/ozone": patch
"@atproto/bsky": patch
"@atproto/api": minor
"@atproto/pds": patch
---
Update Lexicon derived code to better reflect data typings. In particular, Lexicon derived interfaces will now explicitly include the `$type` property that can be present in the data.

@ -0,0 +1,5 @@
---
"@atproto/syntax": patch
---
Improve performance of isValidTid

@ -0,0 +1,5 @@
---
"@atproto/lex-cli": minor
---
Update the code generation to better reflect the data typings. In particular this change will cause generated code to explicit the `$type` property that can be present in the data.

@ -0,0 +1,5 @@
---
"@atproto/pds": patch
---
Minor typing fixes

@ -0,0 +1,5 @@
---
"@atproto/api": minor
---
Helper functions (e.g. `NS.isRecord`) no longer casts the output value. Use `asPredicate(NS.validateRecord)` to create a predicate function that will ensure that an unknown value is indeed an `NS.Record`. The `isX` helper function's purpose is to discriminate between `$type`d values from unions.

@ -0,0 +1,5 @@
---
"@atproto/lex-cli": patch
---
Add `.js` file extension to `import` statements in generated code.

@ -0,0 +1,5 @@
---
"@atproto/lexicon": patch
---
Various performance improvements

@ -0,0 +1,5 @@
---
"@atproto/lex-cli": patch
---
Type the generated `ids` object (that contains all the lexicon namespace ids) as `const`.

@ -0,0 +1,5 @@
---
"@atproto/lexicon": patch
---
Fully type `ValidationResult`'s `value` property, allowing `NS.validateMyType` helper functions to return a typed value in case of success.

@ -0,0 +1,5 @@
---
"@atproto/lex-cli": minor
---
Remove `[string]: unknown` index signature from custom user objects, input and output schemas.

@ -0,0 +1,5 @@
---
"@atproto/lex-cli": patch
---
Ensures that empty `schemas` arrays are typed as `LexiconDoc[]`.

@ -6,3 +6,9 @@ pnpm-lock.yaml
.pnpm*
.changeset
CHANGELOG.md
# Prettier is used to format the code during codegen
packages/api/src/client
packages/bsky/src/lexicon
packages/pds/src/lexicon
packages/ozone/src/lexicon

@ -5,4 +5,5 @@ module.exports = {
testTimeout: 60000,
setupFiles: ['<rootDir>/../../jest.setup.ts'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
moduleNameMapper: { '^(\\.\\.?\\/.+)\\.js$': ['$1.ts', '$1.js'] },
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,7 +1,13 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import { LexiconDoc, Lexicons } from '@atproto/lexicon'
import {
LexiconDoc,
Lexicons,
ValidationError,
ValidationResult,
} from '@atproto/lexicon'
import { $Typed, is$typed, maybe$typed } from './util.js'
export const schemaDict = {
ComAtprotoAdminDefs: {
@ -13871,8 +13877,37 @@ export const schemaDict = {
},
} as const satisfies Record<string, LexiconDoc>
export const schemas = Object.values(schemaDict)
export const schemas = Object.values(schemaDict) satisfies LexiconDoc[]
export const lexicons: Lexicons = new Lexicons(schemas)
export function validate<T extends { $type: string }>(
v: unknown,
id: string,
hash: string,
requiredType: true,
): ValidationResult<T>
export function validate<T extends { $type?: string }>(
v: unknown,
id: string,
hash: string,
requiredType?: false,
): ValidationResult<T>
export function validate(
v: unknown,
id: string,
hash: string,
requiredType?: boolean,
): ValidationResult {
return (requiredType ? is$typed : maybe$typed)(v, id, hash)
? lexicons.validate(`${id}#${hash}`, v)
: {
success: false,
error: new ValidationError(
`Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`,
),
}
}
export const ids = {
ComAtprotoAdminDefs: 'com.atproto.admin.defs',
ComAtprotoAdminDeleteAccount: 'com.atproto.admin.deleteAccount',
@ -14124,4 +14159,4 @@ export const ids = {
ToolsOzoneTeamDeleteMember: 'tools.ozone.team.deleteMember',
ToolsOzoneTeamListMembers: 'tools.ozone.team.listMembers',
ToolsOzoneTeamUpdateMember: 'tools.ozone.team.updateMember',
}
} as const

@ -2,16 +2,21 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as AppBskyGraphDefs from '../graph/defs'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
import * as AppBskyFeedThreadgate from '../feed/threadgate'
import * as AppBskyFeedPostgate from '../feed/postgate'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
import type * as AppBskyGraphDefs from '../graph/defs.js'
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'
import type * as AppBskyFeedThreadgate from '../feed/threadgate.js'
import type * as AppBskyFeedPostgate from '../feed/postgate.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.actor.defs'
export interface ProfileViewBasic {
$type?: 'app.bsky.actor.defs#profileViewBasic'
did: string
handle: string
displayName?: string
@ -20,22 +25,20 @@ export interface ProfileViewBasic {
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
createdAt?: string
[k: string]: unknown
}
export function isProfileViewBasic(v: unknown): v is ProfileViewBasic {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#profileViewBasic'
)
const hashProfileViewBasic = 'profileViewBasic'
export function isProfileViewBasic<V>(v: V) {
return is$typed(v, id, hashProfileViewBasic)
}
export function validateProfileViewBasic(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#profileViewBasic', v)
export function validateProfileViewBasic<V>(v: V) {
return validate<ProfileViewBasic & V>(v, id, hashProfileViewBasic)
}
export interface ProfileView {
$type?: 'app.bsky.actor.defs#profileView'
did: string
handle: string
displayName?: string
@ -46,22 +49,20 @@ export interface ProfileView {
createdAt?: string
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isProfileView(v: unknown): v is ProfileView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#profileView'
)
const hashProfileView = 'profileView'
export function isProfileView<V>(v: V) {
return is$typed(v, id, hashProfileView)
}
export function validateProfileView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#profileView', v)
export function validateProfileView<V>(v: V) {
return validate<ProfileView & V>(v, id, hashProfileView)
}
export interface ProfileViewDetailed {
$type?: 'app.bsky.actor.defs#profileViewDetailed'
did: string
handle: string
displayName?: string
@ -78,63 +79,55 @@ export interface ProfileViewDetailed {
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
pinnedPost?: ComAtprotoRepoStrongRef.Main
[k: string]: unknown
}
export function isProfileViewDetailed(v: unknown): v is ProfileViewDetailed {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#profileViewDetailed'
)
const hashProfileViewDetailed = 'profileViewDetailed'
export function isProfileViewDetailed<V>(v: V) {
return is$typed(v, id, hashProfileViewDetailed)
}
export function validateProfileViewDetailed(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#profileViewDetailed', v)
export function validateProfileViewDetailed<V>(v: V) {
return validate<ProfileViewDetailed & V>(v, id, hashProfileViewDetailed)
}
export interface ProfileAssociated {
$type?: 'app.bsky.actor.defs#profileAssociated'
lists?: number
feedgens?: number
starterPacks?: number
labeler?: boolean
chat?: ProfileAssociatedChat
[k: string]: unknown
}
export function isProfileAssociated(v: unknown): v is ProfileAssociated {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#profileAssociated'
)
const hashProfileAssociated = 'profileAssociated'
export function isProfileAssociated<V>(v: V) {
return is$typed(v, id, hashProfileAssociated)
}
export function validateProfileAssociated(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#profileAssociated', v)
export function validateProfileAssociated<V>(v: V) {
return validate<ProfileAssociated & V>(v, id, hashProfileAssociated)
}
export interface ProfileAssociatedChat {
$type?: 'app.bsky.actor.defs#profileAssociatedChat'
allowIncoming: 'all' | 'none' | 'following' | (string & {})
[k: string]: unknown
}
export function isProfileAssociatedChat(
v: unknown,
): v is ProfileAssociatedChat {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#profileAssociatedChat'
)
const hashProfileAssociatedChat = 'profileAssociatedChat'
export function isProfileAssociatedChat<V>(v: V) {
return is$typed(v, id, hashProfileAssociatedChat)
}
export function validateProfileAssociatedChat(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#profileAssociatedChat', v)
export function validateProfileAssociatedChat<V>(v: V) {
return validate<ProfileAssociatedChat & V>(v, id, hashProfileAssociatedChat)
}
/** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */
export interface ViewerState {
$type?: 'app.bsky.actor.defs#viewerState'
muted?: boolean
mutedByList?: AppBskyGraphDefs.ListViewBasic
blockedBy?: boolean
@ -143,169 +136,153 @@ export interface ViewerState {
following?: string
followedBy?: string
knownFollowers?: KnownFollowers
[k: string]: unknown
}
export function isViewerState(v: unknown): v is ViewerState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#viewerState'
)
const hashViewerState = 'viewerState'
export function isViewerState<V>(v: V) {
return is$typed(v, id, hashViewerState)
}
export function validateViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#viewerState', v)
export function validateViewerState<V>(v: V) {
return validate<ViewerState & V>(v, id, hashViewerState)
}
/** The subject's followers whom you also follow */
export interface KnownFollowers {
$type?: 'app.bsky.actor.defs#knownFollowers'
count: number
followers: ProfileViewBasic[]
[k: string]: unknown
}
export function isKnownFollowers(v: unknown): v is KnownFollowers {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#knownFollowers'
)
const hashKnownFollowers = 'knownFollowers'
export function isKnownFollowers<V>(v: V) {
return is$typed(v, id, hashKnownFollowers)
}
export function validateKnownFollowers(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#knownFollowers', v)
export function validateKnownFollowers<V>(v: V) {
return validate<KnownFollowers & V>(v, id, hashKnownFollowers)
}
export type Preferences = (
| AdultContentPref
| ContentLabelPref
| SavedFeedsPref
| SavedFeedsPrefV2
| PersonalDetailsPref
| FeedViewPref
| ThreadViewPref
| InterestsPref
| MutedWordsPref
| HiddenPostsPref
| BskyAppStatePref
| LabelersPref
| PostInteractionSettingsPref
| { $type: string; [k: string]: unknown }
| $Typed<AdultContentPref>
| $Typed<ContentLabelPref>
| $Typed<SavedFeedsPref>
| $Typed<SavedFeedsPrefV2>
| $Typed<PersonalDetailsPref>
| $Typed<FeedViewPref>
| $Typed<ThreadViewPref>
| $Typed<InterestsPref>
| $Typed<MutedWordsPref>
| $Typed<HiddenPostsPref>
| $Typed<BskyAppStatePref>
| $Typed<LabelersPref>
| $Typed<PostInteractionSettingsPref>
| { $type: string }
)[]
export interface AdultContentPref {
$type?: 'app.bsky.actor.defs#adultContentPref'
enabled: boolean
[k: string]: unknown
}
export function isAdultContentPref(v: unknown): v is AdultContentPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#adultContentPref'
)
const hashAdultContentPref = 'adultContentPref'
export function isAdultContentPref<V>(v: V) {
return is$typed(v, id, hashAdultContentPref)
}
export function validateAdultContentPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#adultContentPref', v)
export function validateAdultContentPref<V>(v: V) {
return validate<AdultContentPref & V>(v, id, hashAdultContentPref)
}
export interface ContentLabelPref {
$type?: 'app.bsky.actor.defs#contentLabelPref'
/** Which labeler does this preference apply to? If undefined, applies globally. */
labelerDid?: string
label: string
visibility: 'ignore' | 'show' | 'warn' | 'hide' | (string & {})
[k: string]: unknown
}
export function isContentLabelPref(v: unknown): v is ContentLabelPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#contentLabelPref'
)
const hashContentLabelPref = 'contentLabelPref'
export function isContentLabelPref<V>(v: V) {
return is$typed(v, id, hashContentLabelPref)
}
export function validateContentLabelPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#contentLabelPref', v)
export function validateContentLabelPref<V>(v: V) {
return validate<ContentLabelPref & V>(v, id, hashContentLabelPref)
}
export interface SavedFeed {
$type?: 'app.bsky.actor.defs#savedFeed'
id: string
type: 'feed' | 'list' | 'timeline' | (string & {})
value: string
pinned: boolean
[k: string]: unknown
}
export function isSavedFeed(v: unknown): v is SavedFeed {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#savedFeed'
)
const hashSavedFeed = 'savedFeed'
export function isSavedFeed<V>(v: V) {
return is$typed(v, id, hashSavedFeed)
}
export function validateSavedFeed(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#savedFeed', v)
export function validateSavedFeed<V>(v: V) {
return validate<SavedFeed & V>(v, id, hashSavedFeed)
}
export interface SavedFeedsPrefV2 {
$type?: 'app.bsky.actor.defs#savedFeedsPrefV2'
items: SavedFeed[]
[k: string]: unknown
}
export function isSavedFeedsPrefV2(v: unknown): v is SavedFeedsPrefV2 {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#savedFeedsPrefV2'
)
const hashSavedFeedsPrefV2 = 'savedFeedsPrefV2'
export function isSavedFeedsPrefV2<V>(v: V) {
return is$typed(v, id, hashSavedFeedsPrefV2)
}
export function validateSavedFeedsPrefV2(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#savedFeedsPrefV2', v)
export function validateSavedFeedsPrefV2<V>(v: V) {
return validate<SavedFeedsPrefV2 & V>(v, id, hashSavedFeedsPrefV2)
}
export interface SavedFeedsPref {
$type?: 'app.bsky.actor.defs#savedFeedsPref'
pinned: string[]
saved: string[]
timelineIndex?: number
[k: string]: unknown
}
export function isSavedFeedsPref(v: unknown): v is SavedFeedsPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#savedFeedsPref'
)
const hashSavedFeedsPref = 'savedFeedsPref'
export function isSavedFeedsPref<V>(v: V) {
return is$typed(v, id, hashSavedFeedsPref)
}
export function validateSavedFeedsPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#savedFeedsPref', v)
export function validateSavedFeedsPref<V>(v: V) {
return validate<SavedFeedsPref & V>(v, id, hashSavedFeedsPref)
}
export interface PersonalDetailsPref {
$type?: 'app.bsky.actor.defs#personalDetailsPref'
/** The birth date of account owner. */
birthDate?: string
[k: string]: unknown
}
export function isPersonalDetailsPref(v: unknown): v is PersonalDetailsPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#personalDetailsPref'
)
const hashPersonalDetailsPref = 'personalDetailsPref'
export function isPersonalDetailsPref<V>(v: V) {
return is$typed(v, id, hashPersonalDetailsPref)
}
export function validatePersonalDetailsPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#personalDetailsPref', v)
export function validatePersonalDetailsPref<V>(v: V) {
return validate<PersonalDetailsPref & V>(v, id, hashPersonalDetailsPref)
}
export interface FeedViewPref {
$type?: 'app.bsky.actor.defs#feedViewPref'
/** The URI of the feed, or an identifier which describes the feed. */
feed: string
/** Hide replies in the feed. */
@ -318,22 +295,20 @@ export interface FeedViewPref {
hideReposts?: boolean
/** Hide quote posts in the feed. */
hideQuotePosts?: boolean
[k: string]: unknown
}
export function isFeedViewPref(v: unknown): v is FeedViewPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#feedViewPref'
)
const hashFeedViewPref = 'feedViewPref'
export function isFeedViewPref<V>(v: V) {
return is$typed(v, id, hashFeedViewPref)
}
export function validateFeedViewPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#feedViewPref', v)
export function validateFeedViewPref<V>(v: V) {
return validate<FeedViewPref & V>(v, id, hashFeedViewPref)
}
export interface ThreadViewPref {
$type?: 'app.bsky.actor.defs#threadViewPref'
/** Sorting mode for threads. */
sort?:
| 'oldest'
@ -344,43 +319,39 @@ export interface ThreadViewPref {
| (string & {})
/** Show followed users at the top of all replies. */
prioritizeFollowedUsers?: boolean
[k: string]: unknown
}
export function isThreadViewPref(v: unknown): v is ThreadViewPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#threadViewPref'
)
const hashThreadViewPref = 'threadViewPref'
export function isThreadViewPref<V>(v: V) {
return is$typed(v, id, hashThreadViewPref)
}
export function validateThreadViewPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#threadViewPref', v)
export function validateThreadViewPref<V>(v: V) {
return validate<ThreadViewPref & V>(v, id, hashThreadViewPref)
}
export interface InterestsPref {
$type?: 'app.bsky.actor.defs#interestsPref'
/** A list of tags which describe the account owner's interests gathered during onboarding. */
tags: string[]
[k: string]: unknown
}
export function isInterestsPref(v: unknown): v is InterestsPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#interestsPref'
)
const hashInterestsPref = 'interestsPref'
export function isInterestsPref<V>(v: V) {
return is$typed(v, id, hashInterestsPref)
}
export function validateInterestsPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#interestsPref', v)
export function validateInterestsPref<V>(v: V) {
return validate<InterestsPref & V>(v, id, hashInterestsPref)
}
export type MutedWordTarget = 'content' | 'tag' | (string & {})
/** A word that the account owner has muted. */
export interface MutedWord {
$type?: 'app.bsky.actor.defs#mutedWord'
id?: string
/** The muted word itself. */
value: string
@ -390,182 +361,165 @@ export interface MutedWord {
actorTarget: 'all' | 'exclude-following' | (string & {})
/** The date and time at which the muted word will expire and no longer be applied. */
expiresAt?: string
[k: string]: unknown
}
export function isMutedWord(v: unknown): v is MutedWord {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#mutedWord'
)
const hashMutedWord = 'mutedWord'
export function isMutedWord<V>(v: V) {
return is$typed(v, id, hashMutedWord)
}
export function validateMutedWord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#mutedWord', v)
export function validateMutedWord<V>(v: V) {
return validate<MutedWord & V>(v, id, hashMutedWord)
}
export interface MutedWordsPref {
$type?: 'app.bsky.actor.defs#mutedWordsPref'
/** A list of words the account owner has muted. */
items: MutedWord[]
[k: string]: unknown
}
export function isMutedWordsPref(v: unknown): v is MutedWordsPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#mutedWordsPref'
)
const hashMutedWordsPref = 'mutedWordsPref'
export function isMutedWordsPref<V>(v: V) {
return is$typed(v, id, hashMutedWordsPref)
}
export function validateMutedWordsPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#mutedWordsPref', v)
export function validateMutedWordsPref<V>(v: V) {
return validate<MutedWordsPref & V>(v, id, hashMutedWordsPref)
}
export interface HiddenPostsPref {
$type?: 'app.bsky.actor.defs#hiddenPostsPref'
/** A list of URIs of posts the account owner has hidden. */
items: string[]
[k: string]: unknown
}
export function isHiddenPostsPref(v: unknown): v is HiddenPostsPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#hiddenPostsPref'
)
const hashHiddenPostsPref = 'hiddenPostsPref'
export function isHiddenPostsPref<V>(v: V) {
return is$typed(v, id, hashHiddenPostsPref)
}
export function validateHiddenPostsPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#hiddenPostsPref', v)
export function validateHiddenPostsPref<V>(v: V) {
return validate<HiddenPostsPref & V>(v, id, hashHiddenPostsPref)
}
export interface LabelersPref {
$type?: 'app.bsky.actor.defs#labelersPref'
labelers: LabelerPrefItem[]
[k: string]: unknown
}
export function isLabelersPref(v: unknown): v is LabelersPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#labelersPref'
)
const hashLabelersPref = 'labelersPref'
export function isLabelersPref<V>(v: V) {
return is$typed(v, id, hashLabelersPref)
}
export function validateLabelersPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#labelersPref', v)
export function validateLabelersPref<V>(v: V) {
return validate<LabelersPref & V>(v, id, hashLabelersPref)
}
export interface LabelerPrefItem {
$type?: 'app.bsky.actor.defs#labelerPrefItem'
did: string
[k: string]: unknown
}
export function isLabelerPrefItem(v: unknown): v is LabelerPrefItem {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#labelerPrefItem'
)
const hashLabelerPrefItem = 'labelerPrefItem'
export function isLabelerPrefItem<V>(v: V) {
return is$typed(v, id, hashLabelerPrefItem)
}
export function validateLabelerPrefItem(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#labelerPrefItem', v)
export function validateLabelerPrefItem<V>(v: V) {
return validate<LabelerPrefItem & V>(v, id, hashLabelerPrefItem)
}
/** A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this. */
export interface BskyAppStatePref {
$type?: 'app.bsky.actor.defs#bskyAppStatePref'
activeProgressGuide?: BskyAppProgressGuide
/** An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. */
queuedNudges?: string[]
/** Storage for NUXs the user has encountered. */
nuxs?: Nux[]
[k: string]: unknown
}
export function isBskyAppStatePref(v: unknown): v is BskyAppStatePref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#bskyAppStatePref'
)
const hashBskyAppStatePref = 'bskyAppStatePref'
export function isBskyAppStatePref<V>(v: V) {
return is$typed(v, id, hashBskyAppStatePref)
}
export function validateBskyAppStatePref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#bskyAppStatePref', v)
export function validateBskyAppStatePref<V>(v: V) {
return validate<BskyAppStatePref & V>(v, id, hashBskyAppStatePref)
}
/** If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. */
export interface BskyAppProgressGuide {
$type?: 'app.bsky.actor.defs#bskyAppProgressGuide'
guide: string
[k: string]: unknown
}
export function isBskyAppProgressGuide(v: unknown): v is BskyAppProgressGuide {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#bskyAppProgressGuide'
)
const hashBskyAppProgressGuide = 'bskyAppProgressGuide'
export function isBskyAppProgressGuide<V>(v: V) {
return is$typed(v, id, hashBskyAppProgressGuide)
}
export function validateBskyAppProgressGuide(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#bskyAppProgressGuide', v)
export function validateBskyAppProgressGuide<V>(v: V) {
return validate<BskyAppProgressGuide & V>(v, id, hashBskyAppProgressGuide)
}
/** A new user experiences (NUX) storage object */
export interface Nux {
$type?: 'app.bsky.actor.defs#nux'
id: string
completed: boolean
/** Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. */
data?: string
/** The date and time at which the NUX will expire and should be considered completed. */
expiresAt?: string
[k: string]: unknown
}
export function isNux(v: unknown): v is Nux {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.actor.defs#nux'
)
const hashNux = 'nux'
export function isNux<V>(v: V) {
return is$typed(v, id, hashNux)
}
export function validateNux(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#nux', v)
export function validateNux<V>(v: V) {
return validate<Nux & V>(v, id, hashNux)
}
/** 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. */
export interface PostInteractionSettingsPref {
$type?: 'app.bsky.actor.defs#postInteractionSettingsPref'
/** 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. */
threadgateAllowRules?: (
| AppBskyFeedThreadgate.MentionRule
| AppBskyFeedThreadgate.FollowerRule
| AppBskyFeedThreadgate.FollowingRule
| AppBskyFeedThreadgate.ListRule
| { $type: string; [k: string]: unknown }
| $Typed<AppBskyFeedThreadgate.MentionRule>
| $Typed<AppBskyFeedThreadgate.FollowerRule>
| $Typed<AppBskyFeedThreadgate.FollowingRule>
| $Typed<AppBskyFeedThreadgate.ListRule>
| { $type: string }
)[]
/** 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. */
postgateEmbeddingRules?: (
| AppBskyFeedPostgate.DisableRule
| { $type: string; [k: string]: unknown }
| $Typed<AppBskyFeedPostgate.DisableRule>
| { $type: string }
)[]
[k: string]: unknown
}
export function isPostInteractionSettingsPref(
v: unknown,
): v is PostInteractionSettingsPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#postInteractionSettingsPref'
const hashPostInteractionSettingsPref = 'postInteractionSettingsPref'
export function isPostInteractionSettingsPref<V>(v: V) {
return is$typed(v, id, hashPostInteractionSettingsPref)
}
export function validatePostInteractionSettingsPref<V>(v: V) {
return validate<PostInteractionSettingsPref & V>(
v,
id,
hashPostInteractionSettingsPref,
)
}
export function validatePostInteractionSettingsPref(
v: unknown,
): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#postInteractionSettingsPref', v)
}

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.actor.getPreferences'
export interface QueryParams {}
@ -14,7 +18,6 @@ export type InputSchema = undefined
export interface OutputSchema {
preferences: AppBskyActorDefs.Preferences
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.actor.getProfile'
export interface QueryParams {
/** Handle or DID of account to fetch profile of. */

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.actor.getProfiles'
export interface QueryParams {
actors: string[]
@ -16,7 +20,6 @@ export type InputSchema = undefined
export interface OutputSchema {
profiles: AppBskyActorDefs.ProfileViewDetailed[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.actor.getSuggestions'
export interface QueryParams {
limit?: number
@ -20,7 +24,6 @@ export interface OutputSchema {
actors: AppBskyActorDefs.ProfileView[]
/** Snowflake for this recommendation, use when submitting recommendation events. */
recId?: number
[k: string]: unknown
}
export interface CallOptions {

@ -2,13 +2,18 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.actor.profile'
export interface Record {
$type: 'app.bsky.actor.profile'
displayName?: string
/** Free-form profile description text. */
description?: string
@ -16,24 +21,19 @@ export interface Record {
avatar?: BlobRef
/** Larger horizontal image to display behind profile view. */
banner?: BlobRef
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string }
joinedViaStarterPack?: ComAtprotoRepoStrongRef.Main
pinnedPost?: ComAtprotoRepoStrongRef.Main
createdAt?: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.actor.profile#main' ||
v.$type === 'app.bsky.actor.profile')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.profile#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -3,16 +3,19 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.actor.putPreferences'
export interface QueryParams {}
export interface InputSchema {
preferences: AppBskyActorDefs.Preferences
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.actor.searchActors'
export interface QueryParams {
/** DEPRECATED: use 'q' instead. */
@ -22,7 +26,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
actors: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.actor.searchActorsTypeahead'
export interface QueryParams {
/** DEPRECATED: use 'q' instead. */
@ -20,7 +24,6 @@ export type InputSchema = undefined
export interface OutputSchema {
actors: AppBskyActorDefs.ProfileViewBasic[]
[k: string]: unknown
}
export interface CallOptions {

@ -2,25 +2,27 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.embed.defs'
/** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. */
export interface AspectRatio {
$type?: 'app.bsky.embed.defs#aspectRatio'
width: number
height: number
[k: string]: unknown
}
export function isAspectRatio(v: unknown): v is AspectRatio {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.defs#aspectRatio'
)
const hashAspectRatio = 'aspectRatio'
export function isAspectRatio<V>(v: V) {
return is$typed(v, id, hashAspectRatio)
}
export function validateAspectRatio(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.defs#aspectRatio', v)
export function validateAspectRatio<V>(v: V) {
return validate<AspectRatio & V>(v, id, hashAspectRatio)
}

@ -2,82 +2,77 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.embed.external'
/** A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). */
export interface Main {
$type?: 'app.bsky.embed.external'
external: External
[k: string]: unknown
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.embed.external#main' ||
v.$type === 'app.bsky.embed.external')
)
const hashMain = 'main'
export function isMain<V>(v: V) {
return is$typed(v, id, hashMain)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#main', v)
export function validateMain<V>(v: V) {
return validate<Main & V>(v, id, hashMain)
}
export interface External {
$type?: 'app.bsky.embed.external#external'
uri: string
title: string
description: string
thumb?: BlobRef
[k: string]: unknown
}
export function isExternal(v: unknown): v is External {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.external#external'
)
const hashExternal = 'external'
export function isExternal<V>(v: V) {
return is$typed(v, id, hashExternal)
}
export function validateExternal(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#external', v)
export function validateExternal<V>(v: V) {
return validate<External & V>(v, id, hashExternal)
}
export interface View {
$type?: 'app.bsky.embed.external#view'
external: ViewExternal
[k: string]: unknown
}
export function isView(v: unknown): v is View {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.external#view'
)
const hashView = 'view'
export function isView<V>(v: V) {
return is$typed(v, id, hashView)
}
export function validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#view', v)
export function validateView<V>(v: V) {
return validate<View & V>(v, id, hashView)
}
export interface ViewExternal {
$type?: 'app.bsky.embed.external#viewExternal'
uri: string
title: string
description: string
thumb?: string
[k: string]: unknown
}
export function isViewExternal(v: unknown): v is ViewExternal {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.external#viewExternal'
)
const hashViewExternal = 'viewExternal'
export function isViewExternal<V>(v: V) {
return is$typed(v, id, hashViewExternal)
}
export function validateViewExternal(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#viewExternal', v)
export function validateViewExternal<V>(v: V) {
return validate<ViewExternal & V>(v, id, hashViewExternal)
}

@ -2,63 +2,65 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyEmbedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyEmbedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.embed.images'
export interface Main {
$type?: 'app.bsky.embed.images'
images: Image[]
[k: string]: unknown
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.embed.images#main' ||
v.$type === 'app.bsky.embed.images')
)
const hashMain = 'main'
export function isMain<V>(v: V) {
return is$typed(v, id, hashMain)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#main', v)
export function validateMain<V>(v: V) {
return validate<Main & V>(v, id, hashMain)
}
export interface Image {
$type?: 'app.bsky.embed.images#image'
image: BlobRef
/** Alt text description of the image, for accessibility. */
alt: string
aspectRatio?: AppBskyEmbedDefs.AspectRatio
[k: string]: unknown
}
export function isImage(v: unknown): v is Image {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.images#image'
)
const hashImage = 'image'
export function isImage<V>(v: V) {
return is$typed(v, id, hashImage)
}
export function validateImage(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#image', v)
export function validateImage<V>(v: V) {
return validate<Image & V>(v, id, hashImage)
}
export interface View {
$type?: 'app.bsky.embed.images#view'
images: ViewImage[]
[k: string]: unknown
}
export function isView(v: unknown): v is View {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.images#view'
)
const hashView = 'view'
export function isView<V>(v: V) {
return is$typed(v, id, hashView)
}
export function validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#view', v)
export function validateView<V>(v: V) {
return validate<View & V>(v, id, hashView)
}
export interface ViewImage {
$type?: 'app.bsky.embed.images#viewImage'
/** Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. */
thumb: string
/** 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. */
@ -66,17 +68,14 @@ export interface ViewImage {
/** Alt text description of the image, for accessibility. */
alt: string
aspectRatio?: AppBskyEmbedDefs.AspectRatio
[k: string]: unknown
}
export function isViewImage(v: unknown): v is ViewImage {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.images#viewImage'
)
const hashViewImage = 'viewImage'
export function isViewImage<V>(v: V) {
return is$typed(v, id, hashViewImage)
}
export function validateViewImage(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#viewImage', v)
export function validateViewImage<V>(v: V) {
return validate<ViewImage & V>(v, id, hashViewImage)
}

@ -2,148 +2,141 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
import * as AppBskyFeedDefs from '../feed/defs'
import * as AppBskyGraphDefs from '../graph/defs'
import * as AppBskyLabelerDefs from '../labeler/defs'
import * as AppBskyActorDefs from '../actor/defs'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as AppBskyEmbedImages from './images'
import * as AppBskyEmbedVideo from './video'
import * as AppBskyEmbedExternal from './external'
import * as AppBskyEmbedRecordWithMedia from './recordWithMedia'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'
import type * as AppBskyFeedDefs from '../feed/defs.js'
import type * as AppBskyGraphDefs from '../graph/defs.js'
import type * as AppBskyLabelerDefs from '../labeler/defs.js'
import type * as AppBskyActorDefs from '../actor/defs.js'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
import type * as AppBskyEmbedImages from './images.js'
import type * as AppBskyEmbedVideo from './video.js'
import type * as AppBskyEmbedExternal from './external.js'
import type * as AppBskyEmbedRecordWithMedia from './recordWithMedia.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.embed.record'
export interface Main {
$type?: 'app.bsky.embed.record'
record: ComAtprotoRepoStrongRef.Main
[k: string]: unknown
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.embed.record#main' ||
v.$type === 'app.bsky.embed.record')
)
const hashMain = 'main'
export function isMain<V>(v: V) {
return is$typed(v, id, hashMain)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#main', v)
export function validateMain<V>(v: V) {
return validate<Main & V>(v, id, hashMain)
}
export interface View {
$type?: 'app.bsky.embed.record#view'
record:
| ViewRecord
| ViewNotFound
| ViewBlocked
| ViewDetached
| AppBskyFeedDefs.GeneratorView
| AppBskyGraphDefs.ListView
| AppBskyLabelerDefs.LabelerView
| AppBskyGraphDefs.StarterPackViewBasic
| { $type: string; [k: string]: unknown }
[k: string]: unknown
| $Typed<ViewRecord>
| $Typed<ViewNotFound>
| $Typed<ViewBlocked>
| $Typed<ViewDetached>
| $Typed<AppBskyFeedDefs.GeneratorView>
| $Typed<AppBskyGraphDefs.ListView>
| $Typed<AppBskyLabelerDefs.LabelerView>
| $Typed<AppBskyGraphDefs.StarterPackViewBasic>
| { $type: string }
}
export function isView(v: unknown): v is View {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.record#view'
)
const hashView = 'view'
export function isView<V>(v: V) {
return is$typed(v, id, hashView)
}
export function validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#view', v)
export function validateView<V>(v: V) {
return validate<View & V>(v, id, hashView)
}
export interface ViewRecord {
$type?: 'app.bsky.embed.record#viewRecord'
uri: string
cid: string
author: AppBskyActorDefs.ProfileViewBasic
/** The record data itself. */
value: {}
value: { [_ in string]: unknown }
labels?: ComAtprotoLabelDefs.Label[]
replyCount?: number
repostCount?: number
likeCount?: number
quoteCount?: number
embeds?: (
| AppBskyEmbedImages.View
| AppBskyEmbedVideo.View
| AppBskyEmbedExternal.View
| View
| AppBskyEmbedRecordWithMedia.View
| { $type: string; [k: string]: unknown }
| $Typed<AppBskyEmbedImages.View>
| $Typed<AppBskyEmbedVideo.View>
| $Typed<AppBskyEmbedExternal.View>
| $Typed<View>
| $Typed<AppBskyEmbedRecordWithMedia.View>
| { $type: string }
)[]
indexedAt: string
[k: string]: unknown
}
export function isViewRecord(v: unknown): v is ViewRecord {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.record#viewRecord'
)
const hashViewRecord = 'viewRecord'
export function isViewRecord<V>(v: V) {
return is$typed(v, id, hashViewRecord)
}
export function validateViewRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#viewRecord', v)
export function validateViewRecord<V>(v: V) {
return validate<ViewRecord & V>(v, id, hashViewRecord)
}
export interface ViewNotFound {
$type?: 'app.bsky.embed.record#viewNotFound'
uri: string
notFound: true
[k: string]: unknown
}
export function isViewNotFound(v: unknown): v is ViewNotFound {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.record#viewNotFound'
)
const hashViewNotFound = 'viewNotFound'
export function isViewNotFound<V>(v: V) {
return is$typed(v, id, hashViewNotFound)
}
export function validateViewNotFound(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#viewNotFound', v)
export function validateViewNotFound<V>(v: V) {
return validate<ViewNotFound & V>(v, id, hashViewNotFound)
}
export interface ViewBlocked {
$type?: 'app.bsky.embed.record#viewBlocked'
uri: string
blocked: true
author: AppBskyFeedDefs.BlockedAuthor
[k: string]: unknown
}
export function isViewBlocked(v: unknown): v is ViewBlocked {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.record#viewBlocked'
)
const hashViewBlocked = 'viewBlocked'
export function isViewBlocked<V>(v: V) {
return is$typed(v, id, hashViewBlocked)
}
export function validateViewBlocked(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#viewBlocked', v)
export function validateViewBlocked<V>(v: V) {
return validate<ViewBlocked & V>(v, id, hashViewBlocked)
}
export interface ViewDetached {
$type?: 'app.bsky.embed.record#viewDetached'
uri: string
detached: true
[k: string]: unknown
}
export function isViewDetached(v: unknown): v is ViewDetached {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.record#viewDetached'
)
const hashViewDetached = 'viewDetached'
export function isViewDetached<V>(v: V) {
return is$typed(v, id, hashViewDetached)
}
export function validateViewDetached(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#viewDetached', v)
export function validateViewDetached<V>(v: V) {
return validate<ViewDetached & V>(v, id, hashViewDetached)
}

@ -2,55 +2,54 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyEmbedRecord from './record'
import * as AppBskyEmbedImages from './images'
import * as AppBskyEmbedVideo from './video'
import * as AppBskyEmbedExternal from './external'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyEmbedRecord from './record.js'
import type * as AppBskyEmbedImages from './images.js'
import type * as AppBskyEmbedVideo from './video.js'
import type * as AppBskyEmbedExternal from './external.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.embed.recordWithMedia'
export interface Main {
$type?: 'app.bsky.embed.recordWithMedia'
record: AppBskyEmbedRecord.Main
media:
| AppBskyEmbedImages.Main
| AppBskyEmbedVideo.Main
| AppBskyEmbedExternal.Main
| { $type: string; [k: string]: unknown }
[k: string]: unknown
| $Typed<AppBskyEmbedImages.Main>
| $Typed<AppBskyEmbedVideo.Main>
| $Typed<AppBskyEmbedExternal.Main>
| { $type: string }
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.embed.recordWithMedia#main' ||
v.$type === 'app.bsky.embed.recordWithMedia')
)
const hashMain = 'main'
export function isMain<V>(v: V) {
return is$typed(v, id, hashMain)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.recordWithMedia#main', v)
export function validateMain<V>(v: V) {
return validate<Main & V>(v, id, hashMain)
}
export interface View {
$type?: 'app.bsky.embed.recordWithMedia#view'
record: AppBskyEmbedRecord.View
media:
| AppBskyEmbedImages.View
| AppBskyEmbedVideo.View
| AppBskyEmbedExternal.View
| { $type: string; [k: string]: unknown }
[k: string]: unknown
| $Typed<AppBskyEmbedImages.View>
| $Typed<AppBskyEmbedVideo.View>
| $Typed<AppBskyEmbedExternal.View>
| { $type: string }
}
export function isView(v: unknown): v is View {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.recordWithMedia#view'
)
const hashView = 'view'
export function isView<V>(v: V) {
return is$typed(v, id, hashView)
}
export function validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.recordWithMedia#view', v)
export function validateView<V>(v: V) {
return validate<View & V>(v, id, hashView)
}

@ -2,66 +2,65 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyEmbedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyEmbedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.embed.video'
export interface Main {
$type?: 'app.bsky.embed.video'
video: BlobRef
captions?: Caption[]
/** Alt text description of the video, for accessibility. */
alt?: string
aspectRatio?: AppBskyEmbedDefs.AspectRatio
[k: string]: unknown
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.embed.video#main' ||
v.$type === 'app.bsky.embed.video')
)
const hashMain = 'main'
export function isMain<V>(v: V) {
return is$typed(v, id, hashMain)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.video#main', v)
export function validateMain<V>(v: V) {
return validate<Main & V>(v, id, hashMain)
}
export interface Caption {
$type?: 'app.bsky.embed.video#caption'
lang: string
file: BlobRef
[k: string]: unknown
}
export function isCaption(v: unknown): v is Caption {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.video#caption'
)
const hashCaption = 'caption'
export function isCaption<V>(v: V) {
return is$typed(v, id, hashCaption)
}
export function validateCaption(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.video#caption', v)
export function validateCaption<V>(v: V) {
return validate<Caption & V>(v, id, hashCaption)
}
export interface View {
$type?: 'app.bsky.embed.video#view'
cid: string
playlist: string
thumbnail?: string
alt?: string
aspectRatio?: AppBskyEmbedDefs.AspectRatio
[k: string]: unknown
}
export function isView(v: unknown): v is View {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.video#view'
)
const hashView = 'view'
export function isView<V>(v: V) {
return is$typed(v, id, hashView)
}
export function validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.video#view', v)
export function validateView<V>(v: V) {
return validate<View & V>(v, id, hashView)
}

@ -2,31 +2,36 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import * as AppBskyEmbedImages from '../embed/images'
import * as AppBskyEmbedVideo from '../embed/video'
import * as AppBskyEmbedExternal from '../embed/external'
import * as AppBskyEmbedRecord from '../embed/record'
import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as AppBskyRichtextFacet from '../richtext/facet'
import * as AppBskyGraphDefs from '../graph/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
import type * as AppBskyEmbedImages from '../embed/images.js'
import type * as AppBskyEmbedVideo from '../embed/video.js'
import type * as AppBskyEmbedExternal from '../embed/external.js'
import type * as AppBskyEmbedRecord from '../embed/record.js'
import type * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia.js'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
import type * as AppBskyRichtextFacet from '../richtext/facet.js'
import type * as AppBskyGraphDefs from '../graph/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.defs'
export interface PostView {
$type?: 'app.bsky.feed.defs#postView'
uri: string
cid: string
author: AppBskyActorDefs.ProfileViewBasic
record: {}
record: { [_ in string]: unknown }
embed?:
| AppBskyEmbedImages.View
| AppBskyEmbedVideo.View
| AppBskyEmbedExternal.View
| AppBskyEmbedRecord.View
| AppBskyEmbedRecordWithMedia.View
| { $type: string; [k: string]: unknown }
| $Typed<AppBskyEmbedImages.View>
| $Typed<AppBskyEmbedVideo.View>
| $Typed<AppBskyEmbedExternal.View>
| $Typed<AppBskyEmbedRecord.View>
| $Typed<AppBskyEmbedRecordWithMedia.View>
| { $type: string }
replyCount?: number
repostCount?: number
likeCount?: number
@ -35,225 +40,207 @@ export interface PostView {
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
threadgate?: ThreadgateView
[k: string]: unknown
}
export function isPostView(v: unknown): v is PostView {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#postView'
)
const hashPostView = 'postView'
export function isPostView<V>(v: V) {
return is$typed(v, id, hashPostView)
}
export function validatePostView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#postView', v)
export function validatePostView<V>(v: V) {
return validate<PostView & V>(v, id, hashPostView)
}
/** Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. */
export interface ViewerState {
$type?: 'app.bsky.feed.defs#viewerState'
repost?: string
like?: string
threadMuted?: boolean
replyDisabled?: boolean
embeddingDisabled?: boolean
pinned?: boolean
[k: string]: unknown
}
export function isViewerState(v: unknown): v is ViewerState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#viewerState'
)
const hashViewerState = 'viewerState'
export function isViewerState<V>(v: V) {
return is$typed(v, id, hashViewerState)
}
export function validateViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#viewerState', v)
export function validateViewerState<V>(v: V) {
return validate<ViewerState & V>(v, id, hashViewerState)
}
/** Metadata about this post within the context of the thread it is in. */
export interface ThreadContext {
$type?: 'app.bsky.feed.defs#threadContext'
rootAuthorLike?: string
[k: string]: unknown
}
export function isThreadContext(v: unknown): v is ThreadContext {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#threadContext'
)
const hashThreadContext = 'threadContext'
export function isThreadContext<V>(v: V) {
return is$typed(v, id, hashThreadContext)
}
export function validateThreadContext(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#threadContext', v)
export function validateThreadContext<V>(v: V) {
return validate<ThreadContext & V>(v, id, hashThreadContext)
}
export interface FeedViewPost {
$type?: 'app.bsky.feed.defs#feedViewPost'
post: PostView
reply?: ReplyRef
reason?: ReasonRepost | ReasonPin | { $type: string; [k: string]: unknown }
reason?: $Typed<ReasonRepost> | $Typed<ReasonPin> | { $type: string }
/** Context provided by feed generator that may be passed back alongside interactions. */
feedContext?: string
[k: string]: unknown
}
export function isFeedViewPost(v: unknown): v is FeedViewPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#feedViewPost'
)
const hashFeedViewPost = 'feedViewPost'
export function isFeedViewPost<V>(v: V) {
return is$typed(v, id, hashFeedViewPost)
}
export function validateFeedViewPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#feedViewPost', v)
export function validateFeedViewPost<V>(v: V) {
return validate<FeedViewPost & V>(v, id, hashFeedViewPost)
}
export interface ReplyRef {
$type?: 'app.bsky.feed.defs#replyRef'
root:
| PostView
| NotFoundPost
| BlockedPost
| { $type: string; [k: string]: unknown }
| $Typed<PostView>
| $Typed<NotFoundPost>
| $Typed<BlockedPost>
| { $type: string }
parent:
| PostView
| NotFoundPost
| BlockedPost
| { $type: string; [k: string]: unknown }
| $Typed<PostView>
| $Typed<NotFoundPost>
| $Typed<BlockedPost>
| { $type: string }
grandparentAuthor?: AppBskyActorDefs.ProfileViewBasic
[k: string]: unknown
}
export function isReplyRef(v: unknown): v is ReplyRef {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#replyRef'
)
const hashReplyRef = 'replyRef'
export function isReplyRef<V>(v: V) {
return is$typed(v, id, hashReplyRef)
}
export function validateReplyRef(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#replyRef', v)
export function validateReplyRef<V>(v: V) {
return validate<ReplyRef & V>(v, id, hashReplyRef)
}
export interface ReasonRepost {
$type?: 'app.bsky.feed.defs#reasonRepost'
by: AppBskyActorDefs.ProfileViewBasic
indexedAt: string
[k: string]: unknown
}
export function isReasonRepost(v: unknown): v is ReasonRepost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#reasonRepost'
)
const hashReasonRepost = 'reasonRepost'
export function isReasonRepost<V>(v: V) {
return is$typed(v, id, hashReasonRepost)
}
export function validateReasonRepost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#reasonRepost', v)
export function validateReasonRepost<V>(v: V) {
return validate<ReasonRepost & V>(v, id, hashReasonRepost)
}
export interface ReasonPin {
[k: string]: unknown
$type?: 'app.bsky.feed.defs#reasonPin'
}
export function isReasonPin(v: unknown): v is ReasonPin {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#reasonPin'
)
const hashReasonPin = 'reasonPin'
export function isReasonPin<V>(v: V) {
return is$typed(v, id, hashReasonPin)
}
export function validateReasonPin(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#reasonPin', v)
export function validateReasonPin<V>(v: V) {
return validate<ReasonPin & V>(v, id, hashReasonPin)
}
export interface ThreadViewPost {
$type?: 'app.bsky.feed.defs#threadViewPost'
post: PostView
parent?:
| ThreadViewPost
| NotFoundPost
| BlockedPost
| { $type: string; [k: string]: unknown }
| $Typed<ThreadViewPost>
| $Typed<NotFoundPost>
| $Typed<BlockedPost>
| { $type: string }
replies?: (
| ThreadViewPost
| NotFoundPost
| BlockedPost
| { $type: string; [k: string]: unknown }
| $Typed<ThreadViewPost>
| $Typed<NotFoundPost>
| $Typed<BlockedPost>
| { $type: string }
)[]
threadContext?: ThreadContext
[k: string]: unknown
}
export function isThreadViewPost(v: unknown): v is ThreadViewPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#threadViewPost'
)
const hashThreadViewPost = 'threadViewPost'
export function isThreadViewPost<V>(v: V) {
return is$typed(v, id, hashThreadViewPost)
}
export function validateThreadViewPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#threadViewPost', v)
export function validateThreadViewPost<V>(v: V) {
return validate<ThreadViewPost & V>(v, id, hashThreadViewPost)
}
export interface NotFoundPost {
$type?: 'app.bsky.feed.defs#notFoundPost'
uri: string
notFound: true
[k: string]: unknown
}
export function isNotFoundPost(v: unknown): v is NotFoundPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#notFoundPost'
)
const hashNotFoundPost = 'notFoundPost'
export function isNotFoundPost<V>(v: V) {
return is$typed(v, id, hashNotFoundPost)
}
export function validateNotFoundPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#notFoundPost', v)
export function validateNotFoundPost<V>(v: V) {
return validate<NotFoundPost & V>(v, id, hashNotFoundPost)
}
export interface BlockedPost {
$type?: 'app.bsky.feed.defs#blockedPost'
uri: string
blocked: true
author: BlockedAuthor
[k: string]: unknown
}
export function isBlockedPost(v: unknown): v is BlockedPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#blockedPost'
)
const hashBlockedPost = 'blockedPost'
export function isBlockedPost<V>(v: V) {
return is$typed(v, id, hashBlockedPost)
}
export function validateBlockedPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#blockedPost', v)
export function validateBlockedPost<V>(v: V) {
return validate<BlockedPost & V>(v, id, hashBlockedPost)
}
export interface BlockedAuthor {
$type?: 'app.bsky.feed.defs#blockedAuthor'
did: string
viewer?: AppBskyActorDefs.ViewerState
[k: string]: unknown
}
export function isBlockedAuthor(v: unknown): v is BlockedAuthor {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#blockedAuthor'
)
const hashBlockedAuthor = 'blockedAuthor'
export function isBlockedAuthor<V>(v: V) {
return is$typed(v, id, hashBlockedAuthor)
}
export function validateBlockedAuthor(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#blockedAuthor', v)
export function validateBlockedAuthor<V>(v: V) {
return validate<BlockedAuthor & V>(v, id, hashBlockedAuthor)
}
export interface GeneratorView {
$type?: 'app.bsky.feed.defs#generatorView'
uri: string
cid: string
did: string
@ -271,115 +258,103 @@ export interface GeneratorView {
| 'app.bsky.feed.defs#contentModeVideo'
| (string & {})
indexedAt: string
[k: string]: unknown
}
export function isGeneratorView(v: unknown): v is GeneratorView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#generatorView'
)
const hashGeneratorView = 'generatorView'
export function isGeneratorView<V>(v: V) {
return is$typed(v, id, hashGeneratorView)
}
export function validateGeneratorView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#generatorView', v)
export function validateGeneratorView<V>(v: V) {
return validate<GeneratorView & V>(v, id, hashGeneratorView)
}
export interface GeneratorViewerState {
$type?: 'app.bsky.feed.defs#generatorViewerState'
like?: string
[k: string]: unknown
}
export function isGeneratorViewerState(v: unknown): v is GeneratorViewerState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#generatorViewerState'
)
const hashGeneratorViewerState = 'generatorViewerState'
export function isGeneratorViewerState<V>(v: V) {
return is$typed(v, id, hashGeneratorViewerState)
}
export function validateGeneratorViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#generatorViewerState', v)
export function validateGeneratorViewerState<V>(v: V) {
return validate<GeneratorViewerState & V>(v, id, hashGeneratorViewerState)
}
export interface SkeletonFeedPost {
$type?: 'app.bsky.feed.defs#skeletonFeedPost'
post: string
reason?:
| SkeletonReasonRepost
| SkeletonReasonPin
| { $type: string; [k: string]: unknown }
| $Typed<SkeletonReasonRepost>
| $Typed<SkeletonReasonPin>
| { $type: string }
/** Context that will be passed through to client and may be passed to feed generator back alongside interactions. */
feedContext?: string
[k: string]: unknown
}
export function isSkeletonFeedPost(v: unknown): v is SkeletonFeedPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#skeletonFeedPost'
)
const hashSkeletonFeedPost = 'skeletonFeedPost'
export function isSkeletonFeedPost<V>(v: V) {
return is$typed(v, id, hashSkeletonFeedPost)
}
export function validateSkeletonFeedPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#skeletonFeedPost', v)
export function validateSkeletonFeedPost<V>(v: V) {
return validate<SkeletonFeedPost & V>(v, id, hashSkeletonFeedPost)
}
export interface SkeletonReasonRepost {
$type?: 'app.bsky.feed.defs#skeletonReasonRepost'
repost: string
[k: string]: unknown
}
export function isSkeletonReasonRepost(v: unknown): v is SkeletonReasonRepost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#skeletonReasonRepost'
)
const hashSkeletonReasonRepost = 'skeletonReasonRepost'
export function isSkeletonReasonRepost<V>(v: V) {
return is$typed(v, id, hashSkeletonReasonRepost)
}
export function validateSkeletonReasonRepost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v)
export function validateSkeletonReasonRepost<V>(v: V) {
return validate<SkeletonReasonRepost & V>(v, id, hashSkeletonReasonRepost)
}
export interface SkeletonReasonPin {
[k: string]: unknown
$type?: 'app.bsky.feed.defs#skeletonReasonPin'
}
export function isSkeletonReasonPin(v: unknown): v is SkeletonReasonPin {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#skeletonReasonPin'
)
const hashSkeletonReasonPin = 'skeletonReasonPin'
export function isSkeletonReasonPin<V>(v: V) {
return is$typed(v, id, hashSkeletonReasonPin)
}
export function validateSkeletonReasonPin(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#skeletonReasonPin', v)
export function validateSkeletonReasonPin<V>(v: V) {
return validate<SkeletonReasonPin & V>(v, id, hashSkeletonReasonPin)
}
export interface ThreadgateView {
$type?: 'app.bsky.feed.defs#threadgateView'
uri?: string
cid?: string
record?: {}
record?: { [_ in string]: unknown }
lists?: AppBskyGraphDefs.ListViewBasic[]
[k: string]: unknown
}
export function isThreadgateView(v: unknown): v is ThreadgateView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#threadgateView'
)
const hashThreadgateView = 'threadgateView'
export function isThreadgateView<V>(v: V) {
return is$typed(v, id, hashThreadgateView)
}
export function validateThreadgateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#threadgateView', v)
export function validateThreadgateView<V>(v: V) {
return validate<ThreadgateView & V>(v, id, hashThreadgateView)
}
export interface Interaction {
$type?: 'app.bsky.feed.defs#interaction'
item?: string
event?:
| 'app.bsky.feed.defs#requestLess'
@ -397,47 +372,43 @@ export interface Interaction {
| (string & {})
/** Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. */
feedContext?: string
[k: string]: unknown
}
export function isInteraction(v: unknown): v is Interaction {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#interaction'
)
const hashInteraction = 'interaction'
export function isInteraction<V>(v: V) {
return is$typed(v, id, hashInteraction)
}
export function validateInteraction(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#interaction', v)
export function validateInteraction<V>(v: V) {
return validate<Interaction & V>(v, id, hashInteraction)
}
/** Request that less content like the given feed item be shown in the feed */
export const REQUESTLESS = 'app.bsky.feed.defs#requestLess'
export const REQUESTLESS = `${id}#requestLess`
/** Request that more content like the given feed item be shown in the feed */
export const REQUESTMORE = 'app.bsky.feed.defs#requestMore'
export const REQUESTMORE = `${id}#requestMore`
/** User clicked through to the feed item */
export const CLICKTHROUGHITEM = 'app.bsky.feed.defs#clickthroughItem'
export const CLICKTHROUGHITEM = `${id}#clickthroughItem`
/** User clicked through to the author of the feed item */
export const CLICKTHROUGHAUTHOR = 'app.bsky.feed.defs#clickthroughAuthor'
export const CLICKTHROUGHAUTHOR = `${id}#clickthroughAuthor`
/** User clicked through to the reposter of the feed item */
export const CLICKTHROUGHREPOSTER = 'app.bsky.feed.defs#clickthroughReposter'
export const CLICKTHROUGHREPOSTER = `${id}#clickthroughReposter`
/** User clicked through to the embedded content of the feed item */
export const CLICKTHROUGHEMBED = 'app.bsky.feed.defs#clickthroughEmbed'
export const CLICKTHROUGHEMBED = `${id}#clickthroughEmbed`
/** Declares the feed generator returns any types of posts. */
export const CONTENTMODEUNSPECIFIED =
'app.bsky.feed.defs#contentModeUnspecified'
export const CONTENTMODEUNSPECIFIED = `${id}#contentModeUnspecified`
/** Declares the feed generator returns posts containing app.bsky.embed.video embeds. */
export const CONTENTMODEVIDEO = 'app.bsky.feed.defs#contentModeVideo'
export const CONTENTMODEVIDEO = `${id}#contentModeVideo`
/** Feed item was seen by user */
export const INTERACTIONSEEN = 'app.bsky.feed.defs#interactionSeen'
export const INTERACTIONSEEN = `${id}#interactionSeen`
/** User liked the feed item */
export const INTERACTIONLIKE = 'app.bsky.feed.defs#interactionLike'
export const INTERACTIONLIKE = `${id}#interactionLike`
/** User reposted the feed item */
export const INTERACTIONREPOST = 'app.bsky.feed.defs#interactionRepost'
export const INTERACTIONREPOST = `${id}#interactionRepost`
/** User replied to the feed item */
export const INTERACTIONREPLY = 'app.bsky.feed.defs#interactionReply'
export const INTERACTIONREPLY = `${id}#interactionReply`
/** User quoted the feed item */
export const INTERACTIONQUOTE = 'app.bsky.feed.defs#interactionQuote'
export const INTERACTIONQUOTE = `${id}#interactionQuote`
/** User shared the feed item */
export const INTERACTIONSHARE = 'app.bsky.feed.defs#interactionShare'
export const INTERACTIONSHARE = `${id}#interactionShare`

@ -3,9 +3,13 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.describeFeedGenerator'
export interface QueryParams {}
@ -15,7 +19,6 @@ export interface OutputSchema {
did: string
feeds: Feed[]
links?: Links
[k: string]: unknown
}
export interface CallOptions {
@ -34,36 +37,32 @@ export function toKnownErr(e: any) {
}
export interface Feed {
$type?: 'app.bsky.feed.describeFeedGenerator#feed'
uri: string
[k: string]: unknown
}
export function isFeed(v: unknown): v is Feed {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.describeFeedGenerator#feed'
)
const hashFeed = 'feed'
export function isFeed<V>(v: V) {
return is$typed(v, id, hashFeed)
}
export function validateFeed(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.describeFeedGenerator#feed', v)
export function validateFeed<V>(v: V) {
return validate<Feed & V>(v, id, hashFeed)
}
export interface Links {
$type?: 'app.bsky.feed.describeFeedGenerator#links'
privacyPolicy?: string
termsOfService?: string
[k: string]: unknown
}
export function isLinks(v: unknown): v is Links {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.describeFeedGenerator#links'
)
const hashLinks = 'links'
export function isLinks<V>(v: V) {
return is$typed(v, id, hashLinks)
}
export function validateLinks(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.describeFeedGenerator#links', v)
export function validateLinks<V>(v: V) {
return validate<Links & V>(v, id, hashLinks)
}

@ -2,13 +2,18 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyRichtextFacet from '../richtext/facet'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyRichtextFacet from '../richtext/facet.js'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.generator'
export interface Record {
$type: 'app.bsky.feed.generator'
did: string
displayName: string
description?: string
@ -16,9 +21,7 @@ export interface Record {
avatar?: BlobRef
/** Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions */
acceptsInteractions?: boolean
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string }
contentMode?:
| 'app.bsky.feed.defs#contentModeUnspecified'
| 'app.bsky.feed.defs#contentModeVideo'
@ -27,15 +30,12 @@ export interface Record {
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.feed.generator#main' ||
v.$type === 'app.bsky.feed.generator')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.generator#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getActorFeeds'
export interface QueryParams {
actor: string
@ -19,7 +23,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feeds: AppBskyFeedDefs.GeneratorView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getActorLikes'
export interface QueryParams {
actor: string
@ -19,7 +23,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feed: AppBskyFeedDefs.FeedViewPost[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getAuthorFeed'
export interface QueryParams {
actor: string
@ -28,7 +32,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feed: AppBskyFeedDefs.FeedViewPost[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getFeed'
export interface QueryParams {
feed: string
@ -19,7 +23,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feed: AppBskyFeedDefs.FeedViewPost[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getFeedGenerator'
export interface QueryParams {
/** AT-URI of the feed generator record. */
@ -21,7 +25,6 @@ export interface OutputSchema {
isOnline: boolean
/** Indicates whether the feed generator service is compatible with the record declaration. */
isValid: boolean
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getFeedGenerators'
export interface QueryParams {
feeds: string[]
@ -16,7 +20,6 @@ export type InputSchema = undefined
export interface OutputSchema {
feeds: AppBskyFeedDefs.GeneratorView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getFeedSkeleton'
export interface QueryParams {
/** Reference to feed generator record describing the specific feed being requested. */
@ -20,7 +24,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feed: AppBskyFeedDefs.SkeletonFeedPost[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getLikes'
export interface QueryParams {
/** AT-URI of the subject (eg, a post record). */
@ -24,7 +28,6 @@ export interface OutputSchema {
cid?: string
cursor?: string
likes: Like[]
[k: string]: unknown
}
export interface CallOptions {
@ -43,18 +46,18 @@ export function toKnownErr(e: any) {
}
export interface Like {
$type?: 'app.bsky.feed.getLikes#like'
indexedAt: string
createdAt: string
actor: AppBskyActorDefs.ProfileView
[k: string]: unknown
}
export function isLike(v: unknown): v is Like {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.getLikes#like'
)
const hashLike = 'like'
export function isLike<V>(v: V) {
return is$typed(v, id, hashLike)
}
export function validateLike(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.getLikes#like', v)
export function validateLike<V>(v: V) {
return validate<Like & V>(v, id, hashLike)
}

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getListFeed'
export interface QueryParams {
/** Reference (AT-URI) to the list record. */
@ -20,7 +24,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feed: AppBskyFeedDefs.FeedViewPost[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getPostThread'
export interface QueryParams {
/** Reference (AT-URI) to post record. */
@ -21,12 +25,11 @@ export type InputSchema = undefined
export interface OutputSchema {
thread:
| AppBskyFeedDefs.ThreadViewPost
| AppBskyFeedDefs.NotFoundPost
| AppBskyFeedDefs.BlockedPost
| { $type: string; [k: string]: unknown }
| $Typed<AppBskyFeedDefs.ThreadViewPost>
| $Typed<AppBskyFeedDefs.NotFoundPost>
| $Typed<AppBskyFeedDefs.BlockedPost>
| { $type: string }
threadgate?: AppBskyFeedDefs.ThreadgateView
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getPosts'
export interface QueryParams {
/** List of post AT-URIs to return hydrated views for. */
@ -17,7 +21,6 @@ export type InputSchema = undefined
export interface OutputSchema {
posts: AppBskyFeedDefs.PostView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getQuotes'
export interface QueryParams {
/** Reference (AT-URI) of post record */
@ -24,7 +28,6 @@ export interface OutputSchema {
cid?: string
cursor?: string
posts: AppBskyFeedDefs.PostView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getRepostedBy'
export interface QueryParams {
/** Reference (AT-URI) of post record */
@ -24,7 +28,6 @@ export interface OutputSchema {
cid?: string
cursor?: string
repostedBy: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getSuggestedFeeds'
export interface QueryParams {
limit?: number
@ -18,7 +22,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feeds: AppBskyFeedDefs.GeneratorView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.getTimeline'
export interface QueryParams {
/** Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism. */
@ -20,7 +24,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feed: AppBskyFeedDefs.FeedViewPost[]
[k: string]: unknown
}
export interface CallOptions {

@ -2,25 +2,28 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.like'
export interface Record {
$type: 'app.bsky.feed.like'
subject: ComAtprotoRepoStrongRef.Main
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.feed.like#main' || v.$type === 'app.bsky.feed.like')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.like#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -2,19 +2,24 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyRichtextFacet from '../richtext/facet'
import * as AppBskyEmbedImages from '../embed/images'
import * as AppBskyEmbedVideo from '../embed/video'
import * as AppBskyEmbedExternal from '../embed/external'
import * as AppBskyEmbedRecord from '../embed/record'
import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyRichtextFacet from '../richtext/facet.js'
import type * as AppBskyEmbedImages from '../embed/images.js'
import type * as AppBskyEmbedVideo from '../embed/video.js'
import type * as AppBskyEmbedExternal from '../embed/external.js'
import type * as AppBskyEmbedRecord from '../embed/record.js'
import type * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia.js'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.post'
export interface Record {
$type: 'app.bsky.feed.post'
/** The primary post content. May be an empty string, if there are embeds. */
text: string
/** DEPRECATED: replaced by app.bsky.richtext.facet. */
@ -23,17 +28,15 @@ export interface Record {
facets?: AppBskyRichtextFacet.Main[]
reply?: ReplyRef
embed?:
| AppBskyEmbedImages.Main
| AppBskyEmbedVideo.Main
| AppBskyEmbedExternal.Main
| AppBskyEmbedRecord.Main
| AppBskyEmbedRecordWithMedia.Main
| { $type: string; [k: string]: unknown }
| $Typed<AppBskyEmbedImages.Main>
| $Typed<AppBskyEmbedVideo.Main>
| $Typed<AppBskyEmbedExternal.Main>
| $Typed<AppBskyEmbedRecord.Main>
| $Typed<AppBskyEmbedRecordWithMedia.Main>
| { $type: string }
/** Indicates human language of post primary text content. */
langs?: string[]
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string }
/** Additional hashtags, in addition to any included in post text and facets. */
tags?: string[]
/** Client-declared timestamp when this post was originally created. */
@ -41,68 +44,64 @@ export interface Record {
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.feed.post#main' || v.$type === 'app.bsky.feed.post')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.post#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}
export interface ReplyRef {
$type?: 'app.bsky.feed.post#replyRef'
root: ComAtprotoRepoStrongRef.Main
parent: ComAtprotoRepoStrongRef.Main
[k: string]: unknown
}
export function isReplyRef(v: unknown): v is ReplyRef {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#replyRef'
)
const hashReplyRef = 'replyRef'
export function isReplyRef<V>(v: V) {
return is$typed(v, id, hashReplyRef)
}
export function validateReplyRef(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.post#replyRef', v)
export function validateReplyRef<V>(v: V) {
return validate<ReplyRef & V>(v, id, hashReplyRef)
}
/** Deprecated: use facets instead. */
export interface Entity {
$type?: 'app.bsky.feed.post#entity'
index: TextSlice
/** Expected values are 'mention' and 'link'. */
type: string
value: string
[k: string]: unknown
}
export function isEntity(v: unknown): v is Entity {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#entity'
)
const hashEntity = 'entity'
export function isEntity<V>(v: V) {
return is$typed(v, id, hashEntity)
}
export function validateEntity(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.post#entity', v)
export function validateEntity<V>(v: V) {
return validate<Entity & V>(v, id, hashEntity)
}
/** Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. */
export interface TextSlice {
$type?: 'app.bsky.feed.post#textSlice'
start: number
end: number
[k: string]: unknown
}
export function isTextSlice(v: unknown): v is TextSlice {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.post#textSlice'
)
const hashTextSlice = 'textSlice'
export function isTextSlice<V>(v: V) {
return is$typed(v, id, hashTextSlice)
}
export function validateTextSlice(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.post#textSlice', v)
export function validateTextSlice<V>(v: V) {
return validate<TextSlice & V>(v, id, hashTextSlice)
}

@ -2,47 +2,47 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.postgate'
export interface Record {
$type: 'app.bsky.feed.postgate'
createdAt: string
/** Reference (AT-URI) to the post record. */
post: string
/** List of AT-URIs embedding this post that the author has detached from. */
detachedEmbeddingUris?: string[]
/** 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. */
embeddingRules?: (DisableRule | { $type: string; [k: string]: unknown })[]
embeddingRules?: ($Typed<DisableRule> | { $type: string })[]
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.feed.postgate#main' ||
v.$type === 'app.bsky.feed.postgate')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}
/** Disables embedding of this post. */
export interface DisableRule {
[k: string]: unknown
$type?: 'app.bsky.feed.postgate#disableRule'
}
export function isDisableRule(v: unknown): v is DisableRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.postgate#disableRule'
)
const hashDisableRule = 'disableRule'
export function isDisableRule<V>(v: V) {
return is$typed(v, id, hashDisableRule)
}
export function validateDisableRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.postgate#disableRule', v)
export function validateDisableRule<V>(v: V) {
return validate<DisableRule & V>(v, id, hashDisableRule)
}

@ -2,26 +2,28 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.repost'
export interface Record {
$type: 'app.bsky.feed.repost'
subject: ComAtprotoRepoStrongRef.Main
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.feed.repost#main' ||
v.$type === 'app.bsky.feed.repost')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.repost#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.searchPosts'
export interface QueryParams {
/** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
@ -41,7 +45,6 @@ export interface OutputSchema {
/** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */
hitsTotal?: number
posts: AppBskyFeedDefs.PostView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,21 +3,22 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.sendInteractions'
export interface QueryParams {}
export interface InputSchema {
interactions: AppBskyFeedDefs.Interaction[]
[k: string]: unknown
}
export interface OutputSchema {
[k: string]: unknown
}
export interface OutputSchema {}
export interface CallOptions {
signal?: AbortSignal

@ -2,20 +2,25 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.feed.threadgate'
export interface Record {
$type: 'app.bsky.feed.threadgate'
/** Reference (AT-URI) to the post record. */
post: string
/** 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. */
allow?: (
| MentionRule
| FollowerRule
| FollowingRule
| ListRule
| { $type: string; [k: string]: unknown }
| $Typed<MentionRule>
| $Typed<FollowerRule>
| $Typed<FollowingRule>
| $Typed<ListRule>
| { $type: string }
)[]
createdAt: string
/** List of hidden reply URIs. */
@ -23,84 +28,73 @@ export interface Record {
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.feed.threadgate#main' ||
v.$type === 'app.bsky.feed.threadgate')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.threadgate#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}
/** Allow replies from actors mentioned in your post. */
export interface MentionRule {
[k: string]: unknown
$type?: 'app.bsky.feed.threadgate#mentionRule'
}
export function isMentionRule(v: unknown): v is MentionRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.threadgate#mentionRule'
)
const hashMentionRule = 'mentionRule'
export function isMentionRule<V>(v: V) {
return is$typed(v, id, hashMentionRule)
}
export function validateMentionRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.threadgate#mentionRule', v)
export function validateMentionRule<V>(v: V) {
return validate<MentionRule & V>(v, id, hashMentionRule)
}
/** Allow replies from actors who follow you. */
export interface FollowerRule {
[k: string]: unknown
$type?: 'app.bsky.feed.threadgate#followerRule'
}
export function isFollowerRule(v: unknown): v is FollowerRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.threadgate#followerRule'
)
const hashFollowerRule = 'followerRule'
export function isFollowerRule<V>(v: V) {
return is$typed(v, id, hashFollowerRule)
}
export function validateFollowerRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.threadgate#followerRule', v)
export function validateFollowerRule<V>(v: V) {
return validate<FollowerRule & V>(v, id, hashFollowerRule)
}
/** Allow replies from actors you follow. */
export interface FollowingRule {
[k: string]: unknown
$type?: 'app.bsky.feed.threadgate#followingRule'
}
export function isFollowingRule(v: unknown): v is FollowingRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.threadgate#followingRule'
)
const hashFollowingRule = 'followingRule'
export function isFollowingRule<V>(v: V) {
return is$typed(v, id, hashFollowingRule)
}
export function validateFollowingRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.threadgate#followingRule', v)
export function validateFollowingRule<V>(v: V) {
return validate<FollowingRule & V>(v, id, hashFollowingRule)
}
/** Allow replies from actors on a list. */
export interface ListRule {
$type?: 'app.bsky.feed.threadgate#listRule'
list: string
[k: string]: unknown
}
export function isListRule(v: unknown): v is ListRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.threadgate#listRule'
)
const hashListRule = 'listRule'
export function isListRule<V>(v: V) {
return is$typed(v, id, hashListRule)
}
export function validateListRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.threadgate#listRule', v)
export function validateListRule<V>(v: V) {
return validate<ListRule & V>(v, id, hashListRule)
}

@ -2,26 +2,28 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.block'
export interface Record {
$type: 'app.bsky.graph.block'
/** DID of the account to be blocked. */
subject: string
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.graph.block#main' ||
v.$type === 'app.bsky.graph.block')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.block#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -2,15 +2,20 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as AppBskyActorDefs from '../actor/defs'
import * as AppBskyRichtextFacet from '../richtext/facet'
import * as AppBskyFeedDefs from '../feed/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
import type * as AppBskyActorDefs from '../actor/defs.js'
import type * as AppBskyRichtextFacet from '../richtext/facet.js'
import type * as AppBskyFeedDefs from '../feed/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.defs'
export interface ListViewBasic {
$type?: 'app.bsky.graph.defs#listViewBasic'
uri: string
cid: string
name: string
@ -20,22 +25,20 @@ export interface ListViewBasic {
labels?: ComAtprotoLabelDefs.Label[]
viewer?: ListViewerState
indexedAt?: string
[k: string]: unknown
}
export function isListViewBasic(v: unknown): v is ListViewBasic {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#listViewBasic'
)
const hashListViewBasic = 'listViewBasic'
export function isListViewBasic<V>(v: V) {
return is$typed(v, id, hashListViewBasic)
}
export function validateListViewBasic(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#listViewBasic', v)
export function validateListViewBasic<V>(v: V) {
return validate<ListViewBasic & V>(v, id, hashListViewBasic)
}
export interface ListView {
$type?: 'app.bsky.graph.defs#listView'
uri: string
cid: string
creator: AppBskyActorDefs.ProfileView
@ -48,43 +51,39 @@ export interface ListView {
labels?: ComAtprotoLabelDefs.Label[]
viewer?: ListViewerState
indexedAt: string
[k: string]: unknown
}
export function isListView(v: unknown): v is ListView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#listView'
)
const hashListView = 'listView'
export function isListView<V>(v: V) {
return is$typed(v, id, hashListView)
}
export function validateListView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#listView', v)
export function validateListView<V>(v: V) {
return validate<ListView & V>(v, id, hashListView)
}
export interface ListItemView {
$type?: 'app.bsky.graph.defs#listItemView'
uri: string
subject: AppBskyActorDefs.ProfileView
[k: string]: unknown
}
export function isListItemView(v: unknown): v is ListItemView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#listItemView'
)
const hashListItemView = 'listItemView'
export function isListItemView<V>(v: V) {
return is$typed(v, id, hashListItemView)
}
export function validateListItemView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#listItemView', v)
export function validateListItemView<V>(v: V) {
return validate<ListItemView & V>(v, id, hashListItemView)
}
export interface StarterPackView {
$type?: 'app.bsky.graph.defs#starterPackView'
uri: string
cid: string
record: {}
record: { [_ in string]: unknown }
creator: AppBskyActorDefs.ProfileViewBasic
list?: ListViewBasic
listItemsSample?: ListItemView[]
@ -93,44 +92,39 @@ export interface StarterPackView {
joinedAllTimeCount?: number
labels?: ComAtprotoLabelDefs.Label[]
indexedAt: string
[k: string]: unknown
}
export function isStarterPackView(v: unknown): v is StarterPackView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#starterPackView'
)
const hashStarterPackView = 'starterPackView'
export function isStarterPackView<V>(v: V) {
return is$typed(v, id, hashStarterPackView)
}
export function validateStarterPackView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#starterPackView', v)
export function validateStarterPackView<V>(v: V) {
return validate<StarterPackView & V>(v, id, hashStarterPackView)
}
export interface StarterPackViewBasic {
$type?: 'app.bsky.graph.defs#starterPackViewBasic'
uri: string
cid: string
record: {}
record: { [_ in string]: unknown }
creator: AppBskyActorDefs.ProfileViewBasic
listItemCount?: number
joinedWeekCount?: number
joinedAllTimeCount?: number
labels?: ComAtprotoLabelDefs.Label[]
indexedAt: string
[k: string]: unknown
}
export function isStarterPackViewBasic(v: unknown): v is StarterPackViewBasic {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#starterPackViewBasic'
)
const hashStarterPackViewBasic = 'starterPackViewBasic'
export function isStarterPackViewBasic<V>(v: V) {
return is$typed(v, id, hashStarterPackViewBasic)
}
export function validateStarterPackViewBasic(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#starterPackViewBasic', v)
export function validateStarterPackViewBasic<V>(v: V) {
return validate<StarterPackViewBasic & V>(v, id, hashStarterPackViewBasic)
}
export type ListPurpose =
@ -140,67 +134,61 @@ export type ListPurpose =
| (string & {})
/** A list of actors to apply an aggregate moderation action (mute/block) on. */
export const MODLIST = 'app.bsky.graph.defs#modlist'
export const MODLIST = `${id}#modlist`
/** A list of actors used for curation purposes such as list feeds or interaction gating. */
export const CURATELIST = 'app.bsky.graph.defs#curatelist'
export const CURATELIST = `${id}#curatelist`
/** A list of actors used for only for reference purposes such as within a starter pack. */
export const REFERENCELIST = 'app.bsky.graph.defs#referencelist'
export const REFERENCELIST = `${id}#referencelist`
export interface ListViewerState {
$type?: 'app.bsky.graph.defs#listViewerState'
muted?: boolean
blocked?: string
[k: string]: unknown
}
export function isListViewerState(v: unknown): v is ListViewerState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#listViewerState'
)
const hashListViewerState = 'listViewerState'
export function isListViewerState<V>(v: V) {
return is$typed(v, id, hashListViewerState)
}
export function validateListViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#listViewerState', v)
export function validateListViewerState<V>(v: V) {
return validate<ListViewerState & V>(v, id, hashListViewerState)
}
/** indicates that a handle or DID could not be resolved */
export interface NotFoundActor {
$type?: 'app.bsky.graph.defs#notFoundActor'
actor: string
notFound: true
[k: string]: unknown
}
export function isNotFoundActor(v: unknown): v is NotFoundActor {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#notFoundActor'
)
const hashNotFoundActor = 'notFoundActor'
export function isNotFoundActor<V>(v: V) {
return is$typed(v, id, hashNotFoundActor)
}
export function validateNotFoundActor(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#notFoundActor', v)
export function validateNotFoundActor<V>(v: V) {
return validate<NotFoundActor & V>(v, id, hashNotFoundActor)
}
/** lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) */
export interface Relationship {
$type?: 'app.bsky.graph.defs#relationship'
did: string
/** if the actor follows this DID, this is the AT-URI of the follow record */
following?: string
/** if the actor is followed by this DID, contains the AT-URI of the follow record */
followedBy?: string
[k: string]: unknown
}
export function isRelationship(v: unknown): v is Relationship {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#relationship'
)
const hashRelationship = 'relationship'
export function isRelationship<V>(v: V) {
return is$typed(v, id, hashRelationship)
}
export function validateRelationship(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#relationship', v)
export function validateRelationship<V>(v: V) {
return validate<Relationship & V>(v, id, hashRelationship)
}

@ -2,25 +2,27 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.follow'
export interface Record {
$type: 'app.bsky.graph.follow'
subject: string
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.graph.follow#main' ||
v.$type === 'app.bsky.graph.follow')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.follow#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getActorStarterPacks'
export interface QueryParams {
actor: string
@ -19,7 +23,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
starterPacks: AppBskyGraphDefs.StarterPackViewBasic[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getBlocks'
export interface QueryParams {
limit?: number
@ -18,7 +22,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
blocks: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getFollowers'
export interface QueryParams {
actor: string
@ -20,7 +24,6 @@ export interface OutputSchema {
subject: AppBskyActorDefs.ProfileView
cursor?: string
followers: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getFollows'
export interface QueryParams {
actor: string
@ -20,7 +24,6 @@ export interface OutputSchema {
subject: AppBskyActorDefs.ProfileView
cursor?: string
follows: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getKnownFollowers'
export interface QueryParams {
actor: string
@ -20,7 +24,6 @@ export interface OutputSchema {
subject: AppBskyActorDefs.ProfileView
cursor?: string
followers: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getList'
export interface QueryParams {
/** Reference (AT-URI) of the list record to hydrate. */
@ -21,7 +25,6 @@ export interface OutputSchema {
cursor?: string
list: AppBskyGraphDefs.ListView
items: AppBskyGraphDefs.ListItemView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getListBlocks'
export interface QueryParams {
limit?: number
@ -18,7 +22,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
lists: AppBskyGraphDefs.ListView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getListMutes'
export interface QueryParams {
limit?: number
@ -18,7 +22,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
lists: AppBskyGraphDefs.ListView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getLists'
export interface QueryParams {
/** The account (actor) to enumerate lists from. */
@ -20,7 +24,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
lists: AppBskyGraphDefs.ListView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getMutes'
export interface QueryParams {
limit?: number
@ -18,7 +22,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
mutes: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getRelationships'
export interface QueryParams {
/** Primary account requesting relationships for. */
@ -20,11 +24,10 @@ export type InputSchema = undefined
export interface OutputSchema {
actor?: string
relationships: (
| AppBskyGraphDefs.Relationship
| AppBskyGraphDefs.NotFoundActor
| { $type: string; [k: string]: unknown }
| $Typed<AppBskyGraphDefs.Relationship>
| $Typed<AppBskyGraphDefs.NotFoundActor>
| { $type: string }
)[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getStarterPack'
export interface QueryParams {
/** Reference (AT-URI) of the starter pack record. */
@ -17,7 +21,6 @@ export type InputSchema = undefined
export interface OutputSchema {
starterPack: AppBskyGraphDefs.StarterPackView
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getStarterPacks'
export interface QueryParams {
uris: string[]
@ -16,7 +20,6 @@ export type InputSchema = undefined
export interface OutputSchema {
starterPacks: AppBskyGraphDefs.StarterPackViewBasic[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.getSuggestedFollowsByActor'
export interface QueryParams {
actor: string
@ -20,7 +24,6 @@ export interface OutputSchema {
isFallback: boolean
/** Snowflake for this recommendation, use when submitting recommendation events. */
recId?: number
[k: string]: unknown
}
export interface CallOptions {

@ -2,36 +2,36 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import * as AppBskyRichtextFacet from '../richtext/facet'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
import type * as AppBskyRichtextFacet from '../richtext/facet.js'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.list'
export interface Record {
$type: 'app.bsky.graph.list'
purpose: AppBskyGraphDefs.ListPurpose
/** Display name for list; can not be empty. */
name: string
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: BlobRef
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string }
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.graph.list#main' ||
v.$type === 'app.bsky.graph.list')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.list#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -2,26 +2,28 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.listblock'
export interface Record {
$type: 'app.bsky.graph.listblock'
/** Reference (AT-URI) to the mod list record. */
subject: string
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.graph.listblock#main' ||
v.$type === 'app.bsky.graph.listblock')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.listblock#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -2,11 +2,16 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.listitem'
export interface Record {
$type: 'app.bsky.graph.listitem'
/** The account which is included on the list. */
subject: string
/** Reference (AT-URI) to the list record (app.bsky.graph.list). */
@ -15,15 +20,12 @@ export interface Record {
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.graph.listitem#main' ||
v.$type === 'app.bsky.graph.listitem')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.listitem#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -3,15 +3,18 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.muteActor'
export interface QueryParams {}
export interface InputSchema {
actor: string
[k: string]: unknown
}
export interface CallOptions {

@ -3,15 +3,18 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.muteActorList'
export interface QueryParams {}
export interface InputSchema {
list: string
[k: string]: unknown
}
export interface CallOptions {

@ -3,15 +3,18 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.muteThread'
export interface QueryParams {}
export interface InputSchema {
root: string
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyGraphDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.searchStarterPacks'
export interface QueryParams {
/** Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
@ -20,7 +24,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
starterPacks: AppBskyGraphDefs.StarterPackViewBasic[]
[k: string]: unknown
}
export interface CallOptions {

@ -2,12 +2,17 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyRichtextFacet from '../richtext/facet'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyRichtextFacet from '../richtext/facet.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.starterpack'
export interface Record {
$type: 'app.bsky.graph.starterpack'
/** Display name for starter pack; can not be empty. */
name: string
description?: string
@ -19,32 +24,27 @@ export interface Record {
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.graph.starterpack#main' ||
v.$type === 'app.bsky.graph.starterpack')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.starterpack#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}
export interface FeedItem {
$type?: 'app.bsky.graph.starterpack#feedItem'
uri: string
[k: string]: unknown
}
export function isFeedItem(v: unknown): v is FeedItem {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.starterpack#feedItem'
)
const hashFeedItem = 'feedItem'
export function isFeedItem<V>(v: V) {
return is$typed(v, id, hashFeedItem)
}
export function validateFeedItem(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.starterpack#feedItem', v)
export function validateFeedItem<V>(v: V) {
return validate<FeedItem & V>(v, id, hashFeedItem)
}

@ -3,15 +3,18 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.unmuteActor'
export interface QueryParams {}
export interface InputSchema {
actor: string
[k: string]: unknown
}
export interface CallOptions {

@ -3,15 +3,18 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.unmuteActorList'
export interface QueryParams {}
export interface InputSchema {
list: string
[k: string]: unknown
}
export interface CallOptions {

@ -3,15 +3,18 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.graph.unmuteThread'
export interface QueryParams {}
export interface InputSchema {
root: string
[k: string]: unknown
}
export interface CallOptions {

@ -2,13 +2,18 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.labeler.defs'
export interface LabelerView {
$type?: 'app.bsky.labeler.defs#labelerView'
uri: string
cid: string
creator: AppBskyActorDefs.ProfileView
@ -16,22 +21,20 @@ export interface LabelerView {
viewer?: LabelerViewerState
indexedAt: string
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isLabelerView(v: unknown): v is LabelerView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.labeler.defs#labelerView'
)
const hashLabelerView = 'labelerView'
export function isLabelerView<V>(v: V) {
return is$typed(v, id, hashLabelerView)
}
export function validateLabelerView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.labeler.defs#labelerView', v)
export function validateLabelerView<V>(v: V) {
return validate<LabelerView & V>(v, id, hashLabelerView)
}
export interface LabelerViewDetailed {
$type?: 'app.bsky.labeler.defs#labelerViewDetailed'
uri: string
cid: string
creator: AppBskyActorDefs.ProfileView
@ -40,54 +43,47 @@ export interface LabelerViewDetailed {
viewer?: LabelerViewerState
indexedAt: string
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isLabelerViewDetailed(v: unknown): v is LabelerViewDetailed {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.labeler.defs#labelerViewDetailed'
)
const hashLabelerViewDetailed = 'labelerViewDetailed'
export function isLabelerViewDetailed<V>(v: V) {
return is$typed(v, id, hashLabelerViewDetailed)
}
export function validateLabelerViewDetailed(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.labeler.defs#labelerViewDetailed', v)
export function validateLabelerViewDetailed<V>(v: V) {
return validate<LabelerViewDetailed & V>(v, id, hashLabelerViewDetailed)
}
export interface LabelerViewerState {
$type?: 'app.bsky.labeler.defs#labelerViewerState'
like?: string
[k: string]: unknown
}
export function isLabelerViewerState(v: unknown): v is LabelerViewerState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.labeler.defs#labelerViewerState'
)
const hashLabelerViewerState = 'labelerViewerState'
export function isLabelerViewerState<V>(v: V) {
return is$typed(v, id, hashLabelerViewerState)
}
export function validateLabelerViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.labeler.defs#labelerViewerState', v)
export function validateLabelerViewerState<V>(v: V) {
return validate<LabelerViewerState & V>(v, id, hashLabelerViewerState)
}
export interface LabelerPolicies {
$type?: 'app.bsky.labeler.defs#labelerPolicies'
/** The label values which this labeler publishes. May include global or custom labels. */
labelValues: ComAtprotoLabelDefs.LabelValue[]
/** Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler. */
labelValueDefinitions?: ComAtprotoLabelDefs.LabelValueDefinition[]
[k: string]: unknown
}
export function isLabelerPolicies(v: unknown): v is LabelerPolicies {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.labeler.defs#labelerPolicies'
)
const hashLabelerPolicies = 'labelerPolicies'
export function isLabelerPolicies<V>(v: V) {
return is$typed(v, id, hashLabelerPolicies)
}
export function validateLabelerPolicies(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.labeler.defs#labelerPolicies', v)
export function validateLabelerPolicies<V>(v: V) {
return validate<LabelerPolicies & V>(v, id, hashLabelerPolicies)
}

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyLabelerDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyLabelerDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.labeler.getServices'
export interface QueryParams {
dids: string[]
@ -17,11 +21,10 @@ export type InputSchema = undefined
export interface OutputSchema {
views: (
| AppBskyLabelerDefs.LabelerView
| AppBskyLabelerDefs.LabelerViewDetailed
| { $type: string; [k: string]: unknown }
| $Typed<AppBskyLabelerDefs.LabelerView>
| $Typed<AppBskyLabelerDefs.LabelerViewDetailed>
| { $type: string }
)[]
[k: string]: unknown
}
export interface CallOptions {

@ -2,30 +2,30 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyLabelerDefs from './defs'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyLabelerDefs from './defs.js'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.labeler.service'
export interface Record {
$type: 'app.bsky.labeler.service'
policies: AppBskyLabelerDefs.LabelerPolicies
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
labels?: $Typed<ComAtprotoLabelDefs.SelfLabels> | { $type: string }
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.labeler.service#main' ||
v.$type === 'app.bsky.labeler.service')
)
const hashRecord = 'main'
export function isRecord<V>(v: V) {
return is$typed(v, id, hashRecord)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.labeler.service#main', v)
export function validateRecord<V>(v: V) {
return validate<Record & V>(v, id, hashRecord, true)
}

@ -3,9 +3,13 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.notification.getUnreadCount'
export interface QueryParams {
priority?: boolean
@ -16,7 +20,6 @@ export type InputSchema = undefined
export interface OutputSchema {
count: number
[k: string]: unknown
}
export interface CallOptions {

@ -3,11 +3,15 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyActorDefs from '../actor/defs'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyActorDefs from '../actor/defs.js'
import type * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.notification.listNotifications'
export interface QueryParams {
/** Notification reasons to include in response. */
@ -25,7 +29,6 @@ export interface OutputSchema {
notifications: Notification[]
priority?: boolean
seenAt?: string
[k: string]: unknown
}
export interface CallOptions {
@ -44,6 +47,7 @@ export function toKnownErr(e: any) {
}
export interface Notification {
$type?: 'app.bsky.notification.listNotifications#notification'
uri: string
cid: string
author: AppBskyActorDefs.ProfileView
@ -58,24 +62,18 @@ export interface Notification {
| 'starterpack-joined'
| (string & {})
reasonSubject?: string
record: {}
record: { [_ in string]: unknown }
isRead: boolean
indexedAt: string
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isNotification(v: unknown): v is Notification {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.notification.listNotifications#notification'
)
const hashNotification = 'notification'
export function isNotification<V>(v: V) {
return is$typed(v, id, hashNotification)
}
export function validateNotification(v: unknown): ValidationResult {
return lexicons.validate(
'app.bsky.notification.listNotifications#notification',
v,
)
export function validateNotification<V>(v: V) {
return validate<Notification & V>(v, id, hashNotification)
}

@ -3,15 +3,18 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.notification.putPreferences'
export interface QueryParams {}
export interface InputSchema {
priority: boolean
[k: string]: unknown
}
export interface CallOptions {

@ -3,9 +3,13 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.notification.registerPush'
export interface QueryParams {}
@ -14,7 +18,6 @@ export interface InputSchema {
token: string
platform: 'ios' | 'android' | 'web' | (string & {})
appId: string
[k: string]: unknown
}
export interface CallOptions {

@ -3,15 +3,18 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.notification.updateSeen'
export interface QueryParams {}
export interface InputSchema {
seenAt: string
[k: string]: unknown
}
export interface CallOptions {

@ -2,97 +2,92 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.richtext.facet'
/** Annotation of a sub-string within rich text. */
export interface Main {
$type?: 'app.bsky.richtext.facet'
index: ByteSlice
features: (Mention | Link | Tag | { $type: string; [k: string]: unknown })[]
[k: string]: unknown
features: ($Typed<Mention> | $Typed<Link> | $Typed<Tag> | { $type: string })[]
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.richtext.facet#main' ||
v.$type === 'app.bsky.richtext.facet')
)
const hashMain = 'main'
export function isMain<V>(v: V) {
return is$typed(v, id, hashMain)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#main', v)
export function validateMain<V>(v: V) {
return validate<Main & V>(v, id, hashMain)
}
/** Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID. */
export interface Mention {
$type?: 'app.bsky.richtext.facet#mention'
did: string
[k: string]: unknown
}
export function isMention(v: unknown): v is Mention {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.richtext.facet#mention'
)
const hashMention = 'mention'
export function isMention<V>(v: V) {
return is$typed(v, id, hashMention)
}
export function validateMention(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#mention', v)
export function validateMention<V>(v: V) {
return validate<Mention & V>(v, id, hashMention)
}
/** Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. */
export interface Link {
$type?: 'app.bsky.richtext.facet#link'
uri: string
[k: string]: unknown
}
export function isLink(v: unknown): v is Link {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.richtext.facet#link'
)
const hashLink = 'link'
export function isLink<V>(v: V) {
return is$typed(v, id, hashLink)
}
export function validateLink(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#link', v)
export function validateLink<V>(v: V) {
return validate<Link & V>(v, id, hashLink)
}
/** 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'). */
export interface Tag {
$type?: 'app.bsky.richtext.facet#tag'
tag: string
[k: string]: unknown
}
export function isTag(v: unknown): v is Tag {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.richtext.facet#tag'
)
const hashTag = 'tag'
export function isTag<V>(v: V) {
return is$typed(v, id, hashTag)
}
export function validateTag(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#tag', v)
export function validateTag<V>(v: V) {
return validate<Tag & V>(v, id, hashTag)
}
/** 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. */
export interface ByteSlice {
$type?: 'app.bsky.richtext.facet#byteSlice'
byteStart: number
byteEnd: number
[k: string]: unknown
}
export function isByteSlice(v: unknown): v is ByteSlice {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.richtext.facet#byteSlice'
)
const hashByteSlice = 'byteSlice'
export function isByteSlice<V>(v: V) {
return is$typed(v, id, hashByteSlice)
}
export function validateByteSlice(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#byteSlice', v)
export function validateByteSlice<V>(v: V) {
return validate<ByteSlice & V>(v, id, hashByteSlice)
}

@ -2,84 +2,77 @@
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.unspecced.defs'
export interface SkeletonSearchPost {
$type?: 'app.bsky.unspecced.defs#skeletonSearchPost'
uri: string
[k: string]: unknown
}
export function isSkeletonSearchPost(v: unknown): v is SkeletonSearchPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.unspecced.defs#skeletonSearchPost'
)
const hashSkeletonSearchPost = 'skeletonSearchPost'
export function isSkeletonSearchPost<V>(v: V) {
return is$typed(v, id, hashSkeletonSearchPost)
}
export function validateSkeletonSearchPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchPost', v)
export function validateSkeletonSearchPost<V>(v: V) {
return validate<SkeletonSearchPost & V>(v, id, hashSkeletonSearchPost)
}
export interface SkeletonSearchActor {
$type?: 'app.bsky.unspecced.defs#skeletonSearchActor'
did: string
[k: string]: unknown
}
export function isSkeletonSearchActor(v: unknown): v is SkeletonSearchActor {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.unspecced.defs#skeletonSearchActor'
)
const hashSkeletonSearchActor = 'skeletonSearchActor'
export function isSkeletonSearchActor<V>(v: V) {
return is$typed(v, id, hashSkeletonSearchActor)
}
export function validateSkeletonSearchActor(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchActor', v)
export function validateSkeletonSearchActor<V>(v: V) {
return validate<SkeletonSearchActor & V>(v, id, hashSkeletonSearchActor)
}
export interface SkeletonSearchStarterPack {
$type?: 'app.bsky.unspecced.defs#skeletonSearchStarterPack'
uri: string
[k: string]: unknown
}
export function isSkeletonSearchStarterPack(
v: unknown,
): v is SkeletonSearchStarterPack {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.unspecced.defs#skeletonSearchStarterPack'
)
const hashSkeletonSearchStarterPack = 'skeletonSearchStarterPack'
export function isSkeletonSearchStarterPack<V>(v: V) {
return is$typed(v, id, hashSkeletonSearchStarterPack)
}
export function validateSkeletonSearchStarterPack(
v: unknown,
): ValidationResult {
return lexicons.validate(
'app.bsky.unspecced.defs#skeletonSearchStarterPack',
export function validateSkeletonSearchStarterPack<V>(v: V) {
return validate<SkeletonSearchStarterPack & V>(
v,
id,
hashSkeletonSearchStarterPack,
)
}
export interface TrendingTopic {
$type?: 'app.bsky.unspecced.defs#trendingTopic'
topic: string
displayName?: string
description?: string
link: string
[k: string]: unknown
}
export function isTrendingTopic(v: unknown): v is TrendingTopic {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.unspecced.defs#trendingTopic'
)
const hashTrendingTopic = 'trendingTopic'
export function isTrendingTopic<V>(v: V) {
return is$typed(v, id, hashTrendingTopic)
}
export function validateTrendingTopic(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.unspecced.defs#trendingTopic', v)
export function validateTrendingTopic<V>(v: V) {
return validate<TrendingTopic & V>(v, id, hashTrendingTopic)
}

@ -3,9 +3,13 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.unspecced.getConfig'
export interface QueryParams {}
@ -13,7 +17,6 @@ export type InputSchema = undefined
export interface OutputSchema {
checkEmailConfirmed?: boolean
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyFeedDefs from '../feed/defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyFeedDefs from '../feed/defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.unspecced.getPopularFeedGenerators'
export interface QueryParams {
limit?: number
@ -19,7 +23,6 @@ export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feeds: AppBskyFeedDefs.GeneratorView[]
[k: string]: unknown
}
export interface CallOptions {

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyUnspeccedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyUnspeccedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.unspecced.getSuggestionsSkeleton'
export interface QueryParams {
/** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
@ -26,7 +30,6 @@ export interface OutputSchema {
relativeToDid?: string
/** Snowflake for this recommendation, use when submitting recommendation events. */
recId?: number
[k: string]: unknown
}
export interface CallOptions {

@ -3,9 +3,13 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.unspecced.getTaggedSuggestions'
export interface QueryParams {}
@ -13,7 +17,6 @@ export type InputSchema = undefined
export interface OutputSchema {
suggestions: Suggestion[]
[k: string]: unknown
}
export interface CallOptions {
@ -32,23 +35,18 @@ export function toKnownErr(e: any) {
}
export interface Suggestion {
$type?: 'app.bsky.unspecced.getTaggedSuggestions#suggestion'
tag: string
subjectType: 'actor' | 'feed' | (string & {})
subject: string
[k: string]: unknown
}
export function isSuggestion(v: unknown): v is Suggestion {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.unspecced.getTaggedSuggestions#suggestion'
)
const hashSuggestion = 'suggestion'
export function isSuggestion<V>(v: V) {
return is$typed(v, id, hashSuggestion)
}
export function validateSuggestion(v: unknown): ValidationResult {
return lexicons.validate(
'app.bsky.unspecced.getTaggedSuggestions#suggestion',
v,
)
export function validateSuggestion<V>(v: V) {
return validate<Suggestion & V>(v, id, hashSuggestion)
}

@ -3,10 +3,14 @@
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { isObj, hasProp } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import { CID } from 'multiformats/cid'
import * as AppBskyUnspeccedDefs from './defs'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as AppBskyUnspeccedDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'app.bsky.unspecced.getTrendingTopics'
export interface QueryParams {
/** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */
@ -19,7 +23,6 @@ export type InputSchema = undefined
export interface OutputSchema {
topics: AppBskyUnspeccedDefs.TrendingTopic[]
suggested: AppBskyUnspeccedDefs.TrendingTopic[]
[k: string]: unknown
}
export interface CallOptions {

Some files were not shown because too many files have changed in this diff Show More