@localzet/xtls-sdk
Version:
TypeScript SDK for XRAY/AURA Core
153 lines (152 loc) • 5.19 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: proxy/blackhole/config.proto
Object.defineProperty(exports, "__esModule", { value: true });
exports.Config = exports.HTTPResponse = exports.NoneResponse = exports.protobufPackage = void 0;
/* eslint-disable */
const wire_1 = require("@bufbuild/protobuf/wire");
const typed_message_1 = require("../../common/serial/typed_message");
const typeRegistry_1 = require("../../typeRegistry");
exports.protobufPackage = 'xray.proxy.blackhole';
function createBaseNoneResponse() {
return { $type: 'xray.proxy.blackhole.NoneResponse' };
}
exports.NoneResponse = {
$type: 'xray.proxy.blackhole.NoneResponse',
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 = createBaseNoneResponse();
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.NoneResponse.$type };
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return exports.NoneResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseNoneResponse();
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.NoneResponse.$type, exports.NoneResponse);
function createBaseHTTPResponse() {
return { $type: 'xray.proxy.blackhole.HTTPResponse' };
}
exports.HTTPResponse = {
$type: 'xray.proxy.blackhole.HTTPResponse',
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 = createBaseHTTPResponse();
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.HTTPResponse.$type };
},
toJSON(_) {
const obj = {};
return obj;
},
create(base) {
return exports.HTTPResponse.fromPartial(base ?? {});
},
fromPartial(_) {
const message = createBaseHTTPResponse();
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.HTTPResponse.$type, exports.HTTPResponse);
function createBaseConfig() {
return { $type: 'xray.proxy.blackhole.Config', response: undefined };
}
exports.Config = {
$type: 'xray.proxy.blackhole.Config',
encode(message, writer = new wire_1.BinaryWriter()) {
if (message.response !== undefined) {
typed_message_1.TypedMessage.encode(message.response, 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 = createBaseConfig();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.response = 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.Config.$type,
response: isSet(object.response) ? typed_message_1.TypedMessage.fromJSON(object.response) : undefined,
};
},
toJSON(message) {
const obj = {};
if (message.response !== undefined) {
obj.response = typed_message_1.TypedMessage.toJSON(message.response);
}
return obj;
},
create(base) {
return exports.Config.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseConfig();
message.response = (object.response !== undefined && object.response !== null)
? typed_message_1.TypedMessage.fromPartial(object.response)
: undefined;
return message;
},
};
typeRegistry_1.messageTypeRegistry.set(exports.Config.$type, exports.Config);
function isSet(value) {
return value !== null && value !== undefined;
}