UNPKG

@remnawave/xtls-sdk

Version:

A Typescript SDK for XRAY (XTLS) Core GRPC Api

69 lines (68 loc) 2.29 kB
"use strict"; // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.11.8 // protoc v6.33.4 // source: proxy/hysteria/account/config.proto Object.defineProperty(exports, "__esModule", { value: true }); exports.Account = exports.protobufPackage = void 0; /* eslint-disable */ const wire_1 = require("@bufbuild/protobuf/wire"); const typeRegistry_1 = require("../../../typeRegistry"); exports.protobufPackage = "xray.proxy.hysteria.account"; function createBaseAccount() { return { $type: "xray.proxy.hysteria.account.Account", auth: "" }; } exports.Account = { $type: "xray.proxy.hysteria.account.Account", encode(message, writer = new wire_1.BinaryWriter()) { if (message.auth !== "") { writer.uint32(10).string(message.auth); } return writer; }, decode(input, length) { const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAccount(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.auth = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { $type: exports.Account.$type, auth: isSet(object.auth) ? globalThis.String(object.auth) : "" }; }, toJSON(message) { const obj = {}; if (message.auth !== "") { obj.auth = message.auth; } return obj; }, create(base) { return exports.Account.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseAccount(); message.auth = object.auth ?? ""; return message; }, }; typeRegistry_1.messageTypeRegistry.set(exports.Account.$type, exports.Account); function isSet(value) { return value !== null && value !== undefined; }