| 14 | } from '../src'; |
| 15 | |
| 16 | class MemoryTokenStorage implements TokenStorage { |
| 17 | readonly tokens = new Map<string, TokenInfo>(); |
| 18 | |
| 19 | async load(name: string): Promise<TokenInfo | undefined> { |
| 20 | return this.tokens.get(name); |
| 21 | } |
| 22 | |
| 23 | async save(name: string, token: TokenInfo): Promise<void> { |
| 24 | this.tokens.set(name, token); |
| 25 | } |
| 26 | |
| 27 | async remove(name: string): Promise<void> { |
| 28 | this.tokens.delete(name); |
| 29 | } |
| 30 | |
| 31 | async list(): Promise<string[]> { |
| 32 | return [...this.tokens.keys()]; |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | function token(accessToken: string): TokenInfo { |
| 37 | return { |
nothing calls this directly
no outgoing calls
no test coverage detected