diff --git a/.changeset/light-lizards-tap.md b/.changeset/light-lizards-tap.md new file mode 100644 index 00000000000..88dc8a55f75 --- /dev/null +++ b/.changeset/light-lizards-tap.md @@ -0,0 +1,5 @@ +--- +'@atproto/api': patch +--- + +Directly pass create account params in api agent diff --git a/packages/api/src/agent.ts b/packages/api/src/agent.ts index 0f6602fc2bb..54f599492b5 100644 --- a/packages/api/src/agent.ts +++ b/packages/api/src/agent.ts @@ -11,7 +11,6 @@ import { } from './client' import { AtpSessionData, - AtpAgentCreateAccountOpts, AtpAgentLoginOpts, AtpAgentFetchHandler, AtpAgentFetchHandlerResponse, @@ -86,15 +85,10 @@ export class AtpAgent { * Create a new account and hydrate its session in this agent. */ async createAccount( - opts: AtpAgentCreateAccountOpts, + opts: ComAtprotoServerCreateAccount.InputSchema, ): Promise { try { - const res = await this.api.com.atproto.server.createAccount({ - handle: opts.handle, - password: opts.password, - email: opts.email, - inviteCode: opts.inviteCode, - }) + const res = await this.api.com.atproto.server.createAccount(opts) this.session = { accessJwt: res.data.accessJwt, refreshJwt: res.data.refreshJwt, diff --git a/packages/api/src/types.ts b/packages/api/src/types.ts index 7b462c0b7e8..45684a3ef27 100644 --- a/packages/api/src/types.ts +++ b/packages/api/src/types.ts @@ -38,16 +38,6 @@ export interface AtpAgentOpts { persistSession?: AtpPersistSessionHandler } -/** - * AtpAgent createAccount() opts - */ -export interface AtpAgentCreateAccountOpts { - email: string - password: string - handle: string - inviteCode?: string -} - /** * AtpAgent login() opts */