UNPKG

@localzet/xtls-sdk

Version:

TypeScript SDK for XRAY/AURA Core

145 lines 7.45 kB
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire'; import { type CallContext, type 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 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 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: {}; }; }; }; 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>>; } 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>; } 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