Commit Graph

214 Commits

Author SHA1 Message Date
Stanley Cheung f516ccbf3c Removed some unused code 2020-06-04 15:31:04 -07:00
Stanley Cheung 721afdf958 Linter changes 2020-06-02 11:40:06 -07:00
Stanley Cheung de0f650a72 Generate the callback client and promise client in two different files 2020-06-01 19:08:30 -07:00
hanabi1224 825dd2a9ee add missing comma 2020-05-31 22:01:01 -07:00
hanabi1224 9d96b7a4b8 Avoid double slash in url when client hostname has tailing slash 2020-05-31 22:01:01 -07:00
Stanley Cheung 5c1b6c7060 Quote string keys 2020-04-30 15:01:47 -07:00
Stanley Cheung 5864e5dd80 Fix a bug in test: callback not properly intercepted 2020-04-30 15:01:47 -07:00
Stanley Cheung cc6cdfb428 Linter changes 2020-04-27 18:51:58 -07:00
Stanley Cheung b62d3629c2 grpc-web interceptors implementation 2020-04-27 17:32:56 -07:00
Tomi Äijö 289ec8020f Add missing separator to imports from external files 2020-04-08 16:37:59 -07:00
Stanley Cheung b0ea6a1e55 Some refactoring prework before interceptors 2020-04-07 23:31:33 -07:00
Stanley Cheung d2858c7440 Add .on(metadata,...) callback to distinguish initial metadata 2020-04-06 15:28:45 -07:00
Stanley Cheung eeb65e66f9 fix whitespace 2020-04-03 14:33:23 -07:00
Yannic Bonenberger 1bcdae540a Remove extra semicolon 2020-04-03 13:27:47 -07:00
Yannic Bonenberger 2badafa034 Fix compilation error 2020-04-03 13:27:47 -07:00
Yannic Bonenberger fe3617c511 [generator] Move options parsing into dedicated class
*** Note: There is no behavior change from this patch. ***
2020-04-03 13:27:47 -07:00
Stanley Cheung d2f9e0a1eb Add Status to UnaryResponse 2020-04-02 16:21:08 -07:00
Stanley Cheung cc5cbf6e40 Fix BUILD.bazel 2020-03-23 23:20:35 -07:00
Stanley Cheung 508f50a32e Update generic client 2020-03-23 23:20:35 -07:00
Stanley Cheung 40aeadef9a Some cleanup 2020-03-19 13:01:27 -07:00
IagoLast 87209cb94b Disable static checkers on generated js files 2020-03-19 01:06:03 -07:00
Florent Castelli b7fb330e3e Enable builder pattern in Typescript protobuf messages. 2020-03-18 23:41:06 -07:00
Yannic Bonenberger 40cbb49772 [bazel] Update rules_closure + fix linter warnings
Working towards resolving #744, #575, #550, #700
2020-03-18 22:56:59 -07:00
Florent Castelli 7f9f7e8e5a Generate Promise based overloads for unary calls in Typescript
Fixes #580
2020-03-18 21:26:13 -07:00
travikk 410ca10711 Added @override to address compiler issues 2020-03-18 18:38:41 -07:00
travikk ebb0ec6549 Added missing semicolons 2020-03-18 18:38:41 -07:00
travikk 4206f4a546 Allow GrpcWebStreamParser to accept Uint8Array 2020-03-18 18:38:41 -07:00
Stanley Cheung 69f23cb5cf Remove two unused goog.require 2020-01-22 11:55:42 -08:00
Holger Finger 764d5bcd18 fix bug that grpc-status response headers resulted in doubled execution of the callback provided to rpcCall. 2020-01-21 14:34:48 -08:00
Stanley Cheung d03435fc6e Do not hardcode CXX to g++ 2019-12-06 14:04:14 -08:00
Stanley Cheung 55ebde4719 Revert #683 2019-12-05 11:30:14 -08:00
travikk 5c65dc4a2c Pass raw buffer to stream parser 2019-12-02 13:22:36 -08:00
travikk 03b73fbe45 Optimise parsing incoming payload 2019-12-02 13:22:36 -08:00
Stanley Cheung 37636129a0 Fix bazel.build 2019-10-29 10:51:42 -07:00
Stanley Cheung a96b958120 Add metadata to error callback 2019-10-29 10:51:42 -07:00
Stanley Cheung 0f79fb4366 Revert "Add metadata in gRPC error"
This reverts commit fe2ea6b351.
2019-10-29 02:15:14 -07:00
A. Ishikawa fe2ea6b351 Add metadata in gRPC error 2019-10-29 01:03:38 -07:00
Stanley Cheung c22f57497b Remove unused require 2019-10-18 11:23:34 -07:00
Julien Roncaglia 401e54063c Ensure that the end callback is called
Previously the end callback was called by checking the state at the end of
the READY_STATE_CHANGE event. The problem with this approach is that there
are multiple early exit cases in this function and when they happen the
consumer is never informed of the end of the stream.

The new approach is to only dispatch the event when the COMPLETE event is
received (Except if an error is dispatched) so the last event is always
either 'error' or 'end').
2019-10-18 11:23:34 -07:00
Stanley Cheung ab6ff71786 Fix error callback 2019-10-16 11:13:18 -07:00
Stanley Cheung 06bda9256e Add CallOptions class 2019-09-30 15:40:48 -07:00
Stanley Cheung 2fa4270334 Fix generated code return type, and remove unused var 2019-09-18 13:10:53 -07:00
Stanley Cheung 8113edeeff Use nullptr instead 2019-09-09 15:34:04 -07:00
Alexey Smirnov 5ee2126d85 Fix output directory name when using import_style=typescript 2019-09-09 13:37:31 -07:00
Stanley Cheung ea4f1aa637 Added API for simple unary call 2019-09-09 13:19:11 -07:00
Harman Gakhal 1711674d66 Return specific grpc status code on http error 2019-08-23 16:10:03 -07:00
Stanley Cheung 9365fd62fc WIP: Generate method descriptors into multiple files 2019-08-22 10:49:30 -07:00
Stanley Cheung ab906036ea Add support in code generator for printing only method descriptors 2019-08-20 12:58:50 -07:00
Stanley Cheung 6a3b282fb0 Remove internal frameworks mode 2019-08-17 00:19:50 -07:00
Stanley Cheung e2f999a0df Some linter formatting changes 2019-08-05 14:39:48 -07:00
Stanley Cheung 36598a2ab1 Fixed semicolons 2019-08-03 00:09:53 -07:00
Stanley Cheung 3b76ca5810 Fix status and error callbacks 2019-08-03 00:09:53 -07:00
Stanley Cheung 8b501a96f4 Remove trailing whitespace; 2019-07-31 17:42:43 -07:00
Stanley Cheung 365783307e Add option to set withCredentials to true 2019-07-31 16:53:50 -07:00
Stanley Cheung 2ae8118d78 Adding some groundwork for generic client 2019-07-31 16:22:41 -07:00
lqs ab242d2bb9 fix wrong package name of input type 2019-07-30 17:51:33 -07:00
Markus Padourek db6cd68df9 Add missing newline 2019-07-01 11:16:08 -07:00
Markus Padourek 10828d7ccc Ensure credentials are not undefined in typescript
Fixes #581
2019-07-01 11:16:08 -07:00
Ben Foxall 0c24e95a38 Uppercase enum keys
To match the generated JS
2019-07-01 10:38:09 -07:00
Stanley Cheung d16364954a Make MethodType a separate class 2019-06-06 15:39:50 -07:00
Stanley Cheung cee964f746 Fix missing bazel def 2019-06-06 15:39:50 -07:00
Stanley Cheung a8e54b3885 Introducing MethodDescriptor 2019-06-06 15:39:50 -07:00
Henke Adolfsson 968b3d2bb2 Default to no grpc-timeout header when timeout is Infinity 2019-05-19 23:09:38 -07:00
Henke Adolfsson 9e666831d1 Use precalculated number for Infinity 2019-05-19 23:09:38 -07:00
Henke Adolfsson 81426015b3 Remove a isFinite that was already checked for 2019-05-19 23:09:38 -07:00
Henke Adolfsson d7fac321b6 Add fix for timeout of strings, NaN, Infinity and -Infinity 2019-05-19 23:09:38 -07:00
Stanley Cheung 671255e706 Adding new fields to MethodInfo 2019-05-13 11:22:06 -07:00
Stanley Cheung 15351a0401 Changes to deserializeBinary API; 2019-04-28 22:59:53 -07:00
Jian Yang ffe8e9c903 remove duplicated has$field$ method for oneof 2019-03-28 15:25:03 -07:00
Jonah Dahlquist aadfb92bdb Made constructor arguments `credentials` and `options` optional
Currently the TypeScript generated clients require that `null` be passed to `credentials` and `options` if they're not being used.  It's easier to simply make those arguments optional.  I've left the `null` portion of the type though to maintain backwards compatibility.
2019-03-26 10:43:36 -07:00
Quentin f9bfe720b5 Remove a return that skip emission of end callback
When the connection is closed and there isn't any message sent, the end callback was not called.

Should fix #289, #384 and #467
2019-03-19 18:17:12 -07:00
Yannic Bonenberger cb3499c967 [bazel] Migrate protobuf info provider to new-style one 2019-03-18 10:40:06 -07:00
Stanley Cheung 5852e276e0 fix compiler warning 2019-03-01 13:22:03 -08:00
Zbigniew Mandziejewicz 626ce9702b feature: Typings codegen for bytes field type 2019-02-27 11:31:58 -08:00
Stanley Cheung 459487e050 Add module alias to enums. Fixes #454 2019-02-27 09:45:54 -08:00
Stanley Cheung c0d3a1d0e5 Fix long line 2019-02-26 15:58:24 -08:00
Jian Yang cfe789f4f0 add typescript definition for Oneof fields 2019-02-26 15:25:39 -08:00
Stanley Cheung 84e0ea356e Linter clean up 2019-02-25 22:52:48 -08:00
Zbigniew Mandziejewicz 95aba7c4d2 fix: Prefix reserved fields in AsObject 2019-02-25 22:13:08 -08:00
Zbigniew Mandziejewicz 3c869187d0 refactor: add methods for element type/name 2019-02-25 22:13:08 -08:00
Zbigniew Mandziejewicz 514edc7e27 fix: support jstype option, fix skipping map entry 2019-02-25 22:13:08 -08:00
Zbigniew Mandziejewicz 194c97e650 fix: exclude map entry message from typings, fix optional values 2019-02-25 22:13:08 -08:00
Stanley Cheung 5a296841ce Code sync 2019-02-22 00:15:36 -08:00
Stanley Cheung cc7dca23a2 Code sync 2019-02-21 16:02:32 -08:00
Stanley Cheung d139a6ad99 Code sync 2019-02-20 22:03:48 -08:00
Zbigniew Mandziejewicz 73358722d8 Export Map types correctly, optional getter/setters for message types 2019-02-01 12:31:35 -08:00
Stanley Cheung 30f8b0e183
Fix typo 2019-02-01 10:35:12 -08:00
Zbigniew Mandziejewicz 347cea046c feature: Messages in typings extending jspb.Message, add missing generated methods 2019-01-30 10:52:16 -08:00
Zbigniew Mandziejewicz 01ed7060f6 Generate typings for protobuf files when no services are present 2019-01-15 10:53:52 -08:00
Zbigniew Mandziejewicz 4feb57a913 Import only messages used by service in grpc-web typings file 2019-01-15 10:53:52 -08:00
Zbigniew Mandziejewicz 8d7e89d34e Match name nesting and imports in .d.ts with .js files 2019-01-15 10:53:52 -08:00
Jimmy Au bb3624ea8d Enable ADVANCED_OPTIMIZATIONS in Closure Compiler 2019-01-09 11:40:36 -08:00
rogchap c2536577a6 Promise function should use ES5 functions rather than fat arrows 2019-01-08 14:58:59 -08:00
Zbigniew Mandziejewicz 68eeabaf89 Fix kokoro warning for status details 2019-01-08 10:12:08 -08:00
Zbigniew Mandziejewicz bca630832e Emit status event on empty stream response 2019-01-08 10:12:08 -08:00
Johan Brandhorst f181d1efae Simplify ToCamelCase 2019-01-07 16:03:43 -08:00
Johan Brandhorst 3d280c34be Use camelCase in AsObject definition
Fixes #428
2019-01-07 16:03:43 -08:00
Ben Picolo 09604c4837 Fix metadata typings for TS client 2018-12-14 13:56:49 -08:00
Roger Chapman 1bbfb214c5 Generate Typescript definition for top level Enums (#404)
* Generate Typescript definition for top level Enums
* Export the top level enums that are use in the messages
* Add test to check compile of typescript
2018-12-06 21:25:05 -08:00
Daniel Bader d8a828a92a fix ?Object 2018-11-29 14:12:27 -08:00