@localzet/xtls-sdk
Version:
TypeScript SDK for XRAY/AURA Core
1,029 lines (1,028 loc) • 37 kB
JavaScript
;
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.2.7
// protoc v5.28.3
// source: app/proxyman/command/command.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.HandlerServiceDefinition = exports.Config = exports.AlterOutboundResponse = exports.AlterOutboundRequest = exports.RemoveOutboundResponse = exports.RemoveOutboundRequest = exports.AddOutboundResponse = exports.AddOutboundRequest = exports.GetInboundUsersCountResponse = exports.GetInboundUserResponse = exports.GetInboundUserRequest = exports.AlterInboundResponse = exports.AlterInboundRequest = exports.RemoveInboundResponse = exports.RemoveInboundRequest = exports.AddInboundResponse = exports.AddInboundRequest = exports.RemoveUserOperation = exports.AddUserOperation = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const user_1 = require("../../../common/protocol/user");
const typed_message_1 = require("../../../common/serial/typed_message");
const config_1 = require("../../../core/config");
const typeRegistry_1 = require("../../../typeRegistry");
exports.protobufPackage = 'xray.app.proxyman.command';
function createBaseAddUserOperation() {
return { $type: 'xray.app.proxyman.command.AddUserOperation', user: undefined };
}
exports.AddUserOperation = {
$type: 'xray.app.proxyman.command.AddUserOperation',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.user !== undefined) {
user_1.User.encode(message.user, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAddUserOperation();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.user = user_1.User.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { $type: exports.AddUserOperation.$type, user: isSet(object.user) ? user_1.User.fromJSON(object.user) : undefined };
},
toJSON(message) {
const obj = {};
if (message.user !== undefined) {
obj.user = user_1.User.toJSON(message.user);
}
return obj;
},
create(base) {
return exports.AddUserOperation.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddUserOperation();
message.user = (object.user !== undefined && object.user !== null) ? user_1.User.fromPartial(object.user) : undefined;
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.AddUserOperation.$type, exports.AddUserOperation);
function createBaseRemoveUserOperation() {
return { $type: 'xray.app.proxyman.command.RemoveUserOperation', email: '' };
}
exports.RemoveUserOperation = {
$type: 'xray.app.proxyman.command.RemoveUserOperation',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.email !== '') {
writer.uint32(10).string(message.email);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRemoveUserOperation();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.email = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { $type: exports.RemoveUserOperation.$type, email: isSet(object.email) ? globalThis.String(object.email) : '' };
},
toJSON(message) {
const obj = {};
if (message.email !== '') {
obj.email = message.email;
}
return obj;
},
create(base) {
return exports.RemoveUserOperation.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveUserOperation();
message.email = object.email ?? '';
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.RemoveUserOperation.$type, exports.RemoveUserOperation);
function createBaseAddInboundRequest() {
return { $type: 'xray.app.proxyman.command.AddInboundRequest', inbound: undefined };
}
exports.AddInboundRequest = {
$type: 'xray.app.proxyman.command.AddInboundRequest',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.inbound !== undefined) {
config_1.InboundHandlerConfig.encode(message.inbound, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAddInboundRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.inbound = config_1.InboundHandlerConfig.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
$type: exports.AddInboundRequest.$type,
inbound: isSet(object.inbound) ? config_1.InboundHandlerConfig.fromJSON(object.inbound) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.inbound !== undefined) {
obj.inbound = config_1.InboundHandlerConfig.toJSON(message.inbound);
}
return obj;
},
create(base) {
return exports.AddInboundRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddInboundRequest();
message.inbound = (object.inbound !== undefined && object.inbound !== null)
? config_1.InboundHandlerConfig.fromPartial(object.inbound)
: undefined;
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.AddInboundRequest.$type, exports.AddInboundRequest);
function createBaseAddInboundResponse() {
return { $type: 'xray.app.proxyman.command.AddInboundResponse' };
}
exports.AddInboundResponse = {
$type: 'xray.app.proxyman.command.AddInboundResponse',
encode(_, writer = new wire_1.BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAddInboundResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return { $type: exports.AddInboundResponse.$type };
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return exports.AddInboundResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseAddInboundResponse();
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.AddInboundResponse.$type, exports.AddInboundResponse);
function createBaseRemoveInboundRequest() {
return { $type: 'xray.app.proxyman.command.RemoveInboundRequest', tag: '' };
}
exports.RemoveInboundRequest = {
$type: 'xray.app.proxyman.command.RemoveInboundRequest',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.tag !== '') {
writer.uint32(10).string(message.tag);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRemoveInboundRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tag = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { $type: exports.RemoveInboundRequest.$type, tag: isSet(object.tag) ? globalThis.String(object.tag) : '' };
},
toJSON(message) {
const obj = {};
if (message.tag !== '') {
obj.tag = message.tag;
}
return obj;
},
create(base) {
return exports.RemoveInboundRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveInboundRequest();
message.tag = object.tag ?? '';
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.RemoveInboundRequest.$type, exports.RemoveInboundRequest);
function createBaseRemoveInboundResponse() {
return { $type: 'xray.app.proxyman.command.RemoveInboundResponse' };
}
exports.RemoveInboundResponse = {
$type: 'xray.app.proxyman.command.RemoveInboundResponse',
encode(_, writer = new wire_1.BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRemoveInboundResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return { $type: exports.RemoveInboundResponse.$type };
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return exports.RemoveInboundResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseRemoveInboundResponse();
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.RemoveInboundResponse.$type, exports.RemoveInboundResponse);
function createBaseAlterInboundRequest() {
return { $type: 'xray.app.proxyman.command.AlterInboundRequest', tag: '', operation: undefined };
}
exports.AlterInboundRequest = {
$type: 'xray.app.proxyman.command.AlterInboundRequest',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.tag !== '') {
writer.uint32(10).string(message.tag);
}
if (message.operation !== undefined) {
typed_message_1.TypedMessage.encode(message.operation, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAlterInboundRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tag = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.operation = typed_message_1.TypedMessage.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
$type: exports.AlterInboundRequest.$type,
tag: isSet(object.tag) ? globalThis.String(object.tag) : '',
operation: isSet(object.operation) ? typed_message_1.TypedMessage.fromJSON(object.operation) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.tag !== '') {
obj.tag = message.tag;
}
if (message.operation !== undefined) {
obj.operation = typed_message_1.TypedMessage.toJSON(message.operation);
}
return obj;
},
create(base) {
return exports.AlterInboundRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAlterInboundRequest();
message.tag = object.tag ?? '';
message.operation = (object.operation !== undefined && object.operation !== null)
? typed_message_1.TypedMessage.fromPartial(object.operation)
: undefined;
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.AlterInboundRequest.$type, exports.AlterInboundRequest);
function createBaseAlterInboundResponse() {
return { $type: 'xray.app.proxyman.command.AlterInboundResponse' };
}
exports.AlterInboundResponse = {
$type: 'xray.app.proxyman.command.AlterInboundResponse',
encode(_, writer = new wire_1.BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAlterInboundResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return { $type: exports.AlterInboundResponse.$type };
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return exports.AlterInboundResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseAlterInboundResponse();
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.AlterInboundResponse.$type, exports.AlterInboundResponse);
function createBaseGetInboundUserRequest() {
return { $type: 'xray.app.proxyman.command.GetInboundUserRequest', tag: '', email: '' };
}
exports.GetInboundUserRequest = {
$type: 'xray.app.proxyman.command.GetInboundUserRequest',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.tag !== '') {
writer.uint32(10).string(message.tag);
}
if (message.email !== '') {
writer.uint32(18).string(message.email);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetInboundUserRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tag = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.email = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
$type: exports.GetInboundUserRequest.$type,
tag: isSet(object.tag) ? globalThis.String(object.tag) : '',
email: isSet(object.email) ? globalThis.String(object.email) : '',
};
},
toJSON(message) {
const obj = {};
if (message.tag !== '') {
obj.tag = message.tag;
}
if (message.email !== '') {
obj.email = message.email;
}
return obj;
},
create(base) {
return exports.GetInboundUserRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseGetInboundUserRequest();
message.tag = object.tag ?? '';
message.email = object.email ?? '';
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.GetInboundUserRequest.$type, exports.GetInboundUserRequest);
function createBaseGetInboundUserResponse() {
return { $type: 'xray.app.proxyman.command.GetInboundUserResponse', users: [] };
}
exports.GetInboundUserResponse = {
$type: 'xray.app.proxyman.command.GetInboundUserResponse',
encode(message, writer = new wire_1.BinaryWriter()) {
for (const v of message.users) {
user_1.User.encode(v, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetInboundUserResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.users.push(user_1.User.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
$type: exports.GetInboundUserResponse.$type,
users: globalThis.Array.isArray(object?.users) ? object.users.map((e) => user_1.User.fromJSON(e)) : [],
};
},
toJSON(message) {
const obj = {};
if (message.users?.length) {
obj.users = message.users.map((e) => user_1.User.toJSON(e));
}
return obj;
},
create(base) {
return exports.GetInboundUserResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseGetInboundUserResponse();
message.users = object.users?.map((e) => user_1.User.fromPartial(e)) || [];
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.GetInboundUserResponse.$type, exports.GetInboundUserResponse);
function createBaseGetInboundUsersCountResponse() {
return { $type: 'xray.app.proxyman.command.GetInboundUsersCountResponse', count: 0 };
}
exports.GetInboundUsersCountResponse = {
$type: 'xray.app.proxyman.command.GetInboundUsersCountResponse',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.count !== 0) {
writer.uint32(8).int64(message.count);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseGetInboundUsersCountResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.count = longToNumber(reader.int64());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
$type: exports.GetInboundUsersCountResponse.$type,
count: isSet(object.count) ? globalThis.Number(object.count) : 0,
};
},
toJSON(message) {
const obj = {};
if (message.count !== 0) {
obj.count = Math.round(message.count);
}
return obj;
},
create(base) {
return exports.GetInboundUsersCountResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseGetInboundUsersCountResponse();
message.count = object.count ?? 0;
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.GetInboundUsersCountResponse.$type, exports.GetInboundUsersCountResponse);
function createBaseAddOutboundRequest() {
return { $type: 'xray.app.proxyman.command.AddOutboundRequest', outbound: undefined };
}
exports.AddOutboundRequest = {
$type: 'xray.app.proxyman.command.AddOutboundRequest',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.outbound !== undefined) {
config_1.OutboundHandlerConfig.encode(message.outbound, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAddOutboundRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.outbound = config_1.OutboundHandlerConfig.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
$type: exports.AddOutboundRequest.$type,
outbound: isSet(object.outbound) ? config_1.OutboundHandlerConfig.fromJSON(object.outbound) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.outbound !== undefined) {
obj.outbound = config_1.OutboundHandlerConfig.toJSON(message.outbound);
}
return obj;
},
create(base) {
return exports.AddOutboundRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddOutboundRequest();
message.outbound = (object.outbound !== undefined && object.outbound !== null)
? config_1.OutboundHandlerConfig.fromPartial(object.outbound)
: undefined;
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.AddOutboundRequest.$type, exports.AddOutboundRequest);
function createBaseAddOutboundResponse() {
return { $type: 'xray.app.proxyman.command.AddOutboundResponse' };
}
exports.AddOutboundResponse = {
$type: 'xray.app.proxyman.command.AddOutboundResponse',
encode(_, writer = new wire_1.BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAddOutboundResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return { $type: exports.AddOutboundResponse.$type };
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return exports.AddOutboundResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseAddOutboundResponse();
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.AddOutboundResponse.$type, exports.AddOutboundResponse);
function createBaseRemoveOutboundRequest() {
return { $type: 'xray.app.proxyman.command.RemoveOutboundRequest', tag: '' };
}
exports.RemoveOutboundRequest = {
$type: 'xray.app.proxyman.command.RemoveOutboundRequest',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.tag !== '') {
writer.uint32(10).string(message.tag);
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRemoveOutboundRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tag = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { $type: exports.RemoveOutboundRequest.$type, tag: isSet(object.tag) ? globalThis.String(object.tag) : '' };
},
toJSON(message) {
const obj = {};
if (message.tag !== '') {
obj.tag = message.tag;
}
return obj;
},
create(base) {
return exports.RemoveOutboundRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveOutboundRequest();
message.tag = object.tag ?? '';
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.RemoveOutboundRequest.$type, exports.RemoveOutboundRequest);
function createBaseRemoveOutboundResponse() {
return { $type: 'xray.app.proxyman.command.RemoveOutboundResponse' };
}
exports.RemoveOutboundResponse = {
$type: 'xray.app.proxyman.command.RemoveOutboundResponse',
encode(_, writer = new wire_1.BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseRemoveOutboundResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return { $type: exports.RemoveOutboundResponse.$type };
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return exports.RemoveOutboundResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseRemoveOutboundResponse();
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.RemoveOutboundResponse.$type, exports.RemoveOutboundResponse);
function createBaseAlterOutboundRequest() {
return { $type: 'xray.app.proxyman.command.AlterOutboundRequest', tag: '', operation: undefined };
}
exports.AlterOutboundRequest = {
$type: 'xray.app.proxyman.command.AlterOutboundRequest',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.tag !== '') {
writer.uint32(10).string(message.tag);
}
if (message.operation !== undefined) {
typed_message_1.TypedMessage.encode(message.operation, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAlterOutboundRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.tag = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.operation = typed_message_1.TypedMessage.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
$type: exports.AlterOutboundRequest.$type,
tag: isSet(object.tag) ? globalThis.String(object.tag) : '',
operation: isSet(object.operation) ? typed_message_1.TypedMessage.fromJSON(object.operation) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.tag !== '') {
obj.tag = message.tag;
}
if (message.operation !== undefined) {
obj.operation = typed_message_1.TypedMessage.toJSON(message.operation);
}
return obj;
},
create(base) {
return exports.AlterOutboundRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAlterOutboundRequest();
message.tag = object.tag ?? '';
message.operation = (object.operation !== undefined && object.operation !== null)
? typed_message_1.TypedMessage.fromPartial(object.operation)
: undefined;
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.AlterOutboundRequest.$type, exports.AlterOutboundRequest);
function createBaseAlterOutboundResponse() {
return { $type: 'xray.app.proxyman.command.AlterOutboundResponse' };
}
exports.AlterOutboundResponse = {
$type: 'xray.app.proxyman.command.AlterOutboundResponse',
encode(_, writer = new wire_1.BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseAlterOutboundResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return { $type: exports.AlterOutboundResponse.$type };
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return exports.AlterOutboundResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseAlterOutboundResponse();
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.AlterOutboundResponse.$type, exports.AlterOutboundResponse);
function createBaseConfig() {
return { $type: 'xray.app.proxyman.command.Config' };
}
exports.Config = {
$type: 'xray.app.proxyman.command.Config',
encode(_, writer = new wire_1.BinaryWriter()) {
return writer;
},
decode(input, length) {
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseConfig();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(_) {
return { $type: exports.Config.$type };
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return exports.Config.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseConfig();
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
exports.HandlerServiceDefinition = {
name: 'HandlerService',
fullName: 'xray.app.proxyman.command.HandlerService',
methods: {
addInbound: {
name: 'AddInbound',
requestType: exports.AddInboundRequest,
requestStream: false,
responseType: exports.AddInboundResponse,
responseStream: false,
options: {},
},
removeInbound: {
name: 'RemoveInbound',
requestType: exports.RemoveInboundRequest,
requestStream: false,
responseType: exports.RemoveInboundResponse,
responseStream: false,
options: {},
},
alterInbound: {
name: 'AlterInbound',
requestType: exports.AlterInboundRequest,
requestStream: false,
responseType: exports.AlterInboundResponse,
responseStream: false,
options: {},
},
getInboundUsers: {
name: 'GetInboundUsers',
requestType: exports.GetInboundUserRequest,
requestStream: false,
responseType: exports.GetInboundUserResponse,
responseStream: false,
options: {},
},
getInboundUsersCount: {
name: 'GetInboundUsersCount',
requestType: exports.GetInboundUserRequest,
requestStream: false,
responseType: exports.GetInboundUsersCountResponse,
responseStream: false,
options: {},
},
addOutbound: {
name: 'AddOutbound',
requestType: exports.AddOutboundRequest,
requestStream: false,
responseType: exports.AddOutboundResponse,
responseStream: false,
options: {},
},
removeOutbound: {
name: 'RemoveOutbound',
requestType: exports.RemoveOutboundRequest,
requestStream: false,
responseType: exports.RemoveOutboundResponse,
responseStream: false,
options: {},
},
alterOutbound: {
name: 'AlterOutbound',
requestType: exports.AlterOutboundRequest,
requestStream: false,
responseType: exports.AlterOutboundResponse,
responseStream: false,
options: {},
},
},
};
function longToNumber(int64) {
const num = globalThis.Number(int64.toString());
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
throw new globalThis.Error('Value is larger than Number.MAX_SAFE_INTEGER');
}
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
throw new globalThis.Error('Value is smaller than Number.MIN_SAFE_INTEGER');
}
return num;
}
function isSet(value) {
return value !== null && value !== undefined;
}