about summary refs log tree commit diff
path: root/src/state/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/models')
-rw-r--r--src/state/models/feed-view.ts16
-rw-r--r--src/state/models/get-assertions-view.ts5
-rw-r--r--src/state/models/members-view.ts8
-rw-r--r--src/state/models/memberships-view.ts6
-rw-r--r--src/state/models/notifications-view.ts8
-rw-r--r--src/state/models/post-thread-view.ts5
-rw-r--r--src/state/models/post.ts2
-rw-r--r--src/state/models/profile-view.ts12
-rw-r--r--src/state/models/profiles-view.ts2
-rw-r--r--src/state/models/reposted-by-view.ts7
-rw-r--r--src/state/models/root-store.ts3
-rw-r--r--src/state/models/session.ts10
-rw-r--r--src/state/models/suggested-actors-view.ts2
-rw-r--r--src/state/models/suggested-invites-view.ts2
-rw-r--r--src/state/models/user-autocomplete-view.ts6
-rw-r--r--src/state/models/user-followers-view.ts6
-rw-r--r--src/state/models/user-follows-view.ts6
-rw-r--r--src/state/models/votes-view.ts6
18 files changed, 66 insertions, 46 deletions
diff --git a/src/state/models/feed-view.ts b/src/state/models/feed-view.ts
index ca00d5e2b..2c205d7c0 100644
--- a/src/state/models/feed-view.ts
+++ b/src/state/models/feed-view.ts
@@ -1,12 +1,14 @@
 import {makeAutoObservable, runInAction} from 'mobx'
-import * as GetTimeline from '../../third-party/api/src/client/types/app/bsky/feed/getTimeline'
 import {
-  Main as FeedViewPost,
-  ReasonTrend,
-  ReasonRepost,
-} from '../../third-party/api/src/client/types/app/bsky/feed/feedViewPost'
-import {View as PostView} from '../../third-party/api/src/client/types/app/bsky/feed/post'
-import * as GetAuthorFeed from '../../third-party/api/src/client/types/app/bsky/feed/getAuthorFeed'
+  AppBskyFeedGetTimeline as GetTimeline,
+  AppBskyFeedFeedViewPost,
+  AppBskyFeedPost,
+  AppBskyFeedGetAuthorFeed as GetAuthorFeed,
+} from '@atproto/api'
+type FeedViewPost = AppBskyFeedFeedViewPost.Main
+type ReasonTrend = AppBskyFeedFeedViewPost.ReasonTrend
+type ReasonRepost = AppBskyFeedFeedViewPost.ReasonRepost
+type PostView = AppBskyFeedPost.View
 import {AtUri} from '../../third-party/uri'
 import {RootStoreModel} from './root-store'
 import * as apilib from '../lib/api'
diff --git a/src/state/models/get-assertions-view.ts b/src/state/models/get-assertions-view.ts
index f9e78f383..4778ef132 100644
--- a/src/state/models/get-assertions-view.ts
+++ b/src/state/models/get-assertions-view.ts
@@ -1,9 +1,8 @@
 import {makeAutoObservable} from 'mobx'
-import * as GetAssertions from '../../third-party/api/src/client/types/app/bsky/graph/getAssertions'
+import {AppBskyGraphGetAssertions as GetAssertions} from '@atproto/api'
 import {RootStoreModel} from './root-store'
 
-type ResponseAssertion = GetAssertions.OutputSchema['assertions'][number]
-export type Assertion = ResponseAssertion & {
+export type Assertion = GetAssertions.Assertion & {
   _reactKey: string
 }
 
diff --git a/src/state/models/members-view.ts b/src/state/models/members-view.ts
index 98d3368ac..35eafb583 100644
--- a/src/state/models/members-view.ts
+++ b/src/state/models/members-view.ts
@@ -1,7 +1,9 @@
 import {makeAutoObservable, runInAction} from 'mobx'
-import * as GetMembers from '../../third-party/api/src/client/types/app/bsky/graph/getMembers'
-import * as ActorRef from '../../third-party/api/src/client/types/app/bsky/actor/ref'
-import {APP_BSKY_GRAPH} from '../../third-party/api'
+import {
+  AppBskyGraphGetMembers as GetMembers,
+  AppBskyActorRef as ActorRef,
+  APP_BSKY_GRAPH,
+} from '@atproto/api'
 import {AtUri} from '../../third-party/uri'
 import {RootStoreModel} from './root-store'
 
diff --git a/src/state/models/memberships-view.ts b/src/state/models/memberships-view.ts
index 57b2fd193..99bb25645 100644
--- a/src/state/models/memberships-view.ts
+++ b/src/state/models/memberships-view.ts
@@ -1,6 +1,8 @@
 import {makeAutoObservable} from 'mobx'
-import * as GetMemberships from '../../third-party/api/src/client/types/app/bsky/graph/getMemberships'
-import * as ActorRef from '../../third-party/api/src/client/types/app/bsky/actor/ref'
+import {
+  AppBskyGraphGetMemberships as GetMemberships,
+  AppBskyActorRef as ActorRef,
+} from '@atproto/api'
 import {RootStoreModel} from './root-store'
 
 export type MembershipItem = GetMemberships.Membership & {
diff --git a/src/state/models/notifications-view.ts b/src/state/models/notifications-view.ts
index fec646b9a..c1ee78d41 100644
--- a/src/state/models/notifications-view.ts
+++ b/src/state/models/notifications-view.ts
@@ -1,10 +1,12 @@
 import {makeAutoObservable, runInAction} from 'mobx'
-import * as ListNotifications from '../../third-party/api/src/client/types/app/bsky/notification/list'
-import * as ActorRef from '../../third-party/api/src/client/types/app/bsky/actor/ref'
+import {
+  AppBskyNotificationList as ListNotifications,
+  AppBskyActorRef as ActorRef,
+  APP_BSKY_GRAPH,
+} from '@atproto/api'
 import {RootStoreModel} from './root-store'
 import {PostThreadViewModel} from './post-thread-view'
 import {hasProp} from '../lib/type-guards'
-import {APP_BSKY_GRAPH} from '../../third-party/api'
 import {cleanError} from '../../lib/strings'
 
 const UNGROUPABLE_REASONS = ['trend', 'assertion']
diff --git a/src/state/models/post-thread-view.ts b/src/state/models/post-thread-view.ts
index 0c8e9c5fd..f0f0d5ef3 100644
--- a/src/state/models/post-thread-view.ts
+++ b/src/state/models/post-thread-view.ts
@@ -1,6 +1,5 @@
 import {makeAutoObservable, runInAction} from 'mobx'
-import {AppBskyFeedGetPostThread as GPT} from '../../third-party/api'
-import type * as GetPostThread from '../../third-party/api/src/client/types/app/bsky/feed/getPostThread'
+import {AppBskyFeedGetPostThread as GetPostThread} from '@atproto/api'
 import {AtUri} from '../../third-party/uri'
 import {RootStoreModel} from './root-store'
 import * as apilib from '../lib/api'
@@ -297,7 +296,7 @@ export class PostThreadViewModel {
     this.isRefreshing = false
     this.hasLoaded = true
     this.error = err ? err.toString() : ''
-    this.notFound = err instanceof GPT.NotFoundError
+    this.notFound = err instanceof GetPostThread.NotFoundError
   }
 
   // loader functions
diff --git a/src/state/models/post.ts b/src/state/models/post.ts
index a3ed83e49..1c49e32f2 100644
--- a/src/state/models/post.ts
+++ b/src/state/models/post.ts
@@ -1,5 +1,5 @@
 import {makeAutoObservable} from 'mobx'
-import * as Post from '../../third-party/api/src/client/types/app/bsky/feed/post'
+import {AppBskyFeedPost as Post} from '@atproto/api'
 import {AtUri} from '../../third-party/uri'
 import {RootStoreModel} from './root-store'
 import {cleanError} from '../../lib/strings'
diff --git a/src/state/models/profile-view.ts b/src/state/models/profile-view.ts
index 9b32c8744..ce70867ae 100644
--- a/src/state/models/profile-view.ts
+++ b/src/state/models/profile-view.ts
@@ -1,9 +1,13 @@
 import {makeAutoObservable, runInAction} from 'mobx'
 import {Image as PickedImage} from 'react-native-image-crop-picker'
-import * as GetProfile from '../../third-party/api/src/client/types/app/bsky/actor/getProfile'
-import * as Profile from '../../third-party/api/src/client/types/app/bsky/actor/profile'
-import {Main as DeclRef} from '../../third-party/api/src/client/types/app/bsky/system/declRef'
-import {Entity} from '../../third-party/api/src/client/types/app/bsky/feed/post'
+import {
+  AppBskyActorGetProfile as GetProfile,
+  AppBskyActorProfile as Profile,
+  AppBskySystemDeclRef,
+  AppBskyFeedPost,
+} from '@atproto/api'
+type DeclRef = AppBskySystemDeclRef.Main
+type Entity = AppBskyFeedPost.Entity
 import {extractEntities} from '../../lib/strings'
 import {RootStoreModel} from './root-store'
 import * as apilib from '../lib/api'
diff --git a/src/state/models/profiles-view.ts b/src/state/models/profiles-view.ts
index d9fe98b3f..804491c8b 100644
--- a/src/state/models/profiles-view.ts
+++ b/src/state/models/profiles-view.ts
@@ -1,7 +1,7 @@
 import {makeAutoObservable} from 'mobx'
 import {LRUMap} from 'lru_map'
 import {RootStoreModel} from './root-store'
-import * as GetProfile from '../../third-party/api/src/client/types/app/bsky/actor/getProfile'
+import {AppBskyActorGetProfile as GetProfile} from '@atproto/api'
 
 type CacheValue = Promise<GetProfile.Response> | GetProfile.Response
 export class ProfilesViewModel {
diff --git a/src/state/models/reposted-by-view.ts b/src/state/models/reposted-by-view.ts
index 9e9146899..624d86ec0 100644
--- a/src/state/models/reposted-by-view.ts
+++ b/src/state/models/reposted-by-view.ts
@@ -1,7 +1,10 @@
 import {makeAutoObservable, runInAction} from 'mobx'
 import {AtUri} from '../../third-party/uri'
-import * as GetRepostedBy from '../../third-party/api/src/client/types/app/bsky/feed/getRepostedBy'
-import {Main as DeclRef} from '../../third-party/api/src/client/types/app/bsky/system/declRef'
+import {
+  AppBskyFeedGetRepostedBy as GetRepostedBy,
+  AppBskySystemDeclRef,
+} from '@atproto/api'
+type DeclRef = AppBskySystemDeclRef.Main
 import {RootStoreModel} from './root-store'
 
 export class RepostedByViewItemModel implements GetRepostedBy.RepostedBy {
diff --git a/src/state/models/root-store.ts b/src/state/models/root-store.ts
index ad306ee9f..26f947c56 100644
--- a/src/state/models/root-store.ts
+++ b/src/state/models/root-store.ts
@@ -3,8 +3,7 @@
  */
 
 import {makeAutoObservable} from 'mobx'
-import {sessionClient as AtpApi} from '../../third-party/api'
-import type {SessionServiceClient} from '../../third-party/api/src/index'
+import {sessionClient as AtpApi, SessionServiceClient} from '@atproto/api'
 import {createContext, useContext} from 'react'
 import {isObj, hasProp} from '../lib/type-guards'
 import {SessionModel} from './session'
diff --git a/src/state/models/session.ts b/src/state/models/session.ts
index eef6808ce..febffcec3 100644
--- a/src/state/models/session.ts
+++ b/src/state/models/session.ts
@@ -1,10 +1,10 @@
 import {makeAutoObservable} from 'mobx'
-import {sessionClient as AtpApi} from '../../third-party/api/index'
-import type {
-  SessionServiceClient,
+import {
+  sessionClient as AtpApi,
   Session,
-} from '../../third-party/api/src/index'
-import type * as GetAccountsConfig from '../../third-party/api/src/client/types/com/atproto/server/getAccountsConfig'
+  SessionServiceClient,
+  ComAtprotoServerGetAccountsConfig as GetAccountsConfig,
+} from '@atproto/api'
 import {isObj, hasProp} from '../lib/type-guards'
 import {RootStoreModel} from './root-store'
 import {isNetworkError} from '../../lib/errors'
diff --git a/src/state/models/suggested-actors-view.ts b/src/state/models/suggested-actors-view.ts
index 0901d5ecc..f52830cfd 100644
--- a/src/state/models/suggested-actors-view.ts
+++ b/src/state/models/suggested-actors-view.ts
@@ -1,5 +1,5 @@
 import {makeAutoObservable} from 'mobx'
-import * as GetSuggestions from '../../third-party/api/src/client/types/app/bsky/actor/getSuggestions'
+import {AppBskyActorGetSuggestions as GetSuggestions} from '@atproto/api'
 import {RootStoreModel} from './root-store'
 
 export type SuggestedActor = GetSuggestions.Actor & {
diff --git a/src/state/models/suggested-invites-view.ts b/src/state/models/suggested-invites-view.ts
index 260ec6817..33ca7396e 100644
--- a/src/state/models/suggested-invites-view.ts
+++ b/src/state/models/suggested-invites-view.ts
@@ -2,7 +2,7 @@ import {makeAutoObservable, runInAction} from 'mobx'
 import {RootStoreModel} from './root-store'
 import {UserFollowsViewModel, FollowItem} from './user-follows-view'
 import {GetAssertionsView} from './get-assertions-view'
-import {APP_BSKY_SYSTEM, APP_BSKY_GRAPH} from '../../third-party/api'
+import {APP_BSKY_SYSTEM, APP_BSKY_GRAPH} from '@atproto/api'
 
 export interface SuggestedInvitesViewParams {
   sceneDid: string
diff --git a/src/state/models/user-autocomplete-view.ts b/src/state/models/user-autocomplete-view.ts
index b6afa40b2..8f467da69 100644
--- a/src/state/models/user-autocomplete-view.ts
+++ b/src/state/models/user-autocomplete-view.ts
@@ -1,6 +1,8 @@
 import {makeAutoObservable, runInAction} from 'mobx'
-import * as GetFollows from '../../third-party/api/src/client/types/app/bsky/graph/getFollows'
-import * as SearchTypeahead from '../../third-party/api/src/client/types/app/bsky/actor/searchTypeahead'
+import {
+  AppBskyGraphGetFollows as GetFollows,
+  AppBskyActorSearchTypeahead as SearchTypeahead,
+} from '@atproto/api'
 import {RootStoreModel} from './root-store'
 
 export class UserAutocompleteViewModel {
diff --git a/src/state/models/user-followers-view.ts b/src/state/models/user-followers-view.ts
index 831dfc689..2d8d7cf13 100644
--- a/src/state/models/user-followers-view.ts
+++ b/src/state/models/user-followers-view.ts
@@ -1,6 +1,8 @@
 import {makeAutoObservable} from 'mobx'
-import * as GetFollowers from '../../third-party/api/src/client/types/app/bsky/graph/getFollowers'
-import * as ActorRef from '../../third-party/api/src/client/types/app/bsky/actor/ref'
+import {
+  AppBskyGraphGetFollowers as GetFollowers,
+  AppBskyActorRef as ActorRef,
+} from '@atproto/api'
 import {RootStoreModel} from './root-store'
 
 export type FollowerItem = GetFollowers.Follower & {
diff --git a/src/state/models/user-follows-view.ts b/src/state/models/user-follows-view.ts
index 15af6abc5..8cbafddf9 100644
--- a/src/state/models/user-follows-view.ts
+++ b/src/state/models/user-follows-view.ts
@@ -1,6 +1,8 @@
 import {makeAutoObservable} from 'mobx'
-import * as GetFollows from '../../third-party/api/src/client/types/app/bsky/graph/getFollows'
-import * as ActorRef from '../../third-party/api/src/client/types/app/bsky/actor/ref'
+import {
+  AppBskyGraphGetFollows as GetFollows,
+  AppBskyActorRef as ActorRef,
+} from '@atproto/api'
 import {RootStoreModel} from './root-store'
 
 export type FollowItem = GetFollows.Follow & {
diff --git a/src/state/models/votes-view.ts b/src/state/models/votes-view.ts
index 64da6b227..c92d8ae22 100644
--- a/src/state/models/votes-view.ts
+++ b/src/state/models/votes-view.ts
@@ -1,7 +1,9 @@
 import {makeAutoObservable, runInAction} from 'mobx'
 import {AtUri} from '../../third-party/uri'
-import * as GetVotes from '../../third-party/api/src/client/types/app/bsky/feed/getVotes'
-import * as ActorRef from '../../third-party/api/src/client/types/app/bsky/actor/ref'
+import {
+  AppBskyFeedGetVotes as GetVotes,
+  AppBskyActorRef as ActorRef,
+} from '@atproto/api'
 import {RootStoreModel} from './root-store'
 
 export class VotesViewItemModel implements GetVotes.Vote {