@donation-alerts/api
Version:
Interact with Donation Alerts API.
43 lines (42 loc) • 1.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DonationAlertsCentrifugoChannel = void 0;
const tslib_1 = require("tslib");
const common_1 = require("@donation-alerts/common");
/**
* Represents a Donation Alerts Centrifugo private channel.
*
* @remarks
* This class provides access to a private channel's data, including its name (`channel`)
* and the token required to connect to this channel (`token`).
*/
let DonationAlertsCentrifugoChannel = class DonationAlertsCentrifugoChannel extends common_1.DataObject {
/**
* The private channel name.
*
* @example
* `$alerts:donation_12345`.
*/
get channel() {
return this[common_1.rawDataSymbol].channel;
}
/**
* The Centrifugo connection token.
*
* @remarks
* This token is required to establish a connection to the respective private channel.
*/
get token() {
return this[common_1.rawDataSymbol].token;
}
toJSON() {
return {
channel: this.channel,
token: this.token,
};
}
};
exports.DonationAlertsCentrifugoChannel = DonationAlertsCentrifugoChannel;
exports.DonationAlertsCentrifugoChannel = DonationAlertsCentrifugoChannel = tslib_1.__decorate([
(0, common_1.ReadDocumentation)('api')
], DonationAlertsCentrifugoChannel);