[SDK] Remove @atproto/api (#11386)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import {type AppBskyFeedDefs} from '@atproto/api'
|
||||
import {type Client} from '@atproto/lex'
|
||||
import {type AtUriString} from '@atproto/syntax'
|
||||
|
||||
import {PROD_DEFAULT_FEED} from '#/lib/constants'
|
||||
import {type app} from '#/lexicons'
|
||||
import {CustomFeedAPI} from './custom'
|
||||
import {FollowingFeedAPI} from './following'
|
||||
import {type FeedAPI, type FeedAPIResponse} from './types'
|
||||
@@ -15,7 +15,12 @@ import {type FeedAPI, type FeedAPIResponse} from './types'
|
||||
// we use this fallback marker post to drive this instead. see Feed.tsx
|
||||
// for the usage.
|
||||
// -prf
|
||||
export const FALLBACK_MARKER_POST: AppBskyFeedDefs.FeedViewPost = {
|
||||
/*
|
||||
* A synthetic marker, not a real view: its `uri`/`did`/`indexedAt` are
|
||||
* deliberately not well-formed, so the literal is asserted rather than branded.
|
||||
* Only `post.uri` is ever read (see Feed.tsx).
|
||||
*/
|
||||
export const FALLBACK_MARKER_POST = {
|
||||
post: {
|
||||
uri: 'fallback-marker-post',
|
||||
cid: 'fake',
|
||||
@@ -26,7 +31,7 @@ export const FALLBACK_MARKER_POST: AppBskyFeedDefs.FeedViewPost = {
|
||||
},
|
||||
indexedAt: new Date().toISOString(),
|
||||
},
|
||||
}
|
||||
} as unknown as app.bsky.feed.defs.FeedViewPost
|
||||
|
||||
export class HomeFeedAPI implements FeedAPI {
|
||||
client: Client
|
||||
@@ -63,7 +68,7 @@ export class HomeFeedAPI implements FeedAPI {
|
||||
this.itemCursor = 0
|
||||
}
|
||||
|
||||
async peekLatest(): Promise<AppBskyFeedDefs.FeedViewPost> {
|
||||
async peekLatest(): Promise<app.bsky.feed.defs.FeedViewPost> {
|
||||
if (this.usingDiscover) {
|
||||
return this.discover.peekLatest()
|
||||
}
|
||||
@@ -82,7 +87,7 @@ export class HomeFeedAPI implements FeedAPI {
|
||||
}
|
||||
|
||||
let returnCursor
|
||||
let posts: AppBskyFeedDefs.FeedViewPost[] = []
|
||||
let posts: app.bsky.feed.defs.FeedViewPost[] = []
|
||||
|
||||
if (!this.usingDiscover) {
|
||||
const res = await this.following.fetch({cursor, limit})
|
||||
|
||||
Reference in New Issue
Block a user