This commit is contained in:
sneakers-the-rat 2023-12-26 18:57:08 -08:00
commit 37478dc5c5
142 changed files with 26298 additions and 0 deletions

130
.gitignore vendored Normal file
View file

@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

21
LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023 Bluesky PBLLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

152
README.md Normal file
View file

@ -0,0 +1,152 @@
# ATProto Feed Generator
This is a starter kit for creating ATProto Feed Generators. It's not feature complete, but should give you a good starting ground off of which to build and deploy a feed.
## 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 views by the requesting server and sent back to the client. This route is described in the [`app.bsky.feed.getFeedSkeleton` lexicon](https://atproto.com/lexicons/app-bsky-feed#appbskyfeedgetfeedskeleton).
A Feed Generator service can host one or more algorithms. The service itself is identified by DID, while each algorithm that it hosts is declared by a record in the repo of the account that created it. For instance, feeds offered by Bluesky will likely be declared in `@bsky.app`'s repo. Therefore, a given algorithm is identified by the at-uri of the declaration record. This declaration record includes a pointer to the service's DID along with some profile information for the feed.
The general flow of providing a custom algorithm to a user is as follows:
- A user requests a feed from their server (PDS) using the at-uri of the declared feed
- The PDS resolves the at-uri and finds the DID doc of the Feed Generator
- The PDS sends a `getFeedSkeleton` request to the service endpoint declared in the Feed Generator's DID doc
- 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
For users, this should feel like visiting a page in the app. Once they subscribe to a custom algorithm, it will appear in their home interface as one of their available feeds.
## Getting Started
We've set up this simple server with SQLite to store and query data. Feel free to switch this out for whichever database you prefer.
Next, you will need to do two things:
1. Implement indexing logic in `src/subscription.ts`.
This will subscribe to the repo subscription stream on startup, parse events and index them according to your provided logic.
2. Implement feed generation logic in `src/algos`
For inspiration, we've provided a very simple feed algorithm (`whats-alf`) that returns all posts related to the titular character of the TV show ALF.
You can either edit it or add another algorithm alongside it. The types are in place, and you will just need to return something that satisfies the `SkeletonFeedPost[]` type.
We've taken care of setting this server up with a did:web. However, you're free to switch this out for did:plc if you like - you may want to if you expect this Feed Generator to be long-standing and possibly migrating domains.
### Deploying your feed
Your feed will need to be accessible at the value supplied to the `FEEDGEN_HOSTNAME` environment variable.
The service must be set up to respond to HTTPS queries over port 443.
### Publishing your feed
To publish your feed, go to the script at `scripts/publishFeedGen.ts` and fill in the variables at the top. Examples are included, and some are optional. To publish your feed generator, simply run `yarn publishFeed`.
To update your feed's display data (name, avatar, description, etc.), just update the relevant variables and re-run the script.
After successfully running the script, you should be able to see your feed from within the app, as well as share it by embedding a link in a post (similar to a quote post).
## Running the Server
Install dependencies with `yarn` and then run the server with `yarn start`. This will start the server on port 3000, or what's defined in `.env`. You can then watch the firehose output in the console and access the output of the default custom ALF feed at [http://localhost:3000/xrpc/app.bsky.feed.getFeedSkeleton?feed=at://did:example:alice/app.bsky.feed.generator/whats-alf](http://localhost:3000/xrpc/app.bsky.feed.getFeedSkeleton?feed=at://did:example:alice/app.bsky.feed.generator/whats-alf).
## 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 an additional location to attach some context. Here is the full schema:
```ts
type SkeletonItem = {
post: string // post 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: 'app.bsky.feed.defs#skeletonReasonRepost'
repost: string // repost URI
}
```
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 the `@atproto/xrpc-server` package, and you can see them in action in `src/auth.ts`.
### Pagination
You'll notice that the `getFeedSkeleton` method returns a `cursor` in its response and takes a `cursor` param as input.
This cursor is treated as an opaque value and fully at the Feed Generator's discretion. It is simply passed through the PDS directly to and 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 use cases, 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 and filter for all posts and likes (ignoring profiles/reposts/follows/etc.). You would keep a running tally of likes per post and 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 and 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.
## Community Feed Generator Templates
- [Python](https://github.com/MarshalX/bluesky-feed-generator) - [@MarshalX](https://github.com/MarshalX)
- [Ruby](https://github.com/mackuba/bluesky-feeds-rb) - [@mackuba](https://github.com/mackuba)

5814
Untitled.ipynb Normal file

File diff suppressed because one or more lines are too long

4461
counts.csv Normal file

File diff suppressed because it is too large Load diff

34
package.json Normal file
View file

@ -0,0 +1,34 @@
{
"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": {
"publishFeed": "ts-node scripts/publishFeedGen.ts",
"start": "ts-node src/index.ts",
"build": "tsc"
},
"dependencies": {
"@atproto/api": "^0.3.7",
"@atproto/did-resolver": "^0.1.0",
"@atproto/lexicon": "^0.1.0",
"@atproto/repo": "^0.1.0",
"@atproto/uri": "^0.0.2",
"@atproto/xrpc-server": "^0.2.0",
"better-sqlite3": "^8.3.0",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"kysely": "^0.22.0",
"multiformats": "^9.9.0"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.4",
"@types/express": "^4.17.17",
"@types/node": "^20.1.2",
"ts-node": "^10.9.1",
"typescript": "^5.0.4"
}
}

89
scripts/publishFeedGen.ts Normal file
View file

@ -0,0 +1,89 @@
import dotenv from 'dotenv'
import { AtpAgent, BlobRef } from '@atproto/api'
import fs from 'fs/promises'
import { ids } from '../src/lexicon/lexicons'
const run = async () => {
dotenv.config()
// YOUR bluesky handle
// Ex: user.bsky.social
const handle = ''
// YOUR bluesky password, or preferably an App Password (found in your client settings)
// Ex: abcd-1234-efgh-5678
const password = ''
// A short name for the record that will show in urls
// Lowercase with no spaces.
// Ex: whats-hot
const recordName = ''
// A display name for your feed
// Ex: What's Hot
const displayName = ''
// (Optional) A description of your feed
// Ex: Top trending content from the whole network
const description = ''
// (Optional) The path to an image to be used as your feed's avatar
// Ex: ~/path/to/avatar.jpeg
const avatar: string = ''
// -------------------------------------
// NO NEED TO TOUCH ANYTHING BELOW HERE
// -------------------------------------
if (!process.env.FEEDGEN_SERVICE_DID && !process.env.FEEDGEN_HOSTNAME) {
throw new Error('Please provide a hostname in the .env file')
}
const feedGenDid =
process.env.FEEDGEN_SERVICE_DID ?? `did:web:${process.env.FEEDGEN_HOSTNAME}`
// only update this if in a test environment
const agent = new AtpAgent({ service: 'https://bsky.social' })
await agent.login({ identifier: handle, password })
try {
await agent.api.app.bsky.feed.describeFeedGenerator()
} catch (err) {
throw new Error(
'The bluesky server is not ready to accept published custom feeds yet',
)
}
let avatarRef: BlobRef | undefined
if (avatar) {
let encoding: string
if (avatar.endsWith('png')) {
encoding = 'image/png'
} else if (avatar.endsWith('jpg') || avatar.endsWith('jpeg')) {
encoding = 'image/jpeg'
} else {
throw new Error('expected png or jpeg')
}
const img = await fs.readFile(avatar)
const blobRes = await agent.api.com.atproto.repo.uploadBlob(img, {
encoding,
})
avatarRef = blobRes.data.blob
}
await agent.api.com.atproto.repo.putRecord({
repo: agent.session?.did ?? '',
collection: ids.AppBskyFeedGenerator,
rkey: recordName,
record: {
did: feedGenDid,
displayName: displayName,
description: description,
avatar: avatarRef,
createdAt: new Date().toISOString(),
},
})
console.log('All done 🎉')
}
run()

14
src/algos/index.ts Normal file
View file

@ -0,0 +1,14 @@
import { AppContext } from '../config'
import {
QueryParams,
OutputSchema as AlgoOutput,
} from '../lexicon/types/app/bsky/feed/getFeedSkeleton'
import * as whatsAlf from './whats-alf'
type AlgoHandler = (ctx: AppContext, params: QueryParams) => Promise<AlgoOutput>
const algos: Record<string, AlgoHandler> = {
[whatsAlf.shortname]: whatsAlf.handler,
}
export default algos

43
src/algos/whats-alf.ts Normal file
View file

@ -0,0 +1,43 @@
import { InvalidRequestError } from '@atproto/xrpc-server'
import { QueryParams } from '../lexicon/types/app/bsky/feed/getFeedSkeleton'
import { AppContext } from '../config'
// max 15 chars
export const shortname = 'whats-alf'
export const handler = async (ctx: AppContext, params: QueryParams) => {
let builder = ctx.db
.selectFrom('post')
.selectAll()
.orderBy('indexedAt', 'desc')
.orderBy('cid', 'desc')
.limit(params.limit)
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('post.indexedAt', '<', timeStr)
.orWhere((qb) => qb.where('post.indexedAt', '=', timeStr))
.where('post.cid', '<', cid)
}
const res = await builder.execute()
const feed = res.map((row) => ({
post: row.uri,
}))
let cursor: string | undefined
const last = res.at(-1)
if (last) {
cursor = `${new Date(last.indexedAt).getTime()}::${last.cid}`
}
return {
cursor,
feed,
}
}

18
src/auth.ts Normal file
View file

@ -0,0 +1,18 @@
import express from 'express'
import { verifyJwt, AuthRequiredError } from '@atproto/xrpc-server'
import { DidResolver } from '@atproto/did-resolver'
export const validateAuth = async (
req: express.Request,
serviceDid: string,
didResolver: DidResolver,
): Promise<string> => {
const { authorization = '' } = req.headers
if (!authorization.startsWith('Bearer ')) {
throw new AuthRequiredError()
}
const jwt = authorization.replace('Bearer ', '').trim()
return verifyJwt(jwt, serviceDid, async (did: string) => {
return didResolver.resolveAtprotoKey(did)
})
}

19
src/config.ts Normal file
View file

@ -0,0 +1,19 @@
import { Database } from './db'
import { DidResolver } from '@atproto/did-resolver'
export type AppContext = {
db: Database
didResolver: DidResolver
cfg: Config
}
export type Config = {
port: number
listenhost: string
hostname: string
sqliteLocation: string
subscriptionEndpoint: string
serviceDid: string
publisherDid: string
subscriptionReconnectDelay: number
}

20
src/db/index.ts Normal file
View file

@ -0,0 +1,20 @@
import SqliteDb from 'better-sqlite3'
import { Kysely, Migrator, SqliteDialect } from 'kysely'
import { DatabaseSchema } from './schema'
import { migrationProvider } from './migrations'
export const createDb = (location: string): Database => {
return new Kysely<DatabaseSchema>({
dialect: new SqliteDialect({
database: new SqliteDb(location),
}),
})
}
export const migrateToLatest = async (db: Database) => {
const migrator = new Migrator({ db, provider: migrationProvider })
const { error } = await migrator.migrateToLatest()
if (error) throw error
}
export type Database = Kysely<DatabaseSchema>

71
src/db/migrations.ts Normal file
View file

@ -0,0 +1,71 @@
import { Kysely, Migration, MigrationProvider } from 'kysely'
const migrations: Record<string, Migration> = {}
export const migrationProvider: MigrationProvider = {
async getMigrations() {
return migrations
},
}
migrations['001'] = {
async up(db: Kysely<unknown>) {
await db.schema
.createTable('post')
.addColumn('uri', 'varchar', (col) => col.primaryKey())
.addColumn('cid', 'varchar', (col) => col.notNull())
.addColumn('authorDid', 'varchar', (col) => col.notNull())
.addColumn('replyParent', 'varchar')
.addColumn('replyRoot', 'varchar')
.addColumn('indexedAt', 'varchar', (col) => col.notNull())
.addColumn('text', 'varchar', (col) => col.notNull())
.addColumn('nAltText', 'integer')
.addColumn('nImages', 'integer')
.execute()
await db.schema
.createTable('like')
.addColumn('uri', 'varchar', (col) => col.primaryKey())
.addColumn('cid', 'varchar', (col) => col.notNull())
.addColumn('authorDid', 'varchar', (col) => col.notNull())
.addColumn('indexedAt', 'varchar', (col) => col.notNull())
.addColumn('createdAt', 'varchar', (col) => col.notNull())
.addColumn('subjectUri', 'varchar', (col) => col.notNull())
.addColumn('subjectCid', 'varchar', (col) => col.notNull())
.addColumn('subjectDid', 'varchar', (col) => col.notNull())
.execute()
await db.schema
.createTable('repost')
.addColumn('uri', 'varchar', (col) => col.primaryKey())
.addColumn('cid', 'varchar', (col) => col.notNull())
.addColumn('authorDid', 'varchar', (col) => col.notNull())
.addColumn('indexedAt', 'varchar', (col) => col.notNull())
.addColumn('createdAt', 'varchar', (col) => col.notNull())
.addColumn('subjectUri', 'varchar', (col) => col.notNull())
.addColumn('subjectCid', 'varchar', (col) => col.notNull())
.addColumn('subjectDid', 'varchar', (col) => col.notNull())
.execute()
await db.schema
.createTable('follow')
.addColumn('uri', 'varchar', (col) => col.primaryKey())
.addColumn('cid', 'varchar', (col) => col.notNull())
.addColumn('authorDid', 'varchar', (col) => col.notNull())
.addColumn('indexedAt', 'varchar', (col) => col.notNull())
.addColumn('createdAt', 'varchar', (col) => col.notNull())
.addColumn('subjectDid', 'varchar', (col) => col.notNull())
.execute()
await db.schema
.createTable('sub_state')
.addColumn('service', 'varchar', (col) => col.primaryKey())
.addColumn('cursor', 'integer', (col) => col.notNull())
.execute()
},
async down(db: Kysely<unknown>) {
await db.schema.dropTable('post').execute()
await db.schema.dropTable('sub_state').execute()
},
}

55
src/db/schema.ts Normal file
View file

@ -0,0 +1,55 @@
export type DatabaseSchema = {
post: Post
like: Like
follow: Follow
repost: Repost
sub_state: SubState
}
export type Post = {
uri: string
cid: string
authorDid: string
replyParent: string | null
replyRoot: string | null
indexedAt: string
nAltText: number | null
nImages: number
text: string
}
export type Like = {
uri: string
cid: string
createdAt: string
authorDid: string
subjectUri: string
subjectCid: string
subjectDid: string
indexedAt: string
}
export type Repost = {
uri: string
cid: string
createdAt: string
authorDid: string
subjectUri: string
subjectCid: string
subjectDid: string
indexedAt: string
}
export type Follow = {
uri: string
cid: string
subjectDid: string
createdAt: string
authorDid: string
indexedAt: string
}
export type SubState = {
service: string
cursor: number
}

41
src/index.ts Normal file
View file

@ -0,0 +1,41 @@
import dotenv from 'dotenv'
import FeedGenerator from './server'
const run = async () => {
dotenv.config()
const hostname = maybeStr(process.env.FEEDGEN_HOSTNAME) ?? 'example.com'
const serviceDid =
maybeStr(process.env.FEEDGEN_SERVICE_DID) ?? `did:web:${hostname}`
const server = FeedGenerator.create({
port: maybeInt(process.env.FEEDGEN_PORT) ?? 3000,
listenhost: maybeStr(process.env.FEEDGEN_LISTENHOST) ?? 'localhost',
sqliteLocation: maybeStr(process.env.FEEDGEN_SQLITE_LOCATION) ?? ':memory:',
subscriptionEndpoint:
maybeStr(process.env.FEEDGEN_SUBSCRIPTION_ENDPOINT) ??
'wss://bsky.social',
publisherDid:
maybeStr(process.env.FEEDGEN_PUBLISHER_DID) ?? 'did:example:alice',
subscriptionReconnectDelay:
maybeInt(process.env.FEEDGEN_SUBSCRIPTION_RECONNECT_DELAY) ?? 3000,
hostname,
serviceDid,
})
await server.start()
console.log(
`🤖 running feed generator at http://${server.cfg.listenhost}:${server.cfg.port}`,
)
}
const maybeStr = (val?: string) => {
if (!val) return undefined
return val
}
const maybeInt = (val?: string) => {
if (!val) return undefined
const int = parseInt(val, 10)
if (isNaN(int)) return undefined
return int
}
run()

1059
src/lexicon/index.ts Normal file

File diff suppressed because it is too large Load diff

6301
src/lexicon/lexicons.ts Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,146 @@
/**
* 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'
import * as AppBskyGraphDefs from '../graph/defs'
export interface ProfileViewBasic {
did: string
handle: string
displayName?: string
avatar?: string
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
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
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
mutedByList?: AppBskyGraphDefs.ListViewBasic
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 type Preferences = (
| AdultContentPref
| ContentLabelPref
| { $type: string; [k: string]: unknown }
)[]
export interface AdultContentPref {
enabled: boolean
[k: string]: unknown
}
export function isAdultContentPref(v: unknown): v is AdultContentPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#adultContentPref'
)
}
export function validateAdultContentPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#adultContentPref', v)
}
export interface ContentLabelPref {
label: string
visibility: 'show' | 'warn' | 'hide' | (string & {})
[k: string]: unknown
}
export function isContentLabelPref(v: unknown): v is ContentLabelPref {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.actor.defs#contentLabelPref'
)
}
export function validateContentLabelPref(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.actor.defs#contentLabelPref', v)
}

View file

@ -0,0 +1,40 @@
/**
* 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 {}
export type InputSchema = undefined
export interface OutputSchema {
preferences: AppBskyActorDefs.Preferences
[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 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,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'
import * as AppBskyActorDefs from './defs'
export interface QueryParams {}
export interface InputSchema {
preferences: AppBskyActorDefs.Preferences
[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 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,115 @@
/**
* 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 AppBskyFeedDefs from '../feed/defs'
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
| AppBskyFeedDefs.GeneratorView
| { $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,267 @@
/**
* 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'
import * as AppBskyRichtextFacet from '../richtext/facet'
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 GeneratorView {
uri: string
cid: string
did?: string
creator: AppBskyActorDefs.ProfileView
displayName?: string
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: string
likeCount?: number
viewer?: GeneratorViewerState
indexedAt: string
[k: string]: unknown
}
export function isGeneratorView(v: unknown): v is GeneratorView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#generatorView'
)
}
export function validateGeneratorView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#generatorView', v)
}
export interface GeneratorViewerState {
saved?: boolean
like?: string
[k: string]: unknown
}
export function isGeneratorViewerState(v: unknown): v is GeneratorViewerState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#generatorViewerState'
)
}
export function validateGeneratorViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#generatorViewerState', v)
}
export interface SkeletonFeedPost {
post: string
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 SkeletonReasonRepost {
repost: string
[k: string]: unknown
}
export function isSkeletonReasonRepost(v: unknown): v is SkeletonReasonRepost {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.defs#skeletonReasonRepost'
)
}
export function validateSkeletonReasonRepost(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v)
}

View file

@ -0,0 +1,76 @@
/**
* 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 {
did: string
feeds: Feed[]
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 Feed {
uri: string
[k: string]: unknown
}
export function isFeed(v: unknown): v is Feed {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.feed.describeFeedGenerator#feed'
)
}
export function validateFeed(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.describeFeedGenerator#feed', v)
}
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 === 'app.bsky.feed.describeFeedGenerator#links'
)
}
export function validateLinks(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.describeFeedGenerator#links', v)
}

View file

@ -0,0 +1,31 @@
/**
* 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'
export interface Record {
did: string
displayName?: string
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: BlobRef
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.feed.generator#main' ||
v.$type === 'app.bsky.feed.generator')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.feed.generator#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 AppBskyFeedDefs from './defs'
export interface QueryParams {
actor: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feeds: AppBskyFeedDefs.GeneratorView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
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 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,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 {
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
error?: 'UnknownFeed'
}
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 AppBskyFeedDefs from './defs'
export interface QueryParams {
feed: string
}
export type InputSchema = undefined
export interface OutputSchema {
view: AppBskyFeedDefs.GeneratorView
isOnline: boolean
isValid: 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,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 {
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
error?: 'UnknownFeed'
}
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,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 AppBskyFeedDefs from './defs'
export interface QueryParams {
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
feeds: AppBskyFeedDefs.GeneratorView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
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,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,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 AppBskyActorDefs from '../actor/defs'
import * as AppBskyRichtextFacet from '../richtext/facet'
export interface ListViewBasic {
uri: string
name: string
purpose: ListPurpose
avatar?: string
viewer?: ListViewerState
indexedAt?: string
[k: string]: unknown
}
export function isListViewBasic(v: unknown): v is ListViewBasic {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#listViewBasic'
)
}
export function validateListViewBasic(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#listViewBasic', v)
}
export interface ListView {
uri: string
creator: AppBskyActorDefs.ProfileView
name: string
purpose: ListPurpose
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: string
viewer?: ListViewerState
indexedAt: string
[k: string]: unknown
}
export function isListView(v: unknown): v is ListView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#listView'
)
}
export function validateListView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#listView', v)
}
export interface ListItemView {
subject: AppBskyActorDefs.ProfileView
[k: string]: unknown
}
export function isListItemView(v: unknown): v is ListItemView {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#listItemView'
)
}
export function validateListItemView(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#listItemView', v)
}
export type ListPurpose = 'app.bsky.graph.defs#modlist' | (string & {})
/** A list of actors to apply an aggregate moderation action (mute/block) on */
export const MODLIST = 'app.bsky.graph.defs#modlist'
export interface ListViewerState {
muted?: boolean
[k: string]: unknown
}
export function isListViewerState(v: unknown): v is ListViewerState {
return (
isObj(v) &&
hasProp(v, '$type') &&
v.$type === 'app.bsky.graph.defs#listViewerState'
)
}
export function validateListViewerState(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.defs#listViewerState', 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,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 AppBskyGraphDefs from './defs'
export interface QueryParams {
list: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
list: AppBskyGraphDefs.ListView
items: AppBskyGraphDefs.ListItemView[]
[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 AppBskyGraphDefs from './defs'
export interface QueryParams {
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
lists: AppBskyGraphDefs.ListView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
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 AppBskyGraphDefs from './defs'
export interface QueryParams {
actor: string
limit: number
cursor?: string
}
export type InputSchema = undefined
export interface OutputSchema {
cursor?: string
lists: AppBskyGraphDefs.ListView[]
[k: string]: unknown
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
}
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,32 @@
/**
* 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 AppBskyGraphDefs from './defs'
import * as AppBskyRichtextFacet from '../richtext/facet'
export interface Record {
purpose: AppBskyGraphDefs.ListPurpose
name: string
description?: string
descriptionFacets?: AppBskyRichtextFacet.Main[]
avatar?: BlobRef
createdAt: string
[k: string]: unknown
}
export function isRecord(v: unknown): v is Record {
return (
isObj(v) &&
hasProp(v, '$type') &&
(v.$type === 'app.bsky.graph.list#main' ||
v.$type === 'app.bsky.graph.list')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.list#main', 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'
export interface Record {
subject: string
list: 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.listitem#main' ||
v.$type === 'app.bsky.graph.listitem')
)
}
export function validateRecord(v: unknown): ValidationResult {
return lexicons.validate('app.bsky.graph.listitem#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 {
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 {
list: 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,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 {
list: 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,382 @@
/**
* 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
invitesDisabled?: boolean
[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[]
invitesDisabled?: boolean
[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,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 {
account: 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 {
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,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 {
account: 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,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'
import * as ComAtprotoAdminDefs from './defs'
export interface QueryParams {
subject?: string
resolved?: boolean
actionType?:
| 'com.atproto.admin.defs#takedown'
| 'com.atproto.admin.defs#flag'
| 'com.atproto.admin.defs#acknowledge'
| 'com.atproto.admin.defs#escalate'
| (string & {})
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)
}

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