All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.atproto.server.createAccount.kt Maven / Gradle / Ivy

The newest version!
@file:Suppress("DEPRECATION")

package com.atproto.server

import kotlin.String
import kotlin.Suppress
import kotlinx.serialization.Serializable
import sh.christian.ozone.api.Did
import sh.christian.ozone.api.Handle
import sh.christian.ozone.api.model.JsonContent

/**
 * @param handle Requested handle for the account.
 * @param did Pre-existing atproto DID, being imported to a new account.
 * @param password Initial account password. May need to meet instance-specific password strength
 * requirements.
 * @param recoveryKey DID PLC rotation key (aka, recovery key) to be included in PLC creation
 * operation.
 * @param plcOp A signed DID PLC operation to be submitted as part of importing an existing account
 * to this instance. NOTE: this optional field may be updated when full account migration is
 * implemented.
 */
@Serializable
public data class CreateAccountRequest(
  public val email: String? = null,
  /**
   * Requested handle for the account.
   */
  public val handle: Handle,
  /**
   * Pre-existing atproto DID, being imported to a new account.
   */
  public val did: Did? = null,
  public val inviteCode: String? = null,
  public val verificationCode: String? = null,
  public val verificationPhone: String? = null,
  /**
   * Initial account password. May need to meet instance-specific password strength requirements.
   */
  public val password: String? = null,
  /**
   * DID PLC rotation key (aka, recovery key) to be included in PLC creation operation.
   */
  public val recoveryKey: String? = null,
  /**
   * A signed DID PLC operation to be submitted as part of importing an existing account to this
   * instance. NOTE: this optional field may be updated when full account migration is implemented.
   */
  public val plcOp: JsonContent? = null,
)

/**
 * Account login session returned on successful account creation.
 *
 * @param did The DID of the new account.
 * @param didDoc Complete DID document.
 */
@Serializable
public data class CreateAccountResponse(
  public val accessJwt: String,
  public val refreshJwt: String,
  public val handle: Handle,
  /**
   * The DID of the new account.
   */
  public val did: Did,
  /**
   * Complete DID document.
   */
  public val didDoc: JsonContent? = null,
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy