pterowrap
Version:
A node.js wrapper for Pterodactyl API
28 lines (27 loc) • 879 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Allocation {
constructor(_client, data, _node) {
this._client = _client;
this._node = _node;
const attributes = data.attributes;
this.id = attributes.id;
this.ip = attributes.ip;
this.alias = attributes.alias;
this.port = attributes.port;
this.notes = attributes.notes;
this.assigned = attributes.assigned;
this.raw = attributes;
}
delete() {
return new Promise(async (resolve, reject) => {
try {
resolve(await this._client.call({ endpoint: `nodes/${this._node.id}/allocations/${this.id}`, method: "DELETE" }));
}
catch (e) {
reject(e);
}
});
}
}
exports.default = Allocation;