
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
@yongenaelf/protobuf-generator-ts
Advanced tools
`@yongenaelf/protobuf-generator-ts` is an npm library designed to generate Protocol Buffer code from TypeScript.
@yongenaelf/protobuf-generator-ts
is an npm library designed to generate Protocol Buffer code from TypeScript.
npm install @yongenaelf/protobuf-generator-ts
import { generateProtoFile, ProtoFile } from '@yongenaelf/protobuf-generator-ts';
const testAST: ProtoFile = {
syntax: "proto3",
package: "", // No package for this file
imports: [
"aelf/options.proto",
"google/protobuf/empty.proto",
"google/protobuf/wrappers.proto",
"Protobuf/reference/acs12.proto"
],
messages: [
{
name: "UpdatedMessage",
fields: [
{ name: "value", type: "string", id: 1 }
],
options: {
"aelf.is_event": "true",
}
}
],
services: [
{
name: "HelloWorld",
options: [
{ key: "aelf.csharp_state", value: `"AElf.Contracts.HelloWorld.HelloWorldState"` },
{ key: "aelf.base", value: `"Protobuf/reference/acs12.proto"` }
],
methods: [
{
name: "Update",
inputType: "google.protobuf.StringValue",
outputType: "google.protobuf.Empty"
},
{
name: "Read",
inputType: "google.protobuf.Empty",
outputType: "google.protobuf.StringValue",
options: [
{ key: "aelf.is_view", value: "true" }
]
}
]
}
],
options: {
"csharp_namespace": `"AElf.Contracts.HelloWorld"`
}
};
generateProtoFile(testAST)
Expected output:
syntax = "proto3";
import "aelf/options.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/wrappers.proto";
import "Protobuf/reference/acs12.proto";
option csharp_namespace = "AElf.Contracts.HelloWorld";
service HelloWorld {
option (aelf.csharp_state) = "AElf.Contracts.HelloWorld.HelloWorldState";
option (aelf.base) = "Protobuf/reference/acs12.proto";
rpc Update (google.protobuf.StringValue) returns (google.protobuf.Empty);
rpc Read (google.protobuf.Empty) returns (google.protobuf.StringValue) {
option (aelf.is_view) = true;
}
}
message UpdatedMessage {
option (aelf.is_event) = true;
string value = 1;
}
FAQs
`@yongenaelf/protobuf-generator-ts` is an npm library designed to generate Protocol Buffer code from TypeScript.
The npm package @yongenaelf/protobuf-generator-ts receives a total of 0 weekly downloads. As such, @yongenaelf/protobuf-generator-ts popularity was classified as not popular.
We found that @yongenaelf/protobuf-generator-ts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.