Skip to content

Commit

Permalink
fix: Bump ts-poet to use @dprint/typescript. (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenh authored Aug 27, 2022
1 parent 6b4eac5 commit 84b64f4
Show file tree
Hide file tree
Showing 88 changed files with 384 additions and 382 deletions.
4 changes: 2 additions & 2 deletions integration/async-iterable-services/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class EchoerClientImpl implements Echoer {
Echo(request: EchoMsg): Promise<EchoMsg> {
const data = EchoMsg.encode(request).finish();
const promise = this.rpc.request("simple.Echoer", "Echo", data);
return promise.then((data) => EchoMsg.decode(new _m0.Reader(data)));
return promise.then(data => EchoMsg.decode(new _m0.Reader(data)));
}

EchoServerStream(request: EchoMsg): AsyncIterable<EchoMsg> {
Expand All @@ -123,7 +123,7 @@ export class EchoerClientImpl implements Echoer {
EchoClientStream(request: AsyncIterable<EchoMsg>): Promise<EchoMsg> {
const data = EchoMsg.encodeTransform(request);
const promise = this.rpc.clientStreamingRequest("simple.Echoer", "EchoClientStream", data);
return promise.then((data) => EchoMsg.decode(new _m0.Reader(data)));
return promise.then(data => EchoMsg.decode(new _m0.Reader(data)));
}

EchoBidiStream(request: AsyncIterable<EchoMsg>): AsyncIterable<EchoMsg> {
Expand Down
8 changes: 4 additions & 4 deletions integration/avoid-import-conflicts/simple.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable */
import * as _m0 from "protobufjs/minimal";
import {
FooService as FooService2,
fooServiceFromJSON,
Expand All @@ -8,7 +9,6 @@ import {
simpleEnumFromJSON as simpleEnumFromJSON4,
simpleEnumToJSON as simpleEnumToJSON5,
} from "./simple2";
import * as _m0 from "protobufjs/minimal";

export const protobufPackage = "simple";

Expand Down Expand Up @@ -115,8 +115,8 @@ export const Simple = {
toJSON(message: Simple): unknown {
const obj: any = {};
message.name !== undefined && (obj.name = message.name);
message.otherSimple !== undefined &&
(obj.otherSimple = message.otherSimple ? Simple3.toJSON(message.otherSimple) : undefined);
message.otherSimple !== undefined
&& (obj.otherSimple = message.otherSimple ? Simple3.toJSON(message.otherSimple) : undefined);
return obj;
},

Expand Down Expand Up @@ -295,7 +295,7 @@ export class FooServiceClientImpl implements FooService {
Create(request: FooServiceCreateRequest): Promise<FooServiceCreateResponse> {
const data = FooServiceCreateRequest.encode(request).finish();
const promise = this.rpc.request("simple.FooService", "Create", data);
return promise.then((data) => FooServiceCreateResponse.decode(new _m0.Reader(data)));
return promise.then(data => FooServiceCreateResponse.decode(new _m0.Reader(data)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion integration/barrel-imports/foo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable */
import { Bar } from "./bar";
import * as _m0 from "protobufjs/minimal";
import { Bar } from "./bar";

export interface Foo {
name: string;
Expand Down
20 changes: 10 additions & 10 deletions integration/batching-with-context/batching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const BatchQueryRequest = {
toJSON(message: BatchQueryRequest): unknown {
const obj: any = {};
if (message.ids) {
obj.ids = message.ids.map((e) => e);
obj.ids = message.ids.map(e => e);
} else {
obj.ids = [];
}
Expand Down Expand Up @@ -134,7 +134,7 @@ export const BatchQueryResponse = {
toJSON(message: BatchQueryResponse): unknown {
const obj: any = {};
if (message.entities) {
obj.entities = message.entities.map((e) => e ? Entity.toJSON(e) : undefined);
obj.entities = message.entities.map(e => e ? Entity.toJSON(e) : undefined);
} else {
obj.entities = [];
}
Expand Down Expand Up @@ -185,7 +185,7 @@ export const BatchMapQueryRequest = {
toJSON(message: BatchMapQueryRequest): unknown {
const obj: any = {};
if (message.ids) {
obj.ids = message.ids.map((e) => e);
obj.ids = message.ids.map(e => e);
} else {
obj.ids = [];
}
Expand Down Expand Up @@ -589,7 +589,7 @@ export class EntityServiceClientImpl<Context extends DataLoaders> implements Ent
const dl = ctx.getDataLoader("batching.EntityService.BatchQuery", () => {
return new DataLoader<string, Entity>((ids) => {
const request = { ids };
return this.BatchQuery(ctx, request).then((res) => res.entities);
return this.BatchQuery(ctx, request).then(res => res.entities);
}, { cacheKeyFn: hash, ...ctx.rpcDataLoaderOptions });
});
return dl.load(id);
Expand All @@ -598,15 +598,15 @@ export class EntityServiceClientImpl<Context extends DataLoaders> implements Ent
BatchQuery(ctx: Context, request: BatchQueryRequest): Promise<BatchQueryResponse> {
const data = BatchQueryRequest.encode(request).finish();
const promise = this.rpc.request(ctx, "batching.EntityService", "BatchQuery", data);
return promise.then((data) => BatchQueryResponse.decode(new _m0.Reader(data)));
return promise.then(data => BatchQueryResponse.decode(new _m0.Reader(data)));
}

GetMapQuery(ctx: Context, id: string): Promise<Entity> {
const dl = ctx.getDataLoader("batching.EntityService.BatchMapQuery", () => {
return new DataLoader<string, Entity>((ids) => {
const request = { ids };
return this.BatchMapQuery(ctx, request).then((res) => {
return ids.map((key) => res.entities[key]);
return this.BatchMapQuery(ctx, request).then(res => {
return ids.map(key => res.entities[key]);
});
}, { cacheKeyFn: hash, ...ctx.rpcDataLoaderOptions });
});
Expand All @@ -616,13 +616,13 @@ export class EntityServiceClientImpl<Context extends DataLoaders> implements Ent
BatchMapQuery(ctx: Context, request: BatchMapQueryRequest): Promise<BatchMapQueryResponse> {
const data = BatchMapQueryRequest.encode(request).finish();
const promise = this.rpc.request(ctx, "batching.EntityService", "BatchMapQuery", data);
return promise.then((data) => BatchMapQueryResponse.decode(new _m0.Reader(data)));
return promise.then(data => BatchMapQueryResponse.decode(new _m0.Reader(data)));
}

GetOnlyMethod(ctx: Context, request: GetOnlyMethodRequest): Promise<GetOnlyMethodResponse> {
const dl = ctx.getDataLoader("batching.EntityService.GetOnlyMethod", () => {
return new DataLoader<GetOnlyMethodRequest, GetOnlyMethodResponse>((requests) => {
const responses = requests.map(async (request) => {
const responses = requests.map(async request => {
const data = GetOnlyMethodRequest.encode(request).finish();
const response = await this.rpc.request(ctx, "batching.EntityService", "GetOnlyMethod", data);
return GetOnlyMethodResponse.decode(new _m0.Reader(response));
Expand All @@ -636,7 +636,7 @@ export class EntityServiceClientImpl<Context extends DataLoaders> implements Ent
WriteMethod(ctx: Context, request: WriteMethodRequest): Promise<WriteMethodResponse> {
const data = WriteMethodRequest.encode(request).finish();
const promise = this.rpc.request(ctx, "batching.EntityService", "WriteMethod", data);
return promise.then((data) => WriteMethodResponse.decode(new _m0.Reader(data)));
return promise.then(data => WriteMethodResponse.decode(new _m0.Reader(data)));
}
}

Expand Down
14 changes: 7 additions & 7 deletions integration/batching/batching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BatchQueryRequest = {
toJSON(message: BatchQueryRequest): unknown {
const obj: any = {};
if (message.ids) {
obj.ids = message.ids.map((e) => e);
obj.ids = message.ids.map(e => e);
} else {
obj.ids = [];
}
Expand Down Expand Up @@ -132,7 +132,7 @@ export const BatchQueryResponse = {
toJSON(message: BatchQueryResponse): unknown {
const obj: any = {};
if (message.entities) {
obj.entities = message.entities.map((e) => e ? Entity.toJSON(e) : undefined);
obj.entities = message.entities.map(e => e ? Entity.toJSON(e) : undefined);
} else {
obj.entities = [];
}
Expand Down Expand Up @@ -183,7 +183,7 @@ export const BatchMapQueryRequest = {
toJSON(message: BatchMapQueryRequest): unknown {
const obj: any = {};
if (message.ids) {
obj.ids = message.ids.map((e) => e);
obj.ids = message.ids.map(e => e);
} else {
obj.ids = [];
}
Expand Down Expand Up @@ -584,25 +584,25 @@ export class EntityServiceClientImpl implements EntityService {
BatchQuery(request: BatchQueryRequest): Promise<BatchQueryResponse> {
const data = BatchQueryRequest.encode(request).finish();
const promise = this.rpc.request("batching.EntityService", "BatchQuery", data);
return promise.then((data) => BatchQueryResponse.decode(new _m0.Reader(data)));
return promise.then(data => BatchQueryResponse.decode(new _m0.Reader(data)));
}

BatchMapQuery(request: BatchMapQueryRequest): Promise<BatchMapQueryResponse> {
const data = BatchMapQueryRequest.encode(request).finish();
const promise = this.rpc.request("batching.EntityService", "BatchMapQuery", data);
return promise.then((data) => BatchMapQueryResponse.decode(new _m0.Reader(data)));
return promise.then(data => BatchMapQueryResponse.decode(new _m0.Reader(data)));
}

GetOnlyMethod(request: GetOnlyMethodRequest): Promise<GetOnlyMethodResponse> {
const data = GetOnlyMethodRequest.encode(request).finish();
const promise = this.rpc.request("batching.EntityService", "GetOnlyMethod", data);
return promise.then((data) => GetOnlyMethodResponse.decode(new _m0.Reader(data)));
return promise.then(data => GetOnlyMethodResponse.decode(new _m0.Reader(data)));
}

WriteMethod(request: WriteMethodRequest): Promise<WriteMethodResponse> {
const data = WriteMethodRequest.encode(request).finish();
const promise = this.rpc.request("batching.EntityService", "WriteMethod", data);
return promise.then((data) => WriteMethodResponse.decode(new _m0.Reader(data)));
return promise.then(data => WriteMethodResponse.decode(new _m0.Reader(data)));
}
}

Expand Down
4 changes: 2 additions & 2 deletions integration/bytes-as-base64/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const Message = {

toJSON(message: Message): unknown {
const obj: any = {};
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
message.data !== undefined
&& (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
return obj;
},

Expand Down
4 changes: 2 additions & 2 deletions integration/bytes-node/google/protobuf/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ export const BytesValue = {

toJSON(message: BytesValue): unknown {
const obj: any = {};
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : Buffer.alloc(0)));
message.value !== undefined
&& (obj.value = base64FromBytes(message.value !== undefined ? message.value : Buffer.alloc(0)));
return obj;
},

Expand Down
4 changes: 2 additions & 2 deletions integration/bytes-node/point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export const Point = {

toJSON(message: Point): unknown {
const obj: any = {};
message.data !== undefined &&
(obj.data = base64FromBytes(message.data !== undefined ? message.data : Buffer.alloc(0)));
message.data !== undefined
&& (obj.data = base64FromBytes(message.data !== undefined ? message.data : Buffer.alloc(0)));
message.dataWrapped !== undefined && (obj.dataWrapped = message.dataWrapped);
return obj;
},
Expand Down
2 changes: 1 addition & 1 deletion integration/file-suffix/parent.pb.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable */
import * as _m0 from "protobufjs/minimal";
import { Child, ChildEnum, childEnumFromJSON, childEnumToJSON } from "./child.pb";
import { Timestamp } from "./google/protobuf/timestamp.pb";
import * as _m0 from "protobufjs/minimal";

export const protobufPackage = "file_suffix";

Expand Down
12 changes: 6 additions & 6 deletions integration/generic-metadata/hero.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable */
import { Foo } from "./some-file";
import * as _m0 from "protobufjs/minimal";
import { Observable } from "rxjs";
import { map } from "rxjs/operators";
import * as _m0 from "protobufjs/minimal";
import { Foo } from "./some-file";

export const protobufPackage = "hero";

Expand Down Expand Up @@ -245,19 +245,19 @@ export class HeroServiceClientImpl implements HeroService {
FindOneHero(request: HeroById): Promise<Hero> {
const data = HeroById.encode(request).finish();
const promise = this.rpc.request("hero.HeroService", "FindOneHero", data);
return promise.then((data) => Hero.decode(new _m0.Reader(data)));
return promise.then(data => Hero.decode(new _m0.Reader(data)));
}

FindOneVillain(request: VillainById): Promise<Villain> {
const data = VillainById.encode(request).finish();
const promise = this.rpc.request("hero.HeroService", "FindOneVillain", data);
return promise.then((data) => Villain.decode(new _m0.Reader(data)));
return promise.then(data => Villain.decode(new _m0.Reader(data)));
}

FindManyVillain(request: Observable<VillainById>): Observable<Villain> {
const data = request.pipe(map((request) => VillainById.encode(request).finish()));
const data = request.pipe(map(request => VillainById.encode(request).finish()));
const result = this.rpc.bidirectionalStreamingRequest("hero.HeroService", "FindManyVillain", data);
return result.pipe(map((data) => Villain.decode(new _m0.Reader(data))));
return result.pipe(map(data => Villain.decode(new _m0.Reader(data))));
}
}

Expand Down
10 changes: 5 additions & 5 deletions integration/grpc-js/google/protobuf/struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export const Struct = {
wrap(object: { [key: string]: any } | undefined): Struct {
const struct = createBaseStruct();
if (object !== undefined) {
Object.keys(object).forEach((key) => {
Object.keys(object).forEach(key => {
struct.fields[key] = object[key];
});
}
Expand All @@ -183,7 +183,7 @@ export const Struct = {

unwrap(message: Struct): { [key: string]: any } {
const object: { [key: string]: any } = {};
Object.keys(message.fields).forEach((key) => {
Object.keys(message.fields).forEach(key => {
object[key] = message.fields[key];
});
return object;
Expand Down Expand Up @@ -325,8 +325,8 @@ export const Value = {

toJSON(message: Value): unknown {
const obj: any = {};
message.nullValue !== undefined &&
(obj.nullValue = message.nullValue !== undefined ? nullValueToJSON(message.nullValue) : undefined);
message.nullValue !== undefined
&& (obj.nullValue = message.nullValue !== undefined ? nullValueToJSON(message.nullValue) : undefined);
message.numberValue !== undefined && (obj.numberValue = message.numberValue);
message.stringValue !== undefined && (obj.stringValue = message.stringValue);
message.boolValue !== undefined && (obj.boolValue = message.boolValue);
Expand Down Expand Up @@ -423,7 +423,7 @@ export const ListValue = {
toJSON(message: ListValue): unknown {
const obj: any = {};
if (message.values) {
obj.values = message.values.map((e) => e);
obj.values = message.values.map(e => e);
} else {
obj.values = [];
}
Expand Down
4 changes: 2 additions & 2 deletions integration/grpc-js/google/protobuf/wrappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ export const BytesValue = {

toJSON(message: BytesValue): unknown {
const obj: any = {};
message.value !== undefined &&
(obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
message.value !== undefined
&& (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
return obj;
},

Expand Down
8 changes: 4 additions & 4 deletions integration/grpc-js/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ import {
ServiceError,
UntypedServiceImplementation,
} from "@grpc/grpc-js";
import { Timestamp } from "./google/protobuf/timestamp";
import * as _m0 from "protobufjs/minimal";
import { Empty } from "./google/protobuf/empty";
import { ListValue, Struct, Value } from "./google/protobuf/struct";
import { Timestamp } from "./google/protobuf/timestamp";
import {
BoolValue,
BytesValue,
Expand All @@ -30,8 +32,6 @@ import {
UInt32Value,
UInt64Value,
} from "./google/protobuf/wrappers";
import { ListValue, Struct, Value } from "./google/protobuf/struct";
import * as _m0 from "protobufjs/minimal";

export const protobufPackage = "simple";

Expand Down Expand Up @@ -617,7 +617,7 @@ export interface TestClient extends Client {
}

export const TestClient = makeGenericClientConstructor(TestService, "simple.Test") as unknown as {
new (address: string, credentials: ChannelCredentials, options?: Partial<ChannelOptions>): TestClient;
new(address: string, credentials: ChannelCredentials, options?: Partial<ChannelOptions>): TestClient;
service: typeof TestService;
};

Expand Down
Loading

0 comments on commit 84b64f4

Please sign in to comment.