Skip to content

Commit

Permalink
chore: update generated files
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Stewart <christian@aperture.us>
  • Loading branch information
paralin committed Apr 23, 2024
1 parent 48cec71 commit 4cefe82
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 60 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ export GO111MODULE=on
undefine GOARCH
undefine GOOS

.PHONY: $(MAKECMDGOALS) help
.PHONY: $(MAKECMDGOALS)

all: help

vendor:
go mod vendor
all:

$(COMMON_MAKEFILE): vendor
@if [ ! -f $(COMMON_MAKEFILE) ]; then \
Expand All @@ -29,3 +26,6 @@ $(MAKECMDGOALS): $(COMMON_MAKEFILE)

%: $(COMMON_MAKEFILE)
@$(MAKE) -C $(COMMON_DIR) PROJECT_DIR="$(PROJECT_DIR)" $@

vendor:
go mod vendor
54 changes: 36 additions & 18 deletions example/example_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
// @generated from file github.com/aperturerobotics/template/example/example.proto (package example, syntax proto3)
/* eslint-disable */

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import type {
BinaryReadOptions,
FieldList,
JsonReadOptions,
JsonValue,
PartialMessage,
PlainMessage,
} from '@bufbuild/protobuf'
import { Message, proto3 } from '@bufbuild/protobuf'

/**
* EchoMsg is the message body for Echo.
Expand All @@ -14,33 +21,44 @@ export class EchoMsg extends Message<EchoMsg> {
/**
* @generated from field: string body = 1;
*/
body = "";
body = ''

constructor(data?: PartialMessage<EchoMsg>) {
super();
proto3.util.initPartial(data, this);
super()
proto3.util.initPartial(data, this)
}

static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "example.EchoMsg";
static readonly runtime: typeof proto3 = proto3
static readonly typeName = 'example.EchoMsg'
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "body", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);
{ no: 1, name: 'body', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
])

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): EchoMsg {
return new EchoMsg().fromBinary(bytes, options);
static fromBinary(
bytes: Uint8Array,
options?: Partial<BinaryReadOptions>,
): EchoMsg {
return new EchoMsg().fromBinary(bytes, options)
}

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): EchoMsg {
return new EchoMsg().fromJson(jsonValue, options);
static fromJson(
jsonValue: JsonValue,
options?: Partial<JsonReadOptions>,
): EchoMsg {
return new EchoMsg().fromJson(jsonValue, options)
}

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): EchoMsg {
return new EchoMsg().fromJsonString(jsonString, options);
static fromJsonString(
jsonString: string,
options?: Partial<JsonReadOptions>,
): EchoMsg {
return new EchoMsg().fromJsonString(jsonString, options)
}

static equals(a: EchoMsg | PlainMessage<EchoMsg> | undefined, b: EchoMsg | PlainMessage<EchoMsg> | undefined): boolean {
return proto3.util.equals(EchoMsg, a, b);
static equals(
a: EchoMsg | PlainMessage<EchoMsg> | undefined,
b: EchoMsg | PlainMessage<EchoMsg> | undefined,
): boolean {
return proto3.util.equals(EchoMsg, a, b)
}
}

77 changes: 40 additions & 37 deletions example/example_srpc.pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,31 @@
// @generated from file github.com/aperturerobotics/template/example/example.proto (package example, syntax proto3)
/* eslint-disable */

import { EchoMsg } from "./example_pb.js";
import type { PartialMessage } from "@bufbuild/protobuf";
import { MethodKind } from "@bufbuild/protobuf";
import { buildDecodeMessageTransform, buildEncodeMessageTransform, MessageStream, ProtoRpc } from "starpc";
import { EchoMsg } from './example_pb.js'
import type { PartialMessage } from '@bufbuild/protobuf'
import { MethodKind } from '@bufbuild/protobuf'
import {
buildDecodeMessageTransform,
buildEncodeMessageTransform,
MessageStream,
ProtoRpc,
} from 'starpc'

/**
* Echoer service returns the given message.
*
* @generated from service example.Echoer
*/
export const EchoerDefinition = {
typeName: "example.Echoer",
typeName: 'example.Echoer',
methods: {
/**
* Echo returns the given message.
*
* @generated from rpc example.Echoer.Echo
*/
Echo: {
name: "Echo",
name: 'Echo',
I: EchoMsg,
O: EchoMsg,
kind: MethodKind.Unary,
Expand All @@ -32,7 +37,7 @@ export const EchoerDefinition = {
* @generated from rpc example.Echoer.EchoServerStream
*/
EchoServerStream: {
name: "EchoServerStream",
name: 'EchoServerStream',
I: EchoMsg,
O: EchoMsg,
kind: MethodKind.ServerStreaming,
Expand All @@ -43,7 +48,7 @@ export const EchoerDefinition = {
* @generated from rpc example.Echoer.EchoClientStream
*/
EchoClientStream: {
name: "EchoClientStream",
name: 'EchoClientStream',
I: EchoMsg,
O: EchoMsg,
kind: MethodKind.ClientStreaming,
Expand All @@ -54,13 +59,13 @@ export const EchoerDefinition = {
* @generated from rpc example.Echoer.EchoBidiStream
*/
EchoBidiStream: {
name: "EchoBidiStream",
name: 'EchoBidiStream',
I: EchoMsg,
O: EchoMsg,
kind: MethodKind.BiDiStreaming,
},
}
} as const;
},
} as const

/**
* Echoer service returns the given message.
Expand All @@ -74,40 +79,39 @@ export interface Echoer {
* @generated from rpc example.Echoer.Echo
*/
Echo(
request: PartialMessage<EchoMsg>, abortSignal?: AbortSignal
):
Promise<PartialMessage<EchoMsg>>
request: PartialMessage<EchoMsg>,
abortSignal?: AbortSignal,
): Promise<PartialMessage<EchoMsg>>

/**
* EchoServerStream is an example of a server -> client one-way stream.
*
* @generated from rpc example.Echoer.EchoServerStream
*/
EchoServerStream(
request: PartialMessage<EchoMsg>, abortSignal?: AbortSignal
):
MessageStream<EchoMsg>
request: PartialMessage<EchoMsg>,
abortSignal?: AbortSignal,
): MessageStream<EchoMsg>

Check failure on line 94 in example/example_srpc.pb.ts

View workflow job for this annotation

GitHub Actions / integration (1.22, 21.x)

Type 'EchoMsg' does not satisfy the constraint 'Message<EchoMsg>'.

/**
* EchoClientStream is an example of client->server one-way stream.
*
* @generated from rpc example.Echoer.EchoClientStream
*/
EchoClientStream(
request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
):
Promise<PartialMessage<EchoMsg>>
request: MessageStream<EchoMsg>,

Check failure on line 102 in example/example_srpc.pb.ts

View workflow job for this annotation

GitHub Actions / integration (1.22, 21.x)

Type 'EchoMsg' does not satisfy the constraint 'Message<EchoMsg>'.
abortSignal?: AbortSignal,
): Promise<PartialMessage<EchoMsg>>

/**
* EchoBidiStream is an example of a two-way stream.
*
* @generated from rpc example.Echoer.EchoBidiStream
*/
EchoBidiStream(
request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
):
MessageStream<EchoMsg>

request: MessageStream<EchoMsg>,

Check failure on line 112 in example/example_srpc.pb.ts

View workflow job for this annotation

GitHub Actions / integration (1.22, 21.x)

Type 'EchoMsg' does not satisfy the constraint 'Message<EchoMsg>'.
abortSignal?: AbortSignal,
): MessageStream<EchoMsg>

Check failure on line 114 in example/example_srpc.pb.ts

View workflow job for this annotation

GitHub Actions / integration (1.22, 21.x)

Type 'EchoMsg' does not satisfy the constraint 'Message<EchoMsg>'.
}

export const EchoerServiceName = EchoerDefinition.typeName
Expand All @@ -129,9 +133,9 @@ export class EchoerClient implements Echoer {
* @generated from rpc example.Echoer.Echo
*/
async Echo(
request: PartialMessage<EchoMsg>, abortSignal?: AbortSignal
):
Promise<PartialMessage<EchoMsg>> {
request: PartialMessage<EchoMsg>,
abortSignal?: AbortSignal,
): Promise<PartialMessage<EchoMsg>> {
const requestMsg = new EchoMsg(request)
const result = await this.rpc.request(
this.service,
Expand All @@ -148,9 +152,9 @@ Promise<PartialMessage<EchoMsg>> {
* @generated from rpc example.Echoer.EchoServerStream
*/
EchoServerStream(
request: PartialMessage<EchoMsg>, abortSignal?: AbortSignal
):
MessageStream<EchoMsg> {
request: PartialMessage<EchoMsg>,
abortSignal?: AbortSignal,
): MessageStream<EchoMsg> {

Check failure on line 157 in example/example_srpc.pb.ts

View workflow job for this annotation

GitHub Actions / integration (1.22, 21.x)

Type 'EchoMsg' does not satisfy the constraint 'Message<EchoMsg>'.
const requestMsg = new EchoMsg(request)
const result = this.rpc.serverStreamingRequest(
this.service,
Expand All @@ -167,9 +171,9 @@ MessageStream<EchoMsg> {
* @generated from rpc example.Echoer.EchoClientStream
*/
async EchoClientStream(
request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
):
Promise<PartialMessage<EchoMsg>> {
request: MessageStream<EchoMsg>,

Check failure on line 174 in example/example_srpc.pb.ts

View workflow job for this annotation

GitHub Actions / integration (1.22, 21.x)

Type 'EchoMsg' does not satisfy the constraint 'Message<EchoMsg>'.
abortSignal?: AbortSignal,
): Promise<PartialMessage<EchoMsg>> {
const result = await this.rpc.clientStreamingRequest(
this.service,
EchoerDefinition.methods.EchoClientStream.name,
Expand All @@ -185,9 +189,9 @@ Promise<PartialMessage<EchoMsg>> {
* @generated from rpc example.Echoer.EchoBidiStream
*/
EchoBidiStream(
request: MessageStream<EchoMsg>, abortSignal?: AbortSignal
):
MessageStream<EchoMsg> {
request: MessageStream<EchoMsg>,

Check failure on line 192 in example/example_srpc.pb.ts

View workflow job for this annotation

GitHub Actions / integration (1.22, 21.x)

Type 'EchoMsg' does not satisfy the constraint 'Message<EchoMsg>'.
abortSignal?: AbortSignal,
): MessageStream<EchoMsg> {
const result = this.rpc.bidirectionalStreamingRequest(
this.service,
EchoerDefinition.methods.EchoBidiStream.name,
Expand All @@ -196,5 +200,4 @@ MessageStream<EchoMsg> {
)
return buildDecodeMessageTransform(EchoMsg)(result)
}

}

0 comments on commit 4cefe82

Please sign in to comment.