/**
 * Errors that can be thrown by the TokenManager
 */
export enum TokenManagerError {
  INITIALIZE_ERROR = 'INITIALIZE_ERROR',
  TOKENS_NOT_FOUND = 'TOKENS_NOT_FOUND',
  TOKEN_NOT_VALID = 'TOKEN_NOT_VALID',
  REFRESH_TOKEN_EXPIRED = 'REFRESH_TOKEN_EXPIRED',
  REFRESH_TOKEN_NOT_VALID = 'REFRESH_TOKEN_NOT_VALID',
  REFRESH_TOKEN_FAILED = 'REFRESH_TOKEN_FAILED',
}

export enum TokenManagerStatus {
  /**
   * The token manager is not initialized or it is getting tokens from storage
   */
  UNINITIALIZED = 'UNINITIALIZED',

  /**
   * The token manager is not authenticated. It means that the tokens are not found in the storage or they were removed
   */
  UNAUTHENTICATED = 'UNAUTHENTICATED',

  /**
   * The token manager is authenticated, but it could be invalid (expired)
   */
  AUTHENTICATED = 'AUTHENTICATED',

  /**
   * The token manager is refreshing the access token.
   * It will retry to refresh the token until it succeeds or the refresh token is no longer valid
   */
  REFRESHING = 'REFRESHING',
}
