From 7421e718fc8516570a16284f9dc49261eba6d4c8 Mon Sep 17 00:00:00 2001 From: dholms Date: Wed, 10 May 2023 09:56:30 -0500 Subject: [PATCH] feed generator starter kit --- .gitignore | 1 + .prettierrc | 14 + README.md | 147 + package.json | 27 + src/db/index.ts | 30 + src/feed-generation.ts | 54 + src/index.ts | 10 + src/lexicon/index.ts | 947 +++ src/lexicon/lexicons.ts | 5513 +++++++++++++++++ src/lexicon/types/app/bsky/actor/defs.ts | 134 + .../types/app/bsky/actor/getProfile.ts | 37 + .../types/app/bsky/actor/getProfiles.ts | 42 + .../types/app/bsky/actor/getSuggestions.ts | 44 + src/lexicon/types/app/bsky/actor/profile.ts | 28 + .../types/app/bsky/actor/searchActors.ts | 45 + .../app/bsky/actor/searchActorsTypeahead.ts | 43 + src/lexicon/types/app/bsky/embed/external.ts | 82 + src/lexicon/types/app/bsky/embed/images.ts | 75 + src/lexicon/types/app/bsky/embed/record.ts | 113 + .../types/app/bsky/embed/recordWithMedia.ts | 53 + .../types/app/bsky/feed/bookmarkFeed.ts | 35 + src/lexicon/types/app/bsky/feed/defs.ts | 241 + .../types/app/bsky/feed/getAuthorFeed.ts | 46 + .../types/app/bsky/feed/getBookmarkedFeeds.ts | 44 + src/lexicon/types/app/bsky/feed/getFeed.ts | 45 + .../types/app/bsky/feed/getFeedSkeleton.ts | 45 + src/lexicon/types/app/bsky/feed/getLikes.ts | 65 + .../types/app/bsky/feed/getPostThread.ts | 48 + src/lexicon/types/app/bsky/feed/getPosts.ts | 42 + .../types/app/bsky/feed/getRepostedBy.ts | 48 + .../types/app/bsky/feed/getTimeline.ts | 45 + src/lexicon/types/app/bsky/feed/like.ts | 26 + src/lexicon/types/app/bsky/feed/post.ts | 95 + src/lexicon/types/app/bsky/feed/repost.ts | 27 + .../types/app/bsky/feed/unbookmarkFeed.ts | 35 + src/lexicon/types/app/bsky/graph/block.ts | 26 + src/lexicon/types/app/bsky/graph/follow.ts | 26 + src/lexicon/types/app/bsky/graph/getBlocks.ts | 44 + .../types/app/bsky/graph/getFollowers.ts | 46 + .../types/app/bsky/graph/getFollows.ts | 46 + src/lexicon/types/app/bsky/graph/getMutes.ts | 44 + src/lexicon/types/app/bsky/graph/muteActor.ts | 35 + .../types/app/bsky/graph/unmuteActor.ts | 35 + .../app/bsky/notification/getUnreadCount.ts | 41 + .../bsky/notification/listNotifications.ts | 82 + .../types/app/bsky/notification/updateSeen.ts | 35 + src/lexicon/types/app/bsky/richtext/facet.ts | 81 + .../types/app/bsky/unspecced/getPopular.ts | 45 + src/lexicon/types/com/atproto/admin/defs.ts | 380 ++ .../com/atproto/admin/disableInviteCodes.ts | 36 + .../types/com/atproto/admin/getInviteCodes.ts | 45 + .../com/atproto/admin/getModerationAction.ts | 37 + .../com/atproto/admin/getModerationActions.ts | 45 + .../com/atproto/admin/getModerationReport.ts | 37 + .../com/atproto/admin/getModerationReports.ts | 46 + .../types/com/atproto/admin/getRecord.ts | 38 + .../types/com/atproto/admin/getRepo.ts | 37 + .../atproto/admin/resolveModerationReports.ts | 45 + .../atproto/admin/reverseModerationAction.ts | 45 + .../types/com/atproto/admin/searchRepos.ts | 46 + .../com/atproto/admin/takeModerationAction.ts | 58 + .../com/atproto/admin/updateAccountEmail.ts | 37 + .../com/atproto/admin/updateAccountHandle.ts | 36 + .../com/atproto/identity/resolveHandle.ts | 42 + .../com/atproto/identity/updateHandle.ts | 35 + src/lexicon/types/com/atproto/label/defs.ts | 36 + .../types/com/atproto/label/queryLabels.ts | 48 + .../com/atproto/label/subscribeLabels.ts | 64 + .../com/atproto/moderation/createReport.ts | 61 + .../types/com/atproto/moderation/defs.ts | 29 + .../types/com/atproto/repo/applyWrites.ts | 100 + .../types/com/atproto/repo/createRecord.ts | 58 + .../types/com/atproto/repo/deleteRecord.ts | 45 + .../types/com/atproto/repo/describeRepo.ts | 46 + .../types/com/atproto/repo/getRecord.ts | 50 + .../types/com/atproto/repo/listRecords.ts | 73 + .../types/com/atproto/repo/putRecord.ts | 60 + .../types/com/atproto/repo/strongRef.ts | 26 + .../types/com/atproto/repo/uploadBlob.ts | 43 + .../types/com/atproto/server/createAccount.ts | 58 + .../com/atproto/server/createAppPassword.ts | 65 + .../com/atproto/server/createInviteCode.ts | 46 + .../com/atproto/server/createInviteCodes.ts | 68 + .../types/com/atproto/server/createSession.ts | 52 + src/lexicon/types/com/atproto/server/defs.ts | 48 + .../types/com/atproto/server/deleteAccount.ts | 38 + .../types/com/atproto/server/deleteSession.ts | 28 + .../com/atproto/server/describeServer.ts | 59 + .../atproto/server/getAccountInviteCodes.ts | 44 + .../types/com/atproto/server/getSession.ts | 41 + .../com/atproto/server/listAppPasswords.ts | 58 + .../com/atproto/server/refreshSession.ts | 43 + .../atproto/server/requestAccountDelete.ts | 28 + .../atproto/server/requestPasswordReset.ts | 35 + .../types/com/atproto/server/resetPassword.ts | 37 + .../com/atproto/server/revokeAppPassword.ts | 35 + src/lexicon/types/com/atproto/sync/getBlob.ts | 39 + .../types/com/atproto/sync/getBlocks.ts | 38 + .../types/com/atproto/sync/getCheckout.ts | 39 + .../types/com/atproto/sync/getCommitPath.ts | 46 + src/lexicon/types/com/atproto/sync/getHead.ts | 42 + .../types/com/atproto/sync/getRecord.ts | 41 + src/lexicon/types/com/atproto/sync/getRepo.ts | 41 + .../types/com/atproto/sync/listBlobs.ts | 46 + .../types/com/atproto/sync/listRepos.ts | 61 + .../types/com/atproto/sync/notifyOfUpdate.ts | 31 + .../types/com/atproto/sync/requestCrawl.ts | 31 + .../types/com/atproto/sync/subscribeRepos.ts | 153 + src/lexicon/util.ts | 13 + src/server.ts | 69 + src/subscription.ts | 60 + src/util/subscription.ts | 124 + test.sqlite | 0 yarn.lock | 1231 ++++ 114 files changed, 13584 insertions(+) create mode 100644 .gitignore create mode 100644 .prettierrc create mode 100644 README.md create mode 100644 package.json create mode 100644 src/db/index.ts create mode 100644 src/feed-generation.ts create mode 100644 src/index.ts create mode 100644 src/lexicon/index.ts create mode 100644 src/lexicon/lexicons.ts create mode 100644 src/lexicon/types/app/bsky/actor/defs.ts create mode 100644 src/lexicon/types/app/bsky/actor/getProfile.ts create mode 100644 src/lexicon/types/app/bsky/actor/getProfiles.ts create mode 100644 src/lexicon/types/app/bsky/actor/getSuggestions.ts create mode 100644 src/lexicon/types/app/bsky/actor/profile.ts create mode 100644 src/lexicon/types/app/bsky/actor/searchActors.ts create mode 100644 src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts create mode 100644 src/lexicon/types/app/bsky/embed/external.ts create mode 100644 src/lexicon/types/app/bsky/embed/images.ts create mode 100644 src/lexicon/types/app/bsky/embed/record.ts create mode 100644 src/lexicon/types/app/bsky/embed/recordWithMedia.ts create mode 100644 src/lexicon/types/app/bsky/feed/bookmarkFeed.ts create mode 100644 src/lexicon/types/app/bsky/feed/defs.ts create mode 100644 src/lexicon/types/app/bsky/feed/getAuthorFeed.ts create mode 100644 src/lexicon/types/app/bsky/feed/getBookmarkedFeeds.ts create mode 100644 src/lexicon/types/app/bsky/feed/getFeed.ts create mode 100644 src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts create mode 100644 src/lexicon/types/app/bsky/feed/getLikes.ts create mode 100644 src/lexicon/types/app/bsky/feed/getPostThread.ts create mode 100644 src/lexicon/types/app/bsky/feed/getPosts.ts create mode 100644 src/lexicon/types/app/bsky/feed/getRepostedBy.ts create mode 100644 src/lexicon/types/app/bsky/feed/getTimeline.ts create mode 100644 src/lexicon/types/app/bsky/feed/like.ts create mode 100644 src/lexicon/types/app/bsky/feed/post.ts create mode 100644 src/lexicon/types/app/bsky/feed/repost.ts create mode 100644 src/lexicon/types/app/bsky/feed/unbookmarkFeed.ts create mode 100644 src/lexicon/types/app/bsky/graph/block.ts create mode 100644 src/lexicon/types/app/bsky/graph/follow.ts create mode 100644 src/lexicon/types/app/bsky/graph/getBlocks.ts create mode 100644 src/lexicon/types/app/bsky/graph/getFollowers.ts create mode 100644 src/lexicon/types/app/bsky/graph/getFollows.ts create mode 100644 src/lexicon/types/app/bsky/graph/getMutes.ts create mode 100644 src/lexicon/types/app/bsky/graph/muteActor.ts create mode 100644 src/lexicon/types/app/bsky/graph/unmuteActor.ts create mode 100644 src/lexicon/types/app/bsky/notification/getUnreadCount.ts create mode 100644 src/lexicon/types/app/bsky/notification/listNotifications.ts create mode 100644 src/lexicon/types/app/bsky/notification/updateSeen.ts create mode 100644 src/lexicon/types/app/bsky/richtext/facet.ts create mode 100644 src/lexicon/types/app/bsky/unspecced/getPopular.ts create mode 100644 src/lexicon/types/com/atproto/admin/defs.ts create mode 100644 src/lexicon/types/com/atproto/admin/disableInviteCodes.ts create mode 100644 src/lexicon/types/com/atproto/admin/getInviteCodes.ts create mode 100644 src/lexicon/types/com/atproto/admin/getModerationAction.ts create mode 100644 src/lexicon/types/com/atproto/admin/getModerationActions.ts create mode 100644 src/lexicon/types/com/atproto/admin/getModerationReport.ts create mode 100644 src/lexicon/types/com/atproto/admin/getModerationReports.ts create mode 100644 src/lexicon/types/com/atproto/admin/getRecord.ts create mode 100644 src/lexicon/types/com/atproto/admin/getRepo.ts create mode 100644 src/lexicon/types/com/atproto/admin/resolveModerationReports.ts create mode 100644 src/lexicon/types/com/atproto/admin/reverseModerationAction.ts create mode 100644 src/lexicon/types/com/atproto/admin/searchRepos.ts create mode 100644 src/lexicon/types/com/atproto/admin/takeModerationAction.ts create mode 100644 src/lexicon/types/com/atproto/admin/updateAccountEmail.ts create mode 100644 src/lexicon/types/com/atproto/admin/updateAccountHandle.ts create mode 100644 src/lexicon/types/com/atproto/identity/resolveHandle.ts create mode 100644 src/lexicon/types/com/atproto/identity/updateHandle.ts create mode 100644 src/lexicon/types/com/atproto/label/defs.ts create mode 100644 src/lexicon/types/com/atproto/label/queryLabels.ts create mode 100644 src/lexicon/types/com/atproto/label/subscribeLabels.ts create mode 100644 src/lexicon/types/com/atproto/moderation/createReport.ts create mode 100644 src/lexicon/types/com/atproto/moderation/defs.ts create mode 100644 src/lexicon/types/com/atproto/repo/applyWrites.ts create mode 100644 src/lexicon/types/com/atproto/repo/createRecord.ts create mode 100644 src/lexicon/types/com/atproto/repo/deleteRecord.ts create mode 100644 src/lexicon/types/com/atproto/repo/describeRepo.ts create mode 100644 src/lexicon/types/com/atproto/repo/getRecord.ts create mode 100644 src/lexicon/types/com/atproto/repo/listRecords.ts create mode 100644 src/lexicon/types/com/atproto/repo/putRecord.ts create mode 100644 src/lexicon/types/com/atproto/repo/strongRef.ts create mode 100644 src/lexicon/types/com/atproto/repo/uploadBlob.ts create mode 100644 src/lexicon/types/com/atproto/server/createAccount.ts create mode 100644 src/lexicon/types/com/atproto/server/createAppPassword.ts create mode 100644 src/lexicon/types/com/atproto/server/createInviteCode.ts create mode 100644 src/lexicon/types/com/atproto/server/createInviteCodes.ts create mode 100644 src/lexicon/types/com/atproto/server/createSession.ts create mode 100644 src/lexicon/types/com/atproto/server/defs.ts create mode 100644 src/lexicon/types/com/atproto/server/deleteAccount.ts create mode 100644 src/lexicon/types/com/atproto/server/deleteSession.ts create mode 100644 src/lexicon/types/com/atproto/server/describeServer.ts create mode 100644 src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts create mode 100644 src/lexicon/types/com/atproto/server/getSession.ts create mode 100644 src/lexicon/types/com/atproto/server/listAppPasswords.ts create mode 100644 src/lexicon/types/com/atproto/server/refreshSession.ts create mode 100644 src/lexicon/types/com/atproto/server/requestAccountDelete.ts create mode 100644 src/lexicon/types/com/atproto/server/requestPasswordReset.ts create mode 100644 src/lexicon/types/com/atproto/server/resetPassword.ts create mode 100644 src/lexicon/types/com/atproto/server/revokeAppPassword.ts create mode 100644 src/lexicon/types/com/atproto/sync/getBlob.ts create mode 100644 src/lexicon/types/com/atproto/sync/getBlocks.ts create mode 100644 src/lexicon/types/com/atproto/sync/getCheckout.ts create mode 100644 src/lexicon/types/com/atproto/sync/getCommitPath.ts create mode 100644 src/lexicon/types/com/atproto/sync/getHead.ts create mode 100644 src/lexicon/types/com/atproto/sync/getRecord.ts create mode 100644 src/lexicon/types/com/atproto/sync/getRepo.ts create mode 100644 src/lexicon/types/com/atproto/sync/listBlobs.ts create mode 100644 src/lexicon/types/com/atproto/sync/listRepos.ts create mode 100644 src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts create mode 100644 src/lexicon/types/com/atproto/sync/requestCrawl.ts create mode 100644 src/lexicon/types/com/atproto/sync/subscribeRepos.ts create mode 100644 src/lexicon/util.ts create mode 100644 src/server.ts create mode 100644 src/subscription.ts create mode 100644 src/util/subscription.ts create mode 100644 test.sqlite create mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..078e423 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,14 @@ +{ + "trailingComma": "all", + "tabWidth": 2, + "semi": false, + "singleQuote": true, + "overrides": [ + { + "files": "*.hbs", + "options": { + "singleQuote": false + } + } + ] +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..d3f6855 --- /dev/null +++ b/README.md @@ -0,0 +1,147 @@ +# ATProto Feed Generator + +🚧 Work in Progress 🚧 + +We are actively developing Feed Generator integration into the Bluesky PDS. Though we are reasonably confident about the general shape and interfaces laid out here, these interfaces and implementation details _are_ subject to change. + +We've put together a starter kit for devs. It doesn't do everything, but it should be enough to get you familiar with the system & started building! + +## Overview + +Feed Generators are services that provide custom algorithms to users through the AT protocol. + +They work very simply: the server receives a request from a user's server and returns a list of [post URIs](https://atproto.com/specs/at-uri-scheme) with some optional metadata attached. Those posts are then "hydrated" into full objects by the requesting server and sent back to the client. This route is described in the `com.atproto.feed.getFeedSkeleton` lexicon. (@TODO insert link) + +Think of Feed Generators like a user with an API attached. Like atproto users, a Feed Generator is identified by a DID/handle and uses a data repository which holds information like its profile. However, a Feed Generator's DID Document also declares a `#bsky_fg` service endpoint that fulfills the interface for a Feed Generator. + +The general flow of providing a custom algorithm to a user is as follows: +- A user requests a feed from their server (PDS). Let's say the feed is identified by `@custom-algo.xyz` +- The PDS resolves `@custom-algo.xyz` to its corresponding DID document +- The PDS sends a `getFeedSkeleton` request to the service endpoint with ID `#bsky_fg` + - This request is authenticated by a JWT signed by the user's repo signing key +- The Feed Generator returns a skeleton of the feed to the user's PDS +- The PDS hydrates the feed (user info, post contents, aggregates, etc) + - In the future, the PDS will hydrate the feed with the help of an App View, but for now the PDS handles hydration itself +- The PDS returns the hydrated feed to the user + +To the user this should feel like visiting a page in the app. Once they subscribe, it will appear in their home interface as one of their available feeds. + +## Getting Started + +For now, your algorithm will need to have an account & repository on the `bsky.social` PDS. + +First, edit the provided `setup.json` to include your preferred handle, password & invite code, along with the hostname that you will be running this server at. Then run with `yarn setup`. + +If you need an invite code, please reach out to a Bluesky team member & inform them that you are building a Feed Generator + +Note: _do not_ use your handle/password from you personal bluesky account. This is a _new account_ for the Feed Generator. + +We've setup this simple server with sqlite to store & query data. Feel free to switch this out for whichever database you prefer. + +Next you will need to do two things: + +- Implement indexing logic in `src/subscription.ts`. + +This will subscribe to the repo subscription stream on startup, parse event & index them according to your provided logic + +- Implement feed generation logic in `src/feed-generation.ts` + +The types are in place and you will just need to return something that satisfies the `SkeletonFeedPost[]` type + +For inspiration, we've provided a very simple feed algorithm that returns recent posts from the Bluesky team. + +## Some Details + +### Skeleton Metadata + +The skeleton that a Feed Generator puts together is, in its simplest form, a list of post uris. + +```ts +[ + {post: 'at://did:example:1234/app.bsky.feed.post/1'}, + {post: 'at://did:example:1234/app.bsky.feed.post/2'}, + {post: 'at://did:example:1234/app.bsky.feed.post/3'} +] +``` + +However, we include two locations to attach some additional context. Here is the full schema: + +```ts +type SkeletonItem = { + post: string // post URI + + // optional metadata about the thread that this post is in reply to + replyTo?: { + root: string, // reply root URI + parent: string, // reply parent URI + } + + // optional reason for inclusion in the feed + // (generally to be displayed in client) + reason?: Reason +} + +// for now, the only defined reason is a repost, but this is open to extension +type Reason = ReasonRepost + +type ReasonRepost = { + $type: @TODO + by: string // the did of the reposting user + indexedAt: string // the time that the repost took place +} +``` + +This metadata serves two purposes: + +1. To aid the PDS in hydrating all relevant post information +2. To give a cue to the client in terms of context to display when rendering a post + +### Authentication + +If you are creating a generic feed that does not differ for different users, you do not need to check auth. But if a user's state (such as follows or likes) is taken into account, we _strongly_ encourage you to validate their auth token. + +Users are authenticated with a simple JWT signed by the user's repo signing key. + +This JWT header/payload takes the format: +```ts +const header = { + type: "JWT", + alg: "ES256K" // (key algorithm) - in this case secp256k1 +} +const payload = { + iss: "did:example:alice", // (issuer) the requesting user's DID + aud: "did:example:feedGenerator", // (audience) the DID of the Feed Generator + exp: 1683643619 // (expiration) unix timestamp in seconds +} +``` + +We provide utilities for verifying user JWTs in `@TODO_PACKAGE` + +### Pagination +You'll notice that the `getFeedSkeleton` method returns a `cursor` in its response & takes a `cursor` param as input. + +This cursor is treated as an opaque value & fully at the Feed Generator's discretion. It is simply pased through he PDS directly to & from the client. + +We strongly encourage that the cursor be _unique per feed item_ to prevent unexpected behavior in pagination. + +We recommend, for instance, a compound cursor with a timestamp + a CID: +`1683654690921::bafyreia3tbsfxe3cc75xrxyyn6qc42oupi73fxiox76prlyi5bpx7hr72u` + +## Suggestions for Implementation + +How a feed generator fulfills the `getFeedSkeleton` request is completely at their discretion. At the simplest end, a Feed Generator could supply a "feed" that only contains some hardcoded posts. + +For most usecases, we recommend subscribing to the firehose at `com.atproto.sync.subscribeRepos`. This websocket will send you every record that is published on the network. Since Feed Generators do not need to provide hydrated posts, you can index as much or as little of the firehose as necessary. + +Depending on your algorithm, you likely do not need to keep posts around for long. Unless your algorithm is intended to provide "posts you missed" or something similar, you can likely garbage collect any data that is older than 48 hours. + +Some examples: + +### Reimplementing What's Hot +To reimplement "What's Hot", you may subscribe to the firehose & filter for all posts & likes (ignoring profiles/reposts/follows/etc). You would keep a running tally of likes per post & when a PDS requests a feed, you would send the most recent posts that pass some threshold of likes. + +### A Community Feed +You might create a feed for a given community by compiling a list of DIDs within that community & filtering the firehose for all posts from users within that list. + +### A Topical Feed +To implement a topical feed, you might filter the algorithm for posts and pass the post text through some filtering mechanism (an LLM, a keyword matcher, etc) that filters for the topic of your choice. diff --git a/package.json b/package.json new file mode 100644 index 0000000..cf61c16 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "feed-generator", + "version": "1.0.0", + "description": "atproto feed generator starter kit", + "main": "index.js", + "repository": "git@github.com:bluesky-social/feed-generator.git", + "author": "dholms ", + "license": "MIT", + "scripts": { + "start": "ts-node src/index.ts" + }, + "dependencies": { + "@atproto/repo": "^0.1.0", + "@atproto/uri": "^0.0.2", + "@atproto/xrpc-server": "^0.1.0", + "better-sqlite3": "^8.3.0", + "express": "^4.18.2", + "kysely": "^0.22.0" + }, + "devDependencies": { + "@types/better-sqlite3": "^7.6.4", + "@types/express": "^4.17.17", + "@types/node": "^20.1.1", + "ts-node": "^10.9.1", + "typescript": "^5.0.4" + } +} diff --git a/src/db/index.ts b/src/db/index.ts new file mode 100644 index 0000000..3c269ad --- /dev/null +++ b/src/db/index.ts @@ -0,0 +1,30 @@ +import { Kysely, SqliteDialect } from 'kysely' +import SqliteDb from 'better-sqlite3' + +export const createDb = (location: string): Database => { + return new Kysely({ + dialect: new SqliteDialect({ + database: new SqliteDb(location), + }), + }) +} + +export type Database = Kysely + +export type PostTable = { + uri: string + cid: string + replyParent: string | null + replyRoot: string | null + indexedAt: string +} + +export type SubStateTable = { + service: string + cursor: number +} + +export type DatabaseSchema = { + posts: PostTable + sub_state: SubStateTable +} diff --git a/src/feed-generation.ts b/src/feed-generation.ts new file mode 100644 index 0000000..30b9fd8 --- /dev/null +++ b/src/feed-generation.ts @@ -0,0 +1,54 @@ +import { InvalidRequestError } from '@atproto/xrpc-server' +import { Database } from './db' +import { Server } from './lexicon' + +export default function (server: Server, db: Database) { + server.app.bsky.feed.getFeedSkeleton(async ({ params, auth }) => { + if (params.feed !== 'alf.bsky.social') { + throw new InvalidRequestError('algorithm unsupported') + } + let builder = db + .selectFrom('posts') + .selectAll() + .orderBy('indexedAt', 'desc') + .orderBy('cid', 'desc') + + if (params.cursor) { + const [indexedAt, cid] = params.cursor.split('..') + if (!indexedAt || !cid) { + throw new InvalidRequestError('malformed cursor') + } + const timeStr = new Date(parseInt(indexedAt, 10)).toISOString() + builder = builder + .where('posts.indexedAt', '<', timeStr) + .orWhere((qb) => qb.where('posts.indexedAt', '=', timeStr)) + .where('posts.cid', '<', cid) + } + const res = await builder.execute() + + const feed = res.map((row) => ({ + post: row.uri, + replyTo: + row.replyParent && row.replyRoot + ? { + root: row.replyRoot, + parent: row.replyParent, + } + : undefined, + })) + + let cursor: string | undefined + const last = res.at(-1) + if (last) { + cursor = `${new Date(last.indexedAt).getTime()}::${last.cid}` + } + + return { + encoding: 'application/json', + body: { + cursor, + feed, + }, + } + }) +} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..b8bbe81 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,10 @@ +import FeedGenerator from './server' + +const run = async () => { + // we'll add .env soon + const server = FeedGenerator.create() + await server.start() + console.log(`🤖 running feed generator at localhost${server.cfg.port}`) +} + +run() diff --git a/src/lexicon/index.ts b/src/lexicon/index.ts new file mode 100644 index 0000000..0fe1132 --- /dev/null +++ b/src/lexicon/index.ts @@ -0,0 +1,947 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { + createServer as createXrpcServer, + Server as XrpcServer, + Options as XrpcOptions, + AuthVerifier, + StreamAuthVerifier, +} from '@atproto/xrpc-server' +import { schemas } from './lexicons' +import * as ComAtprotoAdminDisableInviteCodes from './types/com/atproto/admin/disableInviteCodes' +import * as ComAtprotoAdminGetInviteCodes from './types/com/atproto/admin/getInviteCodes' +import * as ComAtprotoAdminGetModerationAction from './types/com/atproto/admin/getModerationAction' +import * as ComAtprotoAdminGetModerationActions from './types/com/atproto/admin/getModerationActions' +import * as ComAtprotoAdminGetModerationReport from './types/com/atproto/admin/getModerationReport' +import * as ComAtprotoAdminGetModerationReports from './types/com/atproto/admin/getModerationReports' +import * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord' +import * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo' +import * as ComAtprotoAdminResolveModerationReports from './types/com/atproto/admin/resolveModerationReports' +import * as ComAtprotoAdminReverseModerationAction from './types/com/atproto/admin/reverseModerationAction' +import * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos' +import * as ComAtprotoAdminTakeModerationAction from './types/com/atproto/admin/takeModerationAction' +import * as ComAtprotoAdminUpdateAccountEmail from './types/com/atproto/admin/updateAccountEmail' +import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/updateAccountHandle' +import * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle' +import * as ComAtprotoIdentityUpdateHandle from './types/com/atproto/identity/updateHandle' +import * as ComAtprotoLabelQueryLabels from './types/com/atproto/label/queryLabels' +import * as ComAtprotoLabelSubscribeLabels from './types/com/atproto/label/subscribeLabels' +import * as ComAtprotoModerationCreateReport from './types/com/atproto/moderation/createReport' +import * as ComAtprotoRepoApplyWrites from './types/com/atproto/repo/applyWrites' +import * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord' +import * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord' +import * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRepo' +import * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord' +import * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords' +import * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord' +import * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob' +import * as ComAtprotoServerCreateAccount from './types/com/atproto/server/createAccount' +import * as ComAtprotoServerCreateAppPassword from './types/com/atproto/server/createAppPassword' +import * as ComAtprotoServerCreateInviteCode from './types/com/atproto/server/createInviteCode' +import * as ComAtprotoServerCreateInviteCodes from './types/com/atproto/server/createInviteCodes' +import * as ComAtprotoServerCreateSession from './types/com/atproto/server/createSession' +import * as ComAtprotoServerDeleteAccount from './types/com/atproto/server/deleteAccount' +import * as ComAtprotoServerDeleteSession from './types/com/atproto/server/deleteSession' +import * as ComAtprotoServerDescribeServer from './types/com/atproto/server/describeServer' +import * as ComAtprotoServerGetAccountInviteCodes from './types/com/atproto/server/getAccountInviteCodes' +import * as ComAtprotoServerGetSession from './types/com/atproto/server/getSession' +import * as ComAtprotoServerListAppPasswords from './types/com/atproto/server/listAppPasswords' +import * as ComAtprotoServerRefreshSession from './types/com/atproto/server/refreshSession' +import * as ComAtprotoServerRequestAccountDelete from './types/com/atproto/server/requestAccountDelete' +import * as ComAtprotoServerRequestPasswordReset from './types/com/atproto/server/requestPasswordReset' +import * as ComAtprotoServerResetPassword from './types/com/atproto/server/resetPassword' +import * as ComAtprotoServerRevokeAppPassword from './types/com/atproto/server/revokeAppPassword' +import * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob' +import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks' +import * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout' +import * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommitPath' +import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead' +import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord' +import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo' +import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs' +import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos' +import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate' +import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl' +import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos' +import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile' +import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles' +import * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions' +import * as AppBskyActorSearchActors from './types/app/bsky/actor/searchActors' +import * as AppBskyActorSearchActorsTypeahead from './types/app/bsky/actor/searchActorsTypeahead' +import * as AppBskyFeedBookmarkFeed from './types/app/bsky/feed/bookmarkFeed' +import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed' +import * as AppBskyFeedGetBookmarkedFeeds from './types/app/bsky/feed/getBookmarkedFeeds' +import * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed' +import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton' +import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes' +import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread' +import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts' +import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy' +import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline' +import * as AppBskyFeedUnbookmarkFeed from './types/app/bsky/feed/unbookmarkFeed' +import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks' +import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers' +import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows' +import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes' +import * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor' +import * as AppBskyGraphUnmuteActor from './types/app/bsky/graph/unmuteActor' +import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notification/getUnreadCount' +import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications' +import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen' +import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular' + +export const COM_ATPROTO_ADMIN = { + DefsTakedown: 'com.atproto.admin.defs#takedown', + DefsFlag: 'com.atproto.admin.defs#flag', + DefsAcknowledge: 'com.atproto.admin.defs#acknowledge', + DefsEscalate: 'com.atproto.admin.defs#escalate', +} +export const COM_ATPROTO_MODERATION = { + DefsReasonSpam: 'com.atproto.moderation.defs#reasonSpam', + DefsReasonViolation: 'com.atproto.moderation.defs#reasonViolation', + DefsReasonMisleading: 'com.atproto.moderation.defs#reasonMisleading', + DefsReasonSexual: 'com.atproto.moderation.defs#reasonSexual', + DefsReasonRude: 'com.atproto.moderation.defs#reasonRude', + DefsReasonOther: 'com.atproto.moderation.defs#reasonOther', +} +export const APP_BSKY_ACTOR = { + DefsUser: 'app.bsky.actor.defs#user', + DefsFeedGenerator: 'app.bsky.actor.defs#feedGenerator', +} + +export function createServer(options?: XrpcOptions): Server { + return new Server(options) +} + +export class Server { + xrpc: XrpcServer + com: ComNS + app: AppNS + + constructor(options?: XrpcOptions) { + this.xrpc = createXrpcServer(schemas, options) + this.com = new ComNS(this) + this.app = new AppNS(this) + } +} + +export class ComNS { + _server: Server + atproto: AtprotoNS + + constructor(server: Server) { + this._server = server + this.atproto = new AtprotoNS(server) + } +} + +export class AtprotoNS { + _server: Server + admin: AdminNS + identity: IdentityNS + label: LabelNS + moderation: ModerationNS + repo: RepoNS + server: ServerNS + sync: SyncNS + + constructor(server: Server) { + this._server = server + this.admin = new AdminNS(server) + this.identity = new IdentityNS(server) + this.label = new LabelNS(server) + this.moderation = new ModerationNS(server) + this.repo = new RepoNS(server) + this.server = new ServerNS(server) + this.sync = new SyncNS(server) + } +} + +export class AdminNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + disableInviteCodes( + cfg: ConfigOf< + AV, + ComAtprotoAdminDisableInviteCodes.Handler> + >, + ) { + const nsid = 'com.atproto.admin.disableInviteCodes' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getInviteCodes( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.admin.getInviteCodes' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getModerationAction( + cfg: ConfigOf< + AV, + ComAtprotoAdminGetModerationAction.Handler> + >, + ) { + const nsid = 'com.atproto.admin.getModerationAction' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getModerationActions( + cfg: ConfigOf< + AV, + ComAtprotoAdminGetModerationActions.Handler> + >, + ) { + const nsid = 'com.atproto.admin.getModerationActions' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getModerationReport( + cfg: ConfigOf< + AV, + ComAtprotoAdminGetModerationReport.Handler> + >, + ) { + const nsid = 'com.atproto.admin.getModerationReport' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getModerationReports( + cfg: ConfigOf< + AV, + ComAtprotoAdminGetModerationReports.Handler> + >, + ) { + const nsid = 'com.atproto.admin.getModerationReports' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getRecord( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.admin.getRecord' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getRepo( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.admin.getRepo' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + resolveModerationReports( + cfg: ConfigOf< + AV, + ComAtprotoAdminResolveModerationReports.Handler> + >, + ) { + const nsid = 'com.atproto.admin.resolveModerationReports' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + reverseModerationAction( + cfg: ConfigOf< + AV, + ComAtprotoAdminReverseModerationAction.Handler> + >, + ) { + const nsid = 'com.atproto.admin.reverseModerationAction' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + searchRepos( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.admin.searchRepos' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + takeModerationAction( + cfg: ConfigOf< + AV, + ComAtprotoAdminTakeModerationAction.Handler> + >, + ) { + const nsid = 'com.atproto.admin.takeModerationAction' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + updateAccountEmail( + cfg: ConfigOf< + AV, + ComAtprotoAdminUpdateAccountEmail.Handler> + >, + ) { + const nsid = 'com.atproto.admin.updateAccountEmail' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + updateAccountHandle( + cfg: ConfigOf< + AV, + ComAtprotoAdminUpdateAccountHandle.Handler> + >, + ) { + const nsid = 'com.atproto.admin.updateAccountHandle' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +export class IdentityNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + resolveHandle( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.identity.resolveHandle' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + updateHandle( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.identity.updateHandle' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +export class LabelNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + queryLabels( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.label.queryLabels' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + subscribeLabels( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.label.subscribeLabels' // @ts-ignore + return this._server.xrpc.streamMethod(nsid, cfg) + } +} + +export class ModerationNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + createReport( + cfg: ConfigOf< + AV, + ComAtprotoModerationCreateReport.Handler> + >, + ) { + const nsid = 'com.atproto.moderation.createReport' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +export class RepoNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + applyWrites( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.repo.applyWrites' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + createRecord( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.repo.createRecord' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + deleteRecord( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.repo.deleteRecord' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + describeRepo( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.repo.describeRepo' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getRecord( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.repo.getRecord' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + listRecords( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.repo.listRecords' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + putRecord( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.repo.putRecord' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + uploadBlob( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.repo.uploadBlob' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +export class ServerNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + createAccount( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.server.createAccount' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + createAppPassword( + cfg: ConfigOf< + AV, + ComAtprotoServerCreateAppPassword.Handler> + >, + ) { + const nsid = 'com.atproto.server.createAppPassword' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + createInviteCode( + cfg: ConfigOf< + AV, + ComAtprotoServerCreateInviteCode.Handler> + >, + ) { + const nsid = 'com.atproto.server.createInviteCode' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + createInviteCodes( + cfg: ConfigOf< + AV, + ComAtprotoServerCreateInviteCodes.Handler> + >, + ) { + const nsid = 'com.atproto.server.createInviteCodes' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + createSession( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.server.createSession' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + deleteAccount( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.server.deleteAccount' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + deleteSession( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.server.deleteSession' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + describeServer( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.server.describeServer' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getAccountInviteCodes( + cfg: ConfigOf< + AV, + ComAtprotoServerGetAccountInviteCodes.Handler> + >, + ) { + const nsid = 'com.atproto.server.getAccountInviteCodes' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getSession( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.server.getSession' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + listAppPasswords( + cfg: ConfigOf< + AV, + ComAtprotoServerListAppPasswords.Handler> + >, + ) { + const nsid = 'com.atproto.server.listAppPasswords' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + refreshSession( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.server.refreshSession' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + requestAccountDelete( + cfg: ConfigOf< + AV, + ComAtprotoServerRequestAccountDelete.Handler> + >, + ) { + const nsid = 'com.atproto.server.requestAccountDelete' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + requestPasswordReset( + cfg: ConfigOf< + AV, + ComAtprotoServerRequestPasswordReset.Handler> + >, + ) { + const nsid = 'com.atproto.server.requestPasswordReset' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + resetPassword( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.server.resetPassword' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + revokeAppPassword( + cfg: ConfigOf< + AV, + ComAtprotoServerRevokeAppPassword.Handler> + >, + ) { + const nsid = 'com.atproto.server.revokeAppPassword' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +export class SyncNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + getBlob( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.getBlob' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getBlocks( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.getBlocks' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getCheckout( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.getCheckout' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getCommitPath( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.getCommitPath' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getHead( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.getHead' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getRecord( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.getRecord' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getRepo( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.getRepo' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + listBlobs( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.listBlobs' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + listRepos( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.listRepos' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + notifyOfUpdate( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.notifyOfUpdate' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + requestCrawl( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.requestCrawl' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + subscribeRepos( + cfg: ConfigOf>>, + ) { + const nsid = 'com.atproto.sync.subscribeRepos' // @ts-ignore + return this._server.xrpc.streamMethod(nsid, cfg) + } +} + +export class AppNS { + _server: Server + bsky: BskyNS + + constructor(server: Server) { + this._server = server + this.bsky = new BskyNS(server) + } +} + +export class BskyNS { + _server: Server + actor: ActorNS + embed: EmbedNS + feed: FeedNS + graph: GraphNS + notification: NotificationNS + richtext: RichtextNS + unspecced: UnspeccedNS + + constructor(server: Server) { + this._server = server + this.actor = new ActorNS(server) + this.embed = new EmbedNS(server) + this.feed = new FeedNS(server) + this.graph = new GraphNS(server) + this.notification = new NotificationNS(server) + this.richtext = new RichtextNS(server) + this.unspecced = new UnspeccedNS(server) + } +} + +export class ActorNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + getProfile( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.actor.getProfile' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getProfiles( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.actor.getProfiles' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getSuggestions( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.actor.getSuggestions' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + searchActors( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.actor.searchActors' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + searchActorsTypeahead( + cfg: ConfigOf< + AV, + AppBskyActorSearchActorsTypeahead.Handler> + >, + ) { + const nsid = 'app.bsky.actor.searchActorsTypeahead' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +export class EmbedNS { + _server: Server + + constructor(server: Server) { + this._server = server + } +} + +export class FeedNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + bookmarkFeed( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.bookmarkFeed' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getAuthorFeed( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.getAuthorFeed' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getBookmarkedFeeds( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.getBookmarkedFeeds' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getFeed( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.getFeed' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getFeedSkeleton( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.getFeedSkeleton' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getLikes( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.getLikes' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getPostThread( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.getPostThread' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getPosts( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.getPosts' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getRepostedBy( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.getRepostedBy' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getTimeline( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.getTimeline' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + unbookmarkFeed( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.feed.unbookmarkFeed' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +export class GraphNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + getBlocks( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.graph.getBlocks' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getFollowers( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.graph.getFollowers' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getFollows( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.graph.getFollows' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + getMutes( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.graph.getMutes' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + muteActor( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.graph.muteActor' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + unmuteActor( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.graph.unmuteActor' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +export class NotificationNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + getUnreadCount( + cfg: ConfigOf< + AV, + AppBskyNotificationGetUnreadCount.Handler> + >, + ) { + const nsid = 'app.bsky.notification.getUnreadCount' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + listNotifications( + cfg: ConfigOf< + AV, + AppBskyNotificationListNotifications.Handler> + >, + ) { + const nsid = 'app.bsky.notification.listNotifications' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } + + updateSeen( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.notification.updateSeen' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +export class RichtextNS { + _server: Server + + constructor(server: Server) { + this._server = server + } +} + +export class UnspeccedNS { + _server: Server + + constructor(server: Server) { + this._server = server + } + + getPopular( + cfg: ConfigOf>>, + ) { + const nsid = 'app.bsky.unspecced.getPopular' // @ts-ignore + return this._server.xrpc.method(nsid, cfg) + } +} + +type ConfigOf = + | Handler + | { + auth?: Auth + handler: Handler + } +type ExtractAuth = Extract< + Awaited>, + { credentials: unknown } +> diff --git a/src/lexicon/lexicons.ts b/src/lexicon/lexicons.ts new file mode 100644 index 0000000..5e07fae --- /dev/null +++ b/src/lexicon/lexicons.ts @@ -0,0 +1,5513 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { LexiconDoc, Lexicons } from '@atproto/lexicon' + +export const schemaDict = { + ComAtprotoAdminDefs: { + lexicon: 1, + id: 'com.atproto.admin.defs', + defs: { + actionView: { + type: 'object', + required: [ + 'id', + 'action', + 'subject', + 'subjectBlobCids', + 'reason', + 'createdBy', + 'createdAt', + 'resolvedReportIds', + ], + properties: { + id: { + type: 'integer', + }, + action: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionType', + }, + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoRef', + 'lex:com.atproto.repo.strongRef', + ], + }, + subjectBlobCids: { + type: 'array', + items: { + type: 'string', + }, + }, + createLabelVals: { + type: 'array', + items: { + type: 'string', + }, + }, + negateLabelVals: { + type: 'array', + items: { + type: 'string', + }, + }, + reason: { + type: 'string', + }, + createdBy: { + type: 'string', + format: 'did', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + reversal: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionReversal', + }, + resolvedReportIds: { + type: 'array', + items: { + type: 'integer', + }, + }, + }, + }, + actionViewDetail: { + type: 'object', + required: [ + 'id', + 'action', + 'subject', + 'subjectBlobs', + 'reason', + 'createdBy', + 'createdAt', + 'resolvedReports', + ], + properties: { + id: { + type: 'integer', + }, + action: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionType', + }, + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoView', + 'lex:com.atproto.admin.defs#recordView', + ], + }, + subjectBlobs: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#blobView', + }, + }, + createLabelVals: { + type: 'array', + items: { + type: 'string', + }, + }, + negateLabelVals: { + type: 'array', + items: { + type: 'string', + }, + }, + reason: { + type: 'string', + }, + createdBy: { + type: 'string', + format: 'did', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + reversal: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionReversal', + }, + resolvedReports: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#reportView', + }, + }, + }, + }, + actionViewCurrent: { + type: 'object', + required: ['id', 'action'], + properties: { + id: { + type: 'integer', + }, + action: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionType', + }, + }, + }, + actionReversal: { + type: 'object', + required: ['reason', 'createdBy', 'createdAt'], + properties: { + reason: { + type: 'string', + }, + createdBy: { + type: 'string', + format: 'did', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + actionType: { + type: 'string', + knownValues: [ + 'lex:com.atproto.admin.defs#takedown', + 'lex:com.atproto.admin.defs#flag', + 'lex:com.atproto.admin.defs#acknowledge', + 'lex:com.atproto.admin.defs#escalate', + ], + }, + takedown: { + type: 'token', + description: + 'Moderation action type: Takedown. Indicates that content should not be served by the PDS.', + }, + flag: { + type: 'token', + description: + 'Moderation action type: Flag. Indicates that the content was reviewed and considered to violate PDS rules, but may still be served.', + }, + acknowledge: { + type: 'token', + description: + 'Moderation action type: Acknowledge. Indicates that the content was reviewed and not considered to violate PDS rules.', + }, + escalate: { + type: 'token', + description: + 'Moderation action type: Escalate. Indicates that the content has been flagged for additional review.', + }, + reportView: { + type: 'object', + required: [ + 'id', + 'reasonType', + 'subject', + 'reportedBy', + 'createdAt', + 'resolvedByActionIds', + ], + properties: { + id: { + type: 'integer', + }, + reasonType: { + type: 'ref', + ref: 'lex:com.atproto.moderation.defs#reasonType', + }, + reason: { + type: 'string', + }, + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoRef', + 'lex:com.atproto.repo.strongRef', + ], + }, + reportedBy: { + type: 'string', + format: 'did', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + resolvedByActionIds: { + type: 'array', + items: { + type: 'integer', + }, + }, + }, + }, + reportViewDetail: { + type: 'object', + required: [ + 'id', + 'reasonType', + 'subject', + 'reportedBy', + 'createdAt', + 'resolvedByActions', + ], + properties: { + id: { + type: 'integer', + }, + reasonType: { + type: 'ref', + ref: 'lex:com.atproto.moderation.defs#reasonType', + }, + reason: { + type: 'string', + }, + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoView', + 'lex:com.atproto.admin.defs#recordView', + ], + }, + reportedBy: { + type: 'string', + format: 'did', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + resolvedByActions: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionView', + }, + }, + }, + }, + repoView: { + type: 'object', + required: [ + 'did', + 'handle', + 'relatedRecords', + 'indexedAt', + 'moderation', + ], + properties: { + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + email: { + type: 'string', + }, + relatedRecords: { + type: 'array', + items: { + type: 'unknown', + }, + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + moderation: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#moderation', + }, + invitedBy: { + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCode', + }, + }, + }, + repoViewDetail: { + type: 'object', + required: [ + 'did', + 'handle', + 'relatedRecords', + 'indexedAt', + 'moderation', + ], + properties: { + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + email: { + type: 'string', + }, + relatedRecords: { + type: 'array', + items: { + type: 'unknown', + }, + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + moderation: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#moderationDetail', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + invitedBy: { + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCode', + }, + invites: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCode', + }, + }, + }, + }, + repoRef: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + recordView: { + type: 'object', + required: [ + 'uri', + 'cid', + 'value', + 'blobCids', + 'indexedAt', + 'moderation', + 'repo', + ], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + value: { + type: 'unknown', + }, + blobCids: { + type: 'array', + items: { + type: 'string', + format: 'cid', + }, + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + moderation: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#moderation', + }, + repo: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#repoView', + }, + }, + }, + recordViewDetail: { + type: 'object', + required: [ + 'uri', + 'cid', + 'value', + 'blobs', + 'indexedAt', + 'moderation', + 'repo', + ], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + value: { + type: 'unknown', + }, + blobs: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#blobView', + }, + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + moderation: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#moderationDetail', + }, + repo: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#repoView', + }, + }, + }, + moderation: { + type: 'object', + required: [], + properties: { + currentAction: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionViewCurrent', + }, + }, + }, + moderationDetail: { + type: 'object', + required: ['actions', 'reports'], + properties: { + currentAction: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionViewCurrent', + }, + actions: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionView', + }, + }, + reports: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#reportView', + }, + }, + }, + }, + blobView: { + type: 'object', + required: ['cid', 'mimeType', 'size', 'createdAt'], + properties: { + cid: { + type: 'string', + format: 'cid', + }, + mimeType: { + type: 'string', + }, + size: { + type: 'integer', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + details: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#imageDetails', + 'lex:com.atproto.admin.defs#videoDetails', + ], + }, + moderation: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#moderation', + }, + }, + }, + imageDetails: { + type: 'object', + required: ['width', 'height'], + properties: { + width: { + type: 'integer', + }, + height: { + type: 'integer', + }, + }, + }, + videoDetails: { + type: 'object', + required: ['width', 'height', 'length'], + properties: { + width: { + type: 'integer', + }, + height: { + type: 'integer', + }, + length: { + type: 'integer', + }, + }, + }, + }, + }, + ComAtprotoAdminDisableInviteCodes: { + lexicon: 1, + id: 'com.atproto.admin.disableInviteCodes', + defs: { + main: { + type: 'procedure', + description: + 'Disable some set of codes and/or all codes associated with a set of users', + input: { + encoding: 'application/json', + schema: { + type: 'object', + properties: { + codes: { + type: 'array', + items: { + type: 'string', + }, + }, + accounts: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, + }, + ComAtprotoAdminGetInviteCodes: { + lexicon: 1, + id: 'com.atproto.admin.getInviteCodes', + defs: { + main: { + type: 'query', + description: 'Admin view of invite codes', + parameters: { + type: 'params', + properties: { + sort: { + type: 'string', + knownValues: ['recent', 'usage'], + default: 'recent', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 500, + default: 100, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['codes'], + properties: { + cursor: { + type: 'string', + }, + codes: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCode', + }, + }, + }, + }, + }, + }, + }, + }, + ComAtprotoAdminGetModerationAction: { + lexicon: 1, + id: 'com.atproto.admin.getModerationAction', + defs: { + main: { + type: 'query', + description: 'View details about a moderation action.', + parameters: { + type: 'params', + required: ['id'], + properties: { + id: { + type: 'integer', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionViewDetail', + }, + }, + }, + }, + }, + ComAtprotoAdminGetModerationActions: { + lexicon: 1, + id: 'com.atproto.admin.getModerationActions', + defs: { + main: { + type: 'query', + description: 'List moderation actions related to a subject.', + parameters: { + type: 'params', + properties: { + subject: { + type: 'string', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['actions'], + properties: { + cursor: { + type: 'string', + }, + actions: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionView', + }, + }, + }, + }, + }, + }, + }, + }, + ComAtprotoAdminGetModerationReport: { + lexicon: 1, + id: 'com.atproto.admin.getModerationReport', + defs: { + main: { + type: 'query', + description: 'View details about a moderation report.', + parameters: { + type: 'params', + required: ['id'], + properties: { + id: { + type: 'integer', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#reportViewDetail', + }, + }, + }, + }, + }, + ComAtprotoAdminGetModerationReports: { + lexicon: 1, + id: 'com.atproto.admin.getModerationReports', + defs: { + main: { + type: 'query', + description: 'List moderation reports related to a subject.', + parameters: { + type: 'params', + properties: { + subject: { + type: 'string', + }, + resolved: { + type: 'boolean', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['reports'], + properties: { + cursor: { + type: 'string', + }, + reports: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#reportView', + }, + }, + }, + }, + }, + }, + }, + }, + ComAtprotoAdminGetRecord: { + lexicon: 1, + id: 'com.atproto.admin.getRecord', + defs: { + main: { + type: 'query', + description: 'View details about a record.', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#recordViewDetail', + }, + }, + }, + }, + }, + ComAtprotoAdminGetRepo: { + lexicon: 1, + id: 'com.atproto.admin.getRepo', + defs: { + main: { + type: 'query', + description: 'View details about a repository.', + parameters: { + type: 'params', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#repoViewDetail', + }, + }, + }, + }, + }, + ComAtprotoAdminResolveModerationReports: { + lexicon: 1, + id: 'com.atproto.admin.resolveModerationReports', + defs: { + main: { + type: 'procedure', + description: 'Resolve moderation reports by an action.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['actionId', 'reportIds', 'createdBy'], + properties: { + actionId: { + type: 'integer', + }, + reportIds: { + type: 'array', + items: { + type: 'integer', + }, + }, + createdBy: { + type: 'string', + format: 'did', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionView', + }, + }, + }, + }, + }, + ComAtprotoAdminReverseModerationAction: { + lexicon: 1, + id: 'com.atproto.admin.reverseModerationAction', + defs: { + main: { + type: 'procedure', + description: 'Reverse a moderation action.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['id', 'reason', 'createdBy'], + properties: { + id: { + type: 'integer', + }, + reason: { + type: 'string', + }, + createdBy: { + type: 'string', + format: 'did', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionView', + }, + }, + }, + }, + }, + ComAtprotoAdminSearchRepos: { + lexicon: 1, + id: 'com.atproto.admin.searchRepos', + defs: { + main: { + type: 'query', + description: 'Find repositories based on a search term.', + parameters: { + type: 'params', + properties: { + term: { + type: 'string', + }, + invitedBy: { + type: 'string', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['repos'], + properties: { + cursor: { + type: 'string', + }, + repos: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#repoView', + }, + }, + }, + }, + }, + }, + }, + }, + ComAtprotoAdminTakeModerationAction: { + lexicon: 1, + id: 'com.atproto.admin.takeModerationAction', + defs: { + main: { + type: 'procedure', + description: 'Take a moderation action on a repo.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['action', 'subject', 'reason', 'createdBy'], + properties: { + action: { + type: 'string', + knownValues: [ + 'com.atproto.admin.defs#takedown', + 'com.atproto.admin.defs#flag', + 'com.atproto.admin.defs#acknowledge', + ], + }, + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoRef', + 'lex:com.atproto.repo.strongRef', + ], + }, + subjectBlobCids: { + type: 'array', + items: { + type: 'string', + format: 'cid', + }, + }, + createLabelVals: { + type: 'array', + items: { + type: 'string', + }, + }, + negateLabelVals: { + type: 'array', + items: { + type: 'string', + }, + }, + reason: { + type: 'string', + }, + createdBy: { + type: 'string', + format: 'did', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.admin.defs#actionView', + }, + }, + errors: [ + { + name: 'SubjectHasAction', + }, + ], + }, + }, + }, + ComAtprotoAdminUpdateAccountEmail: { + lexicon: 1, + id: 'com.atproto.admin.updateAccountEmail', + defs: { + main: { + type: 'procedure', + description: "Administrative action to update an account's email", + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['account', 'email'], + properties: { + account: { + type: 'string', + format: 'at-identifier', + description: 'The handle or DID of the repo.', + }, + email: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoAdminUpdateAccountHandle: { + lexicon: 1, + id: 'com.atproto.admin.updateAccountHandle', + defs: { + main: { + type: 'procedure', + description: "Administrative action to update an account's handle", + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['did', 'handle'], + properties: { + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoIdentityResolveHandle: { + lexicon: 1, + id: 'com.atproto.identity.resolveHandle', + defs: { + main: { + type: 'query', + description: 'Provides the DID of a repo.', + parameters: { + type: 'params', + properties: { + handle: { + type: 'string', + format: 'handle', + description: + "The handle to resolve. If not supplied, will resolve the host's own handle.", + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoIdentityUpdateHandle: { + lexicon: 1, + id: 'com.atproto.identity.updateHandle', + defs: { + main: { + type: 'procedure', + description: 'Updates the handle of the account', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['handle'], + properties: { + handle: { + type: 'string', + format: 'handle', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoLabelDefs: { + lexicon: 1, + id: 'com.atproto.label.defs', + defs: { + label: { + type: 'object', + description: 'Metadata tag on an atproto resource (eg, repo or record)', + required: ['src', 'uri', 'val', 'cts'], + properties: { + src: { + type: 'string', + format: 'did', + description: 'DID of the actor who created this label', + }, + uri: { + type: 'string', + format: 'uri', + description: + 'AT URI of the record, repository (account), or other resource which this label applies to', + }, + cid: { + type: 'string', + format: 'cid', + description: + "optionally, CID specifying the specific version of 'uri' resource this label applies to", + }, + val: { + type: 'string', + maxLength: 128, + description: + 'the short string name of the value or type of this label', + }, + neg: { + type: 'boolean', + description: + 'if true, this is a negation label, overwriting a previous label', + }, + cts: { + type: 'string', + format: 'datetime', + description: 'timestamp when this label was created', + }, + }, + }, + }, + }, + ComAtprotoLabelQueryLabels: { + lexicon: 1, + id: 'com.atproto.label.queryLabels', + defs: { + main: { + type: 'query', + description: 'Find labels relevant to the provided URI patterns.', + parameters: { + type: 'params', + required: ['uriPatterns'], + properties: { + uriPatterns: { + type: 'array', + items: { + type: 'string', + }, + description: + "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", + }, + sources: { + type: 'array', + items: { + type: 'string', + format: 'did', + }, + description: 'Optional list of label sources (DIDs) to filter on', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 250, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['labels'], + properties: { + cursor: { + type: 'string', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + }, + }, + }, + }, + }, + }, + ComAtprotoLabelSubscribeLabels: { + lexicon: 1, + id: 'com.atproto.label.subscribeLabels', + defs: { + main: { + type: 'subscription', + description: 'Subscribe to label updates', + parameters: { + type: 'params', + properties: { + cursor: { + type: 'integer', + description: 'The last known event to backfill from.', + }, + }, + }, + message: { + schema: { + type: 'union', + refs: [ + 'lex:com.atproto.label.subscribeLabels#labels', + 'lex:com.atproto.label.subscribeLabels#info', + ], + }, + }, + errors: [ + { + name: 'FutureCursor', + }, + ], + }, + labels: { + type: 'object', + required: ['seq', 'labels'], + properties: { + seq: { + type: 'integer', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + }, + }, + info: { + type: 'object', + required: ['name'], + properties: { + name: { + type: 'string', + knownValues: ['OutdatedCursor'], + }, + message: { + type: 'string', + }, + }, + }, + }, + }, + ComAtprotoModerationCreateReport: { + lexicon: 1, + id: 'com.atproto.moderation.createReport', + defs: { + main: { + type: 'procedure', + description: 'Report a repo or a record.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['reasonType', 'subject'], + properties: { + reasonType: { + type: 'ref', + ref: 'lex:com.atproto.moderation.defs#reasonType', + }, + reason: { + type: 'string', + }, + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoRef', + 'lex:com.atproto.repo.strongRef', + ], + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: [ + 'id', + 'reasonType', + 'subject', + 'reportedBy', + 'createdAt', + ], + properties: { + id: { + type: 'integer', + }, + reasonType: { + type: 'ref', + ref: 'lex:com.atproto.moderation.defs#reasonType', + }, + reason: { + type: 'string', + }, + subject: { + type: 'union', + refs: [ + 'lex:com.atproto.admin.defs#repoRef', + 'lex:com.atproto.repo.strongRef', + ], + }, + reportedBy: { + type: 'string', + format: 'did', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoModerationDefs: { + lexicon: 1, + id: 'com.atproto.moderation.defs', + defs: { + reasonType: { + type: 'string', + knownValues: [ + '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', + ], + }, + reasonSpam: { + type: 'token', + description: 'Spam: frequent unwanted promotion, replies, mentions', + }, + reasonViolation: { + type: 'token', + description: 'Direct violation of server rules, laws, terms of service', + }, + reasonMisleading: { + type: 'token', + description: 'Misleading identity, affiliation, or content', + }, + reasonSexual: { + type: 'token', + description: 'Unwanted or mis-labeled sexual content', + }, + reasonRude: { + type: 'token', + description: + 'Rude, harassing, explicit, or otherwise unwelcoming behavior', + }, + reasonOther: { + type: 'token', + description: 'Other: reports not falling under another report category', + }, + }, + }, + ComAtprotoRepoApplyWrites: { + lexicon: 1, + id: 'com.atproto.repo.applyWrites', + defs: { + main: { + type: 'procedure', + description: + 'Apply a batch transaction of creates, updates, and deletes.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['repo', 'writes'], + properties: { + repo: { + type: 'string', + format: 'at-identifier', + description: 'The handle or DID of the repo.', + }, + validate: { + type: 'boolean', + default: true, + description: 'Validate the records?', + }, + writes: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:com.atproto.repo.applyWrites#create', + 'lex:com.atproto.repo.applyWrites#update', + 'lex:com.atproto.repo.applyWrites#delete', + ], + closed: true, + }, + }, + swapCommit: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + errors: [ + { + name: 'InvalidSwap', + }, + ], + }, + create: { + type: 'object', + description: 'Create a new record.', + required: ['action', 'collection', 'value'], + properties: { + collection: { + type: 'string', + format: 'nsid', + }, + rkey: { + type: 'string', + }, + value: { + type: 'unknown', + }, + }, + }, + update: { + type: 'object', + description: 'Update an existing record.', + required: ['action', 'collection', 'rkey', 'value'], + properties: { + collection: { + type: 'string', + format: 'nsid', + }, + rkey: { + type: 'string', + }, + value: { + type: 'unknown', + }, + }, + }, + delete: { + type: 'object', + description: 'Delete an existing record.', + required: ['action', 'collection', 'rkey'], + properties: { + collection: { + type: 'string', + format: 'nsid', + }, + rkey: { + type: 'string', + }, + }, + }, + }, + }, + ComAtprotoRepoCreateRecord: { + lexicon: 1, + id: 'com.atproto.repo.createRecord', + defs: { + main: { + type: 'procedure', + description: 'Create a new record.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['repo', 'collection', 'record'], + properties: { + repo: { + type: 'string', + format: 'at-identifier', + description: 'The handle or DID of the repo.', + }, + collection: { + type: 'string', + format: 'nsid', + description: 'The NSID of the record collection.', + }, + rkey: { + type: 'string', + description: 'The key of the record.', + }, + validate: { + type: 'boolean', + default: true, + description: 'Validate the record?', + }, + record: { + type: 'unknown', + description: 'The record to create.', + }, + swapCommit: { + type: 'string', + format: 'cid', + description: + 'Compare and swap with the previous commit by cid.', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['uri', 'cid'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + errors: [ + { + name: 'InvalidSwap', + }, + ], + }, + }, + }, + ComAtprotoRepoDeleteRecord: { + lexicon: 1, + id: 'com.atproto.repo.deleteRecord', + defs: { + main: { + type: 'procedure', + description: "Delete a record, or ensure it doesn't exist.", + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['repo', 'collection', 'rkey'], + properties: { + repo: { + type: 'string', + format: 'at-identifier', + description: 'The handle or DID of the repo.', + }, + collection: { + type: 'string', + format: 'nsid', + description: 'The NSID of the record collection.', + }, + rkey: { + type: 'string', + description: 'The key of the record.', + }, + swapRecord: { + type: 'string', + format: 'cid', + description: + 'Compare and swap with the previous record by cid.', + }, + swapCommit: { + type: 'string', + format: 'cid', + description: + 'Compare and swap with the previous commit by cid.', + }, + }, + }, + }, + errors: [ + { + name: 'InvalidSwap', + }, + ], + }, + }, + }, + ComAtprotoRepoDescribeRepo: { + lexicon: 1, + id: 'com.atproto.repo.describeRepo', + defs: { + main: { + type: 'query', + description: + 'Get information about the repo, including the list of collections.', + parameters: { + type: 'params', + required: ['repo'], + properties: { + repo: { + type: 'string', + format: 'at-identifier', + description: 'The handle or DID of the repo.', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: [ + 'handle', + 'did', + 'didDoc', + 'collections', + 'handleIsCorrect', + ], + properties: { + handle: { + type: 'string', + format: 'handle', + }, + did: { + type: 'string', + format: 'did', + }, + didDoc: { + type: 'unknown', + }, + collections: { + type: 'array', + items: { + type: 'string', + format: 'nsid', + }, + }, + handleIsCorrect: { + type: 'boolean', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoRepoGetRecord: { + lexicon: 1, + id: 'com.atproto.repo.getRecord', + defs: { + main: { + type: 'query', + description: 'Get a record.', + parameters: { + type: 'params', + required: ['repo', 'collection', 'rkey'], + properties: { + repo: { + type: 'string', + format: 'at-identifier', + description: 'The handle or DID of the repo.', + }, + collection: { + type: 'string', + format: 'nsid', + description: 'The NSID of the record collection.', + }, + rkey: { + type: 'string', + description: 'The key of the record.', + }, + cid: { + type: 'string', + format: 'cid', + description: + 'The CID of the version of the record. If not specified, then return the most recent version.', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['uri', 'value'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + value: { + type: 'unknown', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoRepoListRecords: { + lexicon: 1, + id: 'com.atproto.repo.listRecords', + defs: { + main: { + type: 'query', + description: 'List a range of records in a collection.', + parameters: { + type: 'params', + required: ['repo', 'collection'], + properties: { + repo: { + type: 'string', + format: 'at-identifier', + description: 'The handle or DID of the repo.', + }, + collection: { + type: 'string', + format: 'nsid', + description: 'The NSID of the record type.', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + description: 'The number of records to return.', + }, + cursor: { + type: 'string', + }, + rkeyStart: { + type: 'string', + description: + 'DEPRECATED: The lowest sort-ordered rkey to start from (exclusive)', + }, + rkeyEnd: { + type: 'string', + description: + 'DEPRECATED: The highest sort-ordered rkey to stop at (exclusive)', + }, + reverse: { + type: 'boolean', + description: 'Reverse the order of the returned records?', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['records'], + properties: { + cursor: { + type: 'string', + }, + records: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.repo.listRecords#record', + }, + }, + }, + }, + }, + }, + record: { + type: 'object', + required: ['uri', 'cid', 'value'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + value: { + type: 'unknown', + }, + }, + }, + }, + }, + ComAtprotoRepoPutRecord: { + lexicon: 1, + id: 'com.atproto.repo.putRecord', + defs: { + main: { + type: 'procedure', + description: 'Write a record, creating or updating it as needed.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['repo', 'collection', 'rkey', 'record'], + nullable: ['swapRecord'], + properties: { + repo: { + type: 'string', + format: 'at-identifier', + description: 'The handle or DID of the repo.', + }, + collection: { + type: 'string', + format: 'nsid', + description: 'The NSID of the record collection.', + }, + rkey: { + type: 'string', + description: 'The key of the record.', + }, + validate: { + type: 'boolean', + default: true, + description: 'Validate the record?', + }, + record: { + type: 'unknown', + description: 'The record to write.', + }, + swapRecord: { + type: 'string', + format: 'cid', + description: + 'Compare and swap with the previous record by cid.', + }, + swapCommit: { + type: 'string', + format: 'cid', + description: + 'Compare and swap with the previous commit by cid.', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['uri', 'cid'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + errors: [ + { + name: 'InvalidSwap', + }, + ], + }, + }, + }, + ComAtprotoRepoStrongRef: { + lexicon: 1, + id: 'com.atproto.repo.strongRef', + description: 'A URI with a content-hash fingerprint.', + defs: { + main: { + type: 'object', + required: ['uri', 'cid'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + }, + ComAtprotoRepoUploadBlob: { + lexicon: 1, + id: 'com.atproto.repo.uploadBlob', + defs: { + main: { + type: 'procedure', + description: + 'Upload a new blob to be added to repo in a later request.', + input: { + encoding: '*/*', + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['blob'], + properties: { + blob: { + type: 'blob', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoServerCreateAccount: { + lexicon: 1, + id: 'com.atproto.server.createAccount', + defs: { + main: { + type: 'procedure', + description: 'Create an account.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['handle', 'email', 'password'], + properties: { + email: { + type: 'string', + }, + handle: { + type: 'string', + format: 'handle', + }, + inviteCode: { + type: 'string', + }, + password: { + type: 'string', + }, + recoveryKey: { + type: 'string', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['accessJwt', 'refreshJwt', 'handle', 'did'], + properties: { + accessJwt: { + type: 'string', + }, + refreshJwt: { + type: 'string', + }, + handle: { + type: 'string', + format: 'handle', + }, + did: { + type: 'string', + format: 'did', + }, + }, + }, + }, + errors: [ + { + name: 'InvalidHandle', + }, + { + name: 'InvalidPassword', + }, + { + name: 'InvalidInviteCode', + }, + { + name: 'HandleNotAvailable', + }, + { + name: 'UnsupportedDomain', + }, + ], + }, + }, + }, + ComAtprotoServerCreateAppPassword: { + lexicon: 1, + id: 'com.atproto.server.createAppPassword', + defs: { + main: { + type: 'procedure', + description: 'Create an app-specific password.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['name'], + properties: { + name: { + type: 'string', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:com.atproto.server.createAppPassword#appPassword', + }, + }, + errors: [ + { + name: 'AccountTakedown', + }, + ], + }, + appPassword: { + type: 'object', + required: ['name', 'password', 'createdAt'], + properties: { + name: { + type: 'string', + }, + password: { + type: 'string', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + ComAtprotoServerCreateInviteCode: { + lexicon: 1, + id: 'com.atproto.server.createInviteCode', + defs: { + main: { + type: 'procedure', + description: 'Create an invite code.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['useCount'], + properties: { + useCount: { + type: 'integer', + }, + forAccount: { + type: 'string', + format: 'did', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['code'], + properties: { + code: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoServerCreateInviteCodes: { + lexicon: 1, + id: 'com.atproto.server.createInviteCodes', + defs: { + main: { + type: 'procedure', + description: 'Create an invite code.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['codeCount', 'useCount'], + properties: { + codeCount: { + type: 'integer', + default: 1, + }, + useCount: { + type: 'integer', + }, + forAccounts: { + type: 'array', + items: { + type: 'string', + format: 'did', + }, + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['codes'], + properties: { + codes: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.server.createInviteCodes#accountCodes', + }, + }, + }, + }, + }, + }, + accountCodes: { + type: 'object', + required: ['account', 'codes'], + properties: { + account: { + type: 'string', + }, + codes: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + }, + }, + }, + ComAtprotoServerCreateSession: { + lexicon: 1, + id: 'com.atproto.server.createSession', + defs: { + main: { + type: 'procedure', + description: 'Create an authentication session.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['identifier', 'password'], + properties: { + identifier: { + type: 'string', + description: + 'Handle or other identifier supported by the server for the authenticating user.', + }, + password: { + type: 'string', + }, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['accessJwt', 'refreshJwt', 'handle', 'did'], + properties: { + accessJwt: { + type: 'string', + }, + refreshJwt: { + type: 'string', + }, + handle: { + type: 'string', + format: 'handle', + }, + did: { + type: 'string', + format: 'did', + }, + email: { + type: 'string', + }, + }, + }, + }, + errors: [ + { + name: 'AccountTakedown', + }, + ], + }, + }, + }, + ComAtprotoServerDefs: { + lexicon: 1, + id: 'com.atproto.server.defs', + defs: { + inviteCode: { + type: 'object', + required: [ + 'code', + 'available', + 'disabled', + 'forAccount', + 'createdBy', + 'createdAt', + 'uses', + ], + properties: { + code: { + type: 'string', + }, + available: { + type: 'integer', + }, + disabled: { + type: 'boolean', + }, + forAccount: { + type: 'string', + }, + createdBy: { + type: 'string', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + uses: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCodeUse', + }, + }, + }, + }, + inviteCodeUse: { + type: 'object', + required: ['usedBy', 'usedAt'], + properties: { + usedBy: { + type: 'string', + format: 'did', + }, + usedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + ComAtprotoServerDeleteAccount: { + lexicon: 1, + id: 'com.atproto.server.deleteAccount', + defs: { + main: { + type: 'procedure', + description: 'Delete a user account with a token and password.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['did', 'password', 'token'], + properties: { + did: { + type: 'string', + format: 'did', + }, + password: { + type: 'string', + }, + token: { + type: 'string', + }, + }, + }, + }, + errors: [ + { + name: 'ExpiredToken', + }, + { + name: 'InvalidToken', + }, + ], + }, + }, + }, + ComAtprotoServerDeleteSession: { + lexicon: 1, + id: 'com.atproto.server.deleteSession', + defs: { + main: { + type: 'procedure', + description: 'Delete the current session.', + }, + }, + }, + ComAtprotoServerDescribeServer: { + lexicon: 1, + id: 'com.atproto.server.describeServer', + defs: { + main: { + type: 'query', + description: + "Get a document describing the service's accounts configuration.", + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['availableUserDomains'], + properties: { + inviteCodeRequired: { + type: 'boolean', + }, + availableUserDomains: { + type: 'array', + items: { + type: 'string', + }, + }, + links: { + type: 'ref', + ref: 'lex:com.atproto.server.describeServer#links', + }, + }, + }, + }, + }, + links: { + type: 'object', + properties: { + privacyPolicy: { + type: 'string', + }, + termsOfService: { + type: 'string', + }, + }, + }, + }, + }, + ComAtprotoServerGetAccountInviteCodes: { + lexicon: 1, + id: 'com.atproto.server.getAccountInviteCodes', + defs: { + main: { + type: 'query', + description: 'Get all invite codes for a given account', + parameters: { + type: 'params', + properties: { + includeUsed: { + type: 'boolean', + default: true, + }, + createAvailable: { + type: 'boolean', + default: true, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['codes'], + properties: { + codes: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.server.defs#inviteCode', + }, + }, + }, + }, + }, + errors: [ + { + name: 'DuplicateCreate', + }, + ], + }, + }, + }, + ComAtprotoServerGetSession: { + lexicon: 1, + id: 'com.atproto.server.getSession', + defs: { + main: { + type: 'query', + description: 'Get information about the current session.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['handle', 'did'], + properties: { + handle: { + type: 'string', + format: 'handle', + }, + did: { + type: 'string', + format: 'did', + }, + email: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoServerListAppPasswords: { + lexicon: 1, + id: 'com.atproto.server.listAppPasswords', + defs: { + main: { + type: 'query', + description: 'List all app-specific passwords.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['passwords'], + properties: { + passwords: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.server.listAppPasswords#appPassword', + }, + }, + }, + }, + }, + errors: [ + { + name: 'AccountTakedown', + }, + ], + }, + appPassword: { + type: 'object', + required: ['name', 'createdAt'], + properties: { + name: { + type: 'string', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + ComAtprotoServerRefreshSession: { + lexicon: 1, + id: 'com.atproto.server.refreshSession', + defs: { + main: { + type: 'procedure', + description: 'Refresh an authentication session.', + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['accessJwt', 'refreshJwt', 'handle', 'did'], + properties: { + accessJwt: { + type: 'string', + }, + refreshJwt: { + type: 'string', + }, + handle: { + type: 'string', + format: 'handle', + }, + did: { + type: 'string', + format: 'did', + }, + }, + }, + }, + errors: [ + { + name: 'AccountTakedown', + }, + ], + }, + }, + }, + ComAtprotoServerRequestAccountDelete: { + lexicon: 1, + id: 'com.atproto.server.requestAccountDelete', + defs: { + main: { + type: 'procedure', + description: 'Initiate a user account deletion via email.', + }, + }, + }, + ComAtprotoServerRequestPasswordReset: { + lexicon: 1, + id: 'com.atproto.server.requestPasswordReset', + defs: { + main: { + type: 'procedure', + description: 'Initiate a user account password reset via email.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['email'], + properties: { + email: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoServerResetPassword: { + lexicon: 1, + id: 'com.atproto.server.resetPassword', + defs: { + main: { + type: 'procedure', + description: 'Reset a user account password using a token.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['token', 'password'], + properties: { + token: { + type: 'string', + }, + password: { + type: 'string', + }, + }, + }, + }, + errors: [ + { + name: 'ExpiredToken', + }, + { + name: 'InvalidToken', + }, + ], + }, + }, + }, + ComAtprotoServerRevokeAppPassword: { + lexicon: 1, + id: 'com.atproto.server.revokeAppPassword', + defs: { + main: { + type: 'procedure', + description: 'Revoke an app-specific password by name.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['name'], + properties: { + name: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoSyncGetBlob: { + lexicon: 1, + id: 'com.atproto.sync.getBlob', + defs: { + main: { + type: 'query', + description: 'Get a blob associated with a given repo.', + parameters: { + type: 'params', + required: ['did', 'cid'], + properties: { + did: { + type: 'string', + format: 'did', + description: 'The DID of the repo.', + }, + cid: { + type: 'string', + format: 'cid', + description: 'The CID of the blob to fetch', + }, + }, + }, + output: { + encoding: '*/*', + }, + }, + }, + }, + ComAtprotoSyncGetBlocks: { + lexicon: 1, + id: 'com.atproto.sync.getBlocks', + defs: { + main: { + type: 'query', + description: 'Gets blocks from a given repo.', + parameters: { + type: 'params', + required: ['did', 'cids'], + properties: { + did: { + type: 'string', + format: 'did', + description: 'The DID of the repo.', + }, + cids: { + type: 'array', + items: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + output: { + encoding: 'application/vnd.ipld.car', + }, + }, + }, + }, + ComAtprotoSyncGetCheckout: { + lexicon: 1, + id: 'com.atproto.sync.getCheckout', + defs: { + main: { + type: 'query', + description: 'Gets the repo state.', + parameters: { + type: 'params', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + description: 'The DID of the repo.', + }, + commit: { + type: 'string', + format: 'cid', + description: + 'The commit to get the checkout from. Defaults to current HEAD.', + }, + }, + }, + output: { + encoding: 'application/vnd.ipld.car', + }, + }, + }, + }, + ComAtprotoSyncGetCommitPath: { + lexicon: 1, + id: 'com.atproto.sync.getCommitPath', + defs: { + main: { + type: 'query', + description: 'Gets the path of repo commits', + parameters: { + type: 'params', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + description: 'The DID of the repo.', + }, + latest: { + type: 'string', + format: 'cid', + description: 'The most recent commit', + }, + earliest: { + type: 'string', + format: 'cid', + description: 'The earliest commit to start from', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['commits'], + properties: { + commits: { + type: 'array', + items: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + }, + }, + }, + }, + ComAtprotoSyncGetHead: { + lexicon: 1, + id: 'com.atproto.sync.getHead', + defs: { + main: { + type: 'query', + description: 'Gets the current HEAD CID of a repo.', + parameters: { + type: 'params', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + description: 'The DID of the repo.', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['root'], + properties: { + root: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + }, + }, + }, + ComAtprotoSyncGetRecord: { + lexicon: 1, + id: 'com.atproto.sync.getRecord', + defs: { + main: { + type: 'query', + description: + 'Gets blocks needed for existence or non-existence of record.', + parameters: { + type: 'params', + required: ['did', 'collection', 'rkey'], + properties: { + did: { + type: 'string', + format: 'did', + description: 'The DID of the repo.', + }, + collection: { + type: 'string', + format: 'nsid', + }, + rkey: { + type: 'string', + }, + commit: { + type: 'string', + format: 'cid', + description: 'An optional past commit CID.', + }, + }, + }, + output: { + encoding: 'application/vnd.ipld.car', + }, + }, + }, + }, + ComAtprotoSyncGetRepo: { + lexicon: 1, + id: 'com.atproto.sync.getRepo', + defs: { + main: { + type: 'query', + description: 'Gets the repo state.', + parameters: { + type: 'params', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + description: 'The DID of the repo.', + }, + earliest: { + type: 'string', + format: 'cid', + description: + 'The earliest commit in the commit range (not inclusive)', + }, + latest: { + type: 'string', + format: 'cid', + description: 'The latest commit in the commit range (inclusive)', + }, + }, + }, + output: { + encoding: 'application/vnd.ipld.car', + }, + }, + }, + }, + ComAtprotoSyncListBlobs: { + lexicon: 1, + id: 'com.atproto.sync.listBlobs', + defs: { + main: { + type: 'query', + description: 'List blob cids for some range of commits', + parameters: { + type: 'params', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + description: 'The DID of the repo.', + }, + latest: { + type: 'string', + format: 'cid', + description: 'The most recent commit', + }, + earliest: { + type: 'string', + format: 'cid', + description: 'The earliest commit to start from', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['cids'], + properties: { + cids: { + type: 'array', + items: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + }, + }, + }, + }, + ComAtprotoSyncListRepos: { + lexicon: 1, + id: 'com.atproto.sync.listRepos', + defs: { + main: { + type: 'query', + description: 'List dids and root cids of hosted repos', + parameters: { + type: 'params', + properties: { + limit: { + type: 'integer', + minimum: 1, + maximum: 1000, + default: 500, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['repos'], + properties: { + cursor: { + type: 'string', + }, + repos: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.sync.listRepos#repo', + }, + }, + }, + }, + }, + }, + repo: { + type: 'object', + required: ['did', 'head'], + properties: { + did: { + type: 'string', + format: 'did', + }, + head: { + type: 'string', + format: 'cid', + }, + }, + }, + }, + }, + ComAtprotoSyncNotifyOfUpdate: { + lexicon: 1, + id: 'com.atproto.sync.notifyOfUpdate', + defs: { + main: { + type: 'query', + description: + 'Notify a crawling service of a recent update. Often when a long break between updates causes the connection with the crawling service to break.', + parameters: { + type: 'params', + required: ['hostname'], + properties: { + hostname: { + type: 'string', + description: + 'Hostname of the service that is notifying of update.', + }, + }, + }, + }, + }, + }, + ComAtprotoSyncRequestCrawl: { + lexicon: 1, + id: 'com.atproto.sync.requestCrawl', + defs: { + main: { + type: 'query', + description: 'Request a service to persistently crawl hosted repos.', + parameters: { + type: 'params', + required: ['hostname'], + properties: { + hostname: { + type: 'string', + description: + 'Hostname of the service that is requesting to be crawled.', + }, + }, + }, + }, + }, + }, + ComAtprotoSyncSubscribeRepos: { + lexicon: 1, + id: 'com.atproto.sync.subscribeRepos', + defs: { + main: { + type: 'subscription', + description: 'Subscribe to repo updates', + parameters: { + type: 'params', + properties: { + cursor: { + type: 'integer', + description: 'The last known event to backfill from.', + }, + }, + }, + message: { + schema: { + type: 'union', + refs: [ + 'lex:com.atproto.sync.subscribeRepos#commit', + 'lex:com.atproto.sync.subscribeRepos#handle', + 'lex:com.atproto.sync.subscribeRepos#migrate', + 'lex:com.atproto.sync.subscribeRepos#tombstone', + 'lex:com.atproto.sync.subscribeRepos#info', + ], + }, + }, + errors: [ + { + name: 'FutureCursor', + }, + ], + }, + commit: { + type: 'object', + required: [ + 'seq', + 'rebase', + 'tooBig', + 'repo', + 'commit', + 'prev', + 'blocks', + 'ops', + 'blobs', + 'time', + ], + nullable: ['prev'], + properties: { + seq: { + type: 'integer', + }, + rebase: { + type: 'boolean', + }, + tooBig: { + type: 'boolean', + }, + repo: { + type: 'string', + format: 'did', + }, + commit: { + type: 'cid-link', + }, + prev: { + type: 'cid-link', + }, + blocks: { + type: 'bytes', + description: 'CAR file containing relevant blocks', + maxLength: 1000000, + }, + ops: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.sync.subscribeRepos#repoOp', + }, + maxLength: 200, + }, + blobs: { + type: 'array', + items: { + type: 'cid-link', + }, + }, + time: { + type: 'string', + format: 'datetime', + }, + }, + }, + handle: { + type: 'object', + required: ['seq', 'did', 'handle', 'time'], + properties: { + seq: { + type: 'integer', + }, + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + time: { + type: 'string', + format: 'datetime', + }, + }, + }, + migrate: { + type: 'object', + required: ['seq', 'did', 'migrateTo', 'time'], + nullable: ['migrateTo'], + properties: { + seq: { + type: 'integer', + }, + did: { + type: 'string', + format: 'did', + }, + migrateTo: { + type: 'string', + }, + time: { + type: 'string', + format: 'datetime', + }, + }, + }, + tombstone: { + type: 'object', + required: ['seq', 'did', 'time'], + properties: { + seq: { + type: 'integer', + }, + did: { + type: 'string', + format: 'did', + }, + time: { + type: 'string', + format: 'datetime', + }, + }, + }, + info: { + type: 'object', + required: ['name'], + properties: { + name: { + type: 'string', + knownValues: ['OutdatedCursor'], + }, + message: { + type: 'string', + }, + }, + }, + repoOp: { + type: 'object', + required: ['action', 'path', 'cid'], + nullable: ['cid'], + properties: { + action: { + type: 'string', + knownValues: ['create', 'update', 'delete'], + }, + path: { + type: 'string', + }, + cid: { + type: 'cid-link', + }, + }, + }, + }, + }, + AppBskyActorDefs: { + lexicon: 1, + id: 'app.bsky.actor.defs', + description: 'A reference to an actor in the network.', + defs: { + profileViewBasic: { + type: 'object', + required: ['did', 'handle'], + properties: { + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + displayName: { + type: 'string', + maxGraphemes: 64, + maxLength: 640, + }, + avatar: { + type: 'string', + }, + actorType: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#actorType', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#viewerState', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + }, + }, + profileView: { + type: 'object', + required: ['did', 'handle'], + properties: { + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + displayName: { + type: 'string', + maxGraphemes: 64, + maxLength: 640, + }, + description: { + type: 'string', + maxGraphemes: 256, + maxLength: 2560, + }, + avatar: { + type: 'string', + }, + actorType: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#actorType', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#viewerState', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + }, + }, + profileViewDetailed: { + type: 'object', + required: ['did', 'handle'], + properties: { + did: { + type: 'string', + format: 'did', + }, + handle: { + type: 'string', + format: 'handle', + }, + displayName: { + type: 'string', + maxGraphemes: 64, + maxLength: 640, + }, + description: { + type: 'string', + maxGraphemes: 256, + maxLength: 2560, + }, + avatar: { + type: 'string', + }, + actorType: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#actorType', + }, + actorInfo: { + type: 'union', + refs: ['lex:app.bsky.actor.defs#infoFeedGenerator'], + }, + banner: { + type: 'string', + }, + followersCount: { + type: 'integer', + }, + followsCount: { + type: 'integer', + }, + postsCount: { + type: 'integer', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#viewerState', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + }, + }, + viewerState: { + type: 'object', + properties: { + muted: { + type: 'boolean', + }, + blockedBy: { + type: 'boolean', + }, + blocking: { + type: 'string', + format: 'at-uri', + }, + following: { + type: 'string', + format: 'at-uri', + }, + followedBy: { + type: 'string', + format: 'at-uri', + }, + }, + }, + infoFeedGenerator: { + type: 'object', + required: ['likes'], + properties: { + likes: { + type: 'integer', + }, + }, + }, + actorType: { + type: 'string', + knownValues: [ + 'app.bsky.actor.defs#user', + 'app.bsky.actor.defs#feedGenerator', + ], + }, + user: { + type: 'token', + description: + 'Actor type: User. This is the default option and an actor is assumed to be a user unless suggested otherwise.', + }, + feedGenerator: { + type: 'token', + description: + 'Actor type: Feed Generator. A service that provides a custom feed.', + }, + }, + }, + AppBskyActorGetProfile: { + lexicon: 1, + id: 'app.bsky.actor.getProfile', + defs: { + main: { + type: 'query', + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewDetailed', + }, + }, + }, + }, + }, + AppBskyActorGetProfiles: { + lexicon: 1, + id: 'app.bsky.actor.getProfiles', + defs: { + main: { + type: 'query', + parameters: { + type: 'params', + required: ['actors'], + properties: { + actors: { + type: 'array', + items: { + type: 'string', + format: 'at-identifier', + }, + maxLength: 25, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['profiles'], + properties: { + profiles: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewDetailed', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyActorGetSuggestions: { + lexicon: 1, + id: 'app.bsky.actor.getSuggestions', + defs: { + main: { + type: 'query', + description: + 'Get a list of actors suggested for following. Used in discovery UIs.', + parameters: { + type: 'params', + properties: { + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['actors'], + properties: { + cursor: { + type: 'string', + }, + actors: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyActorProfile: { + lexicon: 1, + id: 'app.bsky.actor.profile', + defs: { + main: { + type: 'record', + key: 'literal:self', + record: { + type: 'object', + properties: { + displayName: { + type: 'string', + maxGraphemes: 64, + maxLength: 640, + }, + description: { + type: 'string', + maxGraphemes: 256, + maxLength: 2560, + }, + avatar: { + type: 'blob', + accept: ['image/png', 'image/jpeg'], + maxSize: 1000000, + }, + banner: { + type: 'blob', + accept: ['image/png', 'image/jpeg'], + maxSize: 1000000, + }, + }, + }, + }, + }, + }, + AppBskyActorSearchActors: { + lexicon: 1, + id: 'app.bsky.actor.searchActors', + defs: { + main: { + type: 'query', + description: 'Find actors matching search criteria.', + parameters: { + type: 'params', + properties: { + term: { + type: 'string', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['actors'], + properties: { + cursor: { + type: 'string', + }, + actors: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyActorSearchActorsTypeahead: { + lexicon: 1, + id: 'app.bsky.actor.searchActorsTypeahead', + defs: { + main: { + type: 'query', + description: 'Find actor suggestions for a search term.', + parameters: { + type: 'params', + properties: { + term: { + type: 'string', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['actors'], + properties: { + actors: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyEmbedExternal: { + lexicon: 1, + id: 'app.bsky.embed.external', + description: + 'A representation of some externally linked content, embedded in another form of content', + defs: { + main: { + type: 'object', + required: ['external'], + properties: { + external: { + type: 'ref', + ref: 'lex:app.bsky.embed.external#external', + }, + }, + }, + external: { + type: 'object', + required: ['uri', 'title', 'description'], + properties: { + uri: { + type: 'string', + format: 'uri', + }, + title: { + type: 'string', + }, + description: { + type: 'string', + }, + thumb: { + type: 'blob', + accept: ['image/*'], + maxSize: 1000000, + }, + }, + }, + view: { + type: 'object', + required: ['external'], + properties: { + external: { + type: 'ref', + ref: 'lex:app.bsky.embed.external#viewExternal', + }, + }, + }, + viewExternal: { + type: 'object', + required: ['uri', 'title', 'description'], + properties: { + uri: { + type: 'string', + format: 'uri', + }, + title: { + type: 'string', + }, + description: { + type: 'string', + }, + thumb: { + type: 'string', + }, + }, + }, + }, + }, + AppBskyEmbedImages: { + lexicon: 1, + id: 'app.bsky.embed.images', + description: 'A set of images embedded in some other form of content', + defs: { + main: { + type: 'object', + required: ['images'], + properties: { + images: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.embed.images#image', + }, + maxLength: 4, + }, + }, + }, + image: { + type: 'object', + required: ['image', 'alt'], + properties: { + image: { + type: 'blob', + accept: ['image/*'], + maxSize: 1000000, + }, + alt: { + type: 'string', + }, + }, + }, + view: { + type: 'object', + required: ['images'], + properties: { + images: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.embed.images#viewImage', + }, + maxLength: 4, + }, + }, + }, + viewImage: { + type: 'object', + required: ['thumb', 'fullsize', 'alt'], + properties: { + thumb: { + type: 'string', + }, + fullsize: { + type: 'string', + }, + alt: { + type: 'string', + }, + }, + }, + }, + }, + AppBskyEmbedRecord: { + lexicon: 1, + id: 'app.bsky.embed.record', + description: + 'A representation of a record embedded in another form of content', + defs: { + main: { + type: 'object', + required: ['record'], + properties: { + record: { + type: 'ref', + ref: 'lex:com.atproto.repo.strongRef', + }, + }, + }, + view: { + type: 'object', + required: ['record'], + properties: { + record: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.record#viewRecord', + 'lex:app.bsky.embed.record#viewNotFound', + 'lex:app.bsky.embed.record#viewBlocked', + ], + }, + }, + }, + viewRecord: { + type: 'object', + required: ['uri', 'cid', 'author', 'value', 'indexedAt'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + author: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + value: { + type: 'unknown', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + embeds: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.images#view', + 'lex:app.bsky.embed.external#view', + 'lex:app.bsky.embed.record#view', + 'lex:app.bsky.embed.recordWithMedia#view', + ], + }, + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + viewNotFound: { + type: 'object', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + }, + }, + viewBlocked: { + type: 'object', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + }, + }, + }, + }, + AppBskyEmbedRecordWithMedia: { + lexicon: 1, + id: 'app.bsky.embed.recordWithMedia', + description: + 'A representation of a record embedded in another form of content, alongside other compatible embeds', + defs: { + main: { + type: 'object', + required: ['record', 'media'], + properties: { + record: { + type: 'ref', + ref: 'lex:app.bsky.embed.record', + }, + media: { + type: 'union', + refs: ['lex:app.bsky.embed.images', 'lex:app.bsky.embed.external'], + }, + }, + }, + view: { + type: 'object', + required: ['record', 'media'], + properties: { + record: { + type: 'ref', + ref: 'lex:app.bsky.embed.record#view', + }, + media: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.images#view', + 'lex:app.bsky.embed.external#view', + ], + }, + }, + }, + }, + }, + AppBskyFeedBookmarkFeed: { + lexicon: 1, + id: 'app.bsky.feed.bookmarkFeed', + defs: { + main: { + type: 'procedure', + description: 'Bookmark a 3rd party feed for use across clients', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + feed: { + type: 'string', + format: 'at-identifier', + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedDefs: { + lexicon: 1, + id: 'app.bsky.feed.defs', + defs: { + postView: { + type: 'object', + required: ['uri', 'cid', 'author', 'record', 'indexedAt'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + author: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + record: { + type: 'unknown', + }, + embed: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.images#view', + 'lex:app.bsky.embed.external#view', + 'lex:app.bsky.embed.record#view', + 'lex:app.bsky.embed.recordWithMedia#view', + ], + }, + replyCount: { + type: 'integer', + }, + repostCount: { + type: 'integer', + }, + likeCount: { + type: 'integer', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + viewer: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#viewerState', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + }, + }, + viewerState: { + type: 'object', + properties: { + repost: { + type: 'string', + format: 'at-uri', + }, + like: { + type: 'string', + format: 'at-uri', + }, + }, + }, + feedViewPost: { + type: 'object', + required: ['post'], + properties: { + post: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#postView', + }, + reply: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#replyRef', + }, + reason: { + type: 'union', + refs: ['lex:app.bsky.feed.defs#reasonRepost'], + }, + }, + }, + replyRef: { + type: 'object', + required: ['root', 'parent'], + properties: { + root: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#postView', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + parent: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#postView', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + }, + }, + reasonRepost: { + type: 'object', + required: ['by', 'indexedAt'], + properties: { + by: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileViewBasic', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + threadViewPost: { + type: 'object', + required: ['post'], + properties: { + post: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#postView', + }, + parent: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#threadViewPost', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + replies: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#threadViewPost', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + }, + }, + }, + notFoundPost: { + type: 'object', + required: ['uri', 'notFound'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + notFound: { + type: 'boolean', + const: true, + }, + }, + }, + blockedPost: { + type: 'object', + required: ['uri', 'blocked'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + blocked: { + type: 'boolean', + const: true, + }, + }, + }, + skeletonFeedPost: { + type: 'object', + required: ['post'], + properties: { + post: { + type: 'string', + format: 'at-uri', + }, + replyTo: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#skeletonReplyRef', + }, + reason: { + type: 'union', + refs: ['lex:app.bsky.feed.defs#skeletonReasonRepost'], + }, + }, + }, + skeletonReplyRef: { + type: 'object', + required: ['root', 'parent'], + properties: { + root: { + type: 'string', + ref: 'at-uri', + }, + parent: { + type: 'string', + ref: 'at-uri', + }, + }, + }, + skeletonReasonRepost: { + type: 'object', + required: ['by', 'indexedAt'], + properties: { + by: { + type: 'string', + format: 'did', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + AppBskyFeedGetAuthorFeed: { + lexicon: 1, + id: 'app.bsky.feed.getAuthorFeed', + defs: { + main: { + type: 'query', + description: "A view of an actor's feed.", + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#feedViewPost', + }, + }, + }, + }, + }, + errors: [ + { + name: 'BlockedActor', + }, + { + name: 'BlockedByActor', + }, + ], + }, + }, + }, + AppBskyFeedGetBookmarkedFeeds: { + lexicon: 1, + id: 'app.bsky.feed.getBookmarkedFeeds', + defs: { + main: { + type: 'query', + description: + "Retrieve a list of the authenticated user's bookmarked feeds", + parameters: { + type: 'params', + properties: { + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feeds'], + properties: { + cursor: { + type: 'string', + }, + feeds: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedGetFeed: { + lexicon: 1, + id: 'app.bsky.feed.getFeed', + defs: { + main: { + type: 'query', + description: + "Compose and hydrate a feed from a user's selected feed generator", + parameters: { + type: 'params', + required: ['feed'], + properties: { + feed: { + type: 'string', + format: 'at-identifier', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#feedViewPost', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedGetFeedSkeleton: { + lexicon: 1, + id: 'app.bsky.feed.getFeedSkeleton', + defs: { + main: { + type: 'query', + description: 'A skeleton of a feed provided by a feed generator', + parameters: { + type: 'params', + required: ['feed'], + properties: { + feed: { + type: 'string', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#skeletonFeedPost', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedGetLikes: { + lexicon: 1, + id: 'app.bsky.feed.getLikes', + defs: { + main: { + type: 'query', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['uri', 'likes'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + cursor: { + type: 'string', + }, + likes: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.getLikes#like', + }, + }, + }, + }, + }, + }, + like: { + type: 'object', + required: ['indexedAt', 'createdAt', 'actor'], + properties: { + indexedAt: { + type: 'string', + format: 'datetime', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + actor: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + AppBskyFeedGetPostThread: { + lexicon: 1, + id: 'app.bsky.feed.getPostThread', + defs: { + main: { + type: 'query', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + depth: { + type: 'integer', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['thread'], + properties: { + thread: { + type: 'union', + refs: [ + 'lex:app.bsky.feed.defs#threadViewPost', + 'lex:app.bsky.feed.defs#notFoundPost', + 'lex:app.bsky.feed.defs#blockedPost', + ], + }, + }, + }, + }, + errors: [ + { + name: 'NotFound', + }, + ], + }, + }, + }, + AppBskyFeedGetPosts: { + lexicon: 1, + id: 'app.bsky.feed.getPosts', + defs: { + main: { + type: 'query', + description: "A view of an actor's feed.", + parameters: { + type: 'params', + required: ['uris'], + properties: { + uris: { + type: 'array', + items: { + type: 'string', + format: 'at-uri', + }, + maxLength: 25, + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['posts'], + properties: { + posts: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#postView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedGetRepostedBy: { + lexicon: 1, + id: 'app.bsky.feed.getRepostedBy', + defs: { + main: { + type: 'query', + parameters: { + type: 'params', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['uri', 'repostedBy'], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + cursor: { + type: 'string', + }, + repostedBy: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedGetTimeline: { + lexicon: 1, + id: 'app.bsky.feed.getTimeline', + defs: { + main: { + type: 'query', + description: "A view of the user's home timeline.", + parameters: { + type: 'params', + properties: { + algorithm: { + type: 'string', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#feedViewPost', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyFeedLike: { + lexicon: 1, + id: 'app.bsky.feed.like', + defs: { + main: { + type: 'record', + key: 'tid', + record: { + type: 'object', + required: ['subject', 'createdAt'], + properties: { + subject: { + type: 'ref', + ref: 'lex:com.atproto.repo.strongRef', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + }, + AppBskyFeedPost: { + lexicon: 1, + id: 'app.bsky.feed.post', + defs: { + main: { + type: 'record', + key: 'tid', + record: { + type: 'object', + required: ['text', 'createdAt'], + properties: { + text: { + type: 'string', + maxLength: 3000, + maxGraphemes: 300, + }, + entities: { + type: 'array', + description: 'Deprecated: replaced by app.bsky.richtext.facet.', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.post#entity', + }, + }, + facets: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.richtext.facet', + }, + }, + reply: { + type: 'ref', + ref: 'lex:app.bsky.feed.post#replyRef', + }, + embed: { + type: 'union', + refs: [ + 'lex:app.bsky.embed.images', + 'lex:app.bsky.embed.external', + 'lex:app.bsky.embed.record', + 'lex:app.bsky.embed.recordWithMedia', + ], + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + replyRef: { + type: 'object', + required: ['root', 'parent'], + properties: { + root: { + type: 'ref', + ref: 'lex:com.atproto.repo.strongRef', + }, + parent: { + type: 'ref', + ref: 'lex:com.atproto.repo.strongRef', + }, + }, + }, + entity: { + type: 'object', + description: 'Deprecated: use facets instead.', + required: ['index', 'type', 'value'], + properties: { + index: { + type: 'ref', + ref: 'lex:app.bsky.feed.post#textSlice', + }, + type: { + type: 'string', + description: "Expected values are 'mention' and 'link'.", + }, + value: { + type: 'string', + }, + }, + }, + textSlice: { + type: 'object', + description: + 'Deprecated. Use app.bsky.richtext instead -- A text segment. Start is inclusive, end is exclusive. Indices are for utf16-encoded strings.', + required: ['start', 'end'], + properties: { + start: { + type: 'integer', + minimum: 0, + }, + end: { + type: 'integer', + minimum: 0, + }, + }, + }, + }, + }, + AppBskyFeedRepost: { + lexicon: 1, + id: 'app.bsky.feed.repost', + defs: { + main: { + type: 'record', + key: 'tid', + record: { + type: 'object', + required: ['subject', 'createdAt'], + properties: { + subject: { + type: 'ref', + ref: 'lex:com.atproto.repo.strongRef', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + }, + AppBskyFeedUnbookmarkFeed: { + lexicon: 1, + id: 'app.bsky.feed.unbookmarkFeed', + defs: { + main: { + type: 'procedure', + description: 'Remove a bookmark for a 3rd party feed', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + feed: { + type: 'string', + format: 'at-identifier', + }, + }, + }, + }, + }, + }, + }, + AppBskyGraphBlock: { + lexicon: 1, + id: 'app.bsky.graph.block', + defs: { + main: { + type: 'record', + description: 'A block.', + key: 'tid', + record: { + type: 'object', + required: ['subject', 'createdAt'], + properties: { + subject: { + type: 'string', + format: 'did', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + }, + AppBskyGraphFollow: { + lexicon: 1, + id: 'app.bsky.graph.follow', + defs: { + main: { + type: 'record', + description: 'A social follow.', + key: 'tid', + record: { + type: 'object', + required: ['subject', 'createdAt'], + properties: { + subject: { + type: 'string', + format: 'did', + }, + createdAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + }, + AppBskyGraphGetBlocks: { + lexicon: 1, + id: 'app.bsky.graph.getBlocks', + defs: { + main: { + type: 'query', + description: "Who is the requester's account blocking?", + parameters: { + type: 'params', + properties: { + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['blocks'], + properties: { + cursor: { + type: 'string', + }, + blocks: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyGraphGetFollowers: { + lexicon: 1, + id: 'app.bsky.graph.getFollowers', + defs: { + main: { + type: 'query', + description: 'Who is following an actor?', + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['subject', 'followers'], + properties: { + subject: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + cursor: { + type: 'string', + }, + followers: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyGraphGetFollows: { + lexicon: 1, + id: 'app.bsky.graph.getFollows', + defs: { + main: { + type: 'query', + description: 'Who is an actor following?', + parameters: { + type: 'params', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['subject', 'follows'], + properties: { + subject: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + cursor: { + type: 'string', + }, + follows: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyGraphGetMutes: { + lexicon: 1, + id: 'app.bsky.graph.getMutes', + defs: { + main: { + type: 'query', + description: 'Who does the viewer mute?', + parameters: { + type: 'params', + properties: { + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['mutes'], + properties: { + cursor: { + type: 'string', + }, + mutes: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + }, + }, + }, + }, + }, + }, + }, + AppBskyGraphMuteActor: { + lexicon: 1, + id: 'app.bsky.graph.muteActor', + defs: { + main: { + type: 'procedure', + description: 'Mute an actor by did or handle.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + }, + }, + }, + }, + }, + }, + AppBskyGraphUnmuteActor: { + lexicon: 1, + id: 'app.bsky.graph.unmuteActor', + defs: { + main: { + type: 'procedure', + description: 'Unmute an actor by did or handle.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['actor'], + properties: { + actor: { + type: 'string', + format: 'at-identifier', + }, + }, + }, + }, + }, + }, + }, + AppBskyNotificationGetUnreadCount: { + lexicon: 1, + id: 'app.bsky.notification.getUnreadCount', + defs: { + main: { + type: 'query', + parameters: { + type: 'params', + properties: { + seenAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['count'], + properties: { + count: { + type: 'integer', + }, + }, + }, + }, + }, + }, + }, + AppBskyNotificationListNotifications: { + lexicon: 1, + id: 'app.bsky.notification.listNotifications', + defs: { + main: { + type: 'query', + parameters: { + type: 'params', + properties: { + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + seenAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['notifications'], + properties: { + cursor: { + type: 'string', + }, + notifications: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.notification.listNotifications#notification', + }, + }, + }, + }, + }, + }, + notification: { + type: 'object', + required: [ + 'uri', + 'cid', + 'author', + 'reason', + 'record', + 'isRead', + 'indexedAt', + ], + properties: { + uri: { + type: 'string', + format: 'at-uri', + }, + cid: { + type: 'string', + format: 'cid', + }, + author: { + type: 'ref', + ref: 'lex:app.bsky.actor.defs#profileView', + }, + reason: { + type: 'string', + description: + "Expected values are 'like', 'repost', 'follow', 'mention', 'reply', and 'quote'.", + knownValues: [ + 'like', + 'repost', + 'follow', + 'mention', + 'reply', + 'quote', + ], + }, + reasonSubject: { + type: 'string', + format: 'at-uri', + }, + record: { + type: 'unknown', + }, + isRead: { + type: 'boolean', + }, + indexedAt: { + type: 'string', + format: 'datetime', + }, + labels: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:com.atproto.label.defs#label', + }, + }, + }, + }, + }, + }, + AppBskyNotificationUpdateSeen: { + lexicon: 1, + id: 'app.bsky.notification.updateSeen', + defs: { + main: { + type: 'procedure', + description: 'Notify server that the user has seen notifications.', + input: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['seenAt'], + properties: { + seenAt: { + type: 'string', + format: 'datetime', + }, + }, + }, + }, + }, + }, + }, + AppBskyRichtextFacet: { + lexicon: 1, + id: 'app.bsky.richtext.facet', + defs: { + main: { + type: 'object', + required: ['index', 'features'], + properties: { + index: { + type: 'ref', + ref: 'lex:app.bsky.richtext.facet#byteSlice', + }, + features: { + type: 'array', + items: { + type: 'union', + refs: [ + 'lex:app.bsky.richtext.facet#mention', + 'lex:app.bsky.richtext.facet#link', + ], + }, + }, + }, + }, + mention: { + type: 'object', + description: 'A facet feature for actor mentions.', + required: ['did'], + properties: { + did: { + type: 'string', + format: 'did', + }, + }, + }, + link: { + type: 'object', + description: 'A facet feature for links.', + required: ['uri'], + properties: { + uri: { + type: 'string', + format: 'uri', + }, + }, + }, + byteSlice: { + type: 'object', + description: + 'A text segment. Start is inclusive, end is exclusive. Indices are for utf8-encoded strings.', + required: ['byteStart', 'byteEnd'], + properties: { + byteStart: { + type: 'integer', + minimum: 0, + }, + byteEnd: { + type: 'integer', + minimum: 0, + }, + }, + }, + }, + }, + AppBskyUnspeccedGetPopular: { + lexicon: 1, + id: 'app.bsky.unspecced.getPopular', + defs: { + main: { + type: 'query', + description: 'An unspecced view of globally popular items', + parameters: { + type: 'params', + properties: { + includeNsfw: { + type: 'boolean', + default: false, + }, + limit: { + type: 'integer', + minimum: 1, + maximum: 100, + default: 50, + }, + cursor: { + type: 'string', + }, + }, + }, + output: { + encoding: 'application/json', + schema: { + type: 'object', + required: ['feed'], + properties: { + cursor: { + type: 'string', + }, + feed: { + type: 'array', + items: { + type: 'ref', + ref: 'lex:app.bsky.feed.defs#feedViewPost', + }, + }, + }, + }, + }, + }, + }, + }, +} +export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[] +export const lexicons: Lexicons = new Lexicons(schemas) +export const ids = { + ComAtprotoAdminDefs: 'com.atproto.admin.defs', + ComAtprotoAdminDisableInviteCodes: 'com.atproto.admin.disableInviteCodes', + ComAtprotoAdminGetInviteCodes: 'com.atproto.admin.getInviteCodes', + ComAtprotoAdminGetModerationAction: 'com.atproto.admin.getModerationAction', + ComAtprotoAdminGetModerationActions: 'com.atproto.admin.getModerationActions', + ComAtprotoAdminGetModerationReport: 'com.atproto.admin.getModerationReport', + ComAtprotoAdminGetModerationReports: 'com.atproto.admin.getModerationReports', + ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord', + ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo', + ComAtprotoAdminResolveModerationReports: + 'com.atproto.admin.resolveModerationReports', + ComAtprotoAdminReverseModerationAction: + 'com.atproto.admin.reverseModerationAction', + ComAtprotoAdminSearchRepos: 'com.atproto.admin.searchRepos', + ComAtprotoAdminTakeModerationAction: 'com.atproto.admin.takeModerationAction', + ComAtprotoAdminUpdateAccountEmail: 'com.atproto.admin.updateAccountEmail', + ComAtprotoAdminUpdateAccountHandle: 'com.atproto.admin.updateAccountHandle', + ComAtprotoIdentityResolveHandle: 'com.atproto.identity.resolveHandle', + ComAtprotoIdentityUpdateHandle: 'com.atproto.identity.updateHandle', + ComAtprotoLabelDefs: 'com.atproto.label.defs', + ComAtprotoLabelQueryLabels: 'com.atproto.label.queryLabels', + ComAtprotoLabelSubscribeLabels: 'com.atproto.label.subscribeLabels', + ComAtprotoModerationCreateReport: 'com.atproto.moderation.createReport', + ComAtprotoModerationDefs: 'com.atproto.moderation.defs', + ComAtprotoRepoApplyWrites: 'com.atproto.repo.applyWrites', + ComAtprotoRepoCreateRecord: 'com.atproto.repo.createRecord', + ComAtprotoRepoDeleteRecord: 'com.atproto.repo.deleteRecord', + ComAtprotoRepoDescribeRepo: 'com.atproto.repo.describeRepo', + ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord', + ComAtprotoRepoListRecords: 'com.atproto.repo.listRecords', + ComAtprotoRepoPutRecord: 'com.atproto.repo.putRecord', + ComAtprotoRepoStrongRef: 'com.atproto.repo.strongRef', + ComAtprotoRepoUploadBlob: 'com.atproto.repo.uploadBlob', + ComAtprotoServerCreateAccount: 'com.atproto.server.createAccount', + ComAtprotoServerCreateAppPassword: 'com.atproto.server.createAppPassword', + ComAtprotoServerCreateInviteCode: 'com.atproto.server.createInviteCode', + ComAtprotoServerCreateInviteCodes: 'com.atproto.server.createInviteCodes', + ComAtprotoServerCreateSession: 'com.atproto.server.createSession', + ComAtprotoServerDefs: 'com.atproto.server.defs', + ComAtprotoServerDeleteAccount: 'com.atproto.server.deleteAccount', + ComAtprotoServerDeleteSession: 'com.atproto.server.deleteSession', + ComAtprotoServerDescribeServer: 'com.atproto.server.describeServer', + ComAtprotoServerGetAccountInviteCodes: + 'com.atproto.server.getAccountInviteCodes', + ComAtprotoServerGetSession: 'com.atproto.server.getSession', + ComAtprotoServerListAppPasswords: 'com.atproto.server.listAppPasswords', + ComAtprotoServerRefreshSession: 'com.atproto.server.refreshSession', + ComAtprotoServerRequestAccountDelete: + 'com.atproto.server.requestAccountDelete', + ComAtprotoServerRequestPasswordReset: + 'com.atproto.server.requestPasswordReset', + ComAtprotoServerResetPassword: 'com.atproto.server.resetPassword', + ComAtprotoServerRevokeAppPassword: 'com.atproto.server.revokeAppPassword', + ComAtprotoSyncGetBlob: 'com.atproto.sync.getBlob', + ComAtprotoSyncGetBlocks: 'com.atproto.sync.getBlocks', + ComAtprotoSyncGetCheckout: 'com.atproto.sync.getCheckout', + ComAtprotoSyncGetCommitPath: 'com.atproto.sync.getCommitPath', + ComAtprotoSyncGetHead: 'com.atproto.sync.getHead', + ComAtprotoSyncGetRecord: 'com.atproto.sync.getRecord', + ComAtprotoSyncGetRepo: 'com.atproto.sync.getRepo', + ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs', + ComAtprotoSyncListRepos: 'com.atproto.sync.listRepos', + ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate', + ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl', + ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos', + AppBskyActorDefs: 'app.bsky.actor.defs', + AppBskyActorGetProfile: 'app.bsky.actor.getProfile', + AppBskyActorGetProfiles: 'app.bsky.actor.getProfiles', + AppBskyActorGetSuggestions: 'app.bsky.actor.getSuggestions', + AppBskyActorProfile: 'app.bsky.actor.profile', + AppBskyActorSearchActors: 'app.bsky.actor.searchActors', + AppBskyActorSearchActorsTypeahead: 'app.bsky.actor.searchActorsTypeahead', + AppBskyEmbedExternal: 'app.bsky.embed.external', + AppBskyEmbedImages: 'app.bsky.embed.images', + AppBskyEmbedRecord: 'app.bsky.embed.record', + AppBskyEmbedRecordWithMedia: 'app.bsky.embed.recordWithMedia', + AppBskyFeedBookmarkFeed: 'app.bsky.feed.bookmarkFeed', + AppBskyFeedDefs: 'app.bsky.feed.defs', + AppBskyFeedGetAuthorFeed: 'app.bsky.feed.getAuthorFeed', + AppBskyFeedGetBookmarkedFeeds: 'app.bsky.feed.getBookmarkedFeeds', + AppBskyFeedGetFeed: 'app.bsky.feed.getFeed', + AppBskyFeedGetFeedSkeleton: 'app.bsky.feed.getFeedSkeleton', + AppBskyFeedGetLikes: 'app.bsky.feed.getLikes', + AppBskyFeedGetPostThread: 'app.bsky.feed.getPostThread', + AppBskyFeedGetPosts: 'app.bsky.feed.getPosts', + AppBskyFeedGetRepostedBy: 'app.bsky.feed.getRepostedBy', + AppBskyFeedGetTimeline: 'app.bsky.feed.getTimeline', + AppBskyFeedLike: 'app.bsky.feed.like', + AppBskyFeedPost: 'app.bsky.feed.post', + AppBskyFeedRepost: 'app.bsky.feed.repost', + AppBskyFeedUnbookmarkFeed: 'app.bsky.feed.unbookmarkFeed', + AppBskyGraphBlock: 'app.bsky.graph.block', + AppBskyGraphFollow: 'app.bsky.graph.follow', + AppBskyGraphGetBlocks: 'app.bsky.graph.getBlocks', + AppBskyGraphGetFollowers: 'app.bsky.graph.getFollowers', + AppBskyGraphGetFollows: 'app.bsky.graph.getFollows', + AppBskyGraphGetMutes: 'app.bsky.graph.getMutes', + AppBskyGraphMuteActor: 'app.bsky.graph.muteActor', + AppBskyGraphUnmuteActor: 'app.bsky.graph.unmuteActor', + AppBskyNotificationGetUnreadCount: 'app.bsky.notification.getUnreadCount', + AppBskyNotificationListNotifications: + 'app.bsky.notification.listNotifications', + AppBskyNotificationUpdateSeen: 'app.bsky.notification.updateSeen', + AppBskyRichtextFacet: 'app.bsky.richtext.facet', + AppBskyUnspeccedGetPopular: 'app.bsky.unspecced.getPopular', +} diff --git a/src/lexicon/types/app/bsky/actor/defs.ts b/src/lexicon/types/app/bsky/actor/defs.ts new file mode 100644 index 0000000..3d826c4 --- /dev/null +++ b/src/lexicon/types/app/bsky/actor/defs.ts @@ -0,0 +1,134 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' + +export interface ProfileViewBasic { + did: string + handle: string + displayName?: string + avatar?: string + actorType?: ActorType + viewer?: ViewerState + labels?: ComAtprotoLabelDefs.Label[] + [k: string]: unknown +} + +export function isProfileViewBasic(v: unknown): v is ProfileViewBasic { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.actor.defs#profileViewBasic' + ) +} + +export function validateProfileViewBasic(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.actor.defs#profileViewBasic', v) +} + +export interface ProfileView { + did: string + handle: string + displayName?: string + description?: string + avatar?: string + actorType?: ActorType + indexedAt?: string + viewer?: ViewerState + labels?: ComAtprotoLabelDefs.Label[] + [k: string]: unknown +} + +export function isProfileView(v: unknown): v is ProfileView { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.actor.defs#profileView' + ) +} + +export function validateProfileView(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.actor.defs#profileView', v) +} + +export interface ProfileViewDetailed { + did: string + handle: string + displayName?: string + description?: string + avatar?: string + actorType?: ActorType + actorInfo?: InfoFeedGenerator | { $type: string; [k: string]: unknown } + banner?: string + followersCount?: number + followsCount?: number + postsCount?: number + indexedAt?: string + viewer?: ViewerState + labels?: ComAtprotoLabelDefs.Label[] + [k: string]: unknown +} + +export function isProfileViewDetailed(v: unknown): v is ProfileViewDetailed { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.actor.defs#profileViewDetailed' + ) +} + +export function validateProfileViewDetailed(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.actor.defs#profileViewDetailed', v) +} + +export interface ViewerState { + muted?: boolean + blockedBy?: boolean + blocking?: string + following?: string + followedBy?: string + [k: string]: unknown +} + +export function isViewerState(v: unknown): v is ViewerState { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.actor.defs#viewerState' + ) +} + +export function validateViewerState(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.actor.defs#viewerState', v) +} + +export interface InfoFeedGenerator { + likes: number + [k: string]: unknown +} + +export function isInfoFeedGenerator(v: unknown): v is InfoFeedGenerator { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.actor.defs#infoFeedGenerator' + ) +} + +export function validateInfoFeedGenerator(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.actor.defs#infoFeedGenerator', v) +} + +export type ActorType = + | 'app.bsky.actor.defs#user' + | 'app.bsky.actor.defs#feedGenerator' + | (string & {}) + +/** Actor type: User. This is the default option and an actor is assumed to be a user unless suggested otherwise. */ +export const USER = 'app.bsky.actor.defs#user' +/** Actor type: Feed Generator. A service that provides a custom feed. */ +export const FEEDGENERATOR = 'app.bsky.actor.defs#feedGenerator' diff --git a/src/lexicon/types/app/bsky/actor/getProfile.ts b/src/lexicon/types/app/bsky/actor/getProfile.ts new file mode 100644 index 0000000..b5ed609 --- /dev/null +++ b/src/lexicon/types/app/bsky/actor/getProfile.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/getProfiles.ts b/src/lexicon/types/app/bsky/actor/getProfiles.ts new file mode 100644 index 0000000..992261e --- /dev/null +++ b/src/lexicon/types/app/bsky/actor/getProfiles.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/getSuggestions.ts b/src/lexicon/types/app/bsky/actor/getSuggestions.ts new file mode 100644 index 0000000..a376212 --- /dev/null +++ b/src/lexicon/types/app/bsky/actor/getSuggestions.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/profile.ts b/src/lexicon/types/app/bsky/actor/profile.ts new file mode 100644 index 0000000..2d4bf52 --- /dev/null +++ b/src/lexicon/types/app/bsky/actor/profile.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/actor/searchActors.ts b/src/lexicon/types/app/bsky/actor/searchActors.ts new file mode 100644 index 0000000..8c5cf57 --- /dev/null +++ b/src/lexicon/types/app/bsky/actor/searchActors.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts b/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts new file mode 100644 index 0000000..7dfae72 --- /dev/null +++ b/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/embed/external.ts b/src/lexicon/types/app/bsky/embed/external.ts new file mode 100644 index 0000000..f42a6cf --- /dev/null +++ b/src/lexicon/types/app/bsky/embed/external.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/embed/images.ts b/src/lexicon/types/app/bsky/embed/images.ts new file mode 100644 index 0000000..422b036 --- /dev/null +++ b/src/lexicon/types/app/bsky/embed/images.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/embed/record.ts b/src/lexicon/types/app/bsky/embed/record.ts new file mode 100644 index 0000000..3b13e3d --- /dev/null +++ b/src/lexicon/types/app/bsky/embed/record.ts @@ -0,0 +1,113 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef' +import * as AppBskyActorDefs from '../actor/defs' +import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' +import * as AppBskyEmbedImages from './images' +import * as AppBskyEmbedExternal from './external' +import * as AppBskyEmbedRecordWithMedia from './recordWithMedia' + +export interface Main { + record: ComAtprotoRepoStrongRef.Main + [k: string]: unknown +} + +export function isMain(v: unknown): v is Main { + return ( + isObj(v) && + hasProp(v, '$type') && + (v.$type === 'app.bsky.embed.record#main' || + v.$type === 'app.bsky.embed.record') + ) +} + +export function validateMain(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.embed.record#main', v) +} + +export interface View { + record: + | ViewRecord + | ViewNotFound + | ViewBlocked + | { $type: string; [k: string]: unknown } + [k: string]: unknown +} + +export function isView(v: unknown): v is View { + return ( + isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.record#view' + ) +} + +export function validateView(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.embed.record#view', v) +} + +export interface ViewRecord { + uri: string + cid: string + author: AppBskyActorDefs.ProfileViewBasic + value: {} + labels?: ComAtprotoLabelDefs.Label[] + embeds?: ( + | AppBskyEmbedImages.View + | AppBskyEmbedExternal.View + | View + | AppBskyEmbedRecordWithMedia.View + | { $type: string; [k: string]: unknown } + )[] + indexedAt: string + [k: string]: unknown +} + +export function isViewRecord(v: unknown): v is ViewRecord { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.embed.record#viewRecord' + ) +} + +export function validateViewRecord(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.embed.record#viewRecord', v) +} + +export interface ViewNotFound { + uri: string + [k: string]: unknown +} + +export function isViewNotFound(v: unknown): v is ViewNotFound { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.embed.record#viewNotFound' + ) +} + +export function validateViewNotFound(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.embed.record#viewNotFound', v) +} + +export interface ViewBlocked { + uri: string + [k: string]: unknown +} + +export function isViewBlocked(v: unknown): v is ViewBlocked { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.embed.record#viewBlocked' + ) +} + +export function validateViewBlocked(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.embed.record#viewBlocked', v) +} diff --git a/src/lexicon/types/app/bsky/embed/recordWithMedia.ts b/src/lexicon/types/app/bsky/embed/recordWithMedia.ts new file mode 100644 index 0000000..f8f1ae5 --- /dev/null +++ b/src/lexicon/types/app/bsky/embed/recordWithMedia.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/feed/bookmarkFeed.ts b/src/lexicon/types/app/bsky/feed/bookmarkFeed.ts new file mode 100644 index 0000000..d4d61e6 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/bookmarkFeed.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/defs.ts b/src/lexicon/types/app/bsky/feed/defs.ts new file mode 100644 index 0000000..cda2c4b --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/defs.ts @@ -0,0 +1,241 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import * as AppBskyActorDefs from '../actor/defs' +import * as AppBskyEmbedImages from '../embed/images' +import * as AppBskyEmbedExternal from '../embed/external' +import * as AppBskyEmbedRecord from '../embed/record' +import * as AppBskyEmbedRecordWithMedia from '../embed/recordWithMedia' +import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs' + +export interface PostView { + uri: string + cid: string + author: AppBskyActorDefs.ProfileViewBasic + record: {} + embed?: + | AppBskyEmbedImages.View + | AppBskyEmbedExternal.View + | AppBskyEmbedRecord.View + | AppBskyEmbedRecordWithMedia.View + | { $type: string; [k: string]: unknown } + replyCount?: number + repostCount?: number + likeCount?: number + indexedAt: string + viewer?: ViewerState + labels?: ComAtprotoLabelDefs.Label[] + [k: string]: unknown +} + +export function isPostView(v: unknown): v is PostView { + return ( + isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#postView' + ) +} + +export function validatePostView(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#postView', v) +} + +export interface ViewerState { + repost?: string + like?: string + [k: string]: unknown +} + +export function isViewerState(v: unknown): v is ViewerState { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#viewerState' + ) +} + +export function validateViewerState(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#viewerState', v) +} + +export interface FeedViewPost { + post: PostView + reply?: ReplyRef + reason?: ReasonRepost | { $type: string; [k: string]: unknown } + [k: string]: unknown +} + +export function isFeedViewPost(v: unknown): v is FeedViewPost { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#feedViewPost' + ) +} + +export function validateFeedViewPost(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#feedViewPost', v) +} + +export interface ReplyRef { + root: + | PostView + | NotFoundPost + | BlockedPost + | { $type: string; [k: string]: unknown } + parent: + | PostView + | NotFoundPost + | BlockedPost + | { $type: string; [k: string]: unknown } + [k: string]: unknown +} + +export function isReplyRef(v: unknown): v is ReplyRef { + return ( + isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.feed.defs#replyRef' + ) +} + +export function validateReplyRef(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#replyRef', v) +} + +export interface ReasonRepost { + by: AppBskyActorDefs.ProfileViewBasic + indexedAt: string + [k: string]: unknown +} + +export function isReasonRepost(v: unknown): v is ReasonRepost { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#reasonRepost' + ) +} + +export function validateReasonRepost(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#reasonRepost', v) +} + +export interface ThreadViewPost { + post: PostView + parent?: + | ThreadViewPost + | NotFoundPost + | BlockedPost + | { $type: string; [k: string]: unknown } + replies?: ( + | ThreadViewPost + | NotFoundPost + | BlockedPost + | { $type: string; [k: string]: unknown } + )[] + [k: string]: unknown +} + +export function isThreadViewPost(v: unknown): v is ThreadViewPost { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#threadViewPost' + ) +} + +export function validateThreadViewPost(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#threadViewPost', v) +} + +export interface NotFoundPost { + uri: string + notFound: true + [k: string]: unknown +} + +export function isNotFoundPost(v: unknown): v is NotFoundPost { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#notFoundPost' + ) +} + +export function validateNotFoundPost(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#notFoundPost', v) +} + +export interface BlockedPost { + uri: string + blocked: true + [k: string]: unknown +} + +export function isBlockedPost(v: unknown): v is BlockedPost { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#blockedPost' + ) +} + +export function validateBlockedPost(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#blockedPost', v) +} + +export interface SkeletonFeedPost { + post: string + replyTo?: SkeletonReplyRef + reason?: SkeletonReasonRepost | { $type: string; [k: string]: unknown } + [k: string]: unknown +} + +export function isSkeletonFeedPost(v: unknown): v is SkeletonFeedPost { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#skeletonFeedPost' + ) +} + +export function validateSkeletonFeedPost(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#skeletonFeedPost', v) +} + +export interface SkeletonReplyRef { + root: string + parent: string + [k: string]: unknown +} + +export function isSkeletonReplyRef(v: unknown): v is SkeletonReplyRef { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#skeletonReplyRef' + ) +} + +export function validateSkeletonReplyRef(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#skeletonReplyRef', v) +} + +export interface SkeletonReasonRepost { + by: string + indexedAt: string + [k: string]: unknown +} + +export function isSkeletonReasonRepost(v: unknown): v is SkeletonReasonRepost { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'app.bsky.feed.defs#skeletonReasonRepost' + ) +} + +export function validateSkeletonReasonRepost(v: unknown): ValidationResult { + return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v) +} diff --git a/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts b/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts new file mode 100644 index 0000000..ca7806a --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getBookmarkedFeeds.ts b/src/lexicon/types/app/bsky/feed/getBookmarkedFeeds.ts new file mode 100644 index 0000000..0dad0a9 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getBookmarkedFeeds.ts @@ -0,0 +1,44 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyActorDefs from '../actor/defs' + +export interface QueryParams { + limit: number + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + feeds: AppBskyActorDefs.ProfileView[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getFeed.ts b/src/lexicon/types/app/bsky/feed/getFeed.ts new file mode 100644 index 0000000..59114f9 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getFeed.ts @@ -0,0 +1,45 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyFeedDefs from './defs' + +export interface QueryParams { + feed: string + limit: number + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + feed: AppBskyFeedDefs.FeedViewPost[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts b/src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts new file mode 100644 index 0000000..efbb2ea --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts @@ -0,0 +1,45 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as AppBskyFeedDefs from './defs' + +export interface QueryParams { + feed: string + limit: number + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + feed: AppBskyFeedDefs.SkeletonFeedPost[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getLikes.ts b/src/lexicon/types/app/bsky/feed/getLikes.ts new file mode 100644 index 0000000..3163089 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getLikes.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | 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) +} diff --git a/src/lexicon/types/app/bsky/feed/getPostThread.ts b/src/lexicon/types/app/bsky/feed/getPostThread.ts new file mode 100644 index 0000000..134228c --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getPostThread.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getPosts.ts b/src/lexicon/types/app/bsky/feed/getPosts.ts new file mode 100644 index 0000000..7376d43 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getPosts.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getRepostedBy.ts b/src/lexicon/types/app/bsky/feed/getRepostedBy.ts new file mode 100644 index 0000000..ad4f7de --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getRepostedBy.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/getTimeline.ts b/src/lexicon/types/app/bsky/feed/getTimeline.ts new file mode 100644 index 0000000..8a73397 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/getTimeline.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/feed/like.ts b/src/lexicon/types/app/bsky/feed/like.ts new file mode 100644 index 0000000..1da9dd9 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/like.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/feed/post.ts b/src/lexicon/types/app/bsky/feed/post.ts new file mode 100644 index 0000000..f376078 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/post.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/feed/repost.ts b/src/lexicon/types/app/bsky/feed/repost.ts new file mode 100644 index 0000000..4c836d7 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/repost.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/feed/unbookmarkFeed.ts b/src/lexicon/types/app/bsky/feed/unbookmarkFeed.ts new file mode 100644 index 0000000..d4d61e6 --- /dev/null +++ b/src/lexicon/types/app/bsky/feed/unbookmarkFeed.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/block.ts b/src/lexicon/types/app/bsky/graph/block.ts new file mode 100644 index 0000000..947463a --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/block.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/graph/follow.ts b/src/lexicon/types/app/bsky/graph/follow.ts new file mode 100644 index 0000000..4b74a58 --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/follow.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/graph/getBlocks.ts b/src/lexicon/types/app/bsky/graph/getBlocks.ts new file mode 100644 index 0000000..6ac56b3 --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/getBlocks.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getFollowers.ts b/src/lexicon/types/app/bsky/graph/getFollowers.ts new file mode 100644 index 0000000..7262aaf --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/getFollowers.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getFollows.ts b/src/lexicon/types/app/bsky/graph/getFollows.ts new file mode 100644 index 0000000..8c47e1b --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/getFollows.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/getMutes.ts b/src/lexicon/types/app/bsky/graph/getMutes.ts new file mode 100644 index 0000000..55806ac --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/getMutes.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/muteActor.ts b/src/lexicon/types/app/bsky/graph/muteActor.ts new file mode 100644 index 0000000..fd19f66 --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/muteActor.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/graph/unmuteActor.ts b/src/lexicon/types/app/bsky/graph/unmuteActor.ts new file mode 100644 index 0000000..fd19f66 --- /dev/null +++ b/src/lexicon/types/app/bsky/graph/unmuteActor.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/notification/getUnreadCount.ts b/src/lexicon/types/app/bsky/notification/getUnreadCount.ts new file mode 100644 index 0000000..2f49ca1 --- /dev/null +++ b/src/lexicon/types/app/bsky/notification/getUnreadCount.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/notification/listNotifications.ts b/src/lexicon/types/app/bsky/notification/listNotifications.ts new file mode 100644 index 0000000..09f913a --- /dev/null +++ b/src/lexicon/types/app/bsky/notification/listNotifications.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | 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, + ) +} diff --git a/src/lexicon/types/app/bsky/notification/updateSeen.ts b/src/lexicon/types/app/bsky/notification/updateSeen.ts new file mode 100644 index 0000000..177f1f4 --- /dev/null +++ b/src/lexicon/types/app/bsky/notification/updateSeen.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/app/bsky/richtext/facet.ts b/src/lexicon/types/app/bsky/richtext/facet.ts new file mode 100644 index 0000000..a7369ee --- /dev/null +++ b/src/lexicon/types/app/bsky/richtext/facet.ts @@ -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) +} diff --git a/src/lexicon/types/app/bsky/unspecced/getPopular.ts b/src/lexicon/types/app/bsky/unspecced/getPopular.ts new file mode 100644 index 0000000..b91dbe7 --- /dev/null +++ b/src/lexicon/types/app/bsky/unspecced/getPopular.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/defs.ts b/src/lexicon/types/com/atproto/admin/defs.ts new file mode 100644 index 0000000..f78afce --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/defs.ts @@ -0,0 +1,380 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import * as ComAtprotoRepoStrongRef from '../repo/strongRef' +import * as ComAtprotoModerationDefs from '../moderation/defs' +import * as ComAtprotoServerDefs from '../server/defs' +import * as ComAtprotoLabelDefs from '../label/defs' + +export interface ActionView { + id: number + action: ActionType + subject: + | RepoRef + | ComAtprotoRepoStrongRef.Main + | { $type: string; [k: string]: unknown } + subjectBlobCids: string[] + createLabelVals?: string[] + negateLabelVals?: string[] + reason: string + createdBy: string + createdAt: string + reversal?: ActionReversal + resolvedReportIds: number[] + [k: string]: unknown +} + +export function isActionView(v: unknown): v is ActionView { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#actionView' + ) +} + +export function validateActionView(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#actionView', v) +} + +export interface ActionViewDetail { + id: number + action: ActionType + subject: RepoView | RecordView | { $type: string; [k: string]: unknown } + subjectBlobs: BlobView[] + createLabelVals?: string[] + negateLabelVals?: string[] + reason: string + createdBy: string + createdAt: string + reversal?: ActionReversal + resolvedReports: ReportView[] + [k: string]: unknown +} + +export function isActionViewDetail(v: unknown): v is ActionViewDetail { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#actionViewDetail' + ) +} + +export function validateActionViewDetail(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#actionViewDetail', v) +} + +export interface ActionViewCurrent { + id: number + action: ActionType + [k: string]: unknown +} + +export function isActionViewCurrent(v: unknown): v is ActionViewCurrent { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#actionViewCurrent' + ) +} + +export function validateActionViewCurrent(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#actionViewCurrent', v) +} + +export interface ActionReversal { + reason: string + createdBy: string + createdAt: string + [k: string]: unknown +} + +export function isActionReversal(v: unknown): v is ActionReversal { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#actionReversal' + ) +} + +export function validateActionReversal(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#actionReversal', v) +} + +export type ActionType = + | 'lex:com.atproto.admin.defs#takedown' + | 'lex:com.atproto.admin.defs#flag' + | 'lex:com.atproto.admin.defs#acknowledge' + | 'lex:com.atproto.admin.defs#escalate' + | (string & {}) + +/** Moderation action type: Takedown. Indicates that content should not be served by the PDS. */ +export const TAKEDOWN = 'com.atproto.admin.defs#takedown' +/** Moderation action type: Flag. Indicates that the content was reviewed and considered to violate PDS rules, but may still be served. */ +export const FLAG = 'com.atproto.admin.defs#flag' +/** Moderation action type: Acknowledge. Indicates that the content was reviewed and not considered to violate PDS rules. */ +export const ACKNOWLEDGE = 'com.atproto.admin.defs#acknowledge' +/** Moderation action type: Escalate. Indicates that the content has been flagged for additional review. */ +export const ESCALATE = 'com.atproto.admin.defs#escalate' + +export interface ReportView { + id: number + reasonType: ComAtprotoModerationDefs.ReasonType + reason?: string + subject: + | RepoRef + | ComAtprotoRepoStrongRef.Main + | { $type: string; [k: string]: unknown } + reportedBy: string + createdAt: string + resolvedByActionIds: number[] + [k: string]: unknown +} + +export function isReportView(v: unknown): v is ReportView { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#reportView' + ) +} + +export function validateReportView(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#reportView', v) +} + +export interface ReportViewDetail { + id: number + reasonType: ComAtprotoModerationDefs.ReasonType + reason?: string + subject: RepoView | RecordView | { $type: string; [k: string]: unknown } + reportedBy: string + createdAt: string + resolvedByActions: ActionView[] + [k: string]: unknown +} + +export function isReportViewDetail(v: unknown): v is ReportViewDetail { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#reportViewDetail' + ) +} + +export function validateReportViewDetail(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#reportViewDetail', v) +} + +export interface RepoView { + did: string + handle: string + email?: string + relatedRecords: {}[] + indexedAt: string + moderation: Moderation + invitedBy?: ComAtprotoServerDefs.InviteCode + [k: string]: unknown +} + +export function isRepoView(v: unknown): v is RepoView { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#repoView' + ) +} + +export function validateRepoView(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#repoView', v) +} + +export interface RepoViewDetail { + did: string + handle: string + email?: string + relatedRecords: {}[] + indexedAt: string + moderation: ModerationDetail + labels?: ComAtprotoLabelDefs.Label[] + invitedBy?: ComAtprotoServerDefs.InviteCode + invites?: ComAtprotoServerDefs.InviteCode[] + [k: string]: unknown +} + +export function isRepoViewDetail(v: unknown): v is RepoViewDetail { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#repoViewDetail' + ) +} + +export function validateRepoViewDetail(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#repoViewDetail', v) +} + +export interface RepoRef { + did: string + [k: string]: unknown +} + +export function isRepoRef(v: unknown): v is RepoRef { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#repoRef' + ) +} + +export function validateRepoRef(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#repoRef', v) +} + +export interface RecordView { + uri: string + cid: string + value: {} + blobCids: string[] + indexedAt: string + moderation: Moderation + repo: RepoView + [k: string]: unknown +} + +export function isRecordView(v: unknown): v is RecordView { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#recordView' + ) +} + +export function validateRecordView(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#recordView', v) +} + +export interface RecordViewDetail { + uri: string + cid: string + value: {} + blobs: BlobView[] + labels?: ComAtprotoLabelDefs.Label[] + indexedAt: string + moderation: ModerationDetail + repo: RepoView + [k: string]: unknown +} + +export function isRecordViewDetail(v: unknown): v is RecordViewDetail { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#recordViewDetail' + ) +} + +export function validateRecordViewDetail(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#recordViewDetail', v) +} + +export interface Moderation { + currentAction?: ActionViewCurrent + [k: string]: unknown +} + +export function isModeration(v: unknown): v is Moderation { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#moderation' + ) +} + +export function validateModeration(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#moderation', v) +} + +export interface ModerationDetail { + currentAction?: ActionViewCurrent + actions: ActionView[] + reports: ReportView[] + [k: string]: unknown +} + +export function isModerationDetail(v: unknown): v is ModerationDetail { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#moderationDetail' + ) +} + +export function validateModerationDetail(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#moderationDetail', v) +} + +export interface BlobView { + cid: string + mimeType: string + size: number + createdAt: string + details?: + | ImageDetails + | VideoDetails + | { $type: string; [k: string]: unknown } + moderation?: Moderation + [k: string]: unknown +} + +export function isBlobView(v: unknown): v is BlobView { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#blobView' + ) +} + +export function validateBlobView(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#blobView', v) +} + +export interface ImageDetails { + width: number + height: number + [k: string]: unknown +} + +export function isImageDetails(v: unknown): v is ImageDetails { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#imageDetails' + ) +} + +export function validateImageDetails(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#imageDetails', v) +} + +export interface VideoDetails { + width: number + height: number + length: number + [k: string]: unknown +} + +export function isVideoDetails(v: unknown): v is VideoDetails { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.admin.defs#videoDetails' + ) +} + +export function validateVideoDetails(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.admin.defs#videoDetails', v) +} diff --git a/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts b/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts new file mode 100644 index 0000000..2e9d326 --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getInviteCodes.ts b/src/lexicon/types/com/atproto/admin/getInviteCodes.ts new file mode 100644 index 0000000..3e3f97a --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/getInviteCodes.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getModerationAction.ts b/src/lexicon/types/com/atproto/admin/getModerationAction.ts new file mode 100644 index 0000000..35c2086 --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/getModerationAction.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getModerationActions.ts b/src/lexicon/types/com/atproto/admin/getModerationActions.ts new file mode 100644 index 0000000..2eb2d76 --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/getModerationActions.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getModerationReport.ts b/src/lexicon/types/com/atproto/admin/getModerationReport.ts new file mode 100644 index 0000000..9794514 --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/getModerationReport.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getModerationReports.ts b/src/lexicon/types/com/atproto/admin/getModerationReports.ts new file mode 100644 index 0000000..f92f207 --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/getModerationReports.ts @@ -0,0 +1,46 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as ComAtprotoAdminDefs from './defs' + +export interface QueryParams { + subject?: string + resolved?: boolean + limit: number + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + reports: ComAtprotoAdminDefs.ReportView[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getRecord.ts b/src/lexicon/types/com/atproto/admin/getRecord.ts new file mode 100644 index 0000000..f89ce9b --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/getRecord.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/getRepo.ts b/src/lexicon/types/com/atproto/admin/getRepo.ts new file mode 100644 index 0000000..836e6e5 --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/getRepo.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/resolveModerationReports.ts b/src/lexicon/types/com/atproto/admin/resolveModerationReports.ts new file mode 100644 index 0000000..912a745 --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/resolveModerationReports.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/reverseModerationAction.ts b/src/lexicon/types/com/atproto/admin/reverseModerationAction.ts new file mode 100644 index 0000000..6f2399f --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/reverseModerationAction.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/searchRepos.ts b/src/lexicon/types/com/atproto/admin/searchRepos.ts new file mode 100644 index 0000000..abfda14 --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/searchRepos.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/takeModerationAction.ts b/src/lexicon/types/com/atproto/admin/takeModerationAction.ts new file mode 100644 index 0000000..977c6ba --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/takeModerationAction.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts b/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts new file mode 100644 index 0000000..eb00af0 --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts b/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts new file mode 100644 index 0000000..b9bb76a --- /dev/null +++ b/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/identity/resolveHandle.ts b/src/lexicon/types/com/atproto/identity/resolveHandle.ts new file mode 100644 index 0000000..132cb43 --- /dev/null +++ b/src/lexicon/types/com/atproto/identity/resolveHandle.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/identity/updateHandle.ts b/src/lexicon/types/com/atproto/identity/updateHandle.ts new file mode 100644 index 0000000..c0c3cf5 --- /dev/null +++ b/src/lexicon/types/com/atproto/identity/updateHandle.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/label/defs.ts b/src/lexicon/types/com/atproto/label/defs.ts new file mode 100644 index 0000000..17a8480 --- /dev/null +++ b/src/lexicon/types/com/atproto/label/defs.ts @@ -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) +} diff --git a/src/lexicon/types/com/atproto/label/queryLabels.ts b/src/lexicon/types/com/atproto/label/queryLabels.ts new file mode 100644 index 0000000..1f085d2 --- /dev/null +++ b/src/lexicon/types/com/atproto/label/queryLabels.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/label/subscribeLabels.ts b/src/lexicon/types/com/atproto/label/subscribeLabels.ts new file mode 100644 index 0000000..758407e --- /dev/null +++ b/src/lexicon/types/com/atproto/label/subscribeLabels.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + req: IncomingMessage + signal: AbortSignal +}) => AsyncIterable + +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) +} diff --git a/src/lexicon/types/com/atproto/moderation/createReport.ts b/src/lexicon/types/com/atproto/moderation/createReport.ts new file mode 100644 index 0000000..73be720 --- /dev/null +++ b/src/lexicon/types/com/atproto/moderation/createReport.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/moderation/defs.ts b/src/lexicon/types/com/atproto/moderation/defs.ts new file mode 100644 index 0000000..9ab6e60 --- /dev/null +++ b/src/lexicon/types/com/atproto/moderation/defs.ts @@ -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' diff --git a/src/lexicon/types/com/atproto/repo/applyWrites.ts b/src/lexicon/types/com/atproto/repo/applyWrites.ts new file mode 100644 index 0000000..6fba024 --- /dev/null +++ b/src/lexicon/types/com/atproto/repo/applyWrites.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | 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) +} diff --git a/src/lexicon/types/com/atproto/repo/createRecord.ts b/src/lexicon/types/com/atproto/repo/createRecord.ts new file mode 100644 index 0000000..6c19d53 --- /dev/null +++ b/src/lexicon/types/com/atproto/repo/createRecord.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/deleteRecord.ts b/src/lexicon/types/com/atproto/repo/deleteRecord.ts new file mode 100644 index 0000000..016547e --- /dev/null +++ b/src/lexicon/types/com/atproto/repo/deleteRecord.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/describeRepo.ts b/src/lexicon/types/com/atproto/repo/describeRepo.ts new file mode 100644 index 0000000..d035bba --- /dev/null +++ b/src/lexicon/types/com/atproto/repo/describeRepo.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/getRecord.ts b/src/lexicon/types/com/atproto/repo/getRecord.ts new file mode 100644 index 0000000..fe81fbc --- /dev/null +++ b/src/lexicon/types/com/atproto/repo/getRecord.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/listRecords.ts b/src/lexicon/types/com/atproto/repo/listRecords.ts new file mode 100644 index 0000000..81e2ddc --- /dev/null +++ b/src/lexicon/types/com/atproto/repo/listRecords.ts @@ -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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | 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) +} diff --git a/src/lexicon/types/com/atproto/repo/putRecord.ts b/src/lexicon/types/com/atproto/repo/putRecord.ts new file mode 100644 index 0000000..13a0672 --- /dev/null +++ b/src/lexicon/types/com/atproto/repo/putRecord.ts @@ -0,0 +1,60 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + /** The handle or DID of the repo. */ + repo: string + /** The NSID of the record collection. */ + collection: string + /** The key of the record. */ + rkey: string + /** Validate the record? */ + validate: boolean + /** The record to write. */ + record: {} + /** Compare and swap with the previous record by cid. */ + swapRecord?: string | null + /** Compare and swap with the previous commit by cid. */ + swapCommit?: string + [k: string]: unknown +} + +export interface OutputSchema { + uri: string + cid: string + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string + error?: 'InvalidSwap' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/repo/strongRef.ts b/src/lexicon/types/com/atproto/repo/strongRef.ts new file mode 100644 index 0000000..8b21a6d --- /dev/null +++ b/src/lexicon/types/com/atproto/repo/strongRef.ts @@ -0,0 +1,26 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' + +export interface Main { + uri: string + cid: string + [k: string]: unknown +} + +export function isMain(v: unknown): v is Main { + return ( + isObj(v) && + hasProp(v, '$type') && + (v.$type === 'com.atproto.repo.strongRef#main' || + v.$type === 'com.atproto.repo.strongRef') + ) +} + +export function validateMain(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.repo.strongRef#main', v) +} diff --git a/src/lexicon/types/com/atproto/repo/uploadBlob.ts b/src/lexicon/types/com/atproto/repo/uploadBlob.ts new file mode 100644 index 0000000..c4c1358 --- /dev/null +++ b/src/lexicon/types/com/atproto/repo/uploadBlob.ts @@ -0,0 +1,43 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import stream from 'stream' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export type InputSchema = string | Uint8Array + +export interface OutputSchema { + blob: BlobRef + [k: string]: unknown +} + +export interface HandlerInput { + encoding: '*/*' + body: stream.Readable +} + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/createAccount.ts b/src/lexicon/types/com/atproto/server/createAccount.ts new file mode 100644 index 0000000..7e5ff93 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/createAccount.ts @@ -0,0 +1,58 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + email: string + handle: string + inviteCode?: string + password: string + recoveryKey?: string + [k: string]: unknown +} + +export interface OutputSchema { + accessJwt: string + refreshJwt: string + handle: string + did: string + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string + error?: + | 'InvalidHandle' + | 'InvalidPassword' + | 'InvalidInviteCode' + | 'HandleNotAvailable' + | 'UnsupportedDomain' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/createAppPassword.ts b/src/lexicon/types/com/atproto/server/createAppPassword.ts new file mode 100644 index 0000000..65673ff --- /dev/null +++ b/src/lexicon/types/com/atproto/server/createAppPassword.ts @@ -0,0 +1,65 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + name: string + [k: string]: unknown +} + +export type OutputSchema = AppPassword + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string + error?: 'AccountTakedown' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput + +export interface AppPassword { + name: string + password: string + createdAt: string + [k: string]: unknown +} + +export function isAppPassword(v: unknown): v is AppPassword { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.server.createAppPassword#appPassword' + ) +} + +export function validateAppPassword(v: unknown): ValidationResult { + return lexicons.validate( + 'com.atproto.server.createAppPassword#appPassword', + v, + ) +} diff --git a/src/lexicon/types/com/atproto/server/createInviteCode.ts b/src/lexicon/types/com/atproto/server/createInviteCode.ts new file mode 100644 index 0000000..f95b098 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/createInviteCode.ts @@ -0,0 +1,46 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + useCount: number + forAccount?: string + [k: string]: unknown +} + +export interface OutputSchema { + code: string + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/createInviteCodes.ts b/src/lexicon/types/com/atproto/server/createInviteCodes.ts new file mode 100644 index 0000000..1f975d5 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/createInviteCodes.ts @@ -0,0 +1,68 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + codeCount: number + useCount: number + forAccounts?: string[] + [k: string]: unknown +} + +export interface OutputSchema { + codes: AccountCodes[] + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput + +export interface AccountCodes { + account: string + codes: string[] + [k: string]: unknown +} + +export function isAccountCodes(v: unknown): v is AccountCodes { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.server.createInviteCodes#accountCodes' + ) +} + +export function validateAccountCodes(v: unknown): ValidationResult { + return lexicons.validate( + 'com.atproto.server.createInviteCodes#accountCodes', + v, + ) +} diff --git a/src/lexicon/types/com/atproto/server/createSession.ts b/src/lexicon/types/com/atproto/server/createSession.ts new file mode 100644 index 0000000..0c5d35d --- /dev/null +++ b/src/lexicon/types/com/atproto/server/createSession.ts @@ -0,0 +1,52 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + /** Handle or other identifier supported by the server for the authenticating user. */ + identifier: string + password: string + [k: string]: unknown +} + +export interface OutputSchema { + accessJwt: string + refreshJwt: string + handle: string + did: string + email?: string + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string + error?: 'AccountTakedown' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/defs.ts b/src/lexicon/types/com/atproto/server/defs.ts new file mode 100644 index 0000000..9bd67c9 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/defs.ts @@ -0,0 +1,48 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' + +export interface InviteCode { + code: string + available: number + disabled: boolean + forAccount: string + createdBy: string + createdAt: string + uses: InviteCodeUse[] + [k: string]: unknown +} + +export function isInviteCode(v: unknown): v is InviteCode { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.server.defs#inviteCode' + ) +} + +export function validateInviteCode(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.server.defs#inviteCode', v) +} + +export interface InviteCodeUse { + usedBy: string + usedAt: string + [k: string]: unknown +} + +export function isInviteCodeUse(v: unknown): v is InviteCodeUse { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.server.defs#inviteCodeUse' + ) +} + +export function validateInviteCodeUse(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.server.defs#inviteCodeUse', v) +} diff --git a/src/lexicon/types/com/atproto/server/deleteAccount.ts b/src/lexicon/types/com/atproto/server/deleteAccount.ts new file mode 100644 index 0000000..6fde5f1 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/deleteAccount.ts @@ -0,0 +1,38 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + did: string + password: string + token: string + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerError { + status: number + message?: string + error?: 'ExpiredToken' | 'InvalidToken' +} + +export type HandlerOutput = HandlerError | void +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/deleteSession.ts b/src/lexicon/types/com/atproto/server/deleteSession.ts new file mode 100644 index 0000000..909c2be --- /dev/null +++ b/src/lexicon/types/com/atproto/server/deleteSession.ts @@ -0,0 +1,28 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/describeServer.ts b/src/lexicon/types/com/atproto/server/describeServer.ts new file mode 100644 index 0000000..fd2c79e --- /dev/null +++ b/src/lexicon/types/com/atproto/server/describeServer.ts @@ -0,0 +1,59 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export type InputSchema = undefined + +export interface OutputSchema { + inviteCodeRequired?: boolean + availableUserDomains: string[] + links?: Links + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput + +export interface Links { + privacyPolicy?: string + termsOfService?: string + [k: string]: unknown +} + +export function isLinks(v: unknown): v is Links { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.server.describeServer#links' + ) +} + +export function validateLinks(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.server.describeServer#links', v) +} diff --git a/src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts b/src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts new file mode 100644 index 0000000..d5c3e17 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts @@ -0,0 +1,44 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' +import * as ComAtprotoServerDefs from './defs' + +export interface QueryParams { + includeUsed: boolean + createAvailable: boolean +} + +export type InputSchema = undefined + +export interface OutputSchema { + codes: ComAtprotoServerDefs.InviteCode[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string + error?: 'DuplicateCreate' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/getSession.ts b/src/lexicon/types/com/atproto/server/getSession.ts new file mode 100644 index 0000000..e610c44 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/getSession.ts @@ -0,0 +1,41 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export type InputSchema = undefined + +export interface OutputSchema { + handle: string + did: string + email?: string + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/listAppPasswords.ts b/src/lexicon/types/com/atproto/server/listAppPasswords.ts new file mode 100644 index 0000000..012239b --- /dev/null +++ b/src/lexicon/types/com/atproto/server/listAppPasswords.ts @@ -0,0 +1,58 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export type InputSchema = undefined + +export interface OutputSchema { + passwords: AppPassword[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string + error?: 'AccountTakedown' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput + +export interface AppPassword { + name: string + createdAt: string + [k: string]: unknown +} + +export function isAppPassword(v: unknown): v is AppPassword { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.server.listAppPasswords#appPassword' + ) +} + +export function validateAppPassword(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.server.listAppPasswords#appPassword', v) +} diff --git a/src/lexicon/types/com/atproto/server/refreshSession.ts b/src/lexicon/types/com/atproto/server/refreshSession.ts new file mode 100644 index 0000000..1dfc878 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/refreshSession.ts @@ -0,0 +1,43 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export type InputSchema = undefined + +export interface OutputSchema { + accessJwt: string + refreshJwt: string + handle: string + did: string + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string + error?: 'AccountTakedown' +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/requestAccountDelete.ts b/src/lexicon/types/com/atproto/server/requestAccountDelete.ts new file mode 100644 index 0000000..909c2be --- /dev/null +++ b/src/lexicon/types/com/atproto/server/requestAccountDelete.ts @@ -0,0 +1,28 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/requestPasswordReset.ts b/src/lexicon/types/com/atproto/server/requestPasswordReset.ts new file mode 100644 index 0000000..d1973cd --- /dev/null +++ b/src/lexicon/types/com/atproto/server/requestPasswordReset.ts @@ -0,0 +1,35 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + email: string + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/resetPassword.ts b/src/lexicon/types/com/atproto/server/resetPassword.ts new file mode 100644 index 0000000..5e01482 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/resetPassword.ts @@ -0,0 +1,37 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + token: string + password: string + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerError { + status: number + message?: string + error?: 'ExpiredToken' | 'InvalidToken' +} + +export type HandlerOutput = HandlerError | void +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/server/revokeAppPassword.ts b/src/lexicon/types/com/atproto/server/revokeAppPassword.ts new file mode 100644 index 0000000..e6bdcd0 --- /dev/null +++ b/src/lexicon/types/com/atproto/server/revokeAppPassword.ts @@ -0,0 +1,35 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams {} + +export interface InputSchema { + name: string + [k: string]: unknown +} + +export interface HandlerInput { + encoding: 'application/json' + body: InputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getBlob.ts b/src/lexicon/types/com/atproto/sync/getBlob.ts new file mode 100644 index 0000000..a9cf2e9 --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/getBlob.ts @@ -0,0 +1,39 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import stream from 'stream' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The DID of the repo. */ + did: string + /** The CID of the blob to fetch */ + cid: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: '*/*' + body: Uint8Array | stream.Readable +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getBlocks.ts b/src/lexicon/types/com/atproto/sync/getBlocks.ts new file mode 100644 index 0000000..89cd475 --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/getBlocks.ts @@ -0,0 +1,38 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import stream from 'stream' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The DID of the repo. */ + did: string + cids: string[] +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/vnd.ipld.car' + body: Uint8Array | stream.Readable +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getCheckout.ts b/src/lexicon/types/com/atproto/sync/getCheckout.ts new file mode 100644 index 0000000..c714a20 --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/getCheckout.ts @@ -0,0 +1,39 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import stream from 'stream' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The DID of the repo. */ + did: string + /** The commit to get the checkout from. Defaults to current HEAD. */ + commit?: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/vnd.ipld.car' + body: Uint8Array | stream.Readable +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getCommitPath.ts b/src/lexicon/types/com/atproto/sync/getCommitPath.ts new file mode 100644 index 0000000..1b7d0ab --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/getCommitPath.ts @@ -0,0 +1,46 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The DID of the repo. */ + did: string + /** The most recent commit */ + latest?: string + /** The earliest commit to start from */ + earliest?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + commits: string[] + [k: string]: unknown +} + +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/json' + body: OutputSchema +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getHead.ts b/src/lexicon/types/com/atproto/sync/getHead.ts new file mode 100644 index 0000000..83abb1b --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/getHead.ts @@ -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 DID of the repo. */ + did: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + root: 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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getRecord.ts b/src/lexicon/types/com/atproto/sync/getRecord.ts new file mode 100644 index 0000000..4921e33 --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/getRecord.ts @@ -0,0 +1,41 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import stream from 'stream' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The DID of the repo. */ + did: string + collection: string + rkey: string + /** An optional past commit CID. */ + commit?: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/vnd.ipld.car' + body: Uint8Array | stream.Readable +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/getRepo.ts b/src/lexicon/types/com/atproto/sync/getRepo.ts new file mode 100644 index 0000000..0999f9b --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/getRepo.ts @@ -0,0 +1,41 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import stream from 'stream' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The DID of the repo. */ + did: string + /** The earliest commit in the commit range (not inclusive) */ + earliest?: string + /** The latest commit in the commit range (inclusive) */ + latest?: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerSuccess { + encoding: 'application/vnd.ipld.car' + body: Uint8Array | stream.Readable +} + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | HandlerSuccess +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/listBlobs.ts b/src/lexicon/types/com/atproto/sync/listBlobs.ts new file mode 100644 index 0000000..78182d9 --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/listBlobs.ts @@ -0,0 +1,46 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +import express from 'express' +import { ValidationResult, BlobRef } from '@atproto/lexicon' +import { lexicons } from '../../../../lexicons' +import { isObj, hasProp } from '../../../../util' +import { CID } from 'multiformats/cid' +import { HandlerAuth } from '@atproto/xrpc-server' + +export interface QueryParams { + /** The DID of the repo. */ + did: string + /** The most recent commit */ + latest?: string + /** The earliest commit to start from */ + earliest?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cids: 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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/listRepos.ts b/src/lexicon/types/com/atproto/sync/listRepos.ts new file mode 100644 index 0000000..fcd7394 --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/listRepos.ts @@ -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' + +export interface QueryParams { + limit: number + cursor?: string +} + +export type InputSchema = undefined + +export interface OutputSchema { + cursor?: string + repos: Repo[] + [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 = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput + +export interface Repo { + did: string + head: string + [k: string]: unknown +} + +export function isRepo(v: unknown): v is Repo { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.sync.listRepos#repo' + ) +} + +export function validateRepo(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.sync.listRepos#repo', v) +} diff --git a/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts b/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts new file mode 100644 index 0000000..8cd27fd --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts @@ -0,0 +1,31 @@ +/** + * 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 { + /** Hostname of the service that is notifying of update. */ + hostname: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/requestCrawl.ts b/src/lexicon/types/com/atproto/sync/requestCrawl.ts new file mode 100644 index 0000000..4ae875d --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/requestCrawl.ts @@ -0,0 +1,31 @@ +/** + * 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 { + /** Hostname of the service that is requesting to be crawled. */ + hostname: string +} + +export type InputSchema = undefined +export type HandlerInput = undefined + +export interface HandlerError { + status: number + message?: string +} + +export type HandlerOutput = HandlerError | void +export type Handler = (ctx: { + auth: HA + params: QueryParams + input: HandlerInput + req: express.Request + res: express.Response +}) => Promise | HandlerOutput diff --git a/src/lexicon/types/com/atproto/sync/subscribeRepos.ts b/src/lexicon/types/com/atproto/sync/subscribeRepos.ts new file mode 100644 index 0000000..591347c --- /dev/null +++ b/src/lexicon/types/com/atproto/sync/subscribeRepos.ts @@ -0,0 +1,153 @@ +/** + * 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' + +export interface QueryParams { + /** The last known event to backfill from. */ + cursor?: number +} + +export type OutputSchema = + | Commit + | Handle + | Migrate + | Tombstone + | Info + | { $type: string; [k: string]: unknown } +export type HandlerError = ErrorFrame<'FutureCursor'> +export type HandlerOutput = HandlerError | OutputSchema +export type Handler = (ctx: { + auth: HA + params: QueryParams + req: IncomingMessage + signal: AbortSignal +}) => AsyncIterable + +export interface Commit { + seq: number + rebase: boolean + tooBig: boolean + repo: string + commit: CID + prev: CID | null + /** CAR file containing relevant blocks */ + blocks: Uint8Array + ops: RepoOp[] + blobs: CID[] + time: string + [k: string]: unknown +} + +export function isCommit(v: unknown): v is Commit { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.sync.subscribeRepos#commit' + ) +} + +export function validateCommit(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.sync.subscribeRepos#commit', v) +} + +export interface Handle { + seq: number + did: string + handle: string + time: string + [k: string]: unknown +} + +export function isHandle(v: unknown): v is Handle { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.sync.subscribeRepos#handle' + ) +} + +export function validateHandle(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.sync.subscribeRepos#handle', v) +} + +export interface Migrate { + seq: number + did: string + migrateTo: string | null + time: string + [k: string]: unknown +} + +export function isMigrate(v: unknown): v is Migrate { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.sync.subscribeRepos#migrate' + ) +} + +export function validateMigrate(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.sync.subscribeRepos#migrate', v) +} + +export interface Tombstone { + seq: number + did: string + time: string + [k: string]: unknown +} + +export function isTombstone(v: unknown): v is Tombstone { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.sync.subscribeRepos#tombstone' + ) +} + +export function validateTombstone(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.sync.subscribeRepos#tombstone', 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.sync.subscribeRepos#info' + ) +} + +export function validateInfo(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.sync.subscribeRepos#info', v) +} + +export interface RepoOp { + action: 'create' | 'update' | 'delete' | (string & {}) + path: string + cid: CID | null + [k: string]: unknown +} + +export function isRepoOp(v: unknown): v is RepoOp { + return ( + isObj(v) && + hasProp(v, '$type') && + v.$type === 'com.atproto.sync.subscribeRepos#repoOp' + ) +} + +export function validateRepoOp(v: unknown): ValidationResult { + return lexicons.validate('com.atproto.sync.subscribeRepos#repoOp', v) +} diff --git a/src/lexicon/util.ts b/src/lexicon/util.ts new file mode 100644 index 0000000..d7e7044 --- /dev/null +++ b/src/lexicon/util.ts @@ -0,0 +1,13 @@ +/** + * GENERATED CODE - DO NOT MODIFY + */ +export function isObj(v: unknown): v is Record { + return typeof v === 'object' && v !== null +} + +export function hasProp( + data: object, + prop: K, +): data is Record { + return prop in data +} diff --git a/src/server.ts b/src/server.ts new file mode 100644 index 0000000..f86fd55 --- /dev/null +++ b/src/server.ts @@ -0,0 +1,69 @@ +import http from 'http' +import events from 'events' +import express from 'express' +import { createServer } from './lexicon' +import feedGeneration from './feed-generation' +import { createDb, Database } from './db' +import { FirehoseSubscription } from './subscription' + +export type Config = { + port: number + sqliteLocation: string + subscriptionEndpoint: string +} + +export class FeedGenerator { + public app: express.Application + public server?: http.Server + public db: Database + public firehose: FirehoseSubscription + public cfg: Config + + constructor( + app: express.Application, + db: Database, + firehose: FirehoseSubscription, + cfg: Config, + ) { + this.app = app + this.db = db + this.firehose = firehose + this.cfg = cfg + } + + static create(config?: Partial) { + const cfg = { + port: config?.port ?? 3000, + sqliteLocation: config?.sqliteLocation ?? 'test.sqlite', + subscriptionEndpoint: + config?.subscriptionEndpoint ?? 'https://bsky.social', + } + const app = express() + const db = createDb(cfg.sqliteLocation) + const firehose = new FirehoseSubscription(db, cfg.subscriptionEndpoint) + + const server = createServer({ + validateResponse: true, + payload: { + jsonLimit: 100 * 1024, // 100kb + textLimit: 100 * 1024, // 100kb + blobLimit: 5 * 1024 * 1024, // 5mb + }, + }) + feedGeneration(server, db) + app.use(server.xrpc.router) + + return new FeedGenerator(app, db, firehose, cfg) + } + + async start(): Promise { + await this.firehose.run() + const server = this.app.listen(this.cfg.port) + server.keepAliveTimeout = 90000 + this.server = server + await events.once(server, 'listening') + return server + } +} + +export default FeedGenerator diff --git a/src/subscription.ts b/src/subscription.ts new file mode 100644 index 0000000..943b8d1 --- /dev/null +++ b/src/subscription.ts @@ -0,0 +1,60 @@ +import { ids, lexicons } from './lexicon/lexicons' +import { Record as PostRecord } from './lexicon/types/app/bsky/feed/post' +import { + OutputSchema as RepoEvent, + isCommit, +} from './lexicon/types/com/atproto/sync/subscribeRepos' +import { + FirehoseSubscriptionBase, + getPostOperations, +} from './util/subscription' + +export class FirehoseSubscription extends FirehoseSubscriptionBase { + async handleEvent(evt: RepoEvent) { + if (!isCommit(evt)) return + const postOps = await getPostOperations(evt) + const postsToDelete = postOps.deletes.map((del) => del.uri) + const postsToCreate = postOps.creates + .filter((create) => { + // only alf-related posts + return ( + isPost(create.record) && + create.record.text.toLowerCase().includes('alf') + ) + }) + .map((create) => { + // map alf-related posts to a db row + const record = isPost(create.record) ? create.record : null + return { + uri: create.uri, + cid: create.cid, + replyParent: record?.reply?.parent.uri ?? null, + replyRoot: record?.reply?.root.uri ?? null, + indexedAt: new Date().toISOString(), + } + }) + + if (postsToDelete.length > 0) { + await this.db + .deleteFrom('posts') + .where('uri', 'in', postsToDelete) + .execute() + } + if (postsToCreate.length > 0) { + await this.db + .insertInto('posts') + .values(postsToCreate) + .onConflict((oc) => oc.doNothing()) + .execute() + } + } +} + +export const isPost = (obj: unknown): obj is PostRecord => { + try { + lexicons.assertValidRecord(ids.AppBskyFeedPost, obj) + return true + } catch (err) { + return false + } +} diff --git a/src/util/subscription.ts b/src/util/subscription.ts new file mode 100644 index 0000000..f3a892c --- /dev/null +++ b/src/util/subscription.ts @@ -0,0 +1,124 @@ +import { Subscription } from '@atproto/xrpc-server' +import { ids, lexicons } from '../lexicon/lexicons' +import { + Commit, + OutputSchema as RepoEvent, + isCommit, +} from '../lexicon/types/com/atproto/sync/subscribeRepos' +import { Database } from '../db' +import { cborToLexRecord, readCar } from '@atproto/repo' + +export abstract class FirehoseSubscriptionBase { + public sub: Subscription + + constructor(public db: Database, public service: string) { + this.sub = new Subscription({ + service: service, + method: ids.ComAtprotoSyncSubscribeRepos, + getParams: () => this.getCursor(), + validate: (value: unknown) => { + try { + return lexicons.assertValidXrpcMessage( + ids.ComAtprotoSyncSubscribeRepos, + value, + ) + } catch (err) { + console.error('repo subscription skipped invalid message', err) + } + }, + }) + } + + abstract handleEvent(evt: RepoEvent): Promise + + async run() { + await this.ensureCursor() + for await (const evt of this.sub) { + try { + await this.handleEvent(evt) + } catch (err) { + console.error('repo subscription could not handle message', err) + } + // update stored cursor every 20 events or so + if (isCommit(evt) && evt.seq % 20 === 0) { + await this.updateCursor(evt.seq) + } + } + } + + async ensureCursor() { + await this.db + .insertInto('sub_state') + .values({ + service: this.service, + cursor: 0, + }) + .onConflict((oc) => oc.doNothing()) + .execute() + } + + async updateCursor(cursor: number) { + await this.db + .updateTable('sub_state') + .set({ cursor }) + .where('service', '=', this.service) + .execute() + } + + async getCursor(): Promise<{ cursor: number }> { + const res = await this.db + .selectFrom('sub_state') + .selectAll() + .where('service', '=', this.service) + .executeTakeFirst() + return res ? { cursor: res.cursor } : { cursor: 0 } + } +} + +export const getPostOperations = async (evt: Commit): Promise => { + const ops: Operations = { creates: [], deletes: [] } + const postOps = evt.ops.filter( + (op) => op.path.split('/')[1] === ids.AppBskyFeedPost, + ) + + if (postOps.length < 1) return ops + + const car = await readCar(evt.blocks) + + for (const op of postOps) { + // updates not supported yet + if (op.action === 'update') continue + const uri = `at://${evt.repo}/${op.path}` + if (op.action === 'delete') { + ops.deletes.push({ uri }) + } else if (op.action === 'create') { + if (!op.cid) continue + const postBytes = await car.blocks.get(op.cid) + if (!postBytes) continue + ops.creates.push({ + uri, + cid: op.cid.toString(), + author: evt.repo, + record: cborToLexRecord(postBytes), + }) + } + } + + return ops +} + +type CreateOp = { + uri: string + cid: string + author: string + record: Record +} + +type DeleteOp = { + uri: string +} + +type Operations = { + creates: CreateOp[] + deletes: DeleteOp[] +} diff --git a/test.sqlite b/test.sqlite new file mode 100644 index 0000000..e69de29 diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..b2e8e28 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1231 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@atproto/common-web@*": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@atproto/common-web/-/common-web-0.1.0.tgz#5529fa66f9533aa00cfd13f0a25757df7b26bd3d" + integrity sha512-qD6xF60hvH+cP++fk/mt+0S9cxs94KsK+rNWypNlgnlp7r9By4ltXwtDSR/DNTA8mwDeularUno4VbTd2IWIzA== + dependencies: + multiformats "^9.6.4" + uint8arrays "3.0.0" + zod "^3.14.2" + +"@atproto/common@*": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@atproto/common/-/common-0.2.0.tgz#e74502edf636f30e332f516dcb96f7342b71ff1b" + integrity sha512-PVYSC30pyonz2MOxuBLk27uGdwyZQ42gJfCA/NE9jLeuenVDmZnVrK5WqJ7eGg+F88rZj7NcGfRsZdP0GMykEQ== + dependencies: + "@atproto/common-web" "*" + "@ipld/dag-cbor" "^7.0.3" + cbor-x "^1.5.1" + multiformats "^9.6.4" + pino "^8.6.1" + +"@atproto/crypto@*": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@atproto/crypto/-/crypto-0.1.1.tgz#54afad2124c3867091e4d9b271f22d375fcfdf9e" + integrity sha512-/7Ntn55dRZPtCnOd6dVo1IvZzpVut6YTAkZ8iFry9JW29l7ZeNkJd+NTnmWRz3aGQody10jngb4SNxQNi/f3+A== + dependencies: + "@noble/secp256k1" "^1.7.0" + big-integer "^1.6.51" + multiformats "^9.6.4" + one-webcrypto "^1.0.3" + uint8arrays "3.0.0" + +"@atproto/did-resolver@*": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@atproto/did-resolver/-/did-resolver-0.0.1.tgz#e54c1b7fddff2cd6adf87c044b4a3b6f00d5eff7" + integrity sha512-sdva3+nydMaWXwHJED558UZdVZuajfC2CHcsIZz0pQybicm3VI+khkf42ClZeOhf4Bwa4V4SOaaAqwyf86bDew== + dependencies: + "@atproto/common" "*" + "@atproto/crypto" "*" + axios "^0.24.0" + did-resolver "^4.0.0" + +"@atproto/identifier@*": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@atproto/identifier/-/identifier-0.1.0.tgz#6b600c8a3da08d9a7d5eab076f8b7064457dde75" + integrity sha512-3LV7+4E6S0k8Rru7NBkyDF6Zf6NHVUXVS9d4l9fiXWMC49ghZMjq0vPmz80xjG1rRuFdJFbpRf4ApFciGxLIyQ== + dependencies: + "@atproto/common-web" "*" + +"@atproto/lexicon@*": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@atproto/lexicon/-/lexicon-0.1.0.tgz#e7784cc868c734314d5bf9af83487aba7ccae0b3" + integrity sha512-Iy+gV9w42xLhrZrmcbZh7VFoHjXuzWvecGHIfz44owNjjv7aE/d2P5BbOX/XicSkmQ8Qkpg0BqwYDD1XBVS+DQ== + dependencies: + "@atproto/common-web" "*" + "@atproto/identifier" "*" + "@atproto/nsid" "*" + "@atproto/uri" "*" + iso-datestring-validator "^2.2.2" + multiformats "^9.6.4" + zod "^3.14.2" + +"@atproto/nsid@*": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@atproto/nsid/-/nsid-0.0.1.tgz#0cdc00cefe8f0b1385f352b9f57b3ad37fff09a4" + integrity sha512-t5M6/CzWBVYoBbIvfKDpqPj/+ZmyoK9ydZSStcTXosJ27XXwOPhz0VDUGKK2SM9G5Y7TPes8S5KTAU0UdVYFCw== + +"@atproto/repo@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@atproto/repo/-/repo-0.1.0.tgz#8c546af16c30fe5ba4c883ac73b68be9d7eca273" + integrity sha512-O4qs5WfSjEFvUtpOTB4n9cLcK6YP/w/ly6Qxc3S8IFevLGYX58NPPr5zlg3dxs64uLKbWWjzhQM7JAqO44MEKw== + dependencies: + "@atproto/common" "*" + "@atproto/crypto" "*" + "@atproto/did-resolver" "*" + "@atproto/lexicon" "*" + "@atproto/nsid" "*" + "@ipld/car" "^3.2.3" + "@ipld/dag-cbor" "^7.0.0" + multiformats "^9.6.4" + uint8arrays "3.0.0" + zod "^3.14.2" + +"@atproto/uri@*", "@atproto/uri@^0.0.2": + version "0.0.2" + resolved "https://registry.yarnpkg.com/@atproto/uri/-/uri-0.0.2.tgz#c6d3788e6f12d66ba72690d2d70fe6c291b4acfb" + integrity sha512-/6otLZF7BLpT9suSdHuXLbL12nINcWPsLmcOI+dctqovWUjH+XIRVNXDQgBYSrPVetxMiknuEwWelmnA33AEXg== + dependencies: + "@atproto/identifier" "*" + "@atproto/nsid" "*" + +"@atproto/xrpc-server@^0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@atproto/xrpc-server/-/xrpc-server-0.1.0.tgz#2dd3172bb35fbfefb98c3d727d29be8eca5c3d9b" + integrity sha512-I7EjhnLUrlqQKTe2jDEnyAaOTvj26pg9NRjTXflbIOqCOkh+K9+5ztGSI0djF7TSQ7pegXroj3qRnmpVVCBr7Q== + dependencies: + "@atproto/common" "*" + "@atproto/lexicon" "*" + cbor-x "^1.5.1" + express "^4.17.2" + http-errors "^2.0.0" + mime-types "^2.1.35" + uint8arrays "3.0.0" + ws "^8.12.0" + zod "^3.14.2" + +"@cbor-extract/cbor-extract-darwin-arm64@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-darwin-arm64/-/cbor-extract-darwin-arm64-2.1.1.tgz#5721f6dd3feae0b96d23122853ce977e0671b7a6" + integrity sha512-blVBy5MXz6m36Vx0DfLd7PChOQKEs8lK2bD1WJn/vVgG4FXZiZmZb2GECHFvVPA5T7OnODd9xZiL3nMCv6QUhA== + +"@cbor-extract/cbor-extract-darwin-x64@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-darwin-x64/-/cbor-extract-darwin-x64-2.1.1.tgz#c25e7d0133950d87d101d7b3afafea8d50d83f5f" + integrity sha512-h6KFOzqk8jXTvkOftyRIWGrd7sKQzQv2jVdTL9nKSf3D2drCvQB/LHUxAOpPXo3pv2clDtKs3xnHalpEh3rDsw== + +"@cbor-extract/cbor-extract-linux-arm64@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-linux-arm64/-/cbor-extract-linux-arm64-2.1.1.tgz#48f78e7d8f0fcc84ed074b6bfa6d15dd83187c63" + integrity sha512-SxAaRcYf8S0QHaMc7gvRSiTSr7nUYMqbUdErBEu+HYA4Q6UNydx1VwFE68hGcp1qvxcy9yT5U7gA+a5XikfwSQ== + +"@cbor-extract/cbor-extract-linux-arm@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-linux-arm/-/cbor-extract-linux-arm-2.1.1.tgz#7507d346389cb682e44fab8fae9534edd52e2e41" + integrity sha512-ds0uikdcIGUjPyraV4oJqyVE5gl/qYBpa/Wnh6l6xLE2lj/hwnjT2XcZCChdXwW/YFZ1LUHs6waoYN8PmK0nKQ== + +"@cbor-extract/cbor-extract-linux-x64@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-linux-x64/-/cbor-extract-linux-x64-2.1.1.tgz#b7c1d2be61c58ec18d58afbad52411ded63cd4cd" + integrity sha512-GVK+8fNIE9lJQHAlhOROYiI0Yd4bAZ4u++C2ZjlkS3YmO6hi+FUxe6Dqm+OKWTcMpL/l71N6CQAmaRcb4zyJuA== + +"@cbor-extract/cbor-extract-win32-x64@2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@cbor-extract/cbor-extract-win32-x64/-/cbor-extract-win32-x64-2.1.1.tgz#21b11a1a3f18c3e7d62fd5f87438b7ed2c64c1f7" + integrity sha512-2Niq1C41dCRIDeD8LddiH+mxGlO7HJ612Ll3D/E73ZWBmycued+8ghTr/Ho3CMOWPUEr08XtyBMVXAjqF+TcKw== + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@ipld/car@^3.2.3": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@ipld/car/-/car-3.2.4.tgz#115951ba2255ec51d865773a074e422c169fb01c" + integrity sha512-rezKd+jk8AsTGOoJKqzfjLJ3WVft7NZNH95f0pfPbicROvzTyvHCNy567HzSUd6gRXZ9im29z5ZEv9Hw49jSYw== + dependencies: + "@ipld/dag-cbor" "^7.0.0" + multiformats "^9.5.4" + varint "^6.0.0" + +"@ipld/dag-cbor@^7.0.0", "@ipld/dag-cbor@^7.0.3": + version "7.0.3" + resolved "https://registry.yarnpkg.com/@ipld/dag-cbor/-/dag-cbor-7.0.3.tgz#aa31b28afb11a807c3d627828a344e5521ac4a1e" + integrity sha512-1VVh2huHsuohdXC1bGJNE8WR72slZ9XE2T3wbBBq31dm7ZBatmKLLxrB+XAqafxfRFjv08RZmj/W/ZqaM13AuA== + dependencies: + cborg "^1.6.0" + multiformats "^9.5.4" + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@noble/secp256k1@^1.7.0": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" + integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== + +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== + +"@types/better-sqlite3@^7.6.4": + version "7.6.4" + resolved "https://registry.yarnpkg.com/@types/better-sqlite3/-/better-sqlite3-7.6.4.tgz#102462611e67aadf950d3ccca10292de91e6f35b" + integrity sha512-dzrRZCYPXIXfSR1/surNbJ/grU3scTaygS0OMzjlGf71i9sc2fGyHPXXiXmEvNIoE0cGwsanEFMVJxPXmco9Eg== + dependencies: + "@types/node" "*" + +"@types/body-parser@*": + version "1.19.2" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" + integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== + dependencies: + "@types/connect" "*" + "@types/node" "*" + +"@types/connect@*": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + +"@types/express-serve-static-core@^4.17.33": + version "4.17.34" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.34.tgz#c119e85b75215178bc127de588e93100698ab4cc" + integrity sha512-fvr49XlCGoUj2Pp730AItckfjat4WNb0lb3kfrLWffd+RLeoGAMsq7UOy04PAPtoL01uKwcp6u8nhzpgpDYr3w== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + "@types/send" "*" + +"@types/express@^4.17.17": + version "4.17.17" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.17.tgz#01d5437f6ef9cfa8668e616e13c2f2ac9a491ae4" + integrity sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.33" + "@types/qs" "*" + "@types/serve-static" "*" + +"@types/mime@*": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" + integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== + +"@types/mime@^1": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" + integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== + +"@types/node@*", "@types/node@^20.1.1": + version "20.1.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.1.tgz#afc492e8dbe7f672dd3a13674823522b467a45ad" + integrity sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A== + +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + +"@types/send@*": + version "0.17.1" + resolved "https://registry.yarnpkg.com/@types/send/-/send-0.17.1.tgz#ed4932b8a2a805f1fe362a70f4e62d0ac994e301" + integrity sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q== + dependencies: + "@types/mime" "^1" + "@types/node" "*" + +"@types/serve-static@*": + version "1.15.1" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.1.tgz#86b1753f0be4f9a1bee68d459fcda5be4ea52b5d" + integrity sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ== + dependencies: + "@types/mime" "*" + "@types/node" "*" + +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + +accepts@~1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== + dependencies: + mime-types "~2.1.34" + negotiator "0.6.3" + +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + +acorn@^8.4.1: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== + +atomic-sleep@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/atomic-sleep/-/atomic-sleep-1.0.0.tgz#eb85b77a601fc932cfe432c5acd364a9e2c9075b" + integrity sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ== + +axios@^0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.24.0.tgz#804e6fa1e4b9c5288501dd9dff56a7a0940d20d6" + integrity sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA== + dependencies: + follow-redirects "^1.14.4" + +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +better-sqlite3@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/better-sqlite3/-/better-sqlite3-8.3.0.tgz#3873ddfd9f2af90b628657e8ff221786c93d1984" + integrity sha512-JTmvBZL/JLTc+3Msbvq6gK6elbU9/wVMqiudplHrVJpr7sVMR9KJrNhZAbW+RhXKlpMcuEhYkdcHa3TXKNXQ1w== + dependencies: + bindings "^1.5.0" + prebuild-install "^7.1.0" + +big-integer@^1.6.51: + version "1.6.51" + resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.51.tgz#0df92a5d9880560d3ff2d5fd20245c889d130686" + integrity sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg== + +bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +bl@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + +body-parser@1.20.1: + version "1.20.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" + integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== + dependencies: + bytes "3.1.2" + content-type "~1.0.4" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.1" + type-is "~1.6.18" + unpipe "1.0.0" + +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +call-bind@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +cbor-extract@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/cbor-extract/-/cbor-extract-2.1.1.tgz#f154b31529fdb6b7c70fb3ca448f44eda96a1b42" + integrity sha512-1UX977+L+zOJHsp0mWFG13GLwO6ucKgSmSW6JTl8B9GUvACvHeIVpFqhU92299Z6PfD09aTXDell5p+lp1rUFA== + dependencies: + node-gyp-build-optional-packages "5.0.3" + optionalDependencies: + "@cbor-extract/cbor-extract-darwin-arm64" "2.1.1" + "@cbor-extract/cbor-extract-darwin-x64" "2.1.1" + "@cbor-extract/cbor-extract-linux-arm" "2.1.1" + "@cbor-extract/cbor-extract-linux-arm64" "2.1.1" + "@cbor-extract/cbor-extract-linux-x64" "2.1.1" + "@cbor-extract/cbor-extract-win32-x64" "2.1.1" + +cbor-x@^1.5.1: + version "1.5.2" + resolved "https://registry.yarnpkg.com/cbor-x/-/cbor-x-1.5.2.tgz#ceabc48bda06185de1f3a078bb4a793e6e222de5" + integrity sha512-JArE6xcgj3eo13fpnShO42QFBUuXP2uG12RLeF2Nb+dJcETFYxkUa27gXQrRYp67Ahtaxyfbg+ihc62XTyQqsQ== + optionalDependencies: + cbor-extract "^2.1.1" + +cborg@^1.6.0: + version "1.10.1" + resolved "https://registry.yarnpkg.com/cborg/-/cborg-1.10.1.tgz#24cfe52c69ec0f66f95e23dc57f2086954c8d718" + integrity sha512-et6Qm8MOUY2kCWa5GKk2MlBVoPjHv0hQBmlzI/Z7+5V3VJCeIkGehIB3vWknNsm2kOkAIs6wEKJFJo8luWQQ/w== + +chownr@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" + integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== + +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== + dependencies: + safe-buffer "5.2.1" + +content-type@~1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== + +cookie@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +debug@2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +destroy@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== + +detect-libc@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.1.tgz#e1897aa88fa6ad197862937fbc0441ef352ee0cd" + integrity sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w== + +did-resolver@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/did-resolver/-/did-resolver-4.1.0.tgz#740852083c4fd5bf9729d528eca5d105aff45eb6" + integrity sha512-S6fWHvCXkZg2IhS4RcVHxwuyVejPR7c+a4Go0xbQ9ps5kILa8viiYQgrM4gfTyeTjJ0ekgJH9gk/BawTpmkbZA== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== + +end-of-stream@^1.1.0, end-of-stream@^1.4.1: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== + +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + +events@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +expand-template@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" + integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== + +express@^4.17.2, express@^4.18.2: + version "4.18.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" + integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + dependencies: + accepts "~1.3.8" + array-flatten "1.1.1" + body-parser "1.20.1" + content-disposition "0.5.4" + content-type "~1.0.4" + cookie "0.5.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "2.0.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.2.0" + fresh "0.5.2" + http-errors "2.0.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "2.4.1" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.7" + qs "6.11.0" + range-parser "~1.2.1" + safe-buffer "5.2.1" + send "0.18.0" + serve-static "1.15.0" + setprototypeof "1.2.0" + statuses "2.0.1" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +fast-redact@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/fast-redact/-/fast-redact-3.1.2.tgz#d58e69e9084ce9fa4c1a6fa98a3e1ecf5d7839aa" + integrity sha512-+0em+Iya9fKGfEQGcd62Yv6onjBmmhV1uh86XVfOU8VwAe6kaFdQCWI9s0/Nnugx5Vd9tdbZ7e6gE2tR9dzXdw== + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +finalhandler@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" + integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "2.4.1" + parseurl "~1.3.3" + statuses "2.0.1" + unpipe "~1.0.0" + +follow-redirects@^1.14.4: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +get-intrinsic@^1.0.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.0.tgz#7ad1dc0535f3a2904bba075772763e5051f6d05f" + integrity sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +github-from-package@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" + integrity sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw== + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +http-errors@2.0.0, http-errors@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ieee754@^1.1.13, ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + +inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ini@~1.3.0: + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +iso-datestring-validator@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/iso-datestring-validator/-/iso-datestring-validator-2.2.2.tgz#2daa80d2900b7a954f9f731d42f96ee0c19a6895" + integrity sha512-yLEMkBbLZTlVQqOnQ4FiMujR6T4DEcCb1xizmvXS+OxuhwcbtynoosRzdMA69zZCShCNAbi+gJ71FxZBBXx1SA== + +kysely@^0.22.0: + version "0.22.0" + resolved "https://registry.yarnpkg.com/kysely/-/kysely-0.22.0.tgz#8aac53942da3cadc604d7d154a746d983fe8f7b9" + integrity sha512-ZE3qWtnqLOalodzfK5QUEcm7AEulhxsPNuKaGFsC3XiqO92vMLm+mAHk/NnbSIOtC4RmGm0nsv700i8KDp1gfQ== + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.35, mime-types@~2.1.24, mime-types@~2.1.34: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + +minimist@^1.2.0, minimist@^1.2.3: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== + +ms@2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +multiformats@^9.4.2, multiformats@^9.5.4, multiformats@^9.6.4: + version "9.9.0" + resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-9.9.0.tgz#c68354e7d21037a8f1f8833c8ccd68618e8f1d37" + integrity sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg== + +napi-build-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" + integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== + +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== + +node-abi@^3.3.0: + version "3.40.0" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.40.0.tgz#51d8ed44534f70ff1357dfbc3a89717b1ceac1b4" + integrity sha512-zNy02qivjjRosswoYmPi8hIKJRr8MpQyeKT6qlcq/OnOgA3Rhoae+IYOqsM9V5+JnHWmxKnWOT2GxvtqdtOCXA== + dependencies: + semver "^7.3.5" + +node-gyp-build-optional-packages@5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.3.tgz#92a89d400352c44ad3975010368072b41ad66c17" + integrity sha512-k75jcVzk5wnnc/FMxsf4udAoTEUv2jY3ycfdSd3yWu6Cnd1oee6/CfZJApyscA4FJOmdoixWwiwOyf16RzD5JA== + +object-inspect@^1.9.0: + version "1.12.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" + integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== + +on-exit-leak-free@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/on-exit-leak-free/-/on-exit-leak-free-2.1.0.tgz#5c703c968f7e7f851885f6459bf8a8a57edc9cc4" + integrity sha512-VuCaZZAjReZ3vUwgOB8LxAosIurDiAW0s13rI1YwmaP++jvcxP77AWoQvenZebpCA2m8WC1/EosPYPMjnRAp/w== + +on-finished@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== + dependencies: + ee-first "1.1.1" + +once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +one-webcrypto@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/one-webcrypto/-/one-webcrypto-1.0.3.tgz#f951243cde29b79b6745ad14966fc598a609997c" + integrity sha512-fu9ywBVBPx0gS9K0etIROTiCkvI5S1TDjFsYFb3rC1ewFxeOqsbzq7aIMBHsYfrTHBcGXJaONXXjTl8B01cW1Q== + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== + +pino-abstract-transport@v1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pino-abstract-transport/-/pino-abstract-transport-1.0.0.tgz#cc0d6955fffcadb91b7b49ef220a6cc111d48bb3" + integrity sha512-c7vo5OpW4wIS42hUVcT5REsL8ZljsUfBjqV/e2sFxmFEFZiq1XLUp5EYLtuDH6PEHq9W1egWqRbnLUP5FuZmOA== + dependencies: + readable-stream "^4.0.0" + split2 "^4.0.0" + +pino-std-serializers@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-6.2.1.tgz#369f4ae2a19eb6d769ddf2c88a2164b76879a284" + integrity sha512-wHuWB+CvSVb2XqXM0W/WOYUkVSPbiJb9S5fNB7TBhd8s892Xq910bRxwHtC4l71hgztObTjXL6ZheZXFjhDrDQ== + +pino@^8.6.1: + version "8.14.1" + resolved "https://registry.yarnpkg.com/pino/-/pino-8.14.1.tgz#bb38dcda8b500dd90c1193b6c9171eb777a47ac8" + integrity sha512-8LYNv7BKWXSfS+k6oEc6occy5La+q2sPwU3q2ljTX5AZk7v+5kND2o5W794FyRaqha6DJajmkNRsWtPpFyMUdw== + dependencies: + atomic-sleep "^1.0.0" + fast-redact "^3.1.1" + on-exit-leak-free "^2.1.0" + pino-abstract-transport v1.0.0 + pino-std-serializers "^6.0.0" + process-warning "^2.0.0" + quick-format-unescaped "^4.0.3" + real-require "^0.2.0" + safe-stable-stringify "^2.3.1" + sonic-boom "^3.1.0" + thread-stream "^2.0.0" + +prebuild-install@^7.1.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" + integrity sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw== + dependencies: + detect-libc "^2.0.0" + expand-template "^2.0.3" + github-from-package "0.0.0" + minimist "^1.2.3" + mkdirp-classic "^0.5.3" + napi-build-utils "^1.0.1" + node-abi "^3.3.0" + pump "^3.0.0" + rc "^1.2.7" + simple-get "^4.0.0" + tar-fs "^2.0.0" + tunnel-agent "^0.6.0" + +process-warning@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/process-warning/-/process-warning-2.2.0.tgz#008ec76b579820a8e5c35d81960525ca64feb626" + integrity sha512-/1WZ8+VQjR6avWOgHeEPd7SDQmFQ1B5mC1eRXsCm5TarlNmx/wCsa5GEaxGm05BORRtyG/Ex/3xq3TuRvq57qg== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + +proxy-addr@~2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" + +quick-format-unescaped@^4.0.3: + version "4.0.4" + resolved "https://registry.yarnpkg.com/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz#93ef6dd8d3453cbc7970dd614fad4c5954d6b5a7" + integrity sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg== + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readable-stream@^3.1.1, readable-stream@^3.4.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readable-stream@^4.0.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.4.0.tgz#55ce132d60a988c460d75c631e9ccf6a7229b468" + integrity sha512-kDMOq0qLtxV9f/SQv522h8cxZBqNZXuXNyjyezmfAAuribMyVXziljpQ/uQhfE1XLg2/TLTW2DsnoE4VAi/krg== + dependencies: + abort-controller "^3.0.0" + buffer "^6.0.3" + events "^3.3.0" + process "^0.11.10" + +real-require@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/real-require/-/real-require-0.2.0.tgz#209632dea1810be2ae063a6ac084fee7e33fba78" + integrity sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg== + +safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-stable-stringify@^2.3.1: + version "2.4.3" + resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz#138c84b6f6edb3db5f8ef3ef7115b8f55ccbf886" + integrity sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^7.3.5: + version "7.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" + integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== + dependencies: + lru-cache "^6.0.0" + +send@0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" + integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + +serve-static@1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" + integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.18.0" + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +simple-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== + +simple-get@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" + integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== + dependencies: + decompress-response "^6.0.0" + once "^1.3.1" + simple-concat "^1.0.0" + +sonic-boom@^3.1.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-3.3.0.tgz#cffab6dafee3b2bcb88d08d589394198bee1838c" + integrity sha512-LYxp34KlZ1a2Jb8ZQgFCK3niIHzibdwtwNUWKg0qQRzsDoJ3Gfgkf8KdBTFU3SkejDEIlWwnSnpVdOZIhFMl/g== + dependencies: + atomic-sleep "^1.0.0" + +split2@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.2.0.tgz#c9c5920904d148bab0b9f67145f245a86aadbfa4" + integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg== + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== + +tar-fs@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" + integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== + dependencies: + chownr "^1.1.1" + mkdirp-classic "^0.5.2" + pump "^3.0.0" + tar-stream "^2.1.4" + +tar-stream@^2.1.4: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" + integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== + dependencies: + bl "^4.0.3" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + +thread-stream@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-2.3.0.tgz#4fc07fb39eff32ae7bad803cb7dd9598349fed33" + integrity sha512-kaDqm1DET9pp3NXwR8382WHbnpXnRkN9xGN9dQt3B2+dmXiW8X1SOwmFOxAErEQ47ObhZ96J6yhZNXuyCOL7KA== + dependencies: + real-require "^0.2.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w== + dependencies: + safe-buffer "^5.0.1" + +type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +typescript@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" + integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== + +uint8arrays@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-3.0.0.tgz#260869efb8422418b6f04e3fac73a3908175c63b" + integrity sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA== + dependencies: + multiformats "^9.4.2" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +varint@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/varint/-/varint-6.0.0.tgz#9881eb0ce8feaea6512439d19ddf84bf551661d0" + integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@^8.12.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" + integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +zod@^3.14.2: + version "3.21.4" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db" + integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==