UNPKG

tempnumber-client

Version:

temp-number.org SMS Typescript client

26 lines (25 loc) 771 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.User = void 0; const base_1 = require("../base"); class User extends base_1.Base { async getBalance() { const response = await this.apiCall('/user/balance'); return response.data; } async getApiKey() { const response = await this.apiCall('/user/apikey'); if (!response.data.key) { throw new Error('No API key found'); } return response.data.key; } async changeApiKey() { const response = await this.apiCall('/user/apikey', undefined, 'put'); if (!response.data.key) { throw new Error('No API key found'); } return response.data.key; } } exports.User = User;