pterowrap
Version:
A node.js wrapper for Pterodactyl API
26 lines (25 loc) • 857 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class APIKey {
constructor(_client, data) {
this._client = _client;
const attributes = data.attributes;
this.identifier = attributes.identifier;
this.description = attributes.description;
this.allowed_ips = attributes.allowed_ips;
this.last_used_at = attributes.last_used_at;
this.created_at = attributes.created_at;
this.raw = attributes;
}
async delete() {
return new Promise(async (resolve, reject) => {
try {
resolve(await this._client.call({ endpoint: `account/api-keys/${this.identifier}`, method: "DELETE" }));
}
catch (e) {
reject(e);
}
});
}
}
exports.default = APIKey;