[READ ONLY MIRROR] Spark Social AppView Server
github.com/sprksocial/server
atproto
deno
hono
lexicon
1import { IdResolver } from "@atp/identity";
2import { Database } from "./db/index.ts";
3import { Blocks } from "./routes/blocks.ts";
4import { FeedGens } from "./routes/feed-gens.ts";
5import { Feeds } from "./routes/feeds.ts";
6import { Follows } from "./routes/follows.ts";
7import { Likes } from "./routes/likes.ts";
8import { Moderation } from "./routes/moderation.ts";
9import { Actors } from "./routes/actors.ts";
10import { Identity } from "./routes/identity.ts";
11import { Notifications } from "./routes/notifs.ts";
12import { Records } from "./routes/records.ts";
13import { Relationships } from "./routes/relationships.ts";
14import { Interactions } from "./routes/interactions.ts";
15import { Reposts } from "./routes/reposts.ts";
16import { Sounds } from "./routes/sounds.ts";
17import { Stories } from "./routes/stories.ts";
18import { Sync } from "./routes/sync.ts";
19import { Threads } from "./routes/threads.ts";
20import { Preferences } from "./routes/preferences.ts";
21import { Search } from "./routes/search.ts";
22import { Labels } from "./routes/labels.ts";
23import { PushTokens } from "./routes/push-tokens.ts";
24import { CrosspostThread } from "./routes/crosspost-threads.ts";
25
26export { RepoSubscription } from "./subscription/index.ts";
27
28export type ServerContext = {
29 db: Database;
30 idResolver?: IdResolver;
31};
32
33export class DataPlane {
34 private db: Database;
35 private idResolver?: IdResolver;
36
37 // Route handlers as root-level properties
38 public blocks: Blocks;
39 public feedGens: FeedGens;
40 public feeds: Feeds;
41 public follows: Follows;
42 public likes: Likes;
43 public moderation: Moderation;
44 public actors: Actors;
45 public identity: Identity;
46 public notifications: Notifications;
47 public records: Records;
48 public relationships: Relationships;
49 public interactions: Interactions;
50 public reposts: Reposts;
51 public sounds: Sounds;
52 public stories: Stories;
53 public sync: Sync;
54 public threads: Threads;
55 public preferences: Preferences;
56 public search: Search;
57 public labels: Labels;
58 public pushTokens: PushTokens;
59 public crosspostThread: CrosspostThread;
60
61 constructor(
62 db: Database,
63 idResolver?: IdResolver,
64 ) {
65 this.db = db;
66 this.idResolver = idResolver;
67
68 // Initialize all route handlers
69 this.blocks = new Blocks(db);
70 this.feedGens = new FeedGens(db);
71 this.feeds = new Feeds(db);
72 this.follows = new Follows(db);
73 this.likes = new Likes(db);
74 this.moderation = new Moderation(db);
75 this.actors = new Actors(db);
76 this.identity = new Identity(idResolver);
77 this.notifications = new Notifications(db);
78 this.records = new Records(db);
79 this.relationships = new Relationships(db);
80 this.interactions = new Interactions(db);
81 this.reposts = new Reposts(db);
82 this.sounds = new Sounds(db);
83 this.stories = new Stories(db);
84 this.sync = new Sync(db);
85 this.threads = new Threads(db);
86 this.preferences = new Preferences(db);
87 this.search = new Search(db);
88 this.labels = new Labels(db);
89 this.pushTokens = new PushTokens(db);
90 this.crosspostThread = new CrosspostThread(db);
91 }
92}