fnbr
Version:
A library to interact with Epic Games' Fortnite HTTP and XMPP services
37 lines • 1.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const Base_1 = tslib_1.__importDefault(require("../Base"));
/**
* Represents an Epicgames server status
*/
class EpicgamesServerStatusComponent extends Base_1.default {
/**
* @param client The main client
* @param data The server status component data
* @param components The server status components
*/
constructor(client, data, components) {
var _a, _b, _c;
super(client);
this.id = data.id;
this.name = data.name;
this.status = data.status;
this.createdAt = new Date(data.created_at);
this.updatedAt = new Date(data.updated_at);
this.position = (_a = data.position) !== null && _a !== void 0 ? _a : undefined;
this.description = (_b = data.description) !== null && _b !== void 0 ? _b : undefined;
this.isShowcase = !!data.showcase;
this.startDate = data.start_date ? new Date(data.start_date) : undefined;
this.groupId = (_c = data.group_id) !== null && _c !== void 0 ? _c : undefined;
this.isGroup = !!data.group;
this.onlyShowIfDegraded = !!data.only_show_if_degraded;
if (data.components) {
this.components = components
.filter((c) => data.components.includes(c.id))
.map((c) => new EpicgamesServerStatusComponent(client, c, components));
}
}
}
exports.default = EpicgamesServerStatusComponent;
//# sourceMappingURL=EpicgamesServerStatusComponent.js.map