├── .DS_Store
├── scripts
├── bluej.png
├── blue-j-icon.png
├── bluej.code-workspace
├── createIndexes.ts
├── get-did.ts
└── import-authors.ts
├── app
├── public
│ ├── blue-jay.webp
│ └── index.html
└── package.json
├── visualization
├── live
│ ├── public
│ │ ├── favicon.ico
│ │ └── index.html
│ ├── src
│ │ ├── assets
│ │ │ └── images
│ │ │ │ ├── bluesky.png
│ │ │ │ └── memgraph.png
│ │ ├── index.css
│ │ └── index.js
│ ├── .env.example
│ ├── .gitignore
│ ├── package.json
│ └── README.md
├── query_module
│ ├── CMakeLists.txt
│ └── README.md
└── backend_service
│ ├── .gitignore
│ ├── package.json
│ ├── .env.example
│ └── src
│ ├── routes
│ ├── create.js
│ ├── delete.js
│ ├── merge.js
│ ├── detach.js
│ └── enrich.js
│ └── util
│ └── enrich_util.js
├── query_module
├── CMakeLists.txt
├── README.md
└── bluej.cpp
├── src
├── db
│ ├── schema.ts
│ ├── index.ts
│ └── migrations.ts
├── lexicon
│ ├── util.ts
│ └── types
│ │ ├── app
│ │ └── bsky
│ │ │ ├── graph
│ │ │ ├── block.ts
│ │ │ ├── follow.ts
│ │ │ ├── listblock.ts
│ │ │ ├── listitem.ts
│ │ │ ├── muteActor.ts
│ │ │ ├── unmuteActor.ts
│ │ │ ├── muteActorList.ts
│ │ │ ├── unmuteActorList.ts
│ │ │ ├── list.ts
│ │ │ ├── getSuggestedFollowsByActor.ts
│ │ │ ├── getListMutes.ts
│ │ │ ├── getListBlocks.ts
│ │ │ ├── getBlocks.ts
│ │ │ ├── getMutes.ts
│ │ │ ├── getLists.ts
│ │ │ ├── getList.ts
│ │ │ ├── getFollowers.ts
│ │ │ └── getFollows.ts
│ │ │ ├── feed
│ │ │ ├── like.ts
│ │ │ ├── repost.ts
│ │ │ ├── generator.ts
│ │ │ ├── getPosts.ts
│ │ │ ├── getFeedGenerators.ts
│ │ │ ├── getFeedGenerator.ts
│ │ │ ├── getSuggestedFeeds.ts
│ │ │ ├── getActorFeeds.ts
│ │ │ ├── getTimeline.ts
│ │ │ ├── getFeed.ts
│ │ │ ├── getListFeed.ts
│ │ │ ├── getFeedSkeleton.ts
│ │ │ ├── getActorLikes.ts
│ │ │ ├── getRepostedBy.ts
│ │ │ ├── getPostThread.ts
│ │ │ ├── getAuthorFeed.ts
│ │ │ ├── searchPosts.ts
│ │ │ ├── getLikes.ts
│ │ │ ├── describeFeedGenerator.ts
│ │ │ └── threadgate.ts
│ │ │ ├── actor
│ │ │ ├── profile.ts
│ │ │ ├── putPreferences.ts
│ │ │ ├── getProfile.ts
│ │ │ ├── getPreferences.ts
│ │ │ ├── getProfiles.ts
│ │ │ ├── getSuggestions.ts
│ │ │ ├── searchActorsTypeahead.ts
│ │ │ └── searchActors.ts
│ │ │ ├── notification
│ │ │ ├── updateSeen.ts
│ │ │ ├── registerPush.ts
│ │ │ ├── getUnreadCount.ts
│ │ │ └── listNotifications.ts
│ │ │ ├── unspecced
│ │ │ ├── defs.ts
│ │ │ ├── getPopular.ts
│ │ │ ├── getPopularFeedGenerators.ts
│ │ │ ├── getTimelineSkeleton.ts
│ │ │ ├── searchPostsSkeleton.ts
│ │ │ └── searchActorsSkeleton.ts
│ │ │ └── embed
│ │ │ ├── recordWithMedia.ts
│ │ │ └── external.ts
│ │ └── com
│ │ └── atproto
│ │ ├── repo
│ │ ├── strongRef.ts
│ │ ├── uploadBlob.ts
│ │ ├── describeRepo.ts
│ │ ├── deleteRecord.ts
│ │ ├── getRecord.ts
│ │ ├── createRecord.ts
│ │ ├── putRecord.ts
│ │ └── listRecords.ts
│ │ ├── server
│ │ ├── deleteSession.ts
│ │ ├── requestAccountDelete.ts
│ │ ├── revokeAppPassword.ts
│ │ ├── requestPasswordReset.ts
│ │ ├── resetPassword.ts
│ │ ├── deleteAccount.ts
│ │ ├── getSession.ts
│ │ ├── refreshSession.ts
│ │ ├── defs.ts
│ │ ├── createInviteCode.ts
│ │ ├── getAccountInviteCodes.ts
│ │ ├── createSession.ts
│ │ ├── createAccount.ts
│ │ ├── listAppPasswords.ts
│ │ ├── describeServer.ts
│ │ ├── createAppPassword.ts
│ │ └── createInviteCodes.ts
│ │ ├── identity
│ │ ├── updateHandle.ts
│ │ └── resolveHandle.ts
│ │ ├── admin
│ │ ├── updateAccountHandle.ts
│ │ ├── disableInviteCodes.ts
│ │ ├── updateAccountEmail.ts
│ │ ├── disableAccountInvites.ts
│ │ ├── enableAccountInvites.ts
│ │ ├── getModerationAction.ts
│ │ ├── getModerationReport.ts
│ │ ├── getRepo.ts
│ │ ├── getRecord.ts
│ │ ├── sendEmail.ts
│ │ ├── getModerationActions.ts
│ │ ├── reverseModerationAction.ts
│ │ ├── resolveModerationReports.ts
│ │ ├── getInviteCodes.ts
│ │ ├── searchRepos.ts
│ │ ├── getModerationReports.ts
│ │ └── takeModerationAction.ts
│ │ ├── sync
│ │ ├── notifyOfUpdate.ts
│ │ ├── requestCrawl.ts
│ │ ├── getCheckout.ts
│ │ ├── getBlocks.ts
│ │ ├── getBlob.ts
│ │ ├── getHead.ts
│ │ ├── getRepo.ts
│ │ ├── getLatestCommit.ts
│ │ ├── getRecord.ts
│ │ ├── listBlobs.ts
│ │ └── listRepos.ts
│ │ ├── moderation
│ │ ├── defs.ts
│ │ └── createReport.ts
│ │ └── label
│ │ ├── queryLabels.ts
│ │ ├── subscribeLabels.ts
│ │ └── defs.ts
├── config.ts
├── algos
│ ├── index.ts
│ └── weighted-round-robin.ts
├── auth.ts
├── methods
│ ├── describe-generator.ts
│ └── feed-generation.ts
├── well-known.ts
├── index.ts
└── server.ts
├── tsconfig.json
├── .env.example
└── package.json
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/memgraph/bluej/HEAD/.DS_Store
--------------------------------------------------------------------------------
/scripts/bluej.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/memgraph/bluej/HEAD/scripts/bluej.png
--------------------------------------------------------------------------------
/app/public/blue-jay.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/memgraph/bluej/HEAD/app/public/blue-jay.webp
--------------------------------------------------------------------------------
/scripts/blue-j-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/memgraph/bluej/HEAD/scripts/blue-j-icon.png
--------------------------------------------------------------------------------
/scripts/bluej.code-workspace:
--------------------------------------------------------------------------------
1 | {
2 | "folders": [
3 | {
4 | "path": ".."
5 | }
6 | ],
7 | "settings": {}
8 | }
--------------------------------------------------------------------------------
/visualization/live/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/memgraph/bluej/HEAD/visualization/live/public/favicon.ico
--------------------------------------------------------------------------------
/visualization/live/src/assets/images/bluesky.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/memgraph/bluej/HEAD/visualization/live/src/assets/images/bluesky.png
--------------------------------------------------------------------------------
/visualization/live/src/assets/images/memgraph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/memgraph/bluej/HEAD/visualization/live/src/assets/images/memgraph.png
--------------------------------------------------------------------------------
/visualization/live/src/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin: 0;
3 | font-family: 'Roboto', sans-serif;
4 | width: 100%;
5 | height: 100%;
6 | }
--------------------------------------------------------------------------------
/query_module/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Add all module files related to graph util module
2 | set(bluej_src bluej.cpp)
3 | add_query_module(bluej 1 "${bluej_src}")
4 |
5 |
--------------------------------------------------------------------------------
/visualization/live/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import App from './components/App';
4 | import "./index.css"
5 |
6 | const root = ReactDOM.createRoot(document.getElementById('root'));
7 |
8 | root.render(
9 |
10 | );
--------------------------------------------------------------------------------
/visualization/live/.env.example:
--------------------------------------------------------------------------------
1 | # Set this to the domain of the backend app (for local testing use http://localhost:3002)
2 | REACT_APP_BACKEND_DOMAIN=https://bluej.memgraph.com
3 |
4 | # Set this to the path of the backend app (for local testing use /socket.io)
5 | REACT_APP_BACKEND_PATH=/viz/socket
--------------------------------------------------------------------------------
/scripts/createIndexes.ts:
--------------------------------------------------------------------------------
1 | /*
2 | if (createIndexes) {
3 | async () => {
4 | await session.run("CREATE INDEX ON :Person(did)", {})
5 | await session.run("CREATE INDEX ON :Post(uri)", {})
6 | await session.run("CREATE INDEX ON :Person", {})
7 | await session.run("CREATE INDEX ON :Post", {})
8 | }
9 | }
10 | */
--------------------------------------------------------------------------------
/src/db/schema.ts:
--------------------------------------------------------------------------------
1 | export type DatabaseSchema = {
2 | post: Post
3 | sub_state: SubState
4 | }
5 |
6 | export type Post = {
7 | uri: string
8 | cid: string
9 | replyParent: string | null
10 | replyRoot: string | null
11 | indexedAt: string
12 | }
13 |
14 | export type SubState = {
15 | service: string
16 | cursor: number
17 | }
18 |
--------------------------------------------------------------------------------
/src/lexicon/util.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | export function isObj(v: unknown): v is Record {
5 | return typeof v === 'object' && v !== null
6 | }
7 |
8 | export function hasProp(
9 | data: object,
10 | prop: K,
11 | ): data is Record {
12 | return prop in data
13 | }
14 |
--------------------------------------------------------------------------------
/visualization/query_module/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # Add all module files related to graph util module
2 | set(visualization_src visualization.cpp)
3 | add_query_module(visualization 1 "${visualization_src}")
4 |
5 | # Link external libraries
6 | target_link_libraries(visualization PRIVATE ${CURL_LIBRARIES})
7 | target_include_directories(visualization PRIVATE ${CURL_INCLUDE_DIRS})
--------------------------------------------------------------------------------
/visualization/live/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/src/config.ts:
--------------------------------------------------------------------------------
1 | import { Database } from './db'
2 | import { DidResolver } from '@atproto/identity'
3 |
4 | export type AppContext = {
5 | db: Database
6 | didResolver: DidResolver
7 | cfg: Config
8 | }
9 |
10 | export type Config = {
11 | port: number
12 | listenhost: string
13 | hostname: string
14 | sqliteLocation: string
15 | subscriptionEndpoint: string
16 | serviceDid: string
17 | publisherDid: string
18 | subscriptionReconnectDelay: number
19 | }
20 |
--------------------------------------------------------------------------------
/visualization/backend_service/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
25 | # config file
26 | .env
--------------------------------------------------------------------------------
/visualization/live/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Live visualization
7 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bluej-app",
3 | "version": "1.0.0",
4 | "description": "A simple servers for running Memgraph queries.",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "body-parser": "^1.20.2",
13 | "express": "^4.18.2",
14 | "helmet": "^7.0.0",
15 | "neo4j-driver": "^4.4.6",
16 | "pm2": "^5.3.0"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 |
2 | {
3 | "compilerOptions": {
4 | "lib": [
5 | "ESNext",
6 | "DOM"
7 | ],
8 | "outDir": "dist",
9 | "module": "CommonJS",
10 | "target": "ES6",
11 | "esModuleInterop": true,
12 | "moduleResolution": "node",
13 | "alwaysStrict": true,
14 | "allowUnreachableCode": false,
15 | "strictNullChecks": true,
16 | "skipLibCheck": true
17 | },
18 | "include": ["./src/**/*.ts"],
19 | "exclude": [
20 | "node_modules"
21 | ]
22 | }
--------------------------------------------------------------------------------
/visualization/backend_service/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "backend_service",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "start": "node ./src/index.js",
9 | "start-dev": "nodemon ./src/index.js"
10 | },
11 | "author": "",
12 | "license": "ISC",
13 | "dependencies": {
14 | "@atproto/api": "^0.6.3",
15 | "dotenv": "^16.3.1",
16 | "express": "^4.18.2",
17 | "neo4j-driver": "^5.11.0",
18 | "socket.io": "^4.7.1"
19 | },
20 | "devDependencies": {
21 | "nodemon": "^3.0.1"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/algos/index.ts:
--------------------------------------------------------------------------------
1 | import { AppContext } from '../config'
2 | import {
3 | QueryParams,
4 | OutputSchema as AlgoOutput,
5 | } from '../lexicon/types/app/bsky/feed/getFeedSkeleton'
6 | import * as FriendsAndCommunity from './friends-and-community'
7 | import * as HomePlus from './home-plus'
8 | import * as Authors from './authors'
9 |
10 | type AlgoHandler = (ctx: AppContext, params: QueryParams, requesterDid: string) => Promise
11 |
12 | const algos: Record = {
13 | [FriendsAndCommunity.shortname]: FriendsAndCommunity.handler,
14 | [HomePlus.shortname]: HomePlus.handler,
15 | [Authors.shortname]: Authors.handler,
16 | }
17 |
18 | export default algos
19 |
--------------------------------------------------------------------------------
/src/auth.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import { verifyJwt, AuthRequiredError } from '@atproto/xrpc-server'
3 | import { DidResolver } from '@atproto/identity'
4 |
5 | export const validateAuth = async (
6 | req: express.Request,
7 | serviceDid: string,
8 | didResolver: DidResolver,
9 | ): Promise => {
10 | const { authorization = '' } = req.headers
11 | if (!authorization.startsWith('Bearer ')) {
12 | return 'did:plc:ewgejell4547pukut5255ibm'
13 | // throw new AuthRequiredError()
14 | }
15 | const jwt = authorization.replace('Bearer ', '').trim()
16 | return verifyJwt(jwt, serviceDid, async (did: string) => {
17 | return didResolver.resolveAtprotoKey(did)
18 | })
19 | }
20 |
--------------------------------------------------------------------------------
/visualization/backend_service/.env.example:
--------------------------------------------------------------------------------
1 | # Set this to the port where you want to run the backend server
2 | PORT=3002
3 |
4 | # Set this to the URL of the client-side app (for local testing use http://localhost:3001)
5 | CLIENT=https://bluej.memgraph.com/viz
6 |
7 | # Set this to the handle and password you want to run with
8 | HANDLE=example.bsky.social
9 | PASSWORD=password-goes-here
10 |
11 | # Set this to the number of nodes you want to send to the client-side app on interest subscribe
12 | NODE_COUNT=50
13 |
14 | # Set this to true if you want the backend service to run the enrichment process
15 | ENRICHMENT=true
16 |
17 | # Set this to true if you want verbose descriptions of activity
18 | VERBOSE=false
--------------------------------------------------------------------------------
/src/db/index.ts:
--------------------------------------------------------------------------------
1 | import SqliteDb from 'better-sqlite3'
2 | import { Kysely, Migrator, SqliteDialect } from 'kysely'
3 | import { DatabaseSchema } from './schema'
4 | import { migrationProvider } from './migrations'
5 |
6 | export const createDb = (location: string): Database => {
7 | return new Kysely({
8 | dialect: new SqliteDialect({
9 | database: new SqliteDb(location),
10 | }),
11 | })
12 | }
13 |
14 | export const migrateToLatest = async (db: Database) => {
15 | const migrator = new Migrator({ db, provider: migrationProvider })
16 | const { error } = await migrator.migrateToLatest()
17 | if (error) throw error
18 | }
19 |
20 | export type Database = Kysely
21 |
--------------------------------------------------------------------------------
/src/methods/describe-generator.ts:
--------------------------------------------------------------------------------
1 | import { Server } from '../lexicon'
2 | import { AppContext } from '../config'
3 | import algos from '../algos'
4 | import { AtUri } from '@atproto/syntax'
5 |
6 | export default function (server: Server, ctx: AppContext) {
7 | server.app.bsky.feed.describeFeedGenerator(async () => {
8 | const feeds = Object.keys(algos).map((shortname) => ({
9 | uri: AtUri.make(
10 | ctx.cfg.publisherDid,
11 | 'app.bsky.feed.generator',
12 | shortname,
13 | ).toString(),
14 | }))
15 | return {
16 | encoding: 'application/json',
17 | body: {
18 | did: ctx.cfg.serviceDid,
19 | feeds,
20 | },
21 | }
22 | })
23 | }
24 |
--------------------------------------------------------------------------------
/visualization/backend_service/src/routes/create.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const { sockets, clientInterests } = require('../index');
3 |
4 | const router = express.Router();
5 |
6 | router.post('/', (req, res) => {
7 | const author = req.body?.did || req.body?.author;
8 |
9 | Object.entries(sockets).forEach(([socketID, socket]) => {
10 | const interests = clientInterests[socketID];
11 |
12 | if (!interests || interests.includes(author)) {
13 | socket.emit('create', req.body);
14 | }
15 | });
16 |
17 | if (process.env.VERBOSE === 'true') {
18 | process.stdout.write('C');
19 | }
20 |
21 | res.sendStatus(200);
22 | })
23 |
24 | module.exports = router;
--------------------------------------------------------------------------------
/src/well-known.ts:
--------------------------------------------------------------------------------
1 | import express from 'express'
2 | import { AppContext } from './config'
3 |
4 | const makeRouter = (ctx: AppContext) => {
5 | const router = express.Router()
6 |
7 | router.get('/.well-known/did.json', (_req, res) => {
8 | if (!ctx.cfg.serviceDid.endsWith(ctx.cfg.hostname)) {
9 | return res.sendStatus(404)
10 | }
11 | res.json({
12 | '@context': ['https://www.w3.org/ns/did/v1'],
13 | id: ctx.cfg.serviceDid,
14 | service: [
15 | {
16 | id: '#bsky_fg',
17 | type: 'BskyFeedGenerator',
18 | serviceEndpoint: `https://${ctx.cfg.hostname}`,
19 | },
20 | ],
21 | })
22 | })
23 |
24 | return router
25 | }
26 | export default makeRouter
27 |
--------------------------------------------------------------------------------
/visualization/backend_service/src/routes/delete.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const { sockets, clientInterests } = require('../index');
3 |
4 | const router = express.Router();
5 |
6 | router.post('/', (req, res) => {
7 | const author = req.body?.did || req.body?.author;
8 |
9 | Object.entries(sockets).forEach(([socketID, socket]) => {
10 | const interests = clientInterests[socketID];
11 |
12 | if (!interests || interests.includes(author) || !author) {
13 | socket.emit('delete', req.body);
14 | }
15 | });
16 |
17 | if (process.env.VERBOSE === 'true') {
18 | process.stdout.write('D');
19 | }
20 |
21 | res.sendStatus(200);
22 | })
23 |
24 | module.exports = router;
--------------------------------------------------------------------------------
/visualization/backend_service/src/routes/merge.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const { sockets, clientInterests } = require('../index');
3 |
4 | const router = express.Router();
5 |
6 | router.post('/', (req, res) => {
7 | const author = req.body.source.startsWith('did') ? req.body.source : req.body?.author;
8 |
9 | Object.entries(sockets).forEach(([socketID, socket]) => {
10 | const interests = clientInterests[socketID];
11 |
12 | if (!interests || interests.includes(author)) {
13 | socket.emit('merge', req.body);
14 | }
15 | });
16 |
17 | if (process.env.VERBOSE === 'true') {
18 | process.stdout.write('M');
19 | }
20 |
21 | res.sendStatus(200);
22 | })
23 |
24 | module.exports = router;
--------------------------------------------------------------------------------
/visualization/backend_service/src/routes/detach.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const { sockets, clientInterests } = require('../index');
3 |
4 | const router = express.Router();
5 |
6 | router.post('/', (req, res) => {
7 | const author = req.body.source.startsWith('did') ? req.body.source : req.body?.author;
8 |
9 | Object.entries(sockets).forEach(([socketID, socket]) => {
10 | const interests = clientInterests[socketID];
11 |
12 | if (!interests || interests.includes(author) || !author) {
13 | socket.emit('detach', req.body);
14 | }
15 | });
16 |
17 | if (process.env.VERBOSE === 'true') {
18 | process.stdout.write('T');
19 | }
20 |
21 | res.sendStatus(200);
22 | })
23 |
24 | module.exports = router;
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/block.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 |
9 | export interface Record {
10 | subject: string
11 | createdAt: string
12 | [k: string]: unknown
13 | }
14 |
15 | export function isRecord(v: unknown): v is Record {
16 | return (
17 | isObj(v) &&
18 | hasProp(v, '$type') &&
19 | (v.$type === 'app.bsky.graph.block#main' ||
20 | v.$type === 'app.bsky.graph.block')
21 | )
22 | }
23 |
24 | export function validateRecord(v: unknown): ValidationResult {
25 | return lexicons.validate('app.bsky.graph.block#main', v)
26 | }
27 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/follow.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 |
9 | export interface Record {
10 | subject: string
11 | createdAt: string
12 | [k: string]: unknown
13 | }
14 |
15 | export function isRecord(v: unknown): v is Record {
16 | return (
17 | isObj(v) &&
18 | hasProp(v, '$type') &&
19 | (v.$type === 'app.bsky.graph.follow#main' ||
20 | v.$type === 'app.bsky.graph.follow')
21 | )
22 | }
23 |
24 | export function validateRecord(v: unknown): ValidationResult {
25 | return lexicons.validate('app.bsky.graph.follow#main', v)
26 | }
27 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/repo/strongRef.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 |
9 | export interface Main {
10 | uri: string
11 | cid: string
12 | [k: string]: unknown
13 | }
14 |
15 | export function isMain(v: unknown): v is Main {
16 | return (
17 | isObj(v) &&
18 | hasProp(v, '$type') &&
19 | (v.$type === 'com.atproto.repo.strongRef#main' ||
20 | v.$type === 'com.atproto.repo.strongRef')
21 | )
22 | }
23 |
24 | export function validateMain(v: unknown): ValidationResult {
25 | return lexicons.validate('com.atproto.repo.strongRef#main', v)
26 | }
27 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/listblock.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 |
9 | export interface Record {
10 | subject: string
11 | createdAt: string
12 | [k: string]: unknown
13 | }
14 |
15 | export function isRecord(v: unknown): v is Record {
16 | return (
17 | isObj(v) &&
18 | hasProp(v, '$type') &&
19 | (v.$type === 'app.bsky.graph.listblock#main' ||
20 | v.$type === 'app.bsky.graph.listblock')
21 | )
22 | }
23 |
24 | export function validateRecord(v: unknown): ValidationResult {
25 | return lexicons.validate('app.bsky.graph.listblock#main', v)
26 | }
27 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/listitem.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 |
9 | export interface Record {
10 | subject: string
11 | list: string
12 | createdAt: string
13 | [k: string]: unknown
14 | }
15 |
16 | export function isRecord(v: unknown): v is Record {
17 | return (
18 | isObj(v) &&
19 | hasProp(v, '$type') &&
20 | (v.$type === 'app.bsky.graph.listitem#main' ||
21 | v.$type === 'app.bsky.graph.listitem')
22 | )
23 | }
24 |
25 | export function validateRecord(v: unknown): ValidationResult {
26 | return lexicons.validate('app.bsky.graph.listitem#main', v)
27 | }
28 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/like.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 | import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
9 |
10 | export interface Record {
11 | subject: ComAtprotoRepoStrongRef.Main
12 | createdAt: string
13 | [k: string]: unknown
14 | }
15 |
16 | export function isRecord(v: unknown): v is Record {
17 | return (
18 | isObj(v) &&
19 | hasProp(v, '$type') &&
20 | (v.$type === 'app.bsky.feed.like#main' || v.$type === 'app.bsky.feed.like')
21 | )
22 | }
23 |
24 | export function validateRecord(v: unknown): ValidationResult {
25 | return lexicons.validate('app.bsky.feed.like#main', v)
26 | }
27 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/repost.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 | import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
9 |
10 | export interface Record {
11 | subject: ComAtprotoRepoStrongRef.Main
12 | createdAt: string
13 | [k: string]: unknown
14 | }
15 |
16 | export function isRecord(v: unknown): v is Record {
17 | return (
18 | isObj(v) &&
19 | hasProp(v, '$type') &&
20 | (v.$type === 'app.bsky.feed.repost#main' ||
21 | v.$type === 'app.bsky.feed.repost')
22 | )
23 | }
24 |
25 | export function validateRecord(v: unknown): ValidationResult {
26 | return lexicons.validate('app.bsky.feed.repost#main', v)
27 | }
28 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | # Whichever port you want to run this on
2 | FEEDGEN_PORT=8000
3 |
4 | # Set to something like db.sqlite to store persistently
5 | FEEDGEN_SQLITE_LOCATION=":memory:"
6 |
7 | # Don't change unless you're working in a different environment than the primary Bluesky network
8 | FEEDGEN_SUBSCRIPTION_ENDPOINT="wss://bsky.social"
9 |
10 | # Set this to the hostname that you intend to run the service at
11 | FEEDGEN_HOSTNAME="example.com"
12 | FEEDGEN_HANDLE="example.bsky.social"
13 | FEEDGEN_PASSWORD="password-goes-here"
14 |
15 | # Set this to the DID of the account you'll use to publish the feed
16 | # You can find your accounts DID by going to
17 | # https://bsky.social/xrpc/com.atproto.identity.resolveHandle?handle=${YOUR_HANDLE}
18 | FEEDGEN_PUBLISHER_DID="did:plc:2wqomm3tjqbgktbrfwgvrw34"
19 |
20 | # Delay between reconnect attempts to the firehose subscription endpoint (in milliseconds)
21 | FEEDGEN_SUBSCRIPTION_RECONNECT_DELAY=3000
--------------------------------------------------------------------------------
/scripts/get-did.ts:
--------------------------------------------------------------------------------
1 | import { BskyAgent, AtpSessionEvent, AtpSessionData } from '@atproto/api'
2 | import * as dotenv from 'dotenv'
3 | dotenv.config()
4 | const util = require('util')
5 |
6 | const agent = new BskyAgent({
7 | service: 'https://bsky.social/',
8 | })
9 |
10 | async function fetchProfile(handle: string) {
11 | try {
12 | let profile = await agent.getProfile({actor: handle})
13 | console.log(util.inspect(profile, false, null, true))
14 | } catch (err) {
15 | console.error('[fetchProfile]:', err)
16 | }
17 | }
18 |
19 | async function run(handle: string) {
20 | console.log(" Querying...", handle)
21 | await agent.login({ identifier: process.env.FEEDGEN_HANDLE, password: process.env.FEEDGEN_PASSWORD })
22 | fetchProfile(handle)
23 | }
24 |
25 | let handle = process.argv[2]?.trim()
26 | if (handle === undefined) {
27 | console.log("Usage: ts-node get-did.ts ")
28 | process.exit(1)
29 | }
30 |
31 | run(handle)
32 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/deleteSession.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export type InputSchema = undefined
14 | export type HandlerInput = undefined
15 |
16 | export interface HandlerError {
17 | status: number
18 | message?: string
19 | }
20 |
21 | export type HandlerOutput = HandlerError | void
22 | export type HandlerReqCtx = {
23 | auth: HA
24 | params: QueryParams
25 | input: HandlerInput
26 | req: express.Request
27 | res: express.Response
28 | }
29 | export type Handler = (
30 | ctx: HandlerReqCtx,
31 | ) => Promise | HandlerOutput
32 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/requestAccountDelete.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export type InputSchema = undefined
14 | export type HandlerInput = undefined
15 |
16 | export interface HandlerError {
17 | status: number
18 | message?: string
19 | }
20 |
21 | export type HandlerOutput = HandlerError | void
22 | export type HandlerReqCtx = {
23 | auth: HA
24 | params: QueryParams
25 | input: HandlerInput
26 | req: express.Request
27 | res: express.Response
28 | }
29 | export type Handler = (
30 | ctx: HandlerReqCtx,
31 | ) => Promise | HandlerOutput
32 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/actor/profile.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 | import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
9 |
10 | export interface Record {
11 | displayName?: string
12 | description?: string
13 | avatar?: BlobRef
14 | banner?: BlobRef
15 | labels?:
16 | | ComAtprotoLabelDefs.SelfLabels
17 | | { $type: string; [k: string]: unknown }
18 | [k: string]: unknown
19 | }
20 |
21 | export function isRecord(v: unknown): v is Record {
22 | return (
23 | isObj(v) &&
24 | hasProp(v, '$type') &&
25 | (v.$type === 'app.bsky.actor.profile#main' ||
26 | v.$type === 'app.bsky.actor.profile')
27 | )
28 | }
29 |
30 | export function validateRecord(v: unknown): ValidationResult {
31 | return lexicons.validate('app.bsky.actor.profile#main', v)
32 | }
33 |
--------------------------------------------------------------------------------
/src/db/migrations.ts:
--------------------------------------------------------------------------------
1 | import { Kysely, Migration, MigrationProvider } from 'kysely'
2 |
3 | const migrations: Record = {}
4 |
5 | export const migrationProvider: MigrationProvider = {
6 | async getMigrations() {
7 | return migrations
8 | },
9 | }
10 |
11 | migrations['001'] = {
12 | async up(db: Kysely) {
13 | await db.schema
14 | .createTable('post')
15 | .addColumn('uri', 'varchar', (col) => col.primaryKey())
16 | .addColumn('cid', 'varchar', (col) => col.notNull())
17 | .addColumn('replyParent', 'varchar')
18 | .addColumn('replyRoot', 'varchar')
19 | .addColumn('indexedAt', 'varchar', (col) => col.notNull())
20 | .execute()
21 | await db.schema
22 | .createTable('sub_state')
23 | .addColumn('service', 'varchar', (col) => col.primaryKey())
24 | .addColumn('cursor', 'integer', (col) => col.notNull())
25 | .execute()
26 | },
27 | async down(db: Kysely) {
28 | await db.schema.dropTable('post').execute()
29 | await db.schema.dropTable('sub_state').execute()
30 | },
31 | }
32 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/muteActor.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | actor: string
15 | [k: string]: unknown
16 | }
17 |
18 | export interface HandlerInput {
19 | encoding: 'application/json'
20 | body: InputSchema
21 | }
22 |
23 | export interface HandlerError {
24 | status: number
25 | message?: string
26 | }
27 |
28 | export type HandlerOutput = HandlerError | void
29 | export type HandlerReqCtx = {
30 | auth: HA
31 | params: QueryParams
32 | input: HandlerInput
33 | req: express.Request
34 | res: express.Response
35 | }
36 | export type Handler = (
37 | ctx: HandlerReqCtx,
38 | ) => Promise | HandlerOutput
39 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/unmuteActor.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | actor: string
15 | [k: string]: unknown
16 | }
17 |
18 | export interface HandlerInput {
19 | encoding: 'application/json'
20 | body: InputSchema
21 | }
22 |
23 | export interface HandlerError {
24 | status: number
25 | message?: string
26 | }
27 |
28 | export type HandlerOutput = HandlerError | void
29 | export type HandlerReqCtx = {
30 | auth: HA
31 | params: QueryParams
32 | input: HandlerInput
33 | req: express.Request
34 | res: express.Response
35 | }
36 | export type Handler = (
37 | ctx: HandlerReqCtx,
38 | ) => Promise | HandlerOutput
39 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/muteActorList.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | list: string
15 | [k: string]: unknown
16 | }
17 |
18 | export interface HandlerInput {
19 | encoding: 'application/json'
20 | body: InputSchema
21 | }
22 |
23 | export interface HandlerError {
24 | status: number
25 | message?: string
26 | }
27 |
28 | export type HandlerOutput = HandlerError | void
29 | export type HandlerReqCtx = {
30 | auth: HA
31 | params: QueryParams
32 | input: HandlerInput
33 | req: express.Request
34 | res: express.Response
35 | }
36 | export type Handler = (
37 | ctx: HandlerReqCtx,
38 | ) => Promise | HandlerOutput
39 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/unmuteActorList.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | list: string
15 | [k: string]: unknown
16 | }
17 |
18 | export interface HandlerInput {
19 | encoding: 'application/json'
20 | body: InputSchema
21 | }
22 |
23 | export interface HandlerError {
24 | status: number
25 | message?: string
26 | }
27 |
28 | export type HandlerOutput = HandlerError | void
29 | export type HandlerReqCtx = {
30 | auth: HA
31 | params: QueryParams
32 | input: HandlerInput
33 | req: express.Request
34 | res: express.Response
35 | }
36 | export type Handler = (
37 | ctx: HandlerReqCtx,
38 | ) => Promise | HandlerOutput
39 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/notification/updateSeen.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | seenAt: string
15 | [k: string]: unknown
16 | }
17 |
18 | export interface HandlerInput {
19 | encoding: 'application/json'
20 | body: InputSchema
21 | }
22 |
23 | export interface HandlerError {
24 | status: number
25 | message?: string
26 | }
27 |
28 | export type HandlerOutput = HandlerError | void
29 | export type HandlerReqCtx = {
30 | auth: HA
31 | params: QueryParams
32 | input: HandlerInput
33 | req: express.Request
34 | res: express.Response
35 | }
36 | export type Handler = (
37 | ctx: HandlerReqCtx,
38 | ) => Promise | HandlerOutput
39 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/identity/updateHandle.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | handle: string
15 | [k: string]: unknown
16 | }
17 |
18 | export interface HandlerInput {
19 | encoding: 'application/json'
20 | body: InputSchema
21 | }
22 |
23 | export interface HandlerError {
24 | status: number
25 | message?: string
26 | }
27 |
28 | export type HandlerOutput = HandlerError | void
29 | export type HandlerReqCtx = {
30 | auth: HA
31 | params: QueryParams
32 | input: HandlerInput
33 | req: express.Request
34 | res: express.Response
35 | }
36 | export type Handler = (
37 | ctx: HandlerReqCtx,
38 | ) => Promise | HandlerOutput
39 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/revokeAppPassword.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | name: string
15 | [k: string]: unknown
16 | }
17 |
18 | export interface HandlerInput {
19 | encoding: 'application/json'
20 | body: InputSchema
21 | }
22 |
23 | export interface HandlerError {
24 | status: number
25 | message?: string
26 | }
27 |
28 | export type HandlerOutput = HandlerError | void
29 | export type HandlerReqCtx = {
30 | auth: HA
31 | params: QueryParams
32 | input: HandlerInput
33 | req: express.Request
34 | res: express.Response
35 | }
36 | export type Handler = (
37 | ctx: HandlerReqCtx,
38 | ) => Promise | HandlerOutput
39 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/requestPasswordReset.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | email: string
15 | [k: string]: unknown
16 | }
17 |
18 | export interface HandlerInput {
19 | encoding: 'application/json'
20 | body: InputSchema
21 | }
22 |
23 | export interface HandlerError {
24 | status: number
25 | message?: string
26 | }
27 |
28 | export type HandlerOutput = HandlerError | void
29 | export type HandlerReqCtx = {
30 | auth: HA
31 | params: QueryParams
32 | input: HandlerInput
33 | req: express.Request
34 | res: express.Response
35 | }
36 | export type Handler = (
37 | ctx: HandlerReqCtx,
38 | ) => Promise | HandlerOutput
39 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | did: string
15 | handle: string
16 | [k: string]: unknown
17 | }
18 |
19 | export interface HandlerInput {
20 | encoding: 'application/json'
21 | body: InputSchema
22 | }
23 |
24 | export interface HandlerError {
25 | status: number
26 | message?: string
27 | }
28 |
29 | export type HandlerOutput = HandlerError | void
30 | export type HandlerReqCtx = {
31 | auth: HA
32 | params: QueryParams
33 | input: HandlerInput
34 | req: express.Request
35 | res: express.Response
36 | }
37 | export type Handler = (
38 | ctx: HandlerReqCtx,
39 | ) => Promise | HandlerOutput
40 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | codes?: string[]
15 | accounts?: string[]
16 | [k: string]: unknown
17 | }
18 |
19 | export interface HandlerInput {
20 | encoding: 'application/json'
21 | body: InputSchema
22 | }
23 |
24 | export interface HandlerError {
25 | status: number
26 | message?: string
27 | }
28 |
29 | export type HandlerOutput = HandlerError | void
30 | export type HandlerReqCtx = {
31 | auth: HA
32 | params: QueryParams
33 | input: HandlerInput
34 | req: express.Request
35 | res: express.Response
36 | }
37 | export type Handler = (
38 | ctx: HandlerReqCtx,
39 | ) => Promise | HandlerOutput
40 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "memgraph-bluej",
3 | "version": "1.0.0",
4 | "description": "memgraph graph database atproto feed generator starter kit",
5 | "main": "index.js",
6 | "repository": "git@github.com:memgraph/bluej.git",
7 | "author": "Memgraph ",
8 | "license": "MIT",
9 | "scripts": {
10 | "start": "ts-node src/index.ts",
11 | "build": "tsc",
12 | "publishFeed": "ts-node scripts/publishFeedGen.ts"
13 | },
14 | "dependencies": {
15 | "@atproto/api": "^0.6.20",
16 | "@atproto/did-resolver": "^0.1.0",
17 | "@atproto/identity": "^0.2.1",
18 | "@atproto/lexicon": "^0.2.2",
19 | "@atproto/repo": "^0.3.2",
20 | "@atproto/syntax": "^0.1.2",
21 | "@atproto/xrpc-server": "^0.3.2",
22 | "better-sqlite3": "^8.3.0",
23 | "dotenv": "^16.0.3",
24 | "express": "^4.18.2",
25 | "kysely": "^0.22.0",
26 | "multiformats": "^9.9.0",
27 | "neo4j-driver": "^5.10.0"
28 | },
29 | "devDependencies": {
30 | "@types/better-sqlite3": "^7.6.4",
31 | "@types/express": "^4.17.17",
32 | "@types/node": "^20.1.2",
33 | "ts-node": "^10.9.1",
34 | "typescript": "^5.0.4"
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/generator.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 | import * as AppBskyRichtextFacet from '../richtext/facet'
9 | import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
10 |
11 | export interface Record {
12 | did: string
13 | displayName: string
14 | description?: string
15 | descriptionFacets?: AppBskyRichtextFacet.Main[]
16 | avatar?: BlobRef
17 | labels?:
18 | | ComAtprotoLabelDefs.SelfLabels
19 | | { $type: string; [k: string]: unknown }
20 | createdAt: string
21 | [k: string]: unknown
22 | }
23 |
24 | export function isRecord(v: unknown): v is Record {
25 | return (
26 | isObj(v) &&
27 | hasProp(v, '$type') &&
28 | (v.$type === 'app.bsky.feed.generator#main' ||
29 | v.$type === 'app.bsky.feed.generator')
30 | )
31 | }
32 |
33 | export function validateRecord(v: unknown): ValidationResult {
34 | return lexicons.validate('app.bsky.feed.generator#main', v)
35 | }
36 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | /** Hostname of the service that is notifying of update. */
15 | hostname: string
16 | [k: string]: unknown
17 | }
18 |
19 | export interface HandlerInput {
20 | encoding: 'application/json'
21 | body: InputSchema
22 | }
23 |
24 | export interface HandlerError {
25 | status: number
26 | message?: string
27 | }
28 |
29 | export type HandlerOutput = HandlerError | void
30 | export type HandlerReqCtx = {
31 | auth: HA
32 | params: QueryParams
33 | input: HandlerInput
34 | req: express.Request
35 | res: express.Response
36 | }
37 | export type Handler = (
38 | ctx: HandlerReqCtx,
39 | ) => Promise | HandlerOutput
40 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/actor/putPreferences.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyActorDefs from './defs'
11 |
12 | export interface QueryParams {}
13 |
14 | export interface InputSchema {
15 | preferences: AppBskyActorDefs.Preferences
16 | [k: string]: unknown
17 | }
18 |
19 | export interface HandlerInput {
20 | encoding: 'application/json'
21 | body: InputSchema
22 | }
23 |
24 | export interface HandlerError {
25 | status: number
26 | message?: string
27 | }
28 |
29 | export type HandlerOutput = HandlerError | void
30 | export type HandlerReqCtx = {
31 | auth: HA
32 | params: QueryParams
33 | input: HandlerInput
34 | req: express.Request
35 | res: express.Response
36 | }
37 | export type Handler = (
38 | ctx: HandlerReqCtx,
39 | ) => Promise | HandlerOutput
40 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | /** The handle or DID of the repo. */
15 | account: string
16 | email: string
17 | [k: string]: unknown
18 | }
19 |
20 | export interface HandlerInput {
21 | encoding: 'application/json'
22 | body: InputSchema
23 | }
24 |
25 | export interface HandlerError {
26 | status: number
27 | message?: string
28 | }
29 |
30 | export type HandlerOutput = HandlerError | void
31 | export type HandlerReqCtx = {
32 | auth: HA
33 | params: QueryParams
34 | input: HandlerInput
35 | req: express.Request
36 | res: express.Response
37 | }
38 | export type Handler = (
39 | ctx: HandlerReqCtx,
40 | ) => Promise | HandlerOutput
41 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/resetPassword.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | token: string
15 | password: string
16 | [k: string]: unknown
17 | }
18 |
19 | export interface HandlerInput {
20 | encoding: 'application/json'
21 | body: InputSchema
22 | }
23 |
24 | export interface HandlerError {
25 | status: number
26 | message?: string
27 | error?: 'ExpiredToken' | 'InvalidToken'
28 | }
29 |
30 | export type HandlerOutput = HandlerError | void
31 | export type HandlerReqCtx = {
32 | auth: HA
33 | params: QueryParams
34 | input: HandlerInput
35 | req: express.Request
36 | res: express.Response
37 | }
38 | export type Handler = (
39 | ctx: HandlerReqCtx,
40 | ) => Promise | HandlerOutput
41 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/sync/requestCrawl.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | /** Hostname of the service that is requesting to be crawled. */
15 | hostname: string
16 | [k: string]: unknown
17 | }
18 |
19 | export interface HandlerInput {
20 | encoding: 'application/json'
21 | body: InputSchema
22 | }
23 |
24 | export interface HandlerError {
25 | status: number
26 | message?: string
27 | }
28 |
29 | export type HandlerOutput = HandlerError | void
30 | export type HandlerReqCtx = {
31 | auth: HA
32 | params: QueryParams
33 | input: HandlerInput
34 | req: express.Request
35 | res: express.Response
36 | }
37 | export type Handler = (
38 | ctx: HandlerReqCtx,
39 | ) => Promise | HandlerOutput
40 |
--------------------------------------------------------------------------------
/src/methods/feed-generation.ts:
--------------------------------------------------------------------------------
1 | import { InvalidRequestError } from '@atproto/xrpc-server'
2 | import { Server } from '../lexicon'
3 | import { AppContext } from '../config'
4 | import algos from '../algos'
5 | import { validateAuth } from '../auth'
6 | import { AtUri } from '@atproto/syntax'
7 |
8 | export default function (server: Server, ctx: AppContext) {
9 | server.app.bsky.feed.getFeedSkeleton(async ({ params, req }) => {
10 | const feedUri = new AtUri(params.feed)
11 | const algo = algos[feedUri.rkey]
12 | if (
13 | feedUri.hostname !== ctx.cfg.publisherDid ||
14 | feedUri.collection !== 'app.bsky.feed.generator' ||
15 | !algo
16 | ) {
17 | throw new InvalidRequestError(
18 | 'Unsupported algorithm',
19 | 'UnsupportedAlgorithm',
20 | )
21 | }
22 | let requesterDid = ''
23 | try {
24 | requesterDid = await validateAuth(
25 | req,
26 | ctx.cfg.serviceDid,
27 | ctx.didResolver,
28 | )
29 | } catch (e) {
30 | console.error(e)
31 | }
32 | const body = await algo(ctx, params, requesterDid)
33 | return {
34 | encoding: 'application/json',
35 | body: body,
36 | }
37 | })
38 | }
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/deleteAccount.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | did: string
15 | password: string
16 | token: string
17 | [k: string]: unknown
18 | }
19 |
20 | export interface HandlerInput {
21 | encoding: 'application/json'
22 | body: InputSchema
23 | }
24 |
25 | export interface HandlerError {
26 | status: number
27 | message?: string
28 | error?: 'ExpiredToken' | 'InvalidToken'
29 | }
30 |
31 | export type HandlerOutput = HandlerError | void
32 | export type HandlerReqCtx = {
33 | auth: HA
34 | params: QueryParams
35 | input: HandlerInput
36 | req: express.Request
37 | res: express.Response
38 | }
39 | export type Handler = (
40 | ctx: HandlerReqCtx,
41 | ) => Promise | HandlerOutput
42 |
--------------------------------------------------------------------------------
/visualization/backend_service/src/routes/enrich.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const enrichPerson = require('../util/enrich_util');
3 | const { agent } = require('../index');
4 |
5 | const router = express.Router();
6 |
7 | router.post('/person', async (req, res) => {
8 | if (req.socket.remoteAddress !== '::1' && req.socket.remoteAddress.replace(/^.*:/, '') !== '127.0.0.1') {
9 | res.sendStatus(403);
10 | return;
11 | }
12 |
13 | if (!agent.hasSession) {
14 | res.sendStatus(401);
15 | return;
16 | }
17 |
18 | if (process.env.ENRICHMENT !== 'true') {
19 | res.sendStatus(200);
20 | return;
21 | }
22 |
23 | const did = req.body.did;
24 |
25 | const result = await enrichPerson(did);
26 |
27 | if (result) {
28 | if (process.env.VERBOSE === 'true') {
29 | process.stdout.write('Ep');
30 | }
31 |
32 | res.sendStatus(200);
33 | } else {
34 | if (process.env.VERBOSE === 'true') {
35 | process.stdout.write(`\nAn error occured while trying to enrich person with DID: ${did}.\n`);
36 | }
37 |
38 | res.sendStatus(500);
39 | }
40 | })
41 |
42 | module.exports = router;
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/list.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 | import * as AppBskyGraphDefs from './defs'
9 | import * as AppBskyRichtextFacet from '../richtext/facet'
10 | import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
11 |
12 | export interface Record {
13 | purpose: AppBskyGraphDefs.ListPurpose
14 | name: string
15 | description?: string
16 | descriptionFacets?: AppBskyRichtextFacet.Main[]
17 | avatar?: BlobRef
18 | labels?:
19 | | ComAtprotoLabelDefs.SelfLabels
20 | | { $type: string; [k: string]: unknown }
21 | createdAt: string
22 | [k: string]: unknown
23 | }
24 |
25 | export function isRecord(v: unknown): v is Record {
26 | return (
27 | isObj(v) &&
28 | hasProp(v, '$type') &&
29 | (v.$type === 'app.bsky.graph.list#main' ||
30 | v.$type === 'app.bsky.graph.list')
31 | )
32 | }
33 |
34 | export function validateRecord(v: unknown): ValidationResult {
35 | return lexicons.validate('app.bsky.graph.list#main', v)
36 | }
37 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/notification/registerPush.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | serviceDid: string
15 | token: string
16 | platform: 'ios' | 'android' | 'web' | (string & {})
17 | appId: string
18 | [k: string]: unknown
19 | }
20 |
21 | export interface HandlerInput {
22 | encoding: 'application/json'
23 | body: InputSchema
24 | }
25 |
26 | export interface HandlerError {
27 | status: number
28 | message?: string
29 | }
30 |
31 | export type HandlerOutput = HandlerError | void
32 | export type HandlerReqCtx = {
33 | auth: HA
34 | params: QueryParams
35 | input: HandlerInput
36 | req: express.Request
37 | res: express.Response
38 | }
39 | export type Handler = (
40 | ctx: HandlerReqCtx,
41 | ) => Promise | HandlerOutput
42 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/disableAccountInvites.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | account: string
15 | /** Additionally add a note describing why the invites were disabled */
16 | note?: string
17 | [k: string]: unknown
18 | }
19 |
20 | export interface HandlerInput {
21 | encoding: 'application/json'
22 | body: InputSchema
23 | }
24 |
25 | export interface HandlerError {
26 | status: number
27 | message?: string
28 | }
29 |
30 | export type HandlerOutput = HandlerError | void
31 | export type HandlerReqCtx = {
32 | auth: HA
33 | params: QueryParams
34 | input: HandlerInput
35 | req: express.Request
36 | res: express.Response
37 | }
38 | export type Handler = (
39 | ctx: HandlerReqCtx,
40 | ) => Promise | HandlerOutput
41 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/enableAccountInvites.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | account: string
15 | /** Additionally add a note describing why the invites were enabled */
16 | note?: string
17 | [k: string]: unknown
18 | }
19 |
20 | export interface HandlerInput {
21 | encoding: 'application/json'
22 | body: InputSchema
23 | }
24 |
25 | export interface HandlerError {
26 | status: number
27 | message?: string
28 | }
29 |
30 | export type HandlerOutput = HandlerError | void
31 | export type HandlerReqCtx = {
32 | auth: HA
33 | params: QueryParams
34 | input: HandlerInput
35 | req: express.Request
36 | res: express.Response
37 | }
38 | export type Handler = (
39 | ctx: HandlerReqCtx,
40 | ) => Promise | HandlerOutput
41 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/sync/getCheckout.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import stream from 'stream'
6 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
7 | import { lexicons } from '../../../../lexicons'
8 | import { isObj, hasProp } from '../../../../util'
9 | import { CID } from 'multiformats/cid'
10 | import { HandlerAuth } from '@atproto/xrpc-server'
11 |
12 | export interface QueryParams {
13 | /** The DID of the repo. */
14 | did: string
15 | }
16 |
17 | export type InputSchema = undefined
18 | export type HandlerInput = undefined
19 |
20 | export interface HandlerSuccess {
21 | encoding: 'application/vnd.ipld.car'
22 | body: Uint8Array | stream.Readable
23 | headers?: { [key: string]: string }
24 | }
25 |
26 | export interface HandlerError {
27 | status: number
28 | message?: string
29 | }
30 |
31 | export type HandlerOutput = HandlerError | HandlerSuccess
32 | export type HandlerReqCtx = {
33 | auth: HA
34 | params: QueryParams
35 | input: HandlerInput
36 | req: express.Request
37 | res: express.Response
38 | }
39 | export type Handler = (
40 | ctx: HandlerReqCtx,
41 | ) => Promise | HandlerOutput
42 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/actor/getProfile.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyActorDefs from './defs'
11 |
12 | export interface QueryParams {
13 | actor: string
14 | }
15 |
16 | export type InputSchema = undefined
17 | export type OutputSchema = AppBskyActorDefs.ProfileViewDetailed
18 | export type HandlerInput = undefined
19 |
20 | export interface HandlerSuccess {
21 | encoding: 'application/json'
22 | body: OutputSchema
23 | headers?: { [key: string]: string }
24 | }
25 |
26 | export interface HandlerError {
27 | status: number
28 | message?: string
29 | }
30 |
31 | export type HandlerOutput = HandlerError | HandlerSuccess
32 | export type HandlerReqCtx = {
33 | auth: HA
34 | params: QueryParams
35 | input: HandlerInput
36 | req: express.Request
37 | res: express.Response
38 | }
39 | export type Handler = (
40 | ctx: HandlerReqCtx,
41 | ) => Promise | HandlerOutput
42 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/sync/getBlocks.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import stream from 'stream'
6 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
7 | import { lexicons } from '../../../../lexicons'
8 | import { isObj, hasProp } from '../../../../util'
9 | import { CID } from 'multiformats/cid'
10 | import { HandlerAuth } from '@atproto/xrpc-server'
11 |
12 | export interface QueryParams {
13 | /** The DID of the repo. */
14 | did: string
15 | cids: string[]
16 | }
17 |
18 | export type InputSchema = undefined
19 | export type HandlerInput = undefined
20 |
21 | export interface HandlerSuccess {
22 | encoding: 'application/vnd.ipld.car'
23 | body: Uint8Array | stream.Readable
24 | headers?: { [key: string]: string }
25 | }
26 |
27 | export interface HandlerError {
28 | status: number
29 | message?: string
30 | }
31 |
32 | export type HandlerOutput = HandlerError | HandlerSuccess
33 | export type HandlerReqCtx = {
34 | auth: HA
35 | params: QueryParams
36 | input: HandlerInput
37 | req: express.Request
38 | res: express.Response
39 | }
40 | export type Handler = (
41 | ctx: HandlerReqCtx,
42 | ) => Promise | HandlerOutput
43 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/notification/getUnreadCount.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {
12 | seenAt?: string
13 | }
14 |
15 | export type InputSchema = undefined
16 |
17 | export interface OutputSchema {
18 | count: number
19 | [k: string]: unknown
20 | }
21 |
22 | export type HandlerInput = undefined
23 |
24 | export interface HandlerSuccess {
25 | encoding: 'application/json'
26 | body: OutputSchema
27 | headers?: { [key: string]: string }
28 | }
29 |
30 | export interface HandlerError {
31 | status: number
32 | message?: string
33 | }
34 |
35 | export type HandlerOutput = HandlerError | HandlerSuccess
36 | export type HandlerReqCtx = {
37 | auth: HA
38 | params: QueryParams
39 | input: HandlerInput
40 | req: express.Request
41 | res: express.Response
42 | }
43 | export type Handler = (
44 | ctx: HandlerReqCtx,
45 | ) => Promise | HandlerOutput
46 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/unspecced/defs.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 |
9 | export interface SkeletonSearchPost {
10 | uri: string
11 | [k: string]: unknown
12 | }
13 |
14 | export function isSkeletonSearchPost(v: unknown): v is SkeletonSearchPost {
15 | return (
16 | isObj(v) &&
17 | hasProp(v, '$type') &&
18 | v.$type === 'app.bsky.unspecced.defs#skeletonSearchPost'
19 | )
20 | }
21 |
22 | export function validateSkeletonSearchPost(v: unknown): ValidationResult {
23 | return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchPost', v)
24 | }
25 |
26 | export interface SkeletonSearchActor {
27 | did: string
28 | [k: string]: unknown
29 | }
30 |
31 | export function isSkeletonSearchActor(v: unknown): v is SkeletonSearchActor {
32 | return (
33 | isObj(v) &&
34 | hasProp(v, '$type') &&
35 | v.$type === 'app.bsky.unspecced.defs#skeletonSearchActor'
36 | )
37 | }
38 |
39 | export function validateSkeletonSearchActor(v: unknown): ValidationResult {
40 | return lexicons.validate('app.bsky.unspecced.defs#skeletonSearchActor', v)
41 | }
42 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/getSession.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export type InputSchema = undefined
14 |
15 | export interface OutputSchema {
16 | handle: string
17 | did: string
18 | email?: string
19 | [k: string]: unknown
20 | }
21 |
22 | export type HandlerInput = undefined
23 |
24 | export interface HandlerSuccess {
25 | encoding: 'application/json'
26 | body: OutputSchema
27 | headers?: { [key: string]: string }
28 | }
29 |
30 | export interface HandlerError {
31 | status: number
32 | message?: string
33 | }
34 |
35 | export type HandlerOutput = HandlerError | HandlerSuccess
36 | export type HandlerReqCtx = {
37 | auth: HA
38 | params: QueryParams
39 | input: HandlerInput
40 | req: express.Request
41 | res: express.Response
42 | }
43 | export type Handler = (
44 | ctx: HandlerReqCtx,
45 | ) => Promise | HandlerOutput
46 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/getModerationAction.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as ComAtprotoAdminDefs from './defs'
11 |
12 | export interface QueryParams {
13 | id: number
14 | }
15 |
16 | export type InputSchema = undefined
17 | export type OutputSchema = ComAtprotoAdminDefs.ActionViewDetail
18 | export type HandlerInput = undefined
19 |
20 | export interface HandlerSuccess {
21 | encoding: 'application/json'
22 | body: OutputSchema
23 | headers?: { [key: string]: string }
24 | }
25 |
26 | export interface HandlerError {
27 | status: number
28 | message?: string
29 | }
30 |
31 | export type HandlerOutput = HandlerError | HandlerSuccess
32 | export type HandlerReqCtx = {
33 | auth: HA
34 | params: QueryParams
35 | input: HandlerInput
36 | req: express.Request
37 | res: express.Response
38 | }
39 | export type Handler = (
40 | ctx: HandlerReqCtx,
41 | ) => Promise | HandlerOutput
42 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/getModerationReport.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as ComAtprotoAdminDefs from './defs'
11 |
12 | export interface QueryParams {
13 | id: number
14 | }
15 |
16 | export type InputSchema = undefined
17 | export type OutputSchema = ComAtprotoAdminDefs.ReportViewDetail
18 | export type HandlerInput = undefined
19 |
20 | export interface HandlerSuccess {
21 | encoding: 'application/json'
22 | body: OutputSchema
23 | headers?: { [key: string]: string }
24 | }
25 |
26 | export interface HandlerError {
27 | status: number
28 | message?: string
29 | }
30 |
31 | export type HandlerOutput = HandlerError | HandlerSuccess
32 | export type HandlerReqCtx = {
33 | auth: HA
34 | params: QueryParams
35 | input: HandlerInput
36 | req: express.Request
37 | res: express.Response
38 | }
39 | export type Handler = (
40 | ctx: HandlerReqCtx,
41 | ) => Promise | HandlerOutput
42 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/sync/getBlob.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import stream from 'stream'
6 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
7 | import { lexicons } from '../../../../lexicons'
8 | import { isObj, hasProp } from '../../../../util'
9 | import { CID } from 'multiformats/cid'
10 | import { HandlerAuth } from '@atproto/xrpc-server'
11 |
12 | export interface QueryParams {
13 | /** The DID of the repo. */
14 | did: string
15 | /** The CID of the blob to fetch */
16 | cid: string
17 | }
18 |
19 | export type InputSchema = undefined
20 | export type HandlerInput = undefined
21 |
22 | export interface HandlerSuccess {
23 | encoding: '*/*'
24 | body: Uint8Array | stream.Readable
25 | headers?: { [key: string]: string }
26 | }
27 |
28 | export interface HandlerError {
29 | status: number
30 | message?: string
31 | }
32 |
33 | export type HandlerOutput = HandlerError | HandlerSuccess
34 | export type HandlerReqCtx = {
35 | auth: HA
36 | params: QueryParams
37 | input: HandlerInput
38 | req: express.Request
39 | res: express.Response
40 | }
41 | export type Handler = (
42 | ctx: HandlerReqCtx,
43 | ) => Promise | HandlerOutput
44 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/getRepo.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as ComAtprotoAdminDefs from './defs'
11 |
12 | export interface QueryParams {
13 | did: string
14 | }
15 |
16 | export type InputSchema = undefined
17 | export type OutputSchema = ComAtprotoAdminDefs.RepoViewDetail
18 | export type HandlerInput = undefined
19 |
20 | export interface HandlerSuccess {
21 | encoding: 'application/json'
22 | body: OutputSchema
23 | headers?: { [key: string]: string }
24 | }
25 |
26 | export interface HandlerError {
27 | status: number
28 | message?: string
29 | error?: 'RepoNotFound'
30 | }
31 |
32 | export type HandlerOutput = HandlerError | HandlerSuccess
33 | export type HandlerReqCtx = {
34 | auth: HA
35 | params: QueryParams
36 | input: HandlerInput
37 | req: express.Request
38 | res: express.Response
39 | }
40 | export type Handler = (
41 | ctx: HandlerReqCtx,
42 | ) => Promise | HandlerOutput
43 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/identity/resolveHandle.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {
12 | /** The handle to resolve. */
13 | handle: string
14 | }
15 |
16 | export type InputSchema = undefined
17 |
18 | export interface OutputSchema {
19 | did: string
20 | [k: string]: unknown
21 | }
22 |
23 | export type HandlerInput = undefined
24 |
25 | export interface HandlerSuccess {
26 | encoding: 'application/json'
27 | body: OutputSchema
28 | headers?: { [key: string]: string }
29 | }
30 |
31 | export interface HandlerError {
32 | status: number
33 | message?: string
34 | }
35 |
36 | export type HandlerOutput = HandlerError | HandlerSuccess
37 | export type HandlerReqCtx = {
38 | auth: HA
39 | params: QueryParams
40 | input: HandlerInput
41 | req: express.Request
42 | res: express.Response
43 | }
44 | export type Handler = (
45 | ctx: HandlerReqCtx,
46 | ) => Promise | HandlerOutput
47 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/actor/getPreferences.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyActorDefs from './defs'
11 |
12 | export interface QueryParams {}
13 |
14 | export type InputSchema = undefined
15 |
16 | export interface OutputSchema {
17 | preferences: AppBskyActorDefs.Preferences
18 | [k: string]: unknown
19 | }
20 |
21 | export type HandlerInput = undefined
22 |
23 | export interface HandlerSuccess {
24 | encoding: 'application/json'
25 | body: OutputSchema
26 | headers?: { [key: string]: string }
27 | }
28 |
29 | export interface HandlerError {
30 | status: number
31 | message?: string
32 | }
33 |
34 | export type HandlerOutput = HandlerError | HandlerSuccess
35 | export type HandlerReqCtx = {
36 | auth: HA
37 | params: QueryParams
38 | input: HandlerInput
39 | req: express.Request
40 | res: express.Response
41 | }
42 | export type Handler = (
43 | ctx: HandlerReqCtx,
44 | ) => Promise | HandlerOutput
45 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/sync/getHead.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {
12 | /** The DID of the repo. */
13 | did: string
14 | }
15 |
16 | export type InputSchema = undefined
17 |
18 | export interface OutputSchema {
19 | root: string
20 | [k: string]: unknown
21 | }
22 |
23 | export type HandlerInput = undefined
24 |
25 | export interface HandlerSuccess {
26 | encoding: 'application/json'
27 | body: OutputSchema
28 | headers?: { [key: string]: string }
29 | }
30 |
31 | export interface HandlerError {
32 | status: number
33 | message?: string
34 | error?: 'HeadNotFound'
35 | }
36 |
37 | export type HandlerOutput = HandlerError | HandlerSuccess
38 | export type HandlerReqCtx = {
39 | auth: HA
40 | params: QueryParams
41 | input: HandlerInput
42 | req: express.Request
43 | res: express.Response
44 | }
45 | export type Handler = (
46 | ctx: HandlerReqCtx,
47 | ) => Promise | HandlerOutput
48 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/getPosts.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyFeedDefs from './defs'
11 |
12 | export interface QueryParams {
13 | uris: string[]
14 | }
15 |
16 | export type InputSchema = undefined
17 |
18 | export interface OutputSchema {
19 | posts: AppBskyFeedDefs.PostView[]
20 | [k: string]: unknown
21 | }
22 |
23 | export type HandlerInput = undefined
24 |
25 | export interface HandlerSuccess {
26 | encoding: 'application/json'
27 | body: OutputSchema
28 | headers?: { [key: string]: string }
29 | }
30 |
31 | export interface HandlerError {
32 | status: number
33 | message?: string
34 | }
35 |
36 | export type HandlerOutput = HandlerError | HandlerSuccess
37 | export type HandlerReqCtx = {
38 | auth: HA
39 | params: QueryParams
40 | input: HandlerInput
41 | req: express.Request
42 | res: express.Response
43 | }
44 | export type Handler = (
45 | ctx: HandlerReqCtx,
46 | ) => Promise | HandlerOutput
47 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/getRecord.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as ComAtprotoAdminDefs from './defs'
11 |
12 | export interface QueryParams {
13 | uri: string
14 | cid?: string
15 | }
16 |
17 | export type InputSchema = undefined
18 | export type OutputSchema = ComAtprotoAdminDefs.RecordViewDetail
19 | export type HandlerInput = undefined
20 |
21 | export interface HandlerSuccess {
22 | encoding: 'application/json'
23 | body: OutputSchema
24 | headers?: { [key: string]: string }
25 | }
26 |
27 | export interface HandlerError {
28 | status: number
29 | message?: string
30 | error?: 'RecordNotFound'
31 | }
32 |
33 | export type HandlerOutput = HandlerError | HandlerSuccess
34 | export type HandlerReqCtx = {
35 | auth: HA
36 | params: QueryParams
37 | input: HandlerInput
38 | req: express.Request
39 | res: express.Response
40 | }
41 | export type Handler = (
42 | ctx: HandlerReqCtx,
43 | ) => Promise | HandlerOutput
44 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/sync/getRepo.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import stream from 'stream'
6 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
7 | import { lexicons } from '../../../../lexicons'
8 | import { isObj, hasProp } from '../../../../util'
9 | import { CID } from 'multiformats/cid'
10 | import { HandlerAuth } from '@atproto/xrpc-server'
11 |
12 | export interface QueryParams {
13 | /** The DID of the repo. */
14 | did: string
15 | /** The revision of the repo to catch up from. */
16 | since?: string
17 | }
18 |
19 | export type InputSchema = undefined
20 | export type HandlerInput = undefined
21 |
22 | export interface HandlerSuccess {
23 | encoding: 'application/vnd.ipld.car'
24 | body: Uint8Array | stream.Readable
25 | headers?: { [key: string]: string }
26 | }
27 |
28 | export interface HandlerError {
29 | status: number
30 | message?: string
31 | }
32 |
33 | export type HandlerOutput = HandlerError | HandlerSuccess
34 | export type HandlerReqCtx = {
35 | auth: HA
36 | params: QueryParams
37 | input: HandlerInput
38 | req: express.Request
39 | res: express.Response
40 | }
41 | export type Handler = (
42 | ctx: HandlerReqCtx,
43 | ) => Promise | HandlerOutput
44 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/repo/uploadBlob.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import stream from 'stream'
6 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
7 | import { lexicons } from '../../../../lexicons'
8 | import { isObj, hasProp } from '../../../../util'
9 | import { CID } from 'multiformats/cid'
10 | import { HandlerAuth } from '@atproto/xrpc-server'
11 |
12 | export interface QueryParams {}
13 |
14 | export type InputSchema = string | Uint8Array
15 |
16 | export interface OutputSchema {
17 | blob: BlobRef
18 | [k: string]: unknown
19 | }
20 |
21 | export interface HandlerInput {
22 | encoding: '*/*'
23 | body: stream.Readable
24 | }
25 |
26 | export interface HandlerSuccess {
27 | encoding: 'application/json'
28 | body: OutputSchema
29 | headers?: { [key: string]: string }
30 | }
31 |
32 | export interface HandlerError {
33 | status: number
34 | message?: string
35 | }
36 |
37 | export type HandlerOutput = HandlerError | HandlerSuccess
38 | export type HandlerReqCtx = {
39 | auth: HA
40 | params: QueryParams
41 | input: HandlerInput
42 | req: express.Request
43 | res: express.Response
44 | }
45 | export type Handler = (
46 | ctx: HandlerReqCtx,
47 | ) => Promise | HandlerOutput
48 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/getFeedGenerators.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyFeedDefs from './defs'
11 |
12 | export interface QueryParams {
13 | feeds: string[]
14 | }
15 |
16 | export type InputSchema = undefined
17 |
18 | export interface OutputSchema {
19 | feeds: AppBskyFeedDefs.GeneratorView[]
20 | [k: string]: unknown
21 | }
22 |
23 | export type HandlerInput = undefined
24 |
25 | export interface HandlerSuccess {
26 | encoding: 'application/json'
27 | body: OutputSchema
28 | headers?: { [key: string]: string }
29 | }
30 |
31 | export interface HandlerError {
32 | status: number
33 | message?: string
34 | }
35 |
36 | export type HandlerOutput = HandlerError | HandlerSuccess
37 | export type HandlerReqCtx = {
38 | auth: HA
39 | params: QueryParams
40 | input: HandlerInput
41 | req: express.Request
42 | res: express.Response
43 | }
44 | export type Handler = (
45 | ctx: HandlerReqCtx,
46 | ) => Promise | HandlerOutput
47 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/actor/getProfiles.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyActorDefs from './defs'
11 |
12 | export interface QueryParams {
13 | actors: string[]
14 | }
15 |
16 | export type InputSchema = undefined
17 |
18 | export interface OutputSchema {
19 | profiles: AppBskyActorDefs.ProfileViewDetailed[]
20 | [k: string]: unknown
21 | }
22 |
23 | export type HandlerInput = undefined
24 |
25 | export interface HandlerSuccess {
26 | encoding: 'application/json'
27 | body: OutputSchema
28 | headers?: { [key: string]: string }
29 | }
30 |
31 | export interface HandlerError {
32 | status: number
33 | message?: string
34 | }
35 |
36 | export type HandlerOutput = HandlerError | HandlerSuccess
37 | export type HandlerReqCtx = {
38 | auth: HA
39 | params: QueryParams
40 | input: HandlerInput
41 | req: express.Request
42 | res: express.Response
43 | }
44 | export type Handler = (
45 | ctx: HandlerReqCtx,
46 | ) => Promise | HandlerOutput
47 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/refreshSession.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export type InputSchema = undefined
14 |
15 | export interface OutputSchema {
16 | accessJwt: string
17 | refreshJwt: string
18 | handle: string
19 | did: string
20 | [k: string]: unknown
21 | }
22 |
23 | export type HandlerInput = undefined
24 |
25 | export interface HandlerSuccess {
26 | encoding: 'application/json'
27 | body: OutputSchema
28 | headers?: { [key: string]: string }
29 | }
30 |
31 | export interface HandlerError {
32 | status: number
33 | message?: string
34 | error?: 'AccountTakedown'
35 | }
36 |
37 | export type HandlerOutput = HandlerError | HandlerSuccess
38 | export type HandlerReqCtx = {
39 | auth: HA
40 | params: QueryParams
41 | input: HandlerInput
42 | req: express.Request
43 | res: express.Response
44 | }
45 | export type Handler = (
46 | ctx: HandlerReqCtx,
47 | ) => Promise | HandlerOutput
48 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/sync/getLatestCommit.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {
12 | /** The DID of the repo. */
13 | did: string
14 | }
15 |
16 | export type InputSchema = undefined
17 |
18 | export interface OutputSchema {
19 | cid: string
20 | rev: string
21 | [k: string]: unknown
22 | }
23 |
24 | export type HandlerInput = undefined
25 |
26 | export interface HandlerSuccess {
27 | encoding: 'application/json'
28 | body: OutputSchema
29 | headers?: { [key: string]: string }
30 | }
31 |
32 | export interface HandlerError {
33 | status: number
34 | message?: string
35 | error?: 'RepoNotFound'
36 | }
37 |
38 | export type HandlerOutput = HandlerError | HandlerSuccess
39 | export type HandlerReqCtx = {
40 | auth: HA
41 | params: QueryParams
42 | input: HandlerInput
43 | req: express.Request
44 | res: express.Response
45 | }
46 | export type Handler = (
47 | ctx: HandlerReqCtx,
48 | ) => Promise | HandlerOutput
49 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyActorDefs from '../actor/defs'
11 |
12 | export interface QueryParams {
13 | actor: string
14 | }
15 |
16 | export type InputSchema = undefined
17 |
18 | export interface OutputSchema {
19 | suggestions: AppBskyActorDefs.ProfileView[]
20 | [k: string]: unknown
21 | }
22 |
23 | export type HandlerInput = undefined
24 |
25 | export interface HandlerSuccess {
26 | encoding: 'application/json'
27 | body: OutputSchema
28 | headers?: { [key: string]: string }
29 | }
30 |
31 | export interface HandlerError {
32 | status: number
33 | message?: string
34 | }
35 |
36 | export type HandlerOutput = HandlerError | HandlerSuccess
37 | export type HandlerReqCtx = {
38 | auth: HA
39 | params: QueryParams
40 | input: HandlerInput
41 | req: express.Request
42 | res: express.Response
43 | }
44 | export type Handler = (
45 | ctx: HandlerReqCtx,
46 | ) => Promise | HandlerOutput
47 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/sync/getRecord.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import stream from 'stream'
6 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
7 | import { lexicons } from '../../../../lexicons'
8 | import { isObj, hasProp } from '../../../../util'
9 | import { CID } from 'multiformats/cid'
10 | import { HandlerAuth } from '@atproto/xrpc-server'
11 |
12 | export interface QueryParams {
13 | /** The DID of the repo. */
14 | did: string
15 | collection: string
16 | rkey: string
17 | /** An optional past commit CID. */
18 | commit?: string
19 | }
20 |
21 | export type InputSchema = undefined
22 | export type HandlerInput = undefined
23 |
24 | export interface HandlerSuccess {
25 | encoding: 'application/vnd.ipld.car'
26 | body: Uint8Array | stream.Readable
27 | headers?: { [key: string]: string }
28 | }
29 |
30 | export interface HandlerError {
31 | status: number
32 | message?: string
33 | }
34 |
35 | export type HandlerOutput = HandlerError | HandlerSuccess
36 | export type HandlerReqCtx = {
37 | auth: HA
38 | params: QueryParams
39 | input: HandlerInput
40 | req: express.Request
41 | res: express.Response
42 | }
43 | export type Handler = (
44 | ctx: HandlerReqCtx,
45 | ) => Promise | HandlerOutput
46 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/defs.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
5 | import { lexicons } from '../../../../lexicons'
6 | import { isObj, hasProp } from '../../../../util'
7 | import { CID } from 'multiformats/cid'
8 |
9 | export interface InviteCode {
10 | code: string
11 | available: number
12 | disabled: boolean
13 | forAccount: string
14 | createdBy: string
15 | createdAt: string
16 | uses: InviteCodeUse[]
17 | [k: string]: unknown
18 | }
19 |
20 | export function isInviteCode(v: unknown): v is InviteCode {
21 | return (
22 | isObj(v) &&
23 | hasProp(v, '$type') &&
24 | v.$type === 'com.atproto.server.defs#inviteCode'
25 | )
26 | }
27 |
28 | export function validateInviteCode(v: unknown): ValidationResult {
29 | return lexicons.validate('com.atproto.server.defs#inviteCode', v)
30 | }
31 |
32 | export interface InviteCodeUse {
33 | usedBy: string
34 | usedAt: string
35 | [k: string]: unknown
36 | }
37 |
38 | export function isInviteCodeUse(v: unknown): v is InviteCodeUse {
39 | return (
40 | isObj(v) &&
41 | hasProp(v, '$type') &&
42 | v.$type === 'com.atproto.server.defs#inviteCodeUse'
43 | )
44 | }
45 |
46 | export function validateInviteCodeUse(v: unknown): ValidationResult {
47 | return lexicons.validate('com.atproto.server.defs#inviteCodeUse', v)
48 | }
49 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/getListMutes.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyGraphDefs from './defs'
11 |
12 | export interface QueryParams {
13 | limit: number
14 | cursor?: string
15 | }
16 |
17 | export type InputSchema = undefined
18 |
19 | export interface OutputSchema {
20 | cursor?: string
21 | lists: AppBskyGraphDefs.ListView[]
22 | [k: string]: unknown
23 | }
24 |
25 | export type HandlerInput = undefined
26 |
27 | export interface HandlerSuccess {
28 | encoding: 'application/json'
29 | body: OutputSchema
30 | headers?: { [key: string]: string }
31 | }
32 |
33 | export interface HandlerError {
34 | status: number
35 | message?: string
36 | }
37 |
38 | export type HandlerOutput = HandlerError | HandlerSuccess
39 | export type HandlerReqCtx = {
40 | auth: HA
41 | params: QueryParams
42 | input: HandlerInput
43 | req: express.Request
44 | res: express.Response
45 | }
46 | export type Handler = (
47 | ctx: HandlerReqCtx,
48 | ) => Promise | HandlerOutput
49 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | import dotenv from 'dotenv'
2 | import FeedGenerator from './server'
3 |
4 | const run = async () => {
5 | dotenv.config()
6 | const hostname = maybeStr(process.env.FEEDGEN_HOSTNAME) ?? 'example.com'
7 | const serviceDid =
8 | maybeStr(process.env.FEEDGEN_SERVICE_DID) ?? `did:web:${hostname}`
9 | const server = FeedGenerator.create({
10 | port: maybeInt(process.env.FEEDGEN_PORT) ?? 3000,
11 | listenhost: maybeStr(process.env.FEEDGEN_LISTENHOST) ?? 'localhost',
12 | sqliteLocation: maybeStr(process.env.FEEDGEN_SQLITE_LOCATION) ?? ':memory:',
13 | subscriptionEndpoint:
14 | maybeStr(process.env.FEEDGEN_SUBSCRIPTION_ENDPOINT) ??
15 | 'wss://bsky.social',
16 | publisherDid:
17 | maybeStr(process.env.FEEDGEN_PUBLISHER_DID) ?? 'did:example:alice',
18 | subscriptionReconnectDelay:
19 | maybeInt(process.env.FEEDGEN_SUBSCRIPTION_RECONNECT_DELAY) ?? 3000,
20 | hostname,
21 | serviceDid,
22 | })
23 | await server.start()
24 | console.log(
25 | `🤖 running feed generator at http://${server.cfg.listenhost}:${server.cfg.port}`,
26 | )
27 | }
28 |
29 | const maybeStr = (val?: string) => {
30 | if (!val) return undefined
31 | return val
32 | }
33 |
34 | const maybeInt = (val?: string) => {
35 | if (!val) return undefined
36 | const int = parseInt(val, 10)
37 | if (isNaN(int)) return undefined
38 | return int
39 | }
40 |
41 | run()
42 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/getFeedGenerator.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyFeedDefs from './defs'
11 |
12 | export interface QueryParams {
13 | feed: string
14 | }
15 |
16 | export type InputSchema = undefined
17 |
18 | export interface OutputSchema {
19 | view: AppBskyFeedDefs.GeneratorView
20 | isOnline: boolean
21 | isValid: boolean
22 | [k: string]: unknown
23 | }
24 |
25 | export type HandlerInput = undefined
26 |
27 | export interface HandlerSuccess {
28 | encoding: 'application/json'
29 | body: OutputSchema
30 | headers?: { [key: string]: string }
31 | }
32 |
33 | export interface HandlerError {
34 | status: number
35 | message?: string
36 | }
37 |
38 | export type HandlerOutput = HandlerError | HandlerSuccess
39 | export type HandlerReqCtx = {
40 | auth: HA
41 | params: QueryParams
42 | input: HandlerInput
43 | req: express.Request
44 | res: express.Response
45 | }
46 | export type Handler = (
47 | ctx: HandlerReqCtx,
48 | ) => Promise | HandlerOutput
49 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/getListBlocks.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyGraphDefs from './defs'
11 |
12 | export interface QueryParams {
13 | limit: number
14 | cursor?: string
15 | }
16 |
17 | export type InputSchema = undefined
18 |
19 | export interface OutputSchema {
20 | cursor?: string
21 | lists: AppBskyGraphDefs.ListView[]
22 | [k: string]: unknown
23 | }
24 |
25 | export type HandlerInput = undefined
26 |
27 | export interface HandlerSuccess {
28 | encoding: 'application/json'
29 | body: OutputSchema
30 | headers?: { [key: string]: string }
31 | }
32 |
33 | export interface HandlerError {
34 | status: number
35 | message?: string
36 | }
37 |
38 | export type HandlerOutput = HandlerError | HandlerSuccess
39 | export type HandlerReqCtx = {
40 | auth: HA
41 | params: QueryParams
42 | input: HandlerInput
43 | req: express.Request
44 | res: express.Response
45 | }
46 | export type Handler = (
47 | ctx: HandlerReqCtx,
48 | ) => Promise | HandlerOutput
49 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/actor/getSuggestions.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyActorDefs from './defs'
11 |
12 | export interface QueryParams {
13 | limit: number
14 | cursor?: string
15 | }
16 |
17 | export type InputSchema = undefined
18 |
19 | export interface OutputSchema {
20 | cursor?: string
21 | actors: AppBskyActorDefs.ProfileView[]
22 | [k: string]: unknown
23 | }
24 |
25 | export type HandlerInput = undefined
26 |
27 | export interface HandlerSuccess {
28 | encoding: 'application/json'
29 | body: OutputSchema
30 | headers?: { [key: string]: string }
31 | }
32 |
33 | export interface HandlerError {
34 | status: number
35 | message?: string
36 | }
37 |
38 | export type HandlerOutput = HandlerError | HandlerSuccess
39 | export type HandlerReqCtx = {
40 | auth: HA
41 | params: QueryParams
42 | input: HandlerInput
43 | req: express.Request
44 | res: express.Response
45 | }
46 | export type Handler = (
47 | ctx: HandlerReqCtx,
48 | ) => Promise | HandlerOutput
49 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/getSuggestedFeeds.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyFeedDefs from './defs'
11 |
12 | export interface QueryParams {
13 | limit: number
14 | cursor?: string
15 | }
16 |
17 | export type InputSchema = undefined
18 |
19 | export interface OutputSchema {
20 | cursor?: string
21 | feeds: AppBskyFeedDefs.GeneratorView[]
22 | [k: string]: unknown
23 | }
24 |
25 | export type HandlerInput = undefined
26 |
27 | export interface HandlerSuccess {
28 | encoding: 'application/json'
29 | body: OutputSchema
30 | headers?: { [key: string]: string }
31 | }
32 |
33 | export interface HandlerError {
34 | status: number
35 | message?: string
36 | }
37 |
38 | export type HandlerOutput = HandlerError | HandlerSuccess
39 | export type HandlerReqCtx = {
40 | auth: HA
41 | params: QueryParams
42 | input: HandlerInput
43 | req: express.Request
44 | res: express.Response
45 | }
46 | export type Handler = (
47 | ctx: HandlerReqCtx,
48 | ) => Promise | HandlerOutput
49 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/getBlocks.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyActorDefs from '../actor/defs'
11 |
12 | export interface QueryParams {
13 | limit: number
14 | cursor?: string
15 | }
16 |
17 | export type InputSchema = undefined
18 |
19 | export interface OutputSchema {
20 | cursor?: string
21 | blocks: AppBskyActorDefs.ProfileView[]
22 | [k: string]: unknown
23 | }
24 |
25 | export type HandlerInput = undefined
26 |
27 | export interface HandlerSuccess {
28 | encoding: 'application/json'
29 | body: OutputSchema
30 | headers?: { [key: string]: string }
31 | }
32 |
33 | export interface HandlerError {
34 | status: number
35 | message?: string
36 | }
37 |
38 | export type HandlerOutput = HandlerError | HandlerSuccess
39 | export type HandlerReqCtx = {
40 | auth: HA
41 | params: QueryParams
42 | input: HandlerInput
43 | req: express.Request
44 | res: express.Response
45 | }
46 | export type Handler = (
47 | ctx: HandlerReqCtx,
48 | ) => Promise | HandlerOutput
49 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/getMutes.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyActorDefs from '../actor/defs'
11 |
12 | export interface QueryParams {
13 | limit: number
14 | cursor?: string
15 | }
16 |
17 | export type InputSchema = undefined
18 |
19 | export interface OutputSchema {
20 | cursor?: string
21 | mutes: AppBskyActorDefs.ProfileView[]
22 | [k: string]: unknown
23 | }
24 |
25 | export type HandlerInput = undefined
26 |
27 | export interface HandlerSuccess {
28 | encoding: 'application/json'
29 | body: OutputSchema
30 | headers?: { [key: string]: string }
31 | }
32 |
33 | export interface HandlerError {
34 | status: number
35 | message?: string
36 | }
37 |
38 | export type HandlerOutput = HandlerError | HandlerSuccess
39 | export type HandlerReqCtx = {
40 | auth: HA
41 | params: QueryParams
42 | input: HandlerInput
43 | req: express.Request
44 | res: express.Response
45 | }
46 | export type Handler = (
47 | ctx: HandlerReqCtx,
48 | ) => Promise | HandlerOutput
49 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/server/createInviteCode.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | useCount: number
15 | forAccount?: string
16 | [k: string]: unknown
17 | }
18 |
19 | export interface OutputSchema {
20 | code: string
21 | [k: string]: unknown
22 | }
23 |
24 | export interface HandlerInput {
25 | encoding: 'application/json'
26 | body: InputSchema
27 | }
28 |
29 | export interface HandlerSuccess {
30 | encoding: 'application/json'
31 | body: OutputSchema
32 | headers?: { [key: string]: string }
33 | }
34 |
35 | export interface HandlerError {
36 | status: number
37 | message?: string
38 | }
39 |
40 | export type HandlerOutput = HandlerError | HandlerSuccess
41 | export type HandlerReqCtx = {
42 | auth: HA
43 | params: QueryParams
44 | input: HandlerInput
45 | req: express.Request
46 | res: express.Response
47 | }
48 | export type Handler = (
49 | ctx: HandlerReqCtx,
50 | ) => Promise | HandlerOutput
51 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/graph/getLists.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyGraphDefs from './defs'
11 |
12 | export interface QueryParams {
13 | actor: string
14 | limit: number
15 | cursor?: string
16 | }
17 |
18 | export type InputSchema = undefined
19 |
20 | export interface OutputSchema {
21 | cursor?: string
22 | lists: AppBskyGraphDefs.ListView[]
23 | [k: string]: unknown
24 | }
25 |
26 | export type HandlerInput = undefined
27 |
28 | export interface HandlerSuccess {
29 | encoding: 'application/json'
30 | body: OutputSchema
31 | headers?: { [key: string]: string }
32 | }
33 |
34 | export interface HandlerError {
35 | status: number
36 | message?: string
37 | }
38 |
39 | export type HandlerOutput = HandlerError | HandlerSuccess
40 | export type HandlerReqCtx = {
41 | auth: HA
42 | params: QueryParams
43 | input: HandlerInput
44 | req: express.Request
45 | res: express.Response
46 | }
47 | export type Handler = (
48 | ctx: HandlerReqCtx,
49 | ) => Promise | HandlerOutput
50 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/getActorFeeds.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyFeedDefs from './defs'
11 |
12 | export interface QueryParams {
13 | actor: string
14 | limit: number
15 | cursor?: string
16 | }
17 |
18 | export type InputSchema = undefined
19 |
20 | export interface OutputSchema {
21 | cursor?: string
22 | feeds: AppBskyFeedDefs.GeneratorView[]
23 | [k: string]: unknown
24 | }
25 |
26 | export type HandlerInput = undefined
27 |
28 | export interface HandlerSuccess {
29 | encoding: 'application/json'
30 | body: OutputSchema
31 | headers?: { [key: string]: string }
32 | }
33 |
34 | export interface HandlerError {
35 | status: number
36 | message?: string
37 | }
38 |
39 | export type HandlerOutput = HandlerError | HandlerSuccess
40 | export type HandlerReqCtx = {
41 | auth: HA
42 | params: QueryParams
43 | input: HandlerInput
44 | req: express.Request
45 | res: express.Response
46 | }
47 | export type Handler = (
48 | ctx: HandlerReqCtx,
49 | ) => Promise | HandlerOutput
50 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/getTimeline.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyFeedDefs from './defs'
11 |
12 | export interface QueryParams {
13 | algorithm?: string
14 | limit: number
15 | cursor?: string
16 | }
17 |
18 | export type InputSchema = undefined
19 |
20 | export interface OutputSchema {
21 | cursor?: string
22 | feed: AppBskyFeedDefs.FeedViewPost[]
23 | [k: string]: unknown
24 | }
25 |
26 | export type HandlerInput = undefined
27 |
28 | export interface HandlerSuccess {
29 | encoding: 'application/json'
30 | body: OutputSchema
31 | headers?: { [key: string]: string }
32 | }
33 |
34 | export interface HandlerError {
35 | status: number
36 | message?: string
37 | }
38 |
39 | export type HandlerOutput = HandlerError | HandlerSuccess
40 | export type HandlerReqCtx = {
41 | auth: HA
42 | params: QueryParams
43 | input: HandlerInput
44 | req: express.Request
45 | res: express.Response
46 | }
47 | export type Handler = (
48 | ctx: HandlerReqCtx,
49 | ) => Promise | HandlerOutput
50 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/sendEmail.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {}
12 |
13 | export interface InputSchema {
14 | recipientDid: string
15 | content: string
16 | subject?: string
17 | [k: string]: unknown
18 | }
19 |
20 | export interface OutputSchema {
21 | sent: boolean
22 | [k: string]: unknown
23 | }
24 |
25 | export interface HandlerInput {
26 | encoding: 'application/json'
27 | body: InputSchema
28 | }
29 |
30 | export interface HandlerSuccess {
31 | encoding: 'application/json'
32 | body: OutputSchema
33 | headers?: { [key: string]: string }
34 | }
35 |
36 | export interface HandlerError {
37 | status: number
38 | message?: string
39 | }
40 |
41 | export type HandlerOutput = HandlerError | HandlerSuccess
42 | export type HandlerReqCtx = {
43 | auth: HA
44 | params: QueryParams
45 | input: HandlerInput
46 | req: express.Request
47 | res: express.Response
48 | }
49 | export type Handler = (
50 | ctx: HandlerReqCtx,
51 | ) => Promise | HandlerOutput
52 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/repo/describeRepo.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 |
11 | export interface QueryParams {
12 | /** The handle or DID of the repo. */
13 | repo: string
14 | }
15 |
16 | export type InputSchema = undefined
17 |
18 | export interface OutputSchema {
19 | handle: string
20 | did: string
21 | didDoc: {}
22 | collections: string[]
23 | handleIsCorrect: boolean
24 | [k: string]: unknown
25 | }
26 |
27 | export type HandlerInput = undefined
28 |
29 | export interface HandlerSuccess {
30 | encoding: 'application/json'
31 | body: OutputSchema
32 | headers?: { [key: string]: string }
33 | }
34 |
35 | export interface HandlerError {
36 | status: number
37 | message?: string
38 | }
39 |
40 | export type HandlerOutput = HandlerError | HandlerSuccess
41 | export type HandlerReqCtx = {
42 | auth: HA
43 | params: QueryParams
44 | input: HandlerInput
45 | req: express.Request
46 | res: express.Response
47 | }
48 | export type Handler = (
49 | ctx: HandlerReqCtx,
50 | ) => Promise | HandlerOutput
51 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/unspecced/getPopular.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyFeedDefs from '../feed/defs'
11 |
12 | export interface QueryParams {
13 | includeNsfw: boolean
14 | limit: number
15 | cursor?: string
16 | }
17 |
18 | export type InputSchema = undefined
19 |
20 | export interface OutputSchema {
21 | cursor?: string
22 | feed: AppBskyFeedDefs.FeedViewPost[]
23 | [k: string]: unknown
24 | }
25 |
26 | export type HandlerInput = undefined
27 |
28 | export interface HandlerSuccess {
29 | encoding: 'application/json'
30 | body: OutputSchema
31 | headers?: { [key: string]: string }
32 | }
33 |
34 | export interface HandlerError {
35 | status: number
36 | message?: string
37 | }
38 |
39 | export type HandlerOutput = HandlerError | HandlerSuccess
40 | export type HandlerReqCtx = {
41 | auth: HA
42 | params: QueryParams
43 | input: HandlerInput
44 | req: express.Request
45 | res: express.Response
46 | }
47 | export type Handler = (
48 | ctx: HandlerReqCtx,
49 | ) => Promise | HandlerOutput
50 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/getFeed.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyFeedDefs from './defs'
11 |
12 | export interface QueryParams {
13 | feed: string
14 | limit: number
15 | cursor?: string
16 | }
17 |
18 | export type InputSchema = undefined
19 |
20 | export interface OutputSchema {
21 | cursor?: string
22 | feed: AppBskyFeedDefs.FeedViewPost[]
23 | [k: string]: unknown
24 | }
25 |
26 | export type HandlerInput = undefined
27 |
28 | export interface HandlerSuccess {
29 | encoding: 'application/json'
30 | body: OutputSchema
31 | headers?: { [key: string]: string }
32 | }
33 |
34 | export interface HandlerError {
35 | status: number
36 | message?: string
37 | error?: 'UnknownFeed'
38 | }
39 |
40 | export type HandlerOutput = HandlerError | HandlerSuccess
41 | export type HandlerReqCtx = {
42 | auth: HA
43 | params: QueryParams
44 | input: HandlerInput
45 | req: express.Request
46 | res: express.Response
47 | }
48 | export type Handler = (
49 | ctx: HandlerReqCtx,
50 | ) => Promise | HandlerOutput
51 |
--------------------------------------------------------------------------------
/src/lexicon/types/com/atproto/admin/getModerationActions.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as ComAtprotoAdminDefs from './defs'
11 |
12 | export interface QueryParams {
13 | subject?: string
14 | limit: number
15 | cursor?: string
16 | }
17 |
18 | export type InputSchema = undefined
19 |
20 | export interface OutputSchema {
21 | cursor?: string
22 | actions: ComAtprotoAdminDefs.ActionView[]
23 | [k: string]: unknown
24 | }
25 |
26 | export type HandlerInput = undefined
27 |
28 | export interface HandlerSuccess {
29 | encoding: 'application/json'
30 | body: OutputSchema
31 | headers?: { [key: string]: string }
32 | }
33 |
34 | export interface HandlerError {
35 | status: number
36 | message?: string
37 | }
38 |
39 | export type HandlerOutput = HandlerError | HandlerSuccess
40 | export type HandlerReqCtx = {
41 | auth: HA
42 | params: QueryParams
43 | input: HandlerInput
44 | req: express.Request
45 | res: express.Response
46 | }
47 | export type Handler = (
48 | ctx: HandlerReqCtx,
49 | ) => Promise | HandlerOutput
50 |
--------------------------------------------------------------------------------
/src/lexicon/types/app/bsky/feed/getListFeed.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * GENERATED CODE - DO NOT MODIFY
3 | */
4 | import express from 'express'
5 | import { ValidationResult, BlobRef } from '@atproto/lexicon'
6 | import { lexicons } from '../../../../lexicons'
7 | import { isObj, hasProp } from '../../../../util'
8 | import { CID } from 'multiformats/cid'
9 | import { HandlerAuth } from '@atproto/xrpc-server'
10 | import * as AppBskyFeedDefs from './defs'
11 |
12 | export interface QueryParams {
13 | list: string
14 | limit: number
15 | cursor?: string
16 | }
17 |
18 | export type InputSchema = undefined
19 |
20 | export interface OutputSchema {
21 | cursor?: string
22 | feed: AppBskyFeedDefs.FeedViewPost[]
23 | [k: string]: unknown
24 | }
25 |
26 | export type HandlerInput = undefined
27 |
28 | export interface HandlerSuccess {
29 | encoding: 'application/json'
30 | body: OutputSchema
31 | headers?: { [key: string]: string }
32 | }
33 |
34 | export interface HandlerError {
35 | status: number
36 | message?: string
37 | error?: 'UnknownList'
38 | }
39 |
40 | export type HandlerOutput = HandlerError | HandlerSuccess
41 | export type HandlerReqCtx = {
42 | auth: HA
43 | params: QueryParams
44 | input: HandlerInput
45 | req: express.Request
46 | res: express.Response
47 | }
48 | export type Handler = (
49 | ctx: HandlerReqCtx,
50 | ) => Promise