UNPKG

@donation-alerts/api

Version:
83 lines (82 loc) 2.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DonationAlertsUser = void 0; const tslib_1 = require("tslib"); const common_1 = require("@donation-alerts/common"); /** * Represents user profile information. * * @remarks * This class provides access to user-related profile data, including unique identifiers, * display names, email addresses, and authentication tokens for Centrifugo connections. */ let DonationAlertsUser = class DonationAlertsUser extends common_1.DataObject { /** * The unique and unchangeable user identifier. * * @returns The user ID as a number. */ get id() { return this[common_1.rawDataSymbol].id; } /** * The unique textual code (username) for the user. * * @returns The user's unique code as a string. */ get code() { return this[common_1.rawDataSymbol].code; } /** * The unique displayed username. * * @remarks * This name is used for display purposes on the platform and can be updated by the user. * * @returns The display name as a string. */ get name() { return this[common_1.rawDataSymbol].name; } /** * The URL to the personal profile picture. * * @returns The URL to the user's avatar as a string. */ get avatar() { return this[common_1.rawDataSymbol].avatar; } /** * The email associated with the user's account. * * @returns The user's email as a string. */ get email() { return this[common_1.rawDataSymbol].email; } /** * Centrifugo connection token. * * @remarks * A token issued to the user for establishing websocket connections via Centrifugo. * * @returns The Centrifugo connection token as a string. */ get socketConnectionToken() { return this[common_1.rawDataSymbol].socket_connection_token; } toJSON() { return { id: this.id, code: this.code, name: this.name, avatar: this.avatar, email: this.email, socketConnectionToken: this.socketConnectionToken, }; } }; exports.DonationAlertsUser = DonationAlertsUser; exports.DonationAlertsUser = DonationAlertsUser = tslib_1.__decorate([ (0, common_1.ReadDocumentation)('api') ], DonationAlertsUser);