grpc-js-reflection-client
Version:
Package use Grpc reflection api to download grpc proto descriptor. Now you don't have to add proto file to each package. Simple direct download proto package from example microservice without any files.
13 lines • 669 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.packageObjectHelper = void 0;
const GrpcReflection_1 = require("../GrpcReflection");
const packageObjectHelper = async (options) => {
const client = new GrpcReflection_1.GrpcReflection(options.host, options.credentials);
const descriptor = 'proto_filename' in options
? await client.getDescriptorByFileName(options.proto_filename)
: await client.getDescriptorBySymbol(options.proto_symbol);
return descriptor.getPackageObject(options.protoLoaderOptions);
};
exports.packageObjectHelper = packageObjectHelper;
//# sourceMappingURL=packageObjectHelper.js.map