an attempt to make a lightweight, easily self-hostable, scoped bluesky appview
at main 10 kB view raw
1/** 2 * GENERATED CODE - DO NOT MODIFY 3 */ 4import { 5 type Auth, 6 type Options as XrpcOptions, 7 Server as XrpcServer, 8 type StreamConfigOrHandler, 9 type MethodConfigOrHandler, 10 createServer as createXrpcServer, 11} from 'npm:@atproto/xrpc-server' 12import { schemas } from './lexicons.ts' 13import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile.ts' 14import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles.ts' 15import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds.ts' 16import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator.ts' 17import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators.ts' 18import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts.ts' 19import * as PartyWheyAppBskyFeedGetActorLikesPartial from './types/party/whey/app/bsky/feed/getActorLikesPartial.ts' 20import * as PartyWheyAppBskyFeedGetAuthorFeedPartial from './types/party/whey/app/bsky/feed/getAuthorFeedPartial.ts' 21import * as PartyWheyAppBskyFeedGetLikesPartial from './types/party/whey/app/bsky/feed/getLikesPartial.ts' 22import * as PartyWheyAppBskyFeedGetListFeedPartial from './types/party/whey/app/bsky/feed/getListFeedPartial.ts' 23import * as PartyWheyAppBskyFeedGetPostThreadPartial from './types/party/whey/app/bsky/feed/getPostThreadPartial.ts' 24import * as PartyWheyAppBskyFeedGetQuotesPartial from './types/party/whey/app/bsky/feed/getQuotesPartial.ts' 25import * as PartyWheyAppBskyFeedGetRepostedByPartial from './types/party/whey/app/bsky/feed/getRepostedByPartial.ts' 26 27export const APP_BSKY_FEED = { 28 DefsRequestLess: 'app.bsky.feed.defs#requestLess', 29 DefsRequestMore: 'app.bsky.feed.defs#requestMore', 30 DefsClickthroughItem: 'app.bsky.feed.defs#clickthroughItem', 31 DefsClickthroughAuthor: 'app.bsky.feed.defs#clickthroughAuthor', 32 DefsClickthroughReposter: 'app.bsky.feed.defs#clickthroughReposter', 33 DefsClickthroughEmbed: 'app.bsky.feed.defs#clickthroughEmbed', 34 DefsContentModeUnspecified: 'app.bsky.feed.defs#contentModeUnspecified', 35 DefsContentModeVideo: 'app.bsky.feed.defs#contentModeVideo', 36 DefsInteractionSeen: 'app.bsky.feed.defs#interactionSeen', 37 DefsInteractionLike: 'app.bsky.feed.defs#interactionLike', 38 DefsInteractionRepost: 'app.bsky.feed.defs#interactionRepost', 39 DefsInteractionReply: 'app.bsky.feed.defs#interactionReply', 40 DefsInteractionQuote: 'app.bsky.feed.defs#interactionQuote', 41 DefsInteractionShare: 'app.bsky.feed.defs#interactionShare', 42} 43export const APP_BSKY_GRAPH = { 44 DefsModlist: 'app.bsky.graph.defs#modlist', 45 DefsCuratelist: 'app.bsky.graph.defs#curatelist', 46 DefsReferencelist: 'app.bsky.graph.defs#referencelist', 47} 48 49export function createServer(options?: XrpcOptions): Server { 50 return new Server(options) 51} 52 53export class Server { 54 xrpc: XrpcServer 55 app: AppNS 56 com: ComNS 57 party: PartyNS 58 59 constructor(options?: XrpcOptions) { 60 this.xrpc = createXrpcServer(schemas, options) 61 this.app = new AppNS(this) 62 this.com = new ComNS(this) 63 this.party = new PartyNS(this) 64 } 65} 66 67export class AppNS { 68 _server: Server 69 bsky: AppBskyNS 70 71 constructor(server: Server) { 72 this._server = server 73 this.bsky = new AppBskyNS(server) 74 } 75} 76 77export class AppBskyNS { 78 _server: Server 79 actor: AppBskyActorNS 80 embed: AppBskyEmbedNS 81 feed: AppBskyFeedNS 82 richtext: AppBskyRichtextNS 83 84 constructor(server: Server) { 85 this._server = server 86 this.actor = new AppBskyActorNS(server) 87 this.embed = new AppBskyEmbedNS(server) 88 this.feed = new AppBskyFeedNS(server) 89 this.richtext = new AppBskyRichtextNS(server) 90 } 91} 92 93export class AppBskyActorNS { 94 _server: Server 95 96 constructor(server: Server) { 97 this._server = server 98 } 99 100 getProfile<A extends Auth = void>( 101 cfg: MethodConfigOrHandler< 102 A, 103 AppBskyActorGetProfile.QueryParams, 104 AppBskyActorGetProfile.HandlerInput, 105 AppBskyActorGetProfile.HandlerOutput 106 >, 107 ) { 108 const nsid = 'app.bsky.actor.getProfile' // @ts-ignore 109 return this._server.xrpc.method(nsid, cfg) 110 } 111 112 getProfiles<A extends Auth = void>( 113 cfg: MethodConfigOrHandler< 114 A, 115 AppBskyActorGetProfiles.QueryParams, 116 AppBskyActorGetProfiles.HandlerInput, 117 AppBskyActorGetProfiles.HandlerOutput 118 >, 119 ) { 120 const nsid = 'app.bsky.actor.getProfiles' // @ts-ignore 121 return this._server.xrpc.method(nsid, cfg) 122 } 123} 124 125export class AppBskyEmbedNS { 126 _server: Server 127 128 constructor(server: Server) { 129 this._server = server 130 } 131} 132 133export class AppBskyFeedNS { 134 _server: Server 135 136 constructor(server: Server) { 137 this._server = server 138 } 139 140 getActorFeeds<A extends Auth = void>( 141 cfg: MethodConfigOrHandler< 142 A, 143 AppBskyFeedGetActorFeeds.QueryParams, 144 AppBskyFeedGetActorFeeds.HandlerInput, 145 AppBskyFeedGetActorFeeds.HandlerOutput 146 >, 147 ) { 148 const nsid = 'app.bsky.feed.getActorFeeds' // @ts-ignore 149 return this._server.xrpc.method(nsid, cfg) 150 } 151 152 getFeedGenerator<A extends Auth = void>( 153 cfg: MethodConfigOrHandler< 154 A, 155 AppBskyFeedGetFeedGenerator.QueryParams, 156 AppBskyFeedGetFeedGenerator.HandlerInput, 157 AppBskyFeedGetFeedGenerator.HandlerOutput 158 >, 159 ) { 160 const nsid = 'app.bsky.feed.getFeedGenerator' // @ts-ignore 161 return this._server.xrpc.method(nsid, cfg) 162 } 163 164 getFeedGenerators<A extends Auth = void>( 165 cfg: MethodConfigOrHandler< 166 A, 167 AppBskyFeedGetFeedGenerators.QueryParams, 168 AppBskyFeedGetFeedGenerators.HandlerInput, 169 AppBskyFeedGetFeedGenerators.HandlerOutput 170 >, 171 ) { 172 const nsid = 'app.bsky.feed.getFeedGenerators' // @ts-ignore 173 return this._server.xrpc.method(nsid, cfg) 174 } 175 176 getPosts<A extends Auth = void>( 177 cfg: MethodConfigOrHandler< 178 A, 179 AppBskyFeedGetPosts.QueryParams, 180 AppBskyFeedGetPosts.HandlerInput, 181 AppBskyFeedGetPosts.HandlerOutput 182 >, 183 ) { 184 const nsid = 'app.bsky.feed.getPosts' // @ts-ignore 185 return this._server.xrpc.method(nsid, cfg) 186 } 187} 188 189export class AppBskyRichtextNS { 190 _server: Server 191 192 constructor(server: Server) { 193 this._server = server 194 } 195} 196 197export class ComNS { 198 _server: Server 199 atproto: ComAtprotoNS 200 201 constructor(server: Server) { 202 this._server = server 203 this.atproto = new ComAtprotoNS(server) 204 } 205} 206 207export class ComAtprotoNS { 208 _server: Server 209 repo: ComAtprotoRepoNS 210 211 constructor(server: Server) { 212 this._server = server 213 this.repo = new ComAtprotoRepoNS(server) 214 } 215} 216 217export class ComAtprotoRepoNS { 218 _server: Server 219 220 constructor(server: Server) { 221 this._server = server 222 } 223} 224 225export class PartyNS { 226 _server: Server 227 whey: PartyWheyNS 228 229 constructor(server: Server) { 230 this._server = server 231 this.whey = new PartyWheyNS(server) 232 } 233} 234 235export class PartyWheyNS { 236 _server: Server 237 app: PartyWheyAppNS 238 239 constructor(server: Server) { 240 this._server = server 241 this.app = new PartyWheyAppNS(server) 242 } 243} 244 245export class PartyWheyAppNS { 246 _server: Server 247 bsky: PartyWheyAppBskyNS 248 249 constructor(server: Server) { 250 this._server = server 251 this.bsky = new PartyWheyAppBskyNS(server) 252 } 253} 254 255export class PartyWheyAppBskyNS { 256 _server: Server 257 feed: PartyWheyAppBskyFeedNS 258 259 constructor(server: Server) { 260 this._server = server 261 this.feed = new PartyWheyAppBskyFeedNS(server) 262 } 263} 264 265export class PartyWheyAppBskyFeedNS { 266 _server: Server 267 268 constructor(server: Server) { 269 this._server = server 270 } 271 272 getActorLikesPartial<A extends Auth = void>( 273 cfg: MethodConfigOrHandler< 274 A, 275 PartyWheyAppBskyFeedGetActorLikesPartial.QueryParams, 276 PartyWheyAppBskyFeedGetActorLikesPartial.HandlerInput, 277 PartyWheyAppBskyFeedGetActorLikesPartial.HandlerOutput 278 >, 279 ) { 280 const nsid = 'party.whey.app.bsky.feed.getActorLikesPartial' // @ts-ignore 281 return this._server.xrpc.method(nsid, cfg) 282 } 283 284 getAuthorFeedPartial<A extends Auth = void>( 285 cfg: MethodConfigOrHandler< 286 A, 287 PartyWheyAppBskyFeedGetAuthorFeedPartial.QueryParams, 288 PartyWheyAppBskyFeedGetAuthorFeedPartial.HandlerInput, 289 PartyWheyAppBskyFeedGetAuthorFeedPartial.HandlerOutput 290 >, 291 ) { 292 const nsid = 'party.whey.app.bsky.feed.getAuthorFeedPartial' // @ts-ignore 293 return this._server.xrpc.method(nsid, cfg) 294 } 295 296 getLikesPartial<A extends Auth = void>( 297 cfg: MethodConfigOrHandler< 298 A, 299 PartyWheyAppBskyFeedGetLikesPartial.QueryParams, 300 PartyWheyAppBskyFeedGetLikesPartial.HandlerInput, 301 PartyWheyAppBskyFeedGetLikesPartial.HandlerOutput 302 >, 303 ) { 304 const nsid = 'party.whey.app.bsky.feed.getLikesPartial' // @ts-ignore 305 return this._server.xrpc.method(nsid, cfg) 306 } 307 308 getListFeedPartial<A extends Auth = void>( 309 cfg: MethodConfigOrHandler< 310 A, 311 PartyWheyAppBskyFeedGetListFeedPartial.QueryParams, 312 PartyWheyAppBskyFeedGetListFeedPartial.HandlerInput, 313 PartyWheyAppBskyFeedGetListFeedPartial.HandlerOutput 314 >, 315 ) { 316 const nsid = 'party.whey.app.bsky.feed.getListFeedPartial' // @ts-ignore 317 return this._server.xrpc.method(nsid, cfg) 318 } 319 320 getPostThreadPartial<A extends Auth = void>( 321 cfg: MethodConfigOrHandler< 322 A, 323 PartyWheyAppBskyFeedGetPostThreadPartial.QueryParams, 324 PartyWheyAppBskyFeedGetPostThreadPartial.HandlerInput, 325 PartyWheyAppBskyFeedGetPostThreadPartial.HandlerOutput 326 >, 327 ) { 328 const nsid = 'party.whey.app.bsky.feed.getPostThreadPartial' // @ts-ignore 329 return this._server.xrpc.method(nsid, cfg) 330 } 331 332 getQuotesPartial<A extends Auth = void>( 333 cfg: MethodConfigOrHandler< 334 A, 335 PartyWheyAppBskyFeedGetQuotesPartial.QueryParams, 336 PartyWheyAppBskyFeedGetQuotesPartial.HandlerInput, 337 PartyWheyAppBskyFeedGetQuotesPartial.HandlerOutput 338 >, 339 ) { 340 const nsid = 'party.whey.app.bsky.feed.getQuotesPartial' // @ts-ignore 341 return this._server.xrpc.method(nsid, cfg) 342 } 343 344 getRepostedByPartial<A extends Auth = void>( 345 cfg: MethodConfigOrHandler< 346 A, 347 PartyWheyAppBskyFeedGetRepostedByPartial.QueryParams, 348 PartyWheyAppBskyFeedGetRepostedByPartial.HandlerInput, 349 PartyWheyAppBskyFeedGetRepostedByPartial.HandlerOutput 350 >, 351 ) { 352 const nsid = 'party.whey.app.bsky.feed.getRepostedByPartial' // @ts-ignore 353 return this._server.xrpc.method(nsid, cfg) 354 } 355}