feed generator starter kit

This commit is contained in:
dholms 2023-05-10 09:56:30 -05:00
commit 7421e718fc
114 changed files with 13584 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules

14
.prettierrc Normal file
View File

@ -0,0 +1,14 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": false,
"singleQuote": true,
"overrides": [
{
"files": "*.hbs",
"options": {
"singleQuote": false
}
}
]
}

147
README.md Normal file
View File

@ -0,0 +1,147 @@
# ATProto Feed Generator
🚧 Work in Progress 🚧
We are actively developing Feed Generator integration into the Bluesky PDS. Though we are reasonably confident about the general shape and interfaces laid out here, these interfaces and implementation details _are_ subject to change.
We've put together a starter kit for devs. It doesn't do everything, but it should be enough to get you familiar with the system & started building!
## Overview
Feed Generators are services that provide custom algorithms to users through the AT protocol.
They work very simply: the server receives a request from a user's server and returns a list of [post URIs](https://atproto.com/specs/at-uri-scheme) with some optional metadata attached. Those posts are then "hydrated" into full objects by the requesting server and sent back to the client. This route is described in the `com.atproto.feed.getFeedSkeleton` lexicon. (@TODO insert link)
Think of Feed Generators like a user with an API attached. Like atproto users, a Feed Generator is identified by a DID/handle and uses a data repository which holds information like its profile. However, a Feed Generator's DID Document also declares a `#bsky_fg` service endpoint that fulfills the interface for a Feed Generator.
The general flow of providing a custom algorithm to a user is as follows:
- A user requests a feed from their server (PDS). Let's say the feed is identified by `@custom-algo.xyz`
- The PDS resolves `@custom-algo.xyz` to its corresponding DID document
- The PDS sends a `getFeedSkeleton` request to the service endpoint with ID `#bsky_fg`
- This request is authenticated by a JWT signed by the user's repo signing key
- The Feed Generator returns a skeleton of the feed to the user's PDS
- The PDS hydrates the feed (user info, post contents, aggregates, etc)
- In the future, the PDS will hydrate the feed with the help of an App View, but for now the PDS handles hydration itself
- The PDS returns the hydrated feed to the user
To the user this should feel like visiting a page in the app. Once they subscribe, it will appear in their home interface as one of their available feeds.
## Getting Started
For now, your algorithm will need to have an account & repository on the `bsky.social` PDS.
First, edit the provided `setup.json` to include your preferred handle, password & invite code, along with the hostname that you will be running this server at. Then run with `yarn setup`.
If you need an invite code, please reach out to a Bluesky team member & inform them that you are building a Feed Generator
Note: _do not_ use your handle/password from you personal bluesky account. This is a _new account_ for the Feed Generator.
We've setup this simple server with sqlite to store & query data. Feel free to switch this out for whichever database you prefer.
Next you will need to do two things:
- Implement indexing logic in `src/subscription.ts`.
This will subscribe to the repo subscription stream on startup, parse event & index them according to your provided logic
- Implement feed generation logic in `src/feed-generation.ts`
The types are in place and you will just need to return something that satisfies the `SkeletonFeedPost[]` type
For inspiration, we've provided a very simple feed algorithm that returns recent posts from the Bluesky team.
## Some Details
### Skeleton Metadata
The skeleton that a Feed Generator puts together is, in its simplest form, a list of post uris.
```ts
[
{post: 'at://did:example:1234/app.bsky.feed.post/1'},
{post: 'at://did:example:1234/app.bsky.feed.post/2'},
{post: 'at://did:example:1234/app.bsky.feed.post/3'}
]
```
However, we include two locations to attach some additional context. Here is the full schema:
```ts
type SkeletonItem = {
post: string // post URI
// optional metadata about the thread that this post is in reply to
replyTo?: {
root: string, // reply root URI
parent: string, // reply parent URI
}
// optional reason for inclusion in the feed
// (generally to be displayed in client)
reason?: Reason
}
// for now, the only defined reason is a repost, but this is open to extension
type Reason = ReasonRepost
type ReasonRepost = {
$type: @TODO
by: string // the did of the reposting user
indexedAt: string // the time that the repost took place
}
```
This metadata serves two purposes:
1. To aid the PDS in hydrating all relevant post information
2. To give a cue to the client in terms of context to display when rendering a post
### Authentication
If you are creating a generic feed that does not differ for different users, you do not need to check auth. But if a user's state (such as follows or likes) is taken into account, we _strongly_ encourage you to validate their auth token.
Users are authenticated with a simple JWT signed by the user's repo signing key.
This JWT header/payload takes the format:
```ts
const header = {
type: "JWT",
alg: "ES256K" // (key algorithm) - in this case secp256k1
}
const payload = {
iss: "did:example:alice", // (issuer) the requesting user's DID
aud: "did:example:feedGenerator", // (audience) the DID of the Feed Generator
exp: 1683643619 // (expiration) unix timestamp in seconds
}
```
We provide utilities for verifying user JWTs in `@TODO_PACKAGE`
### Pagination
You'll notice that the `getFeedSkeleton` method returns a `cursor` in its response & takes a `cursor` param as input.
This cursor is treated as an opaque value & fully at the Feed Generator's discretion. It is simply pased through he PDS directly to & from the client.
We strongly encourage that the cursor be _unique per feed item_ to prevent unexpected behavior in pagination.
We recommend, for instance, a compound cursor with a timestamp + a CID:
`1683654690921::bafyreia3tbsfxe3cc75xrxyyn6qc42oupi73fxiox76prlyi5bpx7hr72u`
## Suggestions for Implementation
How a feed generator fulfills the `getFeedSkeleton` request is completely at their discretion. At the simplest end, a Feed Generator could supply a "feed" that only contains some hardcoded posts.
For most usecases, we recommend subscribing to the firehose at `com.atproto.sync.subscribeRepos`. This websocket will send you every record that is published on the network. Since Feed Generators do not need to provide hydrated posts, you can index as much or as little of the firehose as necessary.
Depending on your algorithm, you likely do not need to keep posts around for long. Unless your algorithm is intended to provide "posts you missed" or something similar, you can likely garbage collect any data that is older than 48 hours.
Some examples:
### Reimplementing What's Hot
To reimplement "What's Hot", you may subscribe to the firehose & filter for all posts & likes (ignoring profiles/reposts/follows/etc). You would keep a running tally of likes per post & when a PDS requests a feed, you would send the most recent posts that pass some threshold of likes.
### A Community Feed
You might create a feed for a given community by compiling a list of DIDs within that community & filtering the firehose for all posts from users within that list.
### A Topical Feed
To implement a topical feed, you might filter the algorithm for posts and pass the post text through some filtering mechanism (an LLM, a keyword matcher, etc) that filters for the topic of your choice.

27
package.json Normal file
View File

@ -0,0 +1,27 @@
{
"name": "feed-generator",
"version": "1.0.0",
"description": "atproto feed generator starter kit",
"main": "index.js",
"repository": "git@github.com:bluesky-social/feed-generator.git",
"author": "dholms <dtholmgren@gmail.com>",
"license": "MIT",
"scripts": {
"start": "ts-node src/index.ts"
},
"dependencies": {
"@atproto/repo": "^0.1.0",
"@atproto/uri": "^0.0.2",
"@atproto/xrpc-server": "^0.1.0",
"better-sqlite3": "^8.3.0",
"express": "^4.18.2",
"kysely": "^0.22.0"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.4",
"@types/express": "^4.17.17",
"@types/node": "^20.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
}
}

30
src/db/index.ts Normal file
View File

@ -0,0 +1,30 @@
import { Kysely, SqliteDialect } from 'kysely'
import SqliteDb from 'better-sqlite3'
export const createDb = (location: string): Database => {
return new Kysely<DatabaseSchema>({
dialect: new SqliteDialect({
database: new SqliteDb(location),
}),
})
}
export type Database = Kysely<DatabaseSchema>
export type PostTable = {
uri: string
cid: string
replyParent: string | null
replyRoot: string | null
indexedAt: string
}
export type SubStateTable = {
service: string
cursor: number
}
export type DatabaseSchema = {
posts: PostTable
sub_state: SubStateTable
}

54
src/feed-generation.ts Normal file
View File

@ -0,0 +1,54 @@
import { InvalidRequestError } from '@atproto/xrpc-server'
import { Database } from './db'
import { Server } from './lexicon'
export default function (server: Server, db: Database) {
server.app.bsky.feed.getFeedSkeleton(async ({ params, auth }) => {
if (params.feed !== 'alf.bsky.social') {
throw new InvalidRequestError('algorithm unsupported')
}
let builder = db
.selectFrom('posts')
.selectAll()
.orderBy('indexedAt', 'desc')
.orderBy('cid', 'desc')
if (params.cursor) {
const [indexedAt, cid] = params.cursor.split('..')
if (!indexedAt || !cid) {
throw new InvalidRequestError('malformed cursor')
}
const timeStr = new Date(parseInt(indexedAt, 10)).toISOString()
builder = builder
.where('posts.indexedAt', '<', timeStr)
.orWhere((qb) => qb.where('posts.indexedAt', '=', timeStr))
.where('posts.cid', '<', cid)
}
const res = await builder.execute()
const feed = res.map((row) => ({
post: row.uri,
replyTo:
row.replyParent && row.replyRoot
? {
root: row.replyRoot,
parent: row.replyParent,
}
: undefined,
}))
let cursor: string | undefined
const last = res.at(-1)
if (last) {
cursor = `${new Date(last.indexedAt).getTime()}::${last.cid}`
}
return {
encoding: 'application/json',
body: {
cursor,
feed,
},
}
})
}

10
src/index.ts Normal file
View File

@ -0,0 +1,10 @@
import FeedGenerator from './server'
const run = async () => {
// we'll add .env soon
const server = FeedGenerator.create()
await server.start()
console.log(`🤖 running feed generator at localhost${server.cfg.port}`)
}
run()

947
src/lexicon/index.ts Normal file
View File

@ -0,0 +1,947 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import {
createServer as createXrpcServer,
Server as XrpcServer,
Options as XrpcOptions,
AuthVerifier,
StreamAuthVerifier,
} from '@atproto/xrpc-server'
import { schemas } from './lexicons'
import * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes'
import * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes'
import * as ComAtprotoAdminGetModerationAction from './types/com/atproto/admin/getModerationAction'
import * as ComAtprotoAdminGetModerationActions from './types/com/atproto/admin/getModerationActions'
import * as ComAtprotoAdminGetModerationReport from './types/com/atproto/admin/getModerationReport'
import * as ComAtprotoAdminGetModerationReports from './types/com/atproto/admin/getModerationReports'
import * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord'
import * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo'
import * as ComAtprotoAdminResolveModerationReports from './types/com/atproto/admin/resolveModerationReports'
import * as ComAtprotoAdminReverseModerationAction from './types/com/atproto/admin/reverseModerationAction'
import * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos'
import * as ComAtprotoAdminTakeModerationAction from './types/com/atproto/admin/takeModerationAction'
import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail'
import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle'
import * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle'
import * as ComAtprotoIdentityUpdateHandle from './types/com/atproto/identity/updateHandle'
import * as ComAtprotoLabelQueryLabels from './types/com/atproto/label/queryLabels'
import * as ComAtprotoLabelSubscribeLabels from './types/com/atproto/label/subscribeLabels'
import * as ComAtprotoModerationCreateReport from './types/com/atproto/moderation/createReport'
import * as ComAtprotoRepoApplyWrites from './types/com/atproto/repo/applyWrites'
import * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord'
import * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord'
import * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRepo'
import * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord'
import * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords'
import * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord'
import * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob'
import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount'
import * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword'
import * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode'
import * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes'
import * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession'
import * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount'
import * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession'
import * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer'
import * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes'
import * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession'
import * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords'
import * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession'
import * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete'
import * as ComAtprotoServerRequestPasswordReset from './types/com/atproto/server/requestPasswordReset'
import * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword'
import * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword'
import * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob'
import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks'
import * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout'
import * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommitPath'
import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead'
import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord'
import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo'
import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs'
import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos'
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles'
import * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions'
import * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors'
import * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead'
import * as AppBskyFeedBookmarkFeed from './types/app/bsky/feed/bookmarkFeed'
import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
import * as AppBskyFeedGetBookmarkedFeeds from './types/app/bsky/feed/getBookmarkedFeeds'
import * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed'
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton'
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes'
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread'
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts'
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy'
import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline'
import * as AppBskyFeedUnbookmarkFeed from './types/app/bsky/feed/unbookmarkFeed'
import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks'
import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes'
import * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor'
import * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor'
import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notification/getUnreadCount'
import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications'
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen'
import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular'
export const COM_ATPROTO_ADMIN = {
DefsTakedown: 'com.atproto.admin.defs#takedown',
DefsFlag: 'com.atproto.admin.defs#flag',
DefsAcknowledge: 'com.atproto.admin.defs#acknowledge',
DefsEscalate: 'com.atproto.admin.defs#escalate',
}
export const COM_ATPROTO_MODERATION = {
DefsReasonSpam: 'com.atproto.moderation.defs#reasonSpam',
DefsReasonViolation: 'com.atproto.moderation.defs#reasonViolation',
DefsReasonMisleading: 'com.atproto.moderation.defs#reasonMisleading',
DefsReasonSexual: 'com.atproto.moderation.defs#reasonSexual',
DefsReasonRude: 'com.atproto.moderation.defs#reasonRude',
DefsReasonOther: 'com.atproto.moderation.defs#reasonOther',
}
export const APP_BSKY_ACTOR = {
DefsUser: 'app.bsky.actor.defs#user',
DefsFeedGenerator: 'app.bsky.actor.defs#feedGenerator',
}
export function createServer(options?: XrpcOptions): Server {
return new Server(options)
}
export class Server {
xrpc: XrpcServer
com: ComNS
app: AppNS
constructor(options?: XrpcOptions) {
this.xrpc = createXrpcServer(schemas, options)
this.com = new ComNS(this)
this.app = new AppNS(this)
}
}
export class ComNS {
_server: Server
atproto: AtprotoNS
constructor(server: Server) {
this._server = server
this.atproto = new AtprotoNS(server)
}
}
export class AtprotoNS {
_server: Server
admin: AdminNS
identity: IdentityNS
label: LabelNS
moderation: ModerationNS
repo: RepoNS
server: ServerNS
sync: SyncNS
constructor(server: Server) {
this._server = server
this.admin = new AdminNS(server)
this.identity = new IdentityNS(server)
this.label = new LabelNS(server)
this.moderation = new ModerationNS(server)
this.repo = new RepoNS(server)
this.server = new ServerNS(server)
this.sync = new SyncNS(server)
}
}
export class AdminNS {
_server: Server
constructor(server: Server) {
this._server = server
}
disableInviteCodes<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminDisableInviteCodes.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.disableInviteCodes' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getInviteCodes<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoAdminGetInviteCodes.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.admin.getInviteCodes' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getModerationAction<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminGetModerationAction.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.getModerationAction' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getModerationActions<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminGetModerationActions.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.getModerationActions' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getModerationReport<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminGetModerationReport.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.getModerationReport' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getModerationReports<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminGetModerationReports.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.getModerationReports' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getRecord<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoAdminGetRecord.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.admin.getRecord' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getRepo<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoAdminGetRepo.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.admin.getRepo' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
resolveModerationReports<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminResolveModerationReports.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.resolveModerationReports' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
reverseModerationAction<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminReverseModerationAction.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.reverseModerationAction' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
searchRepos<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoAdminSearchRepos.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.admin.searchRepos' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
takeModerationAction<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminTakeModerationAction.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.takeModerationAction' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
updateAccountEmail<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminUpdateAccountEmail.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.updateAccountEmail' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
updateAccountHandle<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoAdminUpdateAccountHandle.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.admin.updateAccountHandle' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
export class IdentityNS {
_server: Server
constructor(server: Server) {
this._server = server
}
resolveHandle<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoIdentityResolveHandle.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.identity.resolveHandle' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
updateHandle<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoIdentityUpdateHandle.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.identity.updateHandle' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
export class LabelNS {
_server: Server
constructor(server: Server) {
this._server = server
}
queryLabels<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoLabelQueryLabels.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.label.queryLabels' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
subscribeLabels<AV extends StreamAuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoLabelSubscribeLabels.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.label.subscribeLabels' // @ts-ignore
return this._server.xrpc.streamMethod(nsid, cfg)
}
}
export class ModerationNS {
_server: Server
constructor(server: Server) {
this._server = server
}
createReport<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoModerationCreateReport.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.moderation.createReport' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
export class RepoNS {
_server: Server
constructor(server: Server) {
this._server = server
}
applyWrites<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoRepoApplyWrites.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.repo.applyWrites' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
createRecord<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoRepoCreateRecord.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.repo.createRecord' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
deleteRecord<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoRepoDeleteRecord.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.repo.deleteRecord' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
describeRepo<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoRepoDescribeRepo.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.repo.describeRepo' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getRecord<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoRepoGetRecord.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.repo.getRecord' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
listRecords<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoRepoListRecords.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.repo.listRecords' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
putRecord<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoRepoPutRecord.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.repo.putRecord' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
uploadBlob<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoRepoUploadBlob.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.repo.uploadBlob' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
export class ServerNS {
_server: Server
constructor(server: Server) {
this._server = server
}
createAccount<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoServerCreateAccount.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.server.createAccount' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
createAppPassword<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoServerCreateAppPassword.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.server.createAppPassword' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
createInviteCode<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoServerCreateInviteCode.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.server.createInviteCode' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
createInviteCodes<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoServerCreateInviteCodes.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.server.createInviteCodes' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
createSession<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoServerCreateSession.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.server.createSession' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
deleteAccount<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoServerDeleteAccount.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.server.deleteAccount' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
deleteSession<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoServerDeleteSession.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.server.deleteSession' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
describeServer<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoServerDescribeServer.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.server.describeServer' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getAccountInviteCodes<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoServerGetAccountInviteCodes.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.server.getAccountInviteCodes' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getSession<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoServerGetSession.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.server.getSession' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
listAppPasswords<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoServerListAppPasswords.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.server.listAppPasswords' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
refreshSession<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoServerRefreshSession.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.server.refreshSession' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
requestAccountDelete<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoServerRequestAccountDelete.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.server.requestAccountDelete' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
requestPasswordReset<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoServerRequestPasswordReset.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.server.requestPasswordReset' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
resetPassword<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoServerResetPassword.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.server.resetPassword' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
revokeAppPassword<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ComAtprotoServerRevokeAppPassword.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'com.atproto.server.revokeAppPassword' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
export class SyncNS {
_server: Server
constructor(server: Server) {
this._server = server
}
getBlob<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncGetBlob.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.getBlob' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getBlocks<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncGetBlocks.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.getBlocks' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getCheckout<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncGetCheckout.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.getCheckout' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getCommitPath<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncGetCommitPath.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.getCommitPath' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getHead<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncGetHead.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.getHead' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getRecord<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncGetRecord.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.getRecord' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getRepo<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncGetRepo.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.getRepo' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
listBlobs<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncListBlobs.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.listBlobs' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
listRepos<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncListRepos.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.listRepos' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
notifyOfUpdate<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncNotifyOfUpdate.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.notifyOfUpdate' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
requestCrawl<AV extends AuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncRequestCrawl.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.requestCrawl' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
subscribeRepos<AV extends StreamAuthVerifier>(
cfg: ConfigOf<AV, ComAtprotoSyncSubscribeRepos.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'com.atproto.sync.subscribeRepos' // @ts-ignore
return this._server.xrpc.streamMethod(nsid, cfg)
}
}
export class AppNS {
_server: Server
bsky: BskyNS
constructor(server: Server) {
this._server = server
this.bsky = new BskyNS(server)
}
}
export class BskyNS {
_server: Server
actor: ActorNS
embed: EmbedNS
feed: FeedNS
graph: GraphNS
notification: NotificationNS
richtext: RichtextNS
unspecced: UnspeccedNS
constructor(server: Server) {
this._server = server
this.actor = new ActorNS(server)
this.embed = new EmbedNS(server)
this.feed = new FeedNS(server)
this.graph = new GraphNS(server)
this.notification = new NotificationNS(server)
this.richtext = new RichtextNS(server)
this.unspecced = new UnspeccedNS(server)
}
}
export class ActorNS {
_server: Server
constructor(server: Server) {
this._server = server
}
getProfile<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyActorGetProfile.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.actor.getProfile' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getProfiles<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyActorGetProfiles.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.actor.getProfiles' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getSuggestions<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyActorGetSuggestions.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.actor.getSuggestions' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
searchActors<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyActorSearchActors.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.actor.searchActors' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
searchActorsTypeahead<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
AppBskyActorSearchActorsTypeahead.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'app.bsky.actor.searchActorsTypeahead' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
export class EmbedNS {
_server: Server
constructor(server: Server) {
this._server = server
}
}
export class FeedNS {
_server: Server
constructor(server: Server) {
this._server = server
}
bookmarkFeed<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedBookmarkFeed.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.bookmarkFeed' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getAuthorFeed<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetAuthorFeed.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.getAuthorFeed' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getBookmarkedFeeds<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetBookmarkedFeeds.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.getBookmarkedFeeds' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getFeed<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetFeed.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.getFeed' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getFeedSkeleton<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetFeedSkeleton.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.getFeedSkeleton' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getLikes<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetLikes.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.getLikes' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getPostThread<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetPostThread.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.getPostThread' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getPosts<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetPosts.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.getPosts' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getRepostedBy<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetRepostedBy.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.getRepostedBy' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getTimeline<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedGetTimeline.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.getTimeline' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
unbookmarkFeed<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyFeedUnbookmarkFeed.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.feed.unbookmarkFeed' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
export class GraphNS {
_server: Server
constructor(server: Server) {
this._server = server
}
getBlocks<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyGraphGetBlocks.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.graph.getBlocks' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getFollowers<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyGraphGetFollowers.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.graph.getFollowers' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getFollows<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyGraphGetFollows.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.graph.getFollows' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getMutes<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyGraphGetMutes.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.graph.getMutes' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
muteActor<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyGraphMuteActor.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.graph.muteActor' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
unmuteActor<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyGraphUnmuteActor.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.graph.unmuteActor' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
export class NotificationNS {
_server: Server
constructor(server: Server) {
this._server = server
}
getUnreadCount<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
AppBskyNotificationGetUnreadCount.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'app.bsky.notification.getUnreadCount' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
listNotifications<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
AppBskyNotificationListNotifications.Handler<ExtractAuth<AV>>
>,
) {
const nsid = 'app.bsky.notification.listNotifications' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
updateSeen<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyNotificationUpdateSeen.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.notification.updateSeen' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
export class RichtextNS {
_server: Server
constructor(server: Server) {
this._server = server
}
}
export class UnspeccedNS {
_server: Server
constructor(server: Server) {
this._server = server
}
getPopular<AV extends AuthVerifier>(
cfg: ConfigOf<AV, AppBskyUnspeccedGetPopular.Handler<ExtractAuth<AV>>>,
) {
const nsid = 'app.bsky.unspecced.getPopular' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
}
type ConfigOf<Auth, Handler> =
| Handler
| {
auth?: Auth
handler: Handler
}
type ExtractAuth<AV extends AuthVerifier | StreamAuthVerifier> = Extract<
Awaited<ReturnType<AV>>,
{ credentials: unknown }
>

5513
src/lexicon/lexicons.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,134 @@
/**
* 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'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
export interface ProfileViewBasic {
did: string
handle: string
displayName?: string
avatar?: string
actorType?: ActorType
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isProfileViewBasic(v: unknown): v is ProfileViewBasic {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#profileViewBasic'
)
}
export function validateProfileViewBasic(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#profileViewBasic', v)
}
export interface ProfileView {
did: string
handle: string
displayName?: string
description?: string
avatar?: string
actorType?: ActorType
indexedAt?: string
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isProfileView(v: unknown): v is ProfileView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#profileView'
)
}
export function validateProfileView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#profileView', v)
}
export interface ProfileViewDetailed {
did: string
handle: string
displayName?: string
description?: string
avatar?: string
actorType?: ActorType
actorInfo?: InfoFeedGenerator | { $type: string; [k: string]: unknown }
banner?: string
followersCount?: number
followsCount?: number
postsCount?: number
indexedAt?: string
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isProfileViewDetailed(v: unknown): v is ProfileViewDetailed {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#profileViewDetailed'
)
}
export function validateProfileViewDetailed(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#profileViewDetailed', v)
}
export interface ViewerState {
muted?: boolean
blockedBy?: boolean
blocking?: string
following?: string
followedBy?: string
[k: string]: unknown
}
export function isViewerState(v: unknown): v is ViewerState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#viewerState'
)
}
export function validateViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#viewerState', v)
}
export interface InfoFeedGenerator {
likes: number
[k: string]: unknown
}
export function isInfoFeedGenerator(v: unknown): v is InfoFeedGenerator {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#infoFeedGenerator'
)
}
export function validateInfoFeedGenerator(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#infoFeedGenerator', v)
}
export type ActorType =
| 'app.bsky.actor.defs#user'
| 'app.bsky.actor.defs#feedGenerator'
| (string & {})
/** Actor type: User. This is the default option and an actor is assumed to be a user unless suggested otherwise. */
export const USER = 'app.bsky.actor.defs#user'
/** Actor type: Feed Generator. A service that provides a custom feed. */
export const FEEDGENERATOR = 'app.bsky.actor.defs#feedGenerator'

View File

@ -0,0 +1,37 @@
/**
* 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 './defs'
export interface QueryParams {
actor: string
}
export type InputSchema = undefined
export type OutputSchema = AppBskyActorDefs.ProfileViewDetailed
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,42 @@
/**
* 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 './defs'
export interface QueryParams {
actors: string[]
}
export type InputSchema = undefined
export interface OutputSchema {
profiles: AppBskyActorDefs.ProfileViewDetailed[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,44 @@
/**
* 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 './defs'
export interface QueryParams {
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
actors: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,28 @@
/**
* 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 {
displayName?: string
description?: string
avatar?: BlobRef
banner?: BlobRef
[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 validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.profile#main', v)
}

View File

@ -0,0 +1,45 @@
/**
* 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 './defs'
export interface QueryParams {
term?: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
actors: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,43 @@
/**
* 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 './defs'
export interface QueryParams {
term?: string
limit: number
}
export type InputSchema = undefined
export interface OutputSchema {
actors: AppBskyActorDefs.ProfileViewBasic[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,82 @@
/**
* 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 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 validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#main', v)
}
export interface External {
uri: string
title: string
description: string
thumb?: BlobRef
[k: string]: unknown
}
export function isExternal(v: unknown): v is External {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.external#external'
)
}
export function validateExternal(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#external', v)
}
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 validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#view', v)
}
export interface ViewExternal {
uri: string
title: string
description: string
thumb?: string
[k: string]: unknown
}
export function isViewExternal(v: unknown): v is ViewExternal {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.external#viewExternal'
)
}
export function validateViewExternal(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.external#viewExternal', v)
}

View File

@ -0,0 +1,75 @@
/**
* 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 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 validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#main', v)
}
export interface Image {
image: BlobRef
alt: string
[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 validateImage(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#image', v)
}
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 validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#view', v)
}
export interface ViewImage {
thumb: string
fullsize: string
alt: string
[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 validateViewImage(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.images#viewImage', v)
}

View File

@ -0,0 +1,113 @@
/**
* 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'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
import * as AppBskyActorDefs from '../actor/defs'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
import * as AppBskyEmbedImages from './images'
import * as AppBskyEmbedExternal from './external'
import * as AppBskyEmbedRecordWithMedia from './recordWithMedia'
export interface Main {
record: ComAtprotoRepoStrongRef.Main
[k: string]: unknown
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.embed.record#main' ||
v.$type === 'app.bsky.embed.record')
)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#main', v)
}
export interface View {
record:
| ViewRecord
| ViewNotFound
| ViewBlocked
| { $type: string; [k: string]: unknown }
[k: string]: unknown
}
export function isView(v: unknown): v is View {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.record#view'
)
}
export function validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#view', v)
}
export interface ViewRecord {
uri: string
cid: string
author: AppBskyActorDefs.ProfileViewBasic
value: {}
labels?: ComAtprotoLabelDefs.Label[]
embeds?: (
| AppBskyEmbedImages.View
| AppBskyEmbedExternal.View
| View
| AppBskyEmbedRecordWithMedia.View
| { $type: string; [k: string]: unknown }
)[]
indexedAt: string
[k: string]: unknown
}
export function isViewRecord(v: unknown): v is ViewRecord {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.record#viewRecord'
)
}
export function validateViewRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#viewRecord', v)
}
export interface ViewNotFound {
uri: string
[k: string]: unknown
}
export function isViewNotFound(v: unknown): v is ViewNotFound {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.record#viewNotFound'
)
}
export function validateViewNotFound(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#viewNotFound', v)
}
export interface ViewBlocked {
uri: string
[k: string]: unknown
}
export function isViewBlocked(v: unknown): v is ViewBlocked {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.record#viewBlocked'
)
}
export function validateViewBlocked(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.record#viewBlocked', v)
}

View File

@ -0,0 +1,53 @@
/**
* 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'
import * as AppBskyEmbedRecord from './record'
import * as AppBskyEmbedImages from './images'
import * as AppBskyEmbedExternal from './external'
export interface Main {
record: AppBskyEmbedRecord.Main
media:
| AppBskyEmbedImages.Main
| AppBskyEmbedExternal.Main
| { $type: string; [k: string]: unknown }
[k: string]: unknown
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.embed.recordWithMedia#main' ||
v.$type === 'app.bsky.embed.recordWithMedia')
)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.recordWithMedia#main', v)
}
export interface View {
record: AppBskyEmbedRecord.View
media:
| AppBskyEmbedImages.View
| AppBskyEmbedExternal.View
| { $type: string; [k: string]: unknown }
[k: string]: unknown
}
export function isView(v: unknown): v is View {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.embed.recordWithMedia#view'
)
}
export function validateView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.embed.recordWithMedia#view', v)
}

View File

@ -0,0 +1,35 @@
/**
* 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 {
feed: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,241 @@
/**
* 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'
import * as AppBskyActorDefs from '../actor/defs'
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'
export interface PostView {
uri: string
cid: string
author: AppBskyActorDefs.ProfileViewBasic
record: {}
embed?:
| AppBskyEmbedImages.View
| AppBskyEmbedExternal.View
| AppBskyEmbedRecord.View
| AppBskyEmbedRecordWithMedia.View
| { $type: string; [k: string]: unknown }
replyCount?: number
repostCount?: number
likeCount?: number
indexedAt: string
viewer?: ViewerState
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isPostView(v: unknown): v is PostView {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#postView'
)
}
export function validatePostView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#postView', v)
}
export interface ViewerState {
repost?: string
like?: string
[k: string]: unknown
}
export function isViewerState(v: unknown): v is ViewerState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#viewerState'
)
}
export function validateViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#viewerState', v)
}
export interface FeedViewPost {
post: PostView
reply?: ReplyRef
reason?: ReasonRepost | { $type: string; [k: string]: unknown }
[k: string]: unknown
}
export function isFeedViewPost(v: unknown): v is FeedViewPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#feedViewPost'
)
}
export function validateFeedViewPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#feedViewPost', v)
}
export interface ReplyRef {
root:
| PostView
| NotFoundPost
| BlockedPost
| { $type: string; [k: string]: unknown }
parent:
| PostView
| NotFoundPost
| BlockedPost
| { $type: string; [k: string]: unknown }
[k: string]: unknown
}
export function isReplyRef(v: unknown): v is ReplyRef {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#replyRef'
)
}
export function validateReplyRef(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#replyRef', v)
}
export interface ReasonRepost {
by: AppBskyActorDefs.ProfileViewBasic
indexedAt: string
[k: string]: unknown
}
export function isReasonRepost(v: unknown): v is ReasonRepost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#reasonRepost'
)
}
export function validateReasonRepost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#reasonRepost', v)
}
export interface ThreadViewPost {
post: PostView
parent?:
| ThreadViewPost
| NotFoundPost
| BlockedPost
| { $type: string; [k: string]: unknown }
replies?: (
| ThreadViewPost
| NotFoundPost
| BlockedPost
| { $type: string; [k: string]: unknown }
)[]
[k: string]: unknown
}
export function isThreadViewPost(v: unknown): v is ThreadViewPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#threadViewPost'
)
}
export function validateThreadViewPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#threadViewPost', v)
}
export interface NotFoundPost {
uri: string
notFound: true
[k: string]: unknown
}
export function isNotFoundPost(v: unknown): v is NotFoundPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#notFoundPost'
)
}
export function validateNotFoundPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#notFoundPost', v)
}
export interface BlockedPost {
uri: string
blocked: true
[k: string]: unknown
}
export function isBlockedPost(v: unknown): v is BlockedPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#blockedPost'
)
}
export function validateBlockedPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#blockedPost', v)
}
export interface SkeletonFeedPost {
post: string
replyTo?: SkeletonReplyRef
reason?: SkeletonReasonRepost | { $type: string; [k: string]: unknown }
[k: string]: unknown
}
export function isSkeletonFeedPost(v: unknown): v is SkeletonFeedPost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#skeletonFeedPost'
)
}
export function validateSkeletonFeedPost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#skeletonFeedPost', v)
}
export interface SkeletonReplyRef {
root: string
parent: string
[k: string]: unknown
}
export function isSkeletonReplyRef(v: unknown): v is SkeletonReplyRef {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#skeletonReplyRef'
)
}
export function validateSkeletonReplyRef(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#skeletonReplyRef', v)
}
export interface SkeletonReasonRepost {
by: string
indexedAt: string
[k: string]: unknown
}
export function isSkeletonReasonRepost(v: unknown): v is SkeletonReasonRepost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#skeletonReasonRepost'
)
}
export function validateSkeletonReasonRepost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v)
}

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 {
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
}
export interface HandlerError {
status: number
message?: string
error?: 'BlockedActor' | 'BlockedByActor'
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,44 @@
/**
* 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 {
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feeds: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,45 @@
/**
* 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 {
feed: 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
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,45 @@
/**
* 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 {
feed: string
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
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,65 @@
/**
* 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 {
uri: string
cid?: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
uri: string
cid?: string
cursor?: string
likes: Like[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
export interface Like {
indexedAt: string
createdAt: string
actor: AppBskyActorDefs.ProfileView
[k: string]: unknown
}
export function isLike(v: unknown): v is Like {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.getLikes#like'
)
}
export function validateLike(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.getLikes#like', v)
}

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 AppBskyFeedDefs from './defs'
export interface QueryParams {
uri: string
depth?: number
}
export type InputSchema = undefined
export interface OutputSchema {
thread:
| AppBskyFeedDefs.ThreadViewPost
| AppBskyFeedDefs.NotFoundPost
| AppBskyFeedDefs.BlockedPost
| { $type: string; [k: string]: unknown }
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'NotFound'
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,42 @@
/**
* 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 {
uris: string[]
}
export type InputSchema = undefined
export interface OutputSchema {
posts: AppBskyFeedDefs.PostView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -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 AppBskyActorDefs from '../actor/defs'
export interface QueryParams {
uri: string
cid?: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
uri: string
cid?: string
cursor?: string
repostedBy: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,45 @@
/**
* 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 {
algorithm?: 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
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -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'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
export interface Record {
subject: ComAtprotoRepoStrongRef.Main
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.feed.like#main' || v.$type === 'app.bsky.feed.like')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.like#main', v)
}

View File

@ -0,0 +1,95 @@
/**
* 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'
import * as AppBskyRichtextFacet from '../richtext/facet'
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 ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
export interface Record {
text: string
/** Deprecated: replaced by app.bsky.richtext.facet. */
entities?: Entity[]
facets?: AppBskyRichtextFacet.Main[]
reply?: ReplyRef
embed?:
| AppBskyEmbedImages.Main
| AppBskyEmbedExternal.Main
| AppBskyEmbedRecord.Main
| AppBskyEmbedRecordWithMedia.Main
| { $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.post#main' || v.$type === 'app.bsky.feed.post')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.post#main', v)
}
export interface ReplyRef {
root: ComAtprotoRepoStrongRef.Main
parent: ComAtprotoRepoStrongRef.Main
[k: string]: unknown
}
export function isReplyRef(v: unknown): v is ReplyRef {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#replyRef'
)
}
export function validateReplyRef(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.post#replyRef', v)
}
/** Deprecated: use facets instead. */
export interface Entity {
index: TextSlice
/** Expected values are 'mention' and 'link'. */
type: string
value: string
[k: string]: unknown
}
export function isEntity(v: unknown): v is Entity {
return (
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.post#entity'
)
}
export function validateEntity(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.post#entity', v)
}
/** Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings. */
export interface TextSlice {
start: number
end: number
[k: string]: unknown
}
export function isTextSlice(v: unknown): v is TextSlice {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.post#textSlice'
)
}
export function validateTextSlice(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.post#textSlice', v)
}

View File

@ -0,0 +1,27 @@
/**
* 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'
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
export interface Record {
subject: ComAtprotoRepoStrongRef.Main
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.feed.repost#main' ||
v.$type === 'app.bsky.feed.repost')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.repost#main', v)
}

View File

@ -0,0 +1,35 @@
/**
* 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 {
feed: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -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.block#main' ||
v.$type === 'app.bsky.graph.block')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.block#main', v)
}

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.follow#main' ||
v.$type === 'app.bsky.graph.follow')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.follow#main', v)
}

View File

@ -0,0 +1,44 @@
/**
* 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 {
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
blocks: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -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
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
subject: AppBskyActorDefs.ProfileView
cursor?: string
followers: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -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
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
subject: AppBskyActorDefs.ProfileView
cursor?: string
follows: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,44 @@
/**
* 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 {
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
mutes: AppBskyActorDefs.ProfileView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,35 @@
/**
* 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 {
actor: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,35 @@
/**
* 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 {
actor: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,41 @@
/**
* 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 {
seenAt?: string
}
export type InputSchema = undefined
export interface OutputSchema {
count: number
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,82 @@
/**
* 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'
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
export interface QueryParams {
limit: number
cursor?: string
seenAt?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
notifications: Notification[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
export interface Notification {
uri: string
cid: string
author: AppBskyActorDefs.ProfileView
/** Expected values are 'like', 'repost', 'follow', 'mention', 'reply', and 'quote'. */
reason:
| 'like'
| 'repost'
| 'follow'
| 'mention'
| 'reply'
| 'quote'
| (string & {})
reasonSubject?: string
record: {}
isRead: boolean
indexedAt: string
labels?: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isNotification(v: unknown): v is Notification {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.notification.listNotifications#notification'
)
}
export function validateNotification(v: unknown): ValidationResult {
return lexicons.validate(
'app.bsky.notification.listNotifications#notification',
v,
)
}

View File

@ -0,0 +1,35 @@
/**
* 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 {
seenAt: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,81 @@
/**
* 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 Main {
index: ByteSlice
features: (Mention | Link | { $type: string; [k: string]: unknown })[]
[k: string]: unknown
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.richtext.facet#main' ||
v.$type === 'app.bsky.richtext.facet')
)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#main', v)
}
/** A facet feature for actor mentions. */
export interface Mention {
did: string
[k: string]: unknown
}
export function isMention(v: unknown): v is Mention {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.richtext.facet#mention'
)
}
export function validateMention(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#mention', v)
}
/** A facet feature for links. */
export interface Link {
uri: string
[k: string]: unknown
}
export function isLink(v: unknown): v is Link {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.richtext.facet#link'
)
}
export function validateLink(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#link', v)
}
/** A text segment. Start is inclusive, end is exclusive. Indices are for utf8-encoded strings. */
export interface ByteSlice {
byteStart: number
byteEnd: number
[k: string]: unknown
}
export function isByteSlice(v: unknown): v is ByteSlice {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.richtext.facet#byteSlice'
)
}
export function validateByteSlice(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.richtext.facet#byteSlice', v)
}

View File

@ -0,0 +1,45 @@
/**
* 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 {
includeNsfw: boolean
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
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,380 @@
/**
* 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'
import * as ComAtprotoRepoStrongRef from '../repo/strongRef'
import * as ComAtprotoModerationDefs from '../moderation/defs'
import * as ComAtprotoServerDefs from '../server/defs'
import * as ComAtprotoLabelDefs from '../label/defs'
export interface ActionView {
id: number
action: ActionType
subject:
| RepoRef
| ComAtprotoRepoStrongRef.Main
| { $type: string; [k: string]: unknown }
subjectBlobCids: string[]
createLabelVals?: string[]
negateLabelVals?: string[]
reason: string
createdBy: string
createdAt: string
reversal?: ActionReversal
resolvedReportIds: number[]
[k: string]: unknown
}
export function isActionView(v: unknown): v is ActionView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#actionView'
)
}
export function validateActionView(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#actionView', v)
}
export interface ActionViewDetail {
id: number
action: ActionType
subject: RepoView | RecordView | { $type: string; [k: string]: unknown }
subjectBlobs: BlobView[]
createLabelVals?: string[]
negateLabelVals?: string[]
reason: string
createdBy: string
createdAt: string
reversal?: ActionReversal
resolvedReports: ReportView[]
[k: string]: unknown
}
export function isActionViewDetail(v: unknown): v is ActionViewDetail {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#actionViewDetail'
)
}
export function validateActionViewDetail(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#actionViewDetail', v)
}
export interface ActionViewCurrent {
id: number
action: ActionType
[k: string]: unknown
}
export function isActionViewCurrent(v: unknown): v is ActionViewCurrent {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#actionViewCurrent'
)
}
export function validateActionViewCurrent(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#actionViewCurrent', v)
}
export interface ActionReversal {
reason: string
createdBy: string
createdAt: string
[k: string]: unknown
}
export function isActionReversal(v: unknown): v is ActionReversal {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#actionReversal'
)
}
export function validateActionReversal(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#actionReversal', v)
}
export type ActionType =
| 'lex:com.atproto.admin.defs#takedown'
| 'lex:com.atproto.admin.defs#flag'
| 'lex:com.atproto.admin.defs#acknowledge'
| 'lex:com.atproto.admin.defs#escalate'
| (string & {})
/** Moderation action type: Takedown. Indicates that content should not be served by the PDS. */
export const TAKEDOWN = 'com.atproto.admin.defs#takedown'
/** Moderation action type: Flag. Indicates that the content was reviewed and considered to violate PDS rules, but may still be served. */
export const FLAG = 'com.atproto.admin.defs#flag'
/** Moderation action type: Acknowledge. Indicates that the content was reviewed and not considered to violate PDS rules. */
export const ACKNOWLEDGE = 'com.atproto.admin.defs#acknowledge'
/** Moderation action type: Escalate. Indicates that the content has been flagged for additional review. */
export const ESCALATE = 'com.atproto.admin.defs#escalate'
export interface ReportView {
id: number
reasonType: ComAtprotoModerationDefs.ReasonType
reason?: string
subject:
| RepoRef
| ComAtprotoRepoStrongRef.Main
| { $type: string; [k: string]: unknown }
reportedBy: string
createdAt: string
resolvedByActionIds: number[]
[k: string]: unknown
}
export function isReportView(v: unknown): v is ReportView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#reportView'
)
}
export function validateReportView(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#reportView', v)
}
export interface ReportViewDetail {
id: number
reasonType: ComAtprotoModerationDefs.ReasonType
reason?: string
subject: RepoView | RecordView | { $type: string; [k: string]: unknown }
reportedBy: string
createdAt: string
resolvedByActions: ActionView[]
[k: string]: unknown
}
export function isReportViewDetail(v: unknown): v is ReportViewDetail {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#reportViewDetail'
)
}
export function validateReportViewDetail(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#reportViewDetail', v)
}
export interface RepoView {
did: string
handle: string
email?: string
relatedRecords: {}[]
indexedAt: string
moderation: Moderation
invitedBy?: ComAtprotoServerDefs.InviteCode
[k: string]: unknown
}
export function isRepoView(v: unknown): v is RepoView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#repoView'
)
}
export function validateRepoView(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#repoView', v)
}
export interface RepoViewDetail {
did: string
handle: string
email?: string
relatedRecords: {}[]
indexedAt: string
moderation: ModerationDetail
labels?: ComAtprotoLabelDefs.Label[]
invitedBy?: ComAtprotoServerDefs.InviteCode
invites?: ComAtprotoServerDefs.InviteCode[]
[k: string]: unknown
}
export function isRepoViewDetail(v: unknown): v is RepoViewDetail {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#repoViewDetail'
)
}
export function validateRepoViewDetail(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v)
}
export interface RepoRef {
did: string
[k: string]: unknown
}
export function isRepoRef(v: unknown): v is RepoRef {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#repoRef'
)
}
export function validateRepoRef(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#repoRef', v)
}
export interface RecordView {
uri: string
cid: string
value: {}
blobCids: string[]
indexedAt: string
moderation: Moderation
repo: RepoView
[k: string]: unknown
}
export function isRecordView(v: unknown): v is RecordView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#recordView'
)
}
export function validateRecordView(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#recordView', v)
}
export interface RecordViewDetail {
uri: string
cid: string
value: {}
blobs: BlobView[]
labels?: ComAtprotoLabelDefs.Label[]
indexedAt: string
moderation: ModerationDetail
repo: RepoView
[k: string]: unknown
}
export function isRecordViewDetail(v: unknown): v is RecordViewDetail {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#recordViewDetail'
)
}
export function validateRecordViewDetail(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#recordViewDetail', v)
}
export interface Moderation {
currentAction?: ActionViewCurrent
[k: string]: unknown
}
export function isModeration(v: unknown): v is Moderation {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#moderation'
)
}
export function validateModeration(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#moderation', v)
}
export interface ModerationDetail {
currentAction?: ActionViewCurrent
actions: ActionView[]
reports: ReportView[]
[k: string]: unknown
}
export function isModerationDetail(v: unknown): v is ModerationDetail {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#moderationDetail'
)
}
export function validateModerationDetail(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#moderationDetail', v)
}
export interface BlobView {
cid: string
mimeType: string
size: number
createdAt: string
details?:
| ImageDetails
| VideoDetails
| { $type: string; [k: string]: unknown }
moderation?: Moderation
[k: string]: unknown
}
export function isBlobView(v: unknown): v is BlobView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#blobView'
)
}
export function validateBlobView(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#blobView', v)
}
export interface ImageDetails {
width: number
height: number
[k: string]: unknown
}
export function isImageDetails(v: unknown): v is ImageDetails {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#imageDetails'
)
}
export function validateImageDetails(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#imageDetails', v)
}
export interface VideoDetails {
width: number
height: number
length: number
[k: string]: unknown
}
export function isVideoDetails(v: unknown): v is VideoDetails {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.admin.defs#videoDetails'
)
}
export function validateVideoDetails(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.admin.defs#videoDetails', v)
}

View File

@ -0,0 +1,36 @@
/**
* 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 {
codes?: string[]
accounts?: string[]
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,45 @@
/**
* 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 ComAtprotoServerDefs from '../server/defs'
export interface QueryParams {
sort: 'recent' | 'usage' | (string & {})
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
codes: ComAtprotoServerDefs.InviteCode[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,37 @@
/**
* 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 ComAtprotoAdminDefs from './defs'
export interface QueryParams {
id: number
}
export type InputSchema = undefined
export type OutputSchema = ComAtprotoAdminDefs.ActionViewDetail
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,45 @@
/**
* 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 ComAtprotoAdminDefs from './defs'
export interface QueryParams {
subject?: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
actions: ComAtprotoAdminDefs.ActionView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,37 @@
/**
* 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 ComAtprotoAdminDefs from './defs'
export interface QueryParams {
id: number
}
export type InputSchema = undefined
export type OutputSchema = ComAtprotoAdminDefs.ReportViewDetail
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -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 ComAtprotoAdminDefs from './defs'
export interface QueryParams {
subject?: string
resolved?: boolean
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
reports: ComAtprotoAdminDefs.ReportView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,38 @@
/**
* 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 ComAtprotoAdminDefs from './defs'
export interface QueryParams {
uri: string
cid?: string
}
export type InputSchema = undefined
export type OutputSchema = ComAtprotoAdminDefs.RecordViewDetail
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,37 @@
/**
* 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 ComAtprotoAdminDefs from './defs'
export interface QueryParams {
did: string
}
export type InputSchema = undefined
export type OutputSchema = ComAtprotoAdminDefs.RepoViewDetail
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,45 @@
/**
* 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 ComAtprotoAdminDefs from './defs'
export interface QueryParams {}
export interface InputSchema {
actionId: number
reportIds: number[]
createdBy: string
[k: string]: unknown
}
export type OutputSchema = ComAtprotoAdminDefs.ActionView
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,45 @@
/**
* 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 ComAtprotoAdminDefs from './defs'
export interface QueryParams {}
export interface InputSchema {
id: number
reason: string
createdBy: string
[k: string]: unknown
}
export type OutputSchema = ComAtprotoAdminDefs.ActionView
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -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 ComAtprotoAdminDefs from './defs'
export interface QueryParams {
term?: string
invitedBy?: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
repos: ComAtprotoAdminDefs.RepoView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,58 @@
/**
* 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 ComAtprotoAdminDefs from './defs'
import * as ComAtprotoRepoStrongRef from '../repo/strongRef'
export interface QueryParams {}
export interface InputSchema {
action:
| 'com.atproto.admin.defs#takedown'
| 'com.atproto.admin.defs#flag'
| 'com.atproto.admin.defs#acknowledge'
| (string & {})
subject:
| ComAtprotoAdminDefs.RepoRef
| ComAtprotoRepoStrongRef.Main
| { $type: string; [k: string]: unknown }
subjectBlobCids?: string[]
createLabelVals?: string[]
negateLabelVals?: string[]
reason: string
createdBy: string
[k: string]: unknown
}
export type OutputSchema = ComAtprotoAdminDefs.ActionView
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'SubjectHasAction'
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,37 @@
/**
* 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. */
account: string
email: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,36 @@
/**
* 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 {
did: string
handle: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,42 @@
/**
* 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 {
/** The handle to resolve. If not supplied, will resolve the host's own handle. */
handle?: string
}
export type InputSchema = undefined
export interface OutputSchema {
did: string
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,35 @@
/**
* 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 {
handle: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,36 @@
/**
* 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'
/** Metadata tag on an atproto resource (eg, repo or record) */
export interface Label {
/** DID of the actor who created this label */
src: string
/** AT URI of the record, repository (account), or other resource which this label applies to */
uri: string
/** optionally, CID specifying the specific version of 'uri' resource this label applies to */
cid?: string
/** the short string name of the value or type of this label */
val: string
/** if true, this is a negation label, overwriting a previous label */
neg?: boolean
/** timestamp when this label was created */
cts: string
[k: string]: unknown
}
export function isLabel(v: unknown): v is Label {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.label.defs#label'
)
}
export function validateLabel(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.label.defs#label', v)
}

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 ComAtprotoLabelDefs from './defs'
export interface QueryParams {
/** List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI */
uriPatterns: string[]
/** Optional list of label sources (DIDs) to filter on */
sources?: string[]
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
labels: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,64 @@
/**
* 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'
import { HandlerAuth, ErrorFrame } from '@atproto/xrpc-server'
import { IncomingMessage } from 'http'
import * as ComAtprotoLabelDefs from './defs'
export interface QueryParams {
/** The last known event to backfill from. */
cursor?: number
}
export type OutputSchema =
| Labels
| Info
| { $type: string; [k: string]: unknown }
export type HandlerError = ErrorFrame<'FutureCursor'>
export type HandlerOutput = HandlerError | OutputSchema
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
req: IncomingMessage
signal: AbortSignal
}) => AsyncIterable<HandlerOutput>
export interface Labels {
seq: number
labels: ComAtprotoLabelDefs.Label[]
[k: string]: unknown
}
export function isLabels(v: unknown): v is Labels {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.label.subscribeLabels#labels'
)
}
export function validateLabels(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.label.subscribeLabels#labels', v)
}
export interface Info {
name: 'OutdatedCursor' | (string & {})
message?: string
[k: string]: unknown
}
export function isInfo(v: unknown): v is Info {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.label.subscribeLabels#info'
)
}
export function validateInfo(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.label.subscribeLabels#info', v)
}

View File

@ -0,0 +1,61 @@
/**
* 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 ComAtprotoModerationDefs from './defs'
import * as ComAtprotoAdminDefs from '../admin/defs'
import * as ComAtprotoRepoStrongRef from '../repo/strongRef'
export interface QueryParams {}
export interface InputSchema {
reasonType: ComAtprotoModerationDefs.ReasonType
reason?: string
subject:
| ComAtprotoAdminDefs.RepoRef
| ComAtprotoRepoStrongRef.Main
| { $type: string; [k: string]: unknown }
[k: string]: unknown
}
export interface OutputSchema {
id: number
reasonType: ComAtprotoModerationDefs.ReasonType
reason?: string
subject:
| ComAtprotoAdminDefs.RepoRef
| ComAtprotoRepoStrongRef.Main
| { $type: string; [k: string]: unknown }
reportedBy: string
createdAt: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,29 @@
/**
* 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 type ReasonType =
| 'com.atproto.moderation.defs#reasonSpam'
| 'com.atproto.moderation.defs#reasonViolation'
| 'com.atproto.moderation.defs#reasonMisleading'
| 'com.atproto.moderation.defs#reasonSexual'
| 'com.atproto.moderation.defs#reasonRude'
| 'com.atproto.moderation.defs#reasonOther'
| (string & {})
/** Spam: frequent unwanted promotion, replies, mentions */
export const REASONSPAM = 'com.atproto.moderation.defs#reasonSpam'
/** Direct violation of server rules, laws, terms of service */
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 */
export const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual'
/** Rude, harassing, explicit, or otherwise unwelcoming behavior */
export const REASONRUDE = 'com.atproto.moderation.defs#reasonRude'
/** Other: reports not falling under another report category */
export const REASONOTHER = 'com.atproto.moderation.defs#reasonOther'

View File

@ -0,0 +1,100 @@
/**
* 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
/** Validate the records? */
validate: boolean
writes: (Create | Update | Delete)[]
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
/** Create a new record. */
export interface Create {
collection: string
rkey?: string
value: {}
[k: string]: unknown
}
export function isCreate(v: unknown): v is Create {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.repo.applyWrites#create'
)
}
export function validateCreate(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.repo.applyWrites#create', v)
}
/** Update an existing record. */
export interface Update {
collection: string
rkey: string
value: {}
[k: string]: unknown
}
export function isUpdate(v: unknown): v is Update {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.repo.applyWrites#update'
)
}
export function validateUpdate(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.repo.applyWrites#update', v)
}
/** Delete an existing record. */
export interface Delete {
collection: string
rkey: string
[k: string]: unknown
}
export function isDelete(v: unknown): v is Delete {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.repo.applyWrites#delete'
)
}
export function validateDelete(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.repo.applyWrites#delete', v)
}

View File

@ -0,0 +1,58 @@
/**
* 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
/** The NSID of the record collection. */
collection: string
/** The key of the record. */
rkey?: string
/** Validate the record? */
validate: boolean
/** The record to create. */
record: {}
/** Compare and swap with the previous commit by cid. */
swapCommit?: string
[k: string]: unknown
}
export interface OutputSchema {
uri: string
cid: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'InvalidSwap'
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,45 @@
/**
* 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
/** The NSID of the record collection. */
collection: string
/** The key of the record. */
rkey: string
/** Compare and swap with the previous record by cid. */
swapRecord?: 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

@ -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'
export interface QueryParams {
/** The handle or DID of the repo. */
repo: string
}
export type InputSchema = undefined
export interface OutputSchema {
handle: string
did: string
didDoc: {}
collections: string[]
handleIsCorrect: boolean
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -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'
export interface QueryParams {
/** The handle or DID of the repo. */
repo: string
/** The NSID of the record collection. */
collection: string
/** The key of the record. */
rkey: string
/** The CID of the version of the record. If not specified, then return the most recent version. */
cid?: string
}
export type InputSchema = undefined
export interface OutputSchema {
uri: string
cid?: string
value: {}
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,73 @@
/**
* 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 {
/** The handle or DID of the repo. */
repo: string
/** The NSID of the record type. */
collection: string
/** The number of records to return. */
limit: number
cursor?: string
/** DEPRECATED: The lowest sort-ordered rkey to start from (exclusive) */
rkeyStart?: string
/** DEPRECATED: The highest sort-ordered rkey to stop at (exclusive) */
rkeyEnd?: string
/** Reverse the order of the returned records? */
reverse?: boolean
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
records: Record[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
export interface Record {
uri: string
cid: string
value: {}
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.repo.listRecords#record'
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.repo.listRecords#record', v)
}

View File

@ -0,0 +1,60 @@
/**
* 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
/** The NSID of the record collection. */
collection: string
/** The key of the record. */
rkey: string
/** Validate the record? */
validate: boolean
/** The record to write. */
record: {}
/** Compare and swap with the previous record by cid. */
swapRecord?: string | null
/** Compare and swap with the previous commit by cid. */
swapCommit?: string
[k: string]: unknown
}
export interface OutputSchema {
uri: string
cid: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'InvalidSwap'
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -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 Main {
uri: string
cid: string
[k: string]: unknown
}
export function isMain(v: unknown): v is Main {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'com.atproto.repo.strongRef#main' ||
v.$type === 'com.atproto.repo.strongRef')
)
}
export function validateMain(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.repo.strongRef#main', v)
}

View File

@ -0,0 +1,43 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import stream from 'stream'
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 type InputSchema = string | Uint8Array
export interface OutputSchema {
blob: BlobRef
[k: string]: unknown
}
export interface HandlerInput {
encoding: '*/*'
body: stream.Readable
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,58 @@
/**
* 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 {
email: string
handle: string
inviteCode?: string
password: string
recoveryKey?: string
[k: string]: unknown
}
export interface OutputSchema {
accessJwt: string
refreshJwt: string
handle: string
did: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?:
| 'InvalidHandle'
| 'InvalidPassword'
| 'InvalidInviteCode'
| 'HandleNotAvailable'
| 'UnsupportedDomain'
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,65 @@
/**
* 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 {
name: string
[k: string]: unknown
}
export type OutputSchema = AppPassword
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'AccountTakedown'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
export interface AppPassword {
name: string
password: string
createdAt: string
[k: string]: unknown
}
export function isAppPassword(v: unknown): v is AppPassword {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.server.createAppPassword#appPassword'
)
}
export function validateAppPassword(v: unknown): ValidationResult {
return lexicons.validate(
'com.atproto.server.createAppPassword#appPassword',
v,
)
}

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'
export interface QueryParams {}
export interface InputSchema {
useCount: number
forAccount?: string
[k: string]: unknown
}
export interface OutputSchema {
code: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,68 @@
/**
* 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 {
codeCount: number
useCount: number
forAccounts?: string[]
[k: string]: unknown
}
export interface OutputSchema {
codes: AccountCodes[]
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
export interface AccountCodes {
account: string
codes: string[]
[k: string]: unknown
}
export function isAccountCodes(v: unknown): v is AccountCodes {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.server.createInviteCodes#accountCodes'
)
}
export function validateAccountCodes(v: unknown): ValidationResult {
return lexicons.validate(
'com.atproto.server.createInviteCodes#accountCodes',
v,
)
}

View File

@ -0,0 +1,52 @@
/**
* 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 {
/** Handle or other identifier supported by the server for the authenticating user. */
identifier: string
password: string
[k: string]: unknown
}
export interface OutputSchema {
accessJwt: string
refreshJwt: string
handle: string
did: string
email?: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'AccountTakedown'
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,48 @@
/**
* 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 InviteCode {
code: string
available: number
disabled: boolean
forAccount: string
createdBy: string
createdAt: string
uses: InviteCodeUse[]
[k: string]: unknown
}
export function isInviteCode(v: unknown): v is InviteCode {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.server.defs#inviteCode'
)
}
export function validateInviteCode(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.server.defs#inviteCode', v)
}
export interface InviteCodeUse {
usedBy: string
usedAt: string
[k: string]: unknown
}
export function isInviteCodeUse(v: unknown): v is InviteCodeUse {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.server.defs#inviteCodeUse'
)
}
export function validateInviteCodeUse(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.server.defs#inviteCodeUse', v)
}

View File

@ -0,0 +1,38 @@
/**
* 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 {
did: string
password: string
token: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'ExpiredToken' | 'InvalidToken'
}
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

@ -0,0 +1,28 @@
/**
* 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 type InputSchema = undefined
export type HandlerInput = undefined
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,59 @@
/**
* 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 type InputSchema = undefined
export interface OutputSchema {
inviteCodeRequired?: boolean
availableUserDomains: string[]
links?: Links
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
export interface Links {
privacyPolicy?: string
termsOfService?: string
[k: string]: unknown
}
export function isLinks(v: unknown): v is Links {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.server.describeServer#links'
)
}
export function validateLinks(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.server.describeServer#links', v)
}

View File

@ -0,0 +1,44 @@
/**
* 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 ComAtprotoServerDefs from './defs'
export interface QueryParams {
includeUsed: boolean
createAvailable: boolean
}
export type InputSchema = undefined
export interface OutputSchema {
codes: ComAtprotoServerDefs.InviteCode[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'DuplicateCreate'
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,41 @@
/**
* 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 type InputSchema = undefined
export interface OutputSchema {
handle: string
did: string
email?: string
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,58 @@
/**
* 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 type InputSchema = undefined
export interface OutputSchema {
passwords: AppPassword[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'AccountTakedown'
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput
export interface AppPassword {
name: string
createdAt: string
[k: string]: unknown
}
export function isAppPassword(v: unknown): v is AppPassword {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'com.atproto.server.listAppPasswords#appPassword'
)
}
export function validateAppPassword(v: unknown): ValidationResult {
return lexicons.validate('com.atproto.server.listAppPasswords#appPassword', v)
}

View File

@ -0,0 +1,43 @@
/**
* 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 type InputSchema = undefined
export interface OutputSchema {
accessJwt: string
refreshJwt: string
handle: string
did: string
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'AccountTakedown'
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,28 @@
/**
* 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 type InputSchema = undefined
export type HandlerInput = undefined
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,35 @@
/**
* 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 {
email: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,37 @@
/**
* 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 {
token: string
password: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
error?: 'ExpiredToken' | 'InvalidToken'
}
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

@ -0,0 +1,35 @@
/**
* 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 {
name: string
[k: string]: unknown
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerError {
status: number
message?: string
}
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

@ -0,0 +1,39 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import stream from 'stream'
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 {
/** The DID of the repo. */
did: string
/** The CID of the blob to fetch */
cid: string
}
export type InputSchema = undefined
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: '*/*'
body: Uint8Array | stream.Readable
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,38 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import stream from 'stream'
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 {
/** The DID of the repo. */
did: string
cids: string[]
}
export type InputSchema = undefined
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/vnd.ipld.car'
body: Uint8Array | stream.Readable
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -0,0 +1,39 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import stream from 'stream'
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 {
/** The DID of the repo. */
did: string
/** The commit to get the checkout from. Defaults to current HEAD. */
commit?: string
}
export type InputSchema = undefined
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/vnd.ipld.car'
body: Uint8Array | stream.Readable
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
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

@ -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'
export interface QueryParams {
/** The DID of the repo. */
did: string
/** The most recent commit */
latest?: string
/** The earliest commit to start from */
earliest?: string
}
export type InputSchema = undefined
export interface OutputSchema {
commits: string[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess
export type Handler<HA extends HandlerAuth = never> = (ctx: {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
}) => Promise<HandlerOutput> | HandlerOutput

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