Skip to content

Commit

Permalink
codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieusieben committed Dec 18, 2024
1 parent afa00ce commit 17b3081
Show file tree
Hide file tree
Showing 876 changed files with 9,739 additions and 8,138 deletions.
405 changes: 213 additions & 192 deletions packages/api/src/client/types/app/bsky/actor/defs.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import * as AppBskyActorDefs from './defs'

const id = 'app.bsky.actor.getPreferences'

export interface QueryParams {}

export type InputSchema = undefined
Expand Down
6 changes: 4 additions & 2 deletions packages/api/src/client/types/app/bsky/actor/getProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import * as AppBskyActorDefs from './defs'

const id = 'app.bsky.actor.getProfile'

export interface QueryParams {
/** Handle or DID of account to fetch profile of. */
actor: string
Expand Down
6 changes: 4 additions & 2 deletions packages/api/src/client/types/app/bsky/actor/getProfiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import * as AppBskyActorDefs from './defs'

const id = 'app.bsky.actor.getProfiles'

export interface QueryParams {
actors: string[]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import * as AppBskyActorDefs from './defs'

const id = 'app.bsky.actor.getSuggestions'

export interface QueryParams {
limit?: number
cursor?: string
Expand Down
21 changes: 10 additions & 11 deletions packages/api/src/client/types/app/bsky/actor/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
* 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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'

const id = 'app.bsky.actor.profile'

export interface Record {
displayName?: string
/** Free-form profile description text. */
Expand All @@ -25,15 +27,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.actor.profile#main' ||
v.$type === 'app.bsky.actor.profile')
)
export function isRecord(
v: unknown,
): v is Record & { $type: $Type<'app.bsky.actor.profile', 'main'> } {
return is$typed(v, id, 'main')
}

export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.profile#main', v)
export function validateRecord(v: unknown) {
return lexicons.validate(`${id}#main`, v) as ValidationResult<Record>
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import * as AppBskyActorDefs from './defs'

const id = 'app.bsky.actor.putPreferences'

export interface QueryParams {}

export interface InputSchema {
Expand Down
6 changes: 4 additions & 2 deletions packages/api/src/client/types/app/bsky/actor/searchActors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import * as AppBskyActorDefs from './defs'

const id = 'app.bsky.actor.searchActors'

export interface QueryParams {
/** DEPRECATED: use 'q' instead. */
term?: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import * as AppBskyActorDefs from './defs'

const id = 'app.bsky.actor.searchActorsTypeahead'

export interface QueryParams {
/** DEPRECATED: use 'q' instead. */
term?: string
Expand Down
23 changes: 13 additions & 10 deletions packages/api/src/client/types/app/bsky/embed/defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
* 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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'

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 {
Expand All @@ -13,14 +15,15 @@ export interface AspectRatio {
[k: string]: unknown
}

export function isAspectRatio(v: unknown): v is AspectRatio {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.defs#aspectRatio'
)
export function isAspectRatio(
v: unknown,
): v is AspectRatio & { $type: $Type<'app.bsky.embed.defs', 'aspectRatio'> } {
return is$typed(v, id, 'aspectRatio')
}

export function validateAspectRatio(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.defs#aspectRatio', v)
export function validateAspectRatio(v: unknown) {
return lexicons.validate(
`${id}#aspectRatio`,
v,
) as ValidationResult<AspectRatio>
}
66 changes: 31 additions & 35 deletions packages/api/src/client/types/app/bsky/embed/external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@
* 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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'

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 {
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')
)
export function isMain(
v: unknown,
): v is Main & { $type: $Type<'app.bsky.embed.external', 'main'> } {
return is$typed(v, id, 'main')
}

export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#main', v)
export function validateMain(v: unknown) {
return lexicons.validate(`${id}#main`, v) as ValidationResult<Main>
}

export interface External {
Expand All @@ -33,33 +32,29 @@ export interface External {
[k: string]: unknown
}

export function isExternal(v: unknown): v is External {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.external#external'
)
export function isExternal(
v: unknown,
): v is External & { $type: $Type<'app.bsky.embed.external', 'external'> } {
return is$typed(v, id, 'external')
}

export function validateExternal(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#external', v)
export function validateExternal(v: unknown) {
return lexicons.validate(`${id}#external`, v) as ValidationResult<External>
}

export interface 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'
)
export function isView(
v: unknown,
): v is View & { $type: $Type<'app.bsky.embed.external', 'view'> } {
return is$typed(v, id, 'view')
}

export function validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#view', v)
export function validateView(v: unknown) {
return lexicons.validate(`${id}#view`, v) as ValidationResult<View>
}

export interface ViewExternal {
Expand All @@ -70,14 +65,15 @@ export interface ViewExternal {
[k: string]: unknown
}

export function isViewExternal(v: unknown): v is ViewExternal {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.external#viewExternal'
)
export function isViewExternal(v: unknown): v is ViewExternal & {
$type: $Type<'app.bsky.embed.external', 'viewExternal'>
} {
return is$typed(v, id, 'viewExternal')
}

export function validateViewExternal(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#viewExternal', v)
export function validateViewExternal(v: unknown) {
return lexicons.validate(
`${id}#viewExternal`,
v,
) as ValidationResult<ViewExternal>
}
59 changes: 28 additions & 31 deletions packages/api/src/client/types/app/bsky/embed/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@
* 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 { $Type, is$typed } from '../../../../util'
import { lexicons } from '../../../../lexicons'
import * as AppBskyEmbedDefs from './defs'

const id = 'app.bsky.embed.images'

export interface Main {
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')
)
export function isMain(
v: unknown,
): v is Main & { $type: $Type<'app.bsky.embed.images', 'main'> } {
return is$typed(v, id, 'main')
}

export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#main', v)
export function validateMain(v: unknown) {
return lexicons.validate(`${id}#main`, v) as ValidationResult<Main>
}

export interface Image {
Expand All @@ -33,29 +32,29 @@ export interface Image {
[k: string]: unknown
}

export function isImage(v: unknown): v is Image {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.images#image'
)
export function isImage(
v: unknown,
): v is Image & { $type: $Type<'app.bsky.embed.images', 'image'> } {
return is$typed(v, id, 'image')
}

export function validateImage(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#image', v)
export function validateImage(v: unknown) {
return lexicons.validate(`${id}#image`, v) as ValidationResult<Image>
}

export interface 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'
)
export function isView(
v: unknown,
): v is View & { $type: $Type<'app.bsky.embed.images', 'view'> } {
return is$typed(v, id, 'view')
}

export function validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#view', v)
export function validateView(v: unknown) {
return lexicons.validate(`${id}#view`, v) as ValidationResult<View>
}

export interface ViewImage {
Expand All @@ -69,14 +68,12 @@ export interface ViewImage {
[k: string]: unknown
}

export function isViewImage(v: unknown): v is ViewImage {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.images#viewImage'
)
export function isViewImage(
v: unknown,
): v is ViewImage & { $type: $Type<'app.bsky.embed.images', 'viewImage'> } {
return is$typed(v, id, 'viewImage')
}

export function validateViewImage(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#viewImage', v)
export function validateViewImage(v: unknown) {
return lexicons.validate(`${id}#viewImage`, v) as ValidationResult<ViewImage>
}
Loading

0 comments on commit 17b3081

Please sign in to comment.