@remnawave/xtls-sdk
Version:
A Typescript SDK for XRAY (XTLS) Core GRPC Api
50 lines • 1.59 kB
TypeScript
import { GetUsersStatsResponse } from '../../../xray-protos/app/stats/command/command';
export interface UserIPEntry {
ip: string;
lastSeen: Date;
}
export interface UserTrafficStat {
uplink: number;
downlink: number;
}
export interface UserStat {
/**
* User identifier. Maps to the `email` field from Xray core.
*/
userId: string;
ips: UserIPEntry[];
traffic?: UserTrafficStat;
}
/**
* Model class for handling user statistics response data from the Xray server.
*/
export declare class GetUsersStatsResponseModel {
/**
* The user statistics data, or null if no data is available.
*/
users: UserStat[] | null;
/**
* Creates a new GetUserStatsResponseModel instance.
*
* @param data - The raw query stats response from the Xray server
*/
constructor(data: GetUsersStatsResponse);
/**
* Creates a model instance from an already-parsed array of user stats,
* bypassing the native `GetUsersStatsResponse` parser.
*
* Intended for code paths that build `UserStat[]` from other sources
* (e.g. the legacy fallback that combines `GetAllOnlineUsers` and
* `GetStatsOnlineIpList`).
*/
static fromUserStats(users: UserStat[]): GetUsersStatsResponseModel;
/**
* Parses the raw stats response data into formatted user statistics.
*
* @param data - The raw query stats response to parse
* @returns An array of formatted user statistics
* @private
*/
private parseData;
}
//# sourceMappingURL=get-users-stats.response.model.d.ts.map