UNPKG

@remnawave/xtls-sdk

Version:

A Typescript SDK for XRAY (XTLS) Core GRPC Api

204 lines 10.7 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import type { CallContext, CallOptions } from "nice-grpc-common"; export declare const protobufPackage = "xray.app.stats.command"; export interface GetStatsRequest { $type: "xray.app.stats.command.GetStatsRequest"; /** Name of the stat counter. */ name: string; /** Whether or not to reset the counter to fetching its value. */ reset: boolean; } export interface Stat { $type: "xray.app.stats.command.Stat"; name: string; value: number; } export interface GetStatsResponse { $type: "xray.app.stats.command.GetStatsResponse"; stat: Stat | undefined; } export interface QueryStatsRequest { $type: "xray.app.stats.command.QueryStatsRequest"; pattern: string; reset: boolean; } export interface QueryStatsResponse { $type: "xray.app.stats.command.QueryStatsResponse"; stat: Stat[]; } export interface SysStatsRequest { $type: "xray.app.stats.command.SysStatsRequest"; } export interface SysStatsResponse { $type: "xray.app.stats.command.SysStatsResponse"; NumGoroutine: number; NumGC: number; Alloc: number; TotalAlloc: number; Sys: number; Mallocs: number; Frees: number; LiveObjects: number; PauseTotalNs: number; Uptime: number; } export interface GetStatsOnlineIpListResponse { $type: "xray.app.stats.command.GetStatsOnlineIpListResponse"; name: string; ips: { [key: string]: number; }; } export interface GetStatsOnlineIpListResponse_IpsEntry { $type: "xray.app.stats.command.GetStatsOnlineIpListResponse.IpsEntry"; key: string; value: number; } export interface GetAllOnlineUsersRequest { $type: "xray.app.stats.command.GetAllOnlineUsersRequest"; } export interface GetAllOnlineUsersResponse { $type: "xray.app.stats.command.GetAllOnlineUsersResponse"; users: string[]; } export interface OnlineIPEntry { $type: "xray.app.stats.command.OnlineIPEntry"; ip: string; lastSeen: number; } export interface TrafficUserStat { $type: "xray.app.stats.command.TrafficUserStat"; uplink: number; downlink: number; } export interface UserStat { $type: "xray.app.stats.command.UserStat"; email: string; ips: OnlineIPEntry[]; traffic: TrafficUserStat | undefined; } export interface GetUsersStatsRequest { $type: "xray.app.stats.command.GetUsersStatsRequest"; includeTraffic: boolean; reset: boolean; } export interface GetUsersStatsResponse { $type: "xray.app.stats.command.GetUsersStatsResponse"; users: UserStat[]; } export interface Config { $type: "xray.app.stats.command.Config"; } export declare const GetStatsRequest: MessageFns<GetStatsRequest, "xray.app.stats.command.GetStatsRequest">; export declare const Stat: MessageFns<Stat, "xray.app.stats.command.Stat">; export declare const GetStatsResponse: MessageFns<GetStatsResponse, "xray.app.stats.command.GetStatsResponse">; export declare const QueryStatsRequest: MessageFns<QueryStatsRequest, "xray.app.stats.command.QueryStatsRequest">; export declare const QueryStatsResponse: MessageFns<QueryStatsResponse, "xray.app.stats.command.QueryStatsResponse">; export declare const SysStatsRequest: MessageFns<SysStatsRequest, "xray.app.stats.command.SysStatsRequest">; export declare const SysStatsResponse: MessageFns<SysStatsResponse, "xray.app.stats.command.SysStatsResponse">; export declare const GetStatsOnlineIpListResponse: MessageFns<GetStatsOnlineIpListResponse, "xray.app.stats.command.GetStatsOnlineIpListResponse">; export declare const GetStatsOnlineIpListResponse_IpsEntry: MessageFns<GetStatsOnlineIpListResponse_IpsEntry, "xray.app.stats.command.GetStatsOnlineIpListResponse.IpsEntry">; export declare const GetAllOnlineUsersRequest: MessageFns<GetAllOnlineUsersRequest, "xray.app.stats.command.GetAllOnlineUsersRequest">; export declare const GetAllOnlineUsersResponse: MessageFns<GetAllOnlineUsersResponse, "xray.app.stats.command.GetAllOnlineUsersResponse">; export declare const OnlineIPEntry: MessageFns<OnlineIPEntry, "xray.app.stats.command.OnlineIPEntry">; export declare const TrafficUserStat: MessageFns<TrafficUserStat, "xray.app.stats.command.TrafficUserStat">; export declare const UserStat: MessageFns<UserStat, "xray.app.stats.command.UserStat">; export declare const GetUsersStatsRequest: MessageFns<GetUsersStatsRequest, "xray.app.stats.command.GetUsersStatsRequest">; export declare const GetUsersStatsResponse: MessageFns<GetUsersStatsResponse, "xray.app.stats.command.GetUsersStatsResponse">; export declare const Config: MessageFns<Config, "xray.app.stats.command.Config">; export type StatsServiceDefinition = typeof StatsServiceDefinition; export declare const StatsServiceDefinition: { readonly name: "StatsService"; readonly fullName: "xray.app.stats.command.StatsService"; readonly methods: { readonly getStats: { readonly name: "GetStats"; readonly requestType: MessageFns<GetStatsRequest, "xray.app.stats.command.GetStatsRequest">; readonly requestStream: false; readonly responseType: MessageFns<GetStatsResponse, "xray.app.stats.command.GetStatsResponse">; readonly responseStream: false; readonly options: {}; }; readonly getStatsOnline: { readonly name: "GetStatsOnline"; readonly requestType: MessageFns<GetStatsRequest, "xray.app.stats.command.GetStatsRequest">; readonly requestStream: false; readonly responseType: MessageFns<GetStatsResponse, "xray.app.stats.command.GetStatsResponse">; readonly responseStream: false; readonly options: {}; }; readonly queryStats: { readonly name: "QueryStats"; readonly requestType: MessageFns<QueryStatsRequest, "xray.app.stats.command.QueryStatsRequest">; readonly requestStream: false; readonly responseType: MessageFns<QueryStatsResponse, "xray.app.stats.command.QueryStatsResponse">; readonly responseStream: false; readonly options: {}; }; readonly getSysStats: { readonly name: "GetSysStats"; readonly requestType: MessageFns<SysStatsRequest, "xray.app.stats.command.SysStatsRequest">; readonly requestStream: false; readonly responseType: MessageFns<SysStatsResponse, "xray.app.stats.command.SysStatsResponse">; readonly responseStream: false; readonly options: {}; }; readonly getStatsOnlineIpList: { readonly name: "GetStatsOnlineIpList"; readonly requestType: MessageFns<GetStatsRequest, "xray.app.stats.command.GetStatsRequest">; readonly requestStream: false; readonly responseType: MessageFns<GetStatsOnlineIpListResponse, "xray.app.stats.command.GetStatsOnlineIpListResponse">; readonly responseStream: false; readonly options: {}; }; readonly getAllOnlineUsers: { readonly name: "GetAllOnlineUsers"; readonly requestType: MessageFns<GetAllOnlineUsersRequest, "xray.app.stats.command.GetAllOnlineUsersRequest">; readonly requestStream: false; readonly responseType: MessageFns<GetAllOnlineUsersResponse, "xray.app.stats.command.GetAllOnlineUsersResponse">; readonly responseStream: false; readonly options: {}; }; readonly getUsersStats: { readonly name: "GetUsersStats"; readonly requestType: MessageFns<GetUsersStatsRequest, "xray.app.stats.command.GetUsersStatsRequest">; readonly requestStream: false; readonly responseType: MessageFns<GetUsersStatsResponse, "xray.app.stats.command.GetUsersStatsResponse">; readonly responseStream: false; readonly options: {}; }; }; }; export interface StatsServiceImplementation<CallContextExt = {}> { getStats(request: GetStatsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetStatsResponse>>; getStatsOnline(request: GetStatsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetStatsResponse>>; queryStats(request: QueryStatsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<QueryStatsResponse>>; getSysStats(request: SysStatsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<SysStatsResponse>>; getStatsOnlineIpList(request: GetStatsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetStatsOnlineIpListResponse>>; getAllOnlineUsers(request: GetAllOnlineUsersRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetAllOnlineUsersResponse>>; getUsersStats(request: GetUsersStatsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetUsersStatsResponse>>; } export interface StatsServiceClient<CallOptionsExt = {}> { getStats(request: DeepPartial<GetStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetStatsResponse>; getStatsOnline(request: DeepPartial<GetStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetStatsResponse>; queryStats(request: DeepPartial<QueryStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<QueryStatsResponse>; getSysStats(request: DeepPartial<SysStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<SysStatsResponse>; getStatsOnlineIpList(request: DeepPartial<GetStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetStatsOnlineIpListResponse>; getAllOnlineUsers(request: DeepPartial<GetAllOnlineUsersRequest>, options?: CallOptions & CallOptionsExt): Promise<GetAllOnlineUsersResponse>; getUsersStats(request: DeepPartial<GetUsersStatsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetUsersStatsResponse>; } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? { [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>; } : Partial<T>; export interface MessageFns<T, V extends string> { readonly $type: V; encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial<T>): T; fromPartial(object: DeepPartial<T>): T; } export {}; //# sourceMappingURL=command.d.ts.map