. */ namespace SP\Domain\Auth; use Defuse\Crypto\Exception\CryptoException; use Defuse\Crypto\Exception\EnvironmentIsBrokenException; use Exception; use SP\Core\Exceptions\ConstraintException; use SP\Core\Exceptions\QueryException; use SP\Core\Exceptions\SPException; use SP\DataModel\AuthTokenData; use SP\DataModel\ItemSearchData; use SP\Domain\Auth\Services\AuthTokenService; use SP\Domain\Common\Services\ServiceException; use SP\Infrastructure\Common\Repositories\NoSuchItemException; use SP\Infrastructure\Database\QueryResult; /** * Class AuthTokenService * * @package SP\Domain\Common\Services\AuthToken */ interface AuthTokenServiceInterface { /** * @throws ConstraintException * @throws QueryException */ public function search(ItemSearchData $itemSearchData): QueryResult; /** * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException */ public function getById(int $id): AuthTokenData; /** * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException * @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException */ public function delete(int $id): AuthTokenService; /** * Deletes all the items for given ids * * @throws ServiceException * @throws ConstraintException * @throws QueryException */ public function deleteByIdBatch(array $ids): int; /** * @throws SPException * @throws CryptoException * @throws EnvironmentIsBrokenException * @throws ConstraintException * @throws QueryException */ public function create(AuthTokenData $itemData): int; /** * @throws Exception */ public function refreshAndUpdate(AuthTokenData $itemData): void; /** * @throws \Defuse\Crypto\Exception\CryptoException * @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException * @throws \SP\Core\Exceptions\ConstraintException * @throws \SP\Core\Exceptions\QueryException * @throws \SP\Infrastructure\Common\Repositories\DuplicatedItemException * @throws \SP\Infrastructure\Common\Repositories\NoSuchItemException * @throws \SP\Domain\Common\Services\ServiceException */ public function update(AuthTokenData $itemData, ?string $token = null): void; /** * @throws SPException * @throws ConstraintException * @throws QueryException */ public function updateRaw(AuthTokenData $itemData): void; /** * Devolver los datos de un token * * @throws ConstraintException * @throws NoSuchItemException * @throws QueryException */ public function getTokenByToken(int $actionId, string $token); /** * @return AuthTokenData[] * @throws ConstraintException * @throws QueryException */ public function getAllBasic(): array; }