@remnawave/xtls-sdk
Version:
A Typescript SDK for XRAY (XTLS) Core GRPC Api
198 lines • 11.8 kB
TypeScript
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import { type CallContext, type CallOptions } from "nice-grpc-common";
import { User } from "../../../common/protocol/user";
import { TypedMessage } from "../../../common/serial/typed_message";
import { InboundHandlerConfig, OutboundHandlerConfig } from "../../../core/config";
export declare const protobufPackage = "xray.app.proxyman.command";
export interface AddUserOperation {
$type: "xray.app.proxyman.command.AddUserOperation";
user: User | undefined;
}
export interface RemoveUserOperation {
$type: "xray.app.proxyman.command.RemoveUserOperation";
email: string;
}
export interface AddInboundRequest {
$type: "xray.app.proxyman.command.AddInboundRequest";
inbound: InboundHandlerConfig | undefined;
}
export interface AddInboundResponse {
$type: "xray.app.proxyman.command.AddInboundResponse";
}
export interface RemoveInboundRequest {
$type: "xray.app.proxyman.command.RemoveInboundRequest";
tag: string;
}
export interface RemoveInboundResponse {
$type: "xray.app.proxyman.command.RemoveInboundResponse";
}
export interface AlterInboundRequest {
$type: "xray.app.proxyman.command.AlterInboundRequest";
tag: string;
operation: TypedMessage | undefined;
}
export interface AlterInboundResponse {
$type: "xray.app.proxyman.command.AlterInboundResponse";
}
export interface GetInboundUserRequest {
$type: "xray.app.proxyman.command.GetInboundUserRequest";
tag: string;
email: string;
}
export interface GetInboundUserResponse {
$type: "xray.app.proxyman.command.GetInboundUserResponse";
users: User[];
}
export interface GetInboundUsersCountResponse {
$type: "xray.app.proxyman.command.GetInboundUsersCountResponse";
count: number;
}
export interface AddOutboundRequest {
$type: "xray.app.proxyman.command.AddOutboundRequest";
outbound: OutboundHandlerConfig | undefined;
}
export interface AddOutboundResponse {
$type: "xray.app.proxyman.command.AddOutboundResponse";
}
export interface RemoveOutboundRequest {
$type: "xray.app.proxyman.command.RemoveOutboundRequest";
tag: string;
}
export interface RemoveOutboundResponse {
$type: "xray.app.proxyman.command.RemoveOutboundResponse";
}
export interface AlterOutboundRequest {
$type: "xray.app.proxyman.command.AlterOutboundRequest";
tag: string;
operation: TypedMessage | undefined;
}
export interface AlterOutboundResponse {
$type: "xray.app.proxyman.command.AlterOutboundResponse";
}
export interface Config {
$type: "xray.app.proxyman.command.Config";
}
export declare const AddUserOperation: MessageFns<AddUserOperation, "xray.app.proxyman.command.AddUserOperation">;
export declare const RemoveUserOperation: MessageFns<RemoveUserOperation, "xray.app.proxyman.command.RemoveUserOperation">;
export declare const AddInboundRequest: MessageFns<AddInboundRequest, "xray.app.proxyman.command.AddInboundRequest">;
export declare const AddInboundResponse: MessageFns<AddInboundResponse, "xray.app.proxyman.command.AddInboundResponse">;
export declare const RemoveInboundRequest: MessageFns<RemoveInboundRequest, "xray.app.proxyman.command.RemoveInboundRequest">;
export declare const RemoveInboundResponse: MessageFns<RemoveInboundResponse, "xray.app.proxyman.command.RemoveInboundResponse">;
export declare const AlterInboundRequest: MessageFns<AlterInboundRequest, "xray.app.proxyman.command.AlterInboundRequest">;
export declare const AlterInboundResponse: MessageFns<AlterInboundResponse, "xray.app.proxyman.command.AlterInboundResponse">;
export declare const GetInboundUserRequest: MessageFns<GetInboundUserRequest, "xray.app.proxyman.command.GetInboundUserRequest">;
export declare const GetInboundUserResponse: MessageFns<GetInboundUserResponse, "xray.app.proxyman.command.GetInboundUserResponse">;
export declare const GetInboundUsersCountResponse: MessageFns<GetInboundUsersCountResponse, "xray.app.proxyman.command.GetInboundUsersCountResponse">;
export declare const AddOutboundRequest: MessageFns<AddOutboundRequest, "xray.app.proxyman.command.AddOutboundRequest">;
export declare const AddOutboundResponse: MessageFns<AddOutboundResponse, "xray.app.proxyman.command.AddOutboundResponse">;
export declare const RemoveOutboundRequest: MessageFns<RemoveOutboundRequest, "xray.app.proxyman.command.RemoveOutboundRequest">;
export declare const RemoveOutboundResponse: MessageFns<RemoveOutboundResponse, "xray.app.proxyman.command.RemoveOutboundResponse">;
export declare const AlterOutboundRequest: MessageFns<AlterOutboundRequest, "xray.app.proxyman.command.AlterOutboundRequest">;
export declare const AlterOutboundResponse: MessageFns<AlterOutboundResponse, "xray.app.proxyman.command.AlterOutboundResponse">;
export declare const Config: MessageFns<Config, "xray.app.proxyman.command.Config">;
export type HandlerServiceDefinition = typeof HandlerServiceDefinition;
export declare const HandlerServiceDefinition: {
readonly name: "HandlerService";
readonly fullName: "xray.app.proxyman.command.HandlerService";
readonly methods: {
readonly addInbound: {
readonly name: "AddInbound";
readonly requestType: MessageFns<AddInboundRequest, "xray.app.proxyman.command.AddInboundRequest">;
readonly requestStream: false;
readonly responseType: MessageFns<AddInboundResponse, "xray.app.proxyman.command.AddInboundResponse">;
readonly responseStream: false;
readonly options: {};
};
readonly removeInbound: {
readonly name: "RemoveInbound";
readonly requestType: MessageFns<RemoveInboundRequest, "xray.app.proxyman.command.RemoveInboundRequest">;
readonly requestStream: false;
readonly responseType: MessageFns<RemoveInboundResponse, "xray.app.proxyman.command.RemoveInboundResponse">;
readonly responseStream: false;
readonly options: {};
};
readonly alterInbound: {
readonly name: "AlterInbound";
readonly requestType: MessageFns<AlterInboundRequest, "xray.app.proxyman.command.AlterInboundRequest">;
readonly requestStream: false;
readonly responseType: MessageFns<AlterInboundResponse, "xray.app.proxyman.command.AlterInboundResponse">;
readonly responseStream: false;
readonly options: {};
};
readonly getInboundUsers: {
readonly name: "GetInboundUsers";
readonly requestType: MessageFns<GetInboundUserRequest, "xray.app.proxyman.command.GetInboundUserRequest">;
readonly requestStream: false;
readonly responseType: MessageFns<GetInboundUserResponse, "xray.app.proxyman.command.GetInboundUserResponse">;
readonly responseStream: false;
readonly options: {};
};
readonly getInboundUsersCount: {
readonly name: "GetInboundUsersCount";
readonly requestType: MessageFns<GetInboundUserRequest, "xray.app.proxyman.command.GetInboundUserRequest">;
readonly requestStream: false;
readonly responseType: MessageFns<GetInboundUsersCountResponse, "xray.app.proxyman.command.GetInboundUsersCountResponse">;
readonly responseStream: false;
readonly options: {};
};
readonly addOutbound: {
readonly name: "AddOutbound";
readonly requestType: MessageFns<AddOutboundRequest, "xray.app.proxyman.command.AddOutboundRequest">;
readonly requestStream: false;
readonly responseType: MessageFns<AddOutboundResponse, "xray.app.proxyman.command.AddOutboundResponse">;
readonly responseStream: false;
readonly options: {};
};
readonly removeOutbound: {
readonly name: "RemoveOutbound";
readonly requestType: MessageFns<RemoveOutboundRequest, "xray.app.proxyman.command.RemoveOutboundRequest">;
readonly requestStream: false;
readonly responseType: MessageFns<RemoveOutboundResponse, "xray.app.proxyman.command.RemoveOutboundResponse">;
readonly responseStream: false;
readonly options: {};
};
readonly alterOutbound: {
readonly name: "AlterOutbound";
readonly requestType: MessageFns<AlterOutboundRequest, "xray.app.proxyman.command.AlterOutboundRequest">;
readonly requestStream: false;
readonly responseType: MessageFns<AlterOutboundResponse, "xray.app.proxyman.command.AlterOutboundResponse">;
readonly responseStream: false;
readonly options: {};
};
};
};
export interface HandlerServiceImplementation<CallContextExt = {}> {
addInbound(request: AddInboundRequest, context: CallContext & CallContextExt): Promise<DeepPartial<AddInboundResponse>>;
removeInbound(request: RemoveInboundRequest, context: CallContext & CallContextExt): Promise<DeepPartial<RemoveInboundResponse>>;
alterInbound(request: AlterInboundRequest, context: CallContext & CallContextExt): Promise<DeepPartial<AlterInboundResponse>>;
getInboundUsers(request: GetInboundUserRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetInboundUserResponse>>;
getInboundUsersCount(request: GetInboundUserRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetInboundUsersCountResponse>>;
addOutbound(request: AddOutboundRequest, context: CallContext & CallContextExt): Promise<DeepPartial<AddOutboundResponse>>;
removeOutbound(request: RemoveOutboundRequest, context: CallContext & CallContextExt): Promise<DeepPartial<RemoveOutboundResponse>>;
alterOutbound(request: AlterOutboundRequest, context: CallContext & CallContextExt): Promise<DeepPartial<AlterOutboundResponse>>;
}
export interface HandlerServiceClient<CallOptionsExt = {}> {
addInbound(request: DeepPartial<AddInboundRequest>, options?: CallOptions & CallOptionsExt): Promise<AddInboundResponse>;
removeInbound(request: DeepPartial<RemoveInboundRequest>, options?: CallOptions & CallOptionsExt): Promise<RemoveInboundResponse>;
alterInbound(request: DeepPartial<AlterInboundRequest>, options?: CallOptions & CallOptionsExt): Promise<AlterInboundResponse>;
getInboundUsers(request: DeepPartial<GetInboundUserRequest>, options?: CallOptions & CallOptionsExt): Promise<GetInboundUserResponse>;
getInboundUsersCount(request: DeepPartial<GetInboundUserRequest>, options?: CallOptions & CallOptionsExt): Promise<GetInboundUsersCountResponse>;
addOutbound(request: DeepPartial<AddOutboundRequest>, options?: CallOptions & CallOptionsExt): Promise<AddOutboundResponse>;
removeOutbound(request: DeepPartial<RemoveOutboundRequest>, options?: CallOptions & CallOptionsExt): Promise<RemoveOutboundResponse>;
alterOutbound(request: DeepPartial<AlterOutboundRequest>, options?: CallOptions & CallOptionsExt): Promise<AlterOutboundResponse>;
}
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