phase 4 foundations: vendor missing lexicons, refreshSession api, toLex no-op purge, de-agent link-meta
This commit is contained in:
@@ -2,7 +2,6 @@ import {type Client} from '@atproto/lex-client'
|
||||
|
||||
import {DEMO_FEED} from '#/lib/demo'
|
||||
import {type app} from '#/lexicons'
|
||||
import {toLex} from '#/types/bsky'
|
||||
import {type FeedAPI, type FeedAPIResponse} from './types'
|
||||
|
||||
export class DemoFeedAPI implements FeedAPI {
|
||||
@@ -12,17 +11,13 @@ export class DemoFeedAPI implements FeedAPI {
|
||||
this.client = client
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
async peekLatest(): Promise<app.bsky.feed.defs.FeedViewPost> {
|
||||
/*
|
||||
* TODO(phase4): drop this cast once `#/lib/demo` (DEMO_FEED) sources its
|
||||
* feed items from `#/lexicons`. Its records are still typed against the old
|
||||
* `@atproto/api` FeedViewPost, which does not assign to the branded lexicon
|
||||
* type this method must return.
|
||||
*/
|
||||
return toLex(DEMO_FEED.feed[0])
|
||||
return DEMO_FEED.feed[0]
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
async fetch(): Promise<FeedAPIResponse> {
|
||||
return toLex(DEMO_FEED)
|
||||
return DEMO_FEED
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import {feedUriToHref} from '#/lib/strings/url-helpers'
|
||||
import {getContentLanguages} from '#/state/preferences/languages'
|
||||
import {type FeedParams} from '#/state/queries/post-feed'
|
||||
import {app} from '#/lexicons'
|
||||
import {toLex} from '#/types/bsky'
|
||||
import {FeedTuner} from '../feed-manip'
|
||||
import {type FeedTunerFn} from '../feed-manip'
|
||||
import {
|
||||
@@ -264,13 +263,7 @@ class MergeFeedSource_Following extends MergeFeedSource {
|
||||
return {
|
||||
success: true,
|
||||
cursor: res.cursor,
|
||||
/*
|
||||
* TODO(phase4): drop the toLex once `#/lib/api/feed-manip` (FeedTuner)
|
||||
* flips its FeedViewPost source from `@atproto/api` to `#/lexicons`. Its
|
||||
* `_feedPost` is still the old-world view type, which does not assign to
|
||||
* the branded lexicon type this page carries.
|
||||
*/
|
||||
feed: slices.map(slice => toLex(slice._feedPost)),
|
||||
feed: slices.map(slice => slice._feedPost),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user