From 7f6db70bb2d5f8427cf9de729b117c4ad5cb60db Mon Sep 17 00:00:00 2001 From: selie Date: Wed, 14 Jul 2021 14:01:40 -0700 Subject: [PATCH 1/3] fixing grpc-web issue#239 where client streaming was producing incorrect requestType --- integration/angular/simple-message.bin | Bin 235 -> 235 bytes .../simple.bin | Bin 605 -> 605 bytes .../simple2.bin | Bin 301 -> 301 bytes integration/avoid-import-conflicts/simple.bin | Bin 577 -> 577 bytes .../avoid-import-conflicts/simple2.bin | Bin 273 -> 273 bytes integration/barrel-imports/bar.bin | Bin 258 -> 258 bytes integration/barrel-imports/foo.bin | Bin 527 -> 527 bytes .../batching-with-context/batching.bin | Bin 2067 -> 2067 bytes integration/batching/batching.bin | Bin 2067 -> 2067 bytes integration/bytes-as-base64/message.bin | Bin 181 -> 181 bytes integration/bytes-node/point.bin | Bin 175 -> 175 bytes integration/const-enum/const-enum.bin | Bin 497 -> 497 bytes .../generic-service-definitions/simple.bin | Bin 1232 -> 1232 bytes integration/global-this/global-this.bin | Bin 315 -> 315 bytes .../grpc-js/google/protobuf/timestamp.ts | 11 +- .../grpc-js/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/grpc-js/simple.bin | Bin 15636 -> 15887 bytes .../grpc-web-client-streaming/client-ts.ts | 45 + .../grpc-web-client-streaming/example-test.ts | 23 + .../grpc-web-client-streaming/example.bin | Bin 0 -> 3309 bytes .../grpc-web-client-streaming/example.proto | 72 ++ .../grpc-web-client-streaming/example.ts | 868 ++++++++++++++++++ .../grpc-web-client-streaming/parameters.txt | 1 + integration/grpc-web-go-server/example.bin | Bin 3082 -> 3082 bytes .../example.bin | Bin 1443 -> 1443 bytes integration/grpc-web-no-streaming/example.bin | Bin 1443 -> 1443 bytes integration/grpc-web/example.bin | Bin 3050 -> 3050 bytes integration/lower-case-svc-methods/math.bin | Bin 792 -> 792 bytes .../meta-typings/google/protobuf/timestamp.ts | 21 +- .../meta-typings/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/meta-typings/google/type/date.bin | Bin 2086 -> 2086 bytes integration/meta-typings/import_dir/thing.bin | Bin 6408 -> 6652 bytes integration/meta-typings/simple.bin | Bin 21180 -> 21424 bytes integration/nestjs-metadata-grpc-js/hero.bin | Bin 1049 -> 1049 bytes .../nestjs-metadata-observables/hero.bin | Bin 1049 -> 1049 bytes .../nestjs-metadata-restparameters/hero.bin | Bin 1049 -> 1049 bytes integration/nestjs-metadata/hero.bin | Bin 1049 -> 1049 bytes integration/nestjs-restparameters/hero.bin | Bin 1049 -> 1049 bytes .../nestjs-simple-observables/hero.bin | Bin 1049 -> 1049 bytes .../nestjs-simple-restparameters/hero.bin | Bin 2814 -> 2821 bytes .../google/protobuf/timestamp.ts | 11 +- integration/nestjs-simple/hero.bin | Bin 10088 -> 10339 bytes .../no-proto-package/no-proto-package.bin | Bin 364 -> 364 bytes integration/oneof-properties/oneof.bin | Bin 1927 -> 1927 bytes integration/oneof-unions/oneof.bin | Bin 2224 -> 2224 bytes .../only-types-grpc-metadata.bin | Bin 518 -> 518 bytes integration/only-types/google/protobuf/any.ts | 7 +- .../only-types/google/protobuf/timestamp.ts | 11 +- integration/only-types/reservation.bin | Bin 12309 -> 12585 bytes integration/point/point.bin | Bin 437 -> 437 bytes integration/return-observable/observable.bin | Bin 463 -> 463 bytes .../simple-deprecated-fields/simple.bin | Bin 887 -> 887 bytes .../simple-esmodule-interop/simple.bin | Bin 1260 -> 1260 bytes .../google/protobuf/timestamp.ts | 11 +- .../google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/simple-long-string/simple.bin | Bin 11765 -> 12009 bytes .../simple-long/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/simple-long/simple.bin | Bin 6685 -> 6685 bytes .../google/protobuf/timestamp.ts | 11 +- .../google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes .../simple-optionals/import_dir/thing.bin | Bin 6408 -> 6652 bytes integration/simple-optionals/simple.bin | Bin 17013 -> 17257 bytes integration/simple-optionals/thing.bin | Bin 6386 -> 6630 bytes integration/simple-proto2/simple.bin | Bin 368 -> 368 bytes .../simple-snake/google/protobuf/timestamp.ts | 11 +- .../simple-snake/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/simple-snake/import_dir/thing.bin | Bin 6408 -> 6652 bytes integration/simple-snake/simple.bin | Bin 17013 -> 17257 bytes integration/simple-string-enums/simple.bin | Bin 595 -> 595 bytes .../google/protobuf/timestamp.ts | 11 +- .../google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes .../import_dir/thing.bin | Bin 6408 -> 6652 bytes .../simple-unrecognized-enum/simple.bin | Bin 17013 -> 17257 bytes .../simple/google/protobuf/timestamp.ts | 11 +- .../simple/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/simple/google/type/date.bin | Bin 2086 -> 2086 bytes integration/simple/import_dir/thing.bin | Bin 6408 -> 6652 bytes integration/simple/simple.bin | Bin 21290 -> 21534 bytes integration/type-registry/bar/bar.bin | Bin 6719 -> 6963 bytes integration/type-registry/foo.bin | Bin 6514 -> 6758 bytes .../google/protobuf/timestamp.ts | 11 +- integration/types-with-underscores/file.bin | Bin 253 -> 253 bytes .../google/protobuf/timestamp.ts | 11 +- integration/use-date-false/metadata.bin | Bin 6371 -> 6615 bytes .../google/protobuf/timestamp.ts | 11 +- .../use-date-string/use-date-string.bin | Bin 6990 -> 7234 bytes .../google/protobuf/timestamp.ts | 11 +- integration/use-date-true/use-date-true.bin | Bin 6986 -> 7230 bytes integration/vector-tile/vector_tile.bin | Bin 2942 -> 2942 bytes src/types.ts | 3 +- 90 files changed, 1151 insertions(+), 21 deletions(-) create mode 100755 integration/grpc-web-client-streaming/client-ts.ts create mode 100644 integration/grpc-web-client-streaming/example-test.ts create mode 100644 integration/grpc-web-client-streaming/example.bin create mode 100644 integration/grpc-web-client-streaming/example.proto create mode 100644 integration/grpc-web-client-streaming/example.ts create mode 100644 integration/grpc-web-client-streaming/parameters.txt diff --git a/integration/angular/simple-message.bin b/integration/angular/simple-message.bin index 64f63ba7173ff55812da993a0cae0d3d440f70fa..21b89c308516484424853dd9cc8f1d726c1fb822 100644 GIT binary patch delta 13 UcmaFO_?mHoG_#-t^F+C`03Xf-F8}}l delta 13 UcmaFO_?mHoG&8RR!$i5W03WIZC;$Ke diff --git a/integration/avoid-import-conflicts-types-only/simple.bin b/integration/avoid-import-conflicts-types-only/simple.bin index 3f79dd4fc22709d94aa3331d7ffb1928e6d98bbf..648562b7669410ae580e83e4334aec77227372f0 100644 GIT binary patch delta 31 mcmcc1a+gJni>EjEjw3cat2(zFB^G0zoMgSa$0}%iK delta 14 VcmZ3>w3cat2s5t)!$xs2MgSaL0}22D diff --git a/integration/avoid-import-conflicts/simple.bin b/integration/avoid-import-conflicts/simple.bin index 9ad985f0e854ef02848b9db733dcad0e7f62f04e..ac820c21883baec1b0a6c8445929722f3de2741b 100644 GIT binary patch delta 31 mcmX@ea*#!gi>EjEjh($ diff --git a/integration/barrel-imports/bar.bin b/integration/barrel-imports/bar.bin index a2a3871f30057c7466bc1be458a7d0afafe16271..5e870abc46ef54c2022fd372ca0414fc3654afb1 100644 GIT binary patch delta 27 icmZo-YGM-R;!H{`(km#+FUgnU;9wRIlwh7H{2l;Y>IT99 delta 27 icmZo-YGM-R;!H{`(km#+FUgnU;9wTum0*}C{2l;Y#s<3p diff --git a/integration/barrel-imports/foo.bin b/integration/barrel-imports/foo.bin index 9db00ed8db859ea3e33444c651fd2037fee94a11..47ee411d838e237ad4d96a9c3c2bb452309a420e 100644 GIT binary patch delta 28 jcmeBY>1Pq<;!MlW*DEN>FUgnU;9wRIlwjT{{D%<$XrKoj delta 28 jcmeBY>1Pq<;!MlW*DEN>FUgnU;9wTum0;K?{D%<$Xmtk` diff --git a/integration/batching-with-context/batching.bin b/integration/batching-with-context/batching.bin index ba1cfffc64d91268cc077178d54e5fbd5fc08eb5..0e8e853370a2cfd6a111be605c470225a26b55e8 100644 GIT binary patch delta 14 VcmbO%Fj-)ND6^mh^G1o^>;N4Q1Lgn# delta 14 VcmbO%Fj-)NC^N4F!$yhU>;N3)1K$7u diff --git a/integration/batching/batching.bin b/integration/batching/batching.bin index ba1cfffc64d91268cc077178d54e5fbd5fc08eb5..0e8e853370a2cfd6a111be605c470225a26b55e8 100644 GIT binary patch delta 14 VcmbO%Fj-)ND6^mh^G1o^>;N4Q1Lgn# delta 14 VcmbO%Fj-)NC^N4F!$yhU>;N3)1K$7u diff --git a/integration/bytes-as-base64/message.bin b/integration/bytes-as-base64/message.bin index cf9ea8f67b537a29a9d8912c1c1d678701240bb7..af5507d7e90153bc654e65e464984f1c9745fa13 100644 GIT binary patch delta 13 UcmdnWxRr5&2(zFB^F;A^02)aHh5!Hn delta 13 UcmdnWxRr5&2s5t)!$k3U02(C&e*gdg diff --git a/integration/bytes-node/point.bin b/integration/bytes-node/point.bin index d7107177cba2dde002ce901e2b3fc404ed9d7446..0aa2ca53bd419db7a77e487cf398344faa6a6185 100644 GIT binary patch delta 29 kcmZ3_xSmmzi@P8{Gp|IipeVm2Uy6f+SwK*Nd7|hn0DW5rzyJUM delta 29 kcmZ3_xSmmzi@P8{Gp|IipeVm2Uy6f+S%6o9VWQ|P0DU(Hxc~qF diff --git a/integration/const-enum/const-enum.bin b/integration/const-enum/const-enum.bin index a72899a87471a0b01256304a5ba75b7e014cf8f4..9ddd8074eb87adf0c0e469b4d6c73599777d0878 100644 GIT binary patch delta 14 Vcmey!{E>NrIJ2Mx^G2!bi~uDr1Y!UH delta 14 Vcmey!{E>NrI5V#V!$zs=i~uDA1X}d4W@mi>Ejd4W@mi>Ej%9Du%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% diff --git a/integration/grpc-js/simple.bin b/integration/grpc-js/simple.bin index 327578a061c1066436e97973537c5e4fb83e47dd..89074edd597c7ad58f176cebacebb647972f0859 100644 GIT binary patch delta 512 zcmbPI)n6mU#Z#P_Tac5gS5TB+k}t)ds$dJ_fz?d*5tZRqu!SfCs+=4sp&STQrk9>t;#!cOoDrOwoS&DX zp{WU10ya^vIJLwtF)zPZ1F9Ir0jknVD$UFRD!1kWTJ2f^^i)o&g4yPC5@~D_++55o z42(i7?Tj3PTyq(@SXdaC7=&25Cwt4!*Xw3vV&~%JVg-o-)pRp*@WZ&wAg+)w*HefV hpzOrS5(>}dCnB^kf&>{kc%fPtfm$YRmQ(yD4FFiQh6w-w delta 299 zcmeCLnNlUg#Z#P_Tac5gS5TB+k}t)>coLo#C+(OLC40fC2+5a#yUDlr*%UQr!2huh9 zDW?#lHb@(1NoHn6KBw z$i&XY%f$*3V+0B^a`3~r%pk6iFxOLv7NBg$WMReU@*M~*j37Zq4qm7hMxd6C&5}yr FqyhVVK-T~O diff --git a/integration/grpc-web-client-streaming/client-ts.ts b/integration/grpc-web-client-streaming/client-ts.ts new file mode 100755 index 000000000..ae92dfb69 --- /dev/null +++ b/integration/grpc-web-client-streaming/client-ts.ts @@ -0,0 +1,45 @@ +#!/usr/bin/env node + +import { NodeHttpTransport } from '@improbable-eng/grpc-web-node-http-transport'; +import { DashAPICredsClientImpl, DashStateClientImpl, GrpcWebImpl } from './example'; +import { grpc } from '@improbable-eng/grpc-web'; + +const rpc = new GrpcWebImpl('http://localhost:9090', { + transport: NodeHttpTransport(), + debug: false, + metadata: new grpc.Metadata({ SomeHeader: 'bar' }), +}); + +const client = new DashStateClientImpl(rpc); +const creds = new DashAPICredsClientImpl(rpc); + +async function main() { + console.log('calling client.UserSettings'); + console.log(await client.UserSettings({})); + + console.log('calling creds.Create'); + const cred = await creds.Create({ description: 'test desc fooo' }); + console.log(cred); + + console.log('calling creds.Delete'); + const del = await creds.Delete({ id: cred.id }); + console.log(del); + + console.log('calling creds.Update'); + try { + await creds.Update({ description: 'test desc2' }); + } catch (e) { + console.log('got expected error', e.message); + } + + const obs = client.ActiveUserSettingsStream({}); + await obs.forEach((value) => { + console.log('Got', value); + client.ChangeUserSettingsStream({ id: String(Math.random()) }); + }); +} + +main().then( + () => console.log('done'), + (err) => console.log('failed', err) +); diff --git a/integration/grpc-web-client-streaming/example-test.ts b/integration/grpc-web-client-streaming/example-test.ts new file mode 100644 index 000000000..ae6cff407 --- /dev/null +++ b/integration/grpc-web-client-streaming/example-test.ts @@ -0,0 +1,23 @@ +import { DashStateClientImpl } from './example'; + +describe('grpc-web', () => { + it('at least compiles', () => { + // TODO move the hand-run `client-ts` integration into here, but for now + // at least check that things compile + const rpc = { + unary: jest.fn(), + invoke: jest.fn(), + }; + const client = new DashStateClientImpl(rpc); + client.UserSettings({}); + }); + it('binds rpc function', () => { + const rpc = { + unary: jest.fn(), + invoke: jest.fn(), + }; + const client = new DashStateClientImpl(rpc); + const userSettings = client.UserSettings; + userSettings({}); + }) +}); diff --git a/integration/grpc-web-client-streaming/example.bin b/integration/grpc-web-client-streaming/example.bin new file mode 100644 index 0000000000000000000000000000000000000000..f3b6375cbca87d7646a6cadee98128cc768aa31e GIT binary patch literal 3309 zcma)9?NZxD6qQyhSz3P}F9c)q%$79ssAd1R%i0+i*x*vp>QrHXOUgA8$p{M<*MMx+ff`byec(kH$d4i`5Vs= zYNrYHUBL;-q6kh0z4&E+5cfh$=0)!0b+;Q&CZR2T!GGwC2O*PzaG#FH!*S@;|F*>~ zQaqi+H%>l1uc&YPt7Op-MoOtrCD0PQ}LEKHApACm+=dtdhsNWu^FR!HalUJ`_ zq>~ETCM|tgpBMaS9QR~Nuzn9M(0uV!9|)hkr?HyI_u@%++#e*yjEOoz~BT=^_iN05+pqG!Cf_k<{tlKr+XE z14$jo4J30?*GOOe9tux#%Q_B)FYJPJEKAZ8lMb^ALI~zrl5@+q@$7h(EgkNcMP6{v zVwQAV_NgccmjFVpCo=>AcQ(q91N7mZrXkT|-|CP}$h(sv(7ff3GUNf>e~=-FcspNf z5hUi=_d3KNk~1RA1*)xNG0I%Mmmx^zcJ?y_$=pGkY;xEX)?8|nlNX_E^3-OYm5D+C z;(6w02#NWikRizBXF}=_nFtkFs6#gD7MPbIiskYd0HK!1vxiXq>%KDMh5*Khn0HGFt#^nsa(8xz)XRJi0+;;uhO6Z6vZSz)_02LcGK zcN(TtG-%3)CG1g4`OmgygWq_pMKq9PRXdUtMW@ z5v8-qD(OxDKyFjZ0U>cSP}>6pxy^+r?ZTm!w%EL;(SdFm8ck*^P#+g0g0?kxOVi-D zsc(kE=%dy&G?HxUn}HZ;O?@*Q0^8a%0BGBWMsBvXXT&H|d*+hwSPzwFj;tMhKRJ2c z)t&($x2xrVkhrTo13_+Ad*;;Op7sm?+Mc12=RNHiG0^tlnI`W_{+ac;>cU0VXSxfQ zy4crp0Fc|)azIGj*K$CR+t(v>sfz>MJOF41hDKc+=;jdv?Las0(xx4nYBc#nLnFyU zQ;mjwXsQ7`(vx@7$v-kQn*1X@dBiAFPac1MpIA?oXWU@tiT3P~=Of((0J=ERazIEt z(p>;S?nrmxQG+er1psI*LnF^E-34Nxwa`U?$>*eVY=w0Fc@9a(e({Bu{&Tba4=mWp A0RR91 literal 0 HcmV?d00001 diff --git a/integration/grpc-web-client-streaming/example.proto b/integration/grpc-web-client-streaming/example.proto new file mode 100644 index 000000000..12390ed2e --- /dev/null +++ b/integration/grpc-web-client-streaming/example.proto @@ -0,0 +1,72 @@ +syntax = "proto3"; + +package rpx; + +service DashState { + rpc UserSettings(Empty) returns (DashUserSettingsState); + rpc ActiveUserSettingsStream(Empty) returns (stream DashUserSettingsState); + rpc ChangeUserSettingsStream (stream Cred) returns (stream DashUserSettingsState) {} +} + +message DashFlash { + string msg = 1; + Type type = 2; + + enum Type { + Undefined = 0; + Success = 1; + Warn = 2; + Error = 3; + } +} + +message DashUserSettingsState { + string email = 1; + URLs urls = 6; + repeated DashFlash flashes = 7; + + message URLs { + string connect_google = 1; + string connect_github = 2; + } +} + + +//---------------------- +// API Creds +//---------------------- +service DashAPICreds { + rpc Create(DashAPICredsCreateReq) returns (DashCred); + rpc Update(DashAPICredsUpdateReq) returns (DashCred); + rpc Delete(DashAPICredsDeleteReq) returns (DashCred); +} + +message Cred { + string id = 7; +} + +message DashCred { + string description = 2; + string metadata = 3; + string token = 4; + string id = 7; +} + +message DashAPICredsCreateReq { + string description = 1; + string metadata = 2; +} + +message DashAPICredsUpdateReq { + string cred_sid = 1; + string description = 2; + string metadata = 3; + string id = 5; +} + +message DashAPICredsDeleteReq { + string cred_sid = 1; + string id = 3; +} + +message Empty {} diff --git a/integration/grpc-web-client-streaming/example.ts b/integration/grpc-web-client-streaming/example.ts new file mode 100644 index 000000000..8e8a22776 --- /dev/null +++ b/integration/grpc-web-client-streaming/example.ts @@ -0,0 +1,868 @@ +/* eslint-disable */ +import { util, configure, Writer, Reader } from 'protobufjs/minimal'; +import * as Long from 'long'; +import { grpc } from '@improbable-eng/grpc-web'; +import { Observable } from 'rxjs'; +import { BrowserHeaders } from 'browser-headers'; +import { share } from 'rxjs/operators'; + +export interface DashFlash { + msg: string; + type: DashFlash_Type; +} + +export enum DashFlash_Type { + Undefined = 0, + Success = 1, + Warn = 2, + Error = 3, + UNRECOGNIZED = -1, +} + +export interface DashUserSettingsState { + email: string; + urls: DashUserSettingsState_URLs | undefined; + flashes: DashFlash[]; +} + +export interface DashUserSettingsState_URLs { + connectGoogle: string; + connectGithub: string; +} + +export interface Cred { + id: string; +} + +export interface DashCred { + description: string; + metadata: string; + token: string; + id: string; +} + +export interface DashAPICredsCreateReq { + description: string; + metadata: string; +} + +export interface DashAPICredsUpdateReq { + credSid: string; + description: string; + metadata: string; + id: string; +} + +export interface DashAPICredsDeleteReq { + credSid: string; + id: string; +} + +export interface Empty {} + +const baseDashFlash: object = { msg: '', type: 0 }; + +export const DashFlash = { + encode(message: DashFlash, writer: Writer = Writer.create()): Writer { + if (message.msg !== '') { + writer.uint32(10).string(message.msg); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DashFlash { + const reader = input instanceof Reader ? input : new Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDashFlash } as DashFlash; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.msg = reader.string(); + break; + case 2: + message.type = reader.int32() as any; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromPartial(object: DeepPartial): DashFlash { + const message = { ...baseDashFlash } as DashFlash; + if (object.msg !== undefined && object.msg !== null) { + message.msg = object.msg; + } else { + message.msg = ''; + } + if (object.type !== undefined && object.type !== null) { + message.type = object.type; + } else { + message.type = 0; + } + return message; + }, +}; + +const baseDashUserSettingsState: object = { email: '' }; + +export const DashUserSettingsState = { + encode(message: DashUserSettingsState, writer: Writer = Writer.create()): Writer { + if (message.email !== '') { + writer.uint32(10).string(message.email); + } + if (message.urls !== undefined) { + DashUserSettingsState_URLs.encode(message.urls, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.flashes) { + DashFlash.encode(v!, writer.uint32(58).fork()).ldelim(); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DashUserSettingsState { + const reader = input instanceof Reader ? input : new Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDashUserSettingsState } as DashUserSettingsState; + message.flashes = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.email = reader.string(); + break; + case 6: + message.urls = DashUserSettingsState_URLs.decode(reader, reader.uint32()); + break; + case 7: + message.flashes.push(DashFlash.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromPartial(object: DeepPartial): DashUserSettingsState { + const message = { ...baseDashUserSettingsState } as DashUserSettingsState; + message.flashes = []; + if (object.email !== undefined && object.email !== null) { + message.email = object.email; + } else { + message.email = ''; + } + if (object.urls !== undefined && object.urls !== null) { + message.urls = DashUserSettingsState_URLs.fromPartial(object.urls); + } else { + message.urls = undefined; + } + if (object.flashes !== undefined && object.flashes !== null) { + for (const e of object.flashes) { + message.flashes.push(DashFlash.fromPartial(e)); + } + } + return message; + }, +}; + +const baseDashUserSettingsState_URLs: object = { connectGoogle: '', connectGithub: '' }; + +export const DashUserSettingsState_URLs = { + encode(message: DashUserSettingsState_URLs, writer: Writer = Writer.create()): Writer { + if (message.connectGoogle !== '') { + writer.uint32(10).string(message.connectGoogle); + } + if (message.connectGithub !== '') { + writer.uint32(18).string(message.connectGithub); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DashUserSettingsState_URLs { + const reader = input instanceof Reader ? input : new Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDashUserSettingsState_URLs } as DashUserSettingsState_URLs; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.connectGoogle = reader.string(); + break; + case 2: + message.connectGithub = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromPartial(object: DeepPartial): DashUserSettingsState_URLs { + const message = { ...baseDashUserSettingsState_URLs } as DashUserSettingsState_URLs; + if (object.connectGoogle !== undefined && object.connectGoogle !== null) { + message.connectGoogle = object.connectGoogle; + } else { + message.connectGoogle = ''; + } + if (object.connectGithub !== undefined && object.connectGithub !== null) { + message.connectGithub = object.connectGithub; + } else { + message.connectGithub = ''; + } + return message; + }, +}; + +const baseCred: object = { id: '' }; + +export const Cred = { + encode(message: Cred, writer: Writer = Writer.create()): Writer { + if (message.id !== '') { + writer.uint32(58).string(message.id); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Cred { + const reader = input instanceof Reader ? input : new Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseCred } as Cred; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 7: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromPartial(object: DeepPartial): Cred { + const message = { ...baseCred } as Cred; + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } else { + message.id = ''; + } + return message; + }, +}; + +const baseDashCred: object = { description: '', metadata: '', token: '', id: '' }; + +export const DashCred = { + encode(message: DashCred, writer: Writer = Writer.create()): Writer { + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + if (message.metadata !== '') { + writer.uint32(26).string(message.metadata); + } + if (message.token !== '') { + writer.uint32(34).string(message.token); + } + if (message.id !== '') { + writer.uint32(58).string(message.id); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DashCred { + const reader = input instanceof Reader ? input : new Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDashCred } as DashCred; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.description = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + case 4: + message.token = reader.string(); + break; + case 7: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromPartial(object: DeepPartial): DashCred { + const message = { ...baseDashCred } as DashCred; + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ''; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } else { + message.metadata = ''; + } + if (object.token !== undefined && object.token !== null) { + message.token = object.token; + } else { + message.token = ''; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } else { + message.id = ''; + } + return message; + }, +}; + +const baseDashAPICredsCreateReq: object = { description: '', metadata: '' }; + +export const DashAPICredsCreateReq = { + encode(message: DashAPICredsCreateReq, writer: Writer = Writer.create()): Writer { + if (message.description !== '') { + writer.uint32(10).string(message.description); + } + if (message.metadata !== '') { + writer.uint32(18).string(message.metadata); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DashAPICredsCreateReq { + const reader = input instanceof Reader ? input : new Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDashAPICredsCreateReq } as DashAPICredsCreateReq; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.description = reader.string(); + break; + case 2: + message.metadata = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromPartial(object: DeepPartial): DashAPICredsCreateReq { + const message = { ...baseDashAPICredsCreateReq } as DashAPICredsCreateReq; + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ''; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } else { + message.metadata = ''; + } + return message; + }, +}; + +const baseDashAPICredsUpdateReq: object = { credSid: '', description: '', metadata: '', id: '' }; + +export const DashAPICredsUpdateReq = { + encode(message: DashAPICredsUpdateReq, writer: Writer = Writer.create()): Writer { + if (message.credSid !== '') { + writer.uint32(10).string(message.credSid); + } + if (message.description !== '') { + writer.uint32(18).string(message.description); + } + if (message.metadata !== '') { + writer.uint32(26).string(message.metadata); + } + if (message.id !== '') { + writer.uint32(42).string(message.id); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DashAPICredsUpdateReq { + const reader = input instanceof Reader ? input : new Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDashAPICredsUpdateReq } as DashAPICredsUpdateReq; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.credSid = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.metadata = reader.string(); + break; + case 5: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromPartial(object: DeepPartial): DashAPICredsUpdateReq { + const message = { ...baseDashAPICredsUpdateReq } as DashAPICredsUpdateReq; + if (object.credSid !== undefined && object.credSid !== null) { + message.credSid = object.credSid; + } else { + message.credSid = ''; + } + if (object.description !== undefined && object.description !== null) { + message.description = object.description; + } else { + message.description = ''; + } + if (object.metadata !== undefined && object.metadata !== null) { + message.metadata = object.metadata; + } else { + message.metadata = ''; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } else { + message.id = ''; + } + return message; + }, +}; + +const baseDashAPICredsDeleteReq: object = { credSid: '', id: '' }; + +export const DashAPICredsDeleteReq = { + encode(message: DashAPICredsDeleteReq, writer: Writer = Writer.create()): Writer { + if (message.credSid !== '') { + writer.uint32(10).string(message.credSid); + } + if (message.id !== '') { + writer.uint32(26).string(message.id); + } + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): DashAPICredsDeleteReq { + const reader = input instanceof Reader ? input : new Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDashAPICredsDeleteReq } as DashAPICredsDeleteReq; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.credSid = reader.string(); + break; + case 3: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromPartial(object: DeepPartial): DashAPICredsDeleteReq { + const message = { ...baseDashAPICredsDeleteReq } as DashAPICredsDeleteReq; + if (object.credSid !== undefined && object.credSid !== null) { + message.credSid = object.credSid; + } else { + message.credSid = ''; + } + if (object.id !== undefined && object.id !== null) { + message.id = object.id; + } else { + message.id = ''; + } + return message; + }, +}; + +const baseEmpty: object = {}; + +export const Empty = { + encode(_: Empty, writer: Writer = Writer.create()): Writer { + return writer; + }, + + decode(input: Reader | Uint8Array, length?: number): Empty { + const reader = input instanceof Reader ? input : new Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseEmpty } as Empty; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromPartial(_: DeepPartial): Empty { + const message = { ...baseEmpty } as Empty; + return message; + }, +}; + +export interface DashState { + UserSettings(request: DeepPartial, metadata?: grpc.Metadata): Promise; + ActiveUserSettingsStream(request: DeepPartial, metadata?: grpc.Metadata): Observable; + ChangeUserSettingsStream(request: DeepPartial, metadata?: grpc.Metadata): Observable; +} + +export class DashStateClientImpl implements DashState { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.UserSettings = this.UserSettings.bind(this); + this.ActiveUserSettingsStream = this.ActiveUserSettingsStream.bind(this); + this.ChangeUserSettingsStream = this.ChangeUserSettingsStream.bind(this); + } + + UserSettings(request: DeepPartial, metadata?: grpc.Metadata): Promise { + return this.rpc.unary(DashStateUserSettingsDesc, Empty.fromPartial(request), metadata); + } + + ActiveUserSettingsStream(request: DeepPartial, metadata?: grpc.Metadata): Observable { + return this.rpc.invoke(DashStateActiveUserSettingsStreamDesc, Empty.fromPartial(request), metadata); + } + + ChangeUserSettingsStream(request: DeepPartial, metadata?: grpc.Metadata): Observable { + return this.rpc.invoke(DashStateChangeUserSettingsStreamDesc, Cred.fromPartial(request), metadata); + } +} + +export const DashStateDesc = { + serviceName: 'rpx.DashState', +}; + +export const DashStateUserSettingsDesc: UnaryMethodDefinitionish = { + methodName: 'UserSettings', + service: DashStateDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return Empty.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...DashUserSettingsState.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +export const DashStateActiveUserSettingsStreamDesc: UnaryMethodDefinitionish = { + methodName: 'ActiveUserSettingsStream', + service: DashStateDesc, + requestStream: false, + responseStream: true, + requestType: { + serializeBinary() { + return Empty.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...DashUserSettingsState.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +export const DashStateChangeUserSettingsStreamDesc: UnaryMethodDefinitionish = { + methodName: 'ChangeUserSettingsStream', + service: DashStateDesc, + requestStream: false, + responseStream: true, + requestType: { + serializeBinary() { + return Cred.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...DashUserSettingsState.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +/** + * ---------------------- + * API Creds + * ---------------------- + */ +export interface DashAPICreds { + Create(request: DeepPartial, metadata?: grpc.Metadata): Promise; + Update(request: DeepPartial, metadata?: grpc.Metadata): Promise; + Delete(request: DeepPartial, metadata?: grpc.Metadata): Promise; +} + +export class DashAPICredsClientImpl implements DashAPICreds { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Create = this.Create.bind(this); + this.Update = this.Update.bind(this); + this.Delete = this.Delete.bind(this); + } + + Create(request: DeepPartial, metadata?: grpc.Metadata): Promise { + return this.rpc.unary(DashAPICredsCreateDesc, DashAPICredsCreateReq.fromPartial(request), metadata); + } + + Update(request: DeepPartial, metadata?: grpc.Metadata): Promise { + return this.rpc.unary(DashAPICredsUpdateDesc, DashAPICredsUpdateReq.fromPartial(request), metadata); + } + + Delete(request: DeepPartial, metadata?: grpc.Metadata): Promise { + return this.rpc.unary(DashAPICredsDeleteDesc, DashAPICredsDeleteReq.fromPartial(request), metadata); + } +} + +export const DashAPICredsDesc = { + serviceName: 'rpx.DashAPICreds', +}; + +export const DashAPICredsCreateDesc: UnaryMethodDefinitionish = { + methodName: 'Create', + service: DashAPICredsDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return DashAPICredsCreateReq.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...DashCred.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +export const DashAPICredsUpdateDesc: UnaryMethodDefinitionish = { + methodName: 'Update', + service: DashAPICredsDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return DashAPICredsUpdateReq.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...DashCred.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +export const DashAPICredsDeleteDesc: UnaryMethodDefinitionish = { + methodName: 'Delete', + service: DashAPICredsDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return DashAPICredsDeleteReq.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...DashCred.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +interface UnaryMethodDefinitionishR extends grpc.UnaryMethodDefinition { + requestStream: any; + responseStream: any; +} + +type UnaryMethodDefinitionish = UnaryMethodDefinitionishR; + +interface Rpc { + unary( + methodDesc: T, + request: any, + metadata: grpc.Metadata | undefined + ): Promise; + invoke( + methodDesc: T, + request: any, + metadata: grpc.Metadata | undefined + ): Observable; +} + +export class GrpcWebImpl { + private host: string; + private options: { + transport?: grpc.TransportFactory; + streamingTransport?: grpc.TransportFactory; + debug?: boolean; + metadata?: grpc.Metadata; + }; + + constructor( + host: string, + options: { + transport?: grpc.TransportFactory; + streamingTransport?: grpc.TransportFactory; + debug?: boolean; + metadata?: grpc.Metadata; + } + ) { + this.host = host; + this.options = options; + } + + unary( + methodDesc: T, + _request: any, + metadata: grpc.Metadata | undefined + ): Promise { + const request = { ..._request, ...methodDesc.requestType }; + const maybeCombinedMetadata = + metadata && this.options.metadata + ? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap }) + : metadata || this.options.metadata; + return new Promise((resolve, reject) => { + grpc.unary(methodDesc, { + request, + host: this.host, + metadata: maybeCombinedMetadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (response.status === grpc.Code.OK) { + resolve(response.message); + } else { + const err = new Error(response.statusMessage) as any; + err.code = response.status; + err.metadata = response.trailers; + reject(err); + } + }, + }); + }); + } + + invoke( + methodDesc: T, + _request: any, + metadata: grpc.Metadata | undefined + ): Observable { + // Status Response Codes (https://developers.google.com/maps-booking/reference/grpc-api/status_codes) + const upStreamCodes = [2, 4, 8, 9, 10, 13, 14, 15]; + const DEFAULT_TIMEOUT_TIME: number = 3_000; + const request = { ..._request, ...methodDesc.requestType }; + const maybeCombinedMetadata = + metadata && this.options.metadata + ? new BrowserHeaders({ ...this.options?.metadata.headersMap, ...metadata?.headersMap }) + : metadata || this.options.metadata; + return new Observable((observer) => { + const upStream = () => { + const client = grpc.invoke(methodDesc, { + host: this.host, + request, + transport: this.options.streamingTransport || this.options.transport, + metadata: maybeCombinedMetadata, + debug: this.options.debug, + onMessage: (next) => observer.next(next), + onEnd: (code: grpc.Code, message: string) => { + if (code === 0) { + observer.complete(); + } else if (upStreamCodes.includes(code)) { + setTimeout(upStream, DEFAULT_TIMEOUT_TIME); + } else { + observer.error(new Error(`Error ${code} ${message}`)); + } + }, + }); + observer.add(() => client.close()); + }; + upStream(); + }).pipe(share()); + } +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; +type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +// If you get a compile-error about 'Constructor and ... have no overlap', +// add '--ts_proto_opt=esModuleInterop=true' as a flag when calling 'protoc'. +if (util.Long !== Long) { + util.Long = Long as any; + configure(); +} diff --git a/integration/grpc-web-client-streaming/parameters.txt b/integration/grpc-web-client-streaming/parameters.txt new file mode 100644 index 000000000..a9f230be8 --- /dev/null +++ b/integration/grpc-web-client-streaming/parameters.txt @@ -0,0 +1 @@ +outputClientImpl=grpc-web,addGrpcMetadata=true,returnObservable=false,oneof=oneof,outputJsonMethods=false,env=browser,exportCommonSymbols=false,useDate=false diff --git a/integration/grpc-web-go-server/example.bin b/integration/grpc-web-go-server/example.bin index 14d0868f91eafca73db8ac9faa2bc4552fd9c74e..3ad33b93bf0d53bacfcf455c64e00c4133f6683e 100644 GIT binary patch delta 14 VcmeB@=#rQq!YnAkyixo!Hvk;Y1Kt1t delta 14 VcmeB@=#rQq!ptkduu=RoHvk-?1J?im diff --git a/integration/grpc-web-no-streaming-observable/example.bin b/integration/grpc-web-no-streaming-observable/example.bin index 64c9054e5b896fb955f35b4230cc26bdb2136e41..4b52601f5c539bb58ca15e3014b860d7beae15d9 100644 GIT binary patch delta 14 VcmZ3?y_kD~2(zFB^G5L=RsbDL1Bn0t delta 14 VcmZ3?y_kD~2s5t)!$$EQRsbC#1A+hm diff --git a/integration/grpc-web-no-streaming/example.bin b/integration/grpc-web-no-streaming/example.bin index 64c9054e5b896fb955f35b4230cc26bdb2136e41..4b52601f5c539bb58ca15e3014b860d7beae15d9 100644 GIT binary patch delta 14 VcmZ3?y_kD~2(zFB^G5L=RsbDL1Bn0t delta 14 VcmZ3?y_kD~2s5t)!$$EQRsbC#1A+hm diff --git a/integration/grpc-web/example.bin b/integration/grpc-web/example.bin index bda1bef9bd43a9e143b93c4135354beadc999fe7..519a2af884105c9c8c5b88570c45cd7af70fadad 100644 GIT binary patch delta 14 VcmaDQ{z`m;2(zFB^G5N@+yEvv1bhGh delta 14 VcmaDQ{z`m;2s5t)!$$GT+yEvE1a$xa diff --git a/integration/lower-case-svc-methods/math.bin b/integration/lower-case-svc-methods/math.bin index 0b8f2e6c08a7ab752c606566cb07013e94c961b8..588e6998f8462ef420a8c1ff6e95a1fa83d9854e 100644 GIT binary patch delta 29 kcmbQiHiJ!siz_#=Btx&DD8D3Mii3k$Kv05tqX-K#0CQ>vrT_o{ delta 29 kcmbQiHiJ!siz_#=Btx&DD8D3Mii3k$fM0@jqX-K#0CQ#rrT_o{ diff --git a/integration/meta-typings/google/protobuf/timestamp.ts b/integration/meta-typings/google/protobuf/timestamp.ts index 89db90a99..6a62cd6fd 100644 --- a/integration/meta-typings/google/protobuf/timestamp.ts +++ b/integration/meta-typings/google/protobuf/timestamp.ts @@ -57,7 +57,16 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * + * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() @@ -177,7 +186,7 @@ export const protoMetadata: ProtoMetadata = { javaPackage: 'com.google.protobuf', javaOuterClassname: 'TimestampProto', javaMultipleFiles: true, - goPackage: 'github.com/golang/protobuf/ptypes/timestamp', + goPackage: 'google.golang.org/protobuf/types/known/timestamppb', ccEnableArenas: true, objcClassPrefix: 'GPB', csharpNamespace: 'Google.Protobuf.WellKnownTypes', @@ -186,21 +195,21 @@ export const protoMetadata: ProtoMetadata = { location: [ { path: [4, 0], - span: [126, 0, 137, 1], + span: [135, 0, 146, 1], leadingDetachedComments: [], 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 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', }, { path: [4, 0, 2, 0], - span: [130, 2, 20], + span: [139, 2, 20], leadingDetachedComments: [], leadingComments: ' Represents seconds of UTC time since Unix epoch\n 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n 9999-12-31T23:59:59Z inclusive.\n', }, { path: [4, 0, 2, 1], - span: [136, 2, 18], + span: [145, 2, 18], leadingDetachedComments: [], leadingComments: ' Non-negative fractions of a second at nanosecond resolution. Negative\n second values with fractions must still have non-negative nanos values\n that count forward in time. Must be from 0 to 999,999,999\n inclusive.\n', diff --git a/integration/meta-typings/google/protobuf/wrappers.bin b/integration/meta-typings/google/protobuf/wrappers.bin index 136184cf883f0b5338c4486eb7ee3d30735c2c52..1c3a982c95fd4b1add11db32f11cfd2f5f4fd90c 100644 GIT binary patch delta 21 ccmcbkct>%9Du%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% diff --git a/integration/meta-typings/google/type/date.bin b/integration/meta-typings/google/type/date.bin index a37fb502610bb10e654de248f4685fae31fd8d33..79b7489a478d8c39160305aeda937b750ffabd82 100644 GIT binary patch delta 14 VcmZ1`uuNcrEVG~l^F{?W4gei>11JCh delta 14 VcmZ1`uuNcrEHkeJ!$t)*4geiW10eta diff --git a/integration/meta-typings/import_dir/thing.bin b/integration/meta-typings/import_dir/thing.bin index 31e69afdf386926161c91df7214c398b9c60b0e9..777648ff4502757afb78a7feacbec6bb9ac73adf 100644 GIT binary patch delta 415 zcmeA$`eQsnmQzrIS&5ZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+j0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHUL_HFoK(GnqWqG4DGm;10YM37C5Ea-0j|mC48=DZ&yip{ZaDd( zL;+JP<76jE4P&G9{QPvFj`aMT#JqI9{GxPyu;!%FH2spwg4AOD?7aN)JpGc)+|=Td z#N2{{q{**2wKliCZADPwgigmrKgs-7UU;q1g9qF=cQ<9YQmL(jngYmE%8gt%P-b|Dh6>hCL3yq zGn!34r!2WSNyC>-f}4w(g@I9srJa#OkZUd@7Yhpm6N3;-_vB-G^YywJnb^5_xmZDB yKsDWr9Q-gYGl(lB%=Hwa1t>dl@?`zz@)HqS7(s%J9K291j6f|DH_tRsRssN+q-_2G delta 241 zcmdn6oN>=mMlmj);>_HFoK(GnqWqG4DGm;10bU7)jbb|`m@ey2z9><^SU1^OQiD-@ z@TJ#g&m-l&@D%lwXoB#lgWWz$?L^#896s-N zrAd0p`MLV(`8kPs>H1(TNu_D}1tpaQsm1!Kxj@ForEA!D?6^3&m^iqFn3WmqHpjBB GU3VDVw!v^+9(q1rKxsk5fU%hMLKqSspqmA{cRbej;nWU;SgI<`(Kw$Y3fPWBD&!nKZ#BZr(hhE;Z%EWA8Ei#<7z zfs?uweiG$^?Z^-2-)DgCBs4#x(5jr}ZZLh5Q**Qb?Cl+vtz*wDyKcdMoRZ%Rh$vm- z=q^}>Td^nKnU+L(+UVbkevSbrAVsWVbcb>5V=P#T-bdya%~Mm`%{#1<t2 on5TxNzK-NWsSH596=7AM4rz_J{};g_#8PiNf?325MiWcoFO`slw*UYD delta 341 zcmaDH@WM}miz_3wC||FjD8D3Mii3k$fLDS+iJ@x8Lliv28Ks^|Z;lb1$-eo%q%WH|7Z)=N1EUag9fu&-Tt+Sy76v8; zA(p1eE(-JYni!ebxp=u)L1K(RK}HUK7?&Bu6%yup3ef_T?U*d6_*}jNp@k77$jHG9 P)xrqW(y>`w$%hR9$UjmS diff --git a/integration/no-proto-package/no-proto-package.bin b/integration/no-proto-package/no-proto-package.bin index 4dab2c70ee646f8b2a1e68bf5219223e924138ab..06e8a111a3b76772a904c53338e2f3f1451a314e 100644 GIT binary patch delta 14 VcmaFE^oD7IEVG~l^F{?9MgSwm1J?im delta 14 VcmaFE^oD7IEHkeJ!$t)kMgSw51JD2f diff --git a/integration/oneof-properties/oneof.bin b/integration/oneof-properties/oneof.bin index 4755b5d36eccfefacc54e29b5cfa2669f55a100c..ec9d341cfe787cff97e43eb6fb2eed26d2dc7b2b 100644 GIT binary patch delta 30 lcmZqYZ|4`~;?B=Y%}>)SD9SI%m*U`H77&zR-Y8nc4gh`I2Y3Jg delta 30 lcmZqYZ|4`~;?B=Y%}>)SD9SI%m*U`H7T}d&*eF`W4gh_y2XO!Z diff --git a/integration/oneof-unions/oneof.bin b/integration/oneof-unions/oneof.bin index 45b7fdb4f24556df153dd165ad492e6e40d94257..f7be100d928b4507db9d2c9901aa8db46684e1f1 100644 GIT binary patch delta 30 lcmdlWxIs{qi#tCrH9t+SpeVm2Uy6f+SwK*Nd86oT4giPf2lxO0 delta 30 lcmdlWxIs{qi#tCrH9t+SpeVm2Uy6f+S%6o9VWa454giO}2k`&^ diff --git a/integration/only-types-grpc-metadata/only-types-grpc-metadata.bin b/integration/only-types-grpc-metadata/only-types-grpc-metadata.bin index cf8fe7025853a37f2a6730e17faa6e16126d7382..1d80a96d221f415ee5a5b6fc3855c629ef9a58df 100644 GIT binary patch delta 21 ccmZo;X=9n7${{Ghti(`tlX-%|M&F%`06F>v-T(jq delta 21 ccmZo;X=9n7%E2qapu|vhlX-%|M&F%`06Cro*8l(j diff --git a/integration/only-types/google/protobuf/any.ts b/integration/only-types/google/protobuf/any.ts index 04572d4fc..ade2721aa 100644 --- a/integration/only-types/google/protobuf/any.ts +++ b/integration/only-types/google/protobuf/any.ts @@ -40,10 +40,13 @@ export const protobufPackage = 'google.protobuf'; * Example 4: Pack and unpack a message in Go * * foo := &pb.Foo{...} - * any, err := ptypes.MarshalAny(foo) + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } * ... * foo := &pb.Foo{} - * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * if err := any.UnmarshalTo(foo); err != nil { * ... * } * diff --git a/integration/only-types/google/protobuf/timestamp.ts b/integration/only-types/google/protobuf/timestamp.ts index 3fd84b70a..c88251a53 100644 --- a/integration/only-types/google/protobuf/timestamp.ts +++ b/integration/only-types/google/protobuf/timestamp.ts @@ -53,7 +53,16 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * + * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() diff --git a/integration/only-types/reservation.bin b/integration/only-types/reservation.bin index b1301068264f4f5bb66e26246e85237387f120cc..fd75bd8480e48c465c2fedeb069750fd762a7c0c 100644 GIT binary patch delta 704 zcmbQ5urg_a1iPRFvl2tqgNgEKjAawslyr5{^YhblQuWgFa}x8?_413-^$UvfOY)OS z)AUO!3sQ^qv-9%H^Yjz*DhrY(p3~s`sl~-E#45)ycjNy`HXdg#PA(=6ZXsr62It8w z?4kUB1-O`47=&1B80IoEO1IJkJZSV4k} zKv70cK^T`A#1#?c3I}TeO3s;lS2R*@4kHsgR0$(UkdcEI#s%t_!zdt_#0K`Van*4{ zuF3g&3X@yJ{Fz!ACtnfMFf$@Dd`dENQ;SOya|;TRelRkE0_vzfB%mgN0&4PASy3KO zSYW9zcuxK%8!C8D793b??TieQfT49>c5}4cO!mniRM_-A^MI!1mFNKjUqdrNj|&oL zP*DY-sDiBmlA6i(s`8xBfK^bK9H*)r2vnn&o?7Bske{3poSK}Um!hEw3wuZmDCiZZ zmiQ&+3K!gVc00a_}R?P&cEHFxOLv7NG3J$*Q`~D@Sf*_*7l>rloyN$-!NtqP3KC=liZXHv!nn*Ju81gC zI9Ll%a^~c}qLI2Y8JXCjN*FOozMghSjHn4|{t1jzLZWb$GtegB*OhZST zaJZCY=B5^xB<2=O4iMMoyr~Nbo=$M^O#Uk?%HsqJA{7Rw$#Qa`0-vQJK~%@k2@ImA z(wkf4X0mT)SNCNT=i*{!0eXqKjzf@ZE+fp_O_OtU=j$~g`~dQG6C(#dlCPT>g@n1D eLbL#7J0@G|J(ur5XaRY<1J&Cdo9*>qF#-T~1bYSm diff --git a/integration/point/point.bin b/integration/point/point.bin index ebc048e8860f6c20c3cf0621da88560ef6418c83..80fb1541de944e7bade943654561f92484879299 100644 GIT binary patch delta 30 lcmdnWyp>s$i@P8{Gp|IipeVm2Uy6f+SwK*Nd86n8MgWI&2loH~ delta 30 lcmdnWyp>s$i@P8{Gp|IipeVm2Uy6f+S%6o9VWa2*MgWIN2k-y@ diff --git a/integration/return-observable/observable.bin b/integration/return-observable/observable.bin index ef7e408dfa438a27ddfbdb7526067bd57552addd..8a42177f52bfb309763a41b176429ca86695610b 100644 GIT binary patch delta 14 VcmX@le4crNIJ2Mx^G2zyi~u2a1N;C0 delta 14 VcmX@le4crNI5V#V!$zsCi~u1^1N8s^ diff --git a/integration/simple-deprecated-fields/simple.bin b/integration/simple-deprecated-fields/simple.bin index 1b5c2e157b11d067e58160621958063c08f2921b..6e2d774abaa9daedd9ab4b3d71cdce42a2cfcaed 100644 GIT binary patch delta 31 mcmey)_MJ_Pi>EjEjEjEj%9Du%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% diff --git a/integration/simple-long-string/simple.bin b/integration/simple-long-string/simple.bin index ff117bb436a9a50699e3f9bf376c3f312e5caa7b..5793ee87c2a40d8b422fb14d309d817599500e59 100644 GIT binary patch delta 418 zcmeww{W4aJi>Ej)(=W-)O)V}-%q=KLn*5wmoAanX z7rPLv9K)o|#{~P>cs#i{xtKV(g_uDgGjj05xXd7~ nkTBO%h!&vi#L4~Y&*di~v@n7M898{NS{Q*^CT^apk-!Q723={z delta 249 zcmaDE`!!mIi>Ej3kB!HPi<66qgIkDM zg~4fZhD4~qXK5}b76u{KI)+Y0MyaRLo6kwiWZxX9=*uR~#l_6Rz$nCA$05iymywHw zg@K7dh^1-rHud>>O^i(JT)bSYATdUuAR`AqjLQt-3JG&Pg=hiFc1&*8crM?8(8353 TWaQw5YGDLw>Db(%9Du%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% diff --git a/integration/simple-long/simple.bin b/integration/simple-long/simple.bin index c634e8f32851c091647f925c1872a442c847186d..1c224e1fe104ff1cf11d14605726ef3090815131 100644 GIT binary patch delta 31 mcmbPhGS@_mi>EjEj%9Du%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% diff --git a/integration/simple-optionals/import_dir/thing.bin b/integration/simple-optionals/import_dir/thing.bin index 31e69afdf386926161c91df7214c398b9c60b0e9..777648ff4502757afb78a7feacbec6bb9ac73adf 100644 GIT binary patch delta 415 zcmeA$`eQsnmQzrIS&5ZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+j0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHULTn*UK+T*9U7!DoxWbsVqn>*3Zt%FVE92$;?eHE=kNSC`g+8oKc(e zs6H3F5UU)+q|L_!``CCqxj4C)IJkwFRTw-cCrE?}-jn5GVqp+sYiDGb#Kds$dJ_fz(W1DKF0nQ3F&q`GmZ( zB~Vl^J+;KOAU`=HI5jyxFGWLB6RreooL+HiiCj3lMkuQ*Xw3vV&~%JVg-o-)pRp*@WZ&w pAg+)w*HefVpzOrS{p!!{kc%fPtfm$YRo~rRc5&)D{YOMeO delta 251 zcmaFa#`v{`QHG1BI5W2(CsnVYD8D3Mii3k$fLDS+iJ@w}BG=@7TJjsMCkQZI)}MS< zpn$P%vb~@NqxR&zj7pp(nYpROC5gEOlV=HPbKcbDVi#hSW9Zy`POy)S$BB!Ri;06< zh*^cfX>x`{sK94wE+!TRA=WyEPDVzlr_!6xNz7#59H{8aCeFph%)-DZ#9YTA$TgRd zi-m=Oi9v{^Y4SGp`Fc%^Ozd2|T&y55MxY=g2S1F<4B`q2b3KJ<0m^nvZq|4%-+|D= V2ohxE;Du^o1ZwHn+^P9M5&#KKH75W7 diff --git a/integration/simple-optionals/thing.bin b/integration/simple-optionals/thing.bin index 450f74794d456b980eb8532d8113b3b4ccaed254..188b45a5849c0ef42dc90c4a87073867498bf787 100644 GIT binary patch delta 433 zcmYL^ze>YU6vppO(k8vJrcJTdU^S>iijYtXU8G}&3JN0bO>0bxX>Mpz|LxKtP)IX5 zhz}r6c?NOx1w=tmcb~wU{?W62-}!yt;rx`pDiY$oPS-Y7r;j}>aU7k=7U&Id{ag+t zhq{4*uT*wSj7`f>O>F4|#eGwo;H|-_=3P04tDV{S!q&WQ&u~4x=Qyq4eLMA}Ay!PR zfpL_BqvS#Zr4YsOBE1C~;UjyTeJdi00b+6p!5Bj6r5K6aEnD5w&vm)kut}5csiasb zHC2SP)eJp3-FNK6^fdBvi delta 262 zcmaE6{K-&?i@PKvGcR4QpeVm2Uy6f+S%6o9L5ZR2vi?M=0>-+DJsLXN>6s-NrAd0p z`MLV(`8kPs>H1*RNu_D}1tpaQsm1ywnYpROC5gEO6Q65y-qht{7h;uT=-e#L*vH1> z#Kp_*>AI4<{afO7roEjEj%9Du%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% diff --git a/integration/simple-snake/import_dir/thing.bin b/integration/simple-snake/import_dir/thing.bin index 31e69afdf386926161c91df7214c398b9c60b0e9..777648ff4502757afb78a7feacbec6bb9ac73adf 100644 GIT binary patch delta 415 zcmeA$`eQsnmQzrIS&5ZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+j0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHULTn*UK+T*9U7!DoxWbsVqn>*3Zt%FVE92$;?eHE=kNSC`g+8oKc(e zs6H3F5UU)+q|L_!``CCqxj4C)IJkwFRTw-cCrE?}-jn5GVqp+sYiDGb#Kds$dJ_fz(W1DKF0nQ3F&q`GmZ( zB~Vl^J+;KOAU`=HI5jyxFGWLB6RreooL+HiiCj3lMkuQ*Xw3vV&~%JVg-o-)pRp*@WZ&w pAg+)w*HefVpzOrS{p!!{kc%fPtfm$YRo~rRc5&)D{YOMeO delta 251 zcmaFa#`v{`QHG1BI5W2(CsnVYD8D3Mii3k$fLDS+iJ@w}BG=@7TJjsMCkQZI)}MS< zpn$P%vb~@NqxR&zj7pp(nYpROC5gEOlV=HPbKcbDVi#hSW9Zy`POy)S$BB!Ri;06< zh*^cfX>x`{sK94wE+!TRA=WyEPDVzlr_!6xNz7#59H{8aCeFph%)-DZ#9YTA$TgRd zi-m=Oi9v{^Y4SGp`Fc%^Ozd2|T&y55MxY=g2S1F<4B`q2b3KJ<0m^nvZq|4%-+|D= V2ohxE;Du^o1ZwHn+^P9M5&#KKH75W7 diff --git a/integration/simple-string-enums/simple.bin b/integration/simple-string-enums/simple.bin index e3a54581912f1631f05f2d94fcfbd84014acaa0b..c7520b729844ace59c71e17d2283e08d45471b67 100644 GIT binary patch delta 31 mcmcc2a+yVpi>EjEj%9Du%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% diff --git a/integration/simple-unrecognized-enum/import_dir/thing.bin b/integration/simple-unrecognized-enum/import_dir/thing.bin index 31e69afdf386926161c91df7214c398b9c60b0e9..777648ff4502757afb78a7feacbec6bb9ac73adf 100644 GIT binary patch delta 415 zcmeA$`eQsnmQzrIS&5ZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+j0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHULTn*UK+T*9U7!DoxWbsVqn>*3Zt%FVE92$;?eHE=kNSC`g+8oKc(e zs6H3F5UU)+q|L_!``CCqxj4C)IJkwFRTw-cCrE?}-jn5GVqp+sYiDGb#Kds$dJ_fz(W1DKF0nQ3F&q`GmZ( zB~Vl^J+;KOAU`=HI5jyxFGWLB6RreooL+HiiCj3lMkuQ*Xw3vV&~%JVg-o-)pRp*@WZ&w pAg+)w*HefVpzOrS{p!!{kc%fPtfm$YRo~rRc5&)D{YOMeO delta 251 zcmaFa#`v{`QHG1BI5W2(CsnVYD8D3Mii3k$fLDS+iJ@w}BG=@7TJjsMCkQZI)}MS< zpn$P%vb~@NqxR&zj7pp(nYpROC5gEOlV=HPbKcbDVi#hSW9Zy`POy)S$BB!Ri;06< zh*^cfX>x`{sK94wE+!TRA=WyEPDVzlr_!6xNz7#59H{8aCeFph%)-DZ#9YTA$TgRd zi-m=Oi9v{^Y4SGp`Fc%^Ozd2|T&y55MxY=g2S1F<4B`q2b3KJ<0m^nvZq|4%-+|D= V2ohxE;Du^o1ZwHn+^P9M5&#KKH75W7 diff --git a/integration/simple/google/protobuf/timestamp.ts b/integration/simple/google/protobuf/timestamp.ts index bd8d8a974..240818407 100644 --- a/integration/simple/google/protobuf/timestamp.ts +++ b/integration/simple/google/protobuf/timestamp.ts @@ -56,7 +56,16 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * + * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() diff --git a/integration/simple/google/protobuf/wrappers.bin b/integration/simple/google/protobuf/wrappers.bin index 136184cf883f0b5338c4486eb7ee3d30735c2c52..1c3a982c95fd4b1add11db32f11cfd2f5f4fd90c 100644 GIT binary patch delta 21 ccmcbkct>%9Du%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% diff --git a/integration/simple/google/type/date.bin b/integration/simple/google/type/date.bin index a37fb502610bb10e654de248f4685fae31fd8d33..79b7489a478d8c39160305aeda937b750ffabd82 100644 GIT binary patch delta 14 VcmZ1`uuNcrEVG~l^F{?W4gei>11JCh delta 14 VcmZ1`uuNcrEHkeJ!$t)*4geiW10eta diff --git a/integration/simple/import_dir/thing.bin b/integration/simple/import_dir/thing.bin index 31e69afdf386926161c91df7214c398b9c60b0e9..777648ff4502757afb78a7feacbec6bb9ac73adf 100644 GIT binary patch delta 415 zcmeA$`eQsnmQzrIS&5ZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+j0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHUL_HFoK(GnqWqG4DGm;10YM37C5Ea-0j|mC48=DZ&yip{ZaDd( zL;+JP<76jE4P&G9{QPvFj`aMT#JqI9{GxPyu;!%FH2spwg4AOD?7aN)JpGc)+|=Td z#N2{{q{**2wKliCZADPwgigmrKgs-7UU;q1g9qF=cQ<9YQmL(jngYmE%8gt%P-b|Dh6>hCL3yq zGn!34r!2WSNyC>-f}4w(g@I9srJa#OkZUd@7Yhpm6N3;-_vB-G^YywJnb^5_xmZDB yKsDWr9Q-gYGl(lB%=Hwa1t>dl@?`zz@)HqS7(s%J9K291j6f|DH_tSfs009D*=_HFoK(GnqWqG4DGm;10bU7)jbb|`m@ey2z9><^SU1^OQiD-@ z@Tm)$JFF_YcGE3qt5A;B{bXi{E@9?)P7 z%>+FzE(H*PiYfp_6>MQVh#Kq3j@(k*3bqi1K(&*_`IQ5K3iZ-cOI!=`lQV)-lk@XZ zG&D8gO2B676{nW?CFbQ9Yd{r)I6zf;Nu`-NK;_n4K+9b#fZobURWO@8flqStT7F+P z32rWC76wKkmUc!CL9V%sTr4aMObkLS-IE2y=IeDcGO=^)3}6K352 delta 246 zcmdmNw%=re2nVkOgAzm4W&MdV1&nnQ`!sa4(=$slN|W@G^KEDS=dbqt-1j8adfH_LL&WZ%3%z?V&&i;J0sfl-LLjzf@ZE+ZEU3j-5_ z5KGf!R`L0IO^i(JT)bSYATdUuAR`AqjLQt-3JG&Pg=hiFc1*q`{#?ETp@k77$jHG9 P)xrqW(y{r5L^KlsL!vbw diff --git a/integration/type-registry/foo.bin b/integration/type-registry/foo.bin index 7413151deafa45dab1f51a3bfb7c3e2c52e96846..2365e5703dbf26cf9526ac32e9a9644e573f9d77 100644 GIT binary patch delta 432 zcmYL^Jx{_w0EX|{LdyX{O9Dtl8+9l#xkfZ3#xOGApfSdsqNNf`uc5`S-4H`!ES(&T zKftlS!8p2`Xk66YKcH7W^tSiC=Xo#pUH)93MX?qk*zOXS6a;}yi+OetTs*BJ|0gGV z8#~M;^sbb(vO$Pp>ewKrW*L}t4Rz!+do9&Hw{=H7w#ccay6ukcxLU`yo8Ie6>`_I$ z6qyIZK!n%PL>2~3=Z5eX3O{O} delta 260 zcmaE6^2tboi!&`hU$3Ajza(FZgM(RsSAs!_q3W{!M2P~%x`|yHI@;-(B^jkjddc~@ z`sw*OiFxVzVAV;bY5D~vl?AEA`X!mUsl_FUxdjuSYIEMykCk&A_efr&wgrD-yw_m)$JNF_YcYE3qt5A;B{bXi{E@9?)P7 z%>+FzE(H*PiYfp_6>MQVkebOq`Q$kvYJkcnOYkdO0!8)GQ%hV6@{==yQ|DHDtROL UAVEeBUZ@sEpq7b~pNjtj07E}wSO5S3 delta 245 zcmca^{Mc}UCEDS=dbqt-1j8adfH_LI%WZ%3{z?V&&i;J0sfl-LLjzf@ZE+ZEU3j-5_ z5KGf!Hu3p-O^i(JT)bSYATdUuAR`AqjLQt-3JG&Pg=hiFc1*r3{#?ETp@k77$jHG9 O)xrqW(lPm_#6JL2q&4jT diff --git a/integration/use-date-string/google/protobuf/timestamp.ts b/integration/use-date-string/google/protobuf/timestamp.ts index bd8d8a974..240818407 100644 --- a/integration/use-date-string/google/protobuf/timestamp.ts +++ b/integration/use-date-string/google/protobuf/timestamp.ts @@ -56,7 +56,16 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * + * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() diff --git a/integration/use-date-string/use-date-string.bin b/integration/use-date-string/use-date-string.bin index fade300b85ff59eff53f787afdb2518ba713c0d3..c51c02f87592c41627537ef1a43108b7839cb094 100644 GIT binary patch delta 399 zcmX?ScF1Ca42Pfuvl2tqal?r!1x&4s6Q^nz8>Q#xr{|>VrRV1)=B4Z97p3bL6y=xX zCzYn@msA#{7VBr{<(KE_mt^Lq7MCRE78E2+e5uWORG*7oh*geZ(q>u4J~kdtE>12c z4sIc46$a1A+u1_}@5yp8u`md+wKFnIVq}y$FS}WWVLPtVUu%uClV zD9SI%Pby8*FDR)jNG;Yc$;?eHE=kNSnD|kf^QJBryAZ1!L+55y#y&P4CoWDdCJt^P zW)%jf$@|$u1wKo2F|jZRvDPtkGBQd%mENq%F_V4s3ISg>aV{=q76wKk<~j~RuDOg{ zEG!I63_>hTlX=DG>oqYlv2*cqv4X@Hfr5-2{4g#vh$|$_^%SB7DBCglmiTk|4ulp) UkRT%mFH{R7P)o<=2NFrl0Cng#egFUf diff --git a/integration/use-date-true/google/protobuf/timestamp.ts b/integration/use-date-true/google/protobuf/timestamp.ts index bd8d8a974..240818407 100644 --- a/integration/use-date-true/google/protobuf/timestamp.ts +++ b/integration/use-date-true/google/protobuf/timestamp.ts @@ -56,7 +56,16 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * + * Example 6: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() diff --git a/integration/use-date-true/use-date-true.bin b/integration/use-date-true/use-date-true.bin index c83398b30547058b94094eccb93a47c0ca2df1ee..f1bb1698f3743cb2d1f964e11dc60bd48de5c204 100644 GIT binary patch delta 417 zcmX?Qw$EaM6sMpBvl2tqaYL@jd=d&1o&A|w87EHGFg8lh&ri=u)l1LMNz6;v%P&gT zFDS|{$xkXx(=VwkNG;aS&dV>)(=W-)O)V}-%q=KLn)qCs^Qb--yAZ1!!=%m9jD2i8 zo?M(VZEWdIfP*g8HwZyd`KRF{fH90>o zMMF~)t^{nHUU6!PUt(T?-0_dNdR0Xri^4yY}H}m_l zNpN#9voJ6Uv9vRC2y)G37FbuHeausk%^s)mx~o722|6{$iWZeGK086 m!dy=wT7a?>CqEH;Eliv28Ks^|Z&v1*$-a4+fG?Xk7Z)=N1EUag9fu&-Tt+Sy76v8; zA(p1e+~V`~ni!ebxp=u)L1K(RK}HUK7?&Bu6%yup3ef_T?U;N+{JDGwLJK2EkdcEI Ps)Z4#rDO9wi3DZ`; } return typeName; From bbe993f0634169036fa2a0cf205f5557005c8f3b Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Thu, 15 Jul 2021 18:46:33 -0500 Subject: [PATCH 2/3] Re-codegen. --- integration/angular/simple-message.bin | Bin 235 -> 235 bytes .../simple.bin | Bin 605 -> 605 bytes .../simple2.bin | Bin 301 -> 301 bytes integration/avoid-import-conflicts/simple.bin | Bin 577 -> 577 bytes .../avoid-import-conflicts/simple2.bin | Bin 273 -> 273 bytes integration/barrel-imports/bar.bin | Bin 258 -> 258 bytes integration/barrel-imports/foo.bin | Bin 527 -> 527 bytes .../batching-with-context/batching.bin | Bin 2067 -> 2067 bytes integration/batching/batching.bin | Bin 2067 -> 2067 bytes integration/bytes-as-base64/message.bin | Bin 181 -> 181 bytes integration/bytes-node/point.bin | Bin 175 -> 175 bytes integration/const-enum/const-enum.bin | Bin 497 -> 497 bytes .../generic-service-definitions/simple.bin | Bin 1232 -> 1232 bytes integration/global-this/global-this.bin | Bin 315 -> 315 bytes .../grpc-js/google/protobuf/timestamp.ts | 11 +-------- .../grpc-js/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/grpc-js/simple.bin | Bin 15887 -> 15636 bytes .../grpc-web-client-streaming/example.bin | Bin 3309 -> 3309 bytes integration/grpc-web-go-server/example.bin | Bin 3082 -> 3082 bytes .../example.bin | Bin 1443 -> 1443 bytes integration/grpc-web-no-streaming/example.bin | Bin 1443 -> 1443 bytes integration/grpc-web/example.bin | Bin 3050 -> 3050 bytes integration/lower-case-svc-methods/math.bin | Bin 792 -> 792 bytes .../meta-typings/google/protobuf/timestamp.ts | 21 +++++------------- .../meta-typings/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/meta-typings/google/type/date.bin | Bin 2086 -> 2086 bytes integration/meta-typings/import_dir/thing.bin | Bin 6652 -> 6408 bytes integration/meta-typings/simple.bin | Bin 21424 -> 21180 bytes integration/nestjs-metadata-grpc-js/hero.bin | Bin 1049 -> 1049 bytes .../nestjs-metadata-observables/hero.bin | Bin 1049 -> 1049 bytes .../nestjs-metadata-restparameters/hero.bin | Bin 1049 -> 1049 bytes integration/nestjs-metadata/hero.bin | Bin 1049 -> 1049 bytes integration/nestjs-restparameters/hero.bin | Bin 1049 -> 1049 bytes .../nestjs-simple-observables/hero.bin | Bin 1049 -> 1049 bytes .../nestjs-simple-restparameters/hero.bin | Bin 2821 -> 2814 bytes .../google/protobuf/timestamp.ts | 11 +-------- integration/nestjs-simple/hero.bin | Bin 10339 -> 10088 bytes .../no-proto-package/no-proto-package.bin | Bin 364 -> 364 bytes integration/oneof-properties/oneof.bin | Bin 1927 -> 1927 bytes integration/oneof-unions/oneof.bin | Bin 2224 -> 2224 bytes .../only-types-grpc-metadata.bin | Bin 518 -> 518 bytes integration/only-types/google/protobuf/any.ts | 7 ++---- .../only-types/google/protobuf/timestamp.ts | 11 +-------- integration/only-types/reservation.bin | Bin 12585 -> 12309 bytes integration/point/point.bin | Bin 437 -> 437 bytes integration/return-observable/observable.bin | Bin 463 -> 463 bytes .../simple-deprecated-fields/simple.bin | Bin 887 -> 887 bytes .../simple-esmodule-interop/simple.bin | Bin 1260 -> 1260 bytes .../google/protobuf/timestamp.ts | 11 +-------- .../google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/simple-long-string/simple.bin | Bin 12009 -> 11765 bytes .../simple-long/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/simple-long/simple.bin | Bin 6685 -> 6685 bytes .../google/protobuf/timestamp.ts | 11 +-------- .../google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes .../simple-optionals/import_dir/thing.bin | Bin 6652 -> 6408 bytes integration/simple-optionals/simple.bin | Bin 17257 -> 17013 bytes integration/simple-optionals/thing.bin | Bin 6630 -> 6386 bytes integration/simple-proto2/simple.bin | Bin 368 -> 368 bytes .../simple-snake/google/protobuf/timestamp.ts | 11 +-------- .../simple-snake/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/simple-snake/import_dir/thing.bin | Bin 6652 -> 6408 bytes integration/simple-snake/simple.bin | Bin 17257 -> 17013 bytes integration/simple-string-enums/simple.bin | Bin 595 -> 595 bytes .../google/protobuf/timestamp.ts | 11 +-------- .../google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes .../import_dir/thing.bin | Bin 6652 -> 6408 bytes .../simple-unrecognized-enum/simple.bin | Bin 17257 -> 17013 bytes .../simple/google/protobuf/timestamp.ts | 11 +-------- .../simple/google/protobuf/wrappers.bin | Bin 4316 -> 4316 bytes integration/simple/google/type/date.bin | Bin 2086 -> 2086 bytes integration/simple/import_dir/thing.bin | Bin 6652 -> 6408 bytes integration/simple/simple.bin | Bin 21534 -> 21290 bytes integration/type-registry/bar/bar.bin | Bin 6963 -> 6719 bytes integration/type-registry/foo.bin | Bin 6758 -> 6514 bytes .../google/protobuf/timestamp.ts | 11 +-------- integration/types-with-underscores/file.bin | Bin 253 -> 253 bytes .../google/protobuf/timestamp.ts | 11 +-------- integration/use-date-false/metadata.bin | Bin 6615 -> 6371 bytes .../google/protobuf/timestamp.ts | 11 +-------- .../use-date-string/use-date-string.bin | Bin 7234 -> 6990 bytes .../google/protobuf/timestamp.ts | 11 +-------- integration/use-date-true/use-date-true.bin | Bin 7230 -> 6986 bytes integration/vector-tile/vector_tile.bin | Bin 2942 -> 2942 bytes 84 files changed, 20 insertions(+), 140 deletions(-) diff --git a/integration/angular/simple-message.bin b/integration/angular/simple-message.bin index 21b89c308516484424853dd9cc8f1d726c1fb822..64f63ba7173ff55812da993a0cae0d3d440f70fa 100644 GIT binary patch delta 13 UcmaFO_?mHoG&8RR!$i5W03WIZC;$Ke delta 13 UcmaFO_?mHoG_#-t^F+C`03Xf-F8}}l diff --git a/integration/avoid-import-conflicts-types-only/simple.bin b/integration/avoid-import-conflicts-types-only/simple.bin index 648562b7669410ae580e83e4334aec77227372f0..3f79dd4fc22709d94aa3331d7ffb1928e6d98bbf 100644 GIT binary patch delta 31 mcmcc1a+gJni>EjEjw3cat2s5t)!$xs2MgSaL0}22D delta 14 VcmZ3>w3cat2(zFB^G0zoMgSa$0}%iK diff --git a/integration/avoid-import-conflicts/simple.bin b/integration/avoid-import-conflicts/simple.bin index ac820c21883baec1b0a6c8445929722f3de2741b..9ad985f0e854ef02848b9db733dcad0e7f62f04e 100644 GIT binary patch delta 31 mcmX@ea*#!gi>EjEjh($ delta 13 UcmbQpG?8h72(zFB^F;Aq02f;WoB#j- diff --git a/integration/barrel-imports/bar.bin b/integration/barrel-imports/bar.bin index 5e870abc46ef54c2022fd372ca0414fc3654afb1..a2a3871f30057c7466bc1be458a7d0afafe16271 100644 GIT binary patch delta 27 icmZo-YGM-R;!H{`(km#+FUgnU;9wTum0*}C{2l;Y#s<3p delta 27 icmZo-YGM-R;!H{`(km#+FUgnU;9wRIlwh7H{2l;Y>IT99 diff --git a/integration/barrel-imports/foo.bin b/integration/barrel-imports/foo.bin index 47ee411d838e237ad4d96a9c3c2bb452309a420e..9db00ed8db859ea3e33444c651fd2037fee94a11 100644 GIT binary patch delta 28 jcmeBY>1Pq<;!MlW*DEN>FUgnU;9wTum0;K?{D%<$Xmtk` delta 28 jcmeBY>1Pq<;!MlW*DEN>FUgnU;9wRIlwjT{{D%<$XrKoj diff --git a/integration/batching-with-context/batching.bin b/integration/batching-with-context/batching.bin index 0e8e853370a2cfd6a111be605c470225a26b55e8..ba1cfffc64d91268cc077178d54e5fbd5fc08eb5 100644 GIT binary patch delta 14 VcmbO%Fj-)NC^N4F!$yhU>;N3)1K$7u delta 14 VcmbO%Fj-)ND6^mh^G1o^>;N4Q1Lgn# diff --git a/integration/batching/batching.bin b/integration/batching/batching.bin index 0e8e853370a2cfd6a111be605c470225a26b55e8..ba1cfffc64d91268cc077178d54e5fbd5fc08eb5 100644 GIT binary patch delta 14 VcmbO%Fj-)NC^N4F!$yhU>;N3)1K$7u delta 14 VcmbO%Fj-)ND6^mh^G1o^>;N4Q1Lgn# diff --git a/integration/bytes-as-base64/message.bin b/integration/bytes-as-base64/message.bin index af5507d7e90153bc654e65e464984f1c9745fa13..cf9ea8f67b537a29a9d8912c1c1d678701240bb7 100644 GIT binary patch delta 13 UcmdnWxRr5&2s5t)!$k3U02(C&e*gdg delta 13 UcmdnWxRr5&2(zFB^F;A^02)aHh5!Hn diff --git a/integration/bytes-node/point.bin b/integration/bytes-node/point.bin index 0aa2ca53bd419db7a77e487cf398344faa6a6185..d7107177cba2dde002ce901e2b3fc404ed9d7446 100644 GIT binary patch delta 29 kcmZ3_xSmmzi@P8{Gp|IipeVm2Uy6f+S%6o9VWQ|P0DU(Hxc~qF delta 29 kcmZ3_xSmmzi@P8{Gp|IipeVm2Uy6f+SwK*Nd7|hn0DW5rzyJUM diff --git a/integration/const-enum/const-enum.bin b/integration/const-enum/const-enum.bin index 9ddd8074eb87adf0c0e469b4d6c73599777d0878..a72899a87471a0b01256304a5ba75b7e014cf8f4 100644 GIT binary patch delta 14 Vcmey!{E>NrI5V#V!$zs=i~uDA1X}NrIJ2Mx^G2!bi~uDr1Y!UH diff --git a/integration/generic-service-definitions/simple.bin b/integration/generic-service-definitions/simple.bin index 5962c62769252da8bc2b9293481899eb101fedab..1dfbabb0a36b782eea1da9c996ffa5a4e11a80f1 100644 GIT binary patch delta 31 mcmcb>d4W@mi>Ejd4W@mi>Ej%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% delta 21 ccmcbkct>%9Du>coLo#C+(OLC40fC2+5a#yUDlr*%UQr!2huh9 zDW?#lHb@(1NoHn6KBw z$i&XY%f$*3V+0B^a`3~r%pk6iFxOLv7NBg$WMReU@*M~*j37Zq4qm7hMxd6C&5}yr FqyhVVK-T~O delta 512 zcmbPI)n6mU#Z#P_Tac5gS5TB+k}t)ds$dJ_fz?d*5tZRqu!SfCs+=4sp&STQrk9>t;#!cOoDrOwoS&DX zp{WU10ya^vIJLwtF)zPZ1F9Ir0jknVD$UFRD!1kWTJ2f^^i)o&g4yPC5@~D_++55o z42(i7?Tj3PTyq(@SXdaC7=&25Cwt4!*Xw3vV&~%JVg-o-)pRp*@WZ&wAg+)w*HefV hpzOrS5(>}dCnB^kf&>{kc%fPtfm$YRmQ(yD4FFiQh6w-w diff --git a/integration/grpc-web-client-streaming/example.bin b/integration/grpc-web-client-streaming/example.bin index f3b6375cbca87d7646a6cadee98128cc768aa31e..acf7b83961f09492586b86ad14a05e9fb9087381 100644 GIT binary patch delta 14 VcmaDW`Brj*2s5t)!$$FIJOCz;1cLwo delta 14 VcmaDW`Brj*2(zFB^G5M&JOC!U1d0Fv diff --git a/integration/grpc-web-go-server/example.bin b/integration/grpc-web-go-server/example.bin index 3ad33b93bf0d53bacfcf455c64e00c4133f6683e..14d0868f91eafca73db8ac9faa2bc4552fd9c74e 100644 GIT binary patch delta 14 VcmeB@=#rQq!ptkduu=RoHvk-?1J?im delta 14 VcmeB@=#rQq!YnAkyixo!Hvk;Y1Kt1t diff --git a/integration/grpc-web-no-streaming-observable/example.bin b/integration/grpc-web-no-streaming-observable/example.bin index 4b52601f5c539bb58ca15e3014b860d7beae15d9..64c9054e5b896fb955f35b4230cc26bdb2136e41 100644 GIT binary patch delta 14 VcmZ3?y_kD~2s5t)!$$EQRsbC#1A+hm delta 14 VcmZ3?y_kD~2(zFB^G5L=RsbDL1Bn0t diff --git a/integration/grpc-web-no-streaming/example.bin b/integration/grpc-web-no-streaming/example.bin index 4b52601f5c539bb58ca15e3014b860d7beae15d9..64c9054e5b896fb955f35b4230cc26bdb2136e41 100644 GIT binary patch delta 14 VcmZ3?y_kD~2s5t)!$$EQRsbC#1A+hm delta 14 VcmZ3?y_kD~2(zFB^G5L=RsbDL1Bn0t diff --git a/integration/grpc-web/example.bin b/integration/grpc-web/example.bin index 519a2af884105c9c8c5b88570c45cd7af70fadad..bda1bef9bd43a9e143b93c4135354beadc999fe7 100644 GIT binary patch delta 14 VcmaDQ{z`m;2s5t)!$$GT+yEvE1a$xa delta 14 VcmaDQ{z`m;2(zFB^G5N@+yEvv1bhGh diff --git a/integration/lower-case-svc-methods/math.bin b/integration/lower-case-svc-methods/math.bin index 588e6998f8462ef420a8c1ff6e95a1fa83d9854e..85cc791a5aa0b31c105e7fef5a8d42cff6fcba5a 100644 GIT binary patch delta 29 kcmbQiHiJ!siz_#=Btx&DD8D3Mii3k$fLDTHqX-K#0CPVEp8x;= delta 29 kcmbQiHiJ!siz_#=Btx&DD8D3Mii3k$Kv05tqX-K#0CQ>vrT_o{ diff --git a/integration/meta-typings/google/protobuf/timestamp.ts b/integration/meta-typings/google/protobuf/timestamp.ts index 6a62cd6fd..89db90a99 100644 --- a/integration/meta-typings/google/protobuf/timestamp.ts +++ b/integration/meta-typings/google/protobuf/timestamp.ts @@ -57,16 +57,7 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() @@ -186,7 +177,7 @@ export const protoMetadata: ProtoMetadata = { javaPackage: 'com.google.protobuf', javaOuterClassname: 'TimestampProto', javaMultipleFiles: true, - goPackage: 'google.golang.org/protobuf/types/known/timestamppb', + goPackage: 'github.com/golang/protobuf/ptypes/timestamp', ccEnableArenas: true, objcClassPrefix: 'GPB', csharpNamespace: 'Google.Protobuf.WellKnownTypes', @@ -195,21 +186,21 @@ export const protoMetadata: ProtoMetadata = { location: [ { path: [4, 0], - span: [135, 0, 146, 1], + span: [126, 0, 137, 1], leadingDetachedComments: [], 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 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', }, { path: [4, 0, 2, 0], - span: [139, 2, 20], + span: [130, 2, 20], leadingDetachedComments: [], leadingComments: ' Represents seconds of UTC time since Unix epoch\n 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to\n 9999-12-31T23:59:59Z inclusive.\n', }, { path: [4, 0, 2, 1], - span: [145, 2, 18], + span: [136, 2, 18], leadingDetachedComments: [], leadingComments: ' Non-negative fractions of a second at nanosecond resolution. Negative\n second values with fractions must still have non-negative nanos values\n that count forward in time. Must be from 0 to 999,999,999\n inclusive.\n', diff --git a/integration/meta-typings/google/protobuf/wrappers.bin b/integration/meta-typings/google/protobuf/wrappers.bin index 1c3a982c95fd4b1add11db32f11cfd2f5f4fd90c..136184cf883f0b5338c4486eb7ee3d30735c2c52 100644 GIT binary patch delta 21 ccmcbkct>%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% delta 21 ccmcbkct>%9Du11JCh diff --git a/integration/meta-typings/import_dir/thing.bin b/integration/meta-typings/import_dir/thing.bin index 777648ff4502757afb78a7feacbec6bb9ac73adf..31e69afdf386926161c91df7214c398b9c60b0e9 100644 GIT binary patch delta 251 zcmexk++j39mXlY4L5ZR2vOd>j0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHULZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+=mMlmj);>_HFoK(GnqWqG4DGm;10bU7)jbb|`m@ey2z9><^SU1^OQiD-@ z@T_HFoK(GnqWqG4DGm;10YM37C5Ea-0j|mC48=DZ&yip{ZaDd( zL;+JP<76jE4P&G9{QPvFj`aMT#JqI9{GxPyu;!%FH2spwg4AOD?7aN)JpGc)+|=Td z#N2{{q{**2wKliCZADPwgigmrKgs-7UU;q1g9qF=cQ<9YQmL(jngYmE%8gt%P-b|Dh6>hCL3yq zGn!34r!2WSNyC>-f}4w(g@I9srJa#OkZUd@7Yhpm6N3;-_vB-G^YywJnb^5_xmZDB yKsDWr9Q-gYGl(lB%=Hwa1t>dl@?`zz@)HqS7(s%J9K291j6f|DH_tRsRssN+q-_2G diff --git a/integration/nestjs-metadata-grpc-js/hero.bin b/integration/nestjs-metadata-grpc-js/hero.bin index cef024802e293270d1c4a54aa67689f913804365..089060a585f5c9a15246efb6428f820c44b0ab62 100644 GIT binary patch delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$fLDTHqX;Vt0CXt^s{jB1 delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$Kv05tqX;Vt0CZFavH$=8 diff --git a/integration/nestjs-metadata-observables/hero.bin b/integration/nestjs-metadata-observables/hero.bin index cef024802e293270d1c4a54aa67689f913804365..089060a585f5c9a15246efb6428f820c44b0ab62 100644 GIT binary patch delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$fLDTHqX;Vt0CXt^s{jB1 delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$Kv05tqX;Vt0CZFavH$=8 diff --git a/integration/nestjs-metadata-restparameters/hero.bin b/integration/nestjs-metadata-restparameters/hero.bin index cef024802e293270d1c4a54aa67689f913804365..089060a585f5c9a15246efb6428f820c44b0ab62 100644 GIT binary patch delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$fLDTHqX;Vt0CXt^s{jB1 delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$Kv05tqX;Vt0CZFavH$=8 diff --git a/integration/nestjs-metadata/hero.bin b/integration/nestjs-metadata/hero.bin index cef024802e293270d1c4a54aa67689f913804365..089060a585f5c9a15246efb6428f820c44b0ab62 100644 GIT binary patch delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$fLDTHqX;Vt0CXt^s{jB1 delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$Kv05tqX;Vt0CZFavH$=8 diff --git a/integration/nestjs-restparameters/hero.bin b/integration/nestjs-restparameters/hero.bin index cef024802e293270d1c4a54aa67689f913804365..089060a585f5c9a15246efb6428f820c44b0ab62 100644 GIT binary patch delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$fLDTHqX;Vt0CXt^s{jB1 delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$Kv05tqX;Vt0CZFavH$=8 diff --git a/integration/nestjs-simple-observables/hero.bin b/integration/nestjs-simple-observables/hero.bin index cef024802e293270d1c4a54aa67689f913804365..089060a585f5c9a15246efb6428f820c44b0ab62 100644 GIT binary patch delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$fLDTHqX;Vt0CXt^s{jB1 delta 29 kcmbQqF_S}tiz_3wC||FjD8D3Mii3k$Kv05tqX;Vt0CZFavH$=8 diff --git a/integration/nestjs-simple-restparameters/hero.bin b/integration/nestjs-simple-restparameters/hero.bin index 709f8464cb82cb0cb0c09ff473a0de47ad474309..55e59e8717a255eea4acac8594997c809c77c10b 100644 GIT binary patch delta 106 zcmZn_`zI>J#g&m-l&@D%lwXoB#lgWWz$?L^#896s-N zrAd0p`MLV(`8kPs>H1(TNu_D}1tpaQsm1!Kxj@ForEA!D?6^3&m^iqFn3WmqHpjBB GUliv28Ks^|Z;lb1$-eo%q%WH|7Z)=N1EUag9fu&-Tt+Sy76v8; zA(p1eE(-JYni!ebxp=u)L1K(RK}HUK7?&Bu6%yup3ef_T?U*d6_*}jNp@k77$jHG9 P)xrqW(y>`w$%hR9$UjmS delta 511 zcma)%J4?e*7>3VDVw!v^+9(q1rKxsk5fU%hMLKqSspqmA{cRbej;nWU;SgI<`(Kw$Y3fPWBD&!nKZ#BZr(hhE;Z%EWA8Ei#<7z zfs?uweiG$^?Z^-2-)DgCBs4#x(5jr}ZZLh5Q**Qb?Cl+vtz*wDyKcdMoRZ%Rh$vm- z=q^}>Td^nKnU+L(+UVbkevSbrAVsWVbcb>5V=P#T-bdya%~Mm`%{#1<t2 on5TxNzK-NWsSH596=7AM4rz_J{};g_#8PiNf?325MiWcoFO`slw*UYD diff --git a/integration/no-proto-package/no-proto-package.bin b/integration/no-proto-package/no-proto-package.bin index 06e8a111a3b76772a904c53338e2f3f1451a314e..4dab2c70ee646f8b2a1e68bf5219223e924138ab 100644 GIT binary patch delta 14 VcmaFE^oD7IEHkeJ!$t)kMgSw51JD2f delta 14 VcmaFE^oD7IEVG~l^F{?9MgSwm1J?im diff --git a/integration/oneof-properties/oneof.bin b/integration/oneof-properties/oneof.bin index ec9d341cfe787cff97e43eb6fb2eed26d2dc7b2b..4755b5d36eccfefacc54e29b5cfa2669f55a100c 100644 GIT binary patch delta 30 lcmZqYZ|4`~;?B=Y%}>)SD9SI%m*U`H7T}d&*eF`W4gh_y2XO!Z delta 30 lcmZqYZ|4`~;?B=Y%}>)SD9SI%m*U`H77&zR-Y8nc4gh`I2Y3Jg diff --git a/integration/oneof-unions/oneof.bin b/integration/oneof-unions/oneof.bin index f7be100d928b4507db9d2c9901aa8db46684e1f1..45b7fdb4f24556df153dd165ad492e6e40d94257 100644 GIT binary patch delta 30 lcmdlWxIs{qi#tCrH9t+SpeVm2Uy6f+S%6o9VWa454giO}2k`&^ delta 30 lcmdlWxIs{qi#tCrH9t+SpeVm2Uy6f+SwK*Nd86oT4giPf2lxO0 diff --git a/integration/only-types-grpc-metadata/only-types-grpc-metadata.bin b/integration/only-types-grpc-metadata/only-types-grpc-metadata.bin index 1d80a96d221f415ee5a5b6fc3855c629ef9a58df..cf8fe7025853a37f2a6730e17faa6e16126d7382 100644 GIT binary patch delta 21 ccmZo;X=9n7%E2qapu|vhlX-%|M&F%`06Cro*8l(j delta 21 ccmZo;X=9n7${{Ghti(`tlX-%|M&F%`06F>v-T(jq diff --git a/integration/only-types/google/protobuf/any.ts b/integration/only-types/google/protobuf/any.ts index ade2721aa..04572d4fc 100644 --- a/integration/only-types/google/protobuf/any.ts +++ b/integration/only-types/google/protobuf/any.ts @@ -40,13 +40,10 @@ export const protobufPackage = 'google.protobuf'; * Example 4: Pack and unpack a message in Go * * foo := &pb.Foo{...} - * any, err := anypb.New(foo) - * if err != nil { - * ... - * } + * any, err := ptypes.MarshalAny(foo) * ... * foo := &pb.Foo{} - * if err := any.UnmarshalTo(foo); err != nil { + * if err := ptypes.UnmarshalAny(any, foo); err != nil { * ... * } * diff --git a/integration/only-types/google/protobuf/timestamp.ts b/integration/only-types/google/protobuf/timestamp.ts index c88251a53..3fd84b70a 100644 --- a/integration/only-types/google/protobuf/timestamp.ts +++ b/integration/only-types/google/protobuf/timestamp.ts @@ -53,16 +53,7 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() diff --git a/integration/only-types/reservation.bin b/integration/only-types/reservation.bin index fd75bd8480e48c465c2fedeb069750fd762a7c0c..b1301068264f4f5bb66e26246e85237387f120cc 100644 GIT binary patch delta 530 zcmZ3PG&Ny@1Us(;gAzm4fr;{IjQJDWl+;wyGfOf`lk}4FbM@2na}x8?^$UvfOY)OS z)AS2UDhpDJ^%L_dCtlUye4xd}F2pLwFl#d#VD@Sf*_*7l>rloyN$-!NtqP3KC=liZXHv!nn*Ju81gC zI9Ll%a^~c}qLI2Y8JXCjN*FOozMghSjHn4|{t1jzLZWb$GtegB*OhZST zaJZCY=B5^xB<2=O4iMMoyr~Nbo=$M^O#Uk?%HsqJA{7Rw$#Qa`0-vQJK~%@k2@ImA z(wkf4X0mT)SNCNT=i*{!0eXqKjzf@ZE+fp_O_OtU=j$~g`~dQG6C(#dlCPT>g@n1D eLbL#7J0@G|J(ur5XaRY<1J&Cdo9*>qF#-T~1bYSm delta 704 zcmbQ5urg_a1iPRFvl2tqgNgEKjAawslyr5{^YhblQuWgFa}x8?_413-^$UvfOY)OS z)AUO!3sQ^qv-9%H^Yjz*DhrY(p3~s`sl~-E#45)ycjNy`HXdg#PA(=6ZXsr62It8w z?4kUB1-O`47=&1B80IoEO1IJkJZSV4k} zKv70cK^T`A#1#?c3I}TeO3s;lS2R*@4kHsgR0$(UkdcEI#s%t_!zdt_#0K`Van*4{ zuF3g&3X@yJ{Fz!ACtnfMFf$@Dd`dENQ;SOya|;TRelRkE0_vzfB%mgN0&4PASy3KO zSYW9zcuxK%8!C8D793b??TieQfT49>c5}4cO!mniRM_-A^MI!1mFNKjUqdrNj|&oL zP*DY-sDiBmlA6i(s`8xBfK^bK9H*)r2vnn&o?7Bske{3poSK}Um!hEw3wuZmDCiZZ zmiQ&+3K!gVc00a_}R?P&cEHFxOLv7NG3J$*Q`~s$i@P8{Gp|IipeVm2Uy6f+S%6o9VWa2*MgWIN2k-y@ delta 30 lcmdnWyp>s$i@P8{Gp|IipeVm2Uy6f+SwK*Nd86n8MgWI&2loH~ diff --git a/integration/return-observable/observable.bin b/integration/return-observable/observable.bin index 8a42177f52bfb309763a41b176429ca86695610b..ef7e408dfa438a27ddfbdb7526067bd57552addd 100644 GIT binary patch delta 14 VcmX@le4crNI5V#V!$zsCi~u1^1N8s^ delta 14 VcmX@le4crNIJ2Mx^G2zyi~u2a1N;C0 diff --git a/integration/simple-deprecated-fields/simple.bin b/integration/simple-deprecated-fields/simple.bin index 6e2d774abaa9daedd9ab4b3d71cdce42a2cfcaed..1b5c2e157b11d067e58160621958063c08f2921b 100644 GIT binary patch delta 31 mcmey)_MJ_Pi>EjEjEjEj%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% delta 21 ccmcbkct>%9DuEj3kB!HPi<66qgIkDM zg~4fZhD4~qXK5}b76u{KI)+Y0MyaRLo6kwiWZxX9=*uR~#l_6Rz$nCA$05iymywHw zg@K7dh^1-rHud>>O^i(JT)bSYATdUuAR`AqjLQt-3JG&Pg=hiFc1&*8crM?8(8353 TWaQw5YGDLw>Db(Ej)(=W-)O)V}-%q=KLn*5wmoAanX z7rPLv9K)o|#{~P>cs#i{xtKV(g_uDgGjj05xXd7~ nkTBO%h!&vi#L4~Y&*di~v@n7M898{NS{Q*^CT^apk-!Q723={z diff --git a/integration/simple-long/google/protobuf/wrappers.bin b/integration/simple-long/google/protobuf/wrappers.bin index 1c3a982c95fd4b1add11db32f11cfd2f5f4fd90c..136184cf883f0b5338c4486eb7ee3d30735c2c52 100644 GIT binary patch delta 21 ccmcbkct>%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% delta 21 ccmcbkct>%9DuEjEj%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% delta 21 ccmcbkct>%9Duj0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHULZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+x`{sK94wE+!TRA=WyEPDVzlr_!6xNz7#59H{8aCeFph%)-DZ#9YTA$TgRd zi-m=Oi9v{^Y4SGp`Fc%^Ozd2|T&y55MxY=g2S1F<4B`q2b3KJ<0m^nvZq|4%-+|D= V2ohxE;Du^o1ZwHn+^P9M5&#KKH75W7 delta 420 zcmey`!uYa{QH+bHI5W2(CsnVYD8D3Mii3k$Kv05tqu5pfrsIZ_&k7VUwK7h&6Vxy^ zO3%+v2dYcY&q>Tn*UK+T*9U7!DoxWbsVqn>*3Zt%FVE92$;?eHE=kNSC`g+8oKc(e zs6H3F5UU)+q|L_!``CCqxj4C)IJkwFRTw-cCrE?}-jn5GVqp+sYiDGb#Kds$dJ_fz(W1DKF0nQ3F&q`GmZ( zB~Vl^J+;KOAU`=HI5jyxFGWLB6RreooL+HiiCj3lMkuQ*Xw3vV&~%JVg-o-)pRp*@WZ&w pAg+)w*HefVpzOrS{p!!{kc%fPtfm$YRo~rRc5&)D{YOMeO diff --git a/integration/simple-optionals/thing.bin b/integration/simple-optionals/thing.bin index 188b45a5849c0ef42dc90c4a87073867498bf787..450f74794d456b980eb8532d8113b3b4ccaed254 100644 GIT binary patch delta 262 zcmaE6{K-&?i@PKvGcR4QpeVm2Uy6f+S%6o9L5ZR2vi?M=0>-+DJsLXN>6s-NrAd0p z`MLV(`8kPs>H1*RNu_D}1tpaQsm1ywnYpROC5gEO6Q65y-qht{7h;uT=-e#L*vH1> z#Kp_*>AI4<{afO7roYU6vppO(k8vJrcJTdU^S>iijYtXU8G}&3JN0bO>0bxX>Mpz|LxKtP)IX5 zhz}r6c?NOx1w=tmcb~wU{?W62-}!yt;rx`pDiY$oPS-Y7r;j}>aU7k=7U&Id{ag+t zhq{4*uT*wSj7`f>O>F4|#eGwo;H|-_=3P04tDV{S!q&WQ&u~4x=Qyq4eLMA}Ay!PR zfpL_BqvS#Zr4YsOBE1C~;UjyTeJdi00b+6p!5Bj6r5K6aEnD5w&vm)kut}5csiasb zHC2SP)eJp3-FNK6^fdBvi diff --git a/integration/simple-proto2/simple.bin b/integration/simple-proto2/simple.bin index 624b4f62c200feeda5b8336a960ffb1b7e83c0c2..f84cd6216ecfae5c6d3bca15db6bfddee8c33be0 100644 GIT binary patch delta 31 mcmeys^npo?i>EjEj%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% delta 21 ccmcbkct>%9Duj0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHULZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+x`{sK94wE+!TRA=WyEPDVzlr_!6xNz7#59H{8aCeFph%)-DZ#9YTA$TgRd zi-m=Oi9v{^Y4SGp`Fc%^Ozd2|T&y55MxY=g2S1F<4B`q2b3KJ<0m^nvZq|4%-+|D= V2ohxE;Du^o1ZwHn+^P9M5&#KKH75W7 delta 420 zcmey`!uYa{QH+bHI5W2(CsnVYD8D3Mii3k$Kv05tqu5pfrsIZ_&k7VUwK7h&6Vxy^ zO3%+v2dYcY&q>Tn*UK+T*9U7!DoxWbsVqn>*3Zt%FVE92$;?eHE=kNSC`g+8oKc(e zs6H3F5UU)+q|L_!``CCqxj4C)IJkwFRTw-cCrE?}-jn5GVqp+sYiDGb#Kds$dJ_fz(W1DKF0nQ3F&q`GmZ( zB~Vl^J+;KOAU`=HI5jyxFGWLB6RreooL+HiiCj3lMkuQ*Xw3vV&~%JVg-o-)pRp*@WZ&w pAg+)w*HefVpzOrS{p!!{kc%fPtfm$YRo~rRc5&)D{YOMeO diff --git a/integration/simple-string-enums/simple.bin b/integration/simple-string-enums/simple.bin index c7520b729844ace59c71e17d2283e08d45471b67..e3a54581912f1631f05f2d94fcfbd84014acaa0b 100644 GIT binary patch delta 31 mcmcc2a+yVpi>EjEj%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% delta 21 ccmcbkct>%9Duj0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHULZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+x`{sK94wE+!TRA=WyEPDVzlr_!6xNz7#59H{8aCeFph%)-DZ#9YTA$TgRd zi-m=Oi9v{^Y4SGp`Fc%^Ozd2|T&y55MxY=g2S1F<4B`q2b3KJ<0m^nvZq|4%-+|D= V2ohxE;Du^o1ZwHn+^P9M5&#KKH75W7 delta 420 zcmey`!uYa{QH+bHI5W2(CsnVYD8D3Mii3k$Kv05tqu5pfrsIZ_&k7VUwK7h&6Vxy^ zO3%+v2dYcY&q>Tn*UK+T*9U7!DoxWbsVqn>*3Zt%FVE92$;?eHE=kNSC`g+8oKc(e zs6H3F5UU)+q|L_!``CCqxj4C)IJkwFRTw-cCrE?}-jn5GVqp+sYiDGb#Kds$dJ_fz(W1DKF0nQ3F&q`GmZ( zB~Vl^J+;KOAU`=HI5jyxFGWLB6RreooL+HiiCj3lMkuQ*Xw3vV&~%JVg-o-)pRp*@WZ&w pAg+)w*HefVpzOrS{p!!{kc%fPtfm$YRo~rRc5&)D{YOMeO diff --git a/integration/simple/google/protobuf/timestamp.ts b/integration/simple/google/protobuf/timestamp.ts index 240818407..bd8d8a974 100644 --- a/integration/simple/google/protobuf/timestamp.ts +++ b/integration/simple/google/protobuf/timestamp.ts @@ -56,16 +56,7 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() diff --git a/integration/simple/google/protobuf/wrappers.bin b/integration/simple/google/protobuf/wrappers.bin index 1c3a982c95fd4b1add11db32f11cfd2f5f4fd90c..136184cf883f0b5338c4486eb7ee3d30735c2c52 100644 GIT binary patch delta 21 ccmcbkct>%9DhICwgAzm4dc_F}8-4o)07{t#mH+?% delta 21 ccmcbkct>%9Du11JCh diff --git a/integration/simple/import_dir/thing.bin b/integration/simple/import_dir/thing.bin index 777648ff4502757afb78a7feacbec6bb9ac73adf..31e69afdf386926161c91df7214c398b9c60b0e9 100644 GIT binary patch delta 251 zcmexk++j39mXlY4L5ZR2vOd>j0ZE04ZvKpQ6Q^tFXs2hEWRxc9CFkerr|0J+=B4Ww z6y=xXCzYn@7nD>Mq!#O!Wag$8mn7yEO#GzHc~h5*U5HhVp>wkuV;>uj6Bj2J69=~t zvkHULZRxBB<7{-6cU%q!#OE=jE5@>6c{YrWThZ<`xtrO?;)zc~qZ^U5HhVVbW$f#y&P4 zPcBX_CJt^PW)%j{$vfCX1@FmnF|jZRv9&WYOk!k|Ixo9fmSZNnsaIlIqC$da9?+z` z5C8TsWoA!>liCM)nO2LeU)(o;)Z3-XgQf>V?8 z^HMZ4HQ`FY#_1KOmiQ&+_HFoK(GnqWqG4DGm;10bU7)jbb|`m@ey2z9><^SU1^OQiD-@ z@T_HFoK(GnqWqG4DGm;10YM37C5Ea-0j|mC48=DZ&yip{ZaDd( zL;+JP<76jE4P&G9{QPvFj`aMT#JqI9{GxPyu;!%FH2spwg4AOD?7aN)JpGc)+|=Td z#N2{{q{**2wKliCZADPwgigmrKgs-7UU;q1g9qF=cQ<9YQmL(jngYmE%8gt%P-b|Dh6>hCL3yq zGn!34r!2WSNyC>-f}4w(g@I9srJa#OkZUd@7Yhpm6N3;-_vB-G^YywJnb^5_xmZDB yKsDWr9Q-gYGl(lB%=Hwa1t>dl@?`zz@)HqS7(s%J9K291j6f|DH_tSfs009D*=EDS=dbqt-1j8adfH_LL&WZ%3%z?V&&i;J0sfl-LLjzf@ZE+ZEU3j-5_ z5KGf!R`L0IO^i(JT)bSYATdUuAR`AqjLQt-3JG&Pg=hiFc1*q`{#?ETp@k77$jHG9 P)xrqW(y{r5L^KlsL!vbw delta 419 zcmdmQve|5c2#25qvl2tqal?r+1x&4s6MHp`jneb;({obw((`i?^V0S5i_-NAitm)$JFF_YcGE3qt5A;B{bXi{E@9?)P7 z%>+FzE(H*PiYfp_6>MQVh#Kq3j@(k*3bqi1K(&*_`IQ5K3iZ-cOI!=`lQV)-lk@XZ zG&D8gO2B676{nW?CFbQ9Yd{r)I6zf;Nu`-NK;_n4K+9b#fZobURWO@8flqStT7F+P z32rWC76wKkmUc!CL9V%sTr4aMObkLS-IE2y=IeDcGO=^)3}6K352 diff --git a/integration/type-registry/foo.bin b/integration/type-registry/foo.bin index 2365e5703dbf26cf9526ac32e9a9644e573f9d77..7413151deafa45dab1f51a3bfb7c3e2c52e96846 100644 GIT binary patch delta 260 zcmaE6^2tboi!&`hU$3Ajza(FZgM(RsSAs!_q3W{!M2P~%x`|yHI@;-(B^jkjddc~@ z`sw*OiFxVzVAV;bY5D~vl?AEA`X!mUsl_FUxdjuSYIEMykCk&A_efr&wgrD-yw_ewKrW*L}t4Rz!+do9&Hw{=H7w#ccay6ukcxLU`yo8Ie6>`_I$ z6qyIZK!n%PL>2~3=Z5eX3O{O} diff --git a/integration/type-registry/google/protobuf/timestamp.ts b/integration/type-registry/google/protobuf/timestamp.ts index 1e352bc83..dfcb6fd3d 100644 --- a/integration/type-registry/google/protobuf/timestamp.ts +++ b/integration/type-registry/google/protobuf/timestamp.ts @@ -57,16 +57,7 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() diff --git a/integration/types-with-underscores/file.bin b/integration/types-with-underscores/file.bin index 665393a841628d3d641ca5a25bb7d23cedd4c234..54597d1ff61e00688ca9f014fd538cdcd81f4fc4 100644 GIT binary patch delta 28 jcmey%_?JEDS=dbqt-1j8adfH_LI%WZ%3{z?V&&i;J0sfl-LLjzf@ZE+ZEU3j-5_ z5KGf!Hu3p-O^i(JT)bSYATdUuAR`AqjLQt-3JG&Pg=hiFc1*r3{#?ETp@k77$jHG9 O)xrqW(lPm_#6JL2q&4jT delta 395 zcmaECc-?q{D2Jc~vl2tqal?tS1x&4s6Zm)$JNF_YcYE3qt5A;B{bXi{E@9?)P7 z%>+FzE(H*PiYfp_6>MQVkebOq`Q$kvYJkcnOYkdO0!8)GQ%hV6@{==yQ|DHDtROL UAVEeBUZ@sEpq7b~pNjtj07E}wSO5S3 diff --git a/integration/use-date-string/google/protobuf/timestamp.ts b/integration/use-date-string/google/protobuf/timestamp.ts index 240818407..bd8d8a974 100644 --- a/integration/use-date-string/google/protobuf/timestamp.ts +++ b/integration/use-date-string/google/protobuf/timestamp.ts @@ -56,16 +56,7 @@ export const protobufPackage = 'google.protobuf'; * .setNanos((int) ((millis % 1000) * 1000000)).build(); * * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * - * Example 6: Compute Timestamp from current time in Python. + * Example 5: Compute Timestamp from current time in Python. * * timestamp = Timestamp() * timestamp.GetCurrentTime() diff --git a/integration/use-date-string/use-date-string.bin b/integration/use-date-string/use-date-string.bin index c51c02f87592c41627537ef1a43108b7839cb094..fade300b85ff59eff53f787afdb2518ba713c0d3 100644 GIT binary patch delta 251 zcmX?Pan5Xl3@5JygAzm4Wqq#6Y?2BSUHuvBCQj4P(N51S$tX?IOU}>LPtVUu%uClV zD9SI%Pby8*FDR)jNG;Yc$;?eHE=kNSnD|kf^QJBryAZ1!L+55y#y&P4CoWDdCJt^P zW)%jf$@|$u1wKo2F|jZRvDPtkGBQd%mENq%F_V4s3ISg>aV{=q76wKk<~j~RuDOg{ zEG!I63_>hTlX=DG>oqYlv2*cqv4X@Hfr5-2{4g#vh$|$_^%SB7DBCglmiTk|4ulp) UkRT%mFH{R7P)o<=2NFrl0Cng#egFUf delta 399 zcmX?ScF1Ca42Pfuvl2tqal?r!1x&4s6Q^nz8>Q#xr{|>VrRV1)=B4Z97p3bL6y=xX zCzYn@msA#{7VBr{<(KE_mt^Lq7MCRE78E2+e5uWORG*7oh*geZ(q>u4J~kdtE>12c z4sIc46$a1A+u1_}@5yp8u`md+wKFnIVq}y$FS}WWVliv28Ks^|Z&v1*$-a4+fG?Xk7Z)=N1EUag9fu&-Tt+Sy76v8; zA(p1e+~V`~ni!ebxp=u)L1K(RK}HUK7?&Bu6%yup3ef_T?U;N+{JDGwLJK2EkdcEI Ps)Z4#rDO9wi3DZ)(=W-)O)V}-%q=KLn)qCs^Qb--yAZ1!!=%m9jD2i8 zo?M(VZEWdIfP*g8HwZyd`KRF{fH90>o zMMF~)t^{nHUU6!PUt(T?-0_dNdR0Xri^4yY}H}m_l zNpN#9voJ6Uv9vRC2y)G37FbuHeausk%^s)mx~o722|6{$iWZeGK086 m!dy=wT7a?>CqEH;E Date: Tue, 3 Aug 2021 16:29:52 -0700 Subject: [PATCH 3/3] don't generate clientStreaming methods for grpc-web --- ...-test.ts => client-stream-example-test.ts} | 13 +++++++++++-- ...ient-ts.ts => client-stream-example-ts.ts} | 3 +-- ...{example.bin => client-stream-example.bin} | Bin 3309 -> 3337 bytes ...mple.proto => client-stream-example.proto} | 0 .../{example.ts => client-stream-example.ts} | 6 ------ src/generate-grpc-web.ts | 17 +++++++++++------ src/generate-services.ts | 13 +++++++++++-- src/main.ts | 1 + 8 files changed, 35 insertions(+), 18 deletions(-) rename integration/grpc-web-client-streaming/{example-test.ts => client-stream-example-test.ts} (58%) rename integration/grpc-web-client-streaming/{client-ts.ts => client-stream-example-ts.ts} (93%) rename integration/grpc-web-client-streaming/{example.bin => client-stream-example.bin} (97%) rename integration/grpc-web-client-streaming/{example.proto => client-stream-example.proto} (100%) rename integration/grpc-web-client-streaming/{example.ts => client-stream-example.ts} (98%) diff --git a/integration/grpc-web-client-streaming/example-test.ts b/integration/grpc-web-client-streaming/client-stream-example-test.ts similarity index 58% rename from integration/grpc-web-client-streaming/example-test.ts rename to integration/grpc-web-client-streaming/client-stream-example-test.ts index ae6cff407..a4fba95d9 100644 --- a/integration/grpc-web-client-streaming/example-test.ts +++ b/integration/grpc-web-client-streaming/client-stream-example-test.ts @@ -1,4 +1,4 @@ -import { DashStateClientImpl } from './example'; +import { DashStateClientImpl } from './client-stream-example'; describe('grpc-web', () => { it('at least compiles', () => { @@ -19,5 +19,14 @@ describe('grpc-web', () => { const client = new DashStateClientImpl(rpc); const userSettings = client.UserSettings; userSettings({}); - }) + }); + it('checks that ChangeUserSettingsStream is undefined because client streaming', () => { + const rpc = { + unary: jest.fn(), + invoke: jest.fn(), + }; + const client = new DashStateClientImpl(rpc); + //@ts-expect-error ChangeUserSettingsStream + expect(client['ChangeUserSettingsStream']).toBeUndefined(); + }); }); diff --git a/integration/grpc-web-client-streaming/client-ts.ts b/integration/grpc-web-client-streaming/client-stream-example-ts.ts similarity index 93% rename from integration/grpc-web-client-streaming/client-ts.ts rename to integration/grpc-web-client-streaming/client-stream-example-ts.ts index ae92dfb69..57931eab6 100755 --- a/integration/grpc-web-client-streaming/client-ts.ts +++ b/integration/grpc-web-client-streaming/client-stream-example-ts.ts @@ -1,7 +1,7 @@ #!/usr/bin/env node import { NodeHttpTransport } from '@improbable-eng/grpc-web-node-http-transport'; -import { DashAPICredsClientImpl, DashStateClientImpl, GrpcWebImpl } from './example'; +import { DashAPICredsClientImpl, DashStateClientImpl, GrpcWebImpl } from './client-stream-example'; import { grpc } from '@improbable-eng/grpc-web'; const rpc = new GrpcWebImpl('http://localhost:9090', { @@ -35,7 +35,6 @@ async function main() { const obs = client.ActiveUserSettingsStream({}); await obs.forEach((value) => { console.log('Got', value); - client.ChangeUserSettingsStream({ id: String(Math.random()) }); }); } diff --git a/integration/grpc-web-client-streaming/example.bin b/integration/grpc-web-client-streaming/client-stream-example.bin similarity index 97% rename from integration/grpc-web-client-streaming/example.bin rename to integration/grpc-web-client-streaming/client-stream-example.bin index acf7b83961f09492586b86ad14a05e9fb9087381..eeaf6ee9039cd7a4ac4e76f078d04042b85539ac 100644 GIT binary patch delta 67 zcmaDW*(qhkC7qm;nVMIkTU=6, metadata?: grpc.Metadata): Promise; ActiveUserSettingsStream(request: DeepPartial, metadata?: grpc.Metadata): Observable; - ChangeUserSettingsStream(request: DeepPartial, metadata?: grpc.Metadata): Observable; } export class DashStateClientImpl implements DashState { @@ -547,7 +546,6 @@ export class DashStateClientImpl implements DashState { this.rpc = rpc; this.UserSettings = this.UserSettings.bind(this); this.ActiveUserSettingsStream = this.ActiveUserSettingsStream.bind(this); - this.ChangeUserSettingsStream = this.ChangeUserSettingsStream.bind(this); } UserSettings(request: DeepPartial, metadata?: grpc.Metadata): Promise { @@ -557,10 +555,6 @@ export class DashStateClientImpl implements DashState { ActiveUserSettingsStream(request: DeepPartial, metadata?: grpc.Metadata): Observable { return this.rpc.invoke(DashStateActiveUserSettingsStreamDesc, Empty.fromPartial(request), metadata); } - - ChangeUserSettingsStream(request: DeepPartial, metadata?: grpc.Metadata): Observable { - return this.rpc.invoke(DashStateChangeUserSettingsStreamDesc, Cred.fromPartial(request), metadata); - } } export const DashStateDesc = { diff --git a/src/generate-grpc-web.ts b/src/generate-grpc-web.ts index fb5bae222..637776ea0 100644 --- a/src/generate-grpc-web.ts +++ b/src/generate-grpc-web.ts @@ -26,20 +26,25 @@ export function generateGrpcClientImpl( // Create the constructor(rpc: Rpc) chunks.push(code` private readonly rpc: Rpc; - + constructor(rpc: Rpc) { `); chunks.push(code`this.rpc = rpc;`); // Bind each FooService method to the FooServiceImpl class for (const methodDesc of serviceDesc.method) { assertInstanceOf(methodDesc, FormattedMethodDescriptor); - chunks.push(code`this.${methodDesc.formattedName} = this.${methodDesc.formattedName}.bind(this);`); + if (!methodDesc.clientStreaming) { + chunks.push(code`this.${methodDesc.formattedName} = this.${methodDesc.formattedName}.bind(this);`); + } } chunks.push(code`}\n`); // Create a method for each FooService method for (const methodDesc of serviceDesc.method) { - chunks.push(generateRpcMethod(ctx, serviceDesc, methodDesc)); + // not supported by improbable-web + if (!methodDesc.clientStreaming) { + chunks.push(generateRpcMethod(ctx, serviceDesc, methodDesc)); + } } chunks.push(code`}`); @@ -196,7 +201,7 @@ function generateGrpcWebImpl(returnObservable: boolean, hasStreamingMethods: boo export class GrpcWebImpl { private host: string; private options: ${options}; - + constructor(host: string, options: ${options}) { this.host = host; this.options = options; @@ -281,7 +286,7 @@ function createObservableUnaryMethod(): Code { }, }); }).pipe(${take}(1)); - } + } `; } @@ -293,7 +298,7 @@ function createInvokeMethod() { metadata: grpc.Metadata | undefined ): ${Observable} { // Status Response Codes (https://developers.google.com/maps-booking/reference/grpc-api/status_codes) - const upStreamCodes = [2, 4, 8, 9, 10, 13, 14, 15]; + const upStreamCodes = [2, 4, 8, 9, 10, 13, 14, 15]; const DEFAULT_TIMEOUT_TIME: number = 3_000; const request = { ..._request, ...methodDesc.requestType }; const maybeCombinedMetadata = diff --git a/src/generate-services.ts b/src/generate-services.ts index f175ca177..0453cea1a 100644 --- a/src/generate-services.ts +++ b/src/generate-services.ts @@ -74,13 +74,18 @@ export function generateService( // Return observable for interface only configuration, passing returnObservable=true and methodDesc.serverStreaming=true let returnType: Code; + let hasDefinition = true; if (options.returnObservable || methodDesc.serverStreaming) { returnType = responseObservable(ctx, methodDesc); } else { returnType = responsePromise(ctx, methodDesc); } - - chunks.push(code`${methodDesc.formattedName}(${joinCode(params, { on: ',' })}): ${returnType};`); + if (methodDesc.clientStreaming && !ctx.options.nestJs) { + hasDefinition = false; + } + if (hasDefinition) { + chunks.push(code`${methodDesc.formattedName}(${joinCode(params, { on: ',' })}): ${returnType};`); + } // If this is a batch method, auto-generate the singular version of it if (options.context) { @@ -149,6 +154,10 @@ export function generateServiceClientImpl( chunks.push(code`private readonly rpc: ${rpcType};`); chunks.push(code`constructor(rpc: ${rpcType}) {`); chunks.push(code`this.rpc = rpc;`); + + const supportedServiceMethods = serviceDesc.method.filter((methodDesc) => + methodDesc.clientStreaming && !options.nestJs ? false : true + ); // Bind each FooService method to the FooServiceImpl class for (const methodDesc of serviceDesc.method) { assertInstanceOf(methodDesc, FormattedMethodDescriptor); diff --git a/src/main.ts b/src/main.ts index eaff669bf..02640118b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -165,6 +165,7 @@ export function generateFile(ctx: Context, fileDesc: FileDescriptorProto): [stri } let hasStreamingMethods = false; + let hasClientStreaming = false; visitServices(fileDesc, sourceInfo, (serviceDesc, sInfo) => { if (options.nestJs) {