update all Lexicons from atproto repo

This commit is contained in:
bryan newbold 2023-09-28 17:11:53 -07:00
parent 64162fa136
commit 7ea9699b49
122 changed files with 3353 additions and 566 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -107,6 +107,10 @@ export function validateViewerState(v: unknown): ValidationResult {
export type Preferences = (
| AdultContentPref
| ContentLabelPref
| SavedFeedsPref
| PersonalDetailsPref
| FeedViewPref
| ThreadViewPref
| { $type: string; [k: string]: unknown }
)[]
@ -144,3 +148,87 @@ export function isContentLabelPref(v: unknown): v is ContentLabelPref {
export function validateContentLabelPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#contentLabelPref', v)
}
export interface SavedFeedsPref {
pinned: string[]
saved: string[]
[k: string]: unknown
}
export function isSavedFeedsPref(v: unknown): v is SavedFeedsPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#savedFeedsPref'
)
}
export function validateSavedFeedsPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#savedFeedsPref', v)
}
export interface PersonalDetailsPref {
/** The birth date of the owner of the account. */
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'
)
}
export function validatePersonalDetailsPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#personalDetailsPref', v)
}
export interface FeedViewPref {
/** The URI of the feed, or an identifier which describes the feed. */
feed: string
/** Hide replies in the feed. */
hideReplies?: boolean
/** Hide replies in the feed if they are not by followed users. */
hideRepliesByUnfollowed?: boolean
/** Hide replies in the feed if they do not have this number of likes. */
hideRepliesByLikeCount?: number
/** Hide reposts in the feed. */
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'
)
}
export function validateFeedViewPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#feedViewPref', v)
}
export interface ThreadViewPref {
/** Sorting mode. */
sort?: 'oldest' | 'newest' | 'most-likes' | 'random' | (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'
)
}
export function validateThreadViewPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#threadViewPref', v)
}

View File

@ -23,6 +23,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -31,10 +32,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -20,6 +20,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -28,10 +29,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -25,6 +25,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -33,10 +34,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -27,6 +27,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -35,10 +36,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -5,12 +5,16 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
export interface Record {
displayName?: string
description?: string
avatar?: BlobRef
banner?: BlobRef
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
[k: string]: unknown
}

View File

@ -27,10 +27,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -10,7 +10,10 @@ import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyActorDefs from './defs'
export interface QueryParams {
/** DEPRECATED: use 'q' instead */
term?: string
/** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended */
q?: string
limit: number
cursor?: string
}
@ -28,6 +31,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -36,10 +40,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -10,7 +10,10 @@ import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyActorDefs from './defs'
export interface QueryParams {
/** DEPRECATED: use 'q' instead */
term?: string
/** search query prefix; not a full query string */
q?: string
limit: number
}
@ -26,6 +29,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -34,10 +38,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -27,6 +27,7 @@ export function validateMain(v: unknown): ValidationResult {
export interface Image {
image: BlobRef
alt: string
aspectRatio?: AspectRatio
[k: string]: unknown
}
@ -40,6 +41,25 @@ export function validateImage(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#image', v)
}
/** width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit. */
export interface 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.images#aspectRatio'
)
}
export function validateAspectRatio(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#aspectRatio', v)
}
export interface View {
images: ViewImage[]
[k: string]: unknown
@ -59,6 +79,7 @@ export interface ViewImage {
thumb: string
fullsize: string
alt: string
aspectRatio?: AspectRatio
[k: string]: unknown
}

View File

@ -7,6 +7,7 @@ import { isObj, hasProp } from '../../../../util'
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 AppBskyActorDefs from '../actor/defs'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as AppBskyEmbedImages from './images'
@ -37,6 +38,7 @@ export interface View {
| ViewNotFound
| ViewBlocked
| AppBskyFeedDefs.GeneratorView
| AppBskyGraphDefs.ListView
| { $type: string; [k: string]: unknown }
[k: string]: unknown
}
@ -82,6 +84,7 @@ export function validateViewRecord(v: unknown): ValidationResult {
export interface ViewNotFound {
uri: string
notFound: true
[k: string]: unknown
}
@ -99,6 +102,8 @@ export function validateViewNotFound(v: unknown): ValidationResult {
export interface ViewBlocked {
uri: string
blocked: true
author: AppBskyFeedDefs.BlockedAuthor
[k: string]: unknown
}

View File

@ -12,6 +12,7 @@ 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'
export interface PostView {
uri: string
@ -30,6 +31,7 @@ export interface PostView {
indexedAt: string
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
threadgate?: ThreadgateView
[k: string]: unknown
}
@ -135,6 +137,7 @@ export interface ThreadViewPost {
| BlockedPost
| { $type: string; [k: string]: unknown }
)[]
viewer?: ViewerThreadState
[k: string]: unknown
}
@ -171,6 +174,7 @@ export function validateNotFoundPost(v: unknown): ValidationResult {
export interface BlockedPost {
uri: string
blocked: true
author: BlockedAuthor
[k: string]: unknown
}
@ -186,12 +190,47 @@ export function validateBlockedPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#blockedPost', v)
}
export interface 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'
)
}
export function validateBlockedAuthor(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#blockedAuthor', v)
}
export interface ViewerThreadState {
canReply?: boolean
[k: string]: unknown
}
export function isViewerThreadState(v: unknown): v is ViewerThreadState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#viewerThreadState'
)
}
export function validateViewerThreadState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#viewerThreadState', v)
}
export interface GeneratorView {
uri: string
cid: string
did?: string
did: string
creator: AppBskyActorDefs.ProfileView
displayName?: string
displayName: string
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: string
@ -214,7 +253,6 @@ export function validateGeneratorView(v: unknown): ValidationResult {
}
export interface GeneratorViewerState {
saved?: boolean
like?: string
[k: string]: unknown
}
@ -265,3 +303,23 @@ export function isSkeletonReasonRepost(v: unknown): v is SkeletonReasonRepost {
export function validateSkeletonReasonRepost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v)
}
export interface ThreadgateView {
uri?: string
cid?: string
record?: {}
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'
)
}
export function validateThreadgateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#threadgateView', v)
}

View File

@ -24,6 +24,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -32,13 +33,16 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput
export interface Feed {
uri: string

View File

@ -6,13 +6,17 @@ import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import * as AppBskyRichtextFacet from '../richtext/facet'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
export interface Record {
did: string
displayName?: string
displayName: string
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: BlobRef
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
createdAt: string
[k: string]: unknown
}

View File

@ -28,6 +28,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -36,10 +37,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -0,0 +1,50 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyFeedDefs from './defs'
export interface QueryParams {
actor: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feed: AppBskyFeedDefs.FeedViewPost[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
error?: 'BlockedActor' | 'BlockedByActor'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -13,6 +13,11 @@ export interface QueryParams {
actor: string
limit: number
cursor?: string
filter:
| 'posts_with_replies'
| 'posts_no_replies'
| 'posts_with_media'
| (string & {})
}
export type InputSchema = undefined
@ -28,6 +33,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,10 +43,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -28,6 +28,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,10 +38,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -27,6 +27,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -35,10 +36,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -0,0 +1,46 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyFeedDefs from './defs'
export interface QueryParams {
feeds: string[]
}
export type InputSchema = undefined
export interface OutputSchema {
feeds: AppBskyFeedDefs.GeneratorView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -28,6 +28,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,10 +38,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -31,6 +31,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -39,13 +40,16 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput
export interface Like {
indexedAt: string

View File

@ -0,0 +1,50 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyFeedDefs from './defs'
export interface QueryParams {
list: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feed: AppBskyFeedDefs.FeedViewPost[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
error?: 'UnknownList'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -11,7 +11,8 @@ import * as AppBskyFeedDefs from './defs'
export interface QueryParams {
uri: string
depth?: number
depth: number
parentHeight: number
}
export type InputSchema = undefined
@ -30,6 +31,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -39,10 +41,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -25,6 +25,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -33,10 +34,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -31,6 +31,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -39,10 +40,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -27,6 +27,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -35,10 +36,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -28,6 +28,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -36,10 +37,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -10,6 +10,7 @@ import * as AppBskyEmbedImages from '../embed/images'
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'
export interface Record {
@ -24,6 +25,12 @@ export interface Record {
| AppBskyEmbedRecord.Main
| AppBskyEmbedRecordWithMedia.Main
| { $type: string; [k: string]: unknown }
langs?: string[]
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
/** Additional non-inline tags describing this post. */
tags?: string[]
createdAt: string
[k: string]: unknown
}

View File

@ -0,0 +1,54 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyFeedDefs from './defs'
export interface QueryParams {
/** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended */
q: string
limit: number
/** optional pagination mechanism; may not necessarily allow scrolling through entire result set */
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
/** 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 type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
error?: 'BadQueryString'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -0,0 +1,84 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
export interface Record {
post: string
allow?: (
| MentionRule
| FollowingRule
| ListRule
| { $type: string; [k: string]: unknown }
)[]
createdAt: string
[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')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.threadgate#main', v)
}
/** Allow replies from actors mentioned in your post. */
export interface MentionRule {
[k: string]: unknown
}
export function isMentionRule(v: unknown): v is MentionRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.threadgate#mentionRule'
)
}
export function validateMentionRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.threadgate#mentionRule', v)
}
/** Allow replies from actors you follow. */
export interface FollowingRule {
[k: string]: unknown
}
export function isFollowingRule(v: unknown): v is FollowingRule {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.threadgate#followingRule'
)
}
export function validateFollowingRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.threadgate#followingRule', v)
}
/** Allow replies from actors on a list. */
export interface 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'
)
}
export function validateListRule(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.threadgate#listRule', v)
}

View File

@ -10,6 +10,7 @@ import * as AppBskyRichtextFacet from '../richtext/facet'
export interface ListViewBasic {
uri: string
cid: string
name: string
purpose: ListPurpose
avatar?: string
@ -32,6 +33,7 @@ export function validateListViewBasic(v: unknown): ValidationResult {
export interface ListView {
uri: string
cid: string
creator: AppBskyActorDefs.ProfileView
name: string
purpose: ListPurpose
@ -72,13 +74,19 @@ export function validateListItemView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#listItemView', v)
}
export type ListPurpose = 'app.bsky.graph.defs#modlist' | (string & {})
export type ListPurpose =
| 'app.bsky.graph.defs#modlist'
| 'app.bsky.graph.defs#curatelist'
| (string & {})
/** A list of actors to apply an aggregate moderation action (mute/block) on */
export const MODLIST = 'app.bsky.graph.defs#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 interface ListViewerState {
muted?: boolean
blocked?: string
[k: string]: unknown
}

View File

@ -27,6 +27,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -35,10 +36,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -29,6 +29,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,10 +38,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -29,6 +29,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,10 +38,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -29,6 +29,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,10 +38,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -0,0 +1,48 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyGraphDefs from './defs'
export interface QueryParams {
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
lists: AppBskyGraphDefs.ListView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -27,6 +27,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -35,10 +36,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -28,6 +28,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -36,10 +37,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -27,6 +27,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -35,10 +36,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -0,0 +1,46 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyActorDefs from '../actor/defs'
export interface QueryParams {
actor: string
}
export type InputSchema = undefined
export interface OutputSchema {
suggestions: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -7,6 +7,7 @@ import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import * as AppBskyGraphDefs from './defs'
import * as AppBskyRichtextFacet from '../richtext/facet'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
export interface Record {
purpose: AppBskyGraphDefs.ListPurpose
@ -14,6 +15,9 @@ export interface Record {
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: BlobRef
labels?:
| ComAtprotoLabelDefs.SelfLabels
| { $type: string; [k: string]: unknown }
createdAt: string
[k: string]: unknown
}

View File

@ -0,0 +1,26 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
export interface 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')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.listblock#main', v)
}

View File

@ -26,10 +26,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -26,10 +26,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -26,10 +26,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -26,10 +26,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -24,6 +24,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -32,10 +33,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -29,6 +29,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,13 +38,16 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput
export interface Notification {
uri: string

View File

@ -11,7 +11,10 @@ import { HandlerAuth } from '@atproto/xrpc-server'
export interface QueryParams {}
export interface InputSchema {
feed: string
serviceDid: string
token: string
platform: 'ios' | 'android' | 'web' | (string & {})
appId: string
[k: string]: unknown
}
@ -26,10 +29,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -26,10 +26,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -8,7 +8,7 @@ import { CID } from 'multiformats/cid'
export interface Main {
index: ByteSlice
features: (Mention | Link | { $type: string; [k: string]: unknown })[]
features: (Mention | Link | Tag | { $type: string; [k: string]: unknown })[]
[k: string]: unknown
}
@ -61,6 +61,22 @@ export function validateLink(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#link', v)
}
/** A hashtag. */
export interface 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'
)
}
export function validateTag(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#tag', v)
}
/** A text segment. Start is inclusive, end is exclusive. Indices are for utf8-encoded strings. */
export interface ByteSlice {
byteStart: number

View File

@ -0,0 +1,41 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
export interface 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'
)
}
export function validateSkeletonSearchPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchPost', v)
}
export interface 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'
)
}
export function validateSkeletonSearchActor(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchActor', v)
}

View File

@ -28,6 +28,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -36,10 +37,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -0,0 +1,49 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyFeedDefs from '../feed/defs'
export interface QueryParams {
limit: number
cursor?: string
query?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feeds: AppBskyFeedDefs.GeneratorView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -0,0 +1,49 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyFeedDefs from '../feed/defs'
export interface QueryParams {
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feed: AppBskyFeedDefs.SkeletonFeedPost[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
error?: 'UnknownFeed'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -0,0 +1,56 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyUnspeccedDefs from './defs'
export interface QueryParams {
/** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax */
q: string
/** if true, acts as fast/simple 'typeahead' query */
typeahead?: boolean
limit: number
/** optional pagination mechanism; may not necessarily allow scrolling through entire result set */
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
/** count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits */
hitsTotal?: number
actors: AppBskyUnspeccedDefs.SkeletonSearchActor[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
error?: 'BadQueryString'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -0,0 +1,54 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
import * as AppBskyUnspeccedDefs from './defs'
export interface QueryParams {
/** search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended */
q: string
limit: number
/** optional pagination mechanism; may not necessarily allow scrolling through entire result set */
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
/** count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits */
hitsTotal?: number
posts: AppBskyUnspeccedDefs.SkeletonSearchPost[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
error?: 'BadQueryString'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -13,6 +13,8 @@ import * as ComAtprotoLabelDefs from '../label/defs'
export interface ActionView {
id: number
action: ActionType
/** Indicates how long this action was meant to be in effect before automatically expiring. */
durationInHours?: number
subject:
| RepoRef
| ComAtprotoRepoStrongRef.Main
@ -43,7 +45,14 @@ export function validateActionView(v: unknown): ValidationResult {
export interface ActionViewDetail {
id: number
action: ActionType
subject: RepoView | RecordView | { $type: string; [k: string]: unknown }
/** Indicates how long this action was meant to be in effect before automatically expiring. */
durationInHours?: number
subject:
| RepoView
| RepoViewNotFound
| RecordView
| RecordViewNotFound
| { $type: string; [k: string]: unknown }
subjectBlobs: BlobView[]
createLabelVals?: string[]
negateLabelVals?: string[]
@ -70,6 +79,8 @@ export function validateActionViewDetail(v: unknown): ValidationResult {
export interface ActionViewCurrent {
id: number
action: ActionType
/** Indicates how long this action was meant to be in effect before automatically expiring. */
durationInHours?: number
[k: string]: unknown
}
@ -124,6 +135,7 @@ export interface ReportView {
id: number
reasonType: ComAtprotoModerationDefs.ReasonType
reason?: string
subjectRepoHandle?: string
subject:
| RepoRef
| ComAtprotoRepoStrongRef.Main
@ -150,7 +162,12 @@ export interface ReportViewDetail {
id: number
reasonType: ComAtprotoModerationDefs.ReasonType
reason?: string
subject: RepoView | RecordView | { $type: string; [k: string]: unknown }
subject:
| RepoView
| RepoViewNotFound
| RecordView
| RecordViewNotFound
| { $type: string; [k: string]: unknown }
reportedBy: string
createdAt: string
resolvedByActions: ActionView[]
@ -178,6 +195,7 @@ export interface RepoView {
moderation: Moderation
invitedBy?: ComAtprotoServerDefs.InviteCode
invitesDisabled?: boolean
inviteNote?: string
[k: string]: unknown
}
@ -204,6 +222,7 @@ export interface RepoViewDetail {
invitedBy?: ComAtprotoServerDefs.InviteCode
invites?: ComAtprotoServerDefs.InviteCode[]
invitesDisabled?: boolean
inviteNote?: string
[k: string]: unknown
}
@ -219,6 +238,23 @@ export function validateRepoViewDetail(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v)
}
export interface RepoViewNotFound {
did: string
[k: string]: unknown
}
export function isRepoViewNotFound(v: unknown): v is RepoViewNotFound {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#repoViewNotFound'
)
}
export function validateRepoViewNotFound(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#repoViewNotFound', v)
}
export interface RepoRef {
did: string
[k: string]: unknown
@ -283,6 +319,23 @@ export function validateRecordViewDetail(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#recordViewDetail', v)
}
export interface RecordViewNotFound {
uri: string
[k: string]: unknown
}
export function isRecordViewNotFound(v: unknown): v is RecordViewNotFound {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#recordViewNotFound'
)
}
export function validateRecordViewNotFound(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#recordViewNotFound', v)
}
export interface Moderation {
currentAction?: ActionViewCurrent
[k: string]: unknown

View File

@ -12,6 +12,8 @@ export interface QueryParams {}
export interface InputSchema {
account: string
/** Additionally add a note describing why the invites were disabled */
note?: string
[k: string]: unknown
}
@ -26,10 +28,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -27,10 +27,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -12,6 +12,8 @@ export interface QueryParams {}
export interface InputSchema {
account: string
/** Additionally add a note describing why the invites were enabled */
note?: string
[k: string]: unknown
}
@ -26,10 +28,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -28,6 +28,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -36,10 +37,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -20,6 +20,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -28,10 +29,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -28,6 +28,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -36,10 +37,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -20,6 +20,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -28,10 +29,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -11,6 +11,11 @@ import * as ComAtprotoAdminDefs from './defs'
export interface QueryParams {
subject?: string
ignoreSubjects?: string[]
/** Get all reports that were actioned by a specific moderator */
actionedBy?: string
/** Filter reports made by one or more DIDs */
reporters?: string[]
resolved?: boolean
actionType?:
| 'com.atproto.admin.defs#takedown'
@ -20,6 +25,8 @@ export interface QueryParams {
| (string & {})
limit: number
cursor?: string
/** Reverse the order of the returned records? when true, returns reports in chronological order */
reverse?: boolean
}
export type InputSchema = undefined
@ -35,6 +42,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -43,10 +51,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -21,18 +21,23 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
error?: 'RecordNotFound'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -20,18 +20,23 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
error?: 'RepoNotFound'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -28,6 +28,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -36,10 +37,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -28,6 +28,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -36,10 +37,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -10,7 +10,9 @@ import { HandlerAuth } from '@atproto/xrpc-server'
import * as ComAtprotoAdminDefs from './defs'
export interface QueryParams {
/** DEPRECATED: use 'q' instead */
term?: string
q?: string
invitedBy?: string
limit: number
cursor?: string
@ -29,6 +31,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,10 +40,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -11,7 +11,14 @@ import { HandlerAuth } from '@atproto/xrpc-server'
export interface QueryParams {}
export interface InputSchema {
feed: string
recipientDid: string
content: string
subject?: string
[k: string]: unknown
}
export interface OutputSchema {
sent: boolean
[k: string]: unknown
}
@ -20,16 +27,25 @@ export interface HandlerInput {
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerOutput = HandlerError | HandlerSuccess
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -26,6 +26,8 @@ export interface InputSchema {
createLabelVals?: string[]
negateLabelVals?: string[]
reason: string
/** Indicates how long this action was meant to be in effect before automatically expiring. */
durationInHours?: number
createdBy: string
[k: string]: unknown
}
@ -40,6 +42,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -49,10 +52,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -28,10 +28,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -27,10 +27,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -9,8 +9,8 @@ import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
export interface QueryParams {
/** The handle to resolve. If not supplied, will resolve the host's own handle. */
handle?: string
/** The handle to resolve. */
handle: string
}
export type InputSchema = undefined
@ -25,6 +25,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -33,10 +34,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -26,10 +26,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -34,3 +34,40 @@ export function isLabel(v: unknown): v is Label {
export function validateLabel(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.label.defs#label', v)
}
/** Metadata tags on an atproto record, published by the author within the record. */
export interface SelfLabels {
values: SelfLabel[]
[k: string]: unknown
}
export function isSelfLabels(v: unknown): v is SelfLabels {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.label.defs#selfLabels'
)
}
export function validateSelfLabels(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.label.defs#selfLabels', v)
}
/** Metadata tag on an atproto record, published by the author within the record. Note -- schemas should use #selfLabels, not #selfLabel. */
export interface SelfLabel {
/** the short string name of the value or type of this label */
val: string
[k: string]: unknown
}
export function isSelfLabel(v: unknown): v is SelfLabel {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.label.defs#selfLabel'
)
}
export function validateSelfLabel(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.label.defs#selfLabel', v)
}

View File

@ -31,6 +31,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -39,10 +40,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -20,12 +20,15 @@ export type OutputSchema =
| { $type: string; [k: string]: unknown }
export type HandlerError = ErrorFrame<'FutureCursor'>
export type HandlerOutput = HandlerError | OutputSchema
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
req: IncomingMessage
signal: AbortSignal
}) => AsyncIterable<HandlerOutput>
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => AsyncIterable<HandlerOutput>
export interface Labels {
seq: number

View File

@ -44,6 +44,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -52,10 +53,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -21,7 +21,7 @@ export const REASONSPAM = 'com.atproto.moderation.defs#reasonSpam'
export const REASONVIOLATION = 'com.atproto.moderation.defs#reasonViolation'
/** Misleading identity, affiliation, or content */
export const REASONMISLEADING = 'com.atproto.moderation.defs#reasonMisleading'
/** Unwanted or mis-labeled sexual content */
/** Unwanted or mislabeled sexual content */
export const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual'
/** Rude, harassing, explicit, or otherwise unwelcoming behavior */
export const REASONRUDE = 'com.atproto.moderation.defs#reasonRude'

View File

@ -32,13 +32,16 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput
/** Create a new record. */
export interface Create {

View File

@ -40,6 +40,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -49,10 +50,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -36,10 +36,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -29,6 +29,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,10 +38,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -33,6 +33,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -41,10 +42,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -37,6 +37,7 @@ export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -45,13 +46,16 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput
export interface Record {
uri: string

View File

@ -42,6 +42,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -51,10 +52,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -1,39 +0,0 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { lexicons } from '../../../../lexicons'
import { isObj, hasProp } from '../../../../util'
import { CID } from 'multiformats/cid'
import { HandlerAuth } from '@atproto/xrpc-server'
export interface QueryParams {}
export interface InputSchema {
/** The handle or DID of the repo. */
repo: string
/** Compare and swap with the previous commit by cid. */
swapCommit?: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'InvalidSwap'
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput

View File

@ -26,6 +26,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -34,10 +35,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -36,6 +36,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -52,10 +53,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -25,6 +25,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -34,13 +35,16 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput
export interface AppPassword {
name: string

View File

@ -29,6 +29,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -37,10 +38,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -30,6 +30,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -38,13 +39,16 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput
export interface AccountCodes {
account: string

View File

@ -34,6 +34,7 @@ export interface HandlerInput {
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
@ -43,10 +44,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -29,10 +29,13 @@ export interface HandlerError {
}
export type HandlerOutput = HandlerError | void
export type Handler<HA extends HandlerAuth = never> = (ctx: {
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

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