UNPKG

@fnlb-project/fnbr

Version:

A library to interact with Epic Games' Fortnite HTTP and XMPP services

39 lines 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const Endpoints_1 = tslib_1.__importDefault(require("../../../resources/Endpoints")); const PartyInvitationExpiredError_1 = tslib_1.__importDefault(require("../../exceptions/PartyInvitationExpiredError")); const BasePartyInvitation_1 = tslib_1.__importDefault(require("./BasePartyInvitation")); const enums_1 = require("../../../resources/enums"); /** * Represents a sent party invitation */ class SentPartyInvitation extends BasePartyInvitation_1.default { /** * @param client The main client * @param party The party this invitation belongs to * @param sender The friend (or the client user) who sent this invitation * @param receiver The friend (or the client user) who received this invitation * @param data The invitation data */ constructor(client, party, sender, receiver, data) { super(client, party, sender, receiver, data); this.sender = sender; this.receiver = receiver; } /** * Declines this invitation * @throws {PartyInvitationExpiredError} The invitation already got accepted or declined */ async abort() { if (this.isExpired || this.isHandled) throw new PartyInvitationExpiredError_1.default(); await this.client.http.epicgamesRequest({ method: 'DELETE', url: `${Endpoints_1.default.BR_PARTY}/parties/${this.party.id}/invites/${this.receiver.id}`, }, enums_1.AuthSessionStoreKey.Fortnite); this.isHandled = true; } } exports.default = SentPartyInvitation; //# sourceMappingURL=SentPartyInvitation.js.map