UNPKG

@capawesome/cli

Version:

The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.

22 lines (21 loc) 711 B
import httpClient from '../utils/http-client.js'; import authorizationService from '../services/authorization-service.js'; class SessionsServiceImpl { httpClient; constructor(httpClient) { this.httpClient = httpClient; } async create(dto) { const response = await this.httpClient.post(`/v1/sessions`, dto); return response.data; } async delete(dto) { await this.httpClient.delete(`/v1/sessions/${dto.id}`, { headers: { Authorization: `Bearer ${authorizationService.getCurrentAuthorizationToken()}`, }, }); } } const sessionsService = new SessionsServiceImpl(httpClient); export default sessionsService;