import { SsoService } from "@joonashak/nestjs-eve-auth"; import { Model } from "mongoose"; import { EveAccessToken } from "../../types/eve-access-token.dto"; import { UserCacheService } from "./user-cache.service"; import { User, UserDocument } from "./user.model"; import { UserService } from "./user.service"; export declare class TokenService { private userModel; private userCacheService; private ssoService; private userService; constructor(userModel: Model, userCacheService: UserCacheService, ssoService: SsoService, userService: UserService); findAccessTokensByUserId(userId: string): Promise; findAccessTokenByCharacterId(characterEveId: number): Promise; /** * Get character's access token if given user owns it. * * A safe version of `TokenService.findAccessTokenByCharacterId`. */ findAccessTokenByCharacterIdSafe(characterEveId: number, userId: string): Promise; /** * Refresh SSO tokens for character. * * New tokens are saved after refreshing and the new access token returned. * * _**DANGER**_: * * Note that this function operates solely on the character ID making it * crucial that the calling code ensures safety. Passing user-controlled ID as * the argument and returning the resulting new access code to them will allow * bad actors to impersonate users against ESI API. (Character EVE ID's are * public.) */ refreshToken(characterEveId: number): Promise; /** * Revoke all refresh tokens for user. */ revokeTokens(inputUser: User): Promise; private findUserWithRefreshTokens; private getCharacter; }