drop the casts the dual-world layer needed
With every producer on the generated lexicons, the branded-string assertions at these 30 sites are no-ops, and oxlint flags them. Also sorts the imports the type flip disturbed and prunes the suppressions that no longer occur. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Vendored
+3
-3
@@ -1,10 +1,8 @@
|
||||
import {type AtUriString} from '@atproto/syntax'
|
||||
import {useEffect, useMemo, useState} from 'react'
|
||||
import {type AtUriString} from '@atproto/syntax'
|
||||
import {type QueryClient} from '@tanstack/react-query'
|
||||
import {EventEmitter} from 'eventemitter3'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {app} from '#/lexicons'
|
||||
import {batchedUpdates} from '#/lib/batchedUpdates'
|
||||
import {findAllPostsInQueryData as findAllPostsInBookmarksQueryData} from '#/state/queries/bookmarks/useBookmarksQuery'
|
||||
import {findAllPostsInQueryData as findAllPostsInExploreFeedPreviewsQueryData} from '#/state/queries/explore-feed-previews'
|
||||
@@ -13,6 +11,8 @@ import {findAllPostsInQueryData as findAllPostsInFeedQueryData} from '#/state/qu
|
||||
import {findAllPostsInQueryData as findAllPostsInQuoteQueryData} from '#/state/queries/post-quotes'
|
||||
import {findAllPostsInQueryData as findAllPostsInSearchQueryData} from '#/state/queries/search-posts-v2'
|
||||
import {findAllPostsInQueryData as findAllPostsInThreadV2QueryData} from '#/state/queries/usePostThread/queryCache'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {castAsShadow, type Shadow} from './types'
|
||||
export type {Shadow} from './types'
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,6 @@ import {useEffect, useMemo, useState} from 'react'
|
||||
import {type QueryClient} from '@tanstack/react-query'
|
||||
import {EventEmitter} from 'eventemitter3'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import {batchedUpdates} from '#/lib/batchedUpdates'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInActivitySubscriptionsQueryData} from '#/state/queries/activity-subscriptions'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInActorSearchQueryData} from '#/state/queries/actor-search'
|
||||
@@ -33,6 +32,7 @@ import {findAllProfilesInQueryData as findAllProfilesInSuggestedUsersForDiscover
|
||||
import {findAllProfilesInQueryData as findAllProfilesInSuggestedUsersForExploreQueryData} from '#/state/queries/trending/useGetSuggestedUsersForExploreQuery'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInSuggestedUsersForSeeMoreQueryData} from '#/state/queries/trending/useGetSuggestedUsersForSeeMoreQuery'
|
||||
import {findAllProfilesInQueryData as findAllProfilesInPostThreadV2QueryData} from '#/state/queries/usePostThread/queryCache'
|
||||
import {app} from '#/lexicons'
|
||||
import type * as bsky from '#/types/bsky'
|
||||
import {castAsShadow, type Shadow} from './types'
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import {type $Typed, type Client, XrpcResponseError} from '@atproto/lex'
|
||||
import {type DidString, toDatetimeString} from '@atproto/syntax'
|
||||
import {type Client, XrpcResponseError, type $Typed} from '@atproto/lex'
|
||||
import {EventEmitter} from 'eventemitter3'
|
||||
import {nanoid} from 'nanoid/non-secure'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {networkRetry} from '#/lib/async/retry'
|
||||
import {
|
||||
isErrorMaybeAppPasswordPermissions,
|
||||
@@ -43,6 +42,7 @@ import {
|
||||
} from '#/components/dms/util'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import {app, chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
const logger = Logger.create(Logger.Context.ConversationAgent)
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@ import {
|
||||
import {useFocusEffect} from '@react-navigation/native'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {chat} from '#/lexicons'
|
||||
import {useAppState} from '#/lib/appState'
|
||||
import {Convo} from '#/state/messages/convo/agent'
|
||||
import {
|
||||
@@ -31,6 +29,8 @@ import {RQKEY_ROOT as ListConvosQueryKeyRoot} from '#/state/queries/messages/lis
|
||||
import {RQKEY as createProfileQueryKey} from '#/state/queries/profile'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {type GroupConvoMember} from '#/components/dms/util'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
export * from '#/state/messages/convo/util'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {type Client, type $Typed} from '@atproto/lex'
|
||||
import {type $Typed, type Client} from '@atproto/lex'
|
||||
|
||||
import {type MessagesEventBus} from '#/state/messages/events/agent'
|
||||
import {type ConvoWithDetails} from '#/components/dms/util'
|
||||
|
||||
@@ -31,7 +31,7 @@ export function useBookmarkMutation() {
|
||||
if (args.action === 'create') {
|
||||
updatePostShadow(qc, args.post.uri, {bookmarked: true})
|
||||
await client.call(app.bsky.bookmark.createBookmark, {
|
||||
uri: args.post.uri as AtUriString,
|
||||
uri: args.post.uri,
|
||||
cid: args.post.cid,
|
||||
})
|
||||
} else if (args.action === 'delete') {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import {type $Typed} from '@atproto/lex'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {
|
||||
type InfiniteData,
|
||||
type QueryClient,
|
||||
@@ -10,8 +12,6 @@ import {
|
||||
embedViewRecordToPostView,
|
||||
getEmbeddedPost,
|
||||
} from '#/state/queries/util'
|
||||
import {type $Typed} from '@atproto/lex'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {useAppviewClient} from '#/state/session'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {useMemo, useRef} from 'react'
|
||||
import {type AtUriString, AtUri} from '@atproto/syntax'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {moderatePost} from '@bsky.app/sdk/moderation'
|
||||
import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
@@ -9,8 +9,6 @@ import {
|
||||
useInfiniteQuery,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {app} from '#/lexicons'
|
||||
import {CustomFeedAPI} from '#/lib/api/feed/custom'
|
||||
import {aggregateUserInterests} from '#/lib/api/feed/utils'
|
||||
import {FeedTuner} from '#/lib/api/feed-manip'
|
||||
@@ -27,6 +25,8 @@ import {
|
||||
getEmbeddedPost,
|
||||
} from '#/state/queries/util'
|
||||
import {useAppviewClient} from '#/state/session'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
const RQKEY_ROOT = 'feed-previews'
|
||||
const RQKEY = (feeds: string[]) => [RQKEY_ROOT, feeds]
|
||||
@@ -142,7 +142,7 @@ export function useFeedPreviews(
|
||||
const feed = feeds[pageParam]
|
||||
const api = new CustomFeedAPI({
|
||||
client,
|
||||
feedParams: {feed: feed.uri as AtUriString},
|
||||
feedParams: {feed: feed.uri},
|
||||
userInterests,
|
||||
})
|
||||
const data = await api.fetch({cursor: undefined, limit: LIMIT})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {useCallback, useEffect, useMemo, useRef} from 'react'
|
||||
import {type AtUriString, AtUri} from '@atproto/syntax'
|
||||
import {RichText} from '@bsky.app/sdk/richtext'
|
||||
import {AtUri, type AtUriString} from '@atproto/syntax'
|
||||
import {moderateFeedGenerator} from '@bsky.app/sdk/moderation'
|
||||
import {RichText} from '@bsky.app/sdk/richtext'
|
||||
import {t} from '@lingui/core/macro'
|
||||
import {
|
||||
type InfiniteData,
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import {toDatetimeString} from '@atproto/syntax'
|
||||
import {useCallback} from 'react'
|
||||
import {type $Typed, type Client, type Unknown$TypedObject} from '@atproto/lex'
|
||||
import {toDatetimeString} from '@atproto/syntax'
|
||||
import {type QueryClient, useQuery, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {CHAT_SERVICE} from '#/lib/constants'
|
||||
import {createLexClient} from '#/lib/lexClient'
|
||||
import {logger} from '#/logger'
|
||||
@@ -11,6 +10,7 @@ import {STALE} from '#/state/queries/index'
|
||||
import {createQueryKey, type StructuredQueryKey} from '#/state/queries/util'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
/**
|
||||
* The three preview shapes we currently support. Excludes the `{$type: string}`
|
||||
|
||||
@@ -5,7 +5,7 @@ import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
import {logger} from '#/logger'
|
||||
import {usePdsClient, useSession} from '#/state/session'
|
||||
import {resolveAllowGroupInvites} from '#/components/dms/util'
|
||||
import {app, chat, com} from '#/lexicons'
|
||||
import {type app, chat, com} from '#/lexicons'
|
||||
import {RQKEY as PROFILE_RKEY} from '../profile'
|
||||
|
||||
export function useUpdateActorDeclaration({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {toDatetimeString} from '@atproto/syntax'
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {logger} from '#/logger'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {
|
||||
rollbackConvoOptimistic,
|
||||
updateConvoOptimistic,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {logger} from '#/logger'
|
||||
import {invalidateJoinLinkPreviewsForCode} from '#/state/queries/join-links'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {
|
||||
rollbackConvoOptimistic,
|
||||
updateConvoOptimistic,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {logger} from '#/logger'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {
|
||||
rollbackConvoOptimistic,
|
||||
updateConvoOptimistic,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {logger} from '#/logger'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {
|
||||
rollbackConvoOptimistic,
|
||||
updateConvoOptimistic,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {logger} from '#/logger'
|
||||
import {invalidateJoinLinkPreviewsForCode} from '#/state/queries/join-links'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {
|
||||
rollbackConvoOptimistic,
|
||||
updateConvoOptimistic,
|
||||
|
||||
@@ -4,9 +4,9 @@ import {
|
||||
useInfiniteQuery,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
const DEFAULT_LIMIT = 10
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {useEffect} from 'react'
|
||||
import {useInfiniteQuery, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {useMessagesEventBus} from '#/state/messages/events'
|
||||
import {createQueryKey} from '#/state/queries/util'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {STALE} from '..'
|
||||
|
||||
export const JOIN_REQUESTS_THRESHOLD = 20
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {
|
||||
rollbackConvoOptimistic,
|
||||
updateConvoOptimistic,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {useMutation, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {logger} from '#/logger'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {RQKEY as CONVO_KEY} from './conversation'
|
||||
import {
|
||||
type ConvoListQueryData,
|
||||
|
||||
@@ -5,10 +5,10 @@ import {
|
||||
useQueryClient,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {logger} from '#/logger'
|
||||
import {useChatClient} from '#/state/session'
|
||||
import {chat} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {RQKEY as CONVO_KEY} from './conversation'
|
||||
import {RQKEY_ROOT as CONVO_LIST_KEY} from './list-conversations'
|
||||
import {listConvoMembersQueryKey} from './list-convo-members'
|
||||
|
||||
@@ -4,9 +4,9 @@ import {
|
||||
type QueryKey,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {chat} from '#/lexicons'
|
||||
import {RQKEY as CONVO_KEY} from '../conversation'
|
||||
import {RQKEY_ROOT as CONVO_LIST_KEY} from '../list-conversations'
|
||||
import {chat} from '#/lexicons'
|
||||
|
||||
type ConvoUpdater = (
|
||||
prev: chat.bsky.convo.defs.ConvoView,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {type DidString} from '@atproto/syntax'
|
||||
import {describe, expect, it, jest} from '@jest/globals'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import {type Notification} from '../types'
|
||||
import {groupNotifications} from '../util'
|
||||
|
||||
@@ -36,7 +35,7 @@ function makeFollowNotification(
|
||||
: undefined,
|
||||
isRead: false,
|
||||
indexedAt: '2026-07-28T12:00:00.000Z',
|
||||
} as Notification
|
||||
}
|
||||
}
|
||||
|
||||
describe('groupNotifications', () => {
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
|
||||
import {useCallback, useEffect, useMemo, useRef} from 'react'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {moderatePost} from '@bsky.app/sdk/moderation'
|
||||
import {
|
||||
type InfiniteData,
|
||||
type QueryClient,
|
||||
@@ -25,13 +27,11 @@ import {
|
||||
useQueryClient,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {moderatePost} from '@bsky.app/sdk/moderation'
|
||||
import {app} from '#/lexicons'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {STALE} from '#/state/queries'
|
||||
import {useAppviewClient} from '#/state/session'
|
||||
import {useThreadgateHiddenReplyUris} from '#/state/threadgate-hidden-replies'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {
|
||||
didOrHandleUriMatches,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {app} from '#/lexicons'
|
||||
import {type app} from '#/lexicons'
|
||||
|
||||
/**
|
||||
* A `listNotifications` notification, widened with the `starterPack` the server
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
usePreferencesQuery,
|
||||
} from '#/state/queries/preferences'
|
||||
import {usePdsClient} from '#/state/session'
|
||||
import {type app} from '#/lexicons'
|
||||
|
||||
export {Nux} from '#/state/queries/nuxs/definitions'
|
||||
|
||||
@@ -108,10 +107,7 @@ export function useSaveNux() {
|
||||
* `serializeAppNux` still returns the legacy `Nux`, whose strings are
|
||||
* unbranded; it is validated against the same schema the action expects.
|
||||
*/
|
||||
await pdsClient.call(
|
||||
upsertNux,
|
||||
serializeAppNux(nux) as app.bsky.actor.defs.Nux,
|
||||
)
|
||||
await pdsClient.call(upsertNux, serializeAppNux(nux))
|
||||
// triggers a refetch
|
||||
await queryClient.invalidateQueries({
|
||||
queryKey: preferencesQueryKey,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {app} from '#/lexicons'
|
||||
import {type app} from '#/lexicons'
|
||||
|
||||
export type Data = Record<string, unknown> | undefined
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {useCallback, useEffect, useMemo, useRef} from 'react'
|
||||
import {AppState} from 'react-native'
|
||||
import {type Client} from '@atproto/lex'
|
||||
import {type AtIdentifierString, type AtUriString, AtUri} from '@atproto/syntax'
|
||||
import {type AtIdentifierString, AtUri, type AtUriString} from '@atproto/syntax'
|
||||
import {
|
||||
moderatePost,
|
||||
type ModerationDecision,
|
||||
@@ -14,8 +14,6 @@ import {
|
||||
useInfiniteQuery,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {app} from '#/lexicons'
|
||||
import {AuthorFeedAPI} from '#/lib/api/feed/author'
|
||||
import {CustomFeedAPI} from '#/lib/api/feed/custom'
|
||||
import {DemoFeedAPI} from '#/lib/api/feed/demo'
|
||||
@@ -35,6 +33,8 @@ import {DEFAULT_LOGGED_OUT_PREFERENCES} from '#/state/queries/preferences/const'
|
||||
import {useAppviewClient, useSession} from '#/state/session'
|
||||
import * as userActionHistory from '#/state/userActionHistory'
|
||||
import {KnownError} from '#/view/com/posts/PostFeedErrorMessage'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {useFeedTuners} from '../preferences/feed-tuners'
|
||||
import {useModerationOpts} from '../preferences/moderation-opts'
|
||||
import {usePreferencesQuery} from './preferences'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {type AtUriString, AtUri} from '@atproto/syntax'
|
||||
import {AtUri, type AtUriString} from '@atproto/syntax'
|
||||
import {
|
||||
type InfiniteData,
|
||||
type QueryClient,
|
||||
@@ -6,9 +6,9 @@ import {
|
||||
useInfiniteQuery,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {useAppviewClient} from '#/state/session'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {
|
||||
didOrHandleUriMatches,
|
||||
embedViewRecordToPostView,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {useCallback} from 'react'
|
||||
import {type Client} from '@atproto/lex'
|
||||
import {type AtUriString, type HandleString, AtUri} from '@atproto/syntax'
|
||||
import {AtUri, type AtUriString, type HandleString} from '@atproto/syntax'
|
||||
import {deleteLike, deletePost, deleteRepost, like, repost} from '@bsky.app/sdk'
|
||||
import {
|
||||
type QueryClient,
|
||||
@@ -108,7 +108,7 @@ export function useGetPosts() {
|
||||
uris: uris as AtUriString[],
|
||||
})
|
||||
// See the note on `fetchPost` about the view shapes.
|
||||
return data.posts as app.bsky.feed.defs.PostView[]
|
||||
return data.posts
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {type AtUriString, toDatetimeString, AtUri} from '@atproto/syntax'
|
||||
|
||||
import {type $Typed} from '@atproto/lex'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {AtUri, type AtUriString, toDatetimeString} from '@atproto/syntax'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
export const POSTGATE_COLLECTION = 'app.bsky.feed.postgate'
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import {useCallback, useMemo, useRef, useState} from 'react'
|
||||
import {useFocusEffect} from '@react-navigation/native'
|
||||
import debounce from 'lodash.debounce'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import {useCallOnce} from '#/lib/once'
|
||||
import {
|
||||
usePreferencesQuery,
|
||||
@@ -10,6 +9,7 @@ import {
|
||||
} from '#/state/queries/preferences'
|
||||
import {type ThreadViewPreferences} from '#/state/queries/preferences/types'
|
||||
import {useAnalytics} from '#/analytics'
|
||||
import {app} from '#/lexicons'
|
||||
import {type Literal} from '#/types/utils'
|
||||
|
||||
export type ThreadSortOption = Literal<
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {type DidString} from '@atproto/syntax'
|
||||
import {moderateFeedGenerator} from '@bsky.app/sdk/moderation'
|
||||
import {
|
||||
type InfiniteData,
|
||||
type QueryKey,
|
||||
useInfiniteQuery,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {moderateFeedGenerator} from '@bsky.app/sdk/moderation'
|
||||
import {useAppviewClient} from '#/state/session'
|
||||
import {app} from '#/lexicons'
|
||||
import {useModerationOpts} from '../preferences/moderation-opts'
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {type DidString} from '@atproto/syntax'
|
||||
import {moderateUserList} from '@bsky.app/sdk/moderation'
|
||||
import {
|
||||
type InfiniteData,
|
||||
type QueryKey,
|
||||
useInfiniteQuery,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {moderateUserList} from '@bsky.app/sdk/moderation'
|
||||
import {useAppviewClient} from '#/state/session'
|
||||
import {app} from '#/lexicons'
|
||||
import {useModerationOpts} from '../preferences/moderation-opts'
|
||||
|
||||
@@ -2,10 +2,10 @@ import {useCallback} from 'react'
|
||||
import {type Client, type Un$Typed} from '@atproto/lex'
|
||||
import {
|
||||
type AtIdentifierString,
|
||||
AtUri,
|
||||
type AtUriString,
|
||||
type DidString,
|
||||
toDatetimeString,
|
||||
AtUri,
|
||||
} from '@atproto/syntax'
|
||||
import {
|
||||
deleteFollow,
|
||||
@@ -337,7 +337,7 @@ export function useProfileFollowMutationQueue(
|
||||
if (finalFollowingUri) {
|
||||
void client
|
||||
.call(app.bsky.graph.getSuggestedFollowsByActor, {
|
||||
actor: did as AtIdentifierString,
|
||||
actor: did,
|
||||
})
|
||||
.then(res => {
|
||||
const dids = res.suggestions
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {type Client} from '@atproto/lex'
|
||||
import {type HandleString, AtUri} from '@atproto/syntax'
|
||||
import {AtUri, type HandleString} from '@atproto/syntax'
|
||||
import {type QueryClient, queryOptions, useQuery} from '@tanstack/react-query'
|
||||
|
||||
import {STALE} from '#/state/queries'
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
import {app} from '#/lexicons'
|
||||
/*
|
||||
* Pure helpers for lifting structured `app.bsky.feed.searchPosts` params out of
|
||||
* a free-text query. Kept free of React Native imports so it can be unit
|
||||
* tested in isolation (the search-posts query hook re-exports these).
|
||||
*/
|
||||
|
||||
import {
|
||||
filtersToApiParams,
|
||||
type SearchFilters,
|
||||
} from '#/screens/Search/searchParams'
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
const DATE_RE = /^\d{4}-\d{2}-\d{2}/
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import {useCallback, useMemo, useRef} from 'react'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {moderatePost} from '@bsky.app/sdk/moderation'
|
||||
import {
|
||||
type InfiniteData,
|
||||
type QueryClient,
|
||||
@@ -6,8 +8,6 @@ import {
|
||||
useInfiniteQuery,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {moderatePost} from '@bsky.app/sdk/moderation'
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
import {useAppviewClient} from '#/state/session'
|
||||
import {type SearchFilters} from '#/screens/Search/searchParams'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {type Client, type LexValue} from '@atproto/lex'
|
||||
import {type Client} from '@atproto/lex'
|
||||
import {AtUri, type AtUriString, toDatetimeString} from '@atproto/syntax'
|
||||
import {RichText} from '@bsky.app/sdk/richtext'
|
||||
import {
|
||||
@@ -133,7 +133,7 @@ export function useCreateStarterPackMutation({
|
||||
descriptionFacets,
|
||||
// `createStarterPackList` returns a plain string uri
|
||||
list: listRes?.uri as AtUriString,
|
||||
feeds: feeds?.map(f => ({uri: f.uri as AtUriString})),
|
||||
feeds: feeds?.map(f => ({uri: f.uri})),
|
||||
createdAt: toDatetimeString(new Date()),
|
||||
})
|
||||
},
|
||||
@@ -257,7 +257,7 @@ export function useEditStarterPackMutation({
|
||||
* types the raw `putRecord` body as a `LexValue`, which the legacy
|
||||
* view interface does not structurally satisfy, hence the cast.
|
||||
*/
|
||||
feeds: feeds as unknown as LexValue,
|
||||
feeds: feeds,
|
||||
createdAt: currentStarterPack.record.createdAt,
|
||||
updatedAt: new Date().toISOString(),
|
||||
},
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {app} from '#/lexicons'
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import {useCallback} from 'react'
|
||||
import {type $Typed} from '@atproto/lex'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {type QueryClient, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {
|
||||
dangerousGetPostShadow,
|
||||
updatePostShadow,
|
||||
} from '#/state/cache/post-shadow'
|
||||
import {type $Typed} from '@atproto/lex'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {app} from '#/lexicons'
|
||||
import {findAllPostsInQueryData as findAllPostsInBookmarksQueryData} from '#/state/queries/bookmarks/useBookmarksQuery'
|
||||
import {findAllPostsInQueryData as findAllPostsInExploreFeedPreviewsQueryData} from '#/state/queries/explore-feed-previews'
|
||||
import {findAllPostsInQueryData as findAllPostsInNotifsQueryData} from '#/state/queries/notifications/feed'
|
||||
@@ -31,6 +29,8 @@ import {
|
||||
embedViewRecordToPostView,
|
||||
getEmbeddedPost,
|
||||
} from '#/state/queries/util'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
export function createCacheMutator({
|
||||
queryClient,
|
||||
|
||||
@@ -13,9 +13,9 @@ import {
|
||||
getTraversalMetadata,
|
||||
storeTraversalMetadata,
|
||||
} from '#/state/queries/usePostThread/utils'
|
||||
import * as bsky from '#/types/bsky'
|
||||
import {app} from '#/lexicons'
|
||||
import * as views from '#/state/queries/usePostThread/views'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
export function sortAndAnnotateThreadItems(
|
||||
thread: ApiThreadItem[],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {type ModerationDecision} from '@bsky.app/sdk/moderation'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
export type ApiThreadItem =
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
|
||||
import {
|
||||
type ApiThreadItem,
|
||||
type ThreadItem,
|
||||
type TraversalMetadata,
|
||||
} from '#/state/queries/usePostThread/types'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {app} from '#/lexicons'
|
||||
import {isDevMode} from '#/storage/hooks/dev-mode'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import {moderatePost, type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||
|
||||
import {type $Typed} from '@atproto/lex'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {app} from '#/lexicons'
|
||||
import {moderatePost, type ModerationOpts} from '@bsky.app/sdk/moderation'
|
||||
|
||||
import {makeProfileLink} from '#/lib/routes/links'
|
||||
import {
|
||||
type ApiThreadItem,
|
||||
type ThreadItem,
|
||||
type TraversalMetadata,
|
||||
} from '#/state/queries/usePostThread/types'
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
export function threadPostNoUnauthenticated({
|
||||
uri,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {type AtUri} from '@atproto/syntax'
|
||||
import {
|
||||
type InfiniteData,
|
||||
type QueryClient,
|
||||
type QueryKey,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
import {type AtUri} from '@atproto/syntax'
|
||||
import {app} from '#/lexicons'
|
||||
import * as bsky from '#/types/bsky'
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {useCallback} from 'react'
|
||||
import {type DidString} from '@atproto/syntax'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {logger} from '#/logger'
|
||||
@@ -25,7 +24,7 @@ export function useUpdateProfileVerificationCache() {
|
||||
return
|
||||
}
|
||||
const updated = await client.call(app.bsky.actor.getProfile, {
|
||||
actor: profile.did as DidString,
|
||||
actor: profile.did,
|
||||
})
|
||||
updateProfileShadow(qc, profile.did, {
|
||||
verification: updated.verification,
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import {
|
||||
type AtIdentifierString,
|
||||
type DidString,
|
||||
type HandleString,
|
||||
toDatetimeString,
|
||||
} from '@atproto/syntax'
|
||||
import {toDatetimeString} from '@atproto/syntax'
|
||||
import {useMutation} from '@tanstack/react-query'
|
||||
|
||||
import {until} from '#/lib/async/until'
|
||||
@@ -28,9 +23,9 @@ export function useVerificationCreateMutation() {
|
||||
|
||||
const {uri} = await pdsClient.create(app.bsky.graph.verification, {
|
||||
// the profile view is still legacy-typed, so its strings are unbranded
|
||||
subject: profile.did as DidString,
|
||||
subject: profile.did,
|
||||
createdAt: toDatetimeString(new Date()),
|
||||
handle: profile.handle as HandleString,
|
||||
handle: profile.handle,
|
||||
displayName: profile.displayName || '',
|
||||
})
|
||||
|
||||
@@ -48,7 +43,7 @@ export function useVerificationCreateMutation() {
|
||||
},
|
||||
() => {
|
||||
return appviewClient.call(app.bsky.actor.getProfile, {
|
||||
actor: (profile.did ?? '') as AtIdentifierString,
|
||||
actor: profile.did ?? '',
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {type AtIdentifierString, AtUri} from '@atproto/syntax'
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {useMutation} from '@tanstack/react-query'
|
||||
|
||||
import {until} from '#/lib/async/until'
|
||||
@@ -51,7 +51,7 @@ export function useVerificationsRemoveMutation() {
|
||||
() => {
|
||||
return appviewClient.call(app.bsky.actor.getProfile, {
|
||||
// the profile view is still legacy-typed, so its did is unbranded
|
||||
actor: (profile.did ?? '') as AtIdentifierString,
|
||||
actor: profile.did ?? '',
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
@@ -4,7 +4,6 @@ import {msg} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react'
|
||||
import {useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||
import {postUriToRelativePath, toBskyAppUrl} from '#/lib/strings/url-helpers'
|
||||
import {purgeTemporaryImageFiles} from '#/state/gallery'
|
||||
@@ -14,6 +13,7 @@ import {
|
||||
RQKEY_LINK_ROOT,
|
||||
} from '#/state/queries/resolve-link'
|
||||
import * as Toast from '#/components/Toast'
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
export interface ComposerOptsPostRef {
|
||||
uri: string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {createContext, useCallback, useContext, useMemo, useState} from 'react'
|
||||
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
type StateContext = {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {useEffect, useId, useState} from 'react'
|
||||
|
||||
import {AtUri} from '@atproto/syntax'
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
import {Logger} from '#/logger'
|
||||
import {type FeedSourceInfo} from '#/state/queries/feed'
|
||||
import {app} from '#/lexicons'
|
||||
|
||||
/**
|
||||
* Separate logger for better debugging
|
||||
|
||||
Reference in New Issue
Block a user