const protoLoader = require('@grpc/proto-loader');
const grpc = require('@grpc/grpc-js');
const path = require('path');

const PROTO_PATH = path.join(__dirname, 'protos', 'main.proto');
// Load the .proto file and build a package definition
const packageDefinition = protoLoader.loadSync(PROTO_PATH, {
  keepCase: false,
});

// Load the package definition into gRPC
const mainProto = grpc.loadPackageDefinition(packageDefinition).automation_tool.src;

export default mainProto;
