Update to latest APIs

This commit is contained in:
Paul Frazee 2022-10-26 14:34:47 -05:00
parent 349cfe7177
commit 1983512fef
74 changed files with 2334 additions and 525 deletions

View file

@ -1,5 +1,5 @@
import {makeAutoObservable} from 'mobx'
import AdxApi from '../../third-party/api'
import AtpApi from '../../third-party/api'
import type * as GetAccountsConfig from '../../third-party/api/src/types/com/atproto/getAccountsConfig'
import {isObj, hasProp} from '../lib/type-guards'
import {RootStoreModel} from './root-store'
@ -135,7 +135,7 @@ export class SessionModel {
}
async describeService(service: string): Promise<ServiceDescription> {
const api = AdxApi.service(service)
const api = AtpApi.service(service)
const res = await api.com.atproto.getAccountsConfig({})
return res.data
}
@ -149,7 +149,7 @@ export class SessionModel {
username: string
password: string
}) {
const api = AdxApi.service(service)
const api = AtpApi.service(service)
const res = await api.com.atproto.createSession({}, {username, password})
if (res.data.jwt) {
this.setState({
@ -178,7 +178,7 @@ export class SessionModel {
username: string
inviteCode?: string
}) {
const api = AdxApi.service(service)
const api = AtpApi.service(service)
const res = await api.com.atproto.createAccount(
{},
{username, password, email, inviteCode},