{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../../src/sdk/authentication-jwt-bearer/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB;+DAC2D;IAC3D,uBAAW,CAAA;IAEX,2BAA2B;IAC3B,yBAAa,CAAA;AACf,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB","sourcesContent":["import type { Env, Platform } from '../../shared/env';\n\nexport enum AuthType {\n  /* sign in using a private key derived from your secret recovery phrase (SRP).\n       Uses message signing snap to perform this operation */\n  SRP = 'SRP',\n\n  /* sign in with Ethereum */\n  SiWE = 'SiWE',\n}\n\nexport type AuthConfig = {\n  env: Env;\n  platform: Platform;\n  type: AuthType;\n};\n\nexport type AccessToken = {\n  /**\n   * The JWT Access Token\n   */\n  accessToken: string;\n  /**\n   * Expiration in seconds\n   */\n  expiresIn: number;\n  /**\n   * Date in milliseconds\n   */\n  obtainedAt: number;\n};\n\nexport type UserProfile = {\n  /**\n   * The \"Identifier\" used to log in with.\n   */\n  identifierId: string;\n  /**\n   * The Unique profile for a logged in user. A Profile can be logged in via multiple Identifiers\n   */\n  profileId: string;\n  /**\n   * Server MetaMetrics ID. Allows grouping of user events cross platform.\n   */\n  metaMetricsId: string;\n};\n\nexport type LoginResponse = {\n  token: AccessToken;\n  profile: UserProfile;\n};\n\nexport type IBaseAuth = {\n  // TODO: figure out if these need the entropy source id param or if that can be abstracted on another layer\n  getAccessToken: (entropySourceId?: string) => Promise<string>;\n  getUserProfile: (entropySourceId?: string) => Promise<UserProfile>;\n  getIdentifier: (entropySourceId?: string) => Promise<string>;\n  signMessage: (message: string, entropySourceId?: string) => Promise<string>;\n};\n\nexport type AuthStorageOptions = {\n  // TODO: figure out if these need the entropy source id param or if that can be abstracted on another layer\n  getLoginResponse: (entropySourceId?: string) => Promise<LoginResponse | null>;\n  setLoginResponse: (\n    val: LoginResponse,\n    entropySourceId?: string,\n  ) => Promise<void>;\n};\n\nexport type AuthSigningOptions = {\n  // TODO: figure out if these need the entropy source id param or if that can be abstracted on another layer\n  signMessage: (message: string, entropySourceId?: string) => Promise<string>;\n  getIdentifier: (entropySourceId?: string) => Promise<string>;\n};\n\nexport type ErrorMessage = {\n  message: string;\n  error: string;\n};\n\nexport type Pair = {\n  identifier: string;\n  encryptedStorageKey: string;\n  identifierType: 'SIWE' | 'SRP';\n  signMessage: (message: string) => Promise<string>;\n};\n\nexport type UserProfileLineage = {\n  profile_id: string;\n  created_at: string;\n  lineage: {\n    metametrics_id: string;\n    agent: Platform;\n    created_at: string;\n    updated_at: string;\n    counter: number;\n  }[];\n};\n"]}