From 554248b1ed6b5007058278488e3119feaf79a8e7 Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Sat, 27 Aug 2022 17:08:13 -0500 Subject: [PATCH] fix: Bump ts-poet to use @dprint/typescript. --- integration/async-iterable-services/simple.ts | 4 +- integration/avoid-import-conflicts/simple.ts | 8 +-- integration/barrel-imports/foo.ts | 2 +- integration/batching-with-context/batching.ts | 20 ++++---- integration/batching/batching.ts | 14 +++--- integration/bytes-as-base64/message.ts | 4 +- .../bytes-node/google/protobuf/wrappers.ts | 4 +- integration/bytes-node/point.ts | 4 +- integration/file-suffix/parent.pb.ts | 2 +- integration/generic-metadata/hero.ts | 12 ++--- integration/grpc-js/google/protobuf/struct.ts | 10 ++-- .../grpc-js/google/protobuf/wrappers.ts | 4 +- integration/grpc-js/simple.ts | 8 +-- integration/grpc-web-go-server/example.ts | 18 +++---- .../example.ts | 12 ++--- integration/grpc-web-no-streaming/example.ts | 8 +-- integration/grpc-web/example.ts | 14 +++--- integration/import-suffix/parent.pb.ts | 2 +- integration/lower-case-svc-methods/math.ts | 10 ++-- .../meta-typings/google/protobuf/timestamp.ts | 4 +- .../meta-typings/google/protobuf/wrappers.ts | 2 +- integration/meta-typings/google/type/date.ts | 2 +- integration/meta-typings/import_dir/thing.ts | 2 +- integration/meta-typings/simple.ts | 10 ++-- integration/nestjs-metadata-grpc-js/hero.ts | 4 +- .../nestjs-metadata-observables/hero.ts | 4 +- .../nestjs-metadata-restparameters/hero.ts | 4 +- integration/nestjs-metadata/hero.ts | 4 +- integration/nestjs-restparameters/hero.ts | 2 +- integration/nestjs-simple-observables/hero.ts | 2 +- .../nestjs-simple-restparameters/hero.ts | 2 +- integration/nestjs-simple/hero.ts | 4 +- .../nice-grpc/google/protobuf/struct.ts | 10 ++-- .../nice-grpc/google/protobuf/wrappers.ts | 4 +- integration/nice-grpc/simple.ts | 6 +-- .../no-proto-package/no-proto-package.ts | 4 +- integration/oneof-properties/oneof.ts | 12 ++--- .../google/protobuf/struct.ts | 29 +++++------ .../oneof-unions/google/protobuf/struct.ts | 28 +++++------ integration/oneof-unions/oneof.ts | 22 ++++---- .../options/google/protobuf/descriptor.ts | 24 ++++----- integration/options/options.ts | 4 +- integration/options/something/something.ts | 2 +- integration/return-observable/observable.ts | 2 +- integration/simple-json-name/simple.ts | 4 +- .../google/protobuf/wrappers.ts | 4 +- integration/simple-long-string/simple.ts | 2 +- .../simple-long/google/protobuf/wrappers.ts | 4 +- integration/simple-long/simple.ts | 6 +-- .../google/protobuf/wrappers.ts | 4 +- .../simple-optionals/import_dir/thing.ts | 2 +- integration/simple-optionals/simple.ts | 26 +++++----- integration/simple-optionals/thing.ts | 2 +- .../google/protobuf/wrappers.ts | 4 +- .../import_dir/thing.ts | 2 +- .../simple-prototype-defaults/simple.ts | 50 +++++++++---------- .../simple-snake/google/protobuf/struct.ts | 10 ++-- .../simple-snake/google/protobuf/wrappers.ts | 4 +- integration/simple-snake/import_dir/thing.ts | 2 +- integration/simple-snake/simple.ts | 28 +++++------ .../google/protobuf/struct.ts | 10 ++-- integration/simple-string-enums/simple.ts | 4 +- .../google/protobuf/wrappers.ts | 4 +- .../import_dir/thing.ts | 2 +- .../simple-unrecognized-enum/simple.ts | 26 +++++----- .../simple/google/protobuf/wrappers.ts | 4 +- integration/simple/import_dir/thing.ts | 2 +- integration/simple/simple.ts | 50 +++++++++---------- integration/struct/google/protobuf/struct.ts | 10 ++-- integration/type-registry/bar/bar.ts | 4 +- integration/type-registry/foo.ts | 4 +- .../type-registry/google/protobuf/struct.ts | 12 ++--- .../google/protobuf/timestamp.ts | 2 +- .../google/protobuf/compiler/plugin.ts | 2 +- integration/unknown-fields/options.ts | 2 +- integration/use-date-false/metadata.ts | 2 +- .../use-date-string/use-date-string.ts | 4 +- integration/use-date-true/use-date-true.ts | 8 +-- .../google/protobuf/struct.ts | 10 ++-- integration/use-numeric-enum-json/simple.ts | 4 +- .../use-objectid-true.ts | 2 +- integration/use-optionals-all/test.ts | 26 +++++----- integration/value/google/protobuf/struct.ts | 10 ++-- integration/value/google/protobuf/wrappers.ts | 4 +- integration/value/value.ts | 4 +- integration/vector-tile/vector_tile.ts | 12 ++--- package.json | 2 +- yarn.lock | 33 ++++++------ 88 files changed, 384 insertions(+), 382 deletions(-) diff --git a/integration/async-iterable-services/simple.ts b/integration/async-iterable-services/simple.ts index 6b478bce1..6a089103b 100644 --- a/integration/async-iterable-services/simple.ts +++ b/integration/async-iterable-services/simple.ts @@ -111,7 +111,7 @@ export class EchoerClientImpl implements Echoer { Echo(request: EchoMsg): Promise { 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 { @@ -123,7 +123,7 @@ export class EchoerClientImpl implements Echoer { EchoClientStream(request: AsyncIterable): Promise { 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): AsyncIterable { diff --git a/integration/avoid-import-conflicts/simple.ts b/integration/avoid-import-conflicts/simple.ts index 05738586d..92e3e638f 100644 --- a/integration/avoid-import-conflicts/simple.ts +++ b/integration/avoid-import-conflicts/simple.ts @@ -1,4 +1,5 @@ /* eslint-disable */ +import * as _m0 from "protobufjs/minimal"; import { FooService as FooService2, fooServiceFromJSON, @@ -8,7 +9,6 @@ import { simpleEnumFromJSON as simpleEnumFromJSON4, simpleEnumToJSON as simpleEnumToJSON5, } from "./simple2"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "simple"; @@ -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; }, @@ -295,7 +295,7 @@ export class FooServiceClientImpl implements FooService { Create(request: FooServiceCreateRequest): Promise { 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))); } } diff --git a/integration/barrel-imports/foo.ts b/integration/barrel-imports/foo.ts index e0107e4a6..e7bb2191a 100644 --- a/integration/barrel-imports/foo.ts +++ b/integration/barrel-imports/foo.ts @@ -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; diff --git a/integration/batching-with-context/batching.ts b/integration/batching-with-context/batching.ts index 348ebbe2d..206e90383 100644 --- a/integration/batching-with-context/batching.ts +++ b/integration/batching-with-context/batching.ts @@ -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 = []; } @@ -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 = []; } @@ -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 = []; } @@ -589,7 +589,7 @@ export class EntityServiceClientImpl implements Ent const dl = ctx.getDataLoader("batching.EntityService.BatchQuery", () => { return new DataLoader((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); @@ -598,15 +598,15 @@ export class EntityServiceClientImpl implements Ent BatchQuery(ctx: Context, request: BatchQueryRequest): Promise { 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 { const dl = ctx.getDataLoader("batching.EntityService.BatchMapQuery", () => { return new DataLoader((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 }); }); @@ -616,13 +616,13 @@ export class EntityServiceClientImpl implements Ent BatchMapQuery(ctx: Context, request: BatchMapQueryRequest): Promise { 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 { const dl = ctx.getDataLoader("batching.EntityService.GetOnlyMethod", () => { return new DataLoader((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)); @@ -636,7 +636,7 @@ export class EntityServiceClientImpl implements Ent WriteMethod(ctx: Context, request: WriteMethodRequest): Promise { 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))); } } diff --git a/integration/batching/batching.ts b/integration/batching/batching.ts index e7e3a3070..5fc240c0f 100644 --- a/integration/batching/batching.ts +++ b/integration/batching/batching.ts @@ -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 = []; } @@ -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 = []; } @@ -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 = []; } @@ -584,25 +584,25 @@ export class EntityServiceClientImpl implements EntityService { BatchQuery(request: BatchQueryRequest): Promise { 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 { 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 { 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 { 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))); } } diff --git a/integration/bytes-as-base64/message.ts b/integration/bytes-as-base64/message.ts index 1ffb1108d..f26c8ade2 100644 --- a/integration/bytes-as-base64/message.ts +++ b/integration/bytes-as-base64/message.ts @@ -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; }, diff --git a/integration/bytes-node/google/protobuf/wrappers.ts b/integration/bytes-node/google/protobuf/wrappers.ts index d1b77e648..04ef29722 100644 --- a/integration/bytes-node/google/protobuf/wrappers.ts +++ b/integration/bytes-node/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/bytes-node/point.ts b/integration/bytes-node/point.ts index ee299e099..95b71cb56 100644 --- a/integration/bytes-node/point.ts +++ b/integration/bytes-node/point.ts @@ -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; }, diff --git a/integration/file-suffix/parent.pb.ts b/integration/file-suffix/parent.pb.ts index e4eb10e35..c4f204a8b 100644 --- a/integration/file-suffix/parent.pb.ts +++ b/integration/file-suffix/parent.pb.ts @@ -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"; diff --git a/integration/generic-metadata/hero.ts b/integration/generic-metadata/hero.ts index 7abf33809..dfcff6f54 100644 --- a/integration/generic-metadata/hero.ts +++ b/integration/generic-metadata/hero.ts @@ -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"; @@ -245,19 +245,19 @@ export class HeroServiceClientImpl implements HeroService { FindOneHero(request: HeroById): Promise { 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 { 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): Observable { - 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)))); } } diff --git a/integration/grpc-js/google/protobuf/struct.ts b/integration/grpc-js/google/protobuf/struct.ts index 80a98258e..8c712529b 100644 --- a/integration/grpc-js/google/protobuf/struct.ts +++ b/integration/grpc-js/google/protobuf/struct.ts @@ -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]; }); } @@ -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; @@ -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); @@ -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 = []; } diff --git a/integration/grpc-js/google/protobuf/wrappers.ts b/integration/grpc-js/google/protobuf/wrappers.ts index 3145298cb..22e0e03e4 100644 --- a/integration/grpc-js/google/protobuf/wrappers.ts +++ b/integration/grpc-js/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/grpc-js/simple.ts b/integration/grpc-js/simple.ts index 1dc515b05..167ac710b 100644 --- a/integration/grpc-js/simple.ts +++ b/integration/grpc-js/simple.ts @@ -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, @@ -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"; @@ -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): TestClient; + new(address: string, credentials: ChannelCredentials, options?: Partial): TestClient; service: typeof TestService; }; diff --git a/integration/grpc-web-go-server/example.ts b/integration/grpc-web-go-server/example.ts index cf3e9f63d..20e616ead 100644 --- a/integration/grpc-web-go-server/example.ts +++ b/integration/grpc-web-go-server/example.ts @@ -1,7 +1,7 @@ /* eslint-disable */ +import * as _m0 from "protobufjs/minimal"; import { Observable } from "rxjs"; import { map } from "rxjs/operators"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "rpx"; @@ -204,10 +204,10 @@ export const DashUserSettingsState = { toJSON(message: DashUserSettingsState): unknown { const obj: any = {}; message.email !== undefined && (obj.email = message.email); - message.urls !== undefined && - (obj.urls = message.urls ? DashUserSettingsState_URLs.toJSON(message.urls) : undefined); + message.urls !== undefined + && (obj.urls = message.urls ? DashUserSettingsState_URLs.toJSON(message.urls) : undefined); if (message.flashes) { - obj.flashes = message.flashes.map((e) => e ? DashFlash.toJSON(e) : undefined); + obj.flashes = message.flashes.map(e => e ? DashFlash.toJSON(e) : undefined); } else { obj.flashes = []; } @@ -605,13 +605,13 @@ export class DashStateClientImpl implements DashState { UserSettings(request: Empty): Promise { const data = Empty.encode(request).finish(); const promise = this.rpc.request("rpx.DashState", "UserSettings", data); - return promise.then((data) => DashUserSettingsState.decode(new _m0.Reader(data))); + return promise.then(data => DashUserSettingsState.decode(new _m0.Reader(data))); } ActiveUserSettingsStream(request: Empty): Observable { const data = Empty.encode(request).finish(); const result = this.rpc.serverStreamingRequest("rpx.DashState", "ActiveUserSettingsStream", data); - return result.pipe(map((data) => DashUserSettingsState.decode(new _m0.Reader(data)))); + return result.pipe(map(data => DashUserSettingsState.decode(new _m0.Reader(data)))); } } @@ -637,19 +637,19 @@ export class DashAPICredsClientImpl implements DashAPICreds { Create(request: DashAPICredsCreateReq): Promise { const data = DashAPICredsCreateReq.encode(request).finish(); const promise = this.rpc.request("rpx.DashAPICreds", "Create", data); - return promise.then((data) => DashCred.decode(new _m0.Reader(data))); + return promise.then(data => DashCred.decode(new _m0.Reader(data))); } Update(request: DashAPICredsUpdateReq): Promise { const data = DashAPICredsUpdateReq.encode(request).finish(); const promise = this.rpc.request("rpx.DashAPICreds", "Update", data); - return promise.then((data) => DashCred.decode(new _m0.Reader(data))); + return promise.then(data => DashCred.decode(new _m0.Reader(data))); } Delete(request: DashAPICredsDeleteReq): Promise { const data = DashAPICredsDeleteReq.encode(request).finish(); const promise = this.rpc.request("rpx.DashAPICreds", "Delete", data); - return promise.then((data) => DashCred.decode(new _m0.Reader(data))); + return promise.then(data => DashCred.decode(new _m0.Reader(data))); } } diff --git a/integration/grpc-web-no-streaming-observable/example.ts b/integration/grpc-web-no-streaming-observable/example.ts index 5412e4eb0..9ff392207 100644 --- a/integration/grpc-web-no-streaming-observable/example.ts +++ b/integration/grpc-web-no-streaming-observable/example.ts @@ -1,9 +1,9 @@ /* eslint-disable */ import { grpc } from "@improbable-eng/grpc-web"; import { BrowserHeaders } from "browser-headers"; -import { take } from "rxjs/operators"; -import { Observable } from "rxjs"; import * as _m0 from "protobufjs/minimal"; +import { Observable } from "rxjs"; +import { take } from "rxjs/operators"; export const protobufPackage = "rpx"; @@ -182,10 +182,10 @@ export const DashUserSettingsState = { toJSON(message: DashUserSettingsState): unknown { const obj: any = {}; message.email !== undefined && (obj.email = message.email); - message.urls !== undefined && - (obj.urls = message.urls ? DashUserSettingsState_URLs.toJSON(message.urls) : undefined); + message.urls !== undefined + && (obj.urls = message.urls ? DashUserSettingsState_URLs.toJSON(message.urls) : undefined); if (message.flashes) { - obj.flashes = message.flashes.map((e) => e ? DashFlash.toJSON(e) : undefined); + obj.flashes = message.flashes.map(e => e ? DashFlash.toJSON(e) : undefined); } else { obj.flashes = []; } @@ -393,7 +393,7 @@ export class GrpcWebImpl { const maybeCombinedMetadata = metadata && this.options.metadata ? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap }) : metadata || this.options.metadata; - return new Observable((observer) => { + return new Observable(observer => { grpc.unary(methodDesc, { request, host: this.host, diff --git a/integration/grpc-web-no-streaming/example.ts b/integration/grpc-web-no-streaming/example.ts index bbf9663cd..4c41e3cfa 100644 --- a/integration/grpc-web-no-streaming/example.ts +++ b/integration/grpc-web-no-streaming/example.ts @@ -180,10 +180,10 @@ export const DashUserSettingsState = { toJSON(message: DashUserSettingsState): unknown { const obj: any = {}; message.email !== undefined && (obj.email = message.email); - message.urls !== undefined && - (obj.urls = message.urls ? DashUserSettingsState_URLs.toJSON(message.urls) : undefined); + message.urls !== undefined + && (obj.urls = message.urls ? DashUserSettingsState_URLs.toJSON(message.urls) : undefined); if (message.flashes) { - obj.flashes = message.flashes.map((e) => e ? DashFlash.toJSON(e) : undefined); + obj.flashes = message.flashes.map(e => e ? DashFlash.toJSON(e) : undefined); } else { obj.flashes = []; } @@ -398,7 +398,7 @@ export class GrpcWebImpl { metadata: maybeCombinedMetadata, transport: this.options.transport, debug: this.options.debug, - onEnd: function (response) { + onEnd: function(response) { if (response.status === grpc.Code.OK) { resolve(response.message); } else { diff --git a/integration/grpc-web/example.ts b/integration/grpc-web/example.ts index e4d52fae9..3d5482797 100644 --- a/integration/grpc-web/example.ts +++ b/integration/grpc-web/example.ts @@ -1,9 +1,9 @@ /* eslint-disable */ import { grpc } from "@improbable-eng/grpc-web"; import { BrowserHeaders } from "browser-headers"; -import { share } from "rxjs/operators"; -import { Observable } from "rxjs"; import * as _m0 from "protobufjs/minimal"; +import { Observable } from "rxjs"; +import { share } from "rxjs/operators"; export const protobufPackage = "rpx"; @@ -206,10 +206,10 @@ export const DashUserSettingsState = { toJSON(message: DashUserSettingsState): unknown { const obj: any = {}; message.email !== undefined && (obj.email = message.email); - message.urls !== undefined && - (obj.urls = message.urls ? DashUserSettingsState_URLs.toJSON(message.urls) : undefined); + message.urls !== undefined + && (obj.urls = message.urls ? DashUserSettingsState_URLs.toJSON(message.urls) : undefined); if (message.flashes) { - obj.flashes = message.flashes.map((e) => e ? DashFlash.toJSON(e) : undefined); + obj.flashes = message.flashes.map(e => e ? DashFlash.toJSON(e) : undefined); } else { obj.flashes = []; } @@ -836,7 +836,7 @@ export class GrpcWebImpl { metadata: maybeCombinedMetadata, transport: this.options.transport, debug: this.options.debug, - onEnd: function (response) { + onEnd: function(response) { if (response.status === grpc.Code.OK) { resolve(response.message); } else { @@ -859,7 +859,7 @@ export class GrpcWebImpl { const maybeCombinedMetadata = metadata && this.options.metadata ? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap }) : metadata || this.options.metadata; - return new Observable((observer) => { + return new Observable(observer => { const upStream = (() => { const client = grpc.invoke(methodDesc, { host: this.host, diff --git a/integration/import-suffix/parent.pb.ts b/integration/import-suffix/parent.pb.ts index 118805d95..081c666b1 100644 --- a/integration/import-suffix/parent.pb.ts +++ b/integration/import-suffix/parent.pb.ts @@ -1,7 +1,7 @@ /* eslint-disable */ +import * as _m0 from "protobufjs/minimal.js"; import { Child, ChildEnum, childEnumFromJSON, childEnumToJSON } from "./child.pb.js"; import { Timestamp } from "./google/protobuf/timestamp.pb.js"; -import * as _m0 from "protobufjs/minimal.js"; export const protobufPackage = "file_suffix"; diff --git a/integration/lower-case-svc-methods/math.ts b/integration/lower-case-svc-methods/math.ts index a54bcd803..7d432d1ee 100644 --- a/integration/lower-case-svc-methods/math.ts +++ b/integration/lower-case-svc-methods/math.ts @@ -166,7 +166,7 @@ export const Numbers = { toJSON(message: Numbers): unknown { const obj: any = {}; if (message.num) { - obj.num = message.num.map((e) => e); + obj.num = message.num.map(e => e); } else { obj.num = []; } @@ -198,20 +198,20 @@ export class MathServiceClientImpl implements MathS add(ctx: Context, request: NumPair): Promise { const data = NumPair.encode(request).finish(); const promise = this.rpc.request(ctx, "MathService", "Add", data); - return promise.then((data) => NumSingle.decode(new _m0.Reader(data))); + return promise.then(data => NumSingle.decode(new _m0.Reader(data))); } absoluteValue(ctx: Context, request: NumSingle): Promise { const data = NumSingle.encode(request).finish(); const promise = this.rpc.request(ctx, "MathService", "AbsoluteValue", data); - return promise.then((data) => NumSingle.decode(new _m0.Reader(data))); + return promise.then(data => NumSingle.decode(new _m0.Reader(data))); } getDouble(ctx: Context, nu: number): Promise { const dl = ctx.getDataLoader("MathService.BatchDouble", () => { return new DataLoader((num) => { const request = { num }; - return this.batchDouble(ctx, request).then((res) => res.num); + return this.batchDouble(ctx, request).then(res => res.num); }, { cacheKeyFn: hash, ...ctx.rpcDataLoaderOptions }); }); return dl.load(nu); @@ -220,7 +220,7 @@ export class MathServiceClientImpl implements MathS batchDouble(ctx: Context, request: Numbers): Promise { const data = Numbers.encode(request).finish(); const promise = this.rpc.request(ctx, "MathService", "BatchDouble", data); - return promise.then((data) => Numbers.decode(new _m0.Reader(data))); + return promise.then(data => Numbers.decode(new _m0.Reader(data))); } } diff --git a/integration/meta-typings/google/protobuf/timestamp.ts b/integration/meta-typings/google/protobuf/timestamp.ts index 3af6bfea4..56147a575 100644 --- a/integration/meta-typings/google/protobuf/timestamp.ts +++ b/integration/meta-typings/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -import { FileDescriptorProto } from "ts-proto-descriptors"; import * as Long from "long"; import * as _m0 from "protobufjs/minimal"; +import { FileDescriptorProto } from "ts-proto-descriptors"; export const protobufPackage = "google.protobuf"; @@ -244,7 +244,7 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 0], "span": [135, 0, 146, 1], "leadingComments": - ' A Timestamp represents a point in time independent of any time zone or local\n calendar, encoded as a count of seconds and fractions of seconds at\n nanosecond resolution. The count is relative to an epoch at UTC midnight on\n January 1, 1970, in the proleptic Gregorian calendar which extends the\n Gregorian calendar backwards to year one.\n\n All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap\n second table is needed for interpretation, using a [24-hour linear\n smear](https://developers.google.com/time/smear).\n\n The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n restricting to that range, we ensure that we can convert to and from [RFC\n 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n\n # Examples\n\n Example 1: Compute Timestamp from POSIX `time()`.\n\n Timestamp timestamp;\n timestamp.set_seconds(time(NULL));\n timestamp.set_nanos(0);\n\n Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n\n struct timeval tv;\n gettimeofday(&tv, NULL);\n\n Timestamp timestamp;\n timestamp.set_seconds(tv.tv_sec);\n timestamp.set_nanos(tv.tv_usec * 1000);\n\n Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\n FILETIME ft;\n GetSystemTimeAsFileTime(&ft);\n UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n\n // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n Timestamp timestamp;\n timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\n Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\n long millis = System.currentTimeMillis();\n\n Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n .setNanos((int) ((millis % 1000) * 1000000)).build();\n\n\n Example 5: Compute Timestamp from Java `Instant.now()`.\n\n Instant now = Instant.now();\n\n Timestamp timestamp =\n Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n .setNanos(now.getNano()).build();\n\n\n Example 6: Compute Timestamp from current time in Python.\n\n timestamp = Timestamp()\n timestamp.GetCurrentTime()\n\n # JSON Mapping\n\n In JSON format, the Timestamp type is encoded as a string in the\n [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"\n where {year} is always expressed using four digits while {month}, {day},\n {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone\n is required. A proto3 JSON serializer should always use UTC (as indicated by\n "Z") when printing the Timestamp type and a proto3 JSON parser should be\n able to accept both UTC and other timezones (as indicated by an offset).\n\n For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past\n 01:30 UTC on January 15, 2017.\n\n In JavaScript, one can convert a Date object to this format using the\n standard\n [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n method. In Python, a standard `datetime.datetime` object can be converted\n to this format using\n [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n the time format spec \'%Y-%m-%dT%H:%M:%S.%fZ\'. Likewise, in Java, one can use\n the Joda Time\'s [`ISODateTimeFormat.dateTime()`](\n http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D\n ) to obtain a formatter capable of generating timestamps in this format.\n\n\n', + " A Timestamp represents a point in time independent of any time zone or local\n calendar, encoded as a count of seconds and fractions of seconds at\n nanosecond resolution. The count is relative to an epoch at UTC midnight on\n January 1, 1970, in the proleptic Gregorian calendar which extends the\n Gregorian calendar backwards to year one.\n\n All minutes are 60 seconds long. Leap seconds are \"smeared\" so that no leap\n second table is needed for interpretation, using a [24-hour linear\n smear](https://developers.google.com/time/smear).\n\n The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By\n restricting to that range, we ensure that we can convert to and from [RFC\n 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.\n\n # Examples\n\n Example 1: Compute Timestamp from POSIX `time()`.\n\n Timestamp timestamp;\n timestamp.set_seconds(time(NULL));\n timestamp.set_nanos(0);\n\n Example 2: Compute Timestamp from POSIX `gettimeofday()`.\n\n struct timeval tv;\n gettimeofday(&tv, NULL);\n\n Timestamp timestamp;\n timestamp.set_seconds(tv.tv_sec);\n timestamp.set_nanos(tv.tv_usec * 1000);\n\n Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.\n\n FILETIME ft;\n GetSystemTimeAsFileTime(&ft);\n UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;\n\n // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z\n // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.\n Timestamp timestamp;\n timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));\n timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));\n\n Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.\n\n long millis = System.currentTimeMillis();\n\n Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)\n .setNanos((int) ((millis % 1000) * 1000000)).build();\n\n\n Example 5: Compute Timestamp from Java `Instant.now()`.\n\n Instant now = Instant.now();\n\n Timestamp timestamp =\n Timestamp.newBuilder().setSeconds(now.getEpochSecond())\n .setNanos(now.getNano()).build();\n\n\n Example 6: Compute Timestamp from current time in Python.\n\n timestamp = Timestamp()\n timestamp.GetCurrentTime()\n\n # JSON Mapping\n\n In JSON format, the Timestamp type is encoded as a string in the\n [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the\n format is \"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z\"\n where {year} is always expressed using four digits while {month}, {day},\n {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional\n seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),\n are optional. The \"Z\" suffix indicates the timezone (\"UTC\"); the timezone\n is required. A proto3 JSON serializer should always use UTC (as indicated by\n \"Z\") when printing the Timestamp type and a proto3 JSON parser should be\n able to accept both UTC and other timezones (as indicated by an offset).\n\n For example, \"2017-01-15T01:30:15.01Z\" encodes 15.01 seconds past\n 01:30 UTC on January 15, 2017.\n\n In JavaScript, one can convert a Date object to this format using the\n standard\n [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)\n method. In Python, a standard `datetime.datetime` object can be converted\n to this format using\n [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with\n the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use\n the Joda Time's [`ISODateTimeFormat.dateTime()`](\n http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D\n ) to obtain a formatter capable of generating timestamps in this format.\n\n\n", "trailingComments": "", "leadingDetachedComments": [], }, { diff --git a/integration/meta-typings/google/protobuf/wrappers.ts b/integration/meta-typings/google/protobuf/wrappers.ts index 13a5e17ac..fd7b093af 100644 --- a/integration/meta-typings/google/protobuf/wrappers.ts +++ b/integration/meta-typings/google/protobuf/wrappers.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -import { FileDescriptorProto } from "ts-proto-descriptors"; import * as Long from "long"; import * as _m0 from "protobufjs/minimal"; +import { FileDescriptorProto } from "ts-proto-descriptors"; export const protobufPackage = "google.protobuf"; diff --git a/integration/meta-typings/google/type/date.ts b/integration/meta-typings/google/type/date.ts index 0c780991d..72e7aceb5 100644 --- a/integration/meta-typings/google/type/date.ts +++ b/integration/meta-typings/google/type/date.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { FileDescriptorProto } from "ts-proto-descriptors"; import * as _m0 from "protobufjs/minimal"; +import { FileDescriptorProto } from "ts-proto-descriptors"; export const protobufPackage = "google.type"; diff --git a/integration/meta-typings/import_dir/thing.ts b/integration/meta-typings/import_dir/thing.ts index 51b470782..ec843ccd8 100644 --- a/integration/meta-typings/import_dir/thing.ts +++ b/integration/meta-typings/import_dir/thing.ts @@ -1,7 +1,7 @@ /* eslint-disable */ +import * as _m0 from "protobufjs/minimal"; import { FileDescriptorProto } from "ts-proto-descriptors"; import { protoMetadata as protoMetadata1, Timestamp } from "../google/protobuf/timestamp"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "simple"; diff --git a/integration/meta-typings/simple.ts b/integration/meta-typings/simple.ts index 79732ab80..9668d2c4d 100644 --- a/integration/meta-typings/simple.ts +++ b/integration/meta-typings/simple.ts @@ -1,11 +1,11 @@ /* eslint-disable */ +import * as Long from "long"; +import * as _m0 from "protobufjs/minimal"; import { FileDescriptorProto } from "ts-proto-descriptors"; -import { DateMessage, protoMetadata as protoMetadata1 } from "./google/type/date"; -import { BoolValue, Int32Value, protoMetadata as protoMetadata2, StringValue } from "./google/protobuf/wrappers"; import { protoMetadata as protoMetadata3, Timestamp } from "./google/protobuf/timestamp"; +import { BoolValue, Int32Value, protoMetadata as protoMetadata2, StringValue } from "./google/protobuf/wrappers"; +import { DateMessage, protoMetadata as protoMetadata1 } from "./google/type/date"; import { ImportedThing, protoMetadata as protoMetadata4 } from "./import_dir/thing"; -import * as Long from "long"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "simple"; @@ -1280,7 +1280,7 @@ export class PingServiceClientImpl implements PingService { ping(request: PingRequest): Promise { const data = PingRequest.encode(request).finish(); const promise = this.rpc.request("simple.PingService", "ping", data); - return promise.then((data) => PingResponse.decode(new _m0.Reader(data))); + return promise.then(data => PingResponse.decode(new _m0.Reader(data))); } } diff --git a/integration/nestjs-metadata-grpc-js/hero.ts b/integration/nestjs-metadata-grpc-js/hero.ts index 4c9fdfb00..7c15715df 100644 --- a/integration/nestjs-metadata-grpc-js/hero.ts +++ b/integration/nestjs-metadata-grpc-js/hero.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Observable } from "rxjs"; export const protobufPackage = "hero"; @@ -42,7 +42,7 @@ export interface HeroServiceController { } export function HeroServiceControllerMethods() { - return function (constructor: Function) { + return function(constructor: Function) { const grpcMethods: string[] = ["findOneHero", "findOneVillain"]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/integration/nestjs-metadata-observables/hero.ts b/integration/nestjs-metadata-observables/hero.ts index a944a59fa..30b036463 100644 --- a/integration/nestjs-metadata-observables/hero.ts +++ b/integration/nestjs-metadata-observables/hero.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Observable } from "rxjs"; export const protobufPackage = "hero"; @@ -42,7 +42,7 @@ export interface HeroServiceController { } export function HeroServiceControllerMethods() { - return function (constructor: Function) { + return function(constructor: Function) { const grpcMethods: string[] = ["findOneHero", "findOneVillain"]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/integration/nestjs-metadata-restparameters/hero.ts b/integration/nestjs-metadata-restparameters/hero.ts index ffb3d3d0d..23eb632ff 100644 --- a/integration/nestjs-metadata-restparameters/hero.ts +++ b/integration/nestjs-metadata-restparameters/hero.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Observable } from "rxjs"; export const protobufPackage = "hero"; @@ -46,7 +46,7 @@ export interface HeroServiceController { } export function HeroServiceControllerMethods() { - return function (constructor: Function) { + return function(constructor: Function) { const grpcMethods: string[] = ["findOneHero", "findOneVillain"]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/integration/nestjs-metadata/hero.ts b/integration/nestjs-metadata/hero.ts index 4c9fdfb00..7c15715df 100644 --- a/integration/nestjs-metadata/hero.ts +++ b/integration/nestjs-metadata/hero.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Metadata } from "@grpc/grpc-js"; +import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; import { Observable } from "rxjs"; export const protobufPackage = "hero"; @@ -42,7 +42,7 @@ export interface HeroServiceController { } export function HeroServiceControllerMethods() { - return function (constructor: Function) { + return function(constructor: Function) { const grpcMethods: string[] = ["findOneHero", "findOneVillain"]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/integration/nestjs-restparameters/hero.ts b/integration/nestjs-restparameters/hero.ts index abf56feb9..412833bfe 100644 --- a/integration/nestjs-restparameters/hero.ts +++ b/integration/nestjs-restparameters/hero.ts @@ -41,7 +41,7 @@ export interface HeroServiceController { } export function HeroServiceControllerMethods() { - return function (constructor: Function) { + return function(constructor: Function) { const grpcMethods: string[] = ["findOneHero", "findOneVillain"]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/integration/nestjs-simple-observables/hero.ts b/integration/nestjs-simple-observables/hero.ts index 7c884baf4..4ab8b0806 100644 --- a/integration/nestjs-simple-observables/hero.ts +++ b/integration/nestjs-simple-observables/hero.ts @@ -41,7 +41,7 @@ export interface HeroServiceController { } export function HeroServiceControllerMethods() { - return function (constructor: Function) { + return function(constructor: Function) { const grpcMethods: string[] = ["findOneHero", "findOneVillain"]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/integration/nestjs-simple-restparameters/hero.ts b/integration/nestjs-simple-restparameters/hero.ts index b7bb522a5..52299e421 100644 --- a/integration/nestjs-simple-restparameters/hero.ts +++ b/integration/nestjs-simple-restparameters/hero.ts @@ -21,7 +21,7 @@ export interface HeroServiceController { } export function HeroServiceControllerMethods() { - return function (constructor: Function) { + return function(constructor: Function) { const grpcMethods: string[] = ["findCurrentUser"]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/integration/nestjs-simple/hero.ts b/integration/nestjs-simple/hero.ts index d48eba0ae..0e3797697 100644 --- a/integration/nestjs-simple/hero.ts +++ b/integration/nestjs-simple/hero.ts @@ -1,8 +1,8 @@ /* eslint-disable */ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices"; -import { Timestamp } from "./google/protobuf/timestamp"; import { Observable } from "rxjs"; import { Empty } from "./google/protobuf/empty"; +import { Timestamp } from "./google/protobuf/timestamp"; export const protobufPackage = "hero"; @@ -56,7 +56,7 @@ export interface HeroServiceController { } export function HeroServiceControllerMethods() { - return function (constructor: Function) { + return function(constructor: Function) { const grpcMethods: string[] = ["addOneHero", "findOneHero", "findOneVillain", "findManyVillainStreamOut"]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/integration/nice-grpc/google/protobuf/struct.ts b/integration/nice-grpc/google/protobuf/struct.ts index 41ef5d717..e655c71e0 100644 --- a/integration/nice-grpc/google/protobuf/struct.ts +++ b/integration/nice-grpc/google/protobuf/struct.ts @@ -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]; }); } @@ -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; @@ -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); @@ -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 = []; } diff --git a/integration/nice-grpc/google/protobuf/wrappers.ts b/integration/nice-grpc/google/protobuf/wrappers.ts index 21a0c1424..f6ad2a219 100644 --- a/integration/nice-grpc/google/protobuf/wrappers.ts +++ b/integration/nice-grpc/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/nice-grpc/simple.ts b/integration/nice-grpc/simple.ts index 88901a97f..67e1ec2fe 100644 --- a/integration/nice-grpc/simple.ts +++ b/integration/nice-grpc/simple.ts @@ -1,7 +1,9 @@ /* eslint-disable */ import { CallContext, CallOptions } from "nice-grpc-common"; -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, @@ -13,8 +15,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"; diff --git a/integration/no-proto-package/no-proto-package.ts b/integration/no-proto-package/no-proto-package.ts index 8f4db6f9b..ce4cff10c 100644 --- a/integration/no-proto-package/no-proto-package.ts +++ b/integration/no-proto-package/no-proto-package.ts @@ -1,7 +1,7 @@ /* eslint-disable */ +import * as _m0 from "protobufjs/minimal"; import { Observable } from "rxjs"; import { map } from "rxjs/operators"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = ""; @@ -111,7 +111,7 @@ export class UserStateClientImpl implements UserState { GetUsers(request: Empty): Observable { const data = Empty.encode(request).finish(); const result = this.rpc.serverStreamingRequest("UserState", "GetUsers", data); - return result.pipe(map((data) => User.decode(new _m0.Reader(data)))); + return result.pipe(map(data => User.decode(new _m0.Reader(data)))); } } diff --git a/integration/oneof-properties/oneof.ts b/integration/oneof-properties/oneof.ts index a80318c1d..f48ecdc5a 100644 --- a/integration/oneof-properties/oneof.ts +++ b/integration/oneof-properties/oneof.ts @@ -199,13 +199,13 @@ export const PleaseChoose = { message.name !== undefined && (obj.name = message.name); message.aNumber !== undefined && (obj.aNumber = message.aNumber); message.aString !== undefined && (obj.aString = message.aString); - message.aMessage !== undefined && - (obj.aMessage = message.aMessage ? PleaseChoose_Submessage.toJSON(message.aMessage) : undefined); + message.aMessage !== undefined + && (obj.aMessage = message.aMessage ? PleaseChoose_Submessage.toJSON(message.aMessage) : undefined); message.aBool !== undefined && (obj.aBool = message.aBool); - message.bunchaBytes !== undefined && - (obj.bunchaBytes = message.bunchaBytes !== undefined ? base64FromBytes(message.bunchaBytes) : undefined); - message.anEnum !== undefined && - (obj.anEnum = message.anEnum !== undefined ? pleaseChoose_StateEnumToJSON(message.anEnum) : undefined); + message.bunchaBytes !== undefined + && (obj.bunchaBytes = message.bunchaBytes !== undefined ? base64FromBytes(message.bunchaBytes) : undefined); + message.anEnum !== undefined + && (obj.anEnum = message.anEnum !== undefined ? pleaseChoose_StateEnumToJSON(message.anEnum) : undefined); message.age !== undefined && (obj.age = Math.round(message.age)); message.either !== undefined && (obj.either = message.either); message.or !== undefined && (obj.or = message.or); diff --git a/integration/oneof-unions-snake/google/protobuf/struct.ts b/integration/oneof-unions-snake/google/protobuf/struct.ts index fdf3803b1..4c0bc6b6b 100644 --- a/integration/oneof-unions-snake/google/protobuf/struct.ts +++ b/integration/oneof-unions-snake/google/protobuf/struct.ts @@ -159,7 +159,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]; }); } @@ -168,7 +168,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; @@ -313,8 +313,9 @@ export const Value = { toJSON(message: Value): unknown { const obj: any = {}; - message.kind?.$case === "null_value" && - (obj.null_value = message.kind?.null_value !== undefined ? nullValueToJSON(message.kind?.null_value) : undefined); + message.kind?.$case === "null_value" && (obj.null_value = message.kind?.null_value !== undefined + ? nullValueToJSON(message.kind?.null_value) + : undefined); message.kind?.$case === "number_value" && (obj.number_value = message.kind?.number_value); message.kind?.$case === "string_value" && (obj.string_value = message.kind?.string_value); message.kind?.$case === "bool_value" && (obj.bool_value = message.kind?.bool_value); @@ -331,16 +332,16 @@ export const Value = { message.kind = { $case: "null_value", null_value: object.kind.null_value }; } if ( - object.kind?.$case === "number_value" && - object.kind?.number_value !== undefined && - object.kind?.number_value !== null + object.kind?.$case === "number_value" + && object.kind?.number_value !== undefined + && object.kind?.number_value !== null ) { message.kind = { $case: "number_value", number_value: object.kind.number_value }; } if ( - object.kind?.$case === "string_value" && - object.kind?.string_value !== undefined && - object.kind?.string_value !== null + object.kind?.$case === "string_value" + && object.kind?.string_value !== undefined + && object.kind?.string_value !== null ) { message.kind = { $case: "string_value", string_value: object.kind.string_value }; } @@ -350,9 +351,9 @@ export const Value = { message.kind = { $case: "bool_value", bool_value: object.kind.bool_value }; } if ( - object.kind?.$case === "struct_value" && - object.kind?.struct_value !== undefined && - object.kind?.struct_value !== null + object.kind?.$case === "struct_value" + && object.kind?.struct_value !== undefined + && object.kind?.struct_value !== null ) { message.kind = { $case: "struct_value", struct_value: object.kind.struct_value }; } @@ -442,7 +443,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 = []; } diff --git a/integration/oneof-unions/google/protobuf/struct.ts b/integration/oneof-unions/google/protobuf/struct.ts index 4a5c792f7..0a7fec23f 100644 --- a/integration/oneof-unions/google/protobuf/struct.ts +++ b/integration/oneof-unions/google/protobuf/struct.ts @@ -159,7 +159,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]; }); } @@ -168,7 +168,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; @@ -310,8 +310,8 @@ export const Value = { toJSON(message: Value): unknown { const obj: any = {}; - message.kind?.$case === "nullValue" && - (obj.nullValue = message.kind?.nullValue !== undefined ? nullValueToJSON(message.kind?.nullValue) : undefined); + message.kind?.$case === "nullValue" + && (obj.nullValue = message.kind?.nullValue !== undefined ? nullValueToJSON(message.kind?.nullValue) : undefined); message.kind?.$case === "numberValue" && (obj.numberValue = message.kind?.numberValue); message.kind?.$case === "stringValue" && (obj.stringValue = message.kind?.stringValue); message.kind?.$case === "boolValue" && (obj.boolValue = message.kind?.boolValue); @@ -326,16 +326,16 @@ export const Value = { message.kind = { $case: "nullValue", nullValue: object.kind.nullValue }; } if ( - object.kind?.$case === "numberValue" && - object.kind?.numberValue !== undefined && - object.kind?.numberValue !== null + object.kind?.$case === "numberValue" + && object.kind?.numberValue !== undefined + && object.kind?.numberValue !== null ) { message.kind = { $case: "numberValue", numberValue: object.kind.numberValue }; } if ( - object.kind?.$case === "stringValue" && - object.kind?.stringValue !== undefined && - object.kind?.stringValue !== null + object.kind?.$case === "stringValue" + && object.kind?.stringValue !== undefined + && object.kind?.stringValue !== null ) { message.kind = { $case: "stringValue", stringValue: object.kind.stringValue }; } @@ -343,9 +343,9 @@ export const Value = { message.kind = { $case: "boolValue", boolValue: object.kind.boolValue }; } if ( - object.kind?.$case === "structValue" && - object.kind?.structValue !== undefined && - object.kind?.structValue !== null + object.kind?.$case === "structValue" + && object.kind?.structValue !== undefined + && object.kind?.structValue !== null ) { message.kind = { $case: "structValue", structValue: object.kind.structValue }; } @@ -433,7 +433,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 = []; } diff --git a/integration/oneof-unions/oneof.ts b/integration/oneof-unions/oneof.ts index e89ecca74..43799f69e 100644 --- a/integration/oneof-unions/oneof.ts +++ b/integration/oneof-unions/oneof.ts @@ -207,8 +207,10 @@ export const PleaseChoose = { message.name !== undefined && (obj.name = message.name); message.choice?.$case === "aNumber" && (obj.aNumber = message.choice?.aNumber); message.choice?.$case === "aString" && (obj.aString = message.choice?.aString); - message.choice?.$case === "aMessage" && - (obj.aMessage = message.choice?.aMessage ? PleaseChoose_Submessage.toJSON(message.choice?.aMessage) : undefined); + message.choice?.$case === "aMessage" + && (obj.aMessage = message.choice?.aMessage + ? PleaseChoose_Submessage.toJSON(message.choice?.aMessage) + : undefined); message.choice?.$case === "aBool" && (obj.aBool = message.choice?.aBool); message.choice?.$case === "bunchaBytes" && (obj.bunchaBytes = message.choice?.bunchaBytes !== undefined ? base64FromBytes(message.choice?.bunchaBytes) @@ -220,8 +222,8 @@ export const PleaseChoose = { message.eitherOr?.$case === "either" && (obj.either = message.eitherOr?.either); message.eitherOr?.$case === "or" && (obj.or = message.eitherOr?.or); message.eitherOr?.$case === "thirdOption" && (obj.thirdOption = message.eitherOr?.thirdOption); - message.signature !== undefined && - (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); + message.signature !== undefined + && (obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array())); message.value !== undefined && (obj.value = message.value); return obj; }, @@ -244,9 +246,9 @@ export const PleaseChoose = { message.choice = { $case: "aBool", aBool: object.choice.aBool }; } if ( - object.choice?.$case === "bunchaBytes" && - object.choice?.bunchaBytes !== undefined && - object.choice?.bunchaBytes !== null + object.choice?.$case === "bunchaBytes" + && object.choice?.bunchaBytes !== undefined + && object.choice?.bunchaBytes !== null ) { message.choice = { $case: "bunchaBytes", bunchaBytes: object.choice.bunchaBytes }; } @@ -263,9 +265,9 @@ export const PleaseChoose = { message.eitherOr = { $case: "or", or: object.eitherOr.or }; } if ( - object.eitherOr?.$case === "thirdOption" && - object.eitherOr?.thirdOption !== undefined && - object.eitherOr?.thirdOption !== null + object.eitherOr?.$case === "thirdOption" + && object.eitherOr?.thirdOption !== undefined + && object.eitherOr?.thirdOption !== null ) { message.eitherOr = { $case: "thirdOption", thirdOption: object.eitherOr.thirdOption }; } diff --git a/integration/options/google/protobuf/descriptor.ts b/integration/options/google/protobuf/descriptor.ts index 165656a02..b2bd9100d 100644 --- a/integration/options/google/protobuf/descriptor.ts +++ b/integration/options/google/protobuf/descriptor.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -import { FileDescriptorProto as FileDescriptorProto1 } from "ts-proto-descriptors"; import * as Long from "long"; import * as _m0 from "protobufjs/minimal"; +import { FileDescriptorProto as FileDescriptorProto1 } from "ts-proto-descriptors"; export const protobufPackage = "google.protobuf"; @@ -4403,7 +4403,7 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 1, 2, 1], "span": [63, 2, 30], "leadingComments": "", - "trailingComments": ' e.g. "foo", "foo.bar", etc.\n', + "trailingComments": " e.g. \"foo\", \"foo.bar\", etc.\n", "leadingDetachedComments": [], }, { "path": [4, 1, 2, 2], @@ -4440,7 +4440,7 @@ export const protoMetadata: ProtoMetadata = { }, { "path": [4, 1, 2, 11], "span": [89, 2, 30], - "leadingComments": ' The syntax of the proto file.\n The supported values are "proto2" and "proto3".\n', + "leadingComments": " The syntax of the proto file.\n The supported values are \"proto2\" and \"proto3\".\n", "trailingComments": "", "leadingDetachedComments": [], }, { @@ -4587,7 +4587,7 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 4, 2, 6], "span": [202, 2, 36], "leadingComments": - ' For numeric types, contains the original text representation of the value.\n For booleans, "true" or "false".\n For strings, contains the default text contents (not escaped in any way).\n For bytes, contains the C escaped value. All bytes >= 128 are escaped.\n TODO(kenton): Base-64 encode?\n', + " For numeric types, contains the original text representation of the value.\n For booleans, \"true\" or \"false\".\n For strings, contains the default text contents (not escaped in any way).\n For bytes, contains the C escaped value. All bytes >= 128 are escaped.\n TODO(kenton): Base-64 encode?\n", "trailingComments": "", "leadingDetachedComments": [], }, { @@ -4608,7 +4608,7 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 4, 2, 10], "span": [237, 2, 37], "leadingComments": - ' If true, this is a proto3 "optional". When a proto3 field is optional, it\n tracks presence regardless of field type.\n\n When proto3_optional is true, this field must be belong to a oneof to\n signal to old proto3 clients that presence is tracked for this field. This\n oneof is known as a "synthetic" oneof, and this field must be its sole\n member (each proto3 optional field gets its own synthetic oneof). Synthetic\n oneofs exist in the descriptor only, and do not generate any API. Synthetic\n oneofs must be ordered after all "real" oneofs.\n\n For message fields, proto3_optional doesn\'t create any semantic change,\n since non-repeated message fields always track presence. However it still\n indicates the semantic detail of whether the user wrote "optional" or not.\n This can be useful for round-tripping the .proto file. For consistency we\n give message fields a synthetic oneof also, even though it is not required\n to track presence. This is especially important because the parser can\'t\n tell if a field is a message or an enum, so it must always create a\n synthetic oneof.\n\n Proto2 optional fields do not set this flag, because they already indicate\n optional with `LABEL_OPTIONAL`.\n', + " If true, this is a proto3 \"optional\". When a proto3 field is optional, it\n tracks presence regardless of field type.\n\n When proto3_optional is true, this field must be belong to a oneof to\n signal to old proto3 clients that presence is tracked for this field. This\n oneof is known as a \"synthetic\" oneof, and this field must be its sole\n member (each proto3 optional field gets its own synthetic oneof). Synthetic\n oneofs exist in the descriptor only, and do not generate any API. Synthetic\n oneofs must be ordered after all \"real\" oneofs.\n\n For message fields, proto3_optional doesn't create any semantic change,\n since non-repeated message fields always track presence. However it still\n indicates the semantic detail of whether the user wrote \"optional\" or not.\n This can be useful for round-tripping the .proto file. For consistency we\n give message fields a synthetic oneof also, even though it is not required\n to track presence. This is especially important because the parser can't\n tell if a field is a message or an enum, so it must always create a\n synthetic oneof.\n\n Proto2 optional fields do not set this flag, because they already indicate\n optional with `LABEL_OPTIONAL`.\n", "trailingComments": "", "leadingDetachedComments": [], }, { @@ -4762,7 +4762,7 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 10, 2, 7], "span": [406, 2, 59], "leadingComments": - ' Should generic services be generated in each language? "Generic" services\n are not specific to any particular RPC system. They are generated by the\n main code generators in each language (without additional plugins).\n Generic services were the only kind of service generation supported by\n early versions of google.protobuf.\n\n Generic services are now considered deprecated in favor of using plugins\n that generate code specific to your particular RPC system. Therefore,\n these default to false. Old code which depends on generic services should\n explicitly set them to true.\n', + " Should generic services be generated in each language? \"Generic\" services\n are not specific to any particular RPC system. They are generated by the\n main code generators in each language (without additional plugins).\n Generic services were the only kind of service generation supported by\n early versions of google.protobuf.\n\n Generic services are now considered deprecated in favor of using plugins\n that generate code specific to your particular RPC system. Therefore,\n these default to false. Old code which depends on generic services should\n explicitly set them to true.\n", "trailingComments": "", "leadingDetachedComments": [], }, { @@ -4831,14 +4831,14 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 10, 2, 20], "span": [457, 2, 58], "leadingComments": - ' The parser stores options it doesn\'t recognize here.\n See the documentation for the "Options" section above.\n', + " The parser stores options it doesn't recognize here.\n See the documentation for the \"Options\" section above.\n", "trailingComments": "", "leadingDetachedComments": [], }, { "path": [4, 10, 5], "span": [461, 2, 25], "leadingComments": - ' Clients can define custom options in extensions of this message.\n See the documentation for the "Options" section above.\n', + " Clients can define custom options in extensions of this message.\n See the documentation for the \"Options\" section above.\n", "trailingComments": "", "leadingDetachedComments": [], }, { @@ -4852,7 +4852,7 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 11, 2, 1], "span": [490, 2, 70], "leadingComments": - ' Disables the generation of the standard "descriptor()" accessor, which can\n conflict with a field of the same name. This is meant to make migration\n from proto1 easier; new code should avoid fields named "descriptor".\n', + " Disables the generation of the standard \"descriptor()\" accessor, which can\n conflict with a field of the same name. This is meant to make migration\n from proto1 easier; new code should avoid fields named \"descriptor\".\n", "trailingComments": "", "leadingDetachedComments": [], }, { @@ -4917,7 +4917,7 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 12, 2, 2], "span": [566, 2, 51], "leadingComments": - ' The jstype option determines the JavaScript type used for values of the\n field. The option is permitted only for 64 bit integral and fixed types\n (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING\n is represented as JavaScript string, which avoids loss of precision that\n can happen when a large value is converted to a floating point JavaScript.\n Specifying JS_NUMBER for the jstype causes the generated JavaScript code to\n use the JavaScript "number" type. The behavior of the default option\n JS_NORMAL is implementation dependent.\n\n This option is an enum to permit additional types to be added, e.g.\n goog.math.Integer.\n', + " The jstype option determines the JavaScript type used for values of the\n field. The option is permitted only for 64 bit integral and fixed types\n (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING\n is represented as JavaScript string, which avoids loss of precision that\n can happen when a large value is converted to a floating point JavaScript.\n Specifying JS_NUMBER for the jstype causes the generated JavaScript code to\n use the JavaScript \"number\" type. The behavior of the default option\n JS_NORMAL is implementation dependent.\n\n This option is an enum to permit additional types to be added, e.g.\n goog.math.Integer.\n", "trailingComments": "", "leadingDetachedComments": [], }, { @@ -5110,7 +5110,7 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 18, 3, 0], "span": [734, 2, 737, 3], "leadingComments": - ' The name of the uninterpreted option. Each string represents a segment in\n a dot-separated name. is_extension is true iff a segment represents an\n extension (denoted with parentheses in options specs in .proto files).\n E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents\n "foo.(bar.baz).qux".\n', + " The name of the uninterpreted option. Each string represents a segment in\n a dot-separated name. is_extension is true iff a segment represents an\n extension (denoted with parentheses in options specs in .proto files).\n E.g.,{ [\"foo\", false], [\"bar.baz\", true], [\"qux\", false] } represents\n \"foo.(bar.baz).qux\".\n", "trailingComments": "", "leadingDetachedComments": [], }, { @@ -5133,7 +5133,7 @@ export const protoMetadata: ProtoMetadata = { "path": [4, 19, 2, 0], "span": [799, 2, 33], "leadingComments": - ' A Location identifies a piece of source code in a .proto file which\n corresponds to a particular definition. This information is intended\n to be useful to IDEs, code indexers, documentation generators, and similar\n tools.\n\n For example, say we have a file like:\n message Foo {\n optional string foo = 1;\n }\n Let\'s look at just the field definition:\n optional string foo = 1;\n ^ ^^ ^^ ^ ^^^\n a bc de f ghi\n We have the following locations:\n span path represents\n [a,i) [ 4, 0, 2, 0 ] The whole field definition.\n [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).\n [c,d) [ 4, 0, 2, 0, 5 ] The type (string).\n [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).\n [g,h) [ 4, 0, 2, 0, 3 ] The number (1).\n\n Notes:\n - A location may refer to a repeated field itself (i.e. not to any\n particular index within it). This is used whenever a set of elements are\n logically enclosed in a single code segment. For example, an entire\n extend block (possibly containing multiple extension definitions) will\n have an outer location whose path refers to the "extensions" repeated\n field without an index.\n - Multiple locations may have the same path. This happens when a single\n logical declaration is spread out across multiple places. The most\n obvious example is the "extend" block again -- there may be multiple\n extend blocks in the same scope, each of which will have the same path.\n - A location\'s span is not always a subset of its parent\'s span. For\n example, the "extendee" of an extension declaration appears at the\n beginning of the "extend" block and is shared by all extensions within\n the block.\n - Just because a location\'s span is a subset of some other location\'s span\n does not mean that it is a descendant. For example, a "group" defines\n both a type and a field in a single declaration. Thus, the locations\n corresponding to the type and field and their components will overlap.\n - Code which tries to interpret locations should probably be designed to\n ignore those that it doesn\'t understand, as more types of locations could\n be recorded in the future.\n', + " A Location identifies a piece of source code in a .proto file which\n corresponds to a particular definition. This information is intended\n to be useful to IDEs, code indexers, documentation generators, and similar\n tools.\n\n For example, say we have a file like:\n message Foo {\n optional string foo = 1;\n }\n Let's look at just the field definition:\n optional string foo = 1;\n ^ ^^ ^^ ^ ^^^\n a bc de f ghi\n We have the following locations:\n span path represents\n [a,i) [ 4, 0, 2, 0 ] The whole field definition.\n [a,b) [ 4, 0, 2, 0, 4 ] The label (optional).\n [c,d) [ 4, 0, 2, 0, 5 ] The type (string).\n [e,f) [ 4, 0, 2, 0, 1 ] The name (foo).\n [g,h) [ 4, 0, 2, 0, 3 ] The number (1).\n\n Notes:\n - A location may refer to a repeated field itself (i.e. not to any\n particular index within it). This is used whenever a set of elements are\n logically enclosed in a single code segment. For example, an entire\n extend block (possibly containing multiple extension definitions) will\n have an outer location whose path refers to the \"extensions\" repeated\n field without an index.\n - Multiple locations may have the same path. This happens when a single\n logical declaration is spread out across multiple places. The most\n obvious example is the \"extend\" block again -- there may be multiple\n extend blocks in the same scope, each of which will have the same path.\n - A location's span is not always a subset of its parent's span. For\n example, the \"extendee\" of an extension declaration appears at the\n beginning of the \"extend\" block and is shared by all extensions within\n the block.\n - Just because a location's span is a subset of some other location's span\n does not mean that it is a descendant. For example, a \"group\" defines\n both a type and a field in a single declaration. Thus, the locations\n corresponding to the type and field and their components will overlap.\n - Code which tries to interpret locations should probably be designed to\n ignore those that it doesn't understand, as more types of locations could\n be recorded in the future.\n", "trailingComments": "", "leadingDetachedComments": [], }, { diff --git a/integration/options/options.ts b/integration/options/options.ts index 0ad89d8ed..3438825d9 100644 --- a/integration/options/options.ts +++ b/integration/options/options.ts @@ -1,8 +1,8 @@ /* eslint-disable */ +import * as _m0 from "protobufjs/minimal"; import { FileDescriptorProto as FileDescriptorProto1 } from "ts-proto-descriptors"; import { protoMetadata as protoMetadata1 } from "./google/protobuf/descriptor"; import { protoMetadata as protoMetadata2, Something } from "./something/something"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = ""; @@ -137,7 +137,7 @@ export class MyServiceClientImpl implements MyService { MyMethod(request: RequestType): Promise { const data = RequestType.encode(request).finish(); const promise = this.rpc.request("MyService", "MyMethod", data); - return promise.then((data) => ResponseType.decode(new _m0.Reader(data))); + return promise.then(data => ResponseType.decode(new _m0.Reader(data))); } } diff --git a/integration/options/something/something.ts b/integration/options/something/something.ts index fec4af4d3..7fb1154f3 100644 --- a/integration/options/something/something.ts +++ b/integration/options/something/something.ts @@ -1,7 +1,7 @@ /* eslint-disable */ +import * as _m0 from "protobufjs/minimal"; import { FileDescriptorProto as FileDescriptorProto1 } from "ts-proto-descriptors"; import { protoMetadata as protoMetadata1 } from "../google/protobuf/descriptor"; -import * as _m0 from "protobufjs/minimal"; export const protobufPackage = "something"; diff --git a/integration/return-observable/observable.ts b/integration/return-observable/observable.ts index 5c076d46b..06edefb9e 100644 --- a/integration/return-observable/observable.ts +++ b/integration/return-observable/observable.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Observable } from "rxjs"; import * as _m0 from "protobufjs/minimal"; +import { Observable } from "rxjs"; export const protobufPackage = ""; diff --git a/integration/simple-json-name/simple.ts b/integration/simple-json-name/simple.ts index d9aff45d5..06981e8bc 100644 --- a/integration/simple-json-name/simple.ts +++ b/integration/simple-json-name/simple.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "./google/protobuf/timestamp"; export const protobufPackage = "simple"; @@ -119,7 +119,7 @@ export const Simple = { message.dollarStart !== undefined && (obj.$dollar = message.dollarStart); message.dollarEnd !== undefined && (obj.dollar$ = message.dollarEnd); if (message.hyphenList) { - obj["hyphen-list"] = message.hyphenList.map((e) => e); + obj["hyphen-list"] = message.hyphenList.map(e => e); } else { obj["hyphen-list"] = []; } diff --git a/integration/simple-long-string/google/protobuf/wrappers.ts b/integration/simple-long-string/google/protobuf/wrappers.ts index 9deb01d20..73e97573e 100644 --- a/integration/simple-long-string/google/protobuf/wrappers.ts +++ b/integration/simple-long-string/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/simple-long-string/simple.ts b/integration/simple-long-string/simple.ts index 609fb19d6..76ee51e3e 100644 --- a/integration/simple-long-string/simple.ts +++ b/integration/simple-long-string/simple.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; import * as Long from "long"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "./google/protobuf/timestamp"; import { UInt64Value } from "./google/protobuf/wrappers"; export const protobufPackage = "simple"; diff --git a/integration/simple-long/google/protobuf/wrappers.ts b/integration/simple-long/google/protobuf/wrappers.ts index c7b5789ab..e3f6f5cb5 100644 --- a/integration/simple-long/google/protobuf/wrappers.ts +++ b/integration/simple-long/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/simple-long/simple.ts b/integration/simple-long/simple.ts index 453afe1ab..4ed2360d5 100644 --- a/integration/simple-long/simple.ts +++ b/integration/simple-long/simple.ts @@ -131,12 +131,12 @@ export const SimpleWithWrappers = { message.enabled !== undefined && (obj.enabled = message.enabled); message.bananas !== undefined && (obj.bananas = message.bananas); if (message.coins) { - obj.coins = message.coins.map((e) => e); + obj.coins = message.coins.map(e => e); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } @@ -617,7 +617,7 @@ export const Numbers = { message.sfixed32 !== undefined && (obj.sfixed32 = Math.round(message.sfixed32)); message.sfixed64 !== undefined && (obj.sfixed64 = (message.sfixed64 || Long.ZERO).toString()); if (message.manyUint64) { - obj.manyUint64 = message.manyUint64.map((e) => (e || Long.UZERO).toString()); + obj.manyUint64 = message.manyUint64.map(e => (e || Long.UZERO).toString()); } else { obj.manyUint64 = []; } diff --git a/integration/simple-optionals/google/protobuf/wrappers.ts b/integration/simple-optionals/google/protobuf/wrappers.ts index 3145298cb..22e0e03e4 100644 --- a/integration/simple-optionals/google/protobuf/wrappers.ts +++ b/integration/simple-optionals/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/simple-optionals/import_dir/thing.ts b/integration/simple-optionals/import_dir/thing.ts index c796f8574..6e927d7cc 100644 --- a/integration/simple-optionals/import_dir/thing.ts +++ b/integration/simple-optionals/import_dir/thing.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Timestamp } from "../google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "../google/protobuf/timestamp"; export const protobufPackage = "simple"; diff --git a/integration/simple-optionals/simple.ts b/integration/simple-optionals/simple.ts index c8f1520c0..e1b053eed 100644 --- a/integration/simple-optionals/simple.ts +++ b/integration/simple-optionals/simple.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import { ImportedThing } from "./import_dir/thing"; -import { Timestamp } from "./google/protobuf/timestamp"; import * as Long from "long"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "./google/protobuf/timestamp"; import { BoolValue, Int32Value, StringValue } from "./google/protobuf/wrappers"; +import { ImportedThing } from "./import_dir/thing"; export const protobufPackage = "simple"; @@ -376,22 +376,22 @@ export const Simple = { message.child !== undefined && (obj.child = message.child ? Child.toJSON(message.child) : undefined); message.state !== undefined && (obj.state = stateEnumToJSON(message.state)); if (message.grandChildren) { - obj.grandChildren = message.grandChildren.map((e) => e ? Child.toJSON(e) : undefined); + obj.grandChildren = message.grandChildren.map(e => e ? Child.toJSON(e) : undefined); } else { obj.grandChildren = []; } if (message.coins) { - obj.coins = message.coins.map((e) => Math.round(e)); + obj.coins = message.coins.map(e => Math.round(e)); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } if (message.oldStates) { - obj.oldStates = message.oldStates.map((e) => stateEnumToJSON(e)); + obj.oldStates = message.oldStates.map(e => stateEnumToJSON(e)); } else { obj.oldStates = []; } @@ -528,8 +528,8 @@ export const Nested = { toJSON(message: Nested): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.message !== undefined && - (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); + message.message !== undefined + && (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); message.state !== undefined && (obj.state = nested_InnerEnumToJSON(message.state)); return obj; }, @@ -591,8 +591,8 @@ export const Nested_InnerMessage = { toJSON(message: Nested_InnerMessage): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.deep !== undefined && - (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); + message.deep !== undefined + && (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); return obj; }, @@ -783,12 +783,12 @@ export const SimpleWithWrappers = { message.age !== undefined && (obj.age = message.age); message.enabled !== undefined && (obj.enabled = message.enabled); if (message.coins) { - obj.coins = message.coins.map((e) => e); + obj.coins = message.coins.map(e => e); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } @@ -1557,7 +1557,7 @@ export class PingServiceClientImpl implements PingService { ping(request: PingRequest): Promise { const data = PingRequest.encode(request).finish(); const promise = this.rpc.request("simple.PingService", "ping", data); - return promise.then((data) => PingResponse.decode(new _m0.Reader(data))); + return promise.then(data => PingResponse.decode(new _m0.Reader(data))); } } diff --git a/integration/simple-optionals/thing.ts b/integration/simple-optionals/thing.ts index 4c23af81c..2c6c6da30 100644 --- a/integration/simple-optionals/thing.ts +++ b/integration/simple-optionals/thing.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "./google/protobuf/timestamp"; export const protobufPackage = "simple"; diff --git a/integration/simple-prototype-defaults/google/protobuf/wrappers.ts b/integration/simple-prototype-defaults/google/protobuf/wrappers.ts index e6fb1977d..b1ae2efa6 100644 --- a/integration/simple-prototype-defaults/google/protobuf/wrappers.ts +++ b/integration/simple-prototype-defaults/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/simple-prototype-defaults/import_dir/thing.ts b/integration/simple-prototype-defaults/import_dir/thing.ts index 627f63fe6..4e66a15cf 100644 --- a/integration/simple-prototype-defaults/import_dir/thing.ts +++ b/integration/simple-prototype-defaults/import_dir/thing.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Timestamp } from "../google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "../google/protobuf/timestamp"; export const protobufPackage = "simple"; diff --git a/integration/simple-prototype-defaults/simple.ts b/integration/simple-prototype-defaults/simple.ts index 75641dc53..cc3cfb2bb 100644 --- a/integration/simple-prototype-defaults/simple.ts +++ b/integration/simple-prototype-defaults/simple.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; import * as Long from "long"; -import { ImportedThing } from "./import_dir/thing"; -import { DateMessage } from "./google/type/date"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "./google/protobuf/timestamp"; import { BoolValue, BytesValue, Int32Value, StringValue } from "./google/protobuf/wrappers"; +import { DateMessage } from "./google/type/date"; +import { ImportedThing } from "./import_dir/thing"; export const protobufPackage = "simple"; @@ -462,35 +462,35 @@ export const Simple = { message.child !== undefined && (obj.child = message.child ? Child.toJSON(message.child) : undefined); message.state !== undefined && (obj.state = stateEnumToJSON(message.state)); if (message.grandChildren) { - obj.grandChildren = message.grandChildren.map((e) => e ? Child.toJSON(e) : undefined); + obj.grandChildren = message.grandChildren.map(e => e ? Child.toJSON(e) : undefined); } else { obj.grandChildren = []; } if (message.coins) { - obj.coins = message.coins.map((e) => Math.round(e)); + obj.coins = message.coins.map(e => Math.round(e)); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } if (message.oldStates) { - obj.oldStates = message.oldStates.map((e) => stateEnumToJSON(e)); + obj.oldStates = message.oldStates.map(e => stateEnumToJSON(e)); } else { obj.oldStates = []; } message.thing !== undefined && (obj.thing = message.thing ? ImportedThing.toJSON(message.thing) : undefined); if (message.blobs) { - obj.blobs = message.blobs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + obj.blobs = message.blobs.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.blobs = []; } - message.birthday !== undefined && - (obj.birthday = message.birthday ? DateMessage.toJSON(message.birthday) : undefined); - message.blob !== undefined && - (obj.blob = base64FromBytes(message.blob !== undefined ? message.blob : new Uint8Array())); + message.birthday !== undefined + && (obj.birthday = message.birthday ? DateMessage.toJSON(message.birthday) : undefined); + message.blob !== undefined + && (obj.blob = base64FromBytes(message.blob !== undefined ? message.blob : new Uint8Array())); return obj; }, @@ -628,8 +628,8 @@ export const Nested = { toJSON(message: Nested): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.message !== undefined && - (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); + message.message !== undefined + && (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); message.state !== undefined && (obj.state = nested_InnerEnumToJSON(message.state)); return obj; }, @@ -691,8 +691,8 @@ export const Nested_InnerMessage = { toJSON(message: Nested_InnerMessage): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.deep !== undefined && - (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); + message.deep !== undefined + && (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); return obj; }, @@ -890,12 +890,12 @@ export const SimpleWithWrappers = { message.age !== undefined && (obj.age = message.age); message.enabled !== undefined && (obj.enabled = message.enabled); if (message.coins) { - obj.coins = message.coins.map((e) => e); + obj.coins = message.coins.map(e => e); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } @@ -1504,8 +1504,8 @@ export const SimpleWithMap_MapOfBytesEntry = { toJSON(message: SimpleWithMap_MapOfBytesEntry): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); - 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; }, @@ -2257,11 +2257,11 @@ export const SimpleButOptional = { message.age !== undefined && (obj.age = Math.round(message.age)); message.createdAt !== undefined && (obj.createdAt = message.createdAt.toISOString()); message.child !== undefined && (obj.child = message.child ? Child.toJSON(message.child) : undefined); - message.state !== undefined && - (obj.state = message.state !== undefined ? stateEnumToJSON(message.state) : undefined); + message.state !== undefined + && (obj.state = message.state !== undefined ? stateEnumToJSON(message.state) : undefined); message.thing !== undefined && (obj.thing = message.thing ? ImportedThing.toJSON(message.thing) : undefined); - message.birthday !== undefined && - (obj.birthday = message.birthday ? DateMessage.toJSON(message.birthday) : undefined); + message.birthday !== undefined + && (obj.birthday = message.birthday ? DateMessage.toJSON(message.birthday) : undefined); return obj; }, @@ -2334,7 +2334,7 @@ export class PingServiceClientImpl implements PingService { ping(request: PingRequest): Promise { const data = PingRequest.encode(request).finish(); const promise = this.rpc.request("simple.PingService", "ping", data); - return promise.then((data) => PingResponse.decode(new _m0.Reader(data))); + return promise.then(data => PingResponse.decode(new _m0.Reader(data))); } } diff --git a/integration/simple-snake/google/protobuf/struct.ts b/integration/simple-snake/google/protobuf/struct.ts index 802676863..b6a054d84 100644 --- a/integration/simple-snake/google/protobuf/struct.ts +++ b/integration/simple-snake/google/protobuf/struct.ts @@ -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]; }); } @@ -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; @@ -325,8 +325,8 @@ export const Value = { toJSON(message: Value): unknown { const obj: any = {}; - message.null_value !== undefined && - (obj.null_value = message.null_value !== undefined ? nullValueToJSON(message.null_value) : undefined); + message.null_value !== undefined + && (obj.null_value = message.null_value !== undefined ? nullValueToJSON(message.null_value) : undefined); message.number_value !== undefined && (obj.number_value = message.number_value); message.string_value !== undefined && (obj.string_value = message.string_value); message.bool_value !== undefined && (obj.bool_value = message.bool_value); @@ -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 = []; } diff --git a/integration/simple-snake/google/protobuf/wrappers.ts b/integration/simple-snake/google/protobuf/wrappers.ts index 3145298cb..22e0e03e4 100644 --- a/integration/simple-snake/google/protobuf/wrappers.ts +++ b/integration/simple-snake/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/simple-snake/import_dir/thing.ts b/integration/simple-snake/import_dir/thing.ts index 7f66f0584..9c9af0708 100644 --- a/integration/simple-snake/import_dir/thing.ts +++ b/integration/simple-snake/import_dir/thing.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Timestamp } from "../google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "../google/protobuf/timestamp"; export const protobufPackage = "simple"; diff --git a/integration/simple-snake/simple.ts b/integration/simple-snake/simple.ts index dbc77664a..8f16da79c 100644 --- a/integration/simple-snake/simple.ts +++ b/integration/simple-snake/simple.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; import * as Long from "long"; -import { ImportedThing } from "./import_dir/thing"; import * as _m0 from "protobufjs/minimal"; -import { BoolValue, Int32Value, StringValue } from "./google/protobuf/wrappers"; import { Struct } from "./google/protobuf/struct"; +import { Timestamp } from "./google/protobuf/timestamp"; +import { BoolValue, Int32Value, StringValue } from "./google/protobuf/wrappers"; +import { ImportedThing } from "./import_dir/thing"; export const protobufPackage = "simple"; @@ -381,22 +381,22 @@ export const Simple = { message.child !== undefined && (obj.child = message.child ? Child.toJSON(message.child) : undefined); message.state !== undefined && (obj.state = stateEnumToJSON(message.state)); if (message.grand_children) { - obj.grand_children = message.grand_children.map((e) => e ? Child.toJSON(e) : undefined); + obj.grand_children = message.grand_children.map(e => e ? Child.toJSON(e) : undefined); } else { obj.grand_children = []; } if (message.coins) { - obj.coins = message.coins.map((e) => Math.round(e)); + obj.coins = message.coins.map(e => Math.round(e)); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } if (message.old_states) { - obj.old_states = message.old_states.map((e) => stateEnumToJSON(e)); + obj.old_states = message.old_states.map(e => stateEnumToJSON(e)); } else { obj.old_states = []; } @@ -533,8 +533,8 @@ export const Nested = { toJSON(message: Nested): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.message !== undefined && - (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); + message.message !== undefined + && (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); message.state !== undefined && (obj.state = nested_InnerEnumToJSON(message.state)); return obj; }, @@ -596,8 +596,8 @@ export const Nested_InnerMessage = { toJSON(message: Nested_InnerMessage): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.deep !== undefined && - (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); + message.deep !== undefined + && (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); return obj; }, @@ -788,12 +788,12 @@ export const SimpleWithWrappers = { message.age !== undefined && (obj.age = message.age); message.enabled !== undefined && (obj.enabled = message.enabled); if (message.coins) { - obj.coins = message.coins.map((e) => e); + obj.coins = message.coins.map(e => e); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } @@ -1609,7 +1609,7 @@ export class PingServiceClientImpl implements PingService { ping(request: PingRequest): Promise { const data = PingRequest.encode(request).finish(); const promise = this.rpc.request("simple.PingService", "ping", data); - return promise.then((data) => PingResponse.decode(new _m0.Reader(data))); + return promise.then(data => PingResponse.decode(new _m0.Reader(data))); } } diff --git a/integration/simple-string-enums/google/protobuf/struct.ts b/integration/simple-string-enums/google/protobuf/struct.ts index 4e88bc237..21c510586 100644 --- a/integration/simple-string-enums/google/protobuf/struct.ts +++ b/integration/simple-string-enums/google/protobuf/struct.ts @@ -184,7 +184,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]; }); } @@ -193,7 +193,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; @@ -335,8 +335,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); @@ -433,7 +433,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 = []; } diff --git a/integration/simple-string-enums/simple.ts b/integration/simple-string-enums/simple.ts index 7d476abdf..1accd574c 100644 --- a/integration/simple-string-enums/simple.ts +++ b/integration/simple-string-enums/simple.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { NullValue, nullValueFromJSON, nullValueToJSON, nullValueToNumber } from "./google/protobuf/struct"; import * as _m0 from "protobufjs/minimal"; +import { NullValue, nullValueFromJSON, nullValueToJSON, nullValueToNumber } from "./google/protobuf/struct"; export const protobufPackage = "simple"; @@ -156,7 +156,7 @@ export const Simple = { message.name !== undefined && (obj.name = message.name); message.state !== undefined && (obj.state = stateEnumToJSON(message.state)); if (message.states) { - obj.states = message.states.map((e) => stateEnumToJSON(e)); + obj.states = message.states.map(e => stateEnumToJSON(e)); } else { obj.states = []; } diff --git a/integration/simple-unrecognized-enum/google/protobuf/wrappers.ts b/integration/simple-unrecognized-enum/google/protobuf/wrappers.ts index 3145298cb..22e0e03e4 100644 --- a/integration/simple-unrecognized-enum/google/protobuf/wrappers.ts +++ b/integration/simple-unrecognized-enum/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/simple-unrecognized-enum/import_dir/thing.ts b/integration/simple-unrecognized-enum/import_dir/thing.ts index 76bd88845..126145ed8 100644 --- a/integration/simple-unrecognized-enum/import_dir/thing.ts +++ b/integration/simple-unrecognized-enum/import_dir/thing.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Timestamp } from "../google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "../google/protobuf/timestamp"; export const protobufPackage = "simple"; diff --git a/integration/simple-unrecognized-enum/simple.ts b/integration/simple-unrecognized-enum/simple.ts index 92bf5e29e..045ff7f86 100644 --- a/integration/simple-unrecognized-enum/simple.ts +++ b/integration/simple-unrecognized-enum/simple.ts @@ -1,9 +1,9 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; import * as Long from "long"; -import { ImportedThing } from "./import_dir/thing"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "./google/protobuf/timestamp"; import { BoolValue, Int32Value, StringValue } from "./google/protobuf/wrappers"; +import { ImportedThing } from "./import_dir/thing"; export const protobufPackage = "simple"; @@ -364,22 +364,22 @@ export const Simple = { message.child !== undefined && (obj.child = message.child ? Child.toJSON(message.child) : undefined); message.state !== undefined && (obj.state = stateEnumToJSON(message.state)); if (message.grandChildren) { - obj.grandChildren = message.grandChildren.map((e) => e ? Child.toJSON(e) : undefined); + obj.grandChildren = message.grandChildren.map(e => e ? Child.toJSON(e) : undefined); } else { obj.grandChildren = []; } if (message.coins) { - obj.coins = message.coins.map((e) => Math.round(e)); + obj.coins = message.coins.map(e => Math.round(e)); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } if (message.oldStates) { - obj.oldStates = message.oldStates.map((e) => stateEnumToJSON(e)); + obj.oldStates = message.oldStates.map(e => stateEnumToJSON(e)); } else { obj.oldStates = []; } @@ -516,8 +516,8 @@ export const Nested = { toJSON(message: Nested): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.message !== undefined && - (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); + message.message !== undefined + && (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); message.state !== undefined && (obj.state = nested_InnerEnumToJSON(message.state)); return obj; }, @@ -579,8 +579,8 @@ export const Nested_InnerMessage = { toJSON(message: Nested_InnerMessage): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.deep !== undefined && - (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); + message.deep !== undefined + && (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); return obj; }, @@ -771,12 +771,12 @@ export const SimpleWithWrappers = { message.age !== undefined && (obj.age = message.age); message.enabled !== undefined && (obj.enabled = message.enabled); if (message.coins) { - obj.coins = message.coins.map((e) => e); + obj.coins = message.coins.map(e => e); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } @@ -1545,7 +1545,7 @@ export class PingServiceClientImpl implements PingService { ping(request: PingRequest): Promise { const data = PingRequest.encode(request).finish(); const promise = this.rpc.request("simple.PingService", "ping", data); - return promise.then((data) => PingResponse.decode(new _m0.Reader(data))); + return promise.then(data => PingResponse.decode(new _m0.Reader(data))); } } diff --git a/integration/simple/google/protobuf/wrappers.ts b/integration/simple/google/protobuf/wrappers.ts index 3145298cb..22e0e03e4 100644 --- a/integration/simple/google/protobuf/wrappers.ts +++ b/integration/simple/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/simple/import_dir/thing.ts b/integration/simple/import_dir/thing.ts index 76bd88845..126145ed8 100644 --- a/integration/simple/import_dir/thing.ts +++ b/integration/simple/import_dir/thing.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Timestamp } from "../google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "../google/protobuf/timestamp"; export const protobufPackage = "simple"; diff --git a/integration/simple/simple.ts b/integration/simple/simple.ts index 045a02578..ecfc52714 100644 --- a/integration/simple/simple.ts +++ b/integration/simple/simple.ts @@ -1,10 +1,10 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; import * as Long from "long"; -import { ImportedThing } from "./import_dir/thing"; -import { DateMessage } from "./google/type/date"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "./google/protobuf/timestamp"; import { BoolValue, BytesValue, Int32Value, StringValue } from "./google/protobuf/wrappers"; +import { DateMessage } from "./google/type/date"; +import { ImportedThing } from "./import_dir/thing"; export const protobufPackage = "simple"; @@ -471,35 +471,35 @@ export const Simple = { message.child !== undefined && (obj.child = message.child ? Child.toJSON(message.child) : undefined); message.state !== undefined && (obj.state = stateEnumToJSON(message.state)); if (message.grandChildren) { - obj.grandChildren = message.grandChildren.map((e) => e ? Child.toJSON(e) : undefined); + obj.grandChildren = message.grandChildren.map(e => e ? Child.toJSON(e) : undefined); } else { obj.grandChildren = []; } if (message.coins) { - obj.coins = message.coins.map((e) => Math.round(e)); + obj.coins = message.coins.map(e => Math.round(e)); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } if (message.oldStates) { - obj.oldStates = message.oldStates.map((e) => stateEnumToJSON(e)); + obj.oldStates = message.oldStates.map(e => stateEnumToJSON(e)); } else { obj.oldStates = []; } message.thing !== undefined && (obj.thing = message.thing ? ImportedThing.toJSON(message.thing) : undefined); if (message.blobs) { - obj.blobs = message.blobs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + obj.blobs = message.blobs.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.blobs = []; } - message.birthday !== undefined && - (obj.birthday = message.birthday ? DateMessage.toJSON(message.birthday) : undefined); - message.blob !== undefined && - (obj.blob = base64FromBytes(message.blob !== undefined ? message.blob : new Uint8Array())); + message.birthday !== undefined + && (obj.birthday = message.birthday ? DateMessage.toJSON(message.birthday) : undefined); + message.blob !== undefined + && (obj.blob = base64FromBytes(message.blob !== undefined ? message.blob : new Uint8Array())); message.enabled !== undefined && (obj.enabled = message.enabled); return obj; }, @@ -639,8 +639,8 @@ export const Nested = { toJSON(message: Nested): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.message !== undefined && - (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); + message.message !== undefined + && (obj.message = message.message ? Nested_InnerMessage.toJSON(message.message) : undefined); message.state !== undefined && (obj.state = nested_InnerEnumToJSON(message.state)); return obj; }, @@ -702,8 +702,8 @@ export const Nested_InnerMessage = { toJSON(message: Nested_InnerMessage): unknown { const obj: any = {}; message.name !== undefined && (obj.name = message.name); - message.deep !== undefined && - (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); + message.deep !== undefined + && (obj.deep = message.deep ? Nested_InnerMessage_DeepMessage.toJSON(message.deep) : undefined); return obj; }, @@ -901,12 +901,12 @@ export const SimpleWithWrappers = { message.age !== undefined && (obj.age = message.age); message.enabled !== undefined && (obj.enabled = message.enabled); if (message.coins) { - obj.coins = message.coins.map((e) => e); + obj.coins = message.coins.map(e => e); } else { obj.coins = []; } if (message.snacks) { - obj.snacks = message.snacks.map((e) => e); + obj.snacks = message.snacks.map(e => e); } else { obj.snacks = []; } @@ -1515,8 +1515,8 @@ export const SimpleWithMap_MapOfBytesEntry = { toJSON(message: SimpleWithMap_MapOfBytesEntry): unknown { const obj: any = {}; message.key !== undefined && (obj.key = message.key); - 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; }, @@ -2256,11 +2256,11 @@ export const SimpleButOptional = { message.age !== undefined && (obj.age = Math.round(message.age)); message.createdAt !== undefined && (obj.createdAt = message.createdAt.toISOString()); message.child !== undefined && (obj.child = message.child ? Child.toJSON(message.child) : undefined); - message.state !== undefined && - (obj.state = message.state !== undefined ? stateEnumToJSON(message.state) : undefined); + message.state !== undefined + && (obj.state = message.state !== undefined ? stateEnumToJSON(message.state) : undefined); message.thing !== undefined && (obj.thing = message.thing ? ImportedThing.toJSON(message.thing) : undefined); - message.birthday !== undefined && - (obj.birthday = message.birthday ? DateMessage.toJSON(message.birthday) : undefined); + message.birthday !== undefined + && (obj.birthday = message.birthday ? DateMessage.toJSON(message.birthday) : undefined); return obj; }, @@ -2333,7 +2333,7 @@ export class PingServiceClientImpl implements PingService { ping(request: PingRequest): Promise { const data = PingRequest.encode(request).finish(); const promise = this.rpc.request("simple.PingService", "ping", data); - return promise.then((data) => PingResponse.decode(new _m0.Reader(data))); + return promise.then(data => PingResponse.decode(new _m0.Reader(data))); } } diff --git a/integration/struct/google/protobuf/struct.ts b/integration/struct/google/protobuf/struct.ts index 80a98258e..8c712529b 100644 --- a/integration/struct/google/protobuf/struct.ts +++ b/integration/struct/google/protobuf/struct.ts @@ -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]; }); } @@ -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; @@ -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); @@ -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 = []; } diff --git a/integration/type-registry/bar/bar.ts b/integration/type-registry/bar/bar.ts index 7e760dcdf..a5829e86c 100644 --- a/integration/type-registry/bar/bar.ts +++ b/integration/type-registry/bar/bar.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -import { messageTypeRegistry } from "../typeRegistry"; -import { Foo } from "../foo"; import * as _m0 from "protobufjs/minimal"; +import { Foo } from "../foo"; +import { messageTypeRegistry } from "../typeRegistry"; export const protobufPackage = "foo.bar"; diff --git a/integration/type-registry/foo.ts b/integration/type-registry/foo.ts index bbc0b2b01..3a72b6cec 100644 --- a/integration/type-registry/foo.ts +++ b/integration/type-registry/foo.ts @@ -1,8 +1,8 @@ /* eslint-disable */ -import { messageTypeRegistry } from "./typeRegistry"; -import { Timestamp } from "./google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; import { Struct } from "./google/protobuf/struct"; +import { Timestamp } from "./google/protobuf/timestamp"; +import { messageTypeRegistry } from "./typeRegistry"; export const protobufPackage = "foo"; diff --git a/integration/type-registry/google/protobuf/struct.ts b/integration/type-registry/google/protobuf/struct.ts index 74acf4406..bf6468692 100644 --- a/integration/type-registry/google/protobuf/struct.ts +++ b/integration/type-registry/google/protobuf/struct.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { messageTypeRegistry } from "../../typeRegistry"; import * as _m0 from "protobufjs/minimal"; +import { messageTypeRegistry } from "../../typeRegistry"; export const protobufPackage = "google.protobuf"; @@ -185,7 +185,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]; }); } @@ -194,7 +194,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; @@ -350,8 +350,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); @@ -452,7 +452,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 = []; } diff --git a/integration/type-registry/google/protobuf/timestamp.ts b/integration/type-registry/google/protobuf/timestamp.ts index 9fc79b168..bec2e71ed 100644 --- a/integration/type-registry/google/protobuf/timestamp.ts +++ b/integration/type-registry/google/protobuf/timestamp.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -import { messageTypeRegistry } from "../../typeRegistry"; import * as Long from "long"; import * as _m0 from "protobufjs/minimal"; +import { messageTypeRegistry } from "../../typeRegistry"; export const protobufPackage = "google.protobuf"; diff --git a/integration/unknown-fields/google/protobuf/compiler/plugin.ts b/integration/unknown-fields/google/protobuf/compiler/plugin.ts index 0ed17b03b..81b022549 100644 --- a/integration/unknown-fields/google/protobuf/compiler/plugin.ts +++ b/integration/unknown-fields/google/protobuf/compiler/plugin.ts @@ -1,7 +1,7 @@ /* eslint-disable */ import * as Long from "long"; -import { FileDescriptorProto, GeneratedCodeInfo } from "../descriptor"; import * as _m0 from "protobufjs/minimal"; +import { FileDescriptorProto, GeneratedCodeInfo } from "../descriptor"; export const protobufPackage = "google.protobuf.compiler"; diff --git a/integration/unknown-fields/options.ts b/integration/unknown-fields/options.ts index fb0869ba5..cd06fbfff 100644 --- a/integration/unknown-fields/options.ts +++ b/integration/unknown-fields/options.ts @@ -194,7 +194,7 @@ export class MyServiceClientImpl implements MyService { MyMethod(request: RequestType): Promise { const data = RequestType.encode(request).finish(); const promise = this.rpc.request("MyService", "MyMethod", data); - return promise.then((data) => ResponseType.decode(new _m0.Reader(data))); + return promise.then(data => ResponseType.decode(new _m0.Reader(data))); } } diff --git a/integration/use-date-false/metadata.ts b/integration/use-date-false/metadata.ts index 4bffb848d..03416ce90 100644 --- a/integration/use-date-false/metadata.ts +++ b/integration/use-date-false/metadata.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "./google/protobuf/timestamp"; export const protobufPackage = ""; diff --git a/integration/use-date-string/use-date-string.ts b/integration/use-date-string/use-date-string.ts index 62c6e70e5..c3a37b140 100644 --- a/integration/use-date-string/use-date-string.ts +++ b/integration/use-date-string/use-date-string.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; import * as _m0 from "protobufjs/minimal"; +import { Timestamp } from "./google/protobuf/timestamp"; export const protobufPackage = ""; @@ -96,7 +96,7 @@ export const Todo = { message.id !== undefined && (obj.id = message.id); message.timestamp !== undefined && (obj.timestamp = message.timestamp); if (message.repeatedTimestamp) { - obj.repeatedTimestamp = message.repeatedTimestamp.map((e) => e); + obj.repeatedTimestamp = message.repeatedTimestamp.map(e => e); } else { obj.repeatedTimestamp = []; } diff --git a/integration/use-date-true/use-date-true.ts b/integration/use-date-true/use-date-true.ts index 56cd91148..1214f6b2b 100644 --- a/integration/use-date-true/use-date-true.ts +++ b/integration/use-date-true/use-date-true.ts @@ -1,7 +1,7 @@ /* eslint-disable */ -import { Timestamp } from "./google/protobuf/timestamp"; -import { Empty } from "./google/protobuf/empty"; import * as _m0 from "protobufjs/minimal"; +import { Empty } from "./google/protobuf/empty"; +import { Timestamp } from "./google/protobuf/timestamp"; export const protobufPackage = ""; @@ -97,7 +97,7 @@ export const Todo = { message.id !== undefined && (obj.id = message.id); message.timestamp !== undefined && (obj.timestamp = message.timestamp.toISOString()); if (message.repeatedTimestamp) { - obj.repeatedTimestamp = message.repeatedTimestamp.map((e) => e.toISOString()); + obj.repeatedTimestamp = message.repeatedTimestamp.map(e => e.toISOString()); } else { obj.repeatedTimestamp = []; } @@ -201,7 +201,7 @@ export class ClockClientImpl implements Clock { Now(request: Empty): Promise { const data = Empty.encode(request).finish(); const promise = this.rpc.request("Clock", "Now", data); - return promise.then((data) => fromTimestamp(Timestamp.decode(new _m0.Reader(data)))); + return promise.then(data => fromTimestamp(Timestamp.decode(new _m0.Reader(data)))); } } diff --git a/integration/use-numeric-enum-json/google/protobuf/struct.ts b/integration/use-numeric-enum-json/google/protobuf/struct.ts index d17382273..5caffc650 100644 --- a/integration/use-numeric-enum-json/google/protobuf/struct.ts +++ b/integration/use-numeric-enum-json/google/protobuf/struct.ts @@ -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]; }); } @@ -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; @@ -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); @@ -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 = []; } diff --git a/integration/use-numeric-enum-json/simple.ts b/integration/use-numeric-enum-json/simple.ts index 0e7924be7..38cba06af 100644 --- a/integration/use-numeric-enum-json/simple.ts +++ b/integration/use-numeric-enum-json/simple.ts @@ -1,6 +1,6 @@ /* eslint-disable */ -import { NullValue, nullValueFromJSON, nullValueToJSON } from "./google/protobuf/struct"; import * as _m0 from "protobufjs/minimal"; +import { NullValue, nullValueFromJSON, nullValueToJSON } from "./google/protobuf/struct"; export const protobufPackage = "simple"; @@ -142,7 +142,7 @@ export const Simple = { message.name !== undefined && (obj.name = message.name); message.state !== undefined && (obj.state = stateEnumToJSON(message.state)); if (message.states) { - obj.states = message.states.map((e) => stateEnumToJSON(e)); + obj.states = message.states.map(e => stateEnumToJSON(e)); } else { obj.states = []; } diff --git a/integration/use-objectid-true-external-import/use-objectid-true.ts b/integration/use-objectid-true-external-import/use-objectid-true.ts index 83d4db1fc..c59a7d1b1 100644 --- a/integration/use-objectid-true-external-import/use-objectid-true.ts +++ b/integration/use-objectid-true-external-import/use-objectid-true.ts @@ -95,7 +95,7 @@ export const Todo = { message.id !== undefined && (obj.id = message.id); message.oid !== undefined && (obj.oid = message.oid.toString()); if (message.repeatedOid) { - obj.repeatedOid = message.repeatedOid.map((e) => e.toString()); + obj.repeatedOid = message.repeatedOid.map(e => e.toString()); } else { obj.repeatedOid = []; } diff --git a/integration/use-optionals-all/test.ts b/integration/use-optionals-all/test.ts index 3cf686dd6..f100ba013 100644 --- a/integration/use-optionals-all/test.ts +++ b/integration/use-optionals-all/test.ts @@ -348,52 +348,52 @@ export const OptionalsTest = { message.long !== undefined && (obj.long = Math.round(message.long)); message.truth !== undefined && (obj.truth = message.truth); message.description !== undefined && (obj.description = message.description); - 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())); if (message.repId) { - obj.repId = message.repId.map((e) => Math.round(e)); + obj.repId = message.repId.map(e => Math.round(e)); } else { obj.repId = []; } if (message.repChild) { - obj.repChild = message.repChild.map((e) => e ? Child.toJSON(e) : undefined); + obj.repChild = message.repChild.map(e => e ? Child.toJSON(e) : undefined); } else { obj.repChild = []; } if (message.repState) { - obj.repState = message.repState.map((e) => stateEnumToJSON(e)); + obj.repState = message.repState.map(e => stateEnumToJSON(e)); } else { obj.repState = []; } if (message.repLong) { - obj.repLong = message.repLong.map((e) => Math.round(e)); + obj.repLong = message.repLong.map(e => Math.round(e)); } else { obj.repLong = []; } if (message.repTruth) { - obj.repTruth = message.repTruth.map((e) => e); + obj.repTruth = message.repTruth.map(e => e); } else { obj.repTruth = []; } if (message.repDescription) { - obj.repDescription = message.repDescription.map((e) => e); + obj.repDescription = message.repDescription.map(e => e); } else { obj.repDescription = []; } if (message.repData) { - obj.repData = message.repData.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array())); + obj.repData = message.repData.map(e => base64FromBytes(e !== undefined ? e : new Uint8Array())); } else { obj.repData = []; } message.optId !== undefined && (obj.optId = Math.round(message.optId)); message.optChild !== undefined && (obj.optChild = message.optChild ? Child.toJSON(message.optChild) : undefined); - message.optState !== undefined && - (obj.optState = message.optState !== undefined ? stateEnumToJSON(message.optState) : undefined); + message.optState !== undefined + && (obj.optState = message.optState !== undefined ? stateEnumToJSON(message.optState) : undefined); message.optLong !== undefined && (obj.optLong = Math.round(message.optLong)); message.optTruth !== undefined && (obj.optTruth = message.optTruth); message.optDescription !== undefined && (obj.optDescription = message.optDescription); - message.optData !== undefined && - (obj.optData = message.optData !== undefined ? base64FromBytes(message.optData) : undefined); + message.optData !== undefined + && (obj.optData = message.optData !== undefined ? base64FromBytes(message.optData) : undefined); obj.translations = {}; if (message.translations) { Object.entries(message.translations).forEach(([k, v]) => { diff --git a/integration/value/google/protobuf/struct.ts b/integration/value/google/protobuf/struct.ts index 80a98258e..8c712529b 100644 --- a/integration/value/google/protobuf/struct.ts +++ b/integration/value/google/protobuf/struct.ts @@ -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]; }); } @@ -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; @@ -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); @@ -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 = []; } diff --git a/integration/value/google/protobuf/wrappers.ts b/integration/value/google/protobuf/wrappers.ts index 3145298cb..22e0e03e4 100644 --- a/integration/value/google/protobuf/wrappers.ts +++ b/integration/value/google/protobuf/wrappers.ts @@ -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; }, diff --git a/integration/value/value.ts b/integration/value/value.ts index b89dd4536..2e28d2619 100644 --- a/integration/value/value.ts +++ b/integration/value/value.ts @@ -82,12 +82,12 @@ export const ValueMessage = { message.value !== undefined && (obj.value = message.value); message.anyList !== undefined && (obj.anyList = message.anyList); if (message.repeatedAny) { - obj.repeatedAny = message.repeatedAny.map((e) => e); + obj.repeatedAny = message.repeatedAny.map(e => e); } else { obj.repeatedAny = []; } if (message.repeatedStrings) { - obj.repeatedStrings = message.repeatedStrings.map((e) => e); + obj.repeatedStrings = message.repeatedStrings.map(e => e); } else { obj.repeatedStrings = []; } diff --git a/integration/vector-tile/vector_tile.ts b/integration/vector-tile/vector_tile.ts index d8b628bb4..b07615a6d 100644 --- a/integration/vector-tile/vector_tile.ts +++ b/integration/vector-tile/vector_tile.ts @@ -116,7 +116,7 @@ export const Tile = { toJSON(message: Tile): unknown { const obj: any = {}; if (message.layers) { - obj.layers = message.layers.map((e) => e ? Tile_Layer.toJSON(e) : undefined); + obj.layers = message.layers.map(e => e ? Tile_Layer.toJSON(e) : undefined); } else { obj.layers = []; } @@ -312,13 +312,13 @@ export const Tile_Feature = { const obj: any = {}; message.id !== undefined && (obj.id = Math.round(message.id)); if (message.tags) { - obj.tags = message.tags.map((e) => Math.round(e)); + obj.tags = message.tags.map(e => Math.round(e)); } else { obj.tags = []; } message.type !== undefined && (obj.type = tile_GeomTypeToJSON(message.type)); if (message.geometry) { - obj.geometry = message.geometry.map((e) => Math.round(e)); + obj.geometry = message.geometry.map(e => Math.round(e)); } else { obj.geometry = []; } @@ -411,17 +411,17 @@ export const Tile_Layer = { message.version !== undefined && (obj.version = Math.round(message.version)); message.name !== undefined && (obj.name = message.name); if (message.features) { - obj.features = message.features.map((e) => e ? Tile_Feature.toJSON(e) : undefined); + obj.features = message.features.map(e => e ? Tile_Feature.toJSON(e) : undefined); } else { obj.features = []; } if (message.keys) { - obj.keys = message.keys.map((e) => e); + obj.keys = message.keys.map(e => e); } else { obj.keys = []; } if (message.values) { - obj.values = message.values.map((e) => e ? Tile_Value.toJSON(e) : undefined); + obj.values = message.values.map(e => e ? Tile_Value.toJSON(e) : undefined); } else { obj.values = []; } diff --git a/package.json b/package.json index eb7f8bec9..5e204108d 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "dataloader": "^1.4.0", "object-hash": "^1.3.1", "protobufjs": "^6.11.3", - "ts-poet": "^5.0.1", + "ts-poet": "^5.1.0", "ts-proto-descriptors": "1.7.1" } } diff --git a/yarn.lock b/yarn.lock index 95672a295..14e457b66 100644 --- a/yarn.lock +++ b/yarn.lock @@ -338,6 +338,16 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== +"@dprint/formatter@^0.2.0": + version "0.2.0" + resolved "https://registry.yarnpkg.com/@dprint/formatter/-/formatter-0.2.0.tgz#5eb044e0969ef5b918b26db42eb9d75e7c6661ee" + integrity sha512-E1q1JaOPeEUBhG//IUayqJQvNpqprZ0OCF8B/bIhUqSsMIp0Y74PgF8JPvDCrOdq43qiGUYAavVO8iCBHOoU/A== + +"@dprint/typescript@^0.71.2": + version "0.71.2" + resolved "https://registry.yarnpkg.com/@dprint/typescript/-/typescript-0.71.2.tgz#07cba75950be8aee753d6983d1f6144cba65db49" + integrity sha512-QpQJiJMxSMhqqOgVk1zrh+2ueQnZmBQ6aCtVgXKd3zxyVOEIj5CLarfDmza/9KFOU+5lKsprbGAQBskC+xODkw== + "@esbuild-kit/cjs-loader@^2.3.3": version "2.3.3" resolved "https://registry.yarnpkg.com/@esbuild-kit/cjs-loader/-/cjs-loader-2.3.3.tgz#d65a8cc099d88ac58a571403428d82d1a791aefa" @@ -2564,11 +2574,6 @@ deprecation@^2.0.0, deprecation@^2.3.1: resolved "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== -detect-libc@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" - integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== - detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz" @@ -2611,13 +2616,6 @@ dot-prop@^5.1.0: dependencies: is-obj "^2.0.0" -dprint-node@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/dprint-node/-/dprint-node-1.0.7.tgz#f571eaf61affb3a696cff1bdde78a021875ba540" - integrity sha512-NTZOW9A7ipb0n7z7nC3wftvsbceircwVHSgzobJsEQa+7RnOMbhrfX5IflA6CtC4GA63DSAiHYXa4JKEy9F7cA== - dependencies: - detect-libc "^1.0.3" - duplexer2@~0.1.0: version "0.1.4" resolved "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz" @@ -6735,12 +6733,13 @@ ts-jest@^28.0.5: semver "7.x" yargs-parser "^21.0.1" -ts-poet@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ts-poet/-/ts-poet-5.0.1.tgz#1add2ae027fa779748ad315898b39d73aa56b5fa" - integrity sha512-EqLEJ+IOuLN51L3O7XzXv2AAoqApq8pYl6tC4bNeFqYC1wCZMct811B09lvQI85o51vgUhw14Pd5Q7fmfxMBqQ== +ts-poet@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ts-poet/-/ts-poet-5.1.0.tgz#7f27bbef5c6ca43df066b405e89a5d8b3598c0bc" + integrity sha512-OaqL9852TaBgZtgOPlQw/Ab5KAdsZbZfNKz22prb8vsl4Iu9XMOv1V3DiFuaT3dnhhrhdFUe1SiXY3RaeYBiSw== dependencies: - dprint-node "^1.0.7" + "@dprint/formatter" "^0.2.0" + "@dprint/typescript" "^0.71.2" ts-proto-descriptors@1.7.1: version "1.7.1"