[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

reorganize routes

+20 -20
+3 -3
services/appview/src/index.ts
··· 13 13 createBidirectionalResolver, 14 14 createIdResolver, 15 15 } from './id-resolver.js' 16 - import { createGetPostsRouter } from './routes/getPosts.js' 17 - import { createGetPostThreadRouter } from './routes/getPostThread.js' 18 - import { createGetProfileRouter } from './routes/getProfile.js' 16 + import { createGetPostsRouter } from './routes/feed/getPosts.js' 17 + import { createGetPostThreadRouter } from './routes/feed/getPostThread.js' 18 + import { createGetProfileRouter } from './routes/actor/getProfile.js' 19 19 import wellKnownRouter from './well-known.js' 20 20 21 21 export type AppContext = {
+5 -5
services/appview/src/routes/getPostThread.ts services/appview/src/routes/feed/getPostThread.ts
··· 1 1 import { Hono } from 'hono' 2 - import { OutputSchema as GetPostThreadView } from '../lexicon/types/so/sprk/feed/getPostThread.js' 3 - import type * as SoSprkFeedDefs from '../lexicon/types/so/sprk/feed/defs.js' 4 - import { AppContext } from '../index.js' 5 - import { transformPostToPostView } from '../utils/post-transformer.js' 6 - import { optionalAuthMiddleware } from '../auth/middleware.js' 2 + import { OutputSchema as GetPostThreadView } from '../../lexicon/types/so/sprk/feed/getPostThread.js' 3 + import type * as SoSprkFeedDefs from '../../lexicon/types/so/sprk/feed/defs.js' 4 + import { AppContext } from '../../index.js' 5 + import { transformPostToPostView } from '../../utils/post-transformer.js' 6 + import { optionalAuthMiddleware } from '../../auth/middleware.js' 7 7 8 8 export const createGetPostThreadRouter = (ctx: AppContext) => { 9 9 const router = new Hono()
+6 -6
services/appview/src/routes/getPosts.ts services/appview/src/routes/feed/getPosts.ts
··· 1 1 import { Hono } from 'hono' 2 2 3 - import { OutputSchema as GetPostsView } from '../lexicon/types/so/sprk/feed/getPosts.js' 4 - import { AppContext } from '../index.js' 5 - import { transformPostToPostView } from '../utils/post-transformer.js' 6 - import { BidirectionalResolver } from '../id-resolver.js' 7 - import { Database } from '../db.js' 8 - import type * as SoSprkFeedDefs from '../lexicon/types/so/sprk/feed/defs.js' 3 + import { OutputSchema as GetPostsView } from '../../lexicon/types/so/sprk/feed/getPosts.js' 4 + import { AppContext } from '../../index.js' 5 + import { transformPostToPostView } from '../../utils/post-transformer.js' 6 + import { BidirectionalResolver } from '../../id-resolver.js' 7 + import { Database } from '../../db.js' 8 + import type * as SoSprkFeedDefs from '../../lexicon/types/so/sprk/feed/defs.js' 9 9 10 10 // Function to fetch posts by URIs 11 11 async function getPosts(
+6 -6
services/appview/src/routes/getProfile.ts services/appview/src/routes/actor/getProfile.ts
··· 1 1 import { ensureValidDid, isValidHandle } from '@atproto/syntax' 2 2 import { Hono } from 'hono' 3 3 4 - import { optionalAuthMiddleware } from '../auth/middleware.js' 5 - import { AppContext } from '../index.js' 6 - import type { Label } from '../lexicon/types/com/atproto/label/defs.js' 7 - import type * as ComAtprotoRepoStrongRef from '../lexicon/types/com/atproto/repo/strongRef.js' 8 - import type * as SoSprkActorDefs from '../lexicon/types/so/sprk/actor/defs.js' 9 - import type * as SoSprkGraphDefs from '../lexicon/types/so/sprk/graph/defs.js' 4 + import { optionalAuthMiddleware } from '../../auth/middleware.js' 5 + import { AppContext } from '../../index.js' 6 + import type { Label } from '../../lexicon/types/com/atproto/label/defs.js' 7 + import type * as ComAtprotoRepoStrongRef from '../../lexicon/types/com/atproto/repo/strongRef.js' 8 + import type * as SoSprkActorDefs from '../../lexicon/types/so/sprk/actor/defs.js' 9 + import type * as SoSprkGraphDefs from '../../lexicon/types/so/sprk/graph/defs.js' 10 10 11 11 export const createGetProfileRouter = (ctx: AppContext) => { 12 12 const router = new Hono()